11 #include <TClonesArray.h>
12 #include <TDirectory.h>
18 #include <TLorentzVector.h>
23 #include "AliAODEvent.h"
24 #include "AliAnalysisManager.h"
25 #include "AliAnalysisUtils.h"
26 #include "AliCentrality.h"
27 #include "AliEMCALGeoParams.h"
28 #include "AliEMCALGeometry.h"
29 #include "AliEMCALRecoUtils.h"
30 #include "AliESDEvent.h"
31 #include "AliESDMuonTrack.h"
33 #include "AliExternalTrackParam.h"
34 #include "AliInputEventHandler.h"
36 #include "AliMultSelection.h"
38 #include "AliTrackerBase.h"
39 #include "AliVCluster.h"
40 #include "AliVEventHandler.h"
41 #include "AliVParticle.h"
42 #include "AliVTrack.h"
50 fDoTracking(0), fDoMuonTracking(0), fDoCumulants(0), fDoCumNtuple(0),
51 fCumPtMin(0.3), fCumPtMax(5.0), fCumEtaMin(-1.0), fCumEtaMax(1.0), fCumMmin(15), fCumMbins(250),
52 fDoHet(0), fHetEtmin(6),
53 fCentCL1In(0), fCentV0AIn(0),
54 fNtupCum(0), fNtupCumInfo(0), fNtupZdcInfo(0),
55 fNtupHet(0), fNtupHetInfo(0)
59 for (
Int_t i=0;i<1000;++i)
67 fDoTracking(1), fDoMuonTracking(0), fDoCumulants(0), fDoCumNtuple(0),
68 fCumPtMin(0.3), fCumPtMax(5.0), fCumEtaMin(-1.0), fCumEtaMax(1.0), fCumMmin(15), fCumMbins(250),
69 fDoHet(0), fHetEtmin(6),
70 fCentCL1In(0), fCentV0AIn(0),
71 fNtupCum(0), fNtupCumInfo(0), fNtupZdcInfo(0),
72 fNtupHet(0), fNtupHetInfo(0)
76 for (
Int_t i=0;i<1000;++i)
95 if (phia < 0) phia += tpi;
96 else if (phia > tpi) phia -= tpi;
97 if (phib < 0) phib += tpi;
98 else if (phib > tpi) phib -= tpi;
100 if (dphi < rangeMin) dphi += tpi;
101 else if (dphi > rangeMax) dphi -= tpi;
111 AliVEvent *
event = InputEvent();
114 UInt_t trig = ((AliInputEventHandler*)(am->GetInputEventHandler()))->IsEventSelected();
115 for (
Int_t i=0;i<31;++i) {
120 Double_t vz =
event->GetPrimaryVertex()->GetZ();
123 Int_t run =
event->GetRunNumber();
124 Int_t vzn =
event->GetPrimaryVertex()->GetNContributors();
125 if ((vzn<1)&&(run>0))
129 if (TMath::Abs(vz)>10)
133 if ((run>=188356&&run<=188366) || (run>=195344&&run<=197388)) {
134 AliAnalysisUtils anau;
135 if (anau.IsFirstEventInChunk(event))
137 if (!anau.IsVertexSelected2013pA(event))
145 AliMultSelection *ms =
dynamic_cast<AliMultSelection*
>(InputEvent()->FindListObject(
"MultSelection"));
146 Double_t v0acent=-1,znacent=-1,v0mcent=-1;
148 v0acent = ms->GetMultiplicityPercentile(
"V0A");
149 znacent = ms->GetMultiplicityPercentile(
"ZNA");
150 v0mcent = ms->GetMultiplicityPercentile(
"V0M");
152 AliCentrality *cent = InputEvent()->GetCentrality();
153 v0acent = cent->GetCentralityPercentile(
"V0A");
154 znacent = cent->GetCentralityPercentile(
"ZNA");
155 v0mcent = cent->GetCentralityPercentile(
"V0M");
157 fHists[10]->Fill(v0acent);
158 fHists[11]->Fill(znacent);
159 fHists[12]->Fill(v0mcent);
164 for (
Int_t i=0; i<ntracks; ++i) {
165 AliVTrack *track =
dynamic_cast<AliVTrack*
>(
fTracks->At(i));
168 if (track->Charge()==0)
178 fHists[20]->Fill(phi,eta);
181 if (TMath::Abs(eta)<0.8) {
182 fHists[23]->Fill(pt,v0acent);
183 fHists[24]->Fill(pt,znacent);
186 fHists[25+ttype]->Fill(phi,pt);
187 if (track->IsExtrapolatedToEMCAL()) {
188 Double_t dphi = TVector2::Phi_mpi_pi(phi-track->GetTrackPhiOnEMCal());
189 fHists[28]->Fill(dphi,pt);
191 AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(track,440);
192 if (track->IsExtrapolatedToEMCAL()) {
193 Double_t dphi = TVector2::Phi_mpi_pi(phi-track->GetTrackPhiOnEMCal());
194 fHists[29]->Fill(dphi,pt);
197 if (track->IsEMCAL() && track->IsExtrapolatedToEMCAL()) {
198 Int_t id = track->GetEMCALcluster();
199 AliVCluster *clus = InputEvent()->GetCaloCluster(
id);
202 clus->GetPosition(pos);
204 Double_t dphi = TVector2::Phi_mpi_pi(vpos.Phi()-track->GetTrackPhiOnEMCal());
205 fHists[30]->Fill(dphi,pt);
208 if (track->IsExtrapolatedToEMCAL()) {
209 Double_t phi1 = track->GetTrackPhiOnEMCal();
210 AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(track,440);
211 Double_t phi2 = track->GetTrackPhiOnEMCal();
212 Double_t dphi = TVector2::Phi_mpi_pi(phi1-phi2);
213 fHists[31]->Fill(dphi,pt);
222 for (
Int_t iMu = 0; iMu<aod->GetNumberOfTracks(); ++iMu) {
223 AliAODTrack* muonTrack =
static_cast<AliAODTrack*
>(aod->GetTrack(iMu));
226 if (!muonTrack->IsMuonTrack())
228 Double_t dThetaAbs = TMath::ATan(muonTrack->GetRAtAbsorberEnd()/505.)* TMath::RadToDeg();
229 if ((dThetaAbs<2.) || (dThetaAbs>10.))
232 if ((dEta<-4.) || (dEta>-2.5))
235 if (muonTrack->GetMatchTrigger()<0.5)
241 fHists[50]->Fill(phiMu,etaMu);
242 fHists[51]->Fill(phiMu,ptMu);
243 fHists[52]->Fill(etaMu,ptMu);
244 fHists[53]->Fill(ptMu,v0acent);
245 fHists[54]->Fill(ptMu,znacent);
250 for (
Int_t iMu = 0; iMu<esd->GetNumberOfMuonTracks(); ++iMu) {
251 AliESDMuonTrack* muonTrack = esd->GetMuonTrack(iMu);
254 if (!muonTrack->ContainTrackerData())
256 Double_t thetaTrackAbsEnd = TMath::ATan(muonTrack->GetRAtAbsorberEnd()/505.) * TMath::RadToDeg();
257 if ((thetaTrackAbsEnd < 2.) || (thetaTrackAbsEnd > 10.))
260 if ((eta < -4.) || (eta > -2.5))
263 if (!muonTrack->ContainTriggerData())
265 if (muonTrack->GetMatchTrigger() < 0.5)
311 if (tname.Contains(
"mc"))
315 Int_t Mall=0,M=0,Mall2=0;
316 Double_t ptmaxall=0,ptsumall=0,pt2sumall=0,ptsumall2=0;
327 for (
Int_t i =0; i<ntracks; ++i) {
328 AliVParticle *track =
dynamic_cast<AliVParticle*
>(
fTracks->At(i));
331 if (track->Charge()==0)
334 if ((eta<5.1)&&(eta>2.8))
336 else if ((eta>-3.7)&&(eta<-1.7))
338 if (TMath::Abs(eta)<1.4) {
341 if ((eta<etamin) || (eta>etamax))
358 if ((pt<ptmin) || (pt>ptmax))
369 Q2r += TMath::Cos(2*phi);
370 Q2i += TMath::Sin(2*phi);
371 Q3r += TMath::Cos(3*phi);
372 Q3i += TMath::Sin(3*phi);
373 Q4r += TMath::Cos(4*phi);
374 Q4i += TMath::Sin(4*phi);
375 Q6r += TMath::Cos(6*phi);
376 Q6i += TMath::Sin(6*phi);
391 for (
Int_t i=0; i<ntracks; ++i) {
392 AliVParticle *track1 =
dynamic_cast<AliVParticle*
>(
fTracks->At(i));
395 if (track1->Charge()==0)
398 if ((eta1<etamin) || (eta1>etamax))
401 if ((pt1<ptmin) || (pt1>ptmax))
404 for (
Int_t j = i+1; j<ntracks; ++j) {
405 AliVParticle *track2 =
dynamic_cast<AliVParticle*
>(
fTracks->At(j));
408 if (track2->Charge()==0)
411 if ((eta2<etamin) || (eta2>etamax))
414 if ((pt2<ptmin) || (pt2>ptmax))
418 Double_t deta=TMath::Abs(eta1-eta2);
421 Double_t dphi=TVector2::Phi_0_2pi(phi1-track2->Phi());
423 v2g+=TMath::Cos(2*dphi);
424 v3g+=TMath::Cos(3*dphi);
427 v2g14+=TMath::Cos(2*dphi);
428 v3g14+=TMath::Cos(3*dphi);
432 v2g18+=TMath::Cos(2*dphi);
433 v3g18+=TMath::Cos(3*dphi);
451 std::complex<double> q2(Q2r,Q2i);
452 std::complex<double> q3(Q3r,Q3i);
453 std::complex<double> q4(Q4r,Q4i);
454 std::complex<double> q6(Q6r,Q6i);
455 Double_t Q22 = std::abs(q2)*std::abs(q2);
456 Double_t Q32 = std::abs(q3)*std::abs(q3);
457 Double_t Q42 = std::abs(q4)*std::abs(q4);
458 Double_t Q62 = std::abs(q6)*std::abs(q6);
459 Double_t Q32re = std::real(q6*std::conj(q3)*std::conj(q3));
460 Double_t Q42re = std::real(q4*std::conj(q2)*std::conj(q2));
461 Double_t Q6are = std::real(q4*q2*std::conj(q2)*std::conj(q2)*std::conj(q2));
462 Double_t Q6bre = std::real(q6*std::conj(q2)*std::conj(q2)*std::conj(q2));
463 Double_t Q6cre = std::real(q6*std::conj(q4)*std::conj(q2));
466 Double_t tsax = (tsa00+tsa11)*(tsa00+tsa11)-4*(tsa00*tsa11-tsa10*tsa10);
468 Double_t l1 = 0.5*(tsa00+tsa11+TMath::Sqrt(tsax))/ptsumall;
469 Double_t l2 = 0.5*(tsa00+tsa11-TMath::Sqrt(tsax))/ptsumall;
470 tsall = 2*l2/(l1+l2);
474 Double_t tsx = (ts00+ts11)*(ts00+ts11)-4*(ts00*ts11-ts10*ts10);
476 Double_t l1 = 0.5*(ts00+ts11+TMath::Sqrt(tsx))/ptsumall;
477 Double_t l2 = 0.5*(ts00+ts11-TMath::Sqrt(tsx))/ptsumall;
485 AliCentrality *cent = InputEvent()->GetCentrality();
496 AliAnalysisUtils anau;
497 AliVEvent *
event = InputEvent();
500 fNtupCumInfo->
fTrig = ((AliInputEventHandler*)(am->GetInputEventHandler()))->IsEventSelected();
535 AliVVZERO *vzero = InputEvent()->GetVZEROData();
539 AliMultSelection *ms =
dynamic_cast<AliMultSelection*
>(InputEvent()->FindListObject(
"MultSelection"));
548 AliCentrality *cent = InputEvent()->GetCentrality();
557 AliVZDC *vZDC = InputEvent()->GetZDCData();
558 const Double_t *znaTowers = vZDC->GetZNATowerEnergy();
573 Bool_t fillCumHist = kTRUE;
575 Int_t run = InputEvent()->GetRunNumber();
577 if ((run>=188356&&run<=188366) || (run>=195344&&run<=197388)) {
578 if (anau.IsFirstEventInChunk(event))
579 fillCumHist = kFALSE;
580 if (!anau.IsVertexSelected2013pA(event))
581 fillCumHist = kFALSE;
584 Double_t vz = InputEvent()->GetPrimaryVertex()->GetZ();
585 if (TMath::Abs(vz)>10)
586 fillCumHist = kFALSE;
589 AliVVZERO *vzero = InputEvent()->GetVZEROData();
592 Double_t v0m = vzero->GetMTotV0A()+vzero->GetMTotV0C();
599 fHists[114]->Fill(M,(Q22-M)/M/(M-1));
600 fHists[120]->Fill(M,(Q32-M)/M/(M-1));
603 fHists[124]->Fill(M,v2g14);
604 fHists[125]->Fill(M,v3g14);
605 fHists[126]->Fill(M,v2g18);
606 fHists[127]->Fill(M,v3g18);
607 fHists[130]->Fill(M,Q2r/M);
608 fHists[131]->Fill(M,Q2i/M);
609 fHists[132]->Fill(M,Q3r/M);
610 fHists[133]->Fill(M,Q3i/M);
611 fHists[134]->Fill(M,Q4r/M);
612 fHists[135]->Fill(M,Q4i/M);
613 fHists[136]->Fill(M,Q6r/M);
614 fHists[137]->Fill(M,Q6i/M);
617 Double_t qc4tmp = (Q22*Q22+Q42-2*Q42re-4*(M-2)*Q22+2*M*(M-3));
618 fHists[115]->Fill(M,qc4tmp/M/(M-1)/(M-2)/(M-3));
619 qc4tmp = (Q32*Q32+Q62-2*Q32re-4*(M-2)*Q32+2*M*(M-3));
620 fHists[121]->Fill(M,qc4tmp/M/(M-1)/(M-2)/(M-3));
623 Double_t qc6tmp = Q22*Q22*Q22 + 9*Q42*Q22 - 6*Q6are
625 + 18*(M-4)*Q42re + 4*Q62
626 - 9*(M-4)*Q22*Q22 - 9*(M-4)*Q42
629 fHists[116]->Fill(M,qc6tmp/M/(M-1)/(M-2)/(M-3)/(M-4)/(M-5));
635 for (
Int_t i =0; i<ntracks; ++i) {
636 AliVParticle *track1 =
dynamic_cast<AliVParticle*
>(
fTracks->At(i));
645 if ((eta1<etamin) || (eta1>etamax))
647 if ((pt1<ptmin) || (pt1>ptmax))
649 for (
Int_t j =0; j<ntracks; ++j) {
650 AliVParticle *track2 =
dynamic_cast<AliVParticle*
>(
fTracks->At(j));
654 if ((eta2<etamin) || (eta2>etamax))
657 if ((pt2<ptmin) || (pt2>ptmax))
662 while (dphi<-TMath::Pi())
663 dphi+=TMath::TwoPi();
664 while (dphi>3*TMath::Pi()/2)
665 dphi-=TMath::TwoPi();
710 fHists[0] =
new TH1D(
"fTrigBits",
";bit",32,-0.5,31.5);
712 fHists[1] =
new TH1D(
"fVertexZ",
";vertex z (cm)",51,-25.5,25.5);
714 fHists[2] =
new TH1D(
"fVertexZnc",
";vertex z (cm)",51,-25.5,25.5);
716 fHists[9] =
new TProfile(
"fAccepted",
"",1,0.5,1.5);
718 fHists[10] =
new TH1D(
"fV0ACent",
";percentile",20,0,100);
720 fHists[11] =
new TH1D(
"fZNACent",
";percentile",20,0,100);
722 fHists[12] =
new TH1D(
"fV0MCent",
";percentile",20,0,100);
726 fHists[20] =
new TH2D(
"fPhiEtaTracks",
";#phi;#eta",60,0,TMath::TwoPi(),20,-2,2);
729 fHists[21] =
new TH2D(
"fPhiPtTracks",
";#phi;p_{T} (GeV/c)",60,0,TMath::TwoPi(),40,0,20);
732 fHists[22] =
new TH2D(
"fEtaPtTracks",
";#eta;p_{T} (GeV/c)",20,-2,2,40,0,20);
735 fHists[23] =
new TH2D(
"fPtV0ATracks",
";#p_{T} (GeV/c);percentile",100,0,20,20,0,100);
738 fHists[24] =
new TH2D(
"fPtZNATracks",
";#p_{T} (GeV/c);percentile",100,0,20,20,0,100);
741 fHists[25] =
new TH2D(
"fPhiPtTracks_type0",
";#phi;p_{T} (GeV/c)",60,0,TMath::TwoPi(),40,0,20);
744 fHists[26] =
new TH2D(
"fPhiPtTracks_type1",
";#phi;p_{T} (GeV/c)",60,0,TMath::TwoPi(),40,0,20);
747 fHists[27] =
new TH2D(
"fPhiPtTracks_type2",
";#phi;p_{T} (GeV/c)",60,0,TMath::TwoPi(),40,0,20);
750 fHists[28] =
new TH2D(
"fDPhiPtTracks",
";#Delta#phi;p_{T} (GeV/c)",60,-TMath::Pi(),TMath::Pi(),40,0,20);
753 fHists[29] =
new TH2D(
"fDPhiPtTracks2",
";#Delta#phi;p_{T} (GeV/c)",60,-TMath::Pi(),TMath::Pi(),40,0,20);
756 fHists[30] =
new TH2D(
"fDPhiPtClusTracks",
";#Delta#phi;p_{T} (GeV/c)",60,-TMath::Pi(),TMath::Pi(),40,0,20);
759 fHists[31] =
new TH2D(
"fDPhiPtReTracks",
";#Delta#phi;p_{T} (GeV/c)",60,-TMath::Pi(),TMath::Pi(),40,0,20);
765 fHists[50] =
new TH2D(
"fPhiEtaMuonTracks",
";#phi;#eta",60,0,TMath::TwoPi(),15,-4,-2.5);
768 fHists[51] =
new TH2D(
"fPhiPtMuonTracks",
";#phi;p_{T} (GeV/c)",60,0,TMath::TwoPi(),200,0,20);
771 fHists[52] =
new TH2D(
"fEtaPtMuonTracks",
";#eta;p_{T} (GeV/c)",15,-4,-2.5,200,0,20);
774 fHists[53] =
new TH2D(
"fPtV0AMuonTracks",
";#p_{T} (GeV/c);percentile",100,0,10,20,0,100);
777 fHists[54] =
new TH2D(
"fPtZNAMuonTracks",
";#p_{T} (GeV/c);percentile",100,0,10,20,0,100);
783 fHists[100] =
new TH3D(
"fCumPhiEtaCl1",
";#Delta#phi;#Delta#eta",32,-TMath::Pi()/2,3*TMath::Pi()/2,60,-3,3,10,0,100);
785 fHists[101] =
new TH3D(
"fCumPhiEtaV0A",
";#Delta#phi;#Delta#eta",32,-TMath::Pi()/2,3*TMath::Pi()/2,60,-3,3,10,0,100);
787 fHists[102] =
new TH3D(
"fCumPhiEtaZNA",
";#Delta#phi;#Delta#eta",32,-TMath::Pi()/2,3*TMath::Pi()/2,60,-3,3,10,0,100);
789 fHists[103] =
new TH3D(
"fCumPtEtaCl1",
";p_{T} (GeV/c);#eta",100,0,25,20,-2,2,10,0,100);
791 fHists[104] =
new TH3D(
"fCumPtEtaV0A",
";p_{T} (GeV/c);#eta",100,0,25,20,-2,2,10,0,100);
793 fHists[105] =
new TH3D(
"fCumPtEtaZNA",
";p_{T} (GeV/c);#eta",100,0,25,20,-2,2,10,0,100);
801 fHists[109] =
new TH1D(
"fCumCl1Cent",
";percentile",10,0,100);
803 fHists[110] =
new TH1D(
"fCumV0ACent",
";percentile",10,0,100);
805 fHists[111] =
new TH1D(
"fCumZNACent",
";percentile",10,0,100);
842 fHists[128] =
new TH3D(
"fDPhiDEtaTracks",
";#Delta#phi;#Delta#eta;M",64,-0.5*TMath::Pi(),1.5*TMath::Pi(),60,-3,3,
fCumMbins/10,0,
fCumMbins);
865 fNtupCum =
new TTree(
"NtupCum",
"Ntuple for cumulant analysis");
871 f->SetCompressionLevel(2);
873 fNtupCum->SetAutoFlush(-4*1024*1024);
892 f->SetCompressionLevel(2);
894 fNtupHet->SetAutoFlush(-4*1024*1024);
void RunHet(Double_t Etmin)
void SetHetParams(Double_t Etmin)
Base task in the EMCAL framework.
ClassImp(AliAnalysisTaskCLQA) AliAnalysisTaskCLQA
virtual ~AliAnalysisTaskCLQA()
Double_t DeltaPhi(Double_t phia, Double_t phib, Double_t rangeMin=-TMath::Pi()/2, Double_t rangeMax=3 *TMath::Pi()/2) const
pointers to histograms
AliNtupZdcInfo * fNtupZdcInfo
object holding cumulant results
void SetCumParams(Double_t Mmin, Double_t ptmin, Double_t ptmax, Double_t etamin, Double_t etamax)
Byte_t GetTrackType() const
virtual Bool_t RetrieveEventObjects()
AliNtupHetInfo * fNtupHetInfo
ntuple for het analysis
AliVTrack * GetTrack() const
Bool_t RetrieveEventObjects()
AliEmcalList * fOutput
!output list
TClonesArray * fTracks
!tracks
TH1 * fHists[1000]
object holding het info
void UserCreateOutputObjects()
AliNtupCumInfo * fNtupCumInfo
ntuple for cumulant analysis
void RunCumulants(Double_t Mmin, Double_t ptmin, Double_t ptmax, Double_t etamin, Double_t etamax)
TList * OpenFile(const char *fname)
TTree * fNtupHet
object holding zdc info
void UserCreateOutputObjects()