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),
99 fAssITSrefitCut(kTRUE),
128 fnULSmLSpairsPerElectron(0),
130 fnElecOverPartPerJet(0),
133 fnIncSubPhotElecPerJet(0),
135 fnTrueHFElecPerJet(0),
136 fnTruePElecPerJet(0),
157 fEtaPhiTrueElec(0x0),
164 fTreeObservableTagging(0)
167 for(
Int_t i=0;i<21;i++){
171 for(
Int_t i=0;i<4;i++){
172 fptTrueHFE[i] = NULL;
175 for(
Int_t i=0;i<5;i++){
176 fInvmassLS[i] = NULL;
177 fInvmassULS[i] = NULL;
178 fUlsLsElecPt[i] = NULL;
179 fTotElecPt[i] = NULL;
180 for(
Int_t j=0;j<18;j++){
181 fnTPCTrueParticles[i][j] = NULL;
184 SetMakeGeneralHistograms(kTRUE);
185 DefineOutput(1, TList::Class());
186 DefineOutput(2, TTree::Class());
205 fMinFractionShared(0),
206 fJetShapeType(
kData),
207 fJetShapeSub(kNoSub),
208 fJetSelection(kInclusive),
209 fPtThreshold(-9999.),
214 fangWindowRecoil(0.6),
218 fCentSelectOn(kTRUE),
221 fOneConstSelectOn(kFALSE),
228 fAssITSrefitCut(kTRUE),
257 fnULSmLSpairsPerElectron(0),
259 fnElecOverPartPerJet(0),
262 fnIncSubPhotElecPerJet(0),
264 fnTrueHFElecPerJet(0),
265 fnTruePElecPerJet(0),
286 fEtaPhiTrueElec(0x0),
293 fTreeObservableTagging(0)
297 for(
Int_t i=0;i<21;i++){
301 for(
Int_t i=0;i<4;i++){
305 for(
Int_t i=0;i<5;i++){
310 for(
Int_t j=0;j<18;j++){
316 DefineOutput(1, TList::Class());
317 DefineOutput(2, TTree::Class());
334 Bool_t oldStatus = TH1::AddDirectoryStatus();
335 TH1::AddDirectory(kFALSE);
337 fh2ResponseUW=
new TH2F(
"fh2ResponseUW",
"fh2ResponseUW", 100, 0, 200, 100, 0, 200);
339 fh2ResponseW=
new TH2F(
"fh2ResponseW",
"fh2ResponseW", 100, 0, 200, 100, 0, 200);
341 fPhiJetCorr6=
new TH2F(
"fPhiJetCorr6",
"fPhiJetCorr6", 50, 0, 2*TMath::Pi(), 50, 0, 2*TMath::Pi());
343 fEtaJetCorr6=
new TH2F(
"fEtaJetCorr6",
"fEtaJetCorr6", 50, -1.5, 1.5, 50, -1.5, 1.5);
346 fPhiJetCorr7=
new TH2F(
"fPhiJetCorr7",
"fPhiJetCorr7", 50, 0, 2*TMath::Pi(), 50, 0, 2*TMath::Pi());
348 fEtaJetCorr7=
new TH2F(
"fEtaJetCorr7",
"fEtaJetCorr7", 50, -1.5, 1.5, 50, -1.5, 1.5);
351 fPtJetCorr=
new TH2F(
"fPtJetCorr",
"fPtJetCorr", 100, 0, 200, 100, 0, 200);
354 fPtJet=
new TH1F(
"fPtJet",
"fPtJet", 100, 0, 200);
357 fPtGenJet=
new TH1F(
"fPtGenJet",
"fPtGenJet", 100, 0, 200);
360 fPhiJet=
new TH2F(
"fPhiJet",
"fPhiJet", 100, 0, 200, 100, 0, TMath::TwoPi());
363 fEtaJet=
new TH2F(
"fEtaJet",
"fEtaJet", 100, 0, 200, 100, -1,1);
366 fEtaPhiJet=
new TH2F(
"fEtaPhiJet",
"fEtaPhiJet", 100, 0, TMath::TwoPi(), 100, -1,1);
369 fAreaJet=
new TH2F(
"fAreaJet",
"fAreaJet", 100, 0, 200, 100, 0,1.5);
372 fhpTjetpT=
new TH2F(
"fhpTjetpT",
"fhpTjetpT", 200, 0, 200, 200, 0, 200);
375 fhPt=
new TH1F(
"fhPt",
"fhPt", 200, 0, 200);
378 fhPhi=
new TH1F(
"fhPhi",
"fhPhi", 100, -TMath::Pi(), TMath::Pi());
381 fNbOfConstvspT=
new TH2F(
"fNbOfConstvspT",
"fNbOfConstvspT", 100, 0, 100, 200, 0, 200);
384 fnTPCnTOFnocut=
new TH2F(
"fnTPCnTOFnocut",
"fnTPCnTOFnocut", 200, -10, 10, 200, -10, 10);
387 fnTPCnocut=
new TH2F(
"fnTPCnocut",
"fnTPCnocut", 50, 0, 5, 200, -10, 10);
390 fnTOFnocut=
new TH2F(
"fnTOFnocut",
"fnTOFnocut", 50, 0, 5, 200, -10, 10);
393 fnTPCcut=
new TH2F(
"fnTPCcut",
"fnTPCcut", 50, 0, 5, 200, -10, 10);
399 fnPartPerJet=
new TH1F(
"fnPartPerJet",
"fnPartPerJet", 500,0,500);
405 fnInclElecPerJet=
new TH1F(
"fnInclElecPerJet",
"fnInclElecPerJet", 100,0,100);
408 fnPhotElecPerJet=
new TH1F(
"fnPhotElecPerJet",
"fnPhotElecPerJet", 100,0,100);
414 fnTrueElecPerJet=
new TH1F(
"fnTrueElecPerJet",
"fnTrueElecPerJet", 100,0,100);
424 double xbins[60] = {0.01,0.1,0.12,0.14,0.16,0.18,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7,0.75,
425 0.8,0.85,0.9,0.95,1,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2,2.2,2.4,2.6,2.8,3,3.2,3.4,3.6,3.8,4,4.5,5,
426 5.5,6,6.5,7,8,9,10,11,12,13,14,15,16,18,20};
428 fPi0Pt =
new TH2F(
"fPi0Pt",
"fPi0Pt",4,0,4,nbin,xbins);
431 fEtaPt =
new TH2F(
"fEtaPt",
"fEtaPt",4,0,4,nbin,xbins);
434 fGenHfePt =
new TH1F(
"fGenHfePt",
"fGenHfePt",nbin,xbins);
437 fGenPePt =
new TH1F(
"fGenPePt",
"fGenPePt",nbin,xbins);
440 Double_t ptRange[19] = {0.5,0.7,0.9,1.1,1.3,1.5,1.7,1.9,2.1,2.3,2.5,2.7,2.9,3.1,3.3,3.5,3.7,3.9,5};
442 fPtP=
new TH2F(
"fPtP",
"fPtP", 18,ptRange,18,ptRange);
445 for(
Int_t i=0;i<5;i++){
447 fInvmassLS[i] =
new TH2F(Form(
"fInvmassLS%d",i), Form(
"fInvmassLS%d",i), 50, 0, 5, 100, 0, 0.5);
450 fInvmassULS[i] =
new TH2F(Form(
"fInvmassULS%d",i), Form(
"fInvmassULS%d",i), 50, 0, 5, 100, 0, 0.5);
453 fUlsLsElecPt[i] =
new TH1F(Form(
"fUlsLsElecPt%d",i), Form(
"fUlsLsElecPt%d",i), 18,ptRange);
456 fTotElecPt[i] =
new TH1F(Form(
"fTotElecPt%d",i), Form(
"fTotElecPt%d",i), 18,ptRange);
460 for(
Int_t j=0;j<18;j++){
461 fnTPCTrueParticles[i][j] =
new TH2F(Form(
"fnTPCTrueParticles%d%d",i,j),Form(
"fnTPCTrueParticles%d%d",i,j), 7,0,7,100,-15,15);
466 for(
Int_t i=0;i<4;i++){
467 fptTrueHFE[i] =
new TH1F(Form(
"fptTrueHFE%d",i), Form(
"fptTrueHFE%d",i), 18,ptRange);
471 fptJetIE=
new TH1F(
"fptJetIE",
"fptJetIE", 100, 0, 200);
474 fptJetPE=
new TH1F(
"fptJetPE",
"fptJetPE", 100, 0, 200);
477 fptJetHFE=
new TH1F(
"fptJetHFE",
"fptJetHFE", 100, 0, 200);
480 fptRecPE=
new TH1F(
"fptRecPE",
"fptRecPE", 100, 0, 50);
483 fptTruePE=
new TH1F(
"fptTruePE",
"fptTruePE", 100, 0, 50);
486 fptWrongPE=
new TH1F(
"fptWrongPE",
"fptWrongPE", 100, 0, 50);
489 fPtTrack=
new TH1F(
"fPtTrack",
"fPtTrack", 100, 0, 200);
492 fPhiTrack=
new TH2F(
"fPhiTrack",
"fPhiTrack", 100, 0, 200, 100, 0, TMath::TwoPi());
495 fEtaTrack=
new TH2F(
"fEtaTrack",
"fEtaTrack", 100, 0, 200, 100, -1,1);
498 fEtaPhiTrack=
new TH2F(
"fEtaPhiTrack",
"fEtaPhiTrack", 100, 0, TMath::TwoPi(), 100, -1,1);
501 fPhiRecElec=
new TH2F(
"fPhiRecElec",
"fPhiRecElec", 100, 0, 50, 100, 0, TMath::TwoPi());
504 fEtaRecElec=
new TH2F(
"fEtaRecElec",
"fEtaRecElec", 100, 0, 50, 100, -1,1);
507 fEtaPhiRecElec=
new TH2F(
"fEtaPhiRecElec",
"fEtaPhiRecElec", 100, 0, TMath::TwoPi(), 100, -1,1);
510 fPhiTrueElec=
new TH2F(
"fPhiTrueElec",
"fPhiTrueElec", 100, 0, 50, 100, 0, TMath::TwoPi());
513 fEtaTrueElec=
new TH2F(
"fEtaTrueElec",
"fEtaTrueElec", 100, 0, 50, 100, -1,1);
516 fEtaPhiTrueElec=
new TH2F(
"fEtaPhiTrueElec",
"fEtaPhiTrueElec", 100, 0, TMath::TwoPi(), 100, -1,1);
520 fnEovPelec =
new TH2F(
"fnEovPelec",
"fnEovPelec", 100,0,100,40,0,2);
523 fnEovPbackg =
new TH2F(
"fnEovPbackg",
"fnEovPbackg", 100,0,100,40,0,2);
526 fnClsE =
new TH2F(
"fnClsE",
"fnClsE", 100, 0, 100, 100, 0,100);
529 fnM20 =
new TH2F(
"fnM20",
"fnM20", 100, 0, 100, 100, 0,2);
532 fnM02 =
new TH2F(
"fnM02",
"fnM02", 100, 0, 100, 100, 0,2);
535 fnClsTime =
new TH2F(
"fnClsTime",
"fnClsTime", 100, 0, 100, 100, -200,200);
546 THnSparse *hn =
dynamic_cast<THnSparse*
>(
fOutput->At(i));
551 TH1::AddDirectory(oldStatus);
558 fShapesVarNames[0] =
"partonCode";
559 fShapesVarNames[1] =
"ptJet";
560 fShapesVarNames[2] =
"ptDJet";
561 fShapesVarNames[3] =
"mJet";
563 fShapesVarNames[4] =
"angularity";
564 fShapesVarNames[5] =
"circularity";
565 fShapesVarNames[6] =
"lesub";
566 fShapesVarNames[7] =
"coronna";
568 fShapesVarNames[8] =
"ptJetMatch";
569 fShapesVarNames[9] =
"ptDJetMatch";
570 fShapesVarNames[10] =
"mJetMatch";
572 fShapesVarNames[11] =
"angularityMatch";
573 fShapesVarNames[12] =
"circularityMatch";
574 fShapesVarNames[13] =
"lesubMatch";
575 fShapesVarNames[14] =
"coronnaMatch";
576 fShapesVarNames[15]=
"weightPythia";
578 fShapesVarNames[16]=
"rhoVal";
579 fShapesVarNames[17]=
"rhoMassVal";
580 fShapesVarNames[18]=
"ptUnsub";
581 fShapesVarNames[19]=
"pElec";
582 fShapesVarNames[20]=
"ptElec";
583 fShapesVarNames[21]=
"nInclElec";
584 fShapesVarNames[22]=
"nPhotElec";
585 fShapesVarNames[23]=
"hasElec";
596 delete [] fShapesVarNames;
606 printf(
"ERROR: fAOD not available\n");
610 fVevent =
dynamic_cast<AliVEvent*
>(InputEvent());
612 printf(
"ERROR: fVEvent not available\n");
620 fMCarray =
dynamic_cast<TClonesArray*
>(
fAOD->FindListObject(AliAODMCParticle::StdBranchName()));
621 fMCheader =
dynamic_cast<AliAODMCHeader*
>(
fAOD->GetList()->FindObject(AliAODMCHeader::StdBranchName()));
628 AliGenEventHeader* gh=(AliGenEventHeader*)lh->At(0);
629 NpureMC = gh->NProduced();
634 Bool_t isPileupfromSPDmulbins = kFALSE, isPileupFromMV = kFALSE;
635 isPileupfromSPDmulbins =
fAOD->IsPileupFromSPDInMultBins();
636 if (isPileupfromSPDmulbins)
return kFALSE;
638 AliAnalysisUtils utils;
639 utils.SetMinPlpContribMV(5);
640 utils.SetMaxPlpChi2MV(5.);
641 utils.SetMinWDistMV(15);
642 utils.SetCheckPlpFromDifferentBCMV(kFALSE);
643 isPileupFromMV = utils.IsPileUpMV(
fAOD);
644 if (isPileupFromMV)
return kFALSE;
648 Bool_t isPrimary = kFALSE, isFromLMdecay = kTRUE, isFromHFdecay=kTRUE;
655 for (
Int_t iParticle = 0; iParticle < nParticles; iParticle++) {
656 AliAODMCParticle* particle = (AliAODMCParticle*)
fMCarray->At(iParticle);
657 int fPDG = particle->GetPdgCode();
663 if(iParticle>=NpureMC)iEnhance = kTRUE;
677 if (TMath::Abs(etaMC)<0.8 && TMath::Abs(fPDG)==11){
682 if (isFromHFdecay)
fGenHfePt->Fill(pTMC);
683 if (iDecay>0 && iDecay<7)
fGenPePt->Fill(pTMC);
688 if (TMath::Abs(yMC)>1.0)
continue;
691 if(fPDG==111)
fPi0Pt->Fill(iEnhance,pTMC);
692 if(fPDG==221)
fEtaPt->Fill(iEnhance,pTMC);
694 if (!isFromHFdecay && !isFromLMdecay){
695 if(fPDG==111)
fPi0Pt->Fill(iEnhance+2,pTMC);
696 if(fPDG==221)
fEtaPt->Fill(iEnhance+2,pTMC);
716 AliAODTrack *triggerHadron = 0x0;
723 if (triggerHadronLabel==-99999) {
738 TClonesArray *TrackArray = NULL;
739 TClonesArray *TrackArrayMC = NULL;
741 else TrackArray = PartCont->GetArray();
743 else triggerHadron =
static_cast<AliAODTrack*
>(TrackArray->At(triggerHadronLabel));
747 if (!triggerHadron) {
758 fhPt->Fill(triggerHadron->Pt());
764 nVertices =
fAOD->GetNumberOfVertices();
765 Double_t listofmotherkink[nVertices];
766 Int_t nMotherKink = 0;
767 for(
Int_t ivertex=0; ivertex < nVertices; ivertex++) {
768 AliAODVertex *vertex =
fAOD->GetVertex(ivertex);
769 if(!vertex)
continue;
770 if(vertex->GetType()==AliAODVertex::kKink) {
771 AliAODTrack *mother = (AliAODTrack *) vertex->GetParent();
772 if(!mother)
continue;
773 Int_t idmother = mother->GetID();
774 listofmotherkink[nMotherKink] = idmother;
783 Float_t rhoVal=0, rhoMassVal = 0.;
786 jetCont->ResetCurrentID();
791 Printf(
"%s: Could not retrieve rho %s (some histograms will be filled with zero)!", GetName(), jetCont->
GetRhoName().Data());
792 }
else rhoVal = rhoParam->GetVal();
796 Printf(
"%s: Could not retrieve rho_m %s (some histograms will be filled with zero)!", GetName(), jetCont->
GetRhoMassName().Data());
797 }
else rhoMassVal = rhomParam->GetVal();
810 Int_t ifound=0, jfound=0;
811 Int_t ilab=-1, jlab=-1;
841 jetUS = jetContUS->
GetJet(i);
844 if(ifound==1) ilab = i;
847 if(ilab==-1)
continue;
848 jetUS=jetContUS->
GetJet(ilab);
854 Printf(
"jet2 does not exist, returning");
862 Printf(
"jet3 does not exist, returning");
891 jetUS = jetContUS->
GetJet(i);
894 if(ifound==1) ilab = i;
897 if(ilab==-1)
continue;
898 jetUS=jetContUS->
GetJet(ilab);
902 Printf(
"jet2 does not exist, returning");
908 jet3 = jetContPart->
GetJet(j);
912 if(jfound==1) jlab = j;
915 if(jlab==-1)
continue;
916 jet3=jetContPart->
GetJet(jlab);
918 Printf(
"jet3 does not exist, returning");
924 Printf(
"jet3 does not exist, returning");
946 Float_t dRp1 = TMath::Sqrt(jp1 * jp1 + detap1 * detap1);
956 dRp1 = TMath::Sqrt(jp1 * jp1 + detap1 * detap1);
999 Float_t ptMatch=0., ptDMatch=0., massMatch=0., angulMatch=0.,circMatch=0., lesubMatch=0., coronnaMatch=0;
1061 Int_t nInclusiveElectrons = 0, nPhotonicElectrons = 0, nTrueElectronsMC, nTrueHFElecMC;
1063 Bool_t hasElectrons = kFALSE;
1067 GetNumberOfElectrons(jet1, 0,nMotherKink,listofmotherkink,nInclusiveElectrons,nPhotonicElectrons,pElec,ptElec,hasElectrons);
1074 AliVParticle *vp1 = 0x0;
1076 Int_t elecCounter = 0;
1083 Printf(
"AliVParticle associated to constituent not found");
1087 pdgCode = vp1->PdgCode();
1088 if (TMath::Abs(pdgCode)==11) elecCounter++;
1122 AliVParticle *vp1 = 0x0;
1123 Int_t nIE=0, nPairs=0, nPE=0, sub = -1;
1126 Bool_t hasElecCand = kFALSE;
1134 printf(
"ERROR: pid response not available\n");
1141 Printf(
"AliVParticle associated to constituent not found");
1145 AliVTrack *vtrack =
dynamic_cast<AliVTrack*
>(vp1);
1147 printf(
"ERROR: Could not receive track%d\n", i);
1151 AliAODTrack *track =
dynamic_cast<AliAODTrack*
>(vtrack);
1152 if (!track)
continue;
1155 Bool_t passTrackCut = kFALSE;
1157 if (!passTrackCut)
continue;
1159 Double_t p=-9., pt=-9., fTPCnSigma=-99., fTOFnSigma=-99., phi = -9., eta = -99.;
1172 fTPCnSigma =
fpidResponse->NumberOfSigmasTPC(track, AliPID::kElectron);
1173 fTOFnSigma =
fpidResponse->NumberOfSigmasTOF(track, AliPID::kElectron);
1180 if(TMath::Abs(fTPCnSigma)<3.5){
1181 hasElecCand = kTRUE;
1194 if (nPairs>0) nPE++;
1199 Double_t clsE = -9., m02 = -9., m20 = -9., clsTime = -9, EovP = -9.;
1204 Int_t clsId = track->GetEMCALcluster();
1206 AliVCluster *cluster=0x0;
1207 cluster = (AliVCluster*)
fVevent->GetCaloCluster(clsId);
1209 if(cluster && cluster->IsEMCAL() && phi>emcphimim && phi<emcphimax){
1210 clsE = cluster->E();
1211 m20 = cluster->GetM20();
1212 m02 = cluster->GetM02();
1213 clsTime = cluster->GetTOF()*1e+9;
1220 if (TMath::Abs(fTPCnSigma)>4)
fnEovPbackg->Fill(pt,EovP);
1222 fnM20->Fill(pt,m20);
1223 fnM02->Fill(pt,m02);
1240 hasElec = hasElecCand;
1246 AliVParticle *vp1 = 0x0;
1247 Int_t nIE=0, nHFE=0, nPE=0, PartId=0, nPairs=0, iDecay = 0;
1248 Double_t p=-9., pt=-9., fTPCnSigma=-99., fTOFnSigma=-99., MCweight = 1.;
1249 Double_t ptRange[19] = {0.5,0.7,0.9,1.1,1.3,1.5,1.7,1.9,2.1,2.3,2.5,2.7,2.9,3.1,3.3,3.5,3.7,3.9,5};
1250 Double_t ptJetRange[6] = {5,15,25,35,45,60};
1252 Bool_t isFromHFdecay=kFALSE;
1253 Bool_t isFromLMdecay=kFALSE;
1254 Bool_t passTrackCut = kFALSE;
1264 Printf(
"AliVParticle associated to constituent not found");
1268 AliVTrack *vtrack =
dynamic_cast<AliVTrack*
>(vp1);
1270 printf(
"ERROR: Could not receive track%d\n", i);
1274 AliAODTrack *track =
dynamic_cast<AliAODTrack*
>(vtrack);
1276 passTrackCut = kFALSE;
1277 isFromHFdecay=kFALSE;
1278 isFromLMdecay=kFALSE;
1283 fTPCnSigma =
fpidResponse->NumberOfSigmasTPC(track, AliPID::kElectron);
1284 fTOFnSigma =
fpidResponse->NumberOfSigmasTOF(track, AliPID::kElectron);
1291 Int_t label = track->GetLabel();
1301 if (TMath::Abs(partPDG)==11 && isFromHFdecay)
fptTrueHFE[0]->Fill(pt);
1305 if (!passTrackCut)
continue;
1307 if (TMath::Abs(partPDG)==11 && isFromHFdecay)
fptTrueHFE[1]->Fill(pt);
1311 if (TMath::Abs(partPDG)==11) PartId = 1;
1312 if (TMath::Abs(partPDG)==13) PartId = 2;
1313 if (TMath::Abs(partPDG)==321) PartId = 3;
1314 if (TMath::Abs(partPDG)==2212) PartId = 4;
1315 if (TMath::Abs(partPDG)==211) PartId = 5;
1317 for (
Int_t l=0;l<5;l++){
1318 for(
Int_t k=0;k<18;k++){
1319 if (jetPt>=ptJetRange[l] && jetPt<ptJetRange[l+1] && p>=ptRange[k] && p<ptRange[k+1])
fnTPCTrueParticles[l][k]->Fill(PartId,fTPCnSigma);
1328 if (TMath::Abs(partPDG)==11) nIE++;
1329 if (isFromHFdecay) nHFE++;
1330 if (isFromLMdecay) nPE++;
1335 if (nPairs>0)
fptRecPE->Fill(pt,MCweight);
1336 if (nPairs>0 && (iDecay<1 || iDecay>6))
fptWrongPE->Fill(pt,MCweight);
1338 if (iDecay>0 && iDecay<7){
1340 for (
Int_t l=0;l<5;l++){
1342 if (jetPt>=ptJetRange[l] && jetPt<ptJetRange[l+1]){
1355 if (nIE==1 && nPE==1)
fptJetPE->Fill(jet->
Pt());
1356 if (nIE==1 && nHFE==1)
fptJetHFE->Fill(jet->
Pt());
1373 ntracks =
fVevent->GetNumberOfTracks();
1375 Int_t nULSpairs = 0;
1379 Double_t ptJetRange[6] = {5,15,25,35,45,60};
1382 for(
Int_t jTracks = 0; jTracks < ntracks; jTracks++){
1384 AliVParticle* Vassotrack =
fVevent->GetTrack(jTracks);
1387 printf(
"ERROR: Could not receive associated track %d\n", jTracks);
1390 AliAODTrack *trackAsso =
dynamic_cast<AliAODTrack*
>(Vassotrack);
1391 if(!trackAsso)
continue;
1393 if((track->GetID())==(trackAsso->GetID()))
continue;
1396 Bool_t passAssoTrackCut = kFALSE;
1398 if (!passAssoTrackCut)
continue;
1401 Double_t p=-9.,pt=-9.,eta =-9.,phi=-9.;
1408 charge = track->Charge();
1412 Double_t pAsso=-9.,ptAsso=-9.,etaAsso =-9.,fITSnSigmaAsso=-9.,fTPCnSigmaAsso=-9.,phiAsso=-9.;
1413 Int_t chargeAsso = 0;
1415 ptAsso = trackAsso->Pt();
1416 pAsso = trackAsso->P();
1417 phiAsso = trackAsso->Phi();
1418 etaAsso = trackAsso->Eta();
1419 chargeAsso = trackAsso->Charge();
1423 fITSnSigmaAsso =
fpidResponse->NumberOfSigmasITS(trackAsso, AliPID::kElectron);
1424 fTPCnSigmaAsso =
fpidResponse->NumberOfSigmasTPC(trackAsso, AliPID::kElectron);
1426 if(TMath::Abs(fTPCnSigmaAsso)>3)
continue;
1429 Bool_t fFlagLS=kFALSE, fFlagULS=kFALSE;
1430 Double_t openingAngle = -999.,
mass=999., width = -999;
1433 if(charge>0) fPDGe1 = -11;
1434 if(chargeAsso>0) fPDGe2 = -11;
1436 if(charge == chargeAsso) fFlagLS = kTRUE;
1437 if(charge != chargeAsso) fFlagULS = kTRUE;
1439 AliKFParticle::SetField(
fVevent->GetMagneticField());
1440 AliKFParticle ge1(*track, fPDGe1);
1441 AliKFParticle ge2(*trackAsso, fPDGe2);
1442 AliKFParticle recg(ge1, ge2);
1444 if(recg.GetNDF()<1)
continue;
1445 Double_t chi2recg = recg.GetChi2()/recg.GetNDF();
1446 if(TMath::Sqrt(TMath::Abs(chi2recg))>3.)
continue;
1448 openingAngle = ge1.GetAngle(ge2);
1451 Int_t MassCorrect=-9;
1452 MassCorrect = recg.GetMass(
mass,width);
1454 for (
Int_t l=0;l<5;l++){
1455 if (jetPt>=ptJetRange[l] && jetPt<ptJetRange[l+1] && fFlagULS)
fInvmassULS[l]->Fill(pt,
mass);
1456 if (jetPt>=ptJetRange[l] && jetPt<ptJetRange[l+1] && fFlagLS)
fInvmassLS[l]->Fill(pt,
mass);
1467 sub = nULSpairs-nLSpairs;
1478 Bool_t isHFdecay = kFALSE;
1479 Int_t partPDG = particle->GetPdgCode();
1481 Int_t idMother = particle->GetMother();
1482 if (TMath::Abs(partPDG)==11 && idMother>0){
1483 AliAODMCParticle* mother = (AliAODMCParticle*)
fMCarray->At(idMother);
1484 Int_t motherPDG = TMath::Abs(mother->GetPdgCode());
1487 if((motherPDG % 1000) / 100 == 4) isHFdecay = kTRUE;
1488 if(motherPDG / 1000 == 4) isHFdecay = kTRUE;
1491 if((motherPDG % 1000) / 100 == 5) isHFdecay = kTRUE;
1492 if(motherPDG / 1000 == 5) isHFdecay = kTRUE;
1495 if(motherPDG==4 || motherPDG==5 || motherPDG == 211 || motherPDG ==13 || motherPDG ==2112 || motherPDG ==130 || motherPDG ==3122 ||
1496 motherPDG ==310 || motherPDG ==3222 || motherPDG ==2212 || motherPDG ==3112 || motherPDG ==321 ||
1497 motherPDG ==11 || motherPDG ==3212 || motherPDG ==311 || motherPDG ==20213 || motherPDG ==3312 ||
1498 motherPDG ==3334 || motherPDG ==3324 || motherPDG ==3322 || motherPDG ==1000010020 || motherPDG ==15
1499 || motherPDG ==10323 || motherPDG ==2114 || motherPDG ==1000010030 || motherPDG ==2214 || motherPDG ==2224
1500 || motherPDG ==1114 || motherPDG == 2214 || motherPDG == 3114 || motherPDG ==3224 || motherPDG ==3124
1501 || motherPDG ==3314 || motherPDG ==10323 || motherPDG == 3214) isHFdecay = kTRUE;
1511 Bool_t isLMdecay = kFALSE;
1512 Int_t partPDG = particle->GetPdgCode();
1514 Int_t idMother = particle->GetMother();
1515 if (TMath::Abs(partPDG)==11 && idMother>0){
1516 AliAODMCParticle* mother = (AliAODMCParticle*)
fMCarray->At(idMother);
1517 Int_t motherPDG = TMath::Abs(mother->GetPdgCode());
1519 if(motherPDG == 111 || motherPDG == 221 || motherPDG==223 || motherPDG==333 || motherPDG==331 ||
1520 motherPDG==113 || motherPDG==213 || motherPDG==313 || motherPDG==323) isLMdecay = kTRUE;
1529 Bool_t isprimary = kFALSE;
1533 if (particle->IsPrimary()) isprimary = kTRUE;
1541 double weight = 1.0;
1543 double parPi0_enh[5] = {0.530499,0.732775,0.000997414,3.46894,4.84342};
1544 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]);
1552 double weight = 1.0;
1554 double parEta_enh[5] = {0.78512,-0.606822,0.0326254,3.13959,4.83715};
1555 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]);
1565 Int_t partPDG = particle->GetPdgCode();
1567 if (TMath::Abs(partPDG)==11){
1568 Int_t idMother = particle->GetMother();
1571 AliAODMCParticle* mother = (AliAODMCParticle*)
fMCarray->At(idMother);
1572 Int_t motherPDG = mother->GetPdgCode();
1579 if (motherPDG==111 && (isMotherPrimary || (!isMotherFromHF && !isMotherFromLM))){
1584 if (motherPDG==221 && (isMotherPrimary || (!isMotherFromHF && !isMotherFromLM))){
1590 Int_t idSecondMother = mother->GetMother();
1592 if (idSecondMother>0){
1593 AliAODMCParticle* secondMother = (AliAODMCParticle*)
fMCarray->At(idSecondMother);
1594 Int_t secondMotherPDG = secondMother->GetPdgCode();
1595 Double_t secondMotherPt = secondMother->Pt();
1601 if (motherPDG==22 && secondMotherPDG==111 && (isSecondMotherPrimary || (!isSecondMotherFromHF && !isSecondMotherFromLM))){
1606 if (motherPDG==22 && secondMotherPDG==221 && (isSecondMotherPrimary || (!isSecondMotherFromHF && !isSecondMotherFromLM))){
1611 if (motherPDG==111 && secondMotherPDG==221 && (isSecondMotherPrimary || (!isSecondMotherFromHF && !isSecondMotherFromLM))){
1616 Int_t idThirdMother = secondMother->GetMother();
1617 if (idThirdMother>0){
1618 AliAODMCParticle* thirdMother = (AliAODMCParticle*)
fMCarray->At(idThirdMother);
1619 Int_t thirdMotherPDG = thirdMother->GetPdgCode();
1620 Double_t thirdMotherPt = thirdMother->Pt();
1626 if (motherPDG==22 && secondMotherPDG==111 && thirdMotherPDG==221 && (isThirdMotherPrimary || (!isThirdMotherFromHF && !isThirdMotherFromLM))){
1645 AliVParticle *vp1 = 0x0;
1650 Printf(
"AliVParticle associated to constituent not found");
1655 Double_t dr2 = (vp1->Eta()-jet->
Eta())*(vp1->Eta()-jet->
Eta()) + dphi*dphi;
1657 num=num+vp1->Pt()*dr;
1691 TClonesArray *TracksArray = NULL;
1692 TClonesArray *TracksArrayMC = NULL;
1695 else TracksArray = PartCont->GetArray();
1698 if(!PartContMC || !TracksArrayMC)
return -2;
1701 if(!PartCont || !TracksArray)
return -2;
1705 AliAODTrack *
Track = 0x0;
1709 else NTracks = TracksArray->GetEntriesFast();
1711 for(
Int_t i=0; i < NTracks; i++){
1714 if (!Track)
continue;
1715 if(TMath::Abs(Track->Eta())>0.9)
continue;
1717 Double_t dr2 = (Track->Eta()-jet->
Eta())*(Track->Eta()-jet->
Eta()) + dphi*dphi;
1719 if((dr>=0.8) && (dr<1)) sumpt=sumpt+Track->Pt();
1723 if((Track = static_cast<AliAODTrack*>(PartCont->
GetAcceptTrack(i)))){
1724 if (!Track)
continue;
1725 if(TMath::Abs(Track->Eta())>0.9)
continue;
1726 if (Track->Pt()<0.15)
continue;
1728 Double_t dr2 = (Track->Eta()-jet->
Eta())*(Track->Eta()-jet->
Eta()) + dphi*dphi;
1730 if((dr>=0.8) && (dr<1)) sumpt=sumpt+Track->Pt();
1743 return Coronna(jet, jetContNb);
1755 AliVParticle *vp1 = 0x0;
1760 Printf(
"AliVParticle associated to constituent not found");
1764 num=num+vp1->Pt()*vp1->Pt();
1767 return TMath::Sqrt(num)/den;
1777 return PTD(jet, jetContNb);
1798 TVector3 ppJ1(pxjet, pyjet, pzjet);
1799 TVector3 ppJ3(- pxjet* pzjet, - pyjet * pzjet, pxjet * pxjet + pyjet * pyjet);
1801 TVector3 ppJ2(-pyjet, pxjet, 0);
1803 AliVParticle *vp1 = 0x0;
1808 Printf(
"AliVParticle associated to constituent not found");
1812 TVector3 pp(vp1->Px(), vp1->Py(), vp1->Pz());
1815 TVector3 pLong = pp.Dot(ppJ1) / ppJ1.Mag2() * ppJ1;
1816 TVector3 pPerp = pp - pLong;
1819 Float_t ppjX = pPerp.Dot(ppJ2);
1820 Float_t ppjY = pPerp.Dot(ppJ3);
1821 Float_t ppjT = TMath::Sqrt(ppjX * ppjX + ppjY * ppjY);
1822 if(ppjT<=0)
return 0;
1824 mxx += (ppjX * ppjX / ppjT);
1825 myy += (ppjY * ppjY / ppjT);
1826 mxy += (ppjX * ppjY / ppjT);
1831 if(sump2==0)
return 0;
1833 Double_t ele[4] = {mxx / sump2, mxy / sump2, mxy / sump2, myy / sump2};
1834 TMatrixDSym m0(2,ele);
1837 TMatrixDSymEigen m(m0);
1839 TMatrixD evecm = m.GetEigenVectors();
1840 eval = m.GetEigenValues();
1844 if (eval[0] < eval[1]) jev = 1;
1847 evec0 = TMatrixDColumn(evecm, jev);
1850 TVector2 evec(compx, compy);
1852 if(jev==1) circ=2*eval[0];
1853 if(jev==0) circ=2*eval[1];
1881 AliVParticle *vp1 = 0x0;
1882 AliVParticle *vp2 = 0x0;
1883 std::vector<int> ordindex;
1888 if(ordindex.size()<2)
return -1;
1892 Printf(
"AliVParticle associated to Leading constituent not found");
1898 Printf(
"AliVParticle associated to Subleading constituent not found");
1918 return LeSub(jet, jetContNb);
1947 AliVParticle *vp1 = 0x0;
1952 Printf(
"AliVParticle associated to constituent not found");
1960 mxx += ppt*ppt*deta*deta;
1961 myy += ppt*ppt*dphi*dphi;
1962 mxy -= ppt*ppt*deta*TMath::Abs(dphi);
1968 if(sump2==0)
return 0;
1970 Double_t ele[4] = {mxx , mxy , mxy , myy };
1971 TMatrixDSym m0(2,ele);
1974 TMatrixDSymEigen m(m0);
1976 TMatrixD evecm = m.GetEigenVectors();
1977 eval = m.GetEigenValues();
1981 if (eval[0] < eval[1]) jev = 1;
1984 evec0 = TMatrixDColumn(evecm, jev);
1987 TVector2 evec(compx, compy);
1989 if(jev==1) sig=TMath::Sqrt(TMath::Abs(eval[0])/sump2);
1990 if(jev==0) sig=TMath::Sqrt(TMath::Abs(eval[1])/sump2);
2004 return Sigma2(jet, jetContNb);
2024 TClonesArray *TracksArray = NULL;
2025 TClonesArray *TracksArrayMC = NULL;
2028 else TracksArray = PartCont->GetArray();
2031 if(!PartContMC || !TracksArrayMC)
return -99999;
2034 if(!PartCont || !TracksArray)
return -99999;
2038 AliAODTrack *
Track = 0x0;
2043 Int_t triggers[100];
2044 for (
Int_t iTrigger=0; iTrigger<100; iTrigger++) triggers[iTrigger] = 0;
2048 else NTracks = TracksArray->GetEntriesFast();
2050 for(
Int_t i=0; i < NTracks; i++){
2053 if (!Track)
continue;
2054 if(TMath::Abs(Track->Eta())>0.9)
continue;
2055 if (Track->Pt()<0.15)
continue;
2056 if ((Track->Pt() >= minpT) && (Track->Pt()< maxpT)) {
2063 if((Track = static_cast<AliAODTrack*>(PartCont->
GetAcceptTrack(i)))){
2064 if (!Track)
continue;
2065 if(TMath::Abs(Track->Eta())>0.9)
continue;
2066 if (Track->Pt()<0.15)
continue;
2067 if ((Track->Pt() >= minpT) && (Track->Pt()< maxpT)) {
2076 if (iTT == 0)
return -99999;
2077 Int_t nbRn = 0, index = 0 ;
2078 TRandom3* random =
new TRandom3(0);
2079 nbRn = random->Integer(iTT);
2080 index = triggers[nbRn];
2089 if (vphi < -1*TMath::Pi()) vphi += (2*TMath::Pi());
2090 else if (vphi > TMath::Pi()) vphi -= (2*TMath::Pi());
2091 if (mphi < -1*TMath::Pi()) mphi += (2*TMath::Pi());
2092 else if (mphi > TMath::Pi()) mphi -= (2*TMath::Pi());
2093 double dphi = mphi-vphi;
2094 if (dphi < -1*TMath::Pi()) dphi += (2*TMath::Pi());
2095 else if (dphi > TMath::Pi()) dphi -= (2*TMath::Pi());
2116 if(!ietrack->TestFilterMask(AliAODTrack::kTrkGlobalNoDCA))
return kFALSE;
2117 if(TMath::Abs(ietrack->Eta())>0.8)
return kFALSE;
2118 if(ietrack->GetTPCNcls() <
fTPCnCut)
return kFALSE;
2119 if (ietrack->GetITSNcls() <
fITSncut)
return kFALSE;
2120 if(!ietrack->IsOn(AliAODTrack::kITSrefit))
return kFALSE;
2121 if(!ietrack->IsOn(AliAODTrack::kTPCrefit))
return kFALSE;
2122 if(!(ietrack->HasPointOnITSLayer(0) && ietrack->HasPointOnITSLayer(1)))
return kFALSE;
2125 Bool_t kinkmotherpass = kTRUE;
2126 for(
Int_t kinkmother = 0; kinkmother < nMother; kinkmother++) {
2127 if(ietrack->GetID() == listMother[kinkmother]) {
2128 kinkmotherpass = kFALSE;
2132 if(!kinkmotherpass)
return kFALSE;
2134 Double_t d0z0[2]={-999,-999}, cov[3];
2136 if(ietrack->PropagateToDCA(pVietx,
fVevent->GetMagneticField(), 20., d0z0, cov))
2137 if(TMath::Abs(d0z0[0]) >
fDcaXYcut || TMath::Abs(d0z0[1]) >
fDcaZcut)
return kFALSE;
2147 if(!aetrack->TestFilterMask(AliAODTrack::kTrkTPCOnly))
return kFALSE;
2148 if(aetrack->Pt() <
fAssPtCut)
return kFALSE;
2149 if(TMath::Abs(aetrack->Eta())>0.9)
return kFALSE;
2150 if(aetrack->GetTPCNcls() <
fAssTPCnCut)
return kFALSE;
2151 if (
fAssITSrefitCut && !(aetrack->GetStatus()&AliAODTrack::kITSrefit))
return kFALSE;
2152 if(!(aetrack->GetStatus()&AliAODTrack::kTPCrefit))
return kFALSE;
Float_t Angularity(AliEmcalJet *jet, Int_t jetContNb)
TClonesArray * fMCarray
MC particle.
Double_t GetFirstOrderSubtractedAngularity() const
Float_t GetJetLeSub(AliEmcalJet *jet, Int_t jetContNb)
Bool_t IsFromHFdecay(AliAODMCParticle *particle)
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 * fnTPCTrueParticles[5][18]
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()
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
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
JetSelectionType fJetSelection
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[])
Double_t RelativePhi(Double_t mphi, Double_t vphi)
virtual AliVParticle * GetAcceptParticle(Int_t i=-1) const
Double_t fCent
!event centrality
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
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)
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.
void GetNumberOfTrueElectrons(AliEmcalJet *jet, Int_t jetContNb, Int_t nMother, Double_t listMother[], Int_t &nTrueElec, Int_t &nTrueHFElec)
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.
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
TTree * fTreeObservableTagging
Double_t GetFirstOrderSubtracted() const
Container for jet within the EMCAL jet framework.
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