31 #include <TParticle.h> 32 #include <TParticlePDG.h> 39 #include <TDatabasePDG.h> 42 #include <TLorentzVector.h> 44 #include <AliAnalysisDataSlot.h> 45 #include <AliAnalysisDataContainer.h> 46 #include "AliMCEvent.h" 47 #include "AliAnalysisManager.h" 48 #include "AliAODMCHeader.h" 49 #include "AliAODHandler.h" 51 #include "AliAODVertex.h" 52 #include "AliAODRecoDecay.h" 56 #include "AliESDtrack.h" 57 #include "AliAODTrack.h" 59 #include "AliAODMCParticle.h" 60 #include "AliAnalysisTaskSE.h" 64 #include "AliPIDResponse.h" 65 #include "AliPIDCombined.h" 66 #include "AliTOFPIDResponse.h" 67 #include "AliInputEventHandler.h" 69 #include "AliKFParticle.h" 70 #include "AliKFVertex.h" 71 #include "AliExternalTrackParam.h" 72 #include "AliESDUtils.h" 91 fIsK0sAnalysis(kFALSE),
99 fUseOnTheFlyV0(kFALSE),
100 fIsEventSelected(kFALSE),
101 fVariablesTreeSgn(0),
102 fVariablesTreeBkg(0),
103 fCandidateVariables(),
107 fFillOnlySgn(kFALSE),
108 fHistoLcBeforeCuts(0),
109 fHistoFiducialAcceptance(0),
112 fHistoLcpKpiBeforeCuts(0),
115 fHistoDistanceLcToPrimVtx(0),
116 fHistoDistanceV0ToPrimVtx(0),
117 fHistoDistanceV0ToLc(0),
118 fHistoDistanceLcToPrimVtxSgn(0),
119 fHistoDistanceV0ToPrimVtxSgn(0),
120 fHistoDistanceV0ToLcSgn(0),
121 fHistoVtxLcResidualToPrimVtx(0),
122 fHistoVtxV0ResidualToPrimVtx(0),
123 fHistoVtxV0ResidualToLc(0),
125 fHistoDecayLengthV0All(0),
126 fHistoLifeTimeV0All(0),
128 fHistoDecayLengthV0True(0),
129 fHistoLifeTimeV0True(0),
130 fHistoMassV0TrueFromAOD(0),
131 fHistoMassV0TrueK0S(0),
132 fHistoDecayLengthV0TrueK0S(0),
133 fHistoLifeTimeV0TrueK0S(0),
134 fHistoMassV0TrueK0SFromAOD(0),
136 fHistoDecayLengthLcAll(0),
137 fHistoLifeTimeLcAll(0),
139 fHistoDecayLengthLcTrue(0),
140 fHistoLifeTimeLcTrue(0),
141 fHistoMassLcTrueFromAOD(0),
142 fHistoMassV0fromLcAll(0),
143 fHistoDecayLengthV0fromLcAll(0),
144 fHistoLifeTimeV0fromLcAll(0),
145 fHistoMassV0fromLcTrue(0),
146 fHistoDecayLengthV0fromLcTrue(0),
147 fHistoLifeTimeV0fromLcTrue(0),
149 fHistoMassLcSgnFromAOD(0),
150 fHistoDecayLengthLcSgn(0),
151 fHistoLifeTimeLcSgn(0),
152 fHistoMassV0fromLcSgn(0),
153 fHistoDecayLengthV0fromLcSgn(0),
154 fHistoLifeTimeV0fromLcSgn(0),
159 fHistoDecayLengthKFV0(0),
160 fHistoLifeTimeKFV0(0),
162 fHistoDecayLengthKFLc(0),
163 fHistoLifeTimeKFLc(0),
164 fHistoArmenterosPodolanskiV0KF(0),
165 fHistoArmenterosPodolanskiV0KFSgn(0),
166 fHistoArmenterosPodolanskiV0AOD(0),
167 fHistoArmenterosPodolanskiV0AODSgn(0),
170 ftopoConstraint(kTRUE),
171 fCallKFVertexing(kFALSE),
172 fKeepingOnlyHIJINGBkg(kFALSE),
175 fCutKFChi2NDF(999999.),
176 fCutKFDeviationFromVtx(999999.),
177 fCutKFDeviationFromVtxV0(0.),
180 fKeepingOnlyPYTHIABkg(kFALSE),
181 fHistoMCLcK0SpGen(0),
182 fHistoMCLcK0SpGenAcc(0),
183 fHistoMCLcK0SpGenLimAcc(0),
185 fFuncWeightPythia(0),
186 fFuncWeightFONLL5overLHC13d3(0),
187 fFuncWeightFONLL5overLHC13d3Lc(0),
193 fBDTHistoVsMassK0S(0),
194 fBDTHistoVstImpParBach(0),
195 fBDTHistoVstImpParV0(0),
196 fBDTHistoVsBachelorPt(0),
197 fBDTHistoVsCombinedProtonProb(0),
199 fBDTHistoVsCosPAK0S(0),
200 fBDTHistoVsSignd0(0),
201 fBDTHistoVsCosThetaStar(0),
334 Info(
"AliAnalysisTaskSELc2V0bachelorTMVAApp",
"Calling Constructor");
336 DefineOutput(1, TList::Class());
337 DefineOutput(2, TList::Class());
338 DefineOutput(3, TList::Class());
339 DefineOutput(4, TTree::Class());
340 DefineOutput(5, TTree::Class());
341 DefineOutput(6, TList::Class());
342 DefineOutput(7, TList::Class());
350 Info(
"~AliAnalysisTaskSELc2V0bachelorTMVAApp",
"Calling Destructor");
424 if (fDebug > 1) AliInfo(
"Init");
449 AliInfo(
"Terminate");
450 AliAnalysisTaskSE::Terminate();
454 AliError(
"fOutput not available");
459 AliInfo(Form(
"At MC level, %f Lc --> K0S + p were found",
fHistoMCLcK0SpGen->GetEntries()));
461 AliInfo(
"fHistoMCLcK0SpGen not available");
464 AliInfo(Form(
"At MC level, %f Lc --> K0S + p were found in the acceptance",
fHistoMCLcK0SpGenAcc->GetEntries()));
466 AliInfo(
"fHistoMCLcK0SpGenAcc not available");
469 AliInfo(Form(
"At Reco level, %lld Lc --> K0S + p were found",
fVariablesTreeSgn->GetEntries()));
471 AliInfo(
"fVariablesTreeSgn not available");
476 AliError(
"fOutputKF not available");
486 AliInfo(Form(
"CreateOutputObjects of task %s\n", GetName()));
493 const char* nameoutput = GetOutputSlot(1)->GetContainer()->GetName();
505 fCandidateVariableNames[0]=
"massLc2K0Sp";
506 fCandidateVariableNames[1]=
"massLc2Lambdapi";
507 fCandidateVariableNames[2]=
"massK0S";
508 fCandidateVariableNames[3]=
"massLambda";
509 fCandidateVariableNames[4]=
"massLambdaBar";
510 fCandidateVariableNames[5]=
"cosPAK0S";
511 fCandidateVariableNames[6]=
"dcaV0";
512 fCandidateVariableNames[7]=
"tImpParBach";
513 fCandidateVariableNames[8]=
"tImpParV0";
514 fCandidateVariableNames[9]=
"nSigmaTPCpr";
515 fCandidateVariableNames[10]=
"nSigmaTOFpr";
516 fCandidateVariableNames[11]=
"bachelorPt";
517 fCandidateVariableNames[12]=
"V0positivePt";
518 fCandidateVariableNames[13]=
"V0negativePt";
519 fCandidateVariableNames[14]=
"dcaV0pos";
520 fCandidateVariableNames[15]=
"dcaV0neg";
521 fCandidateVariableNames[16]=
"v0Pt";
522 fCandidateVariableNames[17]=
"massGamma";
523 fCandidateVariableNames[18]=
"LcPt";
524 fCandidateVariableNames[19]=
"combinedProtonProb";
525 fCandidateVariableNames[20]=
"LcEta";
526 fCandidateVariableNames[21]=
"V0positiveEta";
527 fCandidateVariableNames[22]=
"V0negativeEta";
528 fCandidateVariableNames[23]=
"TPCProtonProb";
529 fCandidateVariableNames[24]=
"TOFProtonProb";
530 fCandidateVariableNames[25]=
"bachelorEta";
531 fCandidateVariableNames[26]=
"LcP";
532 fCandidateVariableNames[27]=
"bachelorP";
533 fCandidateVariableNames[28]=
"v0P";
534 fCandidateVariableNames[29]=
"V0positiveP";
535 fCandidateVariableNames[30]=
"V0negativeP";
536 fCandidateVariableNames[31]=
"v0Eta";
537 fCandidateVariableNames[32]=
"DecayLengthLc";
538 fCandidateVariableNames[33]=
"DecayLengthK0S";
539 fCandidateVariableNames[34]=
"bachCode";
540 fCandidateVariableNames[35]=
"k0SCode";
541 fCandidateVariableNames[36]=
"alphaArm";
542 fCandidateVariableNames[37]=
"ptArm";
543 fCandidateVariableNames[38]=
"CosThetaStar";
544 fCandidateVariableNames[39]=
"weightPtFlat";
545 fCandidateVariableNames[40]=
"weightFONLL5overLHC13d3";
546 fCandidateVariableNames[41]=
"weightFONLL5overLHC13d3Lc";
547 fCandidateVariableNames[42]=
"weightNch";
548 fCandidateVariableNames[43]=
"NtrkRaw";
549 fCandidateVariableNames[44]=
"NtrkCorr";
550 fCandidateVariableNames[45]=
"signd0";
551 fCandidateVariableNames[46]=
"centrality";
554 fCandidateVariableNames[0]=
"massLc2K0Sp";
555 fCandidateVariableNames[1]=
"massLc2Lambdapi";
556 fCandidateVariableNames[2]=
"massK0S";
557 fCandidateVariableNames[3]=
"massLambda";
558 fCandidateVariableNames[4]=
"massLambdaBar";
559 fCandidateVariableNames[5]=
"cosPAK0S";
560 fCandidateVariableNames[6]=
"dcaV0";
561 fCandidateVariableNames[7]=
"tImpParBach";
562 fCandidateVariableNames[8]=
"tImpParV0";
563 fCandidateVariableNames[9]=
"nSigmaTPCpr";
564 fCandidateVariableNames[10]=
"nSigmaTOFpr";
565 fCandidateVariableNames[11]=
"bachelorPt";
566 fCandidateVariableNames[12]=
"V0positivePt";
567 fCandidateVariableNames[13]=
"V0negativePt";
568 fCandidateVariableNames[14]=
"dcaV0pos";
569 fCandidateVariableNames[15]=
"dcaV0neg";
570 fCandidateVariableNames[16]=
"v0Pt";
571 fCandidateVariableNames[17]=
"massGamma";
572 fCandidateVariableNames[18]=
"LcPt";
573 fCandidateVariableNames[19]=
"combinedProtonProb";
574 fCandidateVariableNames[20]=
"V0positiveEta";
575 fCandidateVariableNames[21]=
"V0negativeEta";
576 fCandidateVariableNames[22]=
"bachelorEta";
577 fCandidateVariableNames[23]=
"v0P";
578 fCandidateVariableNames[24]=
"DecayLengthK0S";
579 fCandidateVariableNames[25]=
"alphaArm";
580 fCandidateVariableNames[26]=
"ptArm";
581 fCandidateVariableNames[27]=
"NtrkRaw";
582 fCandidateVariableNames[28]=
"NtrkCorr";
583 fCandidateVariableNames[29]=
"CosThetaStar";
584 fCandidateVariableNames[30]=
"signd0";
585 fCandidateVariableNames[31]=
"centrality";
588 for(
Int_t ivar=0; ivar<nVar; ivar++){
593 fHistoCentrality =
new TH1F(
"fHistoCentrality",
"fHistoCentrality", 100, 0., 100.);
595 fHistoEvents =
new TH1F(
"fHistoEvents",
"fHistoEvents", 2, -0.5, 1.5);
596 TString labelEv[2] = {
"NotSelected",
"Selected"};
601 fHistoLc =
new TH1F(
"fHistoLc",
"fHistoLc", 2, -0.5, 1.5);
603 fHistoLcOnTheFly =
new TH1F(
"fHistoLcOnTheFly",
"fHistoLcOnTheFly", 4, -0.5, 3.5);
604 TString labelOnTheFly[4] = {
"OnTheFly-Bkg",
"OfflineBkg",
"OnTheFly-Sgn",
"OfflineSgn"};
609 fHistoLcBeforeCuts =
new TH1F(
"fHistoLcBeforeCuts",
"fHistoLcBeforeCuts", 2, -0.5, 1.5);
610 TString labelBeforeCuts[2] = {
"Bkg",
"Sgn"};
613 fHistoLc->GetXaxis()->SetBinLabel(ibin, labelBeforeCuts[ibin-1].
Data());
617 TString labelAcc[4] = {
"NotOk-Bkg",
"Ok-Bkg",
"NotOk-Sgn",
"Ok-Sgn"};
622 fHistoCodesSgn =
new TH2F(
"fHistoCodesSgn",
"fHistoCodes for Signal; bachelor; K0S", 7, -1.5, 5.5, 9, -1.5, 7.5);
623 fHistoCodesBkg =
new TH2F(
"fHistoCodesBkg",
"fHistoCodes for Background; bachelor; K0S", 7, -1.5, 5.5, 9, -1.5, 7.5);
625 TString labelx[7] = {
"kBachInvalid",
"kBachFake",
"kBachNoProton",
"kBachPrimary",
"kBachNoLambdaMother",
626 "kBachDifferentLambdaMother",
"kBachCorrectLambdaMother"};
627 TString labely[9] = {
"kK0SInvalid",
"kK0SFake",
"kK0SNoK0S",
"kK0SWithoutMother",
"kK0SNotFromK0",
628 "kK0Primary",
"kK0NoLambdaMother",
"kK0DifferentLambdaMother",
"kK0CorrectLambdaMother"};
644 fHistoBackground =
new TH1F(
"fHistoBackground",
"fHistoBackground", 4, -0.5, 3.5);
645 TString labelBkg[4] = {
"Injected",
"Non-injected",
"Non-PYTHIA",
"PYTHIA"};
650 const Float_t ptbins[15] = {0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 12., 17., 25., 35.};
652 fHistoMCLcK0SpGen =
new TH1F(
"fHistoMCLcK0SpGen",
"fHistoMCLcK0SpGen", 14, ptbins);
671 fBDTHisto =
new TH2D(
"fBDTHisto",
"Lc inv mass vs bdt output; bdt; m_{inv}(pK^{0}_{S})[GeV/#it{c}^{2}]", 10000, -1, 1, 1000, 2.05, 2.55);
672 fBDTHistoVsMassK0S =
new TH2D(
"fBDTHistoVsMassK0S",
"K0S inv mass vs bdt output; bdt; m_{inv}(#pi^{+}#pi^{#minus})[GeV/#it{c}^{2}]", 10000, -1, 1, 1000, 0.485, 0.51);
673 fBDTHistoVstImpParBach =
new TH2D(
"fBDTHistoVstImpParBach",
"d0 bachelor vs bdt output; bdt; d_{0, bachelor}[cm]", 10000, -1, 1, 1000, -1, 1);
674 fBDTHistoVstImpParV0 =
new TH2D(
"fBDTHistoVstImpParV0",
"d0 K0S vs bdt output; bdt; d_{0, V0}[cm]", 10000, -1, 1, 1000, -1, 1);
675 fBDTHistoVsBachelorPt =
new TH2D(
"fBDTHistoVsBachelorPt",
"bachelor pT vs bdt output; bdt; p_{T, bachelor}[GeV/#it{c}]", 10000, -1, 1, 1000, 0, 20);
676 fBDTHistoVsCombinedProtonProb =
new TH2D(
"fBDTHistoVsCombinedProtonProb",
"combined proton probability vs bdt output; bdt; Bayesian PID_{bachelor}", 10000, -1, 1, 1000, 0, 1);
677 fBDTHistoVsCtau =
new TH2D(
"fBDTHistoVsCtau",
"K0S ctau vs bdt output; bdt; c#tau_{V0}[cm]", 10000, -1, 1, 1000, -2, 2);
678 fBDTHistoVsCosPAK0S =
new TH2D(
"fBDTHistoVsCosPAK0S",
"V0 cosine pointing angle vs bdt output; bdt; CosPAK^{0}_{S}", 10000, -1, 1, 1000, 0.9, 1);
679 fBDTHistoVsCosThetaStar =
new TH2D(
"fBDTHistoVsCosThetaStar",
"proton emission angle in pK0s pair rest frame vs bdt output; bdt; Cos#Theta*", 10000, -1, 1, 1000, -1, 1);
680 fBDTHistoVsSignd0 =
new TH2D(
"fBDTHistoVstImpParBach",
"signed d0 bachelor vs bdt output; bdt; signd_{0, bachelor}[cm]", 10000, -1, 1, 1000, -1, 1);
681 fHistoNsigmaTPC =
new TH2D(
"fHistoNsigmaTPC",
"; #it{p} (GeV/#it{c}); n_{#sigma}^{TPC} (proton hypothesis)", 500, 0, 5, 1000, -5, 5);
682 fHistoNsigmaTOF =
new TH2D(
"fHistoNsigmaTOF",
"; #it{p} (GeV/#it{c}); n_{#sigma}^{TOF} (proton hypothesis)", 500, 0, 5, 1000, -5, 5);
716 AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
735 fPIDCombined->SetDetectorMask(AliPIDResponse::kDetTPC+AliPIDResponse::kDetTOF);
754 fHistoDistanceV0ToLc =
new TH1D(
"fHistoDistanceV0ToLc",
"V0 distance to Lc Vertex from KF; distance [cm]", 1000, 0., 100.);
758 fHistoDistanceV0ToLcSgn =
new TH1D(
"fHistoDistanceV0ToLcSgn",
"V0 Sgn distance to Lc Vertex from KF; distance [cm]", 1000, 0., 100.);
760 fHistoVtxLcResidualToPrimVtx =
new TH1D(
"fHistoVtxLcResidualToPrimVtx",
"Residual between MC and KF (MC - KF): Lc to Prim Vtx; distance [cm]", 1000, -5., 5.);
761 fHistoVtxV0ResidualToPrimVtx =
new TH1D(
"fHistoVtxV0ResidualToPrimVtx",
"Residual between MC and KF (MC - KF): V0 to Prim Vtx; distance [cm]", 1000, -5., 5.);
762 fHistoVtxV0ResidualToLc =
new TH1D(
"fHistoVtxV0ResidualToLc",
"Residual between MC and KF: V0 to Lc (MC - KF); distance [cm]", 1000, -5., 5.);
801 fHistoLifeTimeLcSgn =
new TH1D(
"fHistoLifeTimeLcSgn",
"True Lc Signal Life Time; lifeTime", 100000, -0.1, 0.1);
807 fHistoKF =
new TH2D(
"fHistoKF",
"Summary from KF; V0 KF; Lc KF", 16, -0.5, 15.5, 16, -0.5, 15.5);
808 fHistoKFV0 =
new TH1D(
"fHistoKFV0",
"Summary from KF; V0 KF", 16, -0.5, 15.5);
809 fHistoKFLc =
new TH1D(
"fHistoKFLc",
"Summary from KF; V0 KF", 16, -0.5, 15.5);
810 TString axisLabel[16] = {
"AllOk",
"M_NotOk",
"Sm_NotOk",
"Dl_NotOk",
811 "Lt_NotOk",
"M_Sm_NotOk",
"M_Dl_NotOk",
"M_Lt_NotOk",
812 "Dl_Sm_NotOk",
"Dl_Lt_NotOk",
"Sm_Lt_NotOk",
"M_Sm_Dl_NotOk",
813 "M_Sm_Lt_NotOk",
"Sm_Dl_Lt_NotOk",
"M_Dl_Lt_NotOk",
"All_NotOk"};
815 for (
Int_t ibin = 1; ibin <=16; ibin++){
816 fHistoKF->GetXaxis()->SetBinLabel(ibin, axisLabel[ibin-1].
Data());
817 fHistoKF->GetYaxis()->SetBinLabel(ibin, axisLabel[ibin-1].
Data());
818 fHistoKFV0->GetXaxis()->SetBinLabel(ibin, axisLabel[ibin-1].
Data());
819 fHistoKFLc->GetXaxis()->SetBinLabel(ibin, axisLabel[ibin-1].
Data());
822 fHistoMassKFV0 =
new TH2D(
"fHistoMassKFV0",
"mass vs sigmaMass for V0; mass; sigmaMass", 500, 0.4, 0.6, 500, 0., 10);
823 fHistoDecayLengthKFV0 =
new TH2D(
"fHistoDecayLengthKFV0",
"decayLength vs sigmaDecayLength for V0; decayLength; sigmaDecayLength", 500, -10, 10, 500, 0., 10);
824 fHistoLifeTimeKFV0 =
new TH2D(
"fHistoLifeTimeKFV0",
"lifeTime vs sigmalifeTime for V0; lifeTime; sigmaLifeTime", 500, -10, 10, 500, 0., 10);
826 fHistoMassKFLc =
new TH2D(
"fHistoMassKFLc",
"mass vs sigmaMass for Lc; mass; sigmaMass", 500, 0.4, 0.6, 500, 0., 10);
827 fHistoDecayLengthKFLc =
new TH2D(
"fHistoDecayLengthKFLc",
"decayLength vs sigmaDecayLength for Lc; decayLength; sigmaDecayLength", 500, -10, 10, 500, 0., 10);
828 fHistoLifeTimeKFLc =
new TH2D(
"fHistoLifeTimeKFLc",
"lifeTime vs sigmalifeTime for Lc; lifeTime; sigmaLifeTime", 500, -10, 10, 500, 0., 10);
898 fFuncWeightPythia =
new TF1(
"funcWeightPythia",
"1./(30. *[0]*x/TMath::Power(1.+(TMath::Power((x/[1]),[3])),[2]))",0.15,30);
903 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.);
904 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);
906 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.);
907 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);
921 AliError(
"NO EVENT FOUND!");
928 TClonesArray *arrayLctopKos=0;
930 TClonesArray *array3Prong = 0;
932 if (!aodEvent && AODEvent() && IsStandardAOD()) {
935 aodEvent =
dynamic_cast<AliAODEvent*
> (AODEvent());
938 AliAODHandler* aodHandler = (AliAODHandler*)
939 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
941 if (aodHandler->GetExtensions()) {
942 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(
"AliAOD.VertexingHF.root");
944 arrayLctopKos=(TClonesArray*)aodFromExt->GetList()->FindObject(
"CascadesHF");
946 array3Prong=(TClonesArray*)aodFromExt->GetList()->FindObject(
"Charm3Prong");
949 arrayLctopKos=(TClonesArray*)aodEvent->GetList()->FindObject(
"CascadesHF");
951 array3Prong=(TClonesArray*)aodEvent->GetList()->FindObject(
"Charm3Prong");
959 Int_t runnumber = aodEvent->GetRunNumber();
960 if (aodEvent->GetTriggerMask() == 0 && (runnumber >= 195344 && runnumber <= 195677)){
961 AliDebug(3,
"Event rejected because of null trigger mask");
968 TClonesArray *mcArray = 0;
969 AliAODMCHeader *mcHeader=0;
975 mcArray =
dynamic_cast<TClonesArray*
>(aodEvent->FindListObject(AliAODMCParticle::StdBranchName()));
977 AliError(
"Could not find Monte-Carlo in AOD");
981 mcHeader = (AliAODMCHeader*)aodEvent->GetList()->FindObject(AliAODMCHeader::StdBranchName());
983 AliError(
"AliAnalysisTaskSELc2V0bachelorTMVAApp::UserExec: MC header branch not found!\n");
987 Double_t zMCVertex = mcHeader->GetVtxZ();
1002 fVtx1 = (AliAODVertex*)aodEvent->GetPrimaryVertex();
1004 if (
fVtx1->GetNContributors()<1)
return;
1015 fBField = aodEvent->GetMagneticField();
1016 AliKFParticle::SetField(
fBField);
1018 Int_t nSelectedAnal = 0;
1022 array3Prong, mcHeader);
1041 if(!
fHistoMCNch) AliInfo(
"Input histos to evaluate Nch weights missing");
1057 for (
Int_t iPart=0; iPart<mcArray->GetEntriesFast(); iPart++) {
1058 AliAODMCParticle* mcPart =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(iPart));
1060 AliError(
"Failed casting particle from MC array!, Skipping particle");
1064 if (TMath::Abs(pdg) != 4122){
1065 AliDebug(2, Form(
"MC particle %d is not a Lc: its pdg code is %d", iPart, pdg));
1068 AliDebug(2, Form(
"Step 0 ok: MC particle %d is a Lc: its pdg code is %d", iPart, pdg));
1069 Int_t labeldaugh0 = mcPart->GetDaughter(0);
1070 Int_t labeldaugh1 = mcPart->GetDaughter(1);
1071 if (labeldaugh0 <= 0 || labeldaugh1 <= 0){
1072 AliDebug(2, Form(
"The MC particle doesn't have correct daughters, skipping!!"));
1075 else if (labeldaugh1 - labeldaugh0 == 1){
1076 AliDebug(2, Form(
"Step 1 ok: The MC particle has correct daughters!!"));
1077 AliAODMCParticle* daugh0 =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labeldaugh0));
1078 AliAODMCParticle* daugh1 =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labeldaugh1));
1079 if(!daugh0 || !daugh1){
1080 AliDebug(2,
"Particle daughters not properly retrieved!");
1083 Int_t pdgCodeDaugh0 = TMath::Abs(daugh0->GetPdgCode());
1084 Int_t pdgCodeDaugh1 = TMath::Abs(daugh1->GetPdgCode());
1085 AliAODMCParticle* bachelorMC = daugh0;
1086 AliAODMCParticle* v0MC = daugh1;
1087 AliDebug(2, Form(
"pdgCodeDaugh0 = %d, pdgCodeDaugh1 = %d", pdgCodeDaugh0, pdgCodeDaugh1));
1088 if ((pdgCodeDaugh0 == 311 && pdgCodeDaugh1 == 2212) || (pdgCodeDaugh0 == 2212 && pdgCodeDaugh1 == 311)){
1091 if (pdgCodeDaugh0 == 311 && pdgCodeDaugh1 == 2212) {
1092 bachelorMC = daugh1;
1095 AliDebug(2, Form(
"Number of Daughters of v0 = %d", v0MC->GetNDaughters()));
1096 if (v0MC->GetNDaughters() != 1) {
1097 AliDebug(2,
"The K0 does not decay in 1 body only! Impossible... Continuing...");
1101 AliDebug(2,
"Step 2 ok: The K0 does decay in 1 body only! ");
1102 Int_t labelK0daugh = v0MC->GetDaughter(0);
1103 AliAODMCParticle* partK0S =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labelK0daugh));
1105 AliError(
"Error while casting particle! returning a NULL array");
1109 if (partK0S->GetNDaughters() != 2 || TMath::Abs(partK0S->GetPdgCode() != 310)){
1110 AliDebug(2,
"The K0 daughter is not a K0S or does not decay in 2 bodies");
1114 AliDebug(2,
"Step 3 ok: The K0 daughter is a K0S and does decay in 2 bodies");
1115 Int_t labelK0Sdaugh0 = partK0S->GetDaughter(0);
1116 Int_t labelK0Sdaugh1 = partK0S->GetDaughter(1);
1117 AliAODMCParticle* daughK0S0 =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labelK0Sdaugh0));
1118 AliAODMCParticle* daughK0S1 =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labelK0Sdaugh1));
1119 if (!daughK0S0 || ! daughK0S1){
1120 AliDebug(2,
"Could not access K0S daughters, continuing...");
1124 AliDebug(2,
"Step 4 ok: Could access K0S daughters, continuing...");
1125 Int_t pdgK0Sdaugh0 = daughK0S0->GetPdgCode();
1126 Int_t pdgK0Sdaugh1 = daughK0S1->GetPdgCode();
1127 if (TMath::Abs(pdgK0Sdaugh0) != 211 || TMath::Abs(pdgK0Sdaugh1) != 211){
1128 AliDebug(2,
"The K0S does not decay in pi+pi-, continuing");
1133 AliDebug(2, Form(
"----> Filling histo with pt = %f", mcPart->Pt()));
1137 if(!(TMath::Abs(bachelorMC->Eta()) > 0.9 || bachelorMC->Pt() < 0.1 ||
1138 TMath::Abs(daughK0S0->Eta()) > 0.9 || daughK0S0->Pt() < 0.1 ||
1139 TMath::Abs(daughK0S1->Eta()) > 0.9 || daughK0S1->Pt() < 0.1)) {
1144 AliDebug(2,
"not in fiducial acceptance! Skipping");
1162 TClonesArray *arrayLctopKos,
1163 TClonesArray *mcArray,
1164 Int_t &nSelectedAnal,
1166 AliAODMCHeader* aodheader){
1170 Int_t pdgCand = 4122;
1171 Int_t pdgDgLctoV0bachelor[2]={2212, 310};
1172 Int_t pdgDgV0toDaughters[2]={211, 211};
1174 Int_t pdgDgLctopKpi[3]={2212, 321, 211};
1177 Int_t n3Prong = array3Prong->GetEntriesFast();
1178 Int_t nCascades= arrayLctopKos->GetEntriesFast();
1185 for (
Int_t iLctopK0s = 0; iLctopK0s < nCascades; iLctopK0s++) {
1190 AliDebug(2,Form(
"Cascade %d doens't exist, skipping",iLctopK0s));
1195 AliDebug(2,Form(
"Cascade %d is not flagged as Lc candidate",iLctopK0s));
1206 if (!lcK0spr->GetSecondaryVtx()) {
1207 AliInfo(
"No secondary vertex");
1211 if (lcK0spr->GetNDaughters()!=2) {
1212 AliDebug(2,Form(
"Cascade %d has not 2 daughters (nDaughters=%d)",iLctopK0s,lcK0spr->GetNDaughters()));
1216 AliAODv0 * v0part =
dynamic_cast<AliAODv0*
>(lcK0spr->
Getv0());
1217 AliAODTrack * bachPart =
dynamic_cast<AliAODTrack*
>(lcK0spr->
GetBachelor());
1218 if (!v0part || !bachPart) {
1219 AliDebug(2,Form(
"Cascade %d has no V0 or no bachelor object",iLctopK0s));
1223 if (!v0part->GetSecondaryVtx()) {
1224 AliDebug(2,Form(
"No secondary vertex for V0 by cascade %d",iLctopK0s));
1228 if (v0part->GetNDaughters()!=2) {
1229 AliDebug(2,Form(
"current V0 has not 2 daughters (onTheFly=%d, nDaughters=%d)",v0part->GetOnFlyStatus(),v0part->GetNDaughters()));
1235 if (!v0Neg || !v0Pos) {
1236 AliDebug(2,Form(
"V0 by cascade %d has no V0positive of V0negative object",iLctopK0s));
1240 if (v0Pos->Charge() == v0Neg->Charge()) {
1241 AliDebug(2,Form(
"V0 by cascade %d has daughters with the same sign: IMPOSSIBLE!",iLctopK0s));
1251 fmcLabelLc = lcK0spr->
MatchToMC(pdgCand, pdgDgLctoV0bachelor[1], pdgDgLctoV0bachelor, pdgDgV0toDaughters, mcArray, kTRUE);
1254 AliDebug(2, Form(
"----> cascade number %d (total cascade number = %d) is a Lc!", iLctopK0s, nCascades));
1256 AliAODMCParticle *partLc =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(
fmcLabelLc));
1258 pdgCode = partLc->GetPdgCode();
1259 if (pdgCode<0) AliDebug(2,Form(
" ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ MClabel=%d ~~~~~~~~~~ pdgCode=%d",
fmcLabelLc, pdgCode));
1260 pdgCode = TMath::Abs(pdgCode);
1278 mcLabel = lcK0spr->
MatchToMC(pdgCand, pdgDgLctoV0bachelor[1], pdgDgLctoV0bachelor, pdgDgV0toDaughters, mcArray, kTRUE);
1280 AliDebug(2,Form(
" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~cascade number %d (total cascade number = %d)", iLctopK0s, nCascades));
1282 AliAODMCParticle *partLc =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(mcLabel));
1284 pdgCode = partLc->GetPdgCode();
1285 if (pdgCode<0) AliDebug(2,Form(
" ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ MClabel=%d ~~~~~~~~~~ pdgCode=%d", mcLabel, pdgCode));
1286 pdgCode = TMath::Abs(pdgCode);
1296 AliDebug(2, Form(
"\n\n\n Analysing candidate %d\n", iLctopK0s));
1297 AliDebug(2, Form(
">>>>>>>>>> Candidate is background, fFillOnlySgn = %d --> SKIPPING",
fFillOnlySgn));
1306 if (!isCandidateInjected){
1307 AliDebug(2,
"The candidate is from HIJING (i.e. not injected), keeping it to fill background");
1311 AliDebug(2,
"The candidate is NOT from HIJING, we skip it when filling background");
1318 AliAODTrack *bachelor = (AliAODTrack*)lcK0spr->
GetBachelor();
1321 if (!bachelor || !v0pos || !v0neg) {
1322 AliDebug(2,
"Cannot retrieve one of the tracks while checking origin, continuing");
1326 Int_t labelbachelor = TMath::Abs(bachelor->GetLabel());
1327 Int_t labelv0pos = TMath::Abs(v0pos->GetLabel());
1328 Int_t labelv0neg = TMath::Abs(v0neg->GetLabel());
1329 AliAODMCParticle* MCbachelor = (AliAODMCParticle*)mcArray->At(labelbachelor);
1330 AliAODMCParticle* MCv0pos = (AliAODMCParticle*)mcArray->At(labelv0pos);
1331 AliAODMCParticle* MCv0neg = (AliAODMCParticle*)mcArray->At(labelv0neg);
1332 if (!MCbachelor || !MCv0pos || !MCv0neg) {
1333 AliDebug(2,
"Cannot retrieve MC particle for one of the tracks while checking origin, continuing");
1340 if (isBachelorFromPythia != 0 && isv0posFromPythia != 0 && isv0negFromPythia != 0){
1341 AliDebug(2,
"The candidate is from PYTHIA (i.e. all daughters originate from a quark), keeping it to fill background");
1345 AliDebug(2,
"The candidate is NOT from PYTHIA, we skip it when filling background");
1367 Int_t &nSelectedAnal,
1369 TClonesArray *mcArray,
Int_t iLctopK0s){
1384 AliAODv0 * v0part = part->
Getv0();
1385 Bool_t onFlyV0 = v0part->GetOnFlyStatus();
1404 Double_t invmassK0s = v0part->MassK0Short();
1425 if (isInV0window == 0) {
1426 AliDebug(2,
"No: The candidate has NOT passed the V0 window cuts!");
1427 if (isLc) Printf(
"SIGNAL candidate rejected: V0 window cuts");
1430 else AliDebug(2,
"Yes: The candidate has passed the mass cuts!");
1434 if (!isInCascadeWindow) {
1435 AliDebug(2,
"No: The candidate has NOT passed the cascade window cuts!");
1436 if (isLc) Printf(
"SIGNAL candidate rejected: cascade window cuts");
1439 else AliDebug(2,
"Yes: The candidate has passed the cascade window cuts!");
1443 if (!isCandidateSelectedCuts){
1444 AliDebug(2,
"No: Analysis cuts kCandidate level NOT passed");
1445 if (isLc) Printf(
"SIGNAL candidate rejected");
1449 AliDebug(2,
"Yes: Analysis cuts kCandidate level passed");
1452 AliAODTrack *bachelor = (AliAODTrack*)part->
GetBachelor();
1454 AliDebug(2, Form(
"Very weird, the bachelor is not there... returning for this candidate"));
1459 Double_t probTPCTOF[AliPID::kSPECIES]={-1.};
1462 AliDebug(2, Form(
"detUsed (TPCTOF case) = %d", detUsed));
1467 AliDebug(2, Form(
"We have found the detector mask for TOF + TPC: probProton will be set to %f", probTPCTOF[
AliPID::kProton]));
1473 fPIDCombined->SetDetectorMask(AliPIDResponse::kDetTPC);
1474 AliDebug(2,
"We did not find the detector mask for TOF + TPC, let's see only TPC");
1476 AliDebug(2,Form(
" detUsed (TPC case) = %d", detUsed));
1481 AliDebug(2, Form(
"TPC only worked: probProton will be set to %f", probTPCTOF[
AliPID::kProton]));
1484 AliDebug(2,
"Only TPC did not work...");
1487 fPIDCombined->SetDetectorMask(AliPIDResponse::kDetTPC+AliPIDResponse::kDetTOF);
1489 AliDebug(2, Form(
"probProton = %f", probProton));
1494 Double_t pidTPC[AliPID::kSPECIES]={-1.};
1495 Double_t pidTOF[AliPID::kSPECIES]={-1.};
1496 Int_t respTPC =
fPIDResponse->ComputePIDProbability(AliPIDResponse::kDetTPC, bachelor, AliPID::kSPECIES, pidTPC);
1497 Int_t respTOF =
fPIDResponse->ComputePIDProbability(AliPIDResponse::kDetTOF, bachelor, AliPID::kSPECIES, pidTOF);
1498 if (respTPC == AliPIDResponse::kDetPidOk) probProtonTPC = pidTPC[
AliPID::kProton];
1499 if (respTOF == AliPIDResponse::kDetPidOk) probProtonTOF = pidTOF[
AliPID::kProton];
1503 AliDebug(2,
"On-the-fly discarded");
1514 if (isLc) Printf(
"SIGNAL candidate rejected");
1515 AliDebug(2,
"No: Analysis cuts kTracks level NOT passed");
1519 AliDebug(2,
"Yes: Analysis cuts kTracks level passed");
1522 Int_t pdgCand = 4122;
1523 Int_t pdgDgLctoV0bachelor[2]={211, 3122};
1524 Int_t pdgDgV0toDaughters[2]={2212, 211};
1525 Int_t isLc2LBarpi=0, isLc2Lpi=0;
1526 Int_t currentLabel = part->GetLabel();
1529 mcLabel = part->
MatchToMC(pdgCand, pdgDgLctoV0bachelor[1], pdgDgLctoV0bachelor, pdgDgV0toDaughters, mcArray, kTRUE);
1531 if (bachelor->Charge()==-1) isLc2LBarpi=1;
1532 if (bachelor->Charge()==+1) isLc2Lpi=1;
1536 Int_t pdgDg2prong[2] = {211, 211};
1540 labelK0S = v0part->MatchToMC(310, mcArray, 2, pdgDg2prong);
1541 if (labelK0S>=0) isK0S = 1;
1544 pdgDg2prong[0] = 211;
1545 pdgDg2prong[1] = 2212;
1547 Int_t isLambdaBar = 0;
1548 Int_t lambdaLabel = 0;
1550 lambdaLabel = v0part->MatchToMC(3122, mcArray, 2, pdgDg2prong);
1551 if (lambdaLabel>=0) {
1552 AliAODMCParticle *lambdaTrack = (AliAODMCParticle*)mcArray->At(lambdaLabel);
1553 if (lambdaTrack->GetPdgCode()==3122) isLambda = 1;
1554 else if (lambdaTrack->GetPdgCode()==-3122) isLambdaBar = 1;
1558 pdgDg2prong[0] = 11;
1559 pdgDg2prong[1] = 11;
1561 Int_t gammaLabel = 0;
1563 gammaLabel = v0part->MatchToMC(22, mcArray, 2, pdgDg2prong);
1564 if (gammaLabel>=0) {
1565 AliAODMCParticle *gammaTrack = (AliAODMCParticle*)mcArray->At(gammaLabel);
1566 if (gammaTrack->GetPdgCode()==22) isGamma = 1;
1571 if (currentLabel != -1){
1572 AliAODMCParticle *tempPart = (AliAODMCParticle*)mcArray->At(currentLabel);
1573 pdgTemp = tempPart->GetPdgCode();
1575 if (isLc) AliDebug(2, Form(
"Signal: Candidate is a Lc in K0s+p"));
1576 else if (isLc2LBarpi) AliDebug(2, Form(
"Background: Candidate is a Lc in Lbar + pi"));
1577 else if (isLc2Lpi) AliDebug(2, Form(
"Background: Candidate is a Lc in L + pi"));
1578 else AliDebug(2, Form(
"Pure bkg: Candidate has pdg = %d", pdgTemp));
1579 if (isK0S) AliDebug(2, Form(
"V0 is a K0S"));
1580 else if (isLambda) AliDebug(2, Form(
"V0 is a Lambda"));
1581 else if (isLambdaBar) AliDebug(2, Form(
"V0 is a LambdaBar"));
1582 else if (isGamma) AliDebug(2, Form(
"V0 is a Gamma"));
1586 Double_t invmassLambda = v0part->MassLambda();
1587 Double_t invmassLambdaBar = v0part->MassAntiLambda();
1621 Double_t weightPythia = -1, weight5LHC13d3 = -1, weight5LHC13d3Lc = -1;
1624 if (iLctopK0s >= 0) {
1625 AliAODMCParticle *partLcMC = (AliAODMCParticle*)mcArray->At(iLctopK0s);
1626 ptLcMC = partLcMC->Pt();
1640 if(!
fHistoMCNch) AliInfo(
"Input histos to evaluate Nch weights missing");
1649 if (!onFlyV0 && isInV0window && isInCascadeWindow){
1655 k0SCode =
CheckK0S(part, v0part, mcArray);
1658 Double_t V0KF[3] = {-999999, -999999, -999999};
1659 Double_t errV0KF[3] = {-999999, -999999, -999999};
1660 Double_t LcKF[3] = {-999999, -999999, -999999};
1661 Double_t errLcKF[3] = {-999999, -999999, -999999};
1662 Double_t distances[3] = {-999999, -999999, -999999};
1663 Double_t armPolKF[2] = {-999999, -999999};
1668 TVector3 mom1(bachelor->Px(), bachelor->Py(), bachelor->Pz());
1669 TVector3 mom2(v0part->Px(), v0part->Py(), v0part->Pz());
1670 TVector3 momTot(part->Px(), part->Py(), part->Pz());
1672 Double_t Ql1 = mom1.Dot(momTot)/momTot.Mag();
1673 Double_t Ql2 = mom2.Dot(momTot)/momTot.Mag();
1675 Double_t alphaArmLc = (Ql1 - Ql2)/(Ql1 + Ql2);
1676 Double_t alphaArmLcCharge = ( bachelor->Charge() > 0 ? (Ql1 - Ql2)/(Ql1 + Ql2) : (Ql2 - Ql1)/(Ql1 + Ql2) );
1677 Double_t ptArmLc = mom1.Perp(momTot);
1679 Double_t massK0SPDG = TDatabasePDG::Instance()->GetParticle(310)->Mass();
1680 Double_t massPrPDG = TDatabasePDG::Instance()->GetParticle(2212)->Mass();
1681 Double_t massLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
1685 Double_t pStar = TMath::Sqrt((massLcPDG*massLcPDG-massPrPDG*massPrPDG-massK0SPDG*massK0SPDG)*(massLcPDG*massLcPDG-massPrPDG*massPrPDG-massK0SPDG*massK0SPDG)-4.*massPrPDG*massPrPDG*massK0SPDG*massK0SPDG)/(2.*massLcPDG);
1693 TLorentzVector vpr, vk0s,vlc;
1694 vpr.SetXYZM(part->PxProng(0), part->PyProng(0), part->PzProng(0), massPrPDG);
1695 vk0s.SetXYZM(part->PxProng(1), part->PyProng(1), part->PzProng(1), massK0SPDG);
1697 TVector3 vboost = vlc.BoostVector();
1699 Double_t cts = TMath::Cos(vpr.Angle(vlc.Vect()));
1702 kfResult =
CallKFVertexing(part, v0part, bachelor, mcArray, &V0KF[0], &errV0KF[0], &LcKF[0], &errLcKF[0], &distances[0], &armPolKF[0]);
1703 AliDebug(2, Form(
"Result from KF = %d", kfResult));
1721 AliAODVertex *primvert =
dynamic_cast<AliAODVertex*
>(part->
GetPrimaryVtx());
1723 Double_t d0z0bach[2],covd0z0bach[3];
1724 bachelor->PropagateToDCA(primvert,
fBField, kVeryBig, d0z0bach, covd0z0bach);
1726 bachelor->GetXYZ(tx);
1727 tx[0] -= primvert->GetX();
1728 tx[1] -= primvert->GetY();
1729 tx[2] -= primvert->GetZ();
1730 Double_t innerpro = tx[0]*part->Px()+tx[1]*part->Py();
1732 if(innerpro<0.) signd0 = -1.;
1734 signd0 = signd0*TMath::Abs(d0z0bach[0]);
1777 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)));
1830 AliDebug(2, Form(
"Reco particle %d --> Filling Sgn", iLctopK0s));
1836 AliDebug(2,
"Filling Bkg");
1849 std::vector<Double_t> inputVars(9);
1850 inputVars[0] = invmassK0s;
1851 inputVars[1] = part->Getd0Prong(0);
1852 inputVars[2] = part->Getd0Prong(1);
1853 inputVars[3] = bachelor->Pt();
1854 inputVars[4] = probProton;
1858 inputVars[8] = signd0;
1863 fBDTHisto->Fill(BDTResponse, invmassLc);
1895 Int_t codeKFV0 = -1, codeKFLc = -1;
1897 AliKFVertex primVtxCopy;
1898 Int_t nt = 0, ntcheck = 0;
1904 fVtx1->GetCovarianceMatrix(covmatrix);
1906 AliESDVertex primaryESDVtxCopy(pos, covmatrix, chi2, contr,
"Vertex");
1909 primVtxCopy = AliKFVertex(primaryESDVtxCopy);
1910 nt = primaryESDVtxCopy.GetNContributors();
1914 Int_t pdgLc[2] = {2212, 310};
1916 Int_t pdgDgV0toDaughters[2] = {211, 211};
1918 Int_t mcLabelV0 = v0part->MatchToMC(310, mcArray, 2, pdgDgV0toDaughters);
1921 Bool_t isMCokV0 = kTRUE, isBkgV0 = kFALSE;
1922 AliKFParticle V0, positiveV0KF, negativeV0KF;
1923 Int_t labelsv0daugh[2] = {-1, -1};
1924 Int_t idv0daugh[2] = {-1, -1};
1925 AliExternalTrackParam* esdv0Daugh1 = 0x0;
1926 AliExternalTrackParam* esdv0Daugh2 = 0x0;
1927 for(
Int_t ipr= 0; ipr < 2; ipr++){
1928 AliAODTrack *aodTrack = (AliAODTrack*)v0part->GetDaughter(ipr);
1930 AliDebug(2,
"No V0 daughters available");
1933 Double_t xyz[3], pxpypz[3], cv[21];
1935 aodTrack->GetXYZ(xyz);
1936 aodTrack->PxPyPz(pxpypz);
1937 aodTrack->GetCovarianceXYZPxPyPz(cv);
1938 sign = aodTrack->Charge();
1939 AliExternalTrackParam tmp1( xyz, pxpypz, cv, sign);
1941 if (ipr == 0) esdv0Daugh1 =
new AliExternalTrackParam( xyz, pxpypz, cv, sign);
1942 else esdv0Daugh2 =
new AliExternalTrackParam( xyz, pxpypz, cv, sign);
1943 labelsv0daugh[ipr] = TMath::Abs(aodTrack->GetLabel());
1944 idv0daugh[ipr] = aodTrack->GetID();
1945 if (labelsv0daugh[ipr] == -1) isBkgV0 = kTRUE;
1949 AliKFParticle daughterKF(*aodTrack, pdg[ipr]);
1950 if (aodTrack->Charge() > 0) {
1951 positiveV0KF = daughterKF;
1954 negativeV0KF = daughterKF;
1959 AliDebug(2, Form(
"bField = %f, esdv0Daugh1 = %p, esdv0Daugh2 = %p",
fBField, esdv0Daugh1, esdv0Daugh2));
1962 AliExternalTrackParam tr1(*esdv0Daugh1);
1963 AliExternalTrackParam tr2(*esdv0Daugh2);
1967 AliKFParticle daughterKF1(tr1, 211);
1968 AliKFParticle daughterKF2(tr2, 211);
1969 V0.AddDaughter(positiveV0KF);
1970 V0.AddDaughter(negativeV0KF);
1979 if( V0.GetNDF() < 1 ) {
1983 if( TMath::Sqrt(TMath::Abs(V0.GetChi2()/V0.GetNDF())) >
fCutKFChi2NDF ) {
1989 for(
Int_t ipr = 0; ipr < 2; ipr++){
1990 AliAODTrack *aodTrack = (AliAODTrack*)v0part->GetDaughter(ipr);
1992 if(!aodTrack->GetUsedForPrimVtxFit()) {
1996 AliKFParticle daughterKF(*aodTrack, pdg[ipr]);
1997 primVtxCopy -= daughterKF;
2011 Double_t massV0 = 999999, sigmaMassV0 = 999999;
2012 Int_t retMV0 = V0.GetMass( massV0, sigmaMassV0 );
2016 if (sigmaMassV0 > 1e19) codeKFV0 = 5;
2018 else if (sigmaMassV0 > 1e19) codeKFV0 = 2;
2022 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]);
2023 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]);
2025 Printf(
"Vertices: KF: x = %f, y = %f, z = %f", V0.GetX(), V0.GetY(), V0.GetZ());
2026 Printf(
"Vertices: AOD: x = %f, y = %f, z = %f", v0part->Xv(), v0part->Yv(), v0part->Zv());
2029 if (
fUseMCInfo && TMath::Abs(labelsv0daugh[0] - labelsv0daugh[1]) == 1) {
2030 AliAODMCParticle* tmpdaughv01 =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labelsv0daugh[0]));
2031 AliAODMCParticle* tmpdaughv02 =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labelsv0daugh[1]));
2032 if (!tmpdaughv01 && labelsv0daugh[0] > 0){
2033 AliDebug(2,
"Could not access MC info for first daughter of V0, continuing");
2035 if (!tmpdaughv02 && labelsv0daugh[1] > 0){
2036 AliDebug(2,
"Could not access MC info for second daughter of V0, continuing");
2039 Double_t xPionMC = tmpdaughv01->Xv();
2040 Double_t yPionMC = tmpdaughv01->Yv();
2041 Double_t zPionMC = tmpdaughv01->Zv();
2043 Printf(
"Vertices: MC: x = %f, y = %f, z = %f", xPionMC, yPionMC, zPionMC);
2047 Printf(
"Not a true V0");
2054 nt = primVtxCopy.GetNContributors();
2057 Bool_t isMCokLc = kTRUE, isBkgLc = kFALSE;
2059 Int_t labelsLcdaugh[2] = {-1, -1};
2060 labelsLcdaugh[0] = TMath::Abs(bach->GetLabel());
2061 labelsLcdaugh[1] = mcLabelV0;
2063 if (bach->Charge() < 0) pdgLc[0] = -pdgLc[0];
2064 AliKFParticle daughterKFLc(*bach, pdgLc[0]);
2065 Lc.AddDaughter(daughterKFLc);
2066 TParticlePDG* particlePDG = TDatabasePDG::Instance()->GetParticle(310);
2067 Double_t massPDGK0S = particlePDG->Mass();
2068 V0.SetMassConstraint(massPDGK0S);
2070 if( Lc.GetNDF() < 1 ) {
2071 AliDebug(2, Form(
"Lc: Number of degrees of freedom < 1 (%d), continuing", Lc.GetNDF()));
2074 if( TMath::Sqrt(TMath::Abs(Lc.GetChi2()/Lc.GetNDF())) >
fCutKFChi2NDF) {
2075 AliDebug(2, Form(
"Lc: Chi2 per DOF too big, continuing (%f)", TMath::Sqrt(TMath::Abs(Lc.GetChi2()/Lc.GetNDF()))));
2081 if(!bach->GetUsedForPrimVtxFit()) {
2082 AliDebug(3,
"Lc: Bachelor was not used for primary vertex, not subtracting it from primary vertex");
2085 primVtxCopy -= daughterKFLc;
2113 if( TMath::Sqrt( TMath::Abs(Lc.GetChi2()/Lc.GetNDF())) >
fCutKFChi2NDF) {
2114 AliDebug(2, Form(
"Lc: Final Chi2 per DOF too big, continuing (%f)", TMath::Sqrt( TMath::Abs(Lc.GetChi2()/Lc.GetNDF()))));
2119 V0.SetProductionVertex(Lc);
2125 Double_t decayLengthV0 = 999999, sigmaDecayLengthV0 = 999999;
2126 Int_t retDLV0 = V0.GetDecayLength( decayLengthV0, sigmaDecayLengthV0 );
2128 if (sigmaDecayLengthV0 > 1e19) {
2132 if (sigmaMassV0 > 1e19) codeKFV0 = 11;
2134 else if (sigmaMassV0 > 1e19) codeKFV0 = 8;
2140 Double_t lifeTimeV0 = 999999, sigmaLifeTimeV0 = 999999;
2141 Int_t retTLV0 = V0.GetLifeTime( lifeTimeV0, sigmaLifeTimeV0 );
2143 if (sigmaLifeTimeV0 > 1e19) {
2145 if (sigmaDecayLengthV0 > 1e19) {
2149 if (sigmaMassV0 > 1e19) codeKFV0 = 15;
2151 else if (sigmaMassV0 > 1e19) codeKFV0 = 13;
2153 else if (massV0 < 0) {
2155 if (sigmaMassV0 > 1e19) codeKFV0 = 12;
2157 else if (sigmaMassV0 > 1e19) codeKFV0 = 10;
2162 if (codeKFV0 == -1) codeKFV0 = 0;
2165 AliDebug(2, Form(
"V0: mass = %f, decay length = %f, life time = %f", massV0, decayLengthV0, lifeTimeV0 ));
2172 Double_t vtxV0KF[3] = {V0.GetX(), V0.GetY(), V0.GetZ()};
2173 positiveV0KF.TransportToPoint(vtxV0KF);
2174 negativeV0KF.TransportToPoint(vtxV0KF);
2175 V0.GetArmenterosPodolanski(positiveV0KF, negativeV0KF, qtAlphaV0);
2176 AliDebug(2, Form(
"Armenteros-Podolanski variables: alpha = %f, qt = %f", qtAlphaV0[1], qtAlphaV0[0]));
2179 armPolKF[0] = qtAlphaV0[1];
2180 armPolKF[1] = qtAlphaV0[0];
2184 AliAODMCParticle *motherV0 = 0x0;
2185 AliAODMCParticle *daughv01 = 0x0;
2186 AliAODMCParticle *daughv02 = 0x0;
2189 daughv01 =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labelsv0daugh[0]));
2190 daughv02 =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labelsv0daugh[1]));
2191 if (!daughv01 && labelsv0daugh[0] > 0){
2192 AliDebug(2,
"Could not access MC info for first daughter of V0, continuing");
2195 if (!daughv02 && labelsv0daugh[1] > 0){
2196 AliDebug(2,
"Could not access MC info for second daughter of V0, continuing");
2200 if( daughv01->GetMother() == daughv02->GetMother() && daughv01->GetMother()>=0 ){
2201 AliDebug(3, Form(
"The mother has label %d", daughv01->GetMother()));
2202 motherV0 =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(daughv01->GetMother()));
2203 if( motherV0 && TMath::Abs(motherV0->GetPdgCode()) != 21 ){
2204 if( motherV0->GetNDaughters() == 2 ){
2209 if (TMath::Abs(motherV0->GetPdgCode()) == 310){
2216 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()));
2218 else if (!motherV0){
2219 AliDebug(3,
"could not access MC info for mother, continuing");
2222 AliDebug(3,
"MC mother is a gluon, continuing");
2226 AliDebug(3,
"Background V0!");
2232 AliDebug(2, Form(
"isMCokV0 = %d, isBkgV0 = %d", (
Int_t)isMCokV0, (
Int_t)isBkgV0));
2237 Double_t massLc = 999999, sigmaMassLc= 999999;
2238 Int_t retMLc = Lc.GetMass( massLc, sigmaMassLc );
2240 AliDebug(3, Form(
"----> Could not get mass (%e), and sigma(%e) for Lc, continuing", massLc, sigmaMassLc));
2243 if (sigmaMassLc > 1e19) codeKFLc = 5;
2245 else if (sigmaMassLc > 1e19) codeKFLc = 2;
2250 Double_t decayLengthLc = 999999, sigmaDecayLengthLc = 999999;
2251 Int_t retDLLc = Lc.GetDecayLength( decayLengthLc, sigmaDecayLengthLc );
2253 AliDebug(3,
"----> Lc: Could not get decay length, and sigma");
2254 if (sigmaDecayLengthLc > 1e19) {
2258 if (sigmaMassLc > 1e19) codeKFLc = 11;
2260 else if (sigmaMassLc > 1e19) codeKFLc = 8;
2263 AliDebug(3, Form(
"retDLLc = %d, with decayLength = %f and error = %e", retDLLc, decayLengthLc, sigmaDecayLengthLc));
2268 Double_t lifeTimeLc = 999999, sigmaLifeTimeLc = 999999;
2269 Int_t retTLLc = Lc.GetLifeTime( lifeTimeLc, sigmaLifeTimeLc );
2271 AliDebug(3,
"----> Lc: Could not get lifeTime, and sigma");
2272 if (sigmaLifeTimeLc > 1e19) {
2274 if (sigmaDecayLengthLc > 1e19) {
2278 if (sigmaMassLc > 1e19) codeKFLc = 15;
2280 else if (sigmaMassLc > 1e19) codeKFLc = 13;
2282 else if (massLc < 0) {
2284 if (sigmaMassLc > 1e19) codeKFLc = 12;
2286 else if (sigmaMassLc > 1e19) codeKFLc = 10;
2292 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));
2294 if (codeKFLc == -1) codeKFLc = 0;
2297 fHistoKF->Fill(codeKFV0, codeKFLc);
2316 Double_t xPrimVtx = primVtxCopy.GetX();
2317 Double_t yPrimVtx = primVtxCopy.GetY();
2318 Double_t zPrimVtx = primVtxCopy.GetZ();
2320 Double_t distanceLcToPrimVtx = TMath::Sqrt((xPrimVtx - xLc) * (xPrimVtx - xLc) +
2321 (yPrimVtx - yLc) * (yPrimVtx - yLc) +
2322 (zPrimVtx - zLc) * (zPrimVtx - zLc));
2324 Double_t distanceV0ToPrimVtx = TMath::Sqrt((xPrimVtx - xV0) * (xPrimVtx - xV0) +
2325 (yPrimVtx - yV0) * (yPrimVtx - yV0) +
2326 (zPrimVtx - zV0) * (zPrimVtx - zV0));
2328 Double_t distanceV0ToLc = TMath::Sqrt((xLc - xV0)*(xLc - xV0) +
2329 (yLc - yV0)*(yLc - yV0) +
2330 (zLc - zV0)*(zLc - zV0));
2338 distances[0] = distanceLcToPrimVtx;
2339 distances[1] = distanceV0ToPrimVtx;
2340 distances[2] = distanceV0ToLc;
2344 AliAODMCParticle *daughv01Lc = 0x0;
2345 AliAODMCParticle *K0S = 0x0;
2346 AliAODMCParticle *daughv02Lc = 0x0;
2348 if (labelsLcdaugh[0] >= 0) {
2350 daughv01Lc =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labelsLcdaugh[0]));
2352 AliDebug(3,
"Could not access MC info for first daughter of Lc");
2356 AliDebug(2, Form(
"The bachelor has label = %d", daughv01Lc->GetLabel()));
2357 if (TMath::Abs(daughv01Lc->GetPdgCode()) != 2212) isBkgLc = kTRUE;
2364 if (labelsLcdaugh[1] >= 0) {
2366 K0S =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labelsLcdaugh[1]));
2368 AliDebug(3,
"Could not access MC info for second daughter of Lc");
2372 if (TMath::Abs(K0S->GetPdgCode()) != 310) isBkgLc = kTRUE;
2376 AliDebug(2,
"The K0S is not true --> it does not have a label, continuing...");
2382 Int_t iK0 = K0S->GetMother();
2384 Printf(
"The K0S has no mother... IMPOSSIBLE");
2387 daughv02Lc =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(iK0));
2389 AliDebug(3,
"Could not access MC info for second daughter of Lc");
2392 if( daughv01Lc && (daughv01Lc->GetMother() == daughv02Lc->GetMother()) && (daughv01Lc->GetMother()>=0) ){
2394 AliAODMCParticle *motherLc =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(daughv01Lc->GetMother()));
2395 Int_t pdgMum = 0, pdgBach = 0, pdgV0 = 0;
2396 if (motherLc) pdgMum = motherLc->GetPdgCode();
2397 if (daughv01Lc) pdgBach = daughv01Lc->GetPdgCode();
2398 if (daughv02Lc) pdgV0 = daughv02Lc->GetPdgCode();
2399 AliDebug(2, Form(
"pdgMum = %d, pdgBach = %d, pdgV0 = %d", pdgMum, pdgBach, pdgV0));
2401 if( motherLc && TMath::Abs(motherLc->GetPdgCode()) != 21 ){
2411 if (TMath::Abs(motherLc->GetPdgCode()) == 4122 && TMath::Abs(motherV0->GetPdgCode()) == 310 && TMath::Abs(daughv01Lc->GetPdgCode()) == 2212){
2412 AliDebug(2, Form(
"IT IS SIGNAL!!! with label = %d", motherLc->GetLabel()));
2441 Double_t xProtonMC = daughv01Lc->Xv();
2442 Double_t yProtonMC = daughv01Lc->Yv();
2443 Double_t zProtonMC = daughv01Lc->Zv();
2446 Double_t vtxLcResidualToPrimVtx = TMath::Sqrt((xLcMC - xProtonMC) * (xLcMC - xProtonMC) +
2447 (yLcMC - yProtonMC) * (yLcMC - yProtonMC) +
2448 (zLcMC - zProtonMC) * (zLcMC - zProtonMC)) - distanceLcToPrimVtx;
2460 Printf(
"Vertices: MC: x = %f, y = %f, z = %f", xPionMC, yPionMC, zPionMC);
2462 Double_t vtxV0ResidualToLc = TMath::Sqrt((xV0MC - xPionMC) * (xV0MC - xPionMC) +
2463 (yV0MC - yPionMC) * (yV0MC - yPionMC) +
2464 (zV0MC - zPionMC) * (zV0MC - zPionMC)) - distanceV0ToLc;
2468 Double_t vtxV0ResidualToPrimVtx = TMath::Sqrt((xPionMC - xLcMC) * (xPionMC - xLcMC) +
2469 (yPionMC - yLcMC) * (yPionMC - yLcMC) +
2470 (zPionMC - zLcMC) * (zPionMC - zLcMC)) - distanceV0ToPrimVtx;
2477 else if (!motherLc){
2478 AliDebug(2,
"We could not access MC info for Lc mother, so we did nothing");
2481 AliDebug(2,
"MC Lc mother is a gluon, so we did nothing");
2494 if ( retMV0 == 0 && retMLc == 0){
2496 errV0KF[0] = sigmaMassV0;
2497 V0KF[1] = decayLengthV0;
2498 errV0KF[1] = sigmaDecayLengthV0;
2499 V0KF[2] = lifeTimeV0;
2500 errV0KF[2] = sigmaLifeTimeV0;
2502 errLcKF[0] = sigmaMassLc;
2503 LcKF[1] = decayLengthLc;
2504 errLcKF[1] = sigmaDecayLengthLc;
2505 LcKF[2] = lifeTimeLc;
2506 errLcKF[2] = sigmaLifeTimeLc;
2514 AliAODTrack* bachelor,
2515 TClonesArray *mcArray ){
2522 Int_t label = bachelor->GetLabel();
2527 AliAODMCParticle *mcpart =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(TMath::Abs(label)));
2530 if (TMath::Abs(pdg) != 2212) {
2531 AliDebug(2, Form(
"Bachelor is not a p, but a particle with pdg code = %d", pdg));
2538 Int_t bachelorMotherLabel = mcpart->GetMother();
2540 if (bachelorMotherLabel == -1) {
2543 AliAODMCParticle *bachelorMother =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(bachelorMotherLabel));
2545 Int_t pdgMother = bachelorMother->PdgCode();
2546 if (TMath::Abs(pdgMother) != 4122) {
2547 AliDebug(2, Form(
"The proton does not come from a Lc, but from a particle with pdgcode = %d", pdgMother));
2551 if (labelLc != bachelorMotherLabel){
2553 AliDebug(2, Form(
"The proton comes from a Lc, but it is not the candidate we are analyzing"));
2557 AliDebug(2, Form(
"The proton comes from a Lc, and it is EXACTLY the candidate we are analyzing"));
2571 TClonesArray *mcArray ){
2582 if (labelFind == -1) {
2586 AliAODMCParticle *mcpart =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labelFind));
2589 if (TMath::Abs(pdg) != 310) {
2590 AliDebug(2, Form(
"K0Spart is not a K0S, but a particle with pdg code = %d", pdg));
2597 Int_t K0SpartMotherLabel = mcpart->GetMother();
2598 if (K0SpartMotherLabel == -1) {
2601 AliAODMCParticle *K0SpartMother =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(K0SpartMotherLabel));
2603 Int_t pdgMotherK0S = K0SpartMother->PdgCode();
2604 if (TMath::Abs(pdgMotherK0S) != 311) {
2605 AliDebug(2, Form(
"The K0S does not come from a K0, but from a particle with pdgcode = %d", pdgMotherK0S));
2610 Int_t K0MotherLabel = K0SpartMother->GetMother();
2611 if (K0MotherLabel == -1) {
2614 AliAODMCParticle *K0Mother =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(K0MotherLabel));
2616 Int_t pdgK0Mother = K0Mother->PdgCode();
2617 if (TMath::Abs(pdgK0Mother) != 4122) {
2618 AliDebug(2, Form(
"The K0 does not come from a Lc, but from a particle with pdgcode = %d", pdgK0Mother));
2623 if (labelLc != K0MotherLabel){
2624 AliDebug(2, Form(
"The K0S comes from a Lc, but it is not the candidate we are analyzing"));
2629 AliDebug(2, Form(
"The K0S comes from a Lc, and it is EXACTLY the candidate we are analyzing"));
2649 Int_t labMother[2]={-1, -1};
2650 AliAODMCParticle *part=0;
2651 AliAODMCParticle *mother=0;
2652 Int_t dgLabels = -1;
2654 Int_t ndg = v0part->GetNDaughters();
2656 AliFatal(Form(
"IMPOSSIBLE!! There are %d daughters, but they should be 2!", ndg));
2659 for(
Int_t i = 0; i < 2; i++) {
2660 AliAODTrack *trk = (AliAODTrack*)v0part->GetDaughter(i);
2661 dgLabels = trk->GetLabel();
2662 if (dgLabels == -1) {
2666 part = (AliAODMCParticle*)mcArray->At(TMath::Abs(dgLabels));
2671 labMother[i] = part->GetMother();
2672 if (labMother[i] != -1){
2673 mother = (AliAODMCParticle*)mcArray->At(labMother[i]);
2684 if (labMother[0] == labMother[1])
return labMother[0];
2698 AliAODMCParticle *part=0;
2699 AliAODMCParticle *mother=0;
2700 AliAODMCParticle *grandmother=0;
2701 Int_t dgLabels = -1;
2703 Int_t ndg = cascade->GetNDaughters();
2705 AliFatal(Form(
"IMPOSSIBLE!! There are %d daughters, but they should be 2!", ndg));
2709 AliAODTrack *trk = (AliAODTrack*)cascade->GetDaughter(0);
2710 dgLabels = trk->GetLabel();
2711 if (dgLabels == -1 ) {
2715 part = (AliAODMCParticle*)mcArray->At(TMath::Abs(dgLabels));
2720 Int_t labMotherBach = part->GetMother();
2721 if (labMotherBach == -1){
2724 mother = (AliAODMCParticle*)mcArray->At(labMotherBach);
2730 AliAODv0 *v0 = (AliAODv0*)cascade->GetDaughter(1);
2732 if (dgLabels == -1 ) {
2736 part = (AliAODMCParticle*)mcArray->At(TMath::Abs(dgLabels));
2741 Int_t labMotherv0 = part->GetMother();
2742 if (labMotherv0 == -1){
2745 mother = (AliAODMCParticle*)mcArray->At(labMotherv0);
2750 Int_t labGrandMotherv0 = mother->GetMother();
2751 if (labGrandMotherv0 == -1){
2754 grandmother = (AliAODMCParticle*)mcArray->At(labGrandMotherv0);
2761 if (labGrandMotherv0 == labMotherBach)
return labMotherBach;
TH1F * fHistoMCLcK0SpGenLimAcc
! histo with MC Lc –> K0S + p
TH2D * fHistoArmenterosPodolanskiV0AODSgn
! KF: AOD Armeteros-Podolanski plot for V0 from signal Lc from KF
Int_t fCurrentEvent
cut for KF on distance to primary vtx for V0
TList * fListCounters
list of weights
TH1D * fHistoVtxV0ResidualToLc
! KF: residual wrt MC of distance V0 vertex from Lc vertex (MC - KF)
TH2D * fHistoDecayLengthKFV0
! KF: decay length vs decay length error for V0 from KF
EBachelor CheckBachelor(AliAODRecoCascadeHF *part, AliAODTrack *bachelor, TClonesArray *mcArray)
Float_t fCentrality
tracklet multiplicity in event
void StoreCandidates(AliVEvent *, Int_t nCand=0, Bool_t flagFilter=kTRUE)
TH2D * fHistoArmenterosPodolanskiV0KFSgn
! KF: Armeteros-Podolanski plot for V0 from signal Lc from KF
virtual void UserCreateOutputObjects()
Implementation of interface methods.
TH1D * fHistoDecayLengthLcTrue
! KF: decay length for true cascades reconstructed with KF
TH1F * fHistoMCNch
! histogram with Nch distribution from MC production
Int_t FindLcLabel(AliAODRecoCascadeHF *cascade, TClonesArray *mcArray) const
Int_t FindV0Label(AliAODRecoDecay *v0part, TClonesArray *mcArray) const
AliPIDCombined * fPIDCombined
! combined PID response object
TH2F * fHistoCodesBkg
! histogram with codes for bachelor and V0 for background
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
TH1D * fHistoMassV0TrueFromAOD
! KF: AOD mass for true V0 reconstructed with KF
TH1D * fHistoDistanceV0ToLc
! KF: distance V0 vertex from Lc vertex
TH2D * fBDTHistoVsCtau
! BDT classifier vs V0 ctau
TH2D * fBDTHistoVsSignd0
! BDT classifier vs V0 proton signed d0
TH1D * fHistoMassV0fromLcTrue
! KF: mass of V0 for true cascades reconstructed with KF
TH1D * fHistoLifeTimeV0TrueK0S
! KF: life time for true V0 which are really K0S reconstructed with KF
TH1D * fHistoLifeTimeV0True
! KF: life time for true V0 reconstructed with KF
Double_t InvMassLctoLambdaPi() const
TTree * fVariablesTreeSgn
flag for event selected
TH2D * fBDTHistoVsMassK0S
! BDT classifier vs mass (pi+pi-) pairs
TH1D * fHistoDistanceV0ToPrimVtx
! KF: distance V0 vertex from primary vertex
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)
TList * fOutputKF
! User output1: list of histograms from KF
TH1D * fHistoDecayLengthV0fromLcSgn
! KF: decay length of V0 for signal Lc reconstructed with KF
TH1D * fHistoMassV0fromLcAll
! KF: mass of V0 for all cascades reconstructed with KF
TH2D * fBDTHistoVsCosPAK0S
! BDT classifier vs V0 cosine of pointing angle
TH1D * fHistoMassV0All
! KF: mass for all V0 reconstructed with KF
TH1F * fCEvents
! Histogram to check selected events
AliRDHFCutsLctoV0 * fAnalCuts
TH2D * fHistoMassKFV0
! KF: mass vs mass error for V0 from KF
TH2D * fBDTHistoVstImpParV0
! BDT classifier vs V0 d0
TH1F * fHistoEvents
! histogram with number of events analyzed
TH1D * fHistoDistanceLcToPrimVtxSgn
! KF: distance of signal Lc vertex from primary vertex
Float_t fCutKFDeviationFromVtx
cut for KF on chi2/NDF
Bool_t ftopoConstraint
label of candidate
static Int_t CheckOrigin(TClonesArray *arrayMC, AliAODMCParticle *mcPart, Bool_t searchUpToQuark=kTRUE)
Functions to check the decay tree.
void FillLc2pK0Sspectrum(AliAODRecoCascadeHF *part, Int_t isLc, Int_t &nSelectedAnal, AliRDHFCutsLctoV0 *cutsAnal, TClonesArray *mcArray, Int_t iLctopK0s)
histos
TH2D * fHistoMassKFLc
! KF: mass vs mass error for Lc from KF
Double_t GetMaxVtxZ() const
AliAnalysisTaskSELc2V0bachelorTMVAApp()
virtual void UserExec(Option_t *option)
Bool_t FillRecoCasc(AliVEvent *event, AliAODRecoCascadeHF *rc, Bool_t isDStar, Bool_t recoSecVtx=kFALSE)
Double_t InvMassLctoK0sP() const
TH2D * fBDTHistoVsCombinedProtonProb
! BDT classifier vs combined proton probability
TH1F * fHistoLc
! histogram with number of Lc
TH2F * fHistoCodesSgn
! histogram with codes for bachelor and V0 for signal
AliAODTrack * Getv0PositiveTrack() const
TH1F * fHistoCentrality
! histogram with centrality from AliRDHFCuts
void MakeAnalysisForLc2prK0S(AliAODEvent *aodEvent, TClonesArray *arrayLctopK0s, TClonesArray *mcArray, Int_t &nSelectedAnal, AliRDHFCutsLctoV0 *cutsAnal, TClonesArray *array3Prong, AliAODMCHeader *aodheader)
TH1D * fHistoMassLcTrue
! KF: mass for true cascades reconstructed with KF
TList * fListCuts
Cuts - sent to output slot 5.
TH2D * fBDTHistoVsCosThetaStar
! BDT classifier vs proton emission angle in pK0s pair rest frame
TH1D * fHistoDecayLengthV0All
! KF: decay length for all V0 reconstructed with KF
static Int_t GetNumberOfTrackletsInEtaRange(AliAODEvent *ev, Double_t mineta, Double_t maxeta)
TH2D * fHistoLifeTimeKFV0
! KF: life time vs life time error for V0 from KF
TH1D * fHistoVtxLcResidualToPrimVtx
! KF: residual wrt MC of distance Lc vertex from primary vertex (MC - KF)
TH1D * fHistoLifeTimeV0All
! KF: life time for all V0 reconstructed with KF
TH1D * fHistoKFV0
! KF: V0 code from KF (mass, decaylength, lifetime considered)
TH1D * fHistoMassV0True
! KF: mass for true V0 reconstructed with KF
TF1 * fFuncWeightFONLL5overLHC13d3
! weight function for FONLL vs pPb prod.
TH1D * fHistoDecayLengthV0fromLcAll
! KF: decay length of V0 for all cascades reconstructed with KF
Double_t fBField
current event number - for debug purposes
TH1F * fHistoFiducialAcceptance
! histogram to check FiducialAcceptance cut
TTree * fVariablesTreeBkg
! tree of the candidate variables after track selection (Background)
AliAODTrack * GetBachelor() const
TH1D * fHistoLifeTimeV0fromLcSgn
! KF: life time of V0 for signal Lc reconstructed with KF
TH2D * fHistoArmenterosPodolanskiV0KF
! KF: Armeteros-Podolanski plot for all V0 from KF
Float_t GetCentrality(AliAODEvent *aodEvent)
TH1D * fHistoMassV0TrueK0SFromAOD
! KF: AOD mass for true V0 which are really K0S reconstructed with KF
TH1D * fHistoMassV0fromLcSgn
! KF: mass of V0 for signal Lc reconstructed with KF
Bool_t HasCascadeCandidateAnyDaughInjected(AliAODRecoCascadeHF *cand, AliAODMCHeader *header, TClonesArray *arrayMC)
TH1F * fHistoLcpKpiBeforeCuts
! histogram number of true Lc–>pKpi (3 prong) before any cut
virtual ~AliAnalysisTaskSELc2V0bachelorTMVAApp()
TH1F * fHistoBackground
AliVertexingHFUtils used to check the generator of a specific candidate.
TH1D * fHistoMassLcAll
! KF: mass for all Lc reconstructed with KF
TH1D * fHistoLifeTimeV0fromLcTrue
! KF: life time of V0 for true cascades reconstructed with KF
Bool_t fUseOnTheFlyV0
list of profiles for z-vtx correction of multiplicity
TF1 * fFuncWeightPythia
mask to the trigger word returned by the physics selection
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)
TList * fOutput
Use MC info.
TH1D * fHistoMassV0TrueK0S
! KF: mass for true V0 which are really K0S reconstructed with KF
TH1D * fHistoMassLcSgnFromAOD
! KF: AOD mass of signal Lc reconstructed with KF
TH1D * fHistoDecayLengthV0fromLcTrue
! KF: decay length of V0 for true cascades reconstructed with KF
TH1D * fHistoDecayLengthLcSgn
! KF: decay length of signal Lc reconstructed with KF
Bool_t IsEventSelected(AliVEvent *event)
TH1D * fHistoDecayLengthV0TrueK0S
! KF: decay length for true V0 which are really K0S reconstructed with KF
void StoreEvent(AliVEvent *, AliRDHFCuts *, Bool_t mc=kFALSE, Int_t multiplicity=-9999, Double_t spherocity=-99.)
void SetUsePID(Bool_t flag=kTRUE)
AliVertexingHFUtils * fUtils
flag to fill bkg with only candidates that have daughters generated by HIJING (to be used for enriche...
TH1D * fHistoDistanceLcToPrimVtx
primary vertex
TH2D * fHistoKF
! KF: V0 code vs Lc code from KF (mass, decaylength, lifetime considered)
TH2D * fHistoArmenterosPodolanskiV0AOD
! KF: AOD Armeteros-Podolanski plot for all V0 from KF
TH1D * fHistoKFLc
! KF: Lc code from KF (mass, decaylength, lifetime considered)
AliPIDResponse * fPIDResponse
! PID response object
TH1D * fHistoMassLcSgn
! KF: mass of signal Lc reconstructed with KF
Float_t fCutKFDeviationFromVtxV0
cut for KF on distance to primary vtx
Bool_t CheckCascadeFlags(AliRDHFCuts::ESele selFlag=AliRDHFCuts::kLctoV0Cuts)
Bool_t fFillTree
centrality
Bool_t fIsEventSelected
flag to analyze also on-the-fly V0 candidates
AliNormalizationCounter * fCounter
switch between Lpi and K0sp
TH1F * fHistoMCLcK0SpGen
flag to allow to use only PYTHIA tracks for background
TH1D * fHistoMassLcTrueFromAOD
! KF: AOD mass for true cascades reconstructed with KF
Float_t * fCandidateVariables
! variables to be written to the tree
TH1D * fHistoDistanceV0ToLcSgn
! KF: distance for signal Lc of V0 vertex from Lc vertex
TH1D * fHistoLifeTimeLcSgn
! KF: life time of signal Lc reconstructed with KF
Bool_t fCallKFVertexing
flag to use topological constraints in KF
TH1D * fHistoLifeTimeLcAll
! KF: life time for all Lc reconstructed with KF
TF1 * fFuncWeightFONLL5overLHC13d3Lc
! weight function for FONLL vs pPb prod.
TH1D * fHistoLifeTimeLcTrue
! KF: life time for true cascades reconstructed with KF
TH1F * fHistoLcOnTheFly
! histogram with number of Lc with on-the-fly V0
EK0S CheckK0S(AliAODRecoCascadeHF *part, AliAODv0 *v0part, TClonesArray *mcArray)
AliAODVertex * GetPrimaryVtx() const
TH2D * fBDTHistoVstImpParBach
! BDT classifier vs proton d0
TH1D * fHistoDecayLengthV0True
! KF: decay length for true V0 reconstructed with KF
void FillMCHisto(TClonesArray *mcArray)
TH2D * fBDTHistoVsBachelorPt
! BDT classifier vs proton pT
Double_t DecayLengthV0() const
void SetTriggerClass(TString trclass0, TString trclass1="")
virtual Bool_t IsInFiducialAcceptance(Double_t pt, Double_t y) const
TH1D * fHistoLifeTimeV0fromLcAll
! KF: life time of V0 for all cascades reconstructed with KF
TH1F * fHistoLcBeforeCuts
flag to fill only signal (speeding up processing)
Bool_t fKeepingOnlyPYTHIABkg
magnetic field of current event
virtual double GetMvaValue(const std::vector< double > &inputValues) const =0
TH2D * fHistoDecayLengthKFLc
! KF: decay length vs decay length error for Lc from KF
Double_t DecayLength() const
TH2D * fHistoLifeTimeKFLc
! KF: life time vs life time error for Lc from KF
Int_t IsSelectedSingleCut(TObject *obj, Int_t selectionLevel, Int_t cutIndex, AliAODEvent *aod=0x0)
Bool_t fKeepingOnlyHIJINGBkg
flag to decide whether to call or not KF
TH1F * fHistoMCLcK0SpGenAcc
! histo with MC Lc –> K0S + p
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
virtual void Terminate(Option_t *option)
void SetTriggerMask(ULong64_t mask=0)
TH1D * fHistoVtxV0ResidualToPrimVtx
! KF: residual wrt MC of distance V0 vertex from primary vertex (MC - KF)
TH2D * fBDTHisto
BDT reader.
TH1D * fHistoDistanceV0ToPrimVtxSgn
! KF: distance for signal Lc of V0 vertex from primary vertex
IClassifierReader * fBDTReader
flag to decide whether to fill the sgn and bkg trees
TH1D * fHistoDecayLengthLcAll
! KF: decay length for all Lc reconstructed with KF
Class with functions useful for different D2H analyses //.