22 #include <TClonesArray.h> 26 #include <THnSparse.h> 28 #include <TLorentzVector.h> 29 #include <TParameter.h> 30 #include <TParticle.h> 33 #include <TObjArray.h> 35 #include <AliVCluster.h> 36 #include <AliVParticle.h> 39 #include "AliAnalysisTask.h" 40 #include "AliAnalysisManager.h" 42 #include "AliESDEvent.h" 43 #include "AliESDInputHandler.h" 44 #include "AliESDtrackCuts.h" 45 #include "AliAODEvent.h" 46 #include "AliAODHandler.h" 56 #include "AliESDpid.h" 57 #include "AliAODPid.h" 58 #include "AliPIDResponse.h" 59 #include "AliKFParticle.h" 60 #include "AliKFVertex.h" 97 fHistClusEovPnonlin(),
98 fHistClusEovPHadCorr(),
99 fHistClusTrackMatchdPhi(),
100 fHistClusTrackMatchdEta()
157 AliVEventHandler *inputHandler =
dynamic_cast<AliVEventHandler *
>(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
158 if(!
TString(inputHandler->IsA()->GetName()).CompareTo(
"AliAODInputHandler")){
163 printf(
"Analysis Mode: %s Analysis\n",
IsAODanalysis() ?
"AOD" :
"ESD");
173 while ((obj = next())) {
210 while ((clusCont = static_cast<AliClusterContainer*>(next()))) {
211 groupname = clusCont->GetName();
215 fInvmassULS =
new TH1F(
"InvmassULS",
"Inv mass of ULS (e,e) for pt^{e}>1; mass(GeV/c^2); counts;", 1000,0,1.0);
216 fInvmassLS =
new TH1F(
"InvmassLS",
"Inv mass of LS (e,e) for pt^{e}>1; mass(GeV/c^2); counts;", 1000,0,1.0);
217 fHistClusEovP =
new TH1F(
"ClusEovP",
"Cluster EovP",200,0,1.3);
220 fHistClusTrackMatchdPhi =
new TH1F(
"HistClusTrackMatchdPhi",
"Cluster_{Phi} - Track_{Phi}; dPhi; counts;",1000,-2.0,2.0);
221 fHistClusTrackMatchdEta =
new TH1F(
"HistClusTrackMatchdEta",
"Cluster_{Eta} - Track_{Eta}; dPhi; counts;",1000,-2.0,2.0);
224 histname = TString::Format(
"%s/histClusterEnergy_%d", groupname.Data(), cent);
225 histtitle = TString::Format(
"%s;#it{E}_{cluster} (GeV);counts", histname.Data());
228 histname = TString::Format(
"%s/histClusterEnergyExotic_%d", groupname.Data(), cent);
229 histtitle = TString::Format(
"%s;#it{E}_{cluster}^{exotic} (GeV);counts", histname.Data());
232 histname = TString::Format(
"%s/histClusterNonLinCorrEnergy_%d", groupname.Data(), cent);
233 histtitle = TString::Format(
"%s;#it{E}_{cluster}^{non-lin.corr.} (GeV);counts", histname.Data());
236 histname = TString::Format(
"%s/histClusterHadCorrEnergy_%d", groupname.Data(), cent);
237 histtitle = TString::Format(
"%s;#it{E}_{cluster}^{had.corr.} (GeV);counts", histname.Data());
240 histname = TString::Format(
"%s/histClusterPhi_%d", groupname.Data(), cent);
241 histtitle = TString::Format(
"%s;#it{#phi}_{custer};counts", histname.Data());
244 histname = TString::Format(
"%s/histClusterEta_%d", groupname.Data(), cent);
245 histtitle = TString::Format(
"%s;#it{#eta}_{custer};counts", histname.Data());
248 histname = TString::Format(
"%s/histNClusters_%d", groupname.Data(), cent);
249 histtitle = TString::Format(
"%s;number of clusters;events", histname.Data());
273 histname = TString::Format(
"%s/histCellEnergyvsAbsId_%d", groupname.Data(), cent);
274 histtitle = TString::Format(
"%s;cell abs. ID;#it{E}_{cell} (GeV);counts", histname.Data());
277 histname = TString::Format(
"%s/histNCells_%d", groupname.Data(), cent);
278 histtitle = TString::Format(
"%s;number of cells;events", histname.Data());
301 while ((partCont = static_cast<AliParticleContainer*>(next()))) {
302 groupname = partCont->GetName();
305 histname = TString::Format(
"%s/histTrackPt_%d", groupname.Data(), cent);
306 histtitle = TString::Format(
"%s;#it{p}_{T,track} (GeV/#it{c});counts", histname.Data());
309 histname = TString::Format(
"%s/histTrackPhi_%d", groupname.Data(), cent);
310 histtitle = TString::Format(
"%s;#it{#phi}_{track};counts", histname.Data());
313 histname = TString::Format(
"%s/histTrackEta_%d", groupname.Data(), cent);
314 histtitle = TString::Format(
"%s;#it{#eta}_{track};counts", histname.Data());
317 if (TClass(partCont->GetClassName()).InheritsFrom(
"AliVTrack")) {
318 histname = TString::Format(
"%s/fHistDeltaEtaPt_%d", groupname.Data(), cent);
319 histtitle = TString::Format(
"%s;#it{p}_{T,track}^{vertex} (GeV/#it{c});#it{#eta}_{track}^{vertex} - #it{#eta}_{track}^{EMCal};counts", histname.Data());
322 histname = TString::Format(
"%s/fHistDeltaPhiPt_%d", groupname.Data(), cent);
323 histtitle = TString::Format(
"%s;#it{p}_{T,track}^{vertex} (GeV/#it{c});#it{#phi}_{track}^{vertex} - #it{#phi}_{track}^{EMCal};counts", histname.Data());
326 histname = TString::Format(
"%s/fHistDeltaPtvsPt_%d", groupname.Data(), cent);
327 histtitle = TString::Format(
"%s;#it{p}_{T,track}^{vertex} (GeV/#it{c});#it{p}_{T,track}^{vertex} - #it{p}_{T,track}^{EMCal} (GeV/#it{c});counts", histname.Data());
330 histname = TString::Format(
"%s/fHistEoverPvsP_%d", groupname.Data(), cent);
331 histtitle = TString::Format(
"%s;#it{P}_{track} (GeV/#it{c});#it{E}_{cluster} / #it{P}_{track} #it{c};counts", histname.Data());
335 histname = TString::Format(
"%s/histNTracks_%d", groupname.Data(), cent);
336 histtitle = TString::Format(
"%s;number of tracks;events", histname.Data());
359 while ((jetCont = static_cast<AliJetContainer*>(next()))) {
360 groupname = jetCont->GetName();
363 fHistJetEovP =
new TH1F(
"JetEovP",
"HFE Jet EovP",200,0,5);
367 histname = TString::Format(
"%s/histJetPt_%d", groupname.Data(), cent);
368 histtitle = TString::Format(
"%s;#it{p}_{T,jet} (GeV/#it{c});counts", histname.Data());
371 histname = TString::Format(
"%s/histJetArea_%d", groupname.Data(), cent);
372 histtitle = TString::Format(
"%s;#it{A}_{jet};counts", histname.Data());
375 histname = TString::Format(
"%s/histJetPhi_%d", groupname.Data(), cent);
376 histtitle = TString::Format(
"%s;#it{#phi}_{jet};counts", histname.Data());
379 histname = TString::Format(
"%s/histJetEta_%d", groupname.Data(), cent);
380 histtitle = TString::Format(
"%s;#it{#eta}_{jet};counts", histname.Data());
383 histname = TString::Format(
"%s/histNJets_%d", groupname.Data(), cent);
384 histtitle = TString::Format(
"%s;number of jets;events", histname.Data());
393 histname = TString::Format(
"%s/histJetCorrPt_%d", groupname.Data(), cent);
394 histtitle = TString::Format(
"%s;#it{p}_{T,jet}^{corr} (GeV/#it{c});counts", histname.Data());
428 while ((jetCont = static_cast<AliJetContainer*>(next()))) {
429 groupname = jetCont->GetName();
434 for(
auto jet : jetCont->
accepted()) {
438 histname = TString::Format(
"%s/histJetPt_%d", groupname.Data(),
fCentBin);
441 histname = TString::Format(
"%s/histJetArea_%d", groupname.Data(),
fCentBin);
444 histname = TString::Format(
"%s/histJetPhi_%d", groupname.Data(),
fCentBin);
447 histname = TString::Format(
"%s/histJetEta_%d", groupname.Data(),
fCentBin);
451 histname = TString::Format(
"%s/histJetCorrPt_%d", groupname.Data(),
fCentBin);
454 histname = TString::Format(
"%s/histNJets_%d", groupname.Data(),
fCentBin);
461 TLorentzVector leadPart;
467 while (ep < 0) ep += TMath::Pi();
468 while (ep >= TMath::Pi()) ep -= TMath::Pi();
475 for (
Int_t it = 0; it < jet->GetNumberOfTracks(); it++) {
476 AliVParticle *track = jet->TrackAt(it, tracks->GetArray());
479 AliVTrack *Vtrack =
dynamic_cast<AliVTrack*
>(track);
510 Int_t JetTrackLabel = Vtrack->GetID();
518 Int_t EMCalIndex = -1;
519 EMCalIndex = Vtrack->GetEMCALcluster();
520 if(EMCalIndex < 0)
continue;
525 if (!ClusterMatchCont)
continue;
526 AliVCluster* clusmatch = ClusterMatchCont->
GetCluster(EMCalIndex);
528 if(clusmatch->E() < 0.500)
continue;
529 if(!(clusmatch && clusmatch->IsEMCAL()))
continue;
531 Double_t clustMatchNonLinE = clusmatch->GetNonLinCorrEnergy();
536 Double_t detaTrckClus = -999. , dphiTrckClus = -999. , emcphi = -999., emceta = -999. ;
537 clusmatch->GetPosition(emcx);
538 clustpos.SetXYZ(emcx[0],emcx[1],emcx[2]);
539 emcphi = clustpos.Phi();
540 emceta = clustpos.Eta();
541 Double_t TrackEtaEMC = -999., TrackPhiEMC = -999., TrackPEMC = -999., TrackPtEMC = -999.;
545 fTPCnSigma =
fpidResponse->NumberOfSigmasTPC(Vtrack, AliPID::kElectron);
548 TrackEtaEMC = Vtrack->GetTrackEtaOnEMCal();
549 TrackPhiEMC = Vtrack->GetTrackPhiOnEMCal();
550 TrackPEMC = Vtrack->GetTrackPOnEMCal();
551 TrackPtEMC = Vtrack->GetTrackPtOnEMCal();
552 detaTrckClus = TrackEtaEMC - track->Eta();
553 dphiTrckClus = TrackPhiEMC - track->Phi();
560 Bool_t fFlagPhotonicElec = kFALSE;
641 while ((partCont = static_cast<AliParticleContainer*>(next()))) {
642 groupname = partCont->GetName();
648 histname = TString::Format(
"%s/histTrackPt_%d", groupname.Data(),
fCentBin);
651 histname = TString::Format(
"%s/histTrackPhi_%d", groupname.Data(),
fCentBin);
654 histname = TString::Format(
"%s/histTrackEta_%d", groupname.Data(),
fCentBin);
657 if (partCont->GetLoadedClass()->InheritsFrom(
"AliVTrack")) {
658 const AliVTrack* track =
static_cast<const AliVTrack*
>(
part);
660 histname = TString::Format(
"%s/fHistDeltaEtaPt_%d", groupname.Data(),
fCentBin);
663 histname = TString::Format(
"%s/fHistDeltaPhiPt_%d", groupname.Data(),
fCentBin);
666 histname = TString::Format(
"%s/fHistDeltaPtvsPt_%d", groupname.Data(),
fCentBin);
675 Int_t iCluster = track->GetEMCALcluster();
681 Double_t ClusterNonLinE = cluster->GetNonLinCorrEnergy();
682 Double_t ClusterHadCorr = cluster->GetHadCorrEnergy();
685 sigma =
fpidResponse->NumberOfSigmasTPC(track, AliPID::kElectron);
692 histname = TString::Format(
"%s/fHistEoverPvsP_%d", groupname.Data(),
fCentBin);
700 histname = TString::Format(
"%s/histNTracks_%d", groupname.Data(),
fCentBin);
715 while ((clusCont = static_cast<AliClusterContainer*>(next()))) {
716 groupname = clusCont->GetName();
718 for(
auto cluster : clusCont->
all()) {
719 if (!cluster)
continue;
721 if (cluster->GetIsExotic()) {
722 histname = TString::Format(
"%s/histClusterEnergyExotic_%d", groupname.Data(),
fCentBin);
728 for(
auto cluster : clusCont->
accepted()) {
729 if (!cluster)
continue;
733 cluster->GetMomentum(nPart,
fVertex);
735 histname = TString::Format(
"%s/histClusterEnergy_%d", groupname.Data(),
fCentBin);
738 histname = TString::Format(
"%s/histClusterNonLinCorrEnergy_%d", groupname.Data(),
fCentBin);
741 histname = TString::Format(
"%s/histClusterHadCorrEnergy_%d", groupname.Data(),
fCentBin);
744 histname = TString::Format(
"%s/histClusterPhi_%d", groupname.Data(),
fCentBin);
747 histname = TString::Format(
"%s/histClusterEta_%d", groupname.Data(),
fCentBin);
751 histname = TString::Format(
"%s/histNClusters_%d", groupname.Data(),
fCentBin);
772 for (
Short_t pos = 0; pos < ncells; pos++) {
800 fVevent =
dynamic_cast<AliVEvent*
>(InputEvent());
802 printf(
"ERROR: fVEvent not available\n");
822 printf(
"ERROR: fpidResponse not available\n");
827 ntracks =
fVevent->GetNumberOfTracks();
841 Int_t numberofvertices = 100;
842 if(
fAOD) numberofvertices =
fAOD->GetNumberOfVertices();
843 Double_t listofmotherkink[numberofvertices];
844 Int_t numberofmotherkink = 0;
847 for(
Int_t ivertex=0; ivertex < numberofvertices; ivertex++) {
848 AliAODVertex *aodvertex =
fAOD->GetVertex(ivertex);
849 if(!aodvertex)
continue;
850 if(aodvertex->GetType()==AliAODVertex::kKink) {
851 AliAODTrack *mother = (AliAODTrack *) aodvertex->GetParent();
852 if(!mother)
continue;
853 Int_t idmother = mother->GetID();
854 listofmotherkink[numberofmotherkink] = idmother;
855 numberofmotherkink++;
875 Double_t clustE=-999, emcphi = -999, emceta=-999;
876 Nclust =
fVevent->GetNumberOfCaloClusters();
877 for(
Int_t icl=0; icl<Nclust; icl++)
879 AliVCluster *clust = 0x0;
880 clust =
fVevent->GetCaloCluster(icl);
881 if(!clust) printf(
"ERROR: Could not receive cluster matched calibrated from track %d\n", icl);
883 if(clust && clust->IsEMCAL())
886 clust->GetPosition(emcx);
887 clustpos.SetXYZ(emcx[0],emcx[1],emcx[2]);
888 emcphi = clustpos.Phi();
889 emceta = clustpos.Eta();
904 Bool_t flagPhotonicElec = kFALSE;
906 Bool_t fFlagLS=kFALSE, fFlagULS=kFALSE;
908 for(
Int_t jTracks = 0; jTracks<
fVevent->GetNumberOfTracks(); jTracks++){
910 AliVParticle* VtrackAsso =
fVevent->GetTrack(jTracks);
912 printf(
"ERROR: Could not receive track %d\n", jTracks);
915 AliVTrack *trackAsso =
dynamic_cast<AliVTrack*
>(VtrackAsso);
916 if(!trackAsso)
continue;
917 if(trackAsso->GetID() == itrack){
923 AliAODTrack *atrackAsso =
dynamic_cast<AliAODTrack*
>(VtrackAsso);
924 if(!atrackAsso)
continue;
925 if(!atrackAsso->TestFilterMask(AliAODTrack::kTrkTPCOnly))
continue;
926 if(atrackAsso->GetTPCNcls() < 70)
continue;
927 if(!(atrackAsso->GetStatus()&AliESDtrack::kTPCrefit))
continue;
928 if(!(atrackAsso->GetStatus()&AliESDtrack::kITSrefit))
continue;
932 ptAsso = trackAsso->Pt();
933 Int_t chargeAsso = trackAsso->Charge();
936 if(ptAsso <0.2)
continue;
937 if(trackAsso->Eta()<-0.9 || trackAsso->Eta()>0.9)
continue;
938 if(nsigma < -3 || nsigma > 3)
continue;
941 if(charge>0) fPDGe1 = -11;
942 if(chargeAsso>0) fPDGe2 = -11;
944 if(charge == chargeAsso) fFlagLS = kTRUE;
945 if(charge != chargeAsso) fFlagULS = kTRUE;
947 AliKFParticle::SetField(
fVevent->GetMagneticField());
949 AliKFParticle ge1 = AliKFParticle(*track, fPDGe1);
950 AliKFParticle ge2 = AliKFParticle(*trackAsso, fPDGe2);
951 AliKFParticle recg(ge1, ge2);
953 if(recg.GetNDF()<1)
continue;
954 Double_t chi2recg = recg.GetChi2()/recg.GetNDF();
955 if(TMath::Sqrt(TMath::Abs(chi2recg))>3.)
continue;
959 MassCorrect = recg.GetMass(mass,width);
961 if(fFlagLS && track->Pt()>1)
fInvmassLS->Fill(mass);
962 if(fFlagULS && track->Pt()>1)
fInvmassULS->Fill(mass);
964 if(mass<
fInvmassCut && fFlagULS && !flagPhotonicElec){
965 flagPhotonicElec = kTRUE;
968 fFlagPhotonicElec = flagPhotonicElec;
977 cout<<
"#######################"<<endl;
978 cout<<
"#### Task Finished ####"<<endl;
979 cout<<
"#######################"<<endl;
TH1F * fHistJetEovPvEP
Jet EovP vs Pt.
virtual ~AliAnalysisTaskEmcalJetHF()
TH1F * fHistClusTrackMatchdPhi
EovP using Hadron Corected Energy.
THashList * CreateHistoGroup(const char *groupname)
Create a new group of histograms within a parent group.
TObjArray fClusterCollArray
cluster collection array
Double_t GetRhoVal() const
const TString & GetRhoName() const
void AllocateClusterHistograms()
AliAODEvent * fAOD
ESD object.
void Terminate(Option_t *option)
TH2F * fdEdx
Invariant mass Cut for photons.
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
Fill a 2D histogram within the container.
Declaration of class AliTLorentzVector.
Double_t fMinBinPt
min pt in histograms
Double_t fEPV0
!event plane V0
AliClusterContainer * GetClusterContainer() const
void AllocateTrackHistograms()
void AllocateCellHistograms()
Int_t fCentBin
!event centrality bin
TH2F * fHistJetEovPvPt
Jet EovP.
TH1F * fHistClusEovPHadCorr
EovP using Non linear corrected energy.
void SelectPhotonicElectron(Int_t itrack, AliVTrack *track, Bool_t &fFlagPhotonicElec)
TH2F * fM02EovP
M20 vs E/p.
THistManager fHistManager
Histogram manager.
TString part
use mixed event to constrain combinatorial background
Container for particles within the EMCAL framework.
TObjArray fParticleCollArray
particle/track collection array
const AliClusterIterableContainer all() const
AliAnalysisTaskEmcalJetHF()
AliParticleContainer * GetParticleContainer() const
void GetLeadingHadronMomentum(TLorentzVector &mom, const AliEmcalJet *jet) const
TH2 * CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, Option_t *opt="")
Create a new TH2 within the container.
TH1F * fHistClusTrackMatchdEta
dPhi = Phi_cluster - Phi_track Matching
THashList * GetListOfHistograms() const
Get the list of histograms.
Double_t Phi_0_2pi() const
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
Create a new TH1 within the container.
BeamType fForceBeamType
forced beam type
Int_t fNcentBins
how many centrality bins
AliClusterContainer * GetClusterContainer(Int_t i=0) const
Get cluster container attached to this task.
AliVCluster * GetAcceptCluster(Int_t i) const
const AliClusterIterableContainer accepted() const
TString fCaloCellsName
name of calo cell collection
Bool_t IsAODanalysis() const
void AllocateJetHistograms()
Declaration of class AliAnalysisTaskEmcalJetHF. Task to perform analysis on HFE JEts.
AliVCluster * GetCluster(Int_t i) const
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
Fill a 1D histogram within the container.
TObjArray fJetCollArray
jet collection array
AliVCaloCells * fCaloCells
!cells
AliRhoParameter * GetRhoParameter()
Double_t fInvmassCut
Event Counter.
AliEmcalList * fOutput
!output list
Double_t fMaxBinPt
max pt in histograms
TH1F * fHistClusEovPnonlin
EovP using Cluster Energy.
Double_t fVertex[3]
!event vertex
void UserCreateOutputObjects()
TH1F * fInvmassLS
M20 vs E/p.
TH1F * fEMCTrketa
Invmass of ULS pairs.
void SetMakeGeneralHistograms(Bool_t g)
Base task in the EMCAL jet framework.
AliESDEvent * fESD
event object
const AliParticleIterableContainer accepted() const
TH1F * fHistJetEovP
EMCal trk phi.
void UserCreateOutputObjects()
Main initialization function on the worker.
Double_t fEventCounter
pid response
const AliJetIterableContainer accepted() const
TH1F * fEMCTrkphi
EMCal trk eta.
Container structure for EMCAL clusters.
TH1F * fHistClusEovP
Jet EovP vs Event Plane.
TH1F * fInvmassULS
Invmass of LS pairs.
AliPIDResponse * fpidResponse
AOD object.
Container for jet within the EMCAL jet framework.
Int_t fNbins
no. of pt bins