31 #include <TParticle.h> 32 #include <TParticlePDG.h> 39 #include <TDatabasePDG.h> 42 #include <AliAnalysisDataSlot.h> 43 #include <AliAnalysisDataContainer.h> 44 #include "AliMCEvent.h" 45 #include "AliAnalysisManager.h" 46 #include "AliAODMCHeader.h" 47 #include "AliAODHandler.h" 49 #include "AliAODVertex.h" 50 #include "AliAODRecoDecay.h" 54 #include "AliESDtrack.h" 55 #include "AliAODTrack.h" 57 #include "AliAODMCParticle.h" 58 #include "AliAnalysisTaskSE.h" 62 #include "AliPIDResponse.h" 63 #include "AliPIDCombined.h" 64 #include "AliTOFPIDResponse.h" 65 #include "AliInputEventHandler.h" 67 #include "AliKFParticle.h" 68 #include "AliKFVertex.h" 69 #include "AliExternalTrackParam.h" 70 #include "AliESDUtils.h" 88 fIsK0sAnalysis(kFALSE),
96 fUseOnTheFlyV0(kFALSE),
97 fIsEventSelected(kFALSE),
100 fCandidateVariables(),
105 fFillOnlySgn(kFALSE),
106 fHistoLcBeforeCuts(0),
107 fHistoFiducialAcceptance(0),
110 fHistoLcpKpiBeforeCuts(0),
113 fHistoDistanceLcToPrimVtx(0),
114 fHistoDistanceV0ToPrimVtx(0),
115 fHistoDistanceV0ToLc(0),
117 fHistoDistanceLcToPrimVtxSgn(0),
118 fHistoDistanceV0ToPrimVtxSgn(0),
119 fHistoDistanceV0ToLcSgn(0),
121 fHistoVtxLcResidualToPrimVtx(0),
122 fHistoVtxV0ResidualToPrimVtx(0),
123 fHistoVtxV0ResidualToLc(0),
126 fHistoDecayLengthV0All(0),
127 fHistoLifeTimeV0All(0),
130 fHistoDecayLengthV0True(0),
131 fHistoLifeTimeV0True(0),
133 fHistoMassV0TrueFromAOD(0),
135 fHistoMassV0TrueK0S(0),
136 fHistoDecayLengthV0TrueK0S(0),
137 fHistoLifeTimeV0TrueK0S(0),
139 fHistoMassV0TrueK0SFromAOD(0),
142 fHistoDecayLengthLcAll(0),
143 fHistoLifeTimeLcAll(0),
146 fHistoDecayLengthLcTrue(0),
147 fHistoLifeTimeLcTrue(0),
149 fHistoMassLcTrueFromAOD(0),
151 fHistoMassV0fromLcAll(0),
152 fHistoDecayLengthV0fromLcAll(0),
153 fHistoLifeTimeV0fromLcAll(0),
155 fHistoMassV0fromLcTrue(0),
156 fHistoDecayLengthV0fromLcTrue(0),
157 fHistoLifeTimeV0fromLcTrue(0),
160 fHistoMassLcSgnFromAOD(0),
161 fHistoDecayLengthLcSgn(0),
162 fHistoLifeTimeLcSgn(0),
164 fHistoMassV0fromLcSgn(0),
165 fHistoDecayLengthV0fromLcSgn(0),
166 fHistoLifeTimeV0fromLcSgn(0),
173 fHistoDecayLengthKFV0(0),
174 fHistoLifeTimeKFV0(0),
177 fHistoDecayLengthKFLc(0),
178 fHistoLifeTimeKFLc(0),
180 fHistoArmenterosPodolanskiV0KF(0),
181 fHistoArmenterosPodolanskiV0KFSgn(0),
182 fHistoArmenterosPodolanskiV0AOD(0),
183 fHistoArmenterosPodolanskiV0AODSgn(0),
187 ftopoConstraint(kTRUE),
188 fCallKFVertexing(kFALSE),
189 fKeepingOnlyHIJINGBkg(kFALSE),
192 fCutKFChi2NDF(999999.),
193 fCutKFDeviationFromVtx(999999.),
194 fCutKFDeviationFromVtxV0(0.),
197 fKeepingOnlyPYTHIABkg(kFALSE),
198 fHistoMCLcK0SpGen(0),
199 fHistoMCLcK0SpGenAcc(0),
200 fHistoMCLcK0SpGenLimAcc(0),
202 fFuncWeightPythia(0),
203 fFuncWeightFONLL5overLHC13d3(0),
204 fFuncWeightFONLL5overLHC13d3Lc(0),
205 fAnalysisType(kpPb2013),
208 fListMultiplicityHistograms(0),
210 fHistNtrCorrVsZvtx(0),
211 fHistNtrUnCorrEvSel(0),
212 fHistNtrUnCorrEvWithCand(0),
213 fHistNtrCorrEvSel(0),
214 fHistNtrCorrEvWithCand(0),
217 fCounterCandidates(0)
369 Info(
"AliAnalysisTaskSELc2V0bachelorTMVA",
"Calling Constructor");
372 DefineOutput(1, TList::Class());
373 DefineOutput(2, TList::Class());
374 DefineOutput(3, TList::Class());
375 DefineOutput(4, TTree::Class());
376 DefineOutput(5, TTree::Class());
377 DefineOutput(6, TList::Class());
378 DefineOutput(7, TList::Class());
379 DefineOutput(8, TList::Class());
380 DefineOutput(9, TList::Class());
389 Info(
"~AliAnalysisTaskSELc2V0bachelorTMVA",
"Calling Destructor");
465 if (fDebug > 1) AliInfo(
"Init");
485 case kpPb2013: period[0] =
"LHC13b"; period[1] =
"LHC13c";
break;
486 case kpPb2016: period[0] =
"LHC16qtbunch1"; period[1] =
"LHC16qtbunch2"; period[2] =
"LHC16qtbunch3"; period[3] =
"LHC16qtbunch4"; nProfiles = 4;
break;
487 case kpp2016: period[0] =
"LHC16j"; period[1] =
"LHC16k"; period[2] =
"LHC16l"; nProfiles = 3;
break;
488 case kpp2010: period[0] =
"LHC10b"; period[1] =
"LHC10c"; period[2] =
"LHC10d"; period[3] =
"LHC10e"; nProfiles = 4;
break;
492 for (
Int_t i = 0; i < nProfiles; i++) {
495 hprof->SetName(Form(
"ProfileTrxVsZvtx%s\n",period[i].
Data()));
514 AliInfo(
"Terminate");
515 AliAnalysisTaskSE::Terminate();
519 AliError(
"fOutput not available");
528 AliInfo(Form(
"At MC level, %f Lc --> K0S + p were found",
fHistoMCLcK0SpGen->GetEntries()));
530 AliInfo(
"fHistoMCLcK0SpGen not available");
533 AliInfo(Form(
"At MC level, %f Lc --> K0S + p were found in the acceptance",
fHistoMCLcK0SpGenAcc->GetEntries()));
535 AliInfo(
"fHistoMCLcK0SpGenAcc not available");
538 AliInfo(Form(
"At Reco level, %lld Lc --> K0S + p were found",
fVariablesTreeSgn->GetEntries()));
540 AliInfo(
"fVariablesTreeSgn not available");
545 AliError(
"fOutputKF not available");
555 AliInfo(Form(
"CreateOutputObjects of task %s\n", GetName()));
564 const char* nameoutput = GetOutputSlot(1)->GetContainer()->GetName();
577 fCandidateVariableNames[0]=
"massLc2K0Sp";
578 fCandidateVariableNames[1]=
"massLc2Lambdapi";
579 fCandidateVariableNames[2]=
"massK0S";
580 fCandidateVariableNames[3]=
"massLambda";
581 fCandidateVariableNames[4]=
"massLambdaBar";
582 fCandidateVariableNames[5]=
"cosPAK0S";
583 fCandidateVariableNames[6]=
"dcaV0";
584 fCandidateVariableNames[7]=
"tImpParBach";
585 fCandidateVariableNames[8]=
"tImpParV0";
586 fCandidateVariableNames[9]=
"nSigmaTPCpr";
587 fCandidateVariableNames[10]=
"nSigmaTOFpr";
588 fCandidateVariableNames[11]=
"bachelorPt";
589 fCandidateVariableNames[12]=
"V0positivePt";
590 fCandidateVariableNames[13]=
"V0negativePt";
591 fCandidateVariableNames[14]=
"dcaV0pos";
592 fCandidateVariableNames[15]=
"dcaV0neg";
593 fCandidateVariableNames[16]=
"v0Pt";
594 fCandidateVariableNames[17]=
"massGamma";
595 fCandidateVariableNames[18]=
"LcPt";
596 fCandidateVariableNames[19]=
"combinedProtonProb";
597 fCandidateVariableNames[20]=
"LcEta";
598 fCandidateVariableNames[21]=
"V0positiveEta";
599 fCandidateVariableNames[22]=
"V0negativeEta";
600 fCandidateVariableNames[23]=
"TPCProtonProb";
601 fCandidateVariableNames[24]=
"TOFProtonProb";
602 fCandidateVariableNames[25]=
"bachelorEta";
603 fCandidateVariableNames[26]=
"LcP";
604 fCandidateVariableNames[27]=
"bachelorP";
605 fCandidateVariableNames[28]=
"v0P";
606 fCandidateVariableNames[29]=
"V0positiveP";
607 fCandidateVariableNames[30]=
"V0negativeP";
608 fCandidateVariableNames[31]=
"v0Eta";
609 fCandidateVariableNames[32]=
"DecayLengthLc";
610 fCandidateVariableNames[33]=
"DecayLengthK0S";
611 fCandidateVariableNames[34]=
"CtLc";
612 fCandidateVariableNames[35]=
"CtK0S";
613 fCandidateVariableNames[36]=
"bachCode";
614 fCandidateVariableNames[37]=
"k0SCode";
615 fCandidateVariableNames[38]=
"alphaArm";
616 fCandidateVariableNames[39]=
"ptArm";
617 fCandidateVariableNames[40]=
"CosThetaStar";
618 fCandidateVariableNames[41]=
"weightPtFlat";
619 fCandidateVariableNames[42]=
"weightFONLL5overLHC13d3";
620 fCandidateVariableNames[43]=
"weightFONLL5overLHC13d3Lc";
621 fCandidateVariableNames[44]=
"weightNch";
622 fCandidateVariableNames[45]=
"NtrkRaw";
623 fCandidateVariableNames[46]=
"NtrkCorr";
683 fCandidateVariableNames[0]=
"massLc2K0Sp";
684 fCandidateVariableNames[1]=
"massLc2Lambdapi";
685 fCandidateVariableNames[2]=
"massK0S";
686 fCandidateVariableNames[3]=
"massLambda";
687 fCandidateVariableNames[4]=
"massLambdaBar";
688 fCandidateVariableNames[5]=
"cosPAK0S";
689 fCandidateVariableNames[6]=
"dcaV0";
690 fCandidateVariableNames[7]=
"tImpParBach";
691 fCandidateVariableNames[8]=
"tImpParV0";
692 fCandidateVariableNames[9]=
"nSigmaTPCpr";
693 fCandidateVariableNames[10]=
"nSigmaTOFpr";
694 fCandidateVariableNames[11]=
"bachelorPt";
695 fCandidateVariableNames[12]=
"V0positivePt";
696 fCandidateVariableNames[13]=
"V0negativePt";
697 fCandidateVariableNames[14]=
"dcaV0pos";
698 fCandidateVariableNames[15]=
"dcaV0neg";
699 fCandidateVariableNames[16]=
"v0Pt";
700 fCandidateVariableNames[17]=
"massGamma";
701 fCandidateVariableNames[18]=
"LcPt";
702 fCandidateVariableNames[19]=
"combinedProtonProb";
703 fCandidateVariableNames[20]=
"V0positiveEta";
704 fCandidateVariableNames[21]=
"V0negativeEta";
705 fCandidateVariableNames[22]=
"bachelorEta";
706 fCandidateVariableNames[23]=
"v0P";
707 fCandidateVariableNames[24]=
"DecayLengthK0S";
708 fCandidateVariableNames[25]=
"CtK0S";
709 fCandidateVariableNames[26]=
"alphaArm";
710 fCandidateVariableNames[27]=
"ptArm";
711 fCandidateVariableNames[28]=
"NtrkRaw";
712 fCandidateVariableNames[29]=
"NtrkCorr";
721 fHistoEvents =
new TH1F(
"fHistoEvents",
"fHistoEvents", 2, -0.5, 1.5);
722 TString labelEv[2] = {
"NotSelected",
"Selected"};
727 fHistoLc =
new TH1F(
"fHistoLc",
"fHistoLc", 2, -0.5, 1.5);
729 fHistoLcOnTheFly =
new TH1F(
"fHistoLcOnTheFly",
"fHistoLcOnTheFly", 4, -0.5, 3.5);
730 TString labelOnTheFly[4] = {
"OnTheFly-Bkg",
"OfflineBkg",
"OnTheFly-Sgn",
"OfflineSgn"};
735 fHistoLcBeforeCuts =
new TH1F(
"fHistoLcBeforeCuts",
"fHistoLcBeforeCuts", 2, -0.5, 1.5);
736 TString labelBeforeCuts[2] = {
"Bkg",
"Sgn"};
739 fHistoLc->GetXaxis()->SetBinLabel(ibin, labelBeforeCuts[ibin-1].
Data());
743 TString labelAcc[4] = {
"NotOk-Bkg",
"Ok-Bkg",
"NotOk-Sgn",
"Ok-Sgn"};
748 fHistoCodesSgn =
new TH2F(
"fHistoCodesSgn",
"fHistoCodes for Signal; bachelor; K0S", 7, -1.5, 5.5, 9, -1.5, 7.5);
749 fHistoCodesBkg =
new TH2F(
"fHistoCodesBkg",
"fHistoCodes for Background; bachelor; K0S", 7, -1.5, 5.5, 9, -1.5, 7.5);
751 TString labelx[7] = {
"kBachInvalid",
"kBachFake",
"kBachNoProton",
"kBachPrimary",
"kBachNoLambdaMother",
752 "kBachDifferentLambdaMother",
"kBachCorrectLambdaMother"};
753 TString labely[9] = {
"kK0SInvalid",
"kK0SFake",
"kK0SNoK0S",
"kK0SWithoutMother",
"kK0SNotFromK0",
754 "kK0Primary",
"kK0NoLambdaMother",
"kK0DifferentLambdaMother",
"kK0CorrectLambdaMother"};
770 fHistoBackground =
new TH1F(
"fHistoBackground",
"fHistoBackground", 4, -0.5, 3.5);
771 TString labelBkg[4] = {
"Injected",
"Non-injected",
"Non-PYTHIA",
"PYTHIA"};
779 const Float_t ptbins[15] = {0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 12., 17., 25., 35.};
781 fHistoMCLcK0SpGen =
new TH1F(
"fHistoMCLcK0SpGen",
"fHistoMCLcK0SpGen", 14, ptbins);
802 AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
820 fPIDCombined->SetDetectorMask(AliPIDResponse::kDetTPC+AliPIDResponse::kDetTOF);
848 Int_t nMultBins = 375;
853 fHistNtrVsZvtx =
new TH2F(
"hNtrVsZvtx",
"Ntrk10 vs VtxZ; VtxZ;N_{trk};",300,-15,15,nMultBins,firstMultBin,lastMultBin);
854 fHistNtrCorrVsZvtx =
new TH2F(
"hNtrCorrVsZvtx",
"Ntrk10 vs VtxZ; VtxZ;N_{trk};",300,-15,15,nMultBins,firstMultBin,lastMultBin);
856 fHistNtrUnCorrEvSel =
new TH1F(
"hNtrUnCorrEvSel",
"Uncorrected Ntrk multiplicity for selected events; Ntrk ; Entries",nMultBins,firstMultBin,lastMultBin);
857 fHistNtrUnCorrEvWithCand =
new TH1F(
"hNtrUnCorrEvWithCand",
"Uncorrected Ntrk multiplicity for events with #Lambda_{c} candidates; Ntrk ; Entries",nMultBins,firstMultBin,lastMultBin);
860 fHistNtrCorrEvSel =
new TH1F(
"hNtrCorrEvSel",
"Corrected Ntrk multiplicity for selected events; Ntrk ; Entries",nMultBins,firstMultBin,lastMultBin);
861 fHistNtrCorrEvWithCand =
new TH1F(
"hNtrCorrEvWithCand",
"Ntrk multiplicity for events with #Lambda_{c} candidates; Ntrk ; Entries",nMultBins,firstMultBin,lastMultBin);
884 fHistoDistanceV0ToLc =
new TH1D(
"fHistoDistanceV0ToLc",
"V0 distance to Lc Vertex from KF; distance [cm]", 1000, 0., 100.);
888 fHistoDistanceV0ToLcSgn =
new TH1D(
"fHistoDistanceV0ToLcSgn",
"V0 Sgn distance to Lc Vertex from KF; distance [cm]", 1000, 0., 100.);
890 fHistoVtxLcResidualToPrimVtx =
new TH1D(
"fHistoVtxLcResidualToPrimVtx",
"Residual between MC and KF (MC - KF): Lc to Prim Vtx; distance [cm]", 1000, -5., 5.);
891 fHistoVtxV0ResidualToPrimVtx =
new TH1D(
"fHistoVtxV0ResidualToPrimVtx",
"Residual between MC and KF (MC - KF): V0 to Prim Vtx; distance [cm]", 1000, -5., 5.);
892 fHistoVtxV0ResidualToLc =
new TH1D(
"fHistoVtxV0ResidualToLc",
"Residual between MC and KF: V0 to Lc (MC - KF); distance [cm]", 1000, -5., 5.);
931 fHistoLifeTimeLcSgn =
new TH1D(
"fHistoLifeTimeLcSgn",
"True Lc Signal Life Time; lifeTime", 100000, -0.1, 0.1);
937 fHistoKF =
new TH2D(
"fHistoKF",
"Summary from KF; V0 KF; Lc KF", 16, -0.5, 15.5, 16, -0.5, 15.5);
938 fHistoKFV0 =
new TH1D(
"fHistoKFV0",
"Summary from KF; V0 KF", 16, -0.5, 15.5);
939 fHistoKFLc =
new TH1D(
"fHistoKFLc",
"Summary from KF; V0 KF", 16, -0.5, 15.5);
940 TString axisLabel[16] = {
"AllOk",
"M_NotOk",
"Sm_NotOk",
"Dl_NotOk",
941 "Lt_NotOk",
"M_Sm_NotOk",
"M_Dl_NotOk",
"M_Lt_NotOk",
942 "Dl_Sm_NotOk",
"Dl_Lt_NotOk",
"Sm_Lt_NotOk",
"M_Sm_Dl_NotOk",
943 "M_Sm_Lt_NotOk",
"Sm_Dl_Lt_NotOk",
"M_Dl_Lt_NotOk",
"All_NotOk"};
945 for (
Int_t ibin = 1; ibin <=16; ibin++){
946 fHistoKF->GetXaxis()->SetBinLabel(ibin, axisLabel[ibin-1].
Data());
947 fHistoKF->GetYaxis()->SetBinLabel(ibin, axisLabel[ibin-1].
Data());
948 fHistoKFV0->GetXaxis()->SetBinLabel(ibin, axisLabel[ibin-1].
Data());
949 fHistoKFLc->GetXaxis()->SetBinLabel(ibin, axisLabel[ibin-1].
Data());
952 fHistoMassKFV0 =
new TH2D(
"fHistoMassKFV0",
"mass vs sigmaMass for V0; mass; sigmaMass", 500, 0.4, 0.6, 500, 0., 10);
953 fHistoDecayLengthKFV0 =
new TH2D(
"fHistoDecayLengthKFV0",
"decayLength vs sigmaDecayLength for V0; decayLength; sigmaDecayLength", 500, -10, 10, 500, 0., 10);
954 fHistoLifeTimeKFV0 =
new TH2D(
"fHistoLifeTimeKFV0",
"lifeTime vs sigmalifeTime for V0; lifeTime; sigmaLifeTime", 500, -10, 10, 500, 0., 10);
956 fHistoMassKFLc =
new TH2D(
"fHistoMassKFLc",
"mass vs sigmaMass for Lc; mass; sigmaMass", 500, 0.4, 0.6, 500, 0., 10);
957 fHistoDecayLengthKFLc =
new TH2D(
"fHistoDecayLengthKFLc",
"decayLength vs sigmaDecayLength for Lc; decayLength; sigmaDecayLength", 500, -10, 10, 500, 0., 10);
958 fHistoLifeTimeKFLc =
new TH2D(
"fHistoLifeTimeKFLc",
"lifeTime vs sigmalifeTime for Lc; lifeTime; sigmaLifeTime", 500, -10, 10, 500, 0., 10);
1046 fFuncWeightPythia =
new TF1(
"funcWeightPythia",
"1./(30. *[0]*x/TMath::Power(1.+(TMath::Power((x/[1]),[3])),[2]))",0.15,30);
1051 fFuncWeightFONLL5overLHC13d3 =
new TF1(
"funcWeightFONLL5overLHC13d3",
"([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x)",0.15,30.);
1052 fFuncWeightFONLL5overLHC13d3->SetParameters(2.94999e+00,3.47032e+00,2.81278e+00,2.5,1.93370e-02,3.86865e+00,-1.54113e-01,8.86944e-02,2.56267e-02);
1054 fFuncWeightFONLL5overLHC13d3Lc =
new TF1(
"funcWeightFONLL5overLHC13d3Lc",
"([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x)",0.15,20.);
1055 fFuncWeightFONLL5overLHC13d3Lc->SetParameters(5.94428e+01,1.63585e+01,9.65555e+00,6.71944e+00,8.88338e-02,2.40477e+00,-4.88649e-02,-6.78599e-01,-2.10951e-01);
1070 AliError(
"NO EVENT FOUND!");
1077 TClonesArray *arrayLctopKos=0;
1079 TClonesArray *array3Prong = 0;
1081 if (!aodEvent && AODEvent() && IsStandardAOD()) {
1084 aodEvent =
dynamic_cast<AliAODEvent*
> (AODEvent());
1087 AliAODHandler* aodHandler = (AliAODHandler*)
1088 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
1090 if (aodHandler->GetExtensions()) {
1091 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(
"AliAOD.VertexingHF.root");
1093 arrayLctopKos=(TClonesArray*)aodFromExt->GetList()->FindObject(
"CascadesHF");
1095 array3Prong=(TClonesArray*)aodFromExt->GetList()->FindObject(
"Charm3Prong");
1098 arrayLctopKos=(TClonesArray*)aodEvent->GetList()->FindObject(
"CascadesHF");
1100 array3Prong=(TClonesArray*)aodEvent->GetList()->FindObject(
"Charm3Prong");
1108 Int_t runnumber = aodEvent->GetRunNumber();
1109 if (aodEvent->GetTriggerMask() == 0 && (runnumber >= 195344 && runnumber <= 195677)){
1110 AliDebug(3,
"Event rejected because of null trigger mask");
1117 TClonesArray *mcArray = 0;
1118 AliAODMCHeader *mcHeader=0;
1124 mcArray =
dynamic_cast<TClonesArray*
>(aodEvent->FindListObject(AliAODMCParticle::StdBranchName()));
1126 AliError(
"Could not find Monte-Carlo in AOD");
1130 mcHeader = (AliAODMCHeader*)aodEvent->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1132 AliError(
"AliAnalysisTaskSELc2V0bachelorTMVA::UserExec: MC header branch not found!\n");
1136 Double_t zMCVertex = mcHeader->GetVtxZ();
1150 fVtx1 = (AliAODVertex*)aodEvent->GetPrimaryVertex();
1152 if (
fVtx1->GetNContributors()<1)
return;
1163 fBField = aodEvent->GetMagneticField();
1164 AliKFParticle::SetField(
fBField);
1166 Int_t nSelectedAnal = 0;
1170 array3Prong, mcHeader);
1190 if(!
fHistoMCNch) AliInfo(
"Input histos to evaluate Nch weights missing");
1219 for (
Int_t iPart=0; iPart<mcArray->GetEntriesFast(); iPart++) {
1220 AliAODMCParticle* mcPart =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(iPart));
1222 AliError(
"Failed casting particle from MC array!, Skipping particle");
1226 if (TMath::Abs(pdg) != 4122){
1227 AliDebug(2, Form(
"MC particle %d is not a Lc: its pdg code is %d", iPart, pdg));
1230 AliDebug(2, Form(
"Step 0 ok: MC particle %d is a Lc: its pdg code is %d", iPart, pdg));
1231 Int_t labeldaugh0 = mcPart->GetDaughter(0);
1232 Int_t labeldaugh1 = mcPart->GetDaughter(1);
1233 if (labeldaugh0 <= 0 || labeldaugh1 <= 0){
1234 AliDebug(2, Form(
"The MC particle doesn't have correct daughters, skipping!!"));
1237 else if (labeldaugh1 - labeldaugh0 == 1){
1238 AliDebug(2, Form(
"Step 1 ok: The MC particle has correct daughters!!"));
1239 AliAODMCParticle* daugh0 =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labeldaugh0));
1240 AliAODMCParticle* daugh1 =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labeldaugh1));
1241 if(!daugh0 || !daugh1){
1242 AliDebug(2,
"Particle daughters not properly retrieved!");
1245 Int_t pdgCodeDaugh0 = TMath::Abs(daugh0->GetPdgCode());
1246 Int_t pdgCodeDaugh1 = TMath::Abs(daugh1->GetPdgCode());
1247 AliAODMCParticle* bachelorMC = daugh0;
1248 AliAODMCParticle* v0MC = daugh1;
1249 AliDebug(2, Form(
"pdgCodeDaugh0 = %d, pdgCodeDaugh1 = %d", pdgCodeDaugh0, pdgCodeDaugh1));
1250 if ((pdgCodeDaugh0 == 311 && pdgCodeDaugh1 == 2212) || (pdgCodeDaugh0 == 2212 && pdgCodeDaugh1 == 311)){
1253 if (pdgCodeDaugh0 == 311 && pdgCodeDaugh1 == 2212) {
1254 bachelorMC = daugh1;
1257 AliDebug(2, Form(
"Number of Daughters of v0 = %d", v0MC->GetNDaughters()));
1258 if (v0MC->GetNDaughters() != 1) {
1259 AliDebug(2,
"The K0 does not decay in 1 body only! Impossible... Continuing...");
1263 AliDebug(2,
"Step 2 ok: The K0 does decay in 1 body only! ");
1264 Int_t labelK0daugh = v0MC->GetDaughter(0);
1265 AliAODMCParticle* partK0S =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labelK0daugh));
1267 AliError(
"Error while casting particle! returning a NULL array");
1271 if (partK0S->GetNDaughters() != 2 || TMath::Abs(partK0S->GetPdgCode() != 310)){
1272 AliDebug(2,
"The K0 daughter is not a K0S or does not decay in 2 bodies");
1276 AliDebug(2,
"Step 3 ok: The K0 daughter is a K0S and does decay in 2 bodies");
1277 Int_t labelK0Sdaugh0 = partK0S->GetDaughter(0);
1278 Int_t labelK0Sdaugh1 = partK0S->GetDaughter(1);
1279 AliAODMCParticle* daughK0S0 =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labelK0Sdaugh0));
1280 AliAODMCParticle* daughK0S1 =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labelK0Sdaugh1));
1281 if (!daughK0S0 || ! daughK0S1){
1282 AliDebug(2,
"Could not access K0S daughters, continuing...");
1286 AliDebug(2,
"Step 4 ok: Could access K0S daughters, continuing...");
1287 Int_t pdgK0Sdaugh0 = daughK0S0->GetPdgCode();
1288 Int_t pdgK0Sdaugh1 = daughK0S1->GetPdgCode();
1289 if (TMath::Abs(pdgK0Sdaugh0) != 211 || TMath::Abs(pdgK0Sdaugh1) != 211){
1290 AliDebug(2,
"The K0S does not decay in pi+pi-, continuing");
1295 AliDebug(2, Form(
"----> Filling histo with pt = %f", mcPart->Pt()));
1299 if(!(TMath::Abs(bachelorMC->Eta()) > 0.9 || bachelorMC->Pt() < 0.1 ||
1300 TMath::Abs(daughK0S0->Eta()) > 0.9 || daughK0S0->Pt() < 0.1 ||
1301 TMath::Abs(daughK0S1->Eta()) > 0.9 || daughK0S1->Pt() < 0.1)) {
1306 AliDebug(2,
"not in fiducial acceptance! Skipping");
1324 TClonesArray *mcArray,
1325 Int_t &nSelectedAnal,
1327 AliAODMCHeader* aodheader){
1330 Int_t pdgCand = 4122;
1331 Int_t pdgDgLctoV0bachelor[2]={2212, 310};
1332 Int_t pdgDgV0toDaughters[2]={211, 211};
1334 Int_t pdgDgLctopKpi[3]={2212, 321, 211};
1337 Int_t n3Prong = array3Prong->GetEntriesFast();
1338 Int_t nCascades= arrayLctopKos->GetEntriesFast();
1341 for (
Int_t i3Prong = 0; i3Prong < n3Prong; i3Prong++) {
1347 Int_t mcLabel = d->MatchToMC(4122, mcArray, 3, pdgDgLctopKpi);
1352 AliAODMCParticle *partLcpKpi =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(mcLabel));
1354 Int_t pdgCode = partLcpKpi->GetPdgCode();
1355 AliDebug(2,Form(
" ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ MClabel=%d ~~~~~~~~~~ pdgCode=%d", mcLabel, pdgCode));
1371 for (
Int_t iLctopK0s = 0; iLctopK0s < nCascades; iLctopK0s++) {
1376 AliDebug(2,Form(
"Cascade %d doens't exist, skipping",iLctopK0s));
1381 AliDebug(2,Form(
"Cascade %d is not flagged as Lc candidate",iLctopK0s));
1391 fmcLabelLc = lcK0spr->
MatchToMC(pdgCand, pdgDgLctoV0bachelor[1], pdgDgLctoV0bachelor, pdgDgV0toDaughters, mcArray, kTRUE);
1393 AliDebug(2, Form(
"----> cascade number %d (total cascade number = %d) is a Lc!", iLctopK0s, nCascades));
1395 AliAODMCParticle *partLc =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(
fmcLabelLc));
1397 pdgCode = partLc->GetPdgCode();
1398 if (pdgCode<0) AliDebug(2,Form(
" ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ MClabel=%d ~~~~~~~~~~ pdgCode=%d",
fmcLabelLc, pdgCode));
1399 pdgCode = TMath::Abs(pdgCode);
1414 if (lcK0spr->GetNDaughters()!=2) {
1415 AliDebug(2,Form(
"Cascade %d has not 2 daughters (nDaughters=%d)",iLctopK0s,lcK0spr->GetNDaughters()));
1419 AliAODv0 * v0part =
dynamic_cast<AliAODv0*
>(lcK0spr->
Getv0());
1420 AliAODTrack * bachPart =
dynamic_cast<AliAODTrack*
>(lcK0spr->
GetBachelor());
1421 if (!v0part || !bachPart) {
1422 AliDebug(2,Form(
"Cascade %d has no V0 or no bachelor object",iLctopK0s));
1427 if (!v0part->GetSecondaryVtx()) {
1428 AliDebug(2,Form(
"No secondary vertex for V0 by cascade %d",iLctopK0s));
1432 if (v0part->GetNDaughters()!=2) {
1433 AliDebug(2,Form(
"current V0 has not 2 daughters (onTheFly=%d, nDaughters=%d)",v0part->GetOnFlyStatus(),v0part->GetNDaughters()));
1439 if (!v0Neg || !v0Pos) {
1440 AliDebug(2,Form(
"V0 by cascade %d has no V0positive of V0negative object",iLctopK0s));
1445 if (v0Pos->Charge() == v0Neg->Charge()) {
1446 AliDebug(2,Form(
"V0 by cascade %d has daughters with the same sign: IMPOSSIBLE!",iLctopK0s));
1457 mcLabel = lcK0spr->
MatchToMC(pdgCand, pdgDgLctoV0bachelor[1], pdgDgLctoV0bachelor, pdgDgV0toDaughters, mcArray, kTRUE);
1459 AliDebug(2,Form(
" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~cascade number %d (total cascade number = %d)", iLctopK0s, nCascades));
1461 AliAODMCParticle *partLc =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(mcLabel));
1463 pdgCode = partLc->GetPdgCode();
1464 if (pdgCode<0) AliDebug(2,Form(
" ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ MClabel=%d ~~~~~~~~~~ pdgCode=%d", mcLabel, pdgCode));
1465 pdgCode = TMath::Abs(pdgCode);
1475 AliDebug(2, Form(
"\n\n\n Analysing candidate %d\n", iLctopK0s));
1476 AliDebug(2, Form(
">>>>>>>>>> Candidate is background, fFillOnlySgn = %d --> SKIPPING",
fFillOnlySgn));
1485 if (!isCandidateInjected){
1486 AliDebug(2,
"The candidate is from HIJING (i.e. not injected), keeping it to fill background");
1490 AliDebug(2,
"The candidate is NOT from HIJING, we skip it when filling background");
1497 AliAODTrack *bachelor = (AliAODTrack*)lcK0spr->
GetBachelor();
1500 if (!bachelor || !v0pos || !v0neg) {
1501 AliDebug(2,
"Cannot retrieve one of the tracks while checking origin, continuing");
1505 Int_t labelbachelor = TMath::Abs(bachelor->GetLabel());
1506 Int_t labelv0pos = TMath::Abs(v0pos->GetLabel());
1507 Int_t labelv0neg = TMath::Abs(v0neg->GetLabel());
1508 AliAODMCParticle* MCbachelor = (AliAODMCParticle*)mcArray->At(labelbachelor);
1509 AliAODMCParticle* MCv0pos = (AliAODMCParticle*)mcArray->At(labelv0pos);
1510 AliAODMCParticle* MCv0neg = (AliAODMCParticle*)mcArray->At(labelv0neg);
1511 if (!MCbachelor || !MCv0pos || !MCv0neg) {
1512 AliDebug(2,
"Cannot retrieve MC particle for one of the tracks while checking origin, continuing");
1519 if (isBachelorFromPythia != 0 && isv0posFromPythia != 0 && isv0negFromPythia != 0){
1520 AliDebug(2,
"The candidate is from PYTHIA (i.e. all daughters originate from a quark), keeping it to fill background");
1524 AliDebug(2,
"The candidate is NOT from PYTHIA, we skip it when filling background");
1537 AliAODVertex* v = lcK0spr->GetSecondaryVtx();
1548 Int_t &nSelectedAnal,
1550 TClonesArray *mcArray,
Int_t iLctopK0s){
1566 AliAODv0 * v0part = part->
Getv0();
1567 Bool_t onFlyV0 = v0part->GetOnFlyStatus();
1586 Double_t invmassK0s = v0part->MassK0Short();
1607 if (isInV0window == 0) {
1608 AliDebug(2,
"No: The candidate has NOT passed the V0 window cuts!");
1609 if (isLc) Printf(
"SIGNAL candidate rejected: V0 window cuts");
1612 else AliDebug(2,
"Yes: The candidate has passed the mass cuts!");
1616 if (!isInCascadeWindow) {
1617 AliDebug(2,
"No: The candidate has NOT passed the cascade window cuts!");
1618 if (isLc) Printf(
"SIGNAL candidate rejected: cascade window cuts");
1621 else AliDebug(2,
"Yes: The candidate has passed the cascade window cuts!");
1625 if (!isCandidateSelectedCuts){
1626 AliDebug(2,
"No: Analysis cuts kCandidate level NOT passed");
1627 if (isLc) Printf(
"SIGNAL candidate rejected");
1631 AliDebug(2,
"Yes: Analysis cuts kCandidate level passed");
1634 AliAODTrack *bachelor = (AliAODTrack*)part->
GetBachelor();
1636 AliDebug(2, Form(
"Very weird, the bachelor is not there... returning for this candidate"));
1641 Double_t probTPCTOF[AliPID::kSPECIES]={-1.};
1644 AliDebug(2, Form(
"detUsed (TPCTOF case) = %d", detUsed));
1649 AliDebug(2, Form(
"We have found the detector mask for TOF + TPC: probProton will be set to %f", probTPCTOF[
AliPID::kProton]));
1655 fPIDCombined->SetDetectorMask(AliPIDResponse::kDetTPC);
1656 AliDebug(2,
"We did not find the detector mask for TOF + TPC, let's see only TPC");
1658 AliDebug(2,Form(
" detUsed (TPC case) = %d", detUsed));
1663 AliDebug(2, Form(
"TPC only worked: probProton will be set to %f", probTPCTOF[
AliPID::kProton]));
1666 AliDebug(2,
"Only TPC did not work...");
1669 fPIDCombined->SetDetectorMask(AliPIDResponse::kDetTPC+AliPIDResponse::kDetTOF);
1671 AliDebug(2, Form(
"probProton = %f", probProton));
1676 Double_t pidTPC[AliPID::kSPECIES]={-1.};
1677 Double_t pidTOF[AliPID::kSPECIES]={-1.};
1678 Int_t respTPC =
fPIDResponse->ComputePIDProbability(AliPIDResponse::kDetTPC, bachelor, AliPID::kSPECIES, pidTPC);
1679 Int_t respTOF =
fPIDResponse->ComputePIDProbability(AliPIDResponse::kDetTOF, bachelor, AliPID::kSPECIES, pidTOF);
1680 if (respTPC == AliPIDResponse::kDetPidOk) probProtonTPC = pidTPC[
AliPID::kProton];
1681 if (respTOF == AliPIDResponse::kDetPidOk) probProtonTOF = pidTOF[
AliPID::kProton];
1685 AliDebug(2,
"On-the-fly discarded");
1696 if (isLc) Printf(
"SIGNAL candidate rejected");
1697 AliDebug(2,
"No: Analysis cuts kTracks level NOT passed");
1701 AliDebug(2,
"Yes: Analysis cuts kTracks level passed");
1704 Int_t pdgCand = 4122;
1705 Int_t pdgDgLctoV0bachelor[2]={211, 3122};
1706 Int_t pdgDgV0toDaughters[2]={2212, 211};
1707 Int_t isLc2LBarpi=0, isLc2Lpi=0;
1708 Int_t currentLabel = part->GetLabel();
1711 mcLabel = part->
MatchToMC(pdgCand, pdgDgLctoV0bachelor[1], pdgDgLctoV0bachelor, pdgDgV0toDaughters, mcArray, kTRUE);
1713 if (bachelor->Charge()==-1) isLc2LBarpi=1;
1714 if (bachelor->Charge()==+1) isLc2Lpi=1;
1718 Int_t pdgDg2prong[2] = {211, 211};
1722 labelK0S = v0part->MatchToMC(310, mcArray, 2, pdgDg2prong);
1723 if (labelK0S>=0) isK0S = 1;
1726 pdgDg2prong[0] = 211;
1727 pdgDg2prong[1] = 2212;
1729 Int_t isLambdaBar = 0;
1730 Int_t lambdaLabel = 0;
1732 lambdaLabel = v0part->MatchToMC(3122, mcArray, 2, pdgDg2prong);
1733 if (lambdaLabel>=0) {
1734 AliAODMCParticle *lambdaTrack = (AliAODMCParticle*)mcArray->At(lambdaLabel);
1735 if (lambdaTrack->GetPdgCode()==3122) isLambda = 1;
1736 else if (lambdaTrack->GetPdgCode()==-3122) isLambdaBar = 1;
1740 pdgDg2prong[0] = 11;
1741 pdgDg2prong[1] = 11;
1743 Int_t gammaLabel = 0;
1745 gammaLabel = v0part->MatchToMC(22, mcArray, 2, pdgDg2prong);
1746 if (gammaLabel>=0) {
1747 AliAODMCParticle *gammaTrack = (AliAODMCParticle*)mcArray->At(gammaLabel);
1748 if (gammaTrack->GetPdgCode()==22) isGamma = 1;
1753 if (currentLabel != -1){
1754 AliAODMCParticle *tempPart = (AliAODMCParticle*)mcArray->At(currentLabel);
1755 pdgTemp = tempPart->GetPdgCode();
1757 if (isLc) AliDebug(2, Form(
"Signal: Candidate is a Lc in K0s+p"));
1758 else if (isLc2LBarpi) AliDebug(2, Form(
"Background: Candidate is a Lc in Lbar + pi"));
1759 else if (isLc2Lpi) AliDebug(2, Form(
"Background: Candidate is a Lc in L + pi"));
1760 else AliDebug(2, Form(
"Pure bkg: Candidate has pdg = %d", pdgTemp));
1761 if (isK0S) AliDebug(2, Form(
"V0 is a K0S"));
1762 else if (isLambda) AliDebug(2, Form(
"V0 is a Lambda"));
1763 else if (isLambdaBar) AliDebug(2, Form(
"V0 is a LambdaBar"));
1764 else if (isGamma) AliDebug(2, Form(
"V0 is a Gamma"));
1768 Double_t invmassLambda = v0part->MassLambda();
1769 Double_t invmassLambdaBar = v0part->MassAntiLambda();
1795 nSigmaTPCpi =
fPIDResponse->NumberOfSigmasTPC(bachelor,(AliPID::kPion));
1796 nSigmaTPCka =
fPIDResponse->NumberOfSigmasTPC(bachelor,(AliPID::kKaon));
1798 nSigmaTOFpi =
fPIDResponse->NumberOfSigmasTOF(bachelor,(AliPID::kPion));
1799 nSigmaTOFka =
fPIDResponse->NumberOfSigmasTOF(bachelor,(AliPID::kKaon));
1803 Double_t weightPythia = -1, weight5LHC13d3 = -1, weight5LHC13d3Lc = -1;
1806 if (iLctopK0s >= 0) {
1807 AliAODMCParticle *partLcMC = (AliAODMCParticle*)mcArray->At(iLctopK0s);
1808 ptLcMC = partLcMC->Pt();
1822 if(!
fHistoMCNch) AliInfo(
"Input histos to evaluate Nch weights missing");
1831 if (!onFlyV0 && isInV0window && isInCascadeWindow && part->
CosV0PointingAngle()>0.99 && TMath::Abs(nSigmaTPCpr) <= 3 && v0part->Getd0Prong(0) < 20 && v0part->Getd0Prong(1) < 20) {
1837 k0SCode =
CheckK0S(part, v0part, mcArray);
1840 Double_t V0KF[3] = {-999999, -999999, -999999};
1841 Double_t errV0KF[3] = {-999999, -999999, -999999};
1842 Double_t LcKF[3] = {-999999, -999999, -999999};
1843 Double_t errLcKF[3] = {-999999, -999999, -999999};
1844 Double_t distances[3] = {-999999, -999999, -999999};
1845 Double_t armPolKF[2] = {-999999, -999999};
1850 TVector3 mom1(bachelor->Px(), bachelor->Py(), bachelor->Pz());
1851 TVector3 mom2(v0part->Px(), v0part->Py(), v0part->Pz());
1852 TVector3 momTot(part->Px(), part->Py(), part->Pz());
1854 Double_t Ql1 = mom1.Dot(momTot)/momTot.Mag();
1855 Double_t Ql2 = mom2.Dot(momTot)/momTot.Mag();
1857 Double_t alphaArmLc = (Ql1 - Ql2)/(Ql1 + Ql2);
1858 Double_t alphaArmLcCharge = ( bachelor->Charge() > 0 ? (Ql1 - Ql2)/(Ql1 + Ql2) : (Ql2 - Ql1)/(Ql1 + Ql2) );
1859 Double_t ptArmLc = mom1.Perp(momTot);
1861 Double_t massK0SPDG = TDatabasePDG::Instance()->GetParticle(310)->Mass();
1862 Double_t massPrPDG = TDatabasePDG::Instance()->GetParticle(2212)->Mass();
1863 Double_t massLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
1865 Double_t pStar = TMath::Sqrt((massLcPDG*massLcPDG-massPrPDG*massPrPDG-massK0SPDG*massK0SPDG)*(massLcPDG*massLcPDG-massPrPDG*massPrPDG-massK0SPDG*massK0SPDG)-4.*massPrPDG*massPrPDG*massK0SPDG*massK0SPDG)/(2.*massLcPDG);
1871 kfResult =
CallKFVertexing(part, v0part, bachelor, mcArray, &V0KF[0], &errV0KF[0], &LcKF[0], &errLcKF[0], &distances[0], &armPolKF[0]);
1872 AliDebug(2, Form(
"Result from KF = %d", kfResult));
1880 Double_t cts = (Ql1/gamma-beta*TMath::Sqrt(pStar*pStar+massPrPDG*massPrPDG))/pStar;
1972 AliDebug(2, Form(
"v0pos->GetStatus() & AliESDtrack::kITSrefit= %d, v0neg->GetStatus() & AliESDtrack::kITSrefit = %d, v0pos->GetTPCClusterInfo(2, 1)= %f, v0neg->GetTPCClusterInfo(2, 1) = %f", (
Int_t)(v0pos->GetStatus() & AliESDtrack::kITSrefit), (
Int_t)(v0pos->GetStatus() & AliESDtrack::kITSrefit), v0pos->GetTPCClusterInfo(2, 1), v0neg->GetTPCClusterInfo(2, 1)));
2051 AliDebug(2, Form(
"Reco particle %d --> Filling Sgn", iLctopK0s));
2057 AliDebug(2,
"Filling Bkg");
2083 Int_t codeKFV0 = -1, codeKFLc = -1;
2085 AliKFVertex primVtxCopy;
2086 Int_t nt = 0, ntcheck = 0;
2092 fVtx1->GetCovarianceMatrix(covmatrix);
2094 AliESDVertex primaryESDVtxCopy(pos, covmatrix, chi2, contr,
"Vertex");
2097 primVtxCopy = AliKFVertex(primaryESDVtxCopy);
2098 nt = primaryESDVtxCopy.GetNContributors();
2102 Int_t pdgLc[2] = {2212, 310};
2104 Int_t pdgDgV0toDaughters[2] = {211, 211};
2106 Int_t mcLabelV0 = v0part->MatchToMC(310, mcArray, 2, pdgDgV0toDaughters);
2109 Bool_t isMCokV0 = kTRUE, isBkgV0 = kFALSE;
2110 AliKFParticle V0, positiveV0KF, negativeV0KF;
2111 Int_t labelsv0daugh[2] = {-1, -1};
2112 Int_t idv0daugh[2] = {-1, -1};
2113 AliExternalTrackParam* esdv0Daugh1 = 0x0;
2114 AliExternalTrackParam* esdv0Daugh2 = 0x0;
2115 for(
Int_t ipr= 0; ipr < 2; ipr++){
2116 AliAODTrack *aodTrack = (AliAODTrack*)v0part->GetDaughter(ipr);
2118 AliDebug(2,
"No V0 daughters available");
2121 Double_t xyz[3], pxpypz[3], cv[21];
2123 aodTrack->GetXYZ(xyz);
2124 aodTrack->PxPyPz(pxpypz);
2125 aodTrack->GetCovarianceXYZPxPyPz(cv);
2126 sign = aodTrack->Charge();
2127 AliExternalTrackParam tmp1( xyz, pxpypz, cv, sign);
2129 if (ipr == 0) esdv0Daugh1 =
new AliExternalTrackParam( xyz, pxpypz, cv, sign);
2130 else esdv0Daugh2 =
new AliExternalTrackParam( xyz, pxpypz, cv, sign);
2131 labelsv0daugh[ipr] = TMath::Abs(aodTrack->GetLabel());
2132 idv0daugh[ipr] = aodTrack->GetID();
2133 if (labelsv0daugh[ipr] == -1) isBkgV0 = kTRUE;
2137 AliKFParticle daughterKF(*aodTrack, pdg[ipr]);
2138 if (aodTrack->Charge() > 0) {
2139 positiveV0KF = daughterKF;
2142 negativeV0KF = daughterKF;
2147 AliDebug(2, Form(
"bField = %f, esdv0Daugh1 = %p, esdv0Daugh2 = %p",
fBField, esdv0Daugh1, esdv0Daugh2));
2150 AliExternalTrackParam tr1(*esdv0Daugh1);
2151 AliExternalTrackParam tr2(*esdv0Daugh2);
2155 AliKFParticle daughterKF1(tr1, 211);
2156 AliKFParticle daughterKF2(tr2, 211);
2157 V0.AddDaughter(positiveV0KF);
2158 V0.AddDaughter(negativeV0KF);
2167 if( V0.GetNDF() < 1 ) {
2171 if( TMath::Sqrt(TMath::Abs(V0.GetChi2()/V0.GetNDF())) >
fCutKFChi2NDF ) {
2177 for(
Int_t ipr = 0; ipr < 2; ipr++){
2178 AliAODTrack *aodTrack = (AliAODTrack*)v0part->GetDaughter(ipr);
2180 if(!aodTrack->GetUsedForPrimVtxFit()) {
2184 AliKFParticle daughterKF(*aodTrack, pdg[ipr]);
2185 primVtxCopy -= daughterKF;
2199 Double_t massV0 = 999999, sigmaMassV0 = 999999;
2200 Int_t retMV0 = V0.GetMass( massV0, sigmaMassV0 );
2204 if (sigmaMassV0 > 1e19) codeKFV0 = 5;
2206 else if (sigmaMassV0 > 1e19) codeKFV0 = 2;
2210 if (massV0 < 0.4) Printf(
"\n\n>>>>>>>>>> Found the Funny V0 (mass = %f, sigma = %f, AOD mass = %f): labels of the tracks = %d, %d, id = %d and %d", massV0, sigmaMassV0, v0part->MassK0Short(), labelsv0daugh[0], labelsv0daugh[1], idv0daugh[0], idv0daugh[1]);
2211 if (massV0 > 0.55) Printf(
"\n\n>>>>>>>>>> Found the Funny V0 (mass = %f, , sigma = %f, AOD mass = %f): labels of the tracks = %d, %d, id = %d and %d", massV0, sigmaMassV0, v0part->MassK0Short(), labelsv0daugh[0], labelsv0daugh[1], idv0daugh[0], idv0daugh[1]);
2213 Printf(
"Vertices: KF: x = %f, y = %f, z = %f", V0.GetX(), V0.GetY(), V0.GetZ());
2214 Printf(
"Vertices: AOD: x = %f, y = %f, z = %f", v0part->Xv(), v0part->Yv(), v0part->Zv());
2217 if (
fUseMCInfo && TMath::Abs(labelsv0daugh[0] - labelsv0daugh[1]) == 1) {
2218 AliAODMCParticle* tmpdaughv01 =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labelsv0daugh[0]));
2219 AliAODMCParticle* tmpdaughv02 =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labelsv0daugh[1]));
2220 if (!tmpdaughv01 && labelsv0daugh[0] > 0){
2221 AliDebug(2,
"Could not access MC info for first daughter of V0, continuing");
2223 if (!tmpdaughv02 && labelsv0daugh[1] > 0){
2224 AliDebug(2,
"Could not access MC info for second daughter of V0, continuing");
2227 Double_t xPionMC = tmpdaughv01->Xv();
2228 Double_t yPionMC = tmpdaughv01->Yv();
2229 Double_t zPionMC = tmpdaughv01->Zv();
2231 Printf(
"Vertices: MC: x = %f, y = %f, z = %f", xPionMC, yPionMC, zPionMC);
2235 Printf(
"Not a true V0");
2242 nt = primVtxCopy.GetNContributors();
2245 Bool_t isMCokLc = kTRUE, isBkgLc = kFALSE;
2247 Int_t labelsLcdaugh[2] = {-1, -1};
2248 labelsLcdaugh[0] = TMath::Abs(bach->GetLabel());
2249 labelsLcdaugh[1] = mcLabelV0;
2251 if (bach->Charge() < 0) pdgLc[0] = -pdgLc[0];
2252 AliKFParticle daughterKFLc(*bach, pdgLc[0]);
2253 Lc.AddDaughter(daughterKFLc);
2254 TParticlePDG* particlePDG = TDatabasePDG::Instance()->GetParticle(310);
2255 Double_t massPDGK0S = particlePDG->Mass();
2256 V0.SetMassConstraint(massPDGK0S);
2258 if( Lc.GetNDF() < 1 ) {
2259 AliDebug(2, Form(
"Lc: Number of degrees of freedom < 1 (%d), continuing", Lc.GetNDF()));
2262 if( TMath::Sqrt(TMath::Abs(Lc.GetChi2()/Lc.GetNDF())) >
fCutKFChi2NDF) {
2263 AliDebug(2, Form(
"Lc: Chi2 per DOF too big, continuing (%f)", TMath::Sqrt(TMath::Abs(Lc.GetChi2()/Lc.GetNDF()))));
2269 if(!bach->GetUsedForPrimVtxFit()) {
2270 AliDebug(3,
"Lc: Bachelor was not used for primary vertex, not subtracting it from primary vertex");
2273 primVtxCopy -= daughterKFLc;
2302 if( TMath::Sqrt( TMath::Abs(Lc.GetChi2()/Lc.GetNDF())) >
fCutKFChi2NDF) {
2303 AliDebug(2, Form(
"Lc: Final Chi2 per DOF too big, continuing (%f)", TMath::Sqrt( TMath::Abs(Lc.GetChi2()/Lc.GetNDF()))));
2308 V0.SetProductionVertex(Lc);
2314 Double_t decayLengthV0 = 999999, sigmaDecayLengthV0 = 999999;
2315 Int_t retDLV0 = V0.GetDecayLength( decayLengthV0, sigmaDecayLengthV0 );
2317 if (sigmaDecayLengthV0 > 1e19) {
2321 if (sigmaMassV0 > 1e19) codeKFV0 = 11;
2323 else if (sigmaMassV0 > 1e19) codeKFV0 = 8;
2329 Double_t lifeTimeV0 = 999999, sigmaLifeTimeV0 = 999999;
2330 Int_t retTLV0 = V0.GetLifeTime( lifeTimeV0, sigmaLifeTimeV0 );
2332 if (sigmaLifeTimeV0 > 1e19) {
2334 if (sigmaDecayLengthV0 > 1e19) {
2338 if (sigmaMassV0 > 1e19) codeKFV0 = 15;
2340 else if (sigmaMassV0 > 1e19) codeKFV0 = 13;
2342 else if (massV0 < 0) {
2344 if (sigmaMassV0 > 1e19) codeKFV0 = 12;
2346 else if (sigmaMassV0 > 1e19) codeKFV0 = 10;
2351 if (codeKFV0 == -1) codeKFV0 = 0;
2354 AliDebug(2, Form(
"V0: mass = %f, decay length = %f, life time = %f", massV0, decayLengthV0, lifeTimeV0 ));
2361 Double_t vtxV0KF[3] = {V0.GetX(), V0.GetY(), V0.GetZ()};
2362 positiveV0KF.TransportToPoint(vtxV0KF);
2363 negativeV0KF.TransportToPoint(vtxV0KF);
2364 V0.GetArmenterosPodolanski(positiveV0KF, negativeV0KF, qtAlphaV0);
2365 AliDebug(2, Form(
"Armenteros-Podolanski variables: alpha = %f, qt = %f", qtAlphaV0[1], qtAlphaV0[0]));
2368 armPolKF[0] = qtAlphaV0[1];
2369 armPolKF[1] = qtAlphaV0[0];
2373 AliAODMCParticle *motherV0 = 0x0;
2374 AliAODMCParticle *daughv01 = 0x0;
2375 AliAODMCParticle *daughv02 = 0x0;
2378 daughv01 =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labelsv0daugh[0]));
2379 daughv02 =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labelsv0daugh[1]));
2380 if (!daughv01 && labelsv0daugh[0] > 0){
2381 AliDebug(2,
"Could not access MC info for first daughter of V0, continuing");
2384 if (!daughv02 && labelsv0daugh[1] > 0){
2385 AliDebug(2,
"Could not access MC info for second daughter of V0, continuing");
2389 if( daughv01->GetMother() == daughv02->GetMother() && daughv01->GetMother()>=0 ){
2390 AliDebug(3, Form(
"The mother has label %d", daughv01->GetMother()));
2391 motherV0 =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(daughv01->GetMother()));
2392 if( motherV0 && TMath::Abs(motherV0->GetPdgCode()) != 21 ){
2393 if( motherV0->GetNDaughters() == 2 ){
2398 if (TMath::Abs(motherV0->GetPdgCode()) == 310){
2405 AliDebug(2, Form(
"PDG V0 = %d, pi = %d, pj = %d, ndaughters = %d, mc mass = %f, reco mass = %f, v0 mass = %f", motherV0->GetPdgCode(), daughv01->GetPdgCode(), daughv02->GetPdgCode(), motherV0->GetNDaughters(), motherV0->GetCalcMass(), massV0, v0part->MassK0Short()));
2407 else if (!motherV0){
2408 AliDebug(3,
"could not access MC info for mother, continuing");
2411 AliDebug(3,
"MC mother is a gluon, continuing");
2415 AliDebug(3,
"Background V0!");
2421 AliDebug(2, Form(
"isMCokV0 = %d, isBkgV0 = %d", (
Int_t)isMCokV0, (
Int_t)isBkgV0));
2426 Double_t massLc = 999999, sigmaMassLc= 999999;
2427 Int_t retMLc = Lc.GetMass( massLc, sigmaMassLc );
2429 AliDebug(3, Form(
"----> Could not get mass (%e), and sigma(%e) for Lc, continuing", massLc, sigmaMassLc));
2432 if (sigmaMassLc > 1e19) codeKFLc = 5;
2434 else if (sigmaMassLc > 1e19) codeKFLc = 2;
2439 Double_t decayLengthLc = 999999, sigmaDecayLengthLc = 999999;
2440 Int_t retDLLc = Lc.GetDecayLength( decayLengthLc, sigmaDecayLengthLc );
2442 AliDebug(3,
"----> Lc: Could not get decay length, and sigma");
2443 if (sigmaDecayLengthLc > 1e19) {
2447 if (sigmaMassLc > 1e19) codeKFLc = 11;
2449 else if (sigmaMassLc > 1e19) codeKFLc = 8;
2452 AliDebug(3, Form(
"retDLLc = %d, with decayLength = %f and error = %e", retDLLc, decayLengthLc, sigmaDecayLengthLc));
2457 Double_t lifeTimeLc = 999999, sigmaLifeTimeLc = 999999;
2458 Int_t retTLLc = Lc.GetLifeTime( lifeTimeLc, sigmaLifeTimeLc );
2460 AliDebug(3,
"----> Lc: Could not get lifeTime, and sigma");
2461 if (sigmaLifeTimeLc > 1e19) {
2463 if (sigmaDecayLengthLc > 1e19) {
2467 if (sigmaMassLc > 1e19) codeKFLc = 15;
2469 else if (sigmaMassLc > 1e19) codeKFLc = 13;
2471 else if (massLc < 0) {
2473 if (sigmaMassLc > 1e19) codeKFLc = 12;
2475 else if (sigmaMassLc > 1e19) codeKFLc = 10;
2481 AliDebug(2, Form(
"Lc: mass = %f (error = %e), decay length = %f (error = %e), life time = %f (error = %e) --> codeKFLc = %d", massLc, sigmaMassLc, decayLengthLc, sigmaDecayLengthLc, lifeTimeLc, sigmaLifeTimeLc, codeKFLc));
2483 if (codeKFLc == -1) codeKFLc = 0;
2486 fHistoKF->Fill(codeKFV0, codeKFLc);
2505 Double_t xPrimVtx = primVtxCopy.GetX();
2506 Double_t yPrimVtx = primVtxCopy.GetY();
2507 Double_t zPrimVtx = primVtxCopy.GetZ();
2509 Double_t distanceLcToPrimVtx = TMath::Sqrt((xPrimVtx - xLc) * (xPrimVtx - xLc) +
2510 (yPrimVtx - yLc) * (yPrimVtx - yLc) +
2511 (zPrimVtx - zLc) * (zPrimVtx - zLc));
2513 Double_t distanceV0ToPrimVtx = TMath::Sqrt((xPrimVtx - xV0) * (xPrimVtx - xV0) +
2514 (yPrimVtx - yV0) * (yPrimVtx - yV0) +
2515 (zPrimVtx - zV0) * (zPrimVtx - zV0));
2517 Double_t distanceV0ToLc = TMath::Sqrt((xLc - xV0)*(xLc - xV0) +
2518 (yLc - yV0)*(yLc - yV0) +
2519 (zLc - zV0)*(zLc - zV0));
2527 distances[0] = distanceLcToPrimVtx;
2528 distances[1] = distanceV0ToPrimVtx;
2529 distances[2] = distanceV0ToLc;
2533 AliAODMCParticle *daughv01Lc = 0x0;
2534 AliAODMCParticle *K0S = 0x0;
2535 AliAODMCParticle *daughv02Lc = 0x0;
2537 if (labelsLcdaugh[0] >= 0) {
2539 daughv01Lc =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labelsLcdaugh[0]));
2541 AliDebug(3,
"Could not access MC info for first daughter of Lc");
2545 AliDebug(2, Form(
"The bachelor has label = %d", daughv01Lc->GetLabel()));
2546 if (TMath::Abs(daughv01Lc->GetPdgCode()) != 2212) isBkgLc = kTRUE;
2553 if (labelsLcdaugh[1] >= 0) {
2555 K0S =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labelsLcdaugh[1]));
2557 AliDebug(3,
"Could not access MC info for second daughter of Lc");
2561 if (TMath::Abs(K0S->GetPdgCode()) != 310) isBkgLc = kTRUE;
2565 AliDebug(2,
"The K0S is not true --> it does not have a label, continuing...");
2571 Int_t iK0 = K0S->GetMother();
2573 Printf(
"The K0S has no mother... IMPOSSIBLE");
2576 daughv02Lc =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(iK0));
2578 AliDebug(3,
"Could not access MC info for second daughter of Lc");
2581 if( daughv01Lc && (daughv01Lc->GetMother() == daughv02Lc->GetMother()) && (daughv01Lc->GetMother()>=0) ){
2583 AliAODMCParticle *motherLc =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(daughv01Lc->GetMother()));
2584 Int_t pdgMum = 0, pdgBach = 0, pdgV0 = 0;
2585 if (motherLc) pdgMum = motherLc->GetPdgCode();
2586 if (daughv01Lc) pdgBach = daughv01Lc->GetPdgCode();
2587 if (daughv02Lc) pdgV0 = daughv02Lc->GetPdgCode();
2588 AliDebug(2, Form(
"pdgMum = %d, pdgBach = %d, pdgV0 = %d", pdgMum, pdgBach, pdgV0));
2590 if( motherLc && TMath::Abs(motherLc->GetPdgCode()) != 21 ){
2600 if (TMath::Abs(motherLc->GetPdgCode()) == 4122 && TMath::Abs(motherV0->GetPdgCode()) == 310 && TMath::Abs(daughv01Lc->GetPdgCode()) == 2212){
2601 AliDebug(2, Form(
"IT IS SIGNAL!!! with label = %d", motherLc->GetLabel()));
2630 Double_t xProtonMC = daughv01Lc->Xv();
2631 Double_t yProtonMC = daughv01Lc->Yv();
2632 Double_t zProtonMC = daughv01Lc->Zv();
2635 Double_t vtxLcResidualToPrimVtx = TMath::Sqrt((xLcMC - xProtonMC) * (xLcMC - xProtonMC) +
2636 (yLcMC - yProtonMC) * (yLcMC - yProtonMC) +
2637 (zLcMC - zProtonMC) * (zLcMC - zProtonMC)) - distanceLcToPrimVtx;
2649 Printf(
"Vertices: MC: x = %f, y = %f, z = %f", xPionMC, yPionMC, zPionMC);
2651 Double_t vtxV0ResidualToLc = TMath::Sqrt((xV0MC - xPionMC) * (xV0MC - xPionMC) +
2652 (yV0MC - yPionMC) * (yV0MC - yPionMC) +
2653 (zV0MC - zPionMC) * (zV0MC - zPionMC)) - distanceV0ToLc;
2657 Double_t vtxV0ResidualToPrimVtx = TMath::Sqrt((xPionMC - xLcMC) * (xPionMC - xLcMC) +
2658 (yPionMC - yLcMC) * (yPionMC - yLcMC) +
2659 (zPionMC - zLcMC) * (zPionMC - zLcMC)) - distanceV0ToPrimVtx;
2666 else if (!motherLc){
2667 AliDebug(2,
"We could not access MC info for Lc mother, so we did nothing");
2670 AliDebug(2,
"MC Lc mother is a gluon, so we did nothing");
2683 if ( retMV0 == 0 && retMLc == 0){
2685 errV0KF[0] = sigmaMassV0;
2686 V0KF[1] = decayLengthV0;
2687 errV0KF[1] = sigmaDecayLengthV0;
2688 V0KF[2] = lifeTimeV0;
2689 errV0KF[2] = sigmaLifeTimeV0;
2691 errLcKF[0] = sigmaMassLc;
2692 LcKF[1] = decayLengthLc;
2693 errLcKF[1] = sigmaDecayLengthLc;
2694 LcKF[2] = lifeTimeLc;
2695 errLcKF[2] = sigmaLifeTimeLc;
2703 AliAODTrack* bachelor,
2704 TClonesArray *mcArray ){
2711 Int_t label = bachelor->GetLabel();
2716 AliAODMCParticle *mcpart =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(TMath::Abs(label)));
2719 if (TMath::Abs(pdg) != 2212) {
2720 AliDebug(2, Form(
"Bachelor is not a p, but a particle with pdg code = %d", pdg));
2727 Int_t bachelorMotherLabel = mcpart->GetMother();
2729 if (bachelorMotherLabel == -1) {
2732 AliAODMCParticle *bachelorMother =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(bachelorMotherLabel));
2734 Int_t pdgMother = bachelorMother->PdgCode();
2735 if (TMath::Abs(pdgMother) != 4122) {
2736 AliDebug(2, Form(
"The proton does not come from a Lc, but from a particle with pdgcode = %d", pdgMother));
2740 if (labelLc != bachelorMotherLabel){
2742 AliDebug(2, Form(
"The proton comes from a Lc, but it is not the candidate we are analyzing"));
2746 AliDebug(2, Form(
"The proton comes from a Lc, and it is EXACTLY the candidate we are analyzing"));
2760 TClonesArray *mcArray ){
2771 if (labelFind == -1) {
2775 AliAODMCParticle *mcpart =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labelFind));
2778 if (TMath::Abs(pdg) != 310) {
2779 AliDebug(2, Form(
"K0Spart is not a K0S, but a particle with pdg code = %d", pdg));
2786 Int_t K0SpartMotherLabel = mcpart->GetMother();
2787 if (K0SpartMotherLabel == -1) {
2790 AliAODMCParticle *K0SpartMother =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(K0SpartMotherLabel));
2792 Int_t pdgMotherK0S = K0SpartMother->PdgCode();
2793 if (TMath::Abs(pdgMotherK0S) != 311) {
2794 AliDebug(2, Form(
"The K0S does not come from a K0, but from a particle with pdgcode = %d", pdgMotherK0S));
2799 Int_t K0MotherLabel = K0SpartMother->GetMother();
2800 if (K0MotherLabel == -1) {
2803 AliAODMCParticle *K0Mother =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(K0MotherLabel));
2805 Int_t pdgK0Mother = K0Mother->PdgCode();
2806 if (TMath::Abs(pdgK0Mother) != 4122) {
2807 AliDebug(2, Form(
"The K0 does not come from a Lc, but from a particle with pdgcode = %d", pdgK0Mother));
2812 if (labelLc != K0MotherLabel){
2813 AliDebug(2, Form(
"The K0S comes from a Lc, but it is not the candidate we are analyzing"));
2818 AliDebug(2, Form(
"The K0S comes from a Lc, and it is EXACTLY the candidate we are analyzing"));
2838 Int_t labMother[2]={-1, -1};
2839 AliAODMCParticle *
part=0;
2840 AliAODMCParticle *mother=0;
2841 Int_t dgLabels = -1;
2843 Int_t ndg = v0part->GetNDaughters();
2845 AliFatal(Form(
"IMPOSSIBLE!! There are %d daughters, but they should be 2!", ndg));
2848 for(
Int_t i = 0; i < 2; i++) {
2849 AliAODTrack *trk = (AliAODTrack*)v0part->GetDaughter(i);
2850 dgLabels = trk->GetLabel();
2851 if (dgLabels == -1) {
2855 part = (AliAODMCParticle*)mcArray->At(TMath::Abs(dgLabels));
2860 labMother[i] = part->GetMother();
2861 if (labMother[i] != -1){
2862 mother = (AliAODMCParticle*)mcArray->At(labMother[i]);
2873 if (labMother[0] == labMother[1])
return labMother[0];
2887 AliAODMCParticle *
part=0;
2888 AliAODMCParticle *mother=0;
2889 AliAODMCParticle *grandmother=0;
2890 Int_t dgLabels = -1;
2892 Int_t ndg = cascade->GetNDaughters();
2894 AliFatal(Form(
"IMPOSSIBLE!! There are %d daughters, but they should be 2!", ndg));
2898 AliAODTrack *trk = (AliAODTrack*)cascade->GetDaughter(0);
2899 dgLabels = trk->GetLabel();
2900 if (dgLabels == -1 ) {
2904 part = (AliAODMCParticle*)mcArray->At(TMath::Abs(dgLabels));
2909 Int_t labMotherBach = part->GetMother();
2910 if (labMotherBach == -1){
2913 mother = (AliAODMCParticle*)mcArray->At(labMotherBach);
2919 AliAODv0 *v0 = (AliAODv0*)cascade->GetDaughter(1);
2921 if (dgLabels == -1 ) {
2925 part = (AliAODMCParticle*)mcArray->At(TMath::Abs(dgLabels));
2930 Int_t labMotherv0 = part->GetMother();
2931 if (labMotherv0 == -1){
2934 mother = (AliAODMCParticle*)mcArray->At(labMotherv0);
2939 Int_t labGrandMotherv0 = mother->GetMother();
2940 if (labGrandMotherv0 == -1){
2943 grandmother = (AliAODMCParticle*)mcArray->At(labGrandMotherv0);
2950 if (labGrandMotherv0 == labMotherBach)
return labMotherBach;
2960 Int_t runNo =
event->GetRunNumber();
2964 if (runNo > 195343 && runNo < 195484) period = 0;
2965 if (runNo > 195528 && runNo < 195678) period = 1;
2966 if (period < 0 || period > 1) { AliInfo(Form(
"Run number %d not found for LHC13!",runNo));
return 0;}
2969 if ((runNo >=265499 && runNo <=265525) || (runNo >= 265309 && runNo <= 265387)) period = 0;
2970 else if (runNo == 265435) period = 1;
2971 else if (runNo >= 265388 && runNo <= 265427) period = 2;
2972 else if (runNo >=267163 && runNo <=276166) period = 3;
2973 if (period < 0 || period > 3) { AliInfo(Form(
"Run number %d not found for LHC16 pPb!",runNo));
return 0;}
2976 if (runNo >= 256219 && runNo <= 256418) period = 0;
2977 else if (runNo >= 256504 && runNo <= 258537) period = 1;
2978 else if (runNo >= 258883 && runNo <= 260187) period = 2;
2979 if (period < 0 || period > 2) {AliInfo(Form(
"Run number %d not found for LHC16 pp!",runNo));
return 0;}
2982 if (runNo > 114930 && runNo < 117223) period = 0;
2983 if (runNo > 119158 && runNo < 120830) period = 1;
2984 if (runNo > 122373 && runNo < 126438) period = 2;
2985 if (runNo > 127711 && runNo < 130851) period = 3;
2986 if (period < 0 || period > 3) {AliInfo(Form(
"Run number %d not found for LHC10 pp!",runNo));
return 0;}
Float_t fCutKFDeviationFromVtxV0
cut for KF on distance to primary vtx
TH1D * fHistoDistanceV0ToLc
! KF: distance V0 vertex from Lc vertex
TH2D * fHistoArmenterosPodolanskiV0KFSgn
! KF: Armeteros-Podolanski plot for V0 from signal Lc from KF
void FillMCHisto(TClonesArray *mcArray)
TList * fListCounters
list of weights
TH1D * fHistoKFV0
! KF: V0 code from KF (mass, decaylength, lifetime considered)
TH1D * fHistoDecayLengthLcTrue
! KF: decay length for true cascades reconstructed with KF
void StoreCandidates(AliVEvent *, Int_t nCand=0, Bool_t flagFilter=kTRUE)
TH1F * fHistoLc
! histogram with number of Lc
TH1F * fHistNtrCorrEvWithCand
! hist. of ntracklets for evnts with a candidate
Double_t Ct(UInt_t pdg) const
TTree * fVariablesTreeSgn
flag for event selected
TList * fListMultiplicityHistograms
reference multiplicity
Int_t MatchToMC(Int_t pdgabs, Int_t pdgabs2prong, Int_t *pdgDg, Int_t *pdgDg2prong, TClonesArray *mcArray, Bool_t isV0=kFALSE) const
AliAODTrack * Getv0NegativeTrack() const
TH2D * fHistoLifeTimeKFLc
! KF: life time vs life time error for Lc from KF
AliPIDCombined * fPIDCombined
! combined PID response object
TH1F * fHistNtrUnCorrEvWithCand
! hist. of ntracklets for evnts with a candidate
TH2D * fHistoArmenterosPodolanskiV0AODSgn
! KF: AOD Armeteros-Podolanski plot for V0 from signal Lc from KF
TH1D * fHistoVtxV0ResidualToPrimVtx
! KF: residual wrt MC of distance V0 vertex from primary vertex (MC - KF)
TH1F * fHistoLcpKpiBeforeCuts
! histogram number of true Lc–>pKpi (3 prong) before any cut
Bool_t fKeepingOnlyPYTHIABkg
magnetic field of current event
AliNormalizationCounter * fCounterC
!Counter for normalization, corrected multiplicity
Double_t InvMassLctoLambdaPi() const
TH1D * fHistoDecayLengthV0All
! KF: decay length for all V0 reconstructed with KF
virtual void UserCreateOutputObjects()
Implementation of interface methods.
virtual void Terminate(Option_t *option)
TH1D * fHistoDecayLengthLcAll
! KF: decay length for all Lc reconstructed with KF
Bool_t fKeepingOnlyHIJINGBkg
flag to decide whether to call or not KF
TH1D * fHistoLifeTimeV0All
! KF: life time for all V0 reconstructed with KF
AliNormalizationCounter * fCounterU
!Counter for normalization, uncorrected multiplicity
AliRDHFCutsLctoV0 * fAnalCuts
Float_t * fCandidateVariables
! variables to be written to the tree
TH1D * fHistoMassV0TrueK0S
! KF: mass for true V0 which are really K0S reconstructed with KF
TH2D * fHistoDecayLengthKFLc
! KF: decay length vs decay length error for Lc from KF
TList * fOutputKF
! User output1: list of histograms from KF
TF1 * fFuncWeightFONLL5overLHC13d3
! weight function for FONLL vs pPb prod.
AliNormalizationCounter * fCounter
switch between Lpi and K0sp
Bool_t fIsEventSelected
flag to analyze also on-the-fly V0 candidates
static Int_t CheckOrigin(TClonesArray *arrayMC, AliAODMCParticle *mcPart, Bool_t searchUpToQuark=kTRUE)
Functions to check the decay tree.
Double_t GetMaxVtxZ() const
Bool_t ftopoConstraint
label of candidate
TString part
use mixed event to constrain combinatorial background
TF1 * fFuncWeightFONLL5overLHC13d3Lc
! weight function for FONLL vs pPb prod.
TH1D * fHistoDecayLengthV0fromLcAll
! KF: decay length of V0 for all cascades reconstructed with KF
Double_t InvMassLctoK0sP() const
TH1D * fHistoMassV0TrueK0SFromAOD
! KF: AOD mass for true V0 which are really K0S reconstructed with KF
TH2F * fHistNtrCorrVsZvtx
! hist of corrected ntracklets vs. z_vtx
TH1F * fHistoLcOnTheFly
! histogram with number of Lc with on-the-fly V0
TH1D * fHistoLifeTimeLcTrue
! KF: life time for true cascades reconstructed with KF
TH1D * fHistoKFLc
! KF: Lc code from KF (mass, decaylength, lifetime considered)
TH2D * fHistoKF
! KF: V0 code vs Lc code from KF (mass, decaylength, lifetime considered)
Int_t CallKFVertexing(AliAODRecoCascadeHF *cascade, AliAODv0 *v0part, AliAODTrack *bach, TClonesArray *mcArray, Double_t *V0KF, Double_t *errV0KF, Double_t *LcKF, Double_t *errLcKF, Double_t *distances, Double_t *armPolKF)
AliAODTrack * Getv0PositiveTrack() const
TH1D * fHistoLifeTimeLcSgn
! KF: life time of signal Lc reconstructed with KF
TH1F * fHistoMCNch
! histogram with Nch distribution from MC production
TH1D * fHistoDistanceV0ToPrimVtx
! KF: distance V0 vertex from primary vertex
void SetStudyMultiplicity(Bool_t flag, Float_t etaRange)
TH1D * fHistoMassLcSgnFromAOD
! KF: AOD mass of signal Lc reconstructed with KF
static Int_t GetNumberOfTrackletsInEtaRange(AliAODEvent *ev, Double_t mineta, Double_t maxeta)
TH2F * fHistNtrVsZvtx
! hist of ntracklets vs. z_vtx
Bool_t fUseOnTheFlyV0
list of profiles for z-vtx correction of multiplicity
Int_t fNTracklets
switch to change system/year in use for loading of mult. estimators
TH1D * fHistoMassLcAll
! KF: mass for all Lc reconstructed with KF
TH1D * fHistoDistanceV0ToLcSgn
! KF: distance for signal Lc of V0 vertex from Lc vertex
TH1D * fHistoMassV0fromLcAll
! KF: mass of V0 for all cascades reconstructed with KF
TH1D * fHistoDecayLengthLcSgn
! KF: decay length of signal Lc reconstructed with KF
TH1F * fHistoMCLcK0SpGenAcc
! histo with MC Lc –> K0S + p
virtual ~AliAnalysisTaskSELc2V0bachelorTMVA()
TH1D * fHistoMassLcTrueFromAOD
! KF: AOD mass for true cascades reconstructed with KF
TH1D * fHistoMassV0fromLcSgn
! KF: mass of V0 for signal Lc reconstructed with KF
AliAODTrack * GetBachelor() const
Int_t FindLcLabel(AliAODRecoCascadeHF *cascade, TClonesArray *mcArray) const
TList * fOutput
Use MC info.
TH1D * fHistoLifeTimeV0fromLcAll
! KF: life time of V0 for all cascades reconstructed with KF
virtual void UserExec(Option_t *option)
TH2D * fHistoLifeTimeKFV0
! KF: life time vs life time error for V0 from KF
TH1D * fHistoMassV0TrueFromAOD
! KF: AOD mass for true V0 reconstructed with KF
Double_t fBField
current event number - for debug purposes
TH2D * fHistoDecayLengthKFV0
! KF: decay length vs decay length error for V0 from KF
Bool_t HasCascadeCandidateAnyDaughInjected(AliAODRecoCascadeHF *cand, AliAODMCHeader *header, TClonesArray *arrayMC)
TH1D * fHistoDecayLengthV0True
! KF: decay length for true V0 reconstructed with KF
TH1F * fHistoFiducialAcceptance
! histogram to check FiducialAcceptance cut
TH2F * fHistoCodesBkg
! histogram with codes for bachelor and V0 for background
Double_t CosV0PointingAngle() const
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
TH1D * fHistoLifeTimeV0fromLcTrue
! KF: life time of V0 for true cascades reconstructed with KF
AliVertexingHFUtils * fUtils
flag to fill bkg with only candidates that have daughters generated by HIJING (to be used for enriche...
EBachelor CheckBachelor(AliAODRecoCascadeHF *part, AliAODTrack *bachelor, TClonesArray *mcArray)
TH1D * fHistoDecayLengthV0fromLcSgn
! KF: decay length of V0 for signal Lc reconstructed with KF
static Double_t GetCorrectedNtracklets(TProfile *estimatorAvg, Double_t uncorrectedNacc, Double_t vtxZ, Double_t refMult)
void MakeAnalysisForLc2prK0S(TClonesArray *arrayLctopK0s, TClonesArray *mcArray, Int_t &nSelectedAnal, AliRDHFCutsLctoV0 *cutsAnal, TClonesArray *array3Prong, AliAODMCHeader *aodheader)
Bool_t IsEventSelected(AliVEvent *event)
TH1F * fHistoLcBeforeCuts
flag to fill only signal (speeding up processing)
void StoreEvent(AliVEvent *, AliRDHFCuts *, Bool_t mc=kFALSE, Int_t multiplicity=-9999, Double_t spherocity=-99.)
TH1D * fHistoDecayLengthV0TrueK0S
! KF: decay length for true V0 which are really K0S reconstructed with KF
void SetUsePID(Bool_t flag=kTRUE)
TH1D * fHistoLifeTimeLcAll
! KF: life time for all Lc reconstructed with KF
TH1D * fHistoMassV0All
! KF: mass for all V0 reconstructed with KF
TProfile * GetEstimatorHistogram(const AliVEvent *event)
TH1D * fHistoMassLcTrue
! KF: mass for true cascades reconstructed with KF
TH1D * fHistoLifeTimeV0True
! KF: life time for true V0 reconstructed with KF
TH1F * fHistoMCLcK0SpGenLimAcc
! histo with MC Lc –> K0S + p
TH2D * fHistoArmenterosPodolanskiV0AOD
! KF: AOD Armeteros-Podolanski plot for all V0 from KF
TH1D * fHistoVtxV0ResidualToLc
! KF: residual wrt MC of distance V0 vertex from Lc vertex (MC - KF)
Float_t fCutKFDeviationFromVtx
cut for KF on chi2/NDF
Bool_t CheckCascadeFlags(AliRDHFCuts::ESele selFlag=AliRDHFCuts::kLctoV0Cuts)
TH1D * fHistoDistanceV0ToPrimVtxSgn
! KF: distance for signal Lc of V0 vertex from primary vertex
TF1 * fFuncWeightPythia
mask to the trigger word returned by the physics selection
TH2D * fHistoArmenterosPodolanskiV0KF
! KF: Armeteros-Podolanski plot for all V0 from KF
TH1D * fHistoDecayLengthV0fromLcTrue
! KF: decay length of V0 for true cascades reconstructed with KF
Bool_t GetIsUsePID() const
Double_t fRefMult
TProfile with mult vs. Z per period.
TH1F * fHistNtrUnCorrEvSel
! hist. of ntracklets for selected events
enum for setting analysis system/year (for loading profile histograms for multiplicity correction) ...
AliNormalizationCounter * fCounterCandidates
!Counter for normalization, corrected multiplicity for candidates
TH1D * fHistoLifeTimeV0fromLcSgn
! KF: life time of V0 for signal Lc reconstructed with KF
TTree * fVariablesTreeBkg
! tree of the candidate variables after track selection (Background)
TH1D * fHistoDistanceLcToPrimVtx
primary vertex
Double_t DecayLengthV0() const
void SetTriggerClass(TString trclass0, TString trclass1="")
TH1D * fHistoDistanceLcToPrimVtxSgn
! KF: distance of signal Lc vertex from primary vertex
AliPIDResponse * fPIDResponse
! PID response object
virtual Bool_t IsInFiducialAcceptance(Double_t pt, Double_t y) const
TProfile * fMultEstimatorAvg[4]
tracklet multiplicity in event
TList * fListCuts
Cuts - sent to output slot 5.
EK0S CheckK0S(AliAODRecoCascadeHF *part, AliAODv0 *v0part, TClonesArray *mcArray)
TH1D * fHistoLifeTimeV0TrueK0S
! KF: life time for true V0 which are really K0S reconstructed with KF
TH1F * fHistoMCLcK0SpGen
flag to allow to use only PYTHIA tracks for background
Double_t DecayLength() const
AliAnalysisTaskSELc2V0bachelorTMVA()
TH2D * fHistoMassKFLc
! KF: mass vs mass error for Lc from KF
Bool_t fCallKFVertexing
flag to use topological constraints in KF
Int_t IsSelectedSingleCut(TObject *obj, Int_t selectionLevel, Int_t cutIndex, AliAODEvent *aod=0x0)
Int_t fCurrentEvent
cut for KF on distance to primary vtx for V0
void FillLc2pK0Sspectrum(AliAODRecoCascadeHF *part, Int_t isLc, Int_t &nSelectedAnal, AliRDHFCutsLctoV0 *cutsAnal, TClonesArray *mcArray, Int_t iLctopK0s)
histos
TH1F * fHistoEvents
flag for running on pA
TH1F * fCEvents
! Histogram to check selected events
TH1D * fHistoVtxLcResidualToPrimVtx
! KF: residual wrt MC of distance Lc vertex from primary vertex (MC - KF)
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
void SetTriggerMask(ULong64_t mask=0)
TH1D * fHistoMassV0True
! KF: mass for true V0 reconstructed with KF
TH2D * fHistoMassKFV0
! KF: mass vs mass error for V0 from KF
TH1F * fHistNtrCorrEvSel
! hist. of ntracklets for selected events
Int_t FindV0Label(AliAODRecoDecay *v0part, TClonesArray *mcArray) const
TH1D * fHistoMassLcSgn
! KF: mass of signal Lc reconstructed with KF
TH2F * fHistoCodesSgn
! histogram with codes for bachelor and V0 for signal
TH1D * fHistoMassV0fromLcTrue
! KF: mass of V0 for true cascades reconstructed with KF
Class with functions useful for different D2H analyses //.
TH1F * fHistoBackground
AliVertexingHFUtils used to check the generator of a specific candidate.