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)
234 fIsK0sAnalysis(kFALSE),
242 fUseOnTheFlyV0(useOnTheFly),
243 fIsEventSelected(kFALSE),
244 fVariablesTreeSgn(0),
245 fVariablesTreeBkg(0),
246 fCandidateVariables(),
251 fFillOnlySgn(kFALSE),
252 fHistoLcBeforeCuts(0),
253 fHistoFiducialAcceptance(0),
256 fHistoLcpKpiBeforeCuts(0),
259 fHistoDistanceLcToPrimVtx(0),
260 fHistoDistanceV0ToPrimVtx(0),
261 fHistoDistanceV0ToLc(0),
263 fHistoDistanceLcToPrimVtxSgn(0),
264 fHistoDistanceV0ToPrimVtxSgn(0),
265 fHistoDistanceV0ToLcSgn(0),
267 fHistoVtxLcResidualToPrimVtx(0),
268 fHistoVtxV0ResidualToPrimVtx(0),
269 fHistoVtxV0ResidualToLc(0),
272 fHistoDecayLengthV0All(0),
273 fHistoLifeTimeV0All(0),
276 fHistoDecayLengthV0True(0),
277 fHistoLifeTimeV0True(0),
279 fHistoMassV0TrueFromAOD(0),
281 fHistoMassV0TrueK0S(0),
282 fHistoDecayLengthV0TrueK0S(0),
283 fHistoLifeTimeV0TrueK0S(0),
285 fHistoMassV0TrueK0SFromAOD(0),
288 fHistoDecayLengthLcAll(0),
289 fHistoLifeTimeLcAll(0),
292 fHistoDecayLengthLcTrue(0),
293 fHistoLifeTimeLcTrue(0),
295 fHistoMassLcTrueFromAOD(0),
297 fHistoMassV0fromLcAll(0),
298 fHistoDecayLengthV0fromLcAll(0),
299 fHistoLifeTimeV0fromLcAll(0),
301 fHistoMassV0fromLcTrue(0),
302 fHistoDecayLengthV0fromLcTrue(0),
303 fHistoLifeTimeV0fromLcTrue(0),
306 fHistoMassLcSgnFromAOD(0),
307 fHistoDecayLengthLcSgn(0),
308 fHistoLifeTimeLcSgn(0),
310 fHistoMassV0fromLcSgn(0),
311 fHistoDecayLengthV0fromLcSgn(0),
312 fHistoLifeTimeV0fromLcSgn(0),
319 fHistoDecayLengthKFV0(0),
320 fHistoLifeTimeKFV0(0),
323 fHistoDecayLengthKFLc(0),
324 fHistoLifeTimeKFLc(0),
326 fHistoArmenterosPodolanskiV0KF(0),
327 fHistoArmenterosPodolanskiV0KFSgn(0),
328 fHistoArmenterosPodolanskiV0AOD(0),
329 fHistoArmenterosPodolanskiV0AODSgn(0),
333 ftopoConstraint(kTRUE),
334 fCallKFVertexing(kFALSE),
335 fKeepingOnlyHIJINGBkg(kFALSE),
338 fCutKFChi2NDF(999999.),
339 fCutKFDeviationFromVtx(999999.),
340 fCutKFDeviationFromVtxV0(0.),
343 fKeepingOnlyPYTHIABkg(kFALSE),
344 fHistoMCLcK0SpGen(0),
345 fHistoMCLcK0SpGenAcc(0),
346 fHistoMCLcK0SpGenLimAcc(0),
349 fFuncWeightPythia(0),
350 fFuncWeightFONLL5overLHC13d3(0),
351 fFuncWeightFONLL5overLHC13d3Lc(0),
352 fAnalysisType(kpPb2013),
355 fListMultiplicityHistograms(0),
357 fHistNtrCorrVsZvtx(0),
358 fHistNtrUnCorrEvSel(0),
359 fHistNtrUnCorrEvWithCand(0),
360 fHistNtrCorrEvSel(0),
361 fHistNtrCorrEvWithCand(0),
364 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");
1544 Int_t &nSelectedAnal,
1546 TClonesArray *mcArray,
Int_t iLctopK0s){
1562 AliAODv0 * v0part = part->
Getv0();
1563 Bool_t onFlyV0 = v0part->GetOnFlyStatus();
1582 Double_t invmassK0s = v0part->MassK0Short();
1603 if (isInV0window == 0) {
1604 AliDebug(2,
"No: The candidate has NOT passed the V0 window cuts!");
1605 if (isLc) Printf(
"SIGNAL candidate rejected: V0 window cuts");
1608 else AliDebug(2,
"Yes: The candidate has passed the mass cuts!");
1612 if (!isInCascadeWindow) {
1613 AliDebug(2,
"No: The candidate has NOT passed the cascade window cuts!");
1614 if (isLc) Printf(
"SIGNAL candidate rejected: cascade window cuts");
1617 else AliDebug(2,
"Yes: The candidate has passed the cascade window cuts!");
1621 if (!isCandidateSelectedCuts){
1622 AliDebug(2,
"No: Analysis cuts kCandidate level NOT passed");
1623 if (isLc) Printf(
"SIGNAL candidate rejected");
1627 AliDebug(2,
"Yes: Analysis cuts kCandidate level passed");
1630 AliAODTrack *bachelor = (AliAODTrack*)part->
GetBachelor();
1632 AliDebug(2, Form(
"Very weird, the bachelor is not there... returning for this candidate"));
1637 Double_t probTPCTOF[AliPID::kSPECIES]={-1.};
1640 AliDebug(2, Form(
"detUsed (TPCTOF case) = %d", detUsed));
1645 AliDebug(2, Form(
"We have found the detector mask for TOF + TPC: probProton will be set to %f", probTPCTOF[
AliPID::kProton]));
1651 fPIDCombined->SetDetectorMask(AliPIDResponse::kDetTPC);
1652 AliDebug(2,
"We did not find the detector mask for TOF + TPC, let's see only TPC");
1654 AliDebug(2,Form(
" detUsed (TPC case) = %d", detUsed));
1659 AliDebug(2, Form(
"TPC only worked: probProton will be set to %f", probTPCTOF[
AliPID::kProton]));
1662 AliDebug(2,
"Only TPC did not work...");
1665 fPIDCombined->SetDetectorMask(AliPIDResponse::kDetTPC+AliPIDResponse::kDetTOF);
1667 AliDebug(2, Form(
"probProton = %f", probProton));
1672 Double_t pidTPC[AliPID::kSPECIES]={-1.};
1673 Double_t pidTOF[AliPID::kSPECIES]={-1.};
1674 Int_t respTPC =
fPIDResponse->ComputePIDProbability(AliPIDResponse::kDetTPC, bachelor, AliPID::kSPECIES, pidTPC);
1675 Int_t respTOF =
fPIDResponse->ComputePIDProbability(AliPIDResponse::kDetTOF, bachelor, AliPID::kSPECIES, pidTOF);
1676 if (respTPC == AliPIDResponse::kDetPidOk) probProtonTPC = pidTPC[
AliPID::kProton];
1677 if (respTOF == AliPIDResponse::kDetPidOk) probProtonTOF = pidTOF[
AliPID::kProton];
1681 AliDebug(2,
"On-the-fly discarded");
1692 if (isLc) Printf(
"SIGNAL candidate rejected");
1693 AliDebug(2,
"No: Analysis cuts kTracks level NOT passed");
1697 AliDebug(2,
"Yes: Analysis cuts kTracks level passed");
1700 Int_t pdgCand = 4122;
1701 Int_t pdgDgLctoV0bachelor[2]={211, 3122};
1702 Int_t pdgDgV0toDaughters[2]={2212, 211};
1703 Int_t isLc2LBarpi=0, isLc2Lpi=0;
1704 Int_t currentLabel = part->GetLabel();
1707 mcLabel = part->
MatchToMC(pdgCand, pdgDgLctoV0bachelor[1], pdgDgLctoV0bachelor, pdgDgV0toDaughters, mcArray, kTRUE);
1709 if (bachelor->Charge()==-1) isLc2LBarpi=1;
1710 if (bachelor->Charge()==+1) isLc2Lpi=1;
1714 Int_t pdgDg2prong[2] = {211, 211};
1718 labelK0S = v0part->MatchToMC(310, mcArray, 2, pdgDg2prong);
1719 if (labelK0S>=0) isK0S = 1;
1722 pdgDg2prong[0] = 211;
1723 pdgDg2prong[1] = 2212;
1725 Int_t isLambdaBar = 0;
1726 Int_t lambdaLabel = 0;
1728 lambdaLabel = v0part->MatchToMC(3122, mcArray, 2, pdgDg2prong);
1729 if (lambdaLabel>=0) {
1730 AliAODMCParticle *lambdaTrack = (AliAODMCParticle*)mcArray->At(lambdaLabel);
1731 if (lambdaTrack->GetPdgCode()==3122) isLambda = 1;
1732 else if (lambdaTrack->GetPdgCode()==-3122) isLambdaBar = 1;
1736 pdgDg2prong[0] = 11;
1737 pdgDg2prong[1] = 11;
1739 Int_t gammaLabel = 0;
1741 gammaLabel = v0part->MatchToMC(22, mcArray, 2, pdgDg2prong);
1742 if (gammaLabel>=0) {
1743 AliAODMCParticle *gammaTrack = (AliAODMCParticle*)mcArray->At(gammaLabel);
1744 if (gammaTrack->GetPdgCode()==22) isGamma = 1;
1749 if (currentLabel != -1){
1750 AliAODMCParticle *tempPart = (AliAODMCParticle*)mcArray->At(currentLabel);
1751 pdgTemp = tempPart->GetPdgCode();
1753 if (isLc) AliDebug(2, Form(
"Signal: Candidate is a Lc in K0s+p"));
1754 else if (isLc2LBarpi) AliDebug(2, Form(
"Background: Candidate is a Lc in Lbar + pi"));
1755 else if (isLc2Lpi) AliDebug(2, Form(
"Background: Candidate is a Lc in L + pi"));
1756 else AliDebug(2, Form(
"Pure bkg: Candidate has pdg = %d", pdgTemp));
1757 if (isK0S) AliDebug(2, Form(
"V0 is a K0S"));
1758 else if (isLambda) AliDebug(2, Form(
"V0 is a Lambda"));
1759 else if (isLambdaBar) AliDebug(2, Form(
"V0 is a LambdaBar"));
1760 else if (isGamma) AliDebug(2, Form(
"V0 is a Gamma"));
1764 Double_t invmassLambda = v0part->MassLambda();
1765 Double_t invmassLambdaBar = v0part->MassAntiLambda();
1791 nSigmaTPCpi =
fPIDResponse->NumberOfSigmasTPC(bachelor,(AliPID::kPion));
1792 nSigmaTPCka =
fPIDResponse->NumberOfSigmasTPC(bachelor,(AliPID::kKaon));
1794 nSigmaTOFpi =
fPIDResponse->NumberOfSigmasTOF(bachelor,(AliPID::kPion));
1795 nSigmaTOFka =
fPIDResponse->NumberOfSigmasTOF(bachelor,(AliPID::kKaon));
1799 Double_t weightPythia = -1, weight5LHC13d3 = -1, weight5LHC13d3Lc = -1;
1802 if (iLctopK0s >= 0) {
1803 AliAODMCParticle *partLcMC = (AliAODMCParticle*)mcArray->At(iLctopK0s);
1804 ptLcMC = partLcMC->Pt();
1818 if(!
fHistoMCNch) AliInfo(
"Input histos to evaluate Nch weights missing");
1827 if (!onFlyV0 && isInV0window && isInCascadeWindow && part->
CosV0PointingAngle()>0.99 && TMath::Abs(nSigmaTPCpr) <= 3 && v0part->Getd0Prong(0) < 20 && v0part->Getd0Prong(1) < 20) {
1833 k0SCode =
CheckK0S(part, v0part, mcArray);
1836 Double_t V0KF[3] = {-999999, -999999, -999999};
1837 Double_t errV0KF[3] = {-999999, -999999, -999999};
1838 Double_t LcKF[3] = {-999999, -999999, -999999};
1839 Double_t errLcKF[3] = {-999999, -999999, -999999};
1840 Double_t distances[3] = {-999999, -999999, -999999};
1841 Double_t armPolKF[2] = {-999999, -999999};
1846 TVector3 mom1(bachelor->Px(), bachelor->Py(), bachelor->Pz());
1847 TVector3 mom2(v0part->Px(), v0part->Py(), v0part->Pz());
1848 TVector3 momTot(part->Px(), part->Py(), part->Pz());
1850 Double_t Ql1 = mom1.Dot(momTot)/momTot.Mag();
1851 Double_t Ql2 = mom2.Dot(momTot)/momTot.Mag();
1853 Double_t alphaArmLc = (Ql1 - Ql2)/(Ql1 + Ql2);
1854 Double_t alphaArmLcCharge = ( bachelor->Charge() > 0 ? (Ql1 - Ql2)/(Ql1 + Ql2) : (Ql2 - Ql1)/(Ql1 + Ql2) );
1855 Double_t ptArmLc = mom1.Perp(momTot);
1857 Double_t massK0SPDG = TDatabasePDG::Instance()->GetParticle(310)->Mass();
1858 Double_t massPrPDG = TDatabasePDG::Instance()->GetParticle(2212)->Mass();
1859 Double_t massLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
1861 Double_t pStar = TMath::Sqrt((massLcPDG*massLcPDG-massPrPDG*massPrPDG-massK0SPDG*massK0SPDG)*(massLcPDG*massLcPDG-massPrPDG*massPrPDG-massK0SPDG*massK0SPDG)-4.*massPrPDG*massPrPDG*massK0SPDG*massK0SPDG)/(2.*massLcPDG);
1867 kfResult =
CallKFVertexing(part, v0part, bachelor, mcArray, &V0KF[0], &errV0KF[0], &LcKF[0], &errLcKF[0], &distances[0], &armPolKF[0]);
1868 AliDebug(2, Form(
"Result from KF = %d", kfResult));
1876 Double_t cts = (Ql1/gamma-beta*TMath::Sqrt(pStar*pStar+massPrPDG*massPrPDG))/pStar;
1968 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)));
2047 AliDebug(2, Form(
"Reco particle %d --> Filling Sgn", iLctopK0s));
2053 AliDebug(2,
"Filling Bkg");
2079 Int_t codeKFV0 = -1, codeKFLc = -1;
2081 AliKFVertex primVtxCopy;
2082 Int_t nt = 0, ntcheck = 0;
2088 fVtx1->GetCovarianceMatrix(covmatrix);
2090 AliESDVertex primaryESDVtxCopy(pos, covmatrix, chi2, contr,
"Vertex");
2093 primVtxCopy = AliKFVertex(primaryESDVtxCopy);
2094 nt = primaryESDVtxCopy.GetNContributors();
2098 Int_t pdgLc[2] = {2212, 310};
2100 Int_t pdgDgV0toDaughters[2] = {211, 211};
2102 Int_t mcLabelV0 = v0part->MatchToMC(310, mcArray, 2, pdgDgV0toDaughters);
2105 Bool_t isMCokV0 = kTRUE, isBkgV0 = kFALSE;
2106 AliKFParticle V0, positiveV0KF, negativeV0KF;
2107 Int_t labelsv0daugh[2] = {-1, -1};
2108 Int_t idv0daugh[2] = {-1, -1};
2109 AliExternalTrackParam* esdv0Daugh1 = 0x0;
2110 AliExternalTrackParam* esdv0Daugh2 = 0x0;
2111 for(
Int_t ipr= 0; ipr < 2; ipr++){
2112 AliAODTrack *aodTrack = (AliAODTrack*)v0part->GetDaughter(ipr);
2114 AliDebug(2,
"No V0 daughters available");
2117 Double_t xyz[3], pxpypz[3], cv[21];
2119 aodTrack->GetXYZ(xyz);
2120 aodTrack->PxPyPz(pxpypz);
2121 aodTrack->GetCovarianceXYZPxPyPz(cv);
2122 sign = aodTrack->Charge();
2123 AliExternalTrackParam tmp1( xyz, pxpypz, cv, sign);
2125 if (ipr == 0) esdv0Daugh1 =
new AliExternalTrackParam( xyz, pxpypz, cv, sign);
2126 else esdv0Daugh2 =
new AliExternalTrackParam( xyz, pxpypz, cv, sign);
2127 labelsv0daugh[ipr] = TMath::Abs(aodTrack->GetLabel());
2128 idv0daugh[ipr] = aodTrack->GetID();
2129 if (labelsv0daugh[ipr] == -1) isBkgV0 = kTRUE;
2133 AliKFParticle daughterKF(*aodTrack, pdg[ipr]);
2134 if (aodTrack->Charge() > 0) {
2135 positiveV0KF = daughterKF;
2138 negativeV0KF = daughterKF;
2143 AliDebug(2, Form(
"bField = %f, esdv0Daugh1 = %p, esdv0Daugh2 = %p",
fBField, esdv0Daugh1, esdv0Daugh2));
2146 AliExternalTrackParam tr1(*esdv0Daugh1);
2147 AliExternalTrackParam tr2(*esdv0Daugh2);
2151 AliKFParticle daughterKF1(tr1, 211);
2152 AliKFParticle daughterKF2(tr2, 211);
2153 V0.AddDaughter(positiveV0KF);
2154 V0.AddDaughter(negativeV0KF);
2163 if( V0.GetNDF() < 1 ) {
2167 if( TMath::Sqrt(TMath::Abs(V0.GetChi2()/V0.GetNDF())) >
fCutKFChi2NDF ) {
2173 for(
Int_t ipr = 0; ipr < 2; ipr++){
2174 AliAODTrack *aodTrack = (AliAODTrack*)v0part->GetDaughter(ipr);
2176 if(!aodTrack->GetUsedForPrimVtxFit()) {
2180 AliKFParticle daughterKF(*aodTrack, pdg[ipr]);
2181 primVtxCopy -= daughterKF;
2195 Double_t massV0 = 999999, sigmaMassV0 = 999999;
2196 Int_t retMV0 = V0.GetMass( massV0, sigmaMassV0 );
2200 if (sigmaMassV0 > 1e19) codeKFV0 = 5;
2202 else if (sigmaMassV0 > 1e19) codeKFV0 = 2;
2206 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]);
2207 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]);
2209 Printf(
"Vertices: KF: x = %f, y = %f, z = %f", V0.GetX(), V0.GetY(), V0.GetZ());
2210 Printf(
"Vertices: AOD: x = %f, y = %f, z = %f", v0part->Xv(), v0part->Yv(), v0part->Zv());
2213 if (
fUseMCInfo && TMath::Abs(labelsv0daugh[0] - labelsv0daugh[1]) == 1) {
2214 AliAODMCParticle* tmpdaughv01 =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labelsv0daugh[0]));
2215 AliAODMCParticle* tmpdaughv02 =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labelsv0daugh[1]));
2216 if (!tmpdaughv01 && labelsv0daugh[0] > 0){
2217 AliDebug(2,
"Could not access MC info for first daughter of V0, continuing");
2219 if (!tmpdaughv02 && labelsv0daugh[1] > 0){
2220 AliDebug(2,
"Could not access MC info for second daughter of V0, continuing");
2223 Double_t xPionMC = tmpdaughv01->Xv();
2224 Double_t yPionMC = tmpdaughv01->Yv();
2225 Double_t zPionMC = tmpdaughv01->Zv();
2227 Printf(
"Vertices: MC: x = %f, y = %f, z = %f", xPionMC, yPionMC, zPionMC);
2231 Printf(
"Not a true V0");
2238 nt = primVtxCopy.GetNContributors();
2241 Bool_t isMCokLc = kTRUE, isBkgLc = kFALSE;
2243 Int_t labelsLcdaugh[2] = {-1, -1};
2244 labelsLcdaugh[0] = TMath::Abs(bach->GetLabel());
2245 labelsLcdaugh[1] = mcLabelV0;
2247 if (bach->Charge() < 0) pdgLc[0] = -pdgLc[0];
2248 AliKFParticle daughterKFLc(*bach, pdgLc[0]);
2249 Lc.AddDaughter(daughterKFLc);
2250 TParticlePDG* particlePDG = TDatabasePDG::Instance()->GetParticle(310);
2251 Double_t massPDGK0S = particlePDG->Mass();
2252 V0.SetMassConstraint(massPDGK0S);
2254 if( Lc.GetNDF() < 1 ) {
2255 AliDebug(2, Form(
"Lc: Number of degrees of freedom < 1 (%d), continuing", Lc.GetNDF()));
2258 if( TMath::Sqrt(TMath::Abs(Lc.GetChi2()/Lc.GetNDF())) >
fCutKFChi2NDF) {
2259 AliDebug(2, Form(
"Lc: Chi2 per DOF too big, continuing (%f)", TMath::Sqrt(TMath::Abs(Lc.GetChi2()/Lc.GetNDF()))));
2265 if(!bach->GetUsedForPrimVtxFit()) {
2266 AliDebug(3,
"Lc: Bachelor was not used for primary vertex, not subtracting it from primary vertex");
2269 primVtxCopy -= daughterKFLc;
2298 if( TMath::Sqrt( TMath::Abs(Lc.GetChi2()/Lc.GetNDF())) >
fCutKFChi2NDF) {
2299 AliDebug(2, Form(
"Lc: Final Chi2 per DOF too big, continuing (%f)", TMath::Sqrt( TMath::Abs(Lc.GetChi2()/Lc.GetNDF()))));
2304 V0.SetProductionVertex(Lc);
2310 Double_t decayLengthV0 = 999999, sigmaDecayLengthV0 = 999999;
2311 Int_t retDLV0 = V0.GetDecayLength( decayLengthV0, sigmaDecayLengthV0 );
2313 if (sigmaDecayLengthV0 > 1e19) {
2317 if (sigmaMassV0 > 1e19) codeKFV0 = 11;
2319 else if (sigmaMassV0 > 1e19) codeKFV0 = 8;
2325 Double_t lifeTimeV0 = 999999, sigmaLifeTimeV0 = 999999;
2326 Int_t retTLV0 = V0.GetLifeTime( lifeTimeV0, sigmaLifeTimeV0 );
2328 if (sigmaLifeTimeV0 > 1e19) {
2330 if (sigmaDecayLengthV0 > 1e19) {
2334 if (sigmaMassV0 > 1e19) codeKFV0 = 15;
2336 else if (sigmaMassV0 > 1e19) codeKFV0 = 13;
2338 else if (massV0 < 0) {
2340 if (sigmaMassV0 > 1e19) codeKFV0 = 12;
2342 else if (sigmaMassV0 > 1e19) codeKFV0 = 10;
2347 if (codeKFV0 == -1) codeKFV0 = 0;
2350 AliDebug(2, Form(
"V0: mass = %f, decay length = %f, life time = %f", massV0, decayLengthV0, lifeTimeV0 ));
2357 Double_t vtxV0KF[3] = {V0.GetX(), V0.GetY(), V0.GetZ()};
2358 positiveV0KF.TransportToPoint(vtxV0KF);
2359 negativeV0KF.TransportToPoint(vtxV0KF);
2360 V0.GetArmenterosPodolanski(positiveV0KF, negativeV0KF, qtAlphaV0);
2361 AliDebug(2, Form(
"Armenteros-Podolanski variables: alpha = %f, qt = %f", qtAlphaV0[1], qtAlphaV0[0]));
2364 armPolKF[0] = qtAlphaV0[1];
2365 armPolKF[1] = qtAlphaV0[0];
2369 AliAODMCParticle *motherV0 = 0x0;
2370 AliAODMCParticle *daughv01 = 0x0;
2371 AliAODMCParticle *daughv02 = 0x0;
2374 daughv01 =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labelsv0daugh[0]));
2375 daughv02 =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labelsv0daugh[1]));
2376 if (!daughv01 && labelsv0daugh[0] > 0){
2377 AliDebug(2,
"Could not access MC info for first daughter of V0, continuing");
2380 if (!daughv02 && labelsv0daugh[1] > 0){
2381 AliDebug(2,
"Could not access MC info for second daughter of V0, continuing");
2385 if( daughv01->GetMother() == daughv02->GetMother() && daughv01->GetMother()>=0 ){
2386 AliDebug(3, Form(
"The mother has label %d", daughv01->GetMother()));
2387 motherV0 =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(daughv01->GetMother()));
2388 if( motherV0 && TMath::Abs(motherV0->GetPdgCode()) != 21 ){
2389 if( motherV0->GetNDaughters() == 2 ){
2394 if (TMath::Abs(motherV0->GetPdgCode()) == 310){
2401 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()));
2403 else if (!motherV0){
2404 AliDebug(3,
"could not access MC info for mother, continuing");
2407 AliDebug(3,
"MC mother is a gluon, continuing");
2411 AliDebug(3,
"Background V0!");
2417 AliDebug(2, Form(
"isMCokV0 = %d, isBkgV0 = %d", (
Int_t)isMCokV0, (
Int_t)isBkgV0));
2422 Double_t massLc = 999999, sigmaMassLc= 999999;
2423 Int_t retMLc = Lc.GetMass( massLc, sigmaMassLc );
2425 AliDebug(3, Form(
"----> Could not get mass (%e), and sigma(%e) for Lc, continuing", massLc, sigmaMassLc));
2428 if (sigmaMassLc > 1e19) codeKFLc = 5;
2430 else if (sigmaMassLc > 1e19) codeKFLc = 2;
2435 Double_t decayLengthLc = 999999, sigmaDecayLengthLc = 999999;
2436 Int_t retDLLc = Lc.GetDecayLength( decayLengthLc, sigmaDecayLengthLc );
2438 AliDebug(3,
"----> Lc: Could not get decay length, and sigma");
2439 if (sigmaDecayLengthLc > 1e19) {
2443 if (sigmaMassLc > 1e19) codeKFLc = 11;
2445 else if (sigmaMassLc > 1e19) codeKFLc = 8;
2448 AliDebug(3, Form(
"retDLLc = %d, with decayLength = %f and error = %e", retDLLc, decayLengthLc, sigmaDecayLengthLc));
2453 Double_t lifeTimeLc = 999999, sigmaLifeTimeLc = 999999;
2454 Int_t retTLLc = Lc.GetLifeTime( lifeTimeLc, sigmaLifeTimeLc );
2456 AliDebug(3,
"----> Lc: Could not get lifeTime, and sigma");
2457 if (sigmaLifeTimeLc > 1e19) {
2459 if (sigmaDecayLengthLc > 1e19) {
2463 if (sigmaMassLc > 1e19) codeKFLc = 15;
2465 else if (sigmaMassLc > 1e19) codeKFLc = 13;
2467 else if (massLc < 0) {
2469 if (sigmaMassLc > 1e19) codeKFLc = 12;
2471 else if (sigmaMassLc > 1e19) codeKFLc = 10;
2477 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));
2479 if (codeKFLc == -1) codeKFLc = 0;
2482 fHistoKF->Fill(codeKFV0, codeKFLc);
2501 Double_t xPrimVtx = primVtxCopy.GetX();
2502 Double_t yPrimVtx = primVtxCopy.GetY();
2503 Double_t zPrimVtx = primVtxCopy.GetZ();
2505 Double_t distanceLcToPrimVtx = TMath::Sqrt((xPrimVtx - xLc) * (xPrimVtx - xLc) +
2506 (yPrimVtx - yLc) * (yPrimVtx - yLc) +
2507 (zPrimVtx - zLc) * (zPrimVtx - zLc));
2509 Double_t distanceV0ToPrimVtx = TMath::Sqrt((xPrimVtx - xV0) * (xPrimVtx - xV0) +
2510 (yPrimVtx - yV0) * (yPrimVtx - yV0) +
2511 (zPrimVtx - zV0) * (zPrimVtx - zV0));
2513 Double_t distanceV0ToLc = TMath::Sqrt((xLc - xV0)*(xLc - xV0) +
2514 (yLc - yV0)*(yLc - yV0) +
2515 (zLc - zV0)*(zLc - zV0));
2523 distances[0] = distanceLcToPrimVtx;
2524 distances[1] = distanceV0ToPrimVtx;
2525 distances[2] = distanceV0ToLc;
2529 AliAODMCParticle *daughv01Lc = 0x0;
2530 AliAODMCParticle *K0S = 0x0;
2531 AliAODMCParticle *daughv02Lc = 0x0;
2533 if (labelsLcdaugh[0] >= 0) {
2535 daughv01Lc =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labelsLcdaugh[0]));
2537 AliDebug(3,
"Could not access MC info for first daughter of Lc");
2541 AliDebug(2, Form(
"The bachelor has label = %d", daughv01Lc->GetLabel()));
2542 if (TMath::Abs(daughv01Lc->GetPdgCode()) != 2212) isBkgLc = kTRUE;
2549 if (labelsLcdaugh[1] >= 0) {
2551 K0S =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labelsLcdaugh[1]));
2553 AliDebug(3,
"Could not access MC info for second daughter of Lc");
2557 if (TMath::Abs(K0S->GetPdgCode()) != 310) isBkgLc = kTRUE;
2561 AliDebug(2,
"The K0S is not true --> it does not have a label, continuing...");
2567 Int_t iK0 = K0S->GetMother();
2569 Printf(
"The K0S has no mother... IMPOSSIBLE");
2572 daughv02Lc =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(iK0));
2574 AliDebug(3,
"Could not access MC info for second daughter of Lc");
2577 if( daughv01Lc && (daughv01Lc->GetMother() == daughv02Lc->GetMother()) && (daughv01Lc->GetMother()>=0) ){
2579 AliAODMCParticle *motherLc =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(daughv01Lc->GetMother()));
2580 Int_t pdgMum = 0, pdgBach = 0, pdgV0 = 0;
2581 if (motherLc) pdgMum = motherLc->GetPdgCode();
2582 if (daughv01Lc) pdgBach = daughv01Lc->GetPdgCode();
2583 if (daughv02Lc) pdgV0 = daughv02Lc->GetPdgCode();
2584 AliDebug(2, Form(
"pdgMum = %d, pdgBach = %d, pdgV0 = %d", pdgMum, pdgBach, pdgV0));
2586 if( motherLc && TMath::Abs(motherLc->GetPdgCode()) != 21 ){
2596 if (TMath::Abs(motherLc->GetPdgCode()) == 4122 && TMath::Abs(motherV0->GetPdgCode()) == 310 && TMath::Abs(daughv01Lc->GetPdgCode()) == 2212){
2597 AliDebug(2, Form(
"IT IS SIGNAL!!! with label = %d", motherLc->GetLabel()));
2626 Double_t xProtonMC = daughv01Lc->Xv();
2627 Double_t yProtonMC = daughv01Lc->Yv();
2628 Double_t zProtonMC = daughv01Lc->Zv();
2631 Double_t vtxLcResidualToPrimVtx = TMath::Sqrt((xLcMC - xProtonMC) * (xLcMC - xProtonMC) +
2632 (yLcMC - yProtonMC) * (yLcMC - yProtonMC) +
2633 (zLcMC - zProtonMC) * (zLcMC - zProtonMC)) - distanceLcToPrimVtx;
2645 Printf(
"Vertices: MC: x = %f, y = %f, z = %f", xPionMC, yPionMC, zPionMC);
2647 Double_t vtxV0ResidualToLc = TMath::Sqrt((xV0MC - xPionMC) * (xV0MC - xPionMC) +
2648 (yV0MC - yPionMC) * (yV0MC - yPionMC) +
2649 (zV0MC - zPionMC) * (zV0MC - zPionMC)) - distanceV0ToLc;
2653 Double_t vtxV0ResidualToPrimVtx = TMath::Sqrt((xPionMC - xLcMC) * (xPionMC - xLcMC) +
2654 (yPionMC - yLcMC) * (yPionMC - yLcMC) +
2655 (zPionMC - zLcMC) * (zPionMC - zLcMC)) - distanceV0ToPrimVtx;
2662 else if (!motherLc){
2663 AliDebug(2,
"We could not access MC info for Lc mother, so we did nothing");
2666 AliDebug(2,
"MC Lc mother is a gluon, so we did nothing");
2679 if ( retMV0 == 0 && retMLc == 0){
2681 errV0KF[0] = sigmaMassV0;
2682 V0KF[1] = decayLengthV0;
2683 errV0KF[1] = sigmaDecayLengthV0;
2684 V0KF[2] = lifeTimeV0;
2685 errV0KF[2] = sigmaLifeTimeV0;
2687 errLcKF[0] = sigmaMassLc;
2688 LcKF[1] = decayLengthLc;
2689 errLcKF[1] = sigmaDecayLengthLc;
2690 LcKF[2] = lifeTimeLc;
2691 errLcKF[2] = sigmaLifeTimeLc;
2699 AliAODTrack* bachelor,
2700 TClonesArray *mcArray ){
2707 Int_t label = bachelor->GetLabel();
2712 AliAODMCParticle *mcpart =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(TMath::Abs(label)));
2715 if (TMath::Abs(pdg) != 2212) {
2716 AliDebug(2, Form(
"Bachelor is not a p, but a particle with pdg code = %d", pdg));
2723 Int_t bachelorMotherLabel = mcpart->GetMother();
2725 if (bachelorMotherLabel == -1) {
2728 AliAODMCParticle *bachelorMother =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(bachelorMotherLabel));
2730 Int_t pdgMother = bachelorMother->PdgCode();
2731 if (TMath::Abs(pdgMother) != 4122) {
2732 AliDebug(2, Form(
"The proton does not come from a Lc, but from a particle with pdgcode = %d", pdgMother));
2736 if (labelLc != bachelorMotherLabel){
2738 AliDebug(2, Form(
"The proton comes from a Lc, but it is not the candidate we are analyzing"));
2742 AliDebug(2, Form(
"The proton comes from a Lc, and it is EXACTLY the candidate we are analyzing"));
2756 TClonesArray *mcArray ){
2767 if (labelFind == -1) {
2771 AliAODMCParticle *mcpart =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(labelFind));
2774 if (TMath::Abs(pdg) != 310) {
2775 AliDebug(2, Form(
"K0Spart is not a K0S, but a particle with pdg code = %d", pdg));
2782 Int_t K0SpartMotherLabel = mcpart->GetMother();
2783 if (K0SpartMotherLabel == -1) {
2786 AliAODMCParticle *K0SpartMother =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(K0SpartMotherLabel));
2788 Int_t pdgMotherK0S = K0SpartMother->PdgCode();
2789 if (TMath::Abs(pdgMotherK0S) != 311) {
2790 AliDebug(2, Form(
"The K0S does not come from a K0, but from a particle with pdgcode = %d", pdgMotherK0S));
2795 Int_t K0MotherLabel = K0SpartMother->GetMother();
2796 if (K0MotherLabel == -1) {
2799 AliAODMCParticle *K0Mother =
dynamic_cast<AliAODMCParticle*
>(mcArray->At(K0MotherLabel));
2801 Int_t pdgK0Mother = K0Mother->PdgCode();
2802 if (TMath::Abs(pdgK0Mother) != 4122) {
2803 AliDebug(2, Form(
"The K0 does not come from a Lc, but from a particle with pdgcode = %d", pdgK0Mother));
2808 if (labelLc != K0MotherLabel){
2809 AliDebug(2, Form(
"The K0S comes from a Lc, but it is not the candidate we are analyzing"));
2814 AliDebug(2, Form(
"The K0S comes from a Lc, and it is EXACTLY the candidate we are analyzing"));
2834 Int_t labMother[2]={-1, -1};
2835 AliAODMCParticle *part=0;
2836 AliAODMCParticle *mother=0;
2837 Int_t dgLabels = -1;
2839 Int_t ndg = v0part->GetNDaughters();
2841 AliFatal(Form(
"IMPOSSIBLE!! There are %d daughters, but they should be 2!", ndg));
2844 for(
Int_t i = 0; i < 2; i++) {
2845 AliAODTrack *trk = (AliAODTrack*)v0part->GetDaughter(i);
2846 dgLabels = trk->GetLabel();
2847 if (dgLabels == -1) {
2851 part = (AliAODMCParticle*)mcArray->At(TMath::Abs(dgLabels));
2856 labMother[i] = part->GetMother();
2857 if (labMother[i] != -1){
2858 mother = (AliAODMCParticle*)mcArray->At(labMother[i]);
2869 if (labMother[0] == labMother[1])
return labMother[0];
2883 AliAODMCParticle *part=0;
2884 AliAODMCParticle *mother=0;
2885 AliAODMCParticle *grandmother=0;
2886 Int_t dgLabels = -1;
2888 Int_t ndg = cascade->GetNDaughters();
2890 AliFatal(Form(
"IMPOSSIBLE!! There are %d daughters, but they should be 2!", ndg));
2894 AliAODTrack *trk = (AliAODTrack*)cascade->GetDaughter(0);
2895 dgLabels = trk->GetLabel();
2896 if (dgLabels == -1 ) {
2900 part = (AliAODMCParticle*)mcArray->At(TMath::Abs(dgLabels));
2905 Int_t labMotherBach = part->GetMother();
2906 if (labMotherBach == -1){
2909 mother = (AliAODMCParticle*)mcArray->At(labMotherBach);
2915 AliAODv0 *v0 = (AliAODv0*)cascade->GetDaughter(1);
2917 if (dgLabels == -1 ) {
2921 part = (AliAODMCParticle*)mcArray->At(TMath::Abs(dgLabels));
2926 Int_t labMotherv0 = part->GetMother();
2927 if (labMotherv0 == -1){
2930 mother = (AliAODMCParticle*)mcArray->At(labMotherv0);
2935 Int_t labGrandMotherv0 = mother->GetMother();
2936 if (labGrandMotherv0 == -1){
2939 grandmother = (AliAODMCParticle*)mcArray->At(labGrandMotherv0);
2946 if (labGrandMotherv0 == labMotherBach)
return labMotherBach;
2956 Int_t runNo =
event->GetRunNumber();
2960 if (runNo > 195343 && runNo < 195484) period = 0;
2961 if (runNo > 195528 && runNo < 195678) period = 1;
2962 if (period < 0 || period > 1) { AliInfo(Form(
"Run number %d not found for LHC13!",runNo));
return 0;}
2965 if ((runNo >=265499 && runNo <=265525) || (runNo >= 265309 && runNo <= 265387)) period = 0;
2966 else if (runNo == 265435) period = 1;
2967 else if (runNo >= 265388 && runNo <= 265427) period = 2;
2968 else if (runNo >=267163 && runNo <=276166) period = 3;
2969 if (period < 0 || period > 3) { AliInfo(Form(
"Run number %d not found for LHC16 pPb!",runNo));
return 0;}
2972 if (runNo >= 256219 && runNo <= 256418) period = 0;
2973 else if (runNo >= 256504 && runNo <= 258537) period = 1;
2974 else if (runNo >= 258883 && runNo <= 260187) period = 2;
2975 if (period < 0 || period > 2) {AliInfo(Form(
"Run number %d not found for LHC16 pp!",runNo));
return 0;}
2978 if (runNo > 114930 && runNo < 117223) period = 0;
2979 if (runNo > 119158 && runNo < 120830) period = 1;
2980 if (runNo > 122373 && runNo < 126438) period = 2;
2981 if (runNo > 127711 && runNo < 130851) period = 3;
2982 if (period < 0 || period > 3) {AliInfo(Form(
"Run number %d not found for LHC10 pp!",runNo));
return 0;}
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
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)
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) ...
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
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.