6 #include <TClonesArray.h> 10 #include <THnSparse.h> 13 #include <TLorentzVector.h> 19 #include <AliAnalysisDataSlot.h> 20 #include <AliAnalysisDataContainer.h> 22 #include "TMatrixDSym.h" 23 #include "TMatrixDSymEigen.h" 26 #include "AliVCluster.h" 27 #include "AliVTrack.h" 32 #include "AliMCEvent.h" 33 #include "AliGenPythiaEventHeader.h" 34 #include "AliAODMCHeader.h" 35 #include "AliAODHandler.h" 36 #include "AliAODEvent.h" 37 #include "AliMCEvent.h" 38 #include "AliAnalysisManager.h" 43 #include "AliAODInputHandler.h" 44 #include "AliPIDResponse.h" 45 #include "AliCFContainer.h" 46 #include "AliCFManager.h" 47 #include "AliMultiEventInputHandler.h" 48 #include "AliKFParticle.h" 49 #include "AliKFVertex.h" 50 #include "AliMultSelection.h" 51 #include "AliAnalysisUtils.h" 53 #include "AliAODEvent.h" 76 fMinFractionShared(0),
79 fJetSelection(kInclusive),
85 fangWindowRecoil(0.6),
92 fOneConstSelectOn(kFALSE),
100 fAssITSrefitCut(kTRUE),
122 fJetProbDensityDetPart(0x0),
123 fJetProbDensityPartDet(0x0),
130 fnULSmLSpairsPerElectron(0),
132 fnElecOverPartPerJet(0),
135 fnIncSubPhotElecPerJet(0),
137 fnTrueHFElecPerJet(0),
138 fnTruePElecPerJet(0),
158 fEtaPhiRecElecTPC(0x0),
159 fPhiRecElecEMCal(0x0),
160 fEtaRecElecEMCal(0x0),
161 fEtaPhiRecElecEMCal(0x0),
164 fEtaPhiTrueElec(0x0),
165 fnEovPelecNoTPCcut(0x0),
166 fnEovPelecTPCcut(0x0),
167 fnEovPelecTPCEMCalcut(0x0),
181 fAngElecFromDFromB(0x0),
196 fDispElecFromDFromB(0x0),
203 fTreeObservableTagging(0)
206 for(
Int_t i=0;i<26;i++){
210 for(
Int_t i=0;i<5;i++){
211 fptTrueHFEeffTPCTOF[i] = NULL;
212 fptTrueHFEeffEMCal[i] = NULL;
213 fnEovPelecTPCsscut[i] = NULL;
216 for(
Int_t i=0;i<2;i++){
217 for(
Int_t j=0;j<5;j++){
218 fptTrueHFEeffTPCTOFwJetPt[i][j] = NULL;
219 fptTrueHFEeffEMCalwJetPt[i][j] = NULL;
224 for(
Int_t i=0;i<5;i++){
225 fInvmassLS[i] = NULL;
226 fInvmassULS[i] = NULL;
227 fRecPEJetPt[i] = NULL;
228 fTotPEJetPt[i] = NULL;
231 for(
Int_t j=0;j<18;j++){
232 fnTPCSigma[i][j] = NULL;
236 for(
Int_t i=0;i<6;i++){
237 fRecPEDisp[i] = NULL;
238 fTotPEDisp[i] = NULL;
242 SetMakeGeneralHistograms(kTRUE);
243 DefineOutput(1, TList::Class());
244 DefineOutput(2, TTree::Class());
262 fMinFractionShared(0),
263 fJetShapeType(
kData),
264 fJetShapeSub(kNoSub),
265 fJetSelection(kInclusive),
266 fPtThreshold(-9999.),
271 fangWindowRecoil(0.6),
275 fCentSelectOn(kTRUE),
278 fOneConstSelectOn(kFALSE),
286 fAssITSrefitCut(kTRUE),
308 fJetProbDensityDetPart(0x0),
309 fJetProbDensityPartDet(0x0),
316 fnULSmLSpairsPerElectron(0),
318 fnElecOverPartPerJet(0),
321 fnIncSubPhotElecPerJet(0),
323 fnTrueHFElecPerJet(0),
324 fnTruePElecPerJet(0),
344 fEtaPhiRecElecTPC(0x0),
345 fPhiRecElecEMCal(0x0),
346 fEtaRecElecEMCal(0x0),
347 fEtaPhiRecElecEMCal(0x0),
350 fEtaPhiTrueElec(0x0),
351 fnEovPelecNoTPCcut(0x0),
352 fnEovPelecTPCcut(0x0),
353 fnEovPelecTPCEMCalcut(0x0),
367 fAngElecFromDFromB(0x0),
382 fDispElecFromDFromB(0x0),
389 fTreeObservableTagging(0)
393 for(
Int_t i=0;i<26;i++){
397 for(
Int_t i=0;i<5;i++){
403 for(
Int_t i=0;i<2;i++){
404 for(
Int_t j=0;j<5;j++){
410 for(
Int_t i=0;i<5;i++){
417 for(
Int_t j=0;j<18;j++){
422 for(
Int_t i=0;i<6;i++){
429 DefineOutput(1, TList::Class());
430 DefineOutput(2, TTree::Class());
446 Bool_t oldStatus = TH1::AddDirectoryStatus();
447 TH1::AddDirectory(kFALSE);
449 Double_t ptRange[34] = {0.5, 0.6, 0.7, 0.8, 0.9, 1., 1.1, 1.2, 1.3, 1.4,
450 1.5, 1.75, 2., 2.25, 2.5, 2.75, 3., 3.5, 4., 5.,
451 6., 8., 10., 12., 14., 16., 19., 22., 26., 30.,
455 double xbins[60] = {0.01,0.1,0.12,0.14,0.16,0.18,0.2,0.25,0.3,0.35,
456 0.4,0.45,0.5,0.55,0.6,0.65,0.7,0.75,0.8,0.85,
457 0.9,0.95,1,1.1,1.2,1.3,1.4,1.5,1.6,1.7,
458 1.8,1.9,2,2.2,2.4,2.6,2.8,3,3.2,3.4,
459 3.6,3.8,4,4.5,5,5.5,6,6.5,7,8,
460 9,10,11,12,13,14,15,16,18,20};
462 Double_t bin_JetPt[6] = {5.,20.,40.,60.,80.,120.};
463 Double_t bin_g[9] = {0.,0.02,0.03,0.04,0.05,0.06,0.07,0.08,0.12};
464 Double_t bin_ptd[7] = {0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 1.0};
466 fNeventV0 =
new TH1F(
"fNeventV0",
"Number of Events (V0)",5,-0.5,4.5);
469 fNeventT0 =
new TH1F(
"fNeventT0",
"Number of Events (T0)",5,-0.5,4.5);
472 fh2ResponseUW=
new TH2F(
"fh2ResponseUW",
"fh2ResponseUW", 100, 0, 200, 100, 0, 200);
475 fh2ResponseW=
new TH2F(
"fh2ResponseW",
"fh2ResponseW", 100, 0, 200, 100, 0, 200);
478 fPhiJetCorr6=
new TH2F(
"fPhiJetCorr6",
"fPhiJetCorr6", 50, 0, 2*TMath::Pi(), 50, 0, 2*TMath::Pi());
481 fEtaJetCorr6=
new TH2F(
"fEtaJetCorr6",
"fEtaJetCorr6", 50, -1.5, 1.5, 50, -1.5, 1.5);
484 fPhiJetCorr7=
new TH2F(
"fPhiJetCorr7",
"fPhiJetCorr7", 50, 0, 2*TMath::Pi(), 50, 0, 2*TMath::Pi());
487 fEtaJetCorr7=
new TH2F(
"fEtaJetCorr7",
"fEtaJetCorr7", 50, -1.5, 1.5, 50, -1.5, 1.5);
490 fPtJetCorr=
new TH2F(
"fPtJetCorr",
"fPtJetCorr", 100, 0, 200, 100, 0, 200);
493 fPtJet=
new TH1F(
"fPtJet",
"fPtJet", 100, 0, 200);
496 fPtGenJet=
new TH1F(
"fPtGenJet",
"fPtGenJet", 100, 0, 200);
499 fPhiJet=
new TH2F(
"fPhiJet",
"fPhiJet", 100, 0, 200, 100, 0, TMath::TwoPi());
502 fEtaJet=
new TH2F(
"fEtaJet",
"fEtaJet", 100, 0, 200, 100, -1,1);
505 fEtaPhiJet=
new TH2F(
"fEtaPhiJet",
"fEtaPhiJet", 100, 0, TMath::TwoPi(), 100, -1,1);
508 fAreaJet=
new TH2F(
"fAreaJet",
"fAreaJet", 100, 0, 200, 100, 0,1.5);
517 fNbOfConstvspT=
new TH2F(
"fNbOfConstvspT",
"fNbOfConstvspT", 100, 0, 100, 200, 0, 200);
520 fnTPCnTOFnocut=
new TH2F(
"fnTPCnTOFnocut",
"fnTPCnTOFnocut", 100, -10, 10, 100, -10, 10);
523 fnTPCnocutP=
new TH2F(
"fnTPCnocutP",
"fnTPCnocutP", 50, 0, 5, 200, -10, 10);
526 fnTOFnocutP=
new TH2F(
"fnTOFnocutP",
"fnTOFnocutP", 50, 0, 5, 200, -10, 10);
529 fnTPCcutP=
new TH2F(
"fnTPCcutP",
"fnTPCcutP", 50, 0, 5, 200, -10, 10);
532 fnTPCcutPt=
new TH2F(
"fnTPCcutPt",
"fnTPCcutPt", 50, 0, 5, 200, -10, 10);
535 for(
Int_t i=0;i<5;i++){
536 for(
Int_t j=0;j<18;j++){
537 fnTPCSigma[i][j] =
new TH1F(Form(
"fnTPCSigma%d%d",i,j),Form(
"fnTPCSigma%d%d",i,j), 100,-15,15);
545 for(
Int_t i=0;i<5;i++){
546 fInvmassLS[i] =
new TH2F(Form(
"fInvmassLS%d",i), Form(
"fInvmassLS%d",i), 33,ptRange, 100, 0, 0.5);
550 for(
Int_t i=0;i<5;i++){
551 fInvmassULS[i] =
new TH2F(Form(
"fInvmassULS%d",i), Form(
"fInvmassULS%d",i), 33,ptRange, 100, 0, 0.5);
555 fnPartPerJet=
new TH1F(
"fnPartPerJet",
"fnPartPerJet", 50,0,50);
579 fPi0PtGen =
new TH1F(
"fPi0PtGen",
"fPi0PtGen",nbin,xbins);
582 fPi0PtEnh =
new TH1F(
"fPi0PtEnh",
"fPi0PtEnh",nbin,xbins);
585 fEtaPtGen =
new TH1F(
"fEtaPtGen",
"fEtaPtGen",nbin,xbins);
588 fEtaPtEnh =
new TH1F(
"fEtaPtEnh",
"fEtaPtEnh",nbin,xbins);
591 fGenHfePt =
new TH1F(
"fGenHfePt",
"fGenHfePt",nbin,xbins);
594 fGenPePt =
new TH1F(
"fGenPePt",
"fGenPePt",nbin,xbins);
597 for(
Int_t i=0;i<5;i++){
598 fRecPEJetPt[i] =
new TH1F(Form(
"fRecPEJetPt%d",i), Form(
"fRecPEJetPt%d",i), 33,ptRange);
602 for(
Int_t i=0;i<5;i++){
603 fTotPEJetPt[i] =
new TH1F(Form(
"fTotPEJetPt%d",i), Form(
"fTotPEJetPt%d",i), 33,ptRange);
607 for(
Int_t i=0;i<5;i++){
608 fRecPEAng[i] =
new TH1F(Form(
"fRecPEAng%d",i), Form(
"fRecPEAng%d",i), 33,ptRange);
612 for(
Int_t i=0;i<5;i++){
613 fTotPEAng[i] =
new TH1F(Form(
"fTotPEAng%d",i), Form(
"fTotPEAng%d",i), 33,ptRange);
617 for(
Int_t i=0;i<6;i++){
618 fRecPEDisp[i] =
new TH1F(Form(
"fRecPEDisp%d",i), Form(
"fRecPEDisp%d",i), 33,ptRange);
622 for(
Int_t i=0;i<6;i++){
623 fTotPEDisp[i] =
new TH1F(Form(
"fTotPEDisp%d",i), Form(
"fTotPEDisp%d",i), 33,ptRange);
627 fPtP=
new TH2F(
"fPtP",
"fPtP", 33,ptRange,33,ptRange);
630 fptJetIE=
new TH1F(
"fptJetIE",
"fptJetIE", 100, 0, 200);
633 fptJetPE=
new TH1F(
"fptJetPE",
"fptJetPE", 100, 0, 200);
636 fptJetHFE=
new TH1F(
"fptJetHFE",
"fptJetHFE", 100, 0, 200);
639 fptRecPE=
new TH1F(
"fptRecPE",
"fptRecPE", 33,ptRange);
642 fptTruePE=
new TH1F(
"fptTruePE",
"fptTruePE", 33,ptRange);
645 for(
Int_t i=0;i<5;i++){
646 fptTrueHFEeffTPCTOF[i] =
new TH1F(Form(
"fptTrueHFEeffTPCTOF%d",i), Form(
"fptTrueHFEeffTPCTOF%d",i), 33,ptRange);
650 for(
Int_t i=0;i<2;i++){
651 for(
Int_t j=0;j<5;j++){
652 fptTrueHFEeffTPCTOFwJetPt[i][j] =
new TH1F(Form(
"fptTrueHFEeffTPCTOFwJetPt%d%d",i,j), Form(
"fptTrueHFEeffTPCTOFwJetPt%d%d",i,j), 33,ptRange);
658 for(
Int_t i=0;i<5;i++){
659 fptTrueHFEeffEMCal[i] =
new TH1F(Form(
"fptTrueHFEeffEMCal%d",i), Form(
"fptTrueHFEeffEMCal%d",i), 33,ptRange);
663 for(
Int_t i=0;i<2;i++){
664 for(
Int_t j=0;j<5;j++){
665 fptTrueHFEeffEMCalwJetPt[i][j] =
new TH1F(Form(
"fptTrueHFEeffEMCalwJetPt%d%d",i,j), Form(
"fptTrueHFEeffEMCalwJetPt%d%d",i,j), 33,ptRange);
670 fptWrongPE=
new TH1F(
"fptWrongPE",
"fptWrongPE", 33,ptRange);
673 fPtTrack=
new TH1F(
"fPtTrack",
"fPtTrack", 100, 0, 200);
676 fPhiTrack=
new TH2F(
"fPhiTrack",
"fPhiTrack", 100, 0, 200, 100, 0, TMath::TwoPi());
679 fEtaTrack=
new TH2F(
"fEtaTrack",
"fEtaTrack", 100, 0, 200, 100, -1,1);
682 fEtaPhiTrack=
new TH2F(
"fEtaPhiTrack",
"fEtaPhiTrack", 100, 0, TMath::TwoPi(), 100, -1,1);
685 fPhiRecElecTPC=
new TH2F(
"fPhiRecElecTPC",
"fPhiRecElecTPC", 100, 0, 50, 100, 0, TMath::TwoPi());
691 fEtaPhiRecElecTPC=
new TH2F(
"fEtaPhiRecElecTPC",
"fEtaPhiRecElecTPC", 100, 0, TMath::TwoPi(), 100, -1,1);
694 fPhiRecElecEMCal=
new TH2F(
"fPhiRecElecEMCal",
"fPhiRecElecEMCal", 100, 0, 50, 100, 0, TMath::TwoPi());
700 fEtaPhiRecElecEMCal=
new TH2F(
"fEtaPhiRecElecEMCal",
"fEtaPhiRecElecEMCal", 100, 0, TMath::TwoPi(), 100, -1,1);
703 fPhiTrueElec=
new TH2F(
"fPhiTrueElec",
"fPhiTrueElec", 100, 0, 50, 100, 0, TMath::TwoPi());
706 fEtaTrueElec=
new TH2F(
"fEtaTrueElec",
"fEtaTrueElec", 100, 0, 50, 100, -1,1);
709 fEtaPhiTrueElec=
new TH2F(
"fEtaPhiTrueElec",
"fEtaPhiTrueElec", 100, 0, TMath::TwoPi(), 100, -1,1);
721 for(
Int_t i=0;i<5;i++){
722 fnEovPelecTPCsscut[i] =
new TH2F(Form(
"fnEovPelecTPCsscut%d",i), Form(
"fnEovPelecTPCsscut%d",i), 33,ptRange,40,0,2);
726 fnEovPbackg =
new TH2F(
"fnEovPbackg",
"fnEovPbackg", 100, 0, 100,40,0,2);
729 fnClsE =
new TH2F(
"fnClsE",
"fnClsE", 100, 0, 100, 100, 0,100);
732 fnM20 =
new TH2F(
"fnM20",
"fnM20", 100, 0, 100, 100, 0,2);
735 fnM02 =
new TH2F(
"fnM02",
"fnM02", 100, 0, 100, 100, 0,2);
738 fnClsTime =
new TH2F(
"fnClsTime",
"fnClsTime", 100, 0, 100, 100, -200,200);
741 fAngULS =
new TH2F(
"fAngULS",
"fAngULS", 5, bin_JetPt, 8, bin_g);
744 fAngLS =
new TH2F(
"fAngLS",
"fAngLS", 5, bin_JetPt, 8, bin_g);
747 fAngChargPart =
new TH2F(
"fAngChargPart",
"fAngChargPart", 5, bin_JetPt, 8, bin_g);
750 fAngHadron =
new TH2F(
"fAngHadron",
"fAngHadron", 5, bin_JetPt, 8, bin_g);
753 fAngIncElec =
new TH2F(
"fAngIncElec",
"fAngIncElec", 5, bin_JetPt, 8, bin_g);
756 fAngPhotElec =
new TH2F(
"fAngPhotElec",
"fAngPhotElec", 5, bin_JetPt, 8, bin_g);
759 fAngElecFromD =
new TH2F(
"fAngElecFromD",
"fAngElecFromD", 5, bin_JetPt, 8, bin_g);
762 fAngElecFromB =
new TH2F(
"fAngElecFromB",
"fAngElecFromB", 5, bin_JetPt, 8, bin_g);
768 fAngD =
new TH2F(
"fAngD",
"fAngD", 5, bin_JetPt, 8, bin_g);
771 fAngB =
new TH2F(
"fAngB",
"fAngB", 5, bin_JetPt, 8, bin_g);
774 fAngCharm =
new TH2F(
"fAngCharm",
"fAngCharm", 5, bin_JetPt, 8, bin_g);
777 fAngBeauty =
new TH2F(
"fAngBeauty",
"fAngBeauty", 5, bin_JetPt, 8, bin_g);
780 fAngQuark =
new TH2F(
"fAngQuark",
"fAngQuark", 5, bin_JetPt, 8, bin_g);
783 fAngGluon =
new TH2F(
"fAngGluon",
"fAngGluon", 5, bin_JetPt, 8, bin_g);
786 fDispULS =
new TH2F(
"fDispULS",
"fDispULS", 5, bin_JetPt, 6, bin_ptd);
789 fDispLS =
new TH2F(
"fDispLS",
"fDispLS", 5, bin_JetPt, 6, bin_ptd);
792 fDispChargPart =
new TH2F(
"fDispChargPart",
"fDispChargPart", 5, bin_JetPt, 6, bin_ptd);
795 fDispHadron =
new TH2F(
"fDispHadron",
"fDispHadron", 5, bin_JetPt, 6, bin_ptd);
798 fDispIncElec =
new TH2F(
"fDispIncElec",
"fDispIncElec", 5, bin_JetPt, 6, bin_ptd);
801 fDispPhotElec =
new TH2F(
"fDispPhotElec",
"fDispPhotElec", 5, bin_JetPt, 6, bin_ptd);
804 fDispElecFromD =
new TH2F(
"fDispElecFromD",
"fDispElecFromD", 5, bin_JetPt, 6, bin_ptd);
807 fDispElecFromB =
new TH2F(
"fDispElecFromB",
"fDispElecFromB", 5, bin_JetPt, 6, bin_ptd);
813 fDispD =
new TH2F(
"fDispD",
"fDispD", 5, bin_JetPt, 6, bin_ptd);
816 fDispB =
new TH2F(
"fDispB",
"fDispB", 5, bin_JetPt, 6, bin_ptd);
819 fDispCharm =
new TH2F(
"fDispCharm",
"fDispCharm", 5, bin_JetPt, 6, bin_ptd);
822 fDispBeauty =
new TH2F(
"fDispBeauty",
"fDispBeauty", 5, bin_JetPt, 6, bin_ptd);
825 fDispQuark =
new TH2F(
"fDispQuark",
"fDispQuark", 5, bin_JetPt, 6, bin_ptd);
828 fDispGluon =
new TH2F(
"fDispGluon",
"fDispGluon", 5, bin_JetPt, 6, bin_ptd);
838 THnSparse *hn =
dynamic_cast<THnSparse*
>(
fOutput->At(i));
843 TH1::AddDirectory(oldStatus);
844 const Int_t nVar = 26;
850 fShapesVarNames[0] =
"partonCode";
851 fShapesVarNames[1] =
"ptJet";
852 fShapesVarNames[2] =
"ptDJet";
853 fShapesVarNames[3] =
"mJet";
855 fShapesVarNames[4] =
"angularity";
856 fShapesVarNames[5] =
"circularity";
857 fShapesVarNames[6] =
"lesub";
858 fShapesVarNames[7] =
"coronna";
860 fShapesVarNames[8] =
"ptJetMatch";
861 fShapesVarNames[9] =
"ptDJetMatch";
862 fShapesVarNames[10] =
"mJetMatch";
864 fShapesVarNames[11] =
"angularityMatch";
865 fShapesVarNames[12] =
"circularityMatch";
866 fShapesVarNames[13] =
"lesubMatch";
867 fShapesVarNames[14] =
"coronnaMatch";
868 fShapesVarNames[15] =
"weightPythia";
870 fShapesVarNames[16] =
"rhoVal";
871 fShapesVarNames[17] =
"rhoMassVal";
872 fShapesVarNames[18] =
"ptUnsub";
873 fShapesVarNames[19] =
"ptTrueHFE";
874 fShapesVarNames[20] =
"ptElec";
875 fShapesVarNames[21] =
"nInclElec";
876 fShapesVarNames[22] =
"nPhotElec";
877 fShapesVarNames[23] =
"hasElec";
878 fShapesVarNames[24] =
"nTrueElectronsMC";
879 fShapesVarNames[25] =
"nTrueHFElecMC";
882 for(
Int_t ivar=0; ivar < nVar; ivar++){
890 delete [] fShapesVarNames;
900 printf(
"ERROR: fAOD not available\n");
904 fVevent =
dynamic_cast<AliVEvent*
>(InputEvent());
906 printf(
"ERROR: fVEvent not available\n");
916 fMCarray =
dynamic_cast<TClonesArray*
>(
fAOD->FindListObject(AliAODMCParticle::StdBranchName()));
917 fMCheader =
dynamic_cast<AliAODMCHeader*
>(
fAOD->GetList()->FindObject(AliAODMCHeader::StdBranchName()));
921 TString firedTriggerClasses =
static_cast<const AliAODEvent*
>(InputEvent())->GetFiredTriggerClasses();
922 if ((firedTriggerClasses.Contains(
"C0TVX-B-NOPF-CENT"))){
927 Int_t NpureMC = -1, NpureMCproc = -1;
932 for(
int igene=0; igene<lh->GetEntries(); igene++){
933 AliGenEventHeader* gh=(AliGenEventHeader*)lh->At(igene);
936 if(igene==0)NpureMC = gh->NProduced();
937 NpureMCproc += gh->NProduced();
944 Bool_t isPileupfromSPDmulbins = kFALSE, isPileupFromMV = kFALSE;
945 isPileupfromSPDmulbins =
fAOD->IsPileupFromSPDInMultBins();
946 if (isPileupfromSPDmulbins)
return kFALSE;
949 AliAnalysisUtils utils;
950 utils.SetMinPlpContribMV(5);
951 utils.SetMaxPlpChi2MV(5.);
952 utils.SetMinWDistMV(15);
953 utils.SetCheckPlpFromDifferentBCMV(kFALSE);
954 isPileupFromMV = utils.IsPileUpMV(
fAOD);
955 if (isPileupFromMV)
return kFALSE;
960 Bool_t isPrimary = kFALSE, isFromLMdecay = kTRUE, isFromHFdecay=kTRUE, hasMother = kTRUE;
967 for (
Int_t iParticle = 0; iParticle < NpureMCproc; iParticle++) {
968 AliAODMCParticle* particle = (AliAODMCParticle*)
fMCarray->At(iParticle);
969 int fPDG = particle->GetPdgCode();
975 if(iParticle>=NpureMC)iEnhance = kTRUE;
990 if (TMath::Abs(etaMC)<0.8 && TMath::Abs(fPDG)==11){
995 if (isFromHFdecay)
fGenHfePt->Fill(pTMC);
996 if (iDecay>0 && iDecay<7)
fGenPePt->Fill(pTMC);
1001 if (TMath::Abs(yMC)>1.0)
continue;
1004 if (!hasMother || (!isFromLMdecay && !isFromHFdecay)){
1005 if(fPDG==111 && iEnhance==kFALSE)
fPi0PtGen->Fill(pTMC);
1006 if(fPDG==111 && iEnhance==kTRUE)
fPi0PtEnh->Fill(pTMC);
1008 if(fPDG==221 && iEnhance==kFALSE)
fEtaPtGen->Fill(pTMC);
1009 if(fPDG==221 && iEnhance==kTRUE)
fEtaPtEnh->Fill(pTMC);
1029 Int_t nVertices = 1;
1030 nVertices =
fAOD->GetNumberOfVertices();
1031 Double_t listofmotherkink[nVertices];
1032 Int_t nMotherKink = 0;
1033 for(
Int_t ivertex=0; ivertex < nVertices; ivertex++) {
1034 AliAODVertex *vertex =
fAOD->GetVertex(ivertex);
1035 if(!vertex)
continue;
1036 if(vertex->GetType()==AliAODVertex::kKink) {
1037 AliAODTrack *mother = (AliAODTrack *) vertex->GetParent();
1038 if(!mother)
continue;
1039 Int_t idmother = mother->GetID();
1040 listofmotherkink[nMotherKink] = idmother;
1045 Float_t rhoVal=0, rhoMassVal = 0.;
1053 Printf(
"%s: Could not retrieve rho %s (some histograms will be filled with zero)!", GetName(), jetCont->
GetRhoName().Data());
1054 }
else rhoVal = rhoParam->GetVal();
1058 Printf(
"%s: Could not retrieve rho_m %s (some histograms will be filled with zero)!", GetName(), jetCont->
GetRhoMassName().Data());
1059 }
else rhoMassVal = rhomParam->GetVal();
1063 if (!jet1)
continue;
1072 Int_t ifound=0, ilab=-1;
1081 jetUS = jetContUS->
GetJet(i);
1084 if(ifound==1) ilab = i;
1087 if(ilab==-1)
continue;
1088 jetUS=jetContUS->
GetJet(ilab);
1094 Printf(
"jet2 does not exist, returning");
1102 Printf(
"jet3 does not exist, returning");
1122 if (!jet3)
continue;
1126 Double_t probDensDetPart = -999., probDensPartDet = -999.;
1128 if (jet1->
Pt()>0) probDensPartDet = (jet3->
Pt()-jet1->
Pt())/jet1->
Pt();
1129 if (jet3->
Pt()>0) probDensDetPart = (jet1->
Pt()-jet3->
Pt())/jet3->
Pt();
1144 Float_t dRp1 = TMath::Sqrt(jp1 * jp1 + detap1 * detap1);
1154 dRp1 = TMath::Sqrt(jp1 * jp1 + detap1 * detap1);
1191 Float_t ptMatch=0., ptDMatch=0., massMatch=0., angulMatch=0.,circMatch=0., lesubMatch=0., coronnaMatch=0;
1200 Printf(
"jet3 does not exist, returning");
1255 Int_t nInclusiveElectrons = 0, nPhotonicElectrons = 0, nTrueElectronsMC= 0, nTrueHFElecMC= 0;
1257 Bool_t hasElectrons = kFALSE;
1259 GetNumberOfElectrons(jet1, 0,nMotherKink,listofmotherkink,nInclusiveElectrons,nPhotonicElectrons,pElec,ptElec,hasElectrons);
1264 if(nInclusiveElectrons==1){
1278 AliVParticle *vp1 = 0x0;
1280 Int_t elecCounter = 0;
1291 Printf(
"AliVParticle associated to constituent not found");
1295 pdgCode = vp1->PdgCode();
1296 if (TMath::Abs(pdgCode)==11) elecCounter++;
1331 AliVParticle *vp1 = 0x0;
1332 Int_t nIE=0, nPairs=0, nPE=0, sub = -1;
1335 Bool_t hasElecCand = kFALSE;
1339 Double_t ptRange[34] = {0.5, 0.6, 0.7, 0.8, 0.9, 1., 1.1, 1.2, 1.3, 1.4,
1340 1.5, 1.75, 2., 2.25, 2.5, 2.75, 3., 3.5, 4., 5.,
1341 6., 8., 10., 12., 14., 16., 19., 22., 26., 30.,
1342 35., 40., 45., 50.};
1343 Double_t ptJetRange[6] = {5,20,40,60,80,120};
1351 printf(
"ERROR: pid response not available\n");
1358 Printf(
"AliVParticle associated to constituent not found");
1362 AliVTrack *vtrack =
dynamic_cast<AliVTrack*
>(vp1);
1364 printf(
"ERROR: Could not receive track%d\n", i);
1368 AliAODTrack *track =
dynamic_cast<AliAODTrack*
>(vtrack);
1369 if (!track)
continue;
1372 Bool_t passTrackCut = kFALSE;
1374 if (!passTrackCut)
continue;
1376 Double_t p=-9., pt=-9., fTPCnSigma=-99., fTOFnSigma=-99., phi = -9., eta = -99.;
1399 for (
Int_t l=0;l<5;l++){
1400 for(
Int_t k=0;k<18;k++){
1401 if (jetPt>=ptJetRange[l] && jetPt<ptJetRange[l+1] && p>=ptRange[k] && p<ptRange[k+1])
fnTPCSigma[l][k]->Fill(fTPCnSigma);
1407 if(TMath::Abs(fTPCnSigma)<3.5) hasElecCand = kTRUE;
1420 if (nPairs>0) nPE++;
1425 Double_t clsE = -9., m02 = -9., m20 = -9., clsTime = -9, EovP = -9.;
1430 Int_t clsId = track->GetEMCALcluster();
1432 AliVCluster *cluster=0x0;
1436 cluster = (AliVCluster*)
fVevent->GetCaloCluster(clsId);
1438 if(cluster && cluster->IsEMCAL()){
1441 cluster->GetPosition(emcx);
1442 TVector3 clustpos(emcx[0],emcx[1],emcx[2]);
1445 if(emcphi < 0) emcphi = emcphi+(2*TMath::Pi());
1447 if (emcphi>emcphimim && emcphi<emcphimax){
1448 clsE = cluster->E();
1449 m20 = cluster->GetM20();
1450 m02 = cluster->GetM02();
1451 clsTime = cluster->GetTOF()*1e+9;
1463 if (fTPCnSigma>-1.5 && fTPCnSigma<3 && m20 > 0.01 && m20 < 0.35){
1466 for (
Int_t l=0;l<5;l++){
1467 if (jetPt>=ptJetRange[l] && jetPt<ptJetRange[l+1])
fnEovPelecTPCsscut[l]->Fill(pt,EovP);
1471 if (fTPCnSigma < -3.5)
fnEovPbackg->Fill(pt,EovP);
1473 fnM20->Fill(pt,m20);
1474 fnM02->Fill(pt,m02);
1477 if (fTPCnSigma>-1.5 && fTPCnSigma<3 && EovP>0.9 && EovP<1.3 && m20 > 0.01 && m20 < 0.35 && pt >= 4 && pt < 50){
1486 if (nPairs>0) nPE++;
1502 hasElec = hasElecCand;
1508 AliVParticle *vp1 = 0x0;
1509 Int_t nIE=0, nHFE=0, nPE=0, nPairs=0, iDecay = 0, nDmeson = 0, nBmeson = 0, nElecFromB = 0, nElecFromD = 0, nElecFromDfromB = 0, nQuark = 0, nGluon = 0, nBeauty = 0, nCharm = 0;
1510 Double_t p=-9., pt=-9., fTPCnSigma=-99., fTOFnSigma=-99., MCweight = 1., eta = -99., phi = -99., pte=0.;
1512 Double_t ptJetRange[6] = {5.,20.,40.,60.,80.,120.};
1513 Double_t angRange[6] = {0.,0.02,0.04,0.06,0.08,0.12};
1514 Double_t dispRange[7] = {0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 1.0};
1516 Bool_t isFromHFdecay=kFALSE;
1517 Bool_t isFromLMdecay=kFALSE;
1518 Bool_t passTrackCut = kFALSE;
1529 printf(
"ERROR: pid response not available\n");
1536 Printf(
"AliVParticle associated to constituent not found");
1540 AliVTrack *vtrack =
dynamic_cast<AliVTrack*
>(vp1);
1542 printf(
"ERROR: Could not receive track%d\n", i);
1546 AliAODTrack *track =
dynamic_cast<AliAODTrack*
>(vtrack);
1547 if (!track)
continue;
1549 passTrackCut = kFALSE;
1550 isFromHFdecay=kFALSE;
1551 isFromLMdecay=kFALSE;
1567 Double_t EovP = -9., clsE = -9., m20 = -9.;
1572 Int_t clsId = track->GetEMCALcluster();
1574 AliVCluster *cluster=0x0;
1575 cluster = (AliVCluster*)
fVevent->GetCaloCluster(clsId);
1577 if(cluster && cluster->IsEMCAL() && phi > emcphimim && phi < emcphimax){
1578 clsE = cluster->E();
1579 m20 = cluster->GetM20();
1586 Int_t label = track->GetLabel();
1592 if (((partPDG/100)%10) == 4) nDmeson++;
1593 if (((partPDG/100)%10) == 5) nBmeson++;
1599 AliAODMCParticle* mother = (AliAODMCParticle*)
fMCarray->At(idMother);
1600 Int_t motherPDG = TMath::Abs(mother->GetPdgCode());
1602 if ((partPDG==11) && ((motherPDG/100)%10) == 5) nElecFromB++;
1604 if (((motherPDG/100)%10) == 4) nDmeson++;
1605 if (((motherPDG/100)%10) == 5) nBmeson++;
1608 Int_t idSecondMother = mother->GetMother();
1609 if (idSecondMother>0){
1610 AliAODMCParticle* secondMother = (AliAODMCParticle*)
fMCarray->At(idSecondMother);
1611 Int_t secondMotherPDG = TMath::Abs(secondMother->GetPdgCode());
1613 if ((partPDG==11) && (((secondMotherPDG/100)%10) != 5) && (((motherPDG/100)%10) == 4))
1615 if ((partPDG==11) && (((secondMotherPDG/100)%10) == 5) && (((motherPDG/100)%10) == 4))
1618 if (((secondMotherPDG/100)%10) == 4) nDmeson++;
1619 if (((secondMotherPDG/100)%10) == 5) nBmeson++;
1622 Int_t idThirdMother = secondMother->GetMother();
1623 if (idThirdMother>0){
1624 AliAODMCParticle* thirdMother = (AliAODMCParticle*)
fMCarray->At(idThirdMother);
1625 Int_t thirdMotherPDG = TMath::Abs(thirdMother->GetPdgCode());
1627 if ((partPDG==11) && (((motherPDG/100)%10) == 5) && secondMotherPDG == 5){
1628 if (thirdMotherPDG < 9) nQuark++;
1629 if (thirdMotherPDG == 21) nGluon++;
1632 if ((partPDG==11) && (((motherPDG/100)%10) == 4) && secondMotherPDG == 4){
1633 if (thirdMotherPDG < 9) nQuark++;
1634 if (thirdMotherPDG == 21) nGluon++;
1637 if (((thirdMotherPDG/100)%10) == 4) nDmeson++;
1638 if (((thirdMotherPDG/100)%10) == 5) nBmeson++;
1641 Int_t idForthMother = thirdMother->GetMother();
1642 if (idForthMother>0){
1643 AliAODMCParticle* forthMother = (AliAODMCParticle*)
fMCarray->At(idForthMother);
1644 Int_t forthMotherPDG = TMath::Abs(forthMother->GetPdgCode());
1646 if ((partPDG==11) && (((secondMotherPDG/100)%10) == 5) && (((motherPDG/100)%10) == 4) && thirdMotherPDG == 5) {
1647 if (forthMotherPDG < 9) nQuark++;
1648 if (forthMotherPDG == 21) nGluon++;
1651 if (((forthMotherPDG/100)%10) == 4) nDmeson++;
1652 if (((forthMotherPDG/100)%10) == 5) nBmeson++;
1654 if (thirdMotherPDG == 4 || forthMotherPDG == 4) nCharm++;
1655 if (thirdMotherPDG == 5 || forthMotherPDG == 5) nBeauty++;
1666 if ((partPDG==11) && isFromHFdecay){
1670 for (
Int_t l=0;l<5;l++){
1671 if (jetPt>=ptJetRange[l] && jetPt<ptJetRange[l+1]){
1680 if (!passTrackCut)
continue;
1682 if ((partPDG==11) && isFromHFdecay){
1695 if (fTPCnSigma>-1.5 && fTPCnSigma<3 && m20 > 0.01 && m20 < 0.35)
1698 if (fTPCnSigma>-1.5 && fTPCnSigma<3 && EovP>0.9 && EovP<1.3)
1701 if (fTPCnSigma>-1.5 && fTPCnSigma<3 && EovP>0.9 && EovP<1.3 && m20 > 0.01 && m20 < 0.35){
1705 for (
Int_t l=0;l<5;l++){
1706 if (jetPt>=ptJetRange[l] && jetPt<ptJetRange[l+1]){
1718 if (isFromHFdecay) nHFE++;
1719 if (iDecay>0 && iDecay<7) nPE++;
1726 if (nPairs>0 && iDecay>0 && iDecay<7)
fptRecPE->Fill(pt);
1727 if (nPairs>0 && iDecay==0)
fptWrongPE->Fill(pt);
1728 if (iDecay>0 && iDecay<7)
fptTruePE->Fill(pt);
1730 for (
Int_t l=0;l<5;l++){
1731 if (jetPt>=ptJetRange[l] && jetPt<ptJetRange[l+1]){
1732 if (iDecay>0 && iDecay<7)
fTotPEJetPt[l]->Fill(pt,MCweight);
1733 if (nPairs>0 && iDecay>0 && iDecay<7)
fRecPEJetPt[l]->Fill(pt,MCweight);
1737 for (
Int_t l=0;l<5;l++){
1738 if (ang>=angRange[l] && ang<angRange[l+1]){
1739 if (iDecay>0 && iDecay<7)
fTotPEAng[l]->Fill(pt,MCweight);
1740 if (nPairs>0 && iDecay>0 && iDecay<7)
fRecPEAng[l]->Fill(pt,MCweight);
1744 for (
Int_t l=0;l<6;l++){
1745 if (disp>=dispRange[l] && disp<dispRange[l+1]){
1746 if (iDecay>0 && iDecay<7)
fTotPEDisp[l]->Fill(pt,MCweight);
1747 if (nPairs>0 && iDecay>0 && iDecay<7)
fRecPEDisp[l]->Fill(pt,MCweight);
1753 if (fTPCnSigma>-1.5 && fTPCnSigma<3 && EovP>0.9 && EovP<1.3 && m20 > 0.01 && m20 < 0.35 && pt >= 4 && pt < 50 ){
1755 if (nPairs>0 && iDecay>0 && iDecay<7)
fptRecPE->Fill(pt);
1756 if (nPairs>0 && iDecay==0)
fptWrongPE->Fill(pt);
1757 if (iDecay>0 && iDecay<7)
fptTruePE->Fill(pt);
1759 for (
Int_t l=0;l<5;l++){
1760 if (jetPt>=ptJetRange[l] && jetPt<ptJetRange[l+1]){
1761 if (iDecay>0 && iDecay<7)
fTotPEJetPt[l]->Fill(pt,MCweight);
1762 if (nPairs>0 && iDecay>0 && iDecay<7)
fRecPEJetPt[l]->Fill(pt,MCweight);
1766 for (
Int_t l=0;l<5;l++){
1767 if (ang>=angRange[l] && ang<angRange[l+1]){
1768 if (iDecay>0 && iDecay<7)
fTotPEAng[l]->Fill(pt,MCweight);
1769 if (nPairs>0 && iDecay>0 && iDecay<7)
fRecPEAng[l]->Fill(pt,MCweight);
1773 for (
Int_t l=0;l<6;l++){
1774 if (disp>=dispRange[l] && disp<dispRange[l+1]){
1775 if (iDecay>0 && iDecay<7)
fTotPEDisp[l]->Fill(pt,MCweight);
1776 if (nPairs>0 && iDecay>0 && iDecay<7)
fRecPEDisp[l]->Fill(pt,MCweight);
1787 if (nIE==1 && nPE==1)
fptJetPE->Fill(jet->
Pt());
1788 if (nIE==1 && nHFE==1)
fptJetHFE->Fill(jet->
Pt());
1797 if (nIE==1 && nHFE==1) ptTrueHFElec = pte;
1819 if (nElecFromB == 1){
1824 if (nElecFromD == 1){
1829 if (nElecFromDfromB == 1){
1850 ntracks =
fVevent->GetNumberOfTracks();
1852 Int_t nULSpairs = 0;
1856 Double_t ptJetRange[6] = {5,20,40,60,80,120};
1859 for(
Int_t jTracks = 0; jTracks < ntracks; jTracks++){
1861 AliVParticle* Vassotrack =
fVevent->GetTrack(jTracks);
1864 printf(
"ERROR: Could not receive associated track %d\n", jTracks);
1867 AliAODTrack *trackAsso =
dynamic_cast<AliAODTrack*
>(Vassotrack);
1868 if(!trackAsso)
continue;
1870 if((track->GetID())==(trackAsso->GetID()))
continue;
1873 Bool_t passAssoTrackCut = kFALSE;
1875 if (!passAssoTrackCut)
continue;
1878 Double_t p=-9.,pt=-9.,eta =-9.,phi=-9.;
1885 charge = track->Charge();
1889 Double_t pAsso=-9.,ptAsso=-9.,etaAsso =-9.,fITSnSigmaAsso=-9.,fTPCnSigmaAsso=-9.,phiAsso=-9.;
1890 Int_t chargeAsso = 0;
1892 ptAsso = trackAsso->Pt();
1893 pAsso = trackAsso->P();
1894 phiAsso = trackAsso->Phi();
1895 etaAsso = trackAsso->Eta();
1896 chargeAsso = trackAsso->Charge();
1903 if(TMath::Abs(fTPCnSigmaAsso)>3.5)
continue;
1906 Bool_t fFlagLS=kFALSE, fFlagULS=kFALSE;
1907 Double_t openingAngle = -999.,
mass=999., width = -999;
1910 if(charge>0) fPDGe1 = -11;
1911 if(chargeAsso>0) fPDGe2 = -11;
1913 if(charge == chargeAsso) fFlagLS = kTRUE;
1914 if(charge != chargeAsso) fFlagULS = kTRUE;
1916 AliKFParticle::SetField(
fVevent->GetMagneticField());
1917 AliKFParticle ge1(*track, fPDGe1);
1918 AliKFParticle ge2(*trackAsso, fPDGe2);
1919 AliKFParticle recg(ge1, ge2);
1921 if(recg.GetNDF()<1)
continue;
1922 Double_t chi2recg = recg.GetChi2()/recg.GetNDF();
1923 if(TMath::Sqrt(TMath::Abs(chi2recg))>3.)
continue;
1925 openingAngle = ge1.GetAngle(ge2);
1928 Int_t MassCorrect=-9;
1929 MassCorrect = recg.GetMass(
mass,width);
1931 for (
Int_t l=0;l<5;l++){
1932 if (jetPt>=ptJetRange[l] && jetPt<ptJetRange[l+1] && fFlagULS)
fInvmassULS[l]->Fill(pt,
mass);
1933 if (jetPt>=ptJetRange[l] && jetPt<ptJetRange[l+1] && fFlagLS)
fInvmassLS[l]->Fill(pt,
mass);
1950 sub = nULSpairs-nLSpairs;
1964 Bool_t isHFdecay = kFALSE;
1966 Int_t idMother = particle->GetMother();
1968 AliAODMCParticle* mother = (AliAODMCParticle*)
fMCarray->At(idMother);
1969 Int_t motherPDG = TMath::Abs(mother->GetPdgCode());
1972 if( (((motherPDG/1000)%10) == 4) || (((motherPDG/100)%10) == 4) ) isHFdecay = kTRUE;
1975 if( (((motherPDG/1000)%10) == 5) || (((motherPDG/100)%10) == 5) ) isHFdecay = kTRUE;
1984 Bool_t isLMdecay = kFALSE;
1986 Int_t idMother = particle->GetMother();
1988 AliAODMCParticle* mother = (AliAODMCParticle*)
fMCarray->At(idMother);
1989 Int_t motherPDG = TMath::Abs(mother->GetPdgCode());
1991 if(motherPDG == 111 || motherPDG == 221 || motherPDG==223 || motherPDG==333 || motherPDG==331 ||
1992 motherPDG==113 || motherPDG==213 || motherPDG==313 || motherPDG==323) isLMdecay = kTRUE;
2001 Bool_t isprimary = kFALSE;
2002 if (particle->IsPrimary()) isprimary = kTRUE;
2010 Bool_t hasMother = kTRUE;
2012 Int_t idMother = particle->GetMother();
2013 if (idMother < 0) hasMother = kFALSE;
2022 double parPi0_enh[5] = {0,0,0,0,0};
2025 parPi0_enh[0] = 11.4919;
2026 parPi0_enh[1] = 0.021972;
2027 parPi0_enh[2] = 0.133756;
2028 parPi0_enh[3] = 1.67114;
2029 parPi0_enh[4] = 5.80327;
2033 parPi0_enh[0] = 17.2349;
2034 parPi0_enh[1] = 0.101117;
2035 parPi0_enh[2] = 0.165525;
2036 parPi0_enh[3] = 1.52289;
2037 parPi0_enh[4] = 5.72523;
2040 if (
fMCweight==1) weight = parPi0_enh[0] / TMath::Power((exp(parPi0_enh[1]*mcPi0pT - parPi0_enh[2]*mcPi0pT*mcPi0pT) + (mcPi0pT/parPi0_enh[3])) , parPi0_enh[4]);
2049 double parEta_enh[5] = {0,0,0,0,0};
2052 parEta_enh[0] = 3.89483;
2053 parEta_enh[1] = 2.8197;
2054 parEta_enh[2] = 0.0662309;
2055 parEta_enh[3] = 0.00563749;
2056 parEta_enh[4] = 0.435908;
2060 parEta_enh[0] = 0.328435;
2061 parEta_enh[1] = -0.450847;
2062 parEta_enh[2] = 0.00972497;
2063 parEta_enh[3] = 3.13337;
2064 parEta_enh[4] = 5.91296;
2067 if (
fMCweight==1) weight = parEta_enh[0] / TMath::Power((exp(parEta_enh[1]*mcEtapT - parEta_enh[2]*mcEtapT*mcEtapT) + (mcEtapT/parEta_enh[3])), parEta_enh[4]);
2077 Int_t partPDG = particle->GetPdgCode();
2079 if (TMath::Abs(partPDG)==11){
2080 Int_t idMother = particle->GetMother();
2083 AliAODMCParticle* mother = (AliAODMCParticle*)
fMCarray->At(idMother);
2084 Int_t motherPDG = mother->GetPdgCode();
2092 if (motherPDG==111 && isMotherPrimary){
2093 if (!hasSecondMother || (!isMotherFromHF && !isMotherFromLM)){
2099 if (motherPDG==221 && isMotherPrimary){
2100 if (!hasSecondMother || (!isMotherFromHF && !isMotherFromLM)){
2106 Int_t idSecondMother = mother->GetMother();
2108 if (idSecondMother>0){
2109 AliAODMCParticle* secondMother = (AliAODMCParticle*)
fMCarray->At(idSecondMother);
2110 Int_t secondMotherPDG = secondMother->GetPdgCode();
2111 Double_t secondMotherPt = secondMother->Pt();
2118 if (motherPDG==22 && secondMotherPDG==111 && isSecondMotherPrimary){
2119 if (!hasThirdMother || (!isSecondMotherFromHF && !isSecondMotherFromLM)){
2125 if (motherPDG==22 && secondMotherPDG==221 && isSecondMotherPrimary){
2126 if (!hasThirdMother || (!isSecondMotherFromHF && !isSecondMotherFromLM)){
2132 if (motherPDG==111 && secondMotherPDG==221 && isSecondMotherPrimary){
2133 if (!hasThirdMother || (!isSecondMotherFromHF && !isSecondMotherFromLM)){
2139 Int_t idThirdMother = secondMother->GetMother();
2141 if (idThirdMother>0){
2142 AliAODMCParticle* thirdMother = (AliAODMCParticle*)
fMCarray->At(idThirdMother);
2143 Int_t thirdMotherPDG = thirdMother->GetPdgCode();
2144 Double_t thirdMotherPt = thirdMother->Pt();
2151 if (motherPDG==22 && secondMotherPDG==111 && thirdMotherPDG==221 && isThirdMotherPrimary){
2152 if (!hasFourthMother || (!isThirdMotherFromHF && !isThirdMotherFromLM)){
2172 AliVParticle *vp1 = 0x0;
2177 Printf(
"AliVParticle associated to constituent not found");
2182 Double_t dr2 = (vp1->Eta()-jet->
Eta())*(vp1->Eta()-jet->
Eta()) + dphi*dphi;
2184 num=num+vp1->Pt()*dr;
2218 TClonesArray *TracksArray = NULL;
2219 TClonesArray *TracksArrayMC = NULL;
2222 else TracksArray = PartCont->
GetArray();
2225 if(!PartContMC || !TracksArrayMC)
return -2;
2228 if(!PartCont || !TracksArray)
return -2;
2232 AliAODTrack *
Track = 0x0;
2236 else NTracks = TracksArray->GetEntriesFast();
2238 for(
Int_t i=0; i < NTracks; i++){
2241 if (!Track)
continue;
2242 if(TMath::Abs(Track->Eta())>0.9)
continue;
2244 Double_t dr2 = (Track->Eta()-jet->
Eta())*(Track->Eta()-jet->
Eta()) + dphi*dphi;
2246 if((dr>=0.8) && (dr<1)) sumpt=sumpt+Track->Pt();
2250 if((Track = static_cast<AliAODTrack*>(PartCont->
GetAcceptTrack(i)))){
2251 if (!Track)
continue;
2252 if(TMath::Abs(Track->Eta())>0.9)
continue;
2253 if (Track->Pt()<0.15)
continue;
2255 Double_t dr2 = (Track->Eta()-jet->
Eta())*(Track->Eta()-jet->
Eta()) + dphi*dphi;
2257 if((dr>=0.8) && (dr<1)) sumpt=sumpt+Track->Pt();
2270 return Coronna(jet, jetContNb);
2282 AliVParticle *vp1 = 0x0;
2287 Printf(
"AliVParticle associated to constituent not found");
2291 num=num+vp1->Pt()*vp1->Pt();
2294 return TMath::Sqrt(num)/den;
2304 return PTD(jet, jetContNb);
2325 TVector3 ppJ1(pxjet, pyjet, pzjet);
2326 TVector3 ppJ3(- pxjet* pzjet, - pyjet * pzjet, pxjet * pxjet + pyjet * pyjet);
2328 TVector3 ppJ2(-pyjet, pxjet, 0);
2330 AliVParticle *vp1 = 0x0;
2335 Printf(
"AliVParticle associated to constituent not found");
2339 TVector3 pp(vp1->Px(), vp1->Py(), vp1->Pz());
2342 TVector3 pLong = pp.Dot(ppJ1) / ppJ1.Mag2() * ppJ1;
2343 TVector3 pPerp = pp - pLong;
2346 Float_t ppjX = pPerp.Dot(ppJ2);
2347 Float_t ppjY = pPerp.Dot(ppJ3);
2348 Float_t ppjT = TMath::Sqrt(ppjX * ppjX + ppjY * ppjY);
2349 if(ppjT<=0)
return 0;
2351 mxx += (ppjX * ppjX / ppjT);
2352 myy += (ppjY * ppjY / ppjT);
2353 mxy += (ppjX * ppjY / ppjT);
2358 if(sump2==0)
return 0;
2360 Double_t ele[4] = {mxx / sump2, mxy / sump2, mxy / sump2, myy / sump2};
2361 TMatrixDSym m0(2,ele);
2364 TMatrixDSymEigen m(m0);
2366 TMatrixD evecm = m.GetEigenVectors();
2367 eval = m.GetEigenValues();
2371 if (eval[0] < eval[1]) jev = 1;
2374 evec0 = TMatrixDColumn(evecm, jev);
2377 TVector2 evec(compx, compy);
2379 if(jev==1) circ=2*eval[0];
2380 if(jev==0) circ=2*eval[1];
2408 AliVParticle *vp1 = 0x0;
2409 AliVParticle *vp2 = 0x0;
2410 std::vector<int> ordindex;
2415 if(ordindex.size()<2)
return -1;
2419 Printf(
"AliVParticle associated to Leading constituent not found");
2425 Printf(
"AliVParticle associated to Subleading constituent not found");
2445 return LeSub(jet, jetContNb);
2474 AliVParticle *vp1 = 0x0;
2479 Printf(
"AliVParticle associated to constituent not found");
2487 mxx += ppt*ppt*deta*deta;
2488 myy += ppt*ppt*dphi*dphi;
2489 mxy -= ppt*ppt*deta*TMath::Abs(dphi);
2495 if(sump2==0)
return 0;
2497 Double_t ele[4] = {mxx , mxy , mxy , myy };
2498 TMatrixDSym m0(2,ele);
2501 TMatrixDSymEigen m(m0);
2503 TMatrixD evecm = m.GetEigenVectors();
2504 eval = m.GetEigenValues();
2508 if (eval[0] < eval[1]) jev = 1;
2511 evec0 = TMatrixDColumn(evecm, jev);
2514 TVector2 evec(compx, compy);
2516 if(jev==1) sig=TMath::Sqrt(TMath::Abs(eval[0])/sump2);
2517 if(jev==0) sig=TMath::Sqrt(TMath::Abs(eval[1])/sump2);
2531 return Sigma2(jet, jetContNb);
2551 TClonesArray *TracksArray = NULL;
2552 TClonesArray *TracksArrayMC = NULL;
2555 else TracksArray = PartCont->
GetArray();
2558 if(!PartContMC || !TracksArrayMC)
return -99999;
2561 if(!PartCont || !TracksArray)
return -99999;
2565 AliAODTrack *
Track = 0x0;
2570 Int_t triggers[100];
2571 for (
Int_t iTrigger=0; iTrigger<100; iTrigger++) triggers[iTrigger] = 0;
2575 else NTracks = TracksArray->GetEntriesFast();
2577 for(
Int_t i=0; i < NTracks; i++){
2580 if (!Track)
continue;
2581 if(TMath::Abs(Track->Eta())>0.9)
continue;
2582 if (Track->Pt()<0.15)
continue;
2583 if ((Track->Pt() >= minpT) && (Track->Pt()< maxpT)) {
2590 if((Track = static_cast<AliAODTrack*>(PartCont->
GetAcceptTrack(i)))){
2591 if (!Track)
continue;
2592 if(TMath::Abs(Track->Eta())>0.9)
continue;
2593 if (Track->Pt()<0.15)
continue;
2594 if ((Track->Pt() >= minpT) && (Track->Pt()< maxpT)) {
2603 if (iTT == 0)
return -99999;
2604 Int_t nbRn = 0, index = 0 ;
2605 TRandom3* random =
new TRandom3(0);
2606 nbRn = random->Integer(iTT);
2607 index = triggers[nbRn];
2616 if (vphi < -1*TMath::Pi()) vphi += (2*TMath::Pi());
2617 else if (vphi > TMath::Pi()) vphi -= (2*TMath::Pi());
2618 if (mphi < -1*TMath::Pi()) mphi += (2*TMath::Pi());
2619 else if (mphi > TMath::Pi()) mphi -= (2*TMath::Pi());
2620 double dphi = mphi-vphi;
2621 if (dphi < -1*TMath::Pi()) dphi += (2*TMath::Pi());
2622 else if (dphi > TMath::Pi()) dphi -= (2*TMath::Pi());
2643 if(!ietrack->TestFilterMask(AliAODTrack::kTrkGlobalNoDCA))
return kFALSE;
2644 if(TMath::Abs(ietrack->Eta())>0.7)
return kFALSE;
2645 if(ietrack->GetTPCNcls() <
fTPCnCut)
return kFALSE;
2646 if (ietrack->GetITSNcls() <
fITSncut)
return kFALSE;
2647 if(!ietrack->IsOn(AliAODTrack::kITSrefit))
return kFALSE;
2648 if(!ietrack->IsOn(AliAODTrack::kTPCrefit))
return kFALSE;
2649 if(!(ietrack->HasPointOnITSLayer(0) && ietrack->HasPointOnITSLayer(1)))
return kFALSE;
2650 if(ietrack->GetTPCFoundFraction() < 0.6)
return kFALSE;
2651 if(ietrack->Chi2perNDF() > 4)
return kFALSE;
2653 Bool_t kinkmotherpass = kTRUE;
2654 for(
Int_t kinkmother = 0; kinkmother < nMother; kinkmother++) {
2655 if(ietrack->GetID() == listMother[kinkmother]) {
2656 kinkmotherpass = kFALSE;
2660 if(!kinkmotherpass)
return kFALSE;
2662 Double_t d0z0[2]={-999,-999}, cov[3];
2664 if(ietrack->PropagateToDCA(pVietx,
fVevent->GetMagneticField(), 20., d0z0, cov))
2665 if(TMath::Abs(d0z0[0]) >
fDcaXYcut || TMath::Abs(d0z0[1]) >
fDcaZcut)
return kFALSE;
2675 if(!aetrack->TestFilterMask(AliAODTrack::kTrkTPCOnly))
return kFALSE;
2676 if(aetrack->Pt() <
fAssPtCut)
return kFALSE;
2677 if(TMath::Abs(aetrack->Eta())>0.9)
return kFALSE;
2678 if(aetrack->GetTPCNcls() <
fAssTPCnCut)
return kFALSE;
2679 if (
fAssITSrefitCut && !(aetrack->IsOn(AliAODTrack::kITSrefit)))
return kFALSE;
2680 if(!aetrack->IsOn(AliAODTrack::kTPCrefit))
return kFALSE;
Float_t Angularity(AliEmcalJet *jet, Int_t jetContNb)
TClonesArray * fMCarray
MC particle.
TH2F * fJetProbDensityPartDet
Double_t GetFirstOrderSubtractedAngularity() const
Float_t GetJetLeSub(AliEmcalJet *jet, Int_t jetContNb)
TH1F * fptTrueHFEeffTPCTOFwJetPt[2][5]
Bool_t IsFromHFdecay(AliAODMCParticle *particle)
void GetNumberOfTrueElectrons(AliEmcalJet *jet, Int_t jetContNb, Int_t nMother, Double_t listMother[], Int_t &nTrueElec, Int_t &nTrueHFElec, Double_t &ptTrueHFElec)
const TString & GetRhoName() const
Double_t GetSecondOrderSubtractedSigma2() const
Bool_t Run()
Run function. This is the core function of the analysis and contains the user code. Therefore users have to implement this function.
Bool_t FillHistograms()
Function filling histograms.
Float_t GetPartonEta6() const
AliEmcalJet * ClosestJet() const
AliJetContainer * GetJetContainer(Int_t i=0) const
Float_t GetPartonEta7() const
Double_t GetSecondOrderSubtractedConstituent() const
Float_t GetPythiaEventWeight() const
Container with name, TClonesArray and cuts for particles.
Double_t GetPi0weight(Double_t mcPi0pT) const
TH2F * fAngElecFromDFromB
Float_t GetPartonPhi7() const
Bool_t RetrieveEventObjects()
Retrieve common objects from event.
Bool_t PhotElecTrackCuts(const AliVVertex *pVtx, AliAODTrack *aetrack, Int_t nMother, Double_t listMother[])
Float_t Circularity(AliEmcalJet *jet, Int_t jetContNb)
Double_t GetSecondOrderSubtractedpTD() const
Bool_t RetrieveEventObjects()
Bool_t HasMother(AliAODMCParticle *particle)
Double_t GetFirstOrderSubtractedLeSub() const
AliAnalysisTaskEmcalHfeTagging()
Int_t GetNumberOfPairs(AliEmcalJet *jet, AliAODTrack *track, const AliVVertex *pVtx, Int_t nMother, Double_t listMother[])
void UserCreateOutputObjects()
Float_t GetJetCircularity(AliEmcalJet *jet, Int_t jetContNb)
Int_t GetPartonFlag7() const
Container for particles within the EMCAL framework.
Float_t Sigma2(AliEmcalJet *jet, Int_t jetContNb)
Float_t GetPartonPhi6() const
Int_t TrackAt(Int_t idx) const
Double_t GetFirstOrderSubtractedpTD() const
UShort_t GetNumberOfTracks() const
TH2F * fnEovPelecTPCsscut[5]
TString kData
Declare data MC or deltaAOD.
Float_t PTD(AliEmcalJet *jet, Int_t jetContNb)
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Get particle container attached to this task.
const TString & GetRhoMassName() const
Double_t GetSecondOrderSubtractedLeSub() const
Int_t GetPartonFlag6() const
Double_t GetEtaweight(Double_t mcEtapT) const
AliParticleContainer * GetParticleContainer() const
Double_t GetFirstOrderSubtractedConstituent() const
TH2F * fnEovPelecNoTPCcut
TH1F * fptTrueHFEeffTPCTOF[5]
TH2F * fnEovPelecTPCEMCalcut
Bool_t IsPrimary(AliAODMCParticle *particle)
TH2F * fnULSmLSpairsPerElectron
Float_t GetJetMass(AliEmcalJet *jet, Int_t jetContNb)
Double_t GetSecondOrderSubtractedAngularity() const
Bool_t InclElecTrackCuts(const AliVVertex *pVtx, AliAODTrack *ietrack, Int_t nMother, Double_t listMother[])
TH2F * fJetProbDensityDetPart
Double_t RelativePhi(Double_t mphi, Double_t vphi)
virtual AliVParticle * GetAcceptParticle(Int_t i=-1) const
Double_t fCent
!event centrality
TClonesArray * GetArray() const
AliVEvent * fVevent
AOD object.
Double_t GetSecondOrderSubtracted() const
AliEmcalJet * GetNextAcceptJet()
void Terminate(Option_t *option)
void GetNumberOfElectrons(AliEmcalJet *jet, Int_t jetContNb, Int_t nMother, Double_t listMother[], Int_t &nIncElec, Int_t &nPhotElec, Double_t &pElec, Double_t &ptElec, Bool_t &hasElec)
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)
Float_t LeSub(AliEmcalJet *jet, Int_t jetContNb)
virtual ~AliAnalysisTaskEmcalHfeTagging()
Double_t GetRhoVal(Int_t i=0) const
void GetWeightAndDecay(AliAODMCParticle *particle, Int_t &decay, Double_t &weight)
Double_t GetFirstOrderSubtractedCircularity() const
Float_t fMinFractionShared
TH1F * fptTrueHFEeffEMCalwJetPt[2][5]
TH2F * fDispElecFromDFromB
AliAODMCParticle * fMCparticle
stack
AliEmcalList * fOutput
!output list
TH1F * fnIncSubPhotElecPerJet
Float_t GetJetCoronna(AliEmcalJet *jet, Int_t jetContNb)
Double_t GetSecondOrderSubtractedCircularity() const
AliTrackContainer * GetTrackContainer(Int_t i=0) const
Store some informaion about a Pythia eventThis class is used to store some information about a Pythia...
void SetMakeGeneralHistograms(Bool_t g)
Enable general histograms.
Float_t GetJetAngularity(AliEmcalJet *jet, Int_t jetContNb)
Float_t GetSigma2(AliEmcalJet *jet, Int_t jetContNb)
virtual AliVTrack * GetAcceptTrack(Int_t i=-1) const
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
const AliEmcalPythiaInfo * GetPythiaInfo() const
AliAODMCHeader * fMCheader
MC array.
Double_t GetFractionSharedPt(const AliEmcalJet *jet, AliParticleContainer *cont2=0x0) const
Declaration of class AliEmcalPythiaInfo.
JetShapeType fJetShapeType
void UserCreateOutputObjects()
Main initialization function on the worker.
TH1F * fptTrueHFEeffEMCal[5]
Double_t GetFirstOrderSubtractedSigma2() const
Bool_t IsFromLMdecay(AliAODMCParticle *particle)
AliEmcalJetShapeProperties * GetShapeProperties() const
Int_t SelectTrigger(Float_t minpT, Float_t maxpT)
TH1F * fnElecOverPartPerJet
AliPIDResponse * fpidResponse
VEvent.
Float_t GetJetpTD(AliEmcalJet *jet, Int_t jetContNb)
const AliVVertex * spdVtx
Float_t Coronna(AliEmcalJet *jet, Int_t jetContNb)
Float_t GetPartonPt7() const
void ResetCurrentID(Int_t i=-1)
Reset the iterator to a given index.
TTree * fTreeObservableTagging
Double_t GetFirstOrderSubtracted() const
Container for jet within the EMCAL jet framework.
TH2F * fEtaPhiRecElecEMCal
std::vector< int > GetPtSortedTrackConstituentIndexes(TClonesArray *tracks) const
Float_t GetPartonPt6() const
Float_t GetJetNumberOfConstituents(AliEmcalJet *jet, Int_t jetContNb)
TH1F * fnTrueHFElecPerJet
AliEmcalJet * GetJet(Int_t i) const