11 #include <TClonesArray.h>
12 #include <TDirectory.h>
18 #include <TLorentzVector.h>
23 #include "AliESDMuonTrack.h"
24 #include "AliAODEvent.h"
25 #include "AliAnalysisManager.h"
26 #include "AliAnalysisUtils.h"
27 #include "AliCentrality.h"
28 #include "AliEMCALGeoParams.h"
29 #include "AliEMCALGeometry.h"
30 #include "AliEMCALRecoUtils.h"
31 #include "AliESDEvent.h"
33 #include "AliExternalTrackParam.h"
34 #include "AliInputEventHandler.h"
37 #include "AliTrackerBase.h"
38 #include "AliVCluster.h"
39 #include "AliVEventHandler.h"
40 #include "AliVParticle.h"
41 #include "AliVTrack.h"
49 fDoTracking(0), fDoMuonTracking(0), fDoCumulants(0), fDoCumNtuple(0),
50 fCumPtMin(0.3), fCumPtMax(5.0), fCumEtaMin(-1.0), fCumEtaMax(1.0), fCumMmin(15), fCumMbins(250),
51 fDoHet(0), fHetEtmin(6),
52 fCentCL1In(0), fCentV0AIn(0),
53 fNtupCum(0), fNtupCumInfo(0), fNtupZdcInfo(0),
54 fNtupHet(0), fNtupHetInfo(0)
58 for (
Int_t i=0;i<1000;++i)
66 fDoTracking(1), fDoMuonTracking(0), fDoCumulants(0), fDoCumNtuple(0),
67 fCumPtMin(0.3), fCumPtMax(5.0), fCumEtaMin(-1.0), fCumEtaMax(1.0), fCumMmin(15), fCumMbins(250),
68 fDoHet(0), fHetEtmin(6),
69 fCentCL1In(0), fCentV0AIn(0),
70 fNtupCum(0), fNtupCumInfo(0), fNtupZdcInfo(0),
71 fNtupHet(0), fNtupHetInfo(0)
75 for (
Int_t i=0;i<1000;++i)
94 if (phia < 0) phia += tpi;
95 else if (phia > tpi) phia -= tpi;
96 if (phib < 0) phib += tpi;
97 else if (phib > tpi) phib -= tpi;
99 if (dphi < rangeMin) dphi += tpi;
100 else if (dphi > rangeMax) dphi -= tpi;
110 AliVEvent *
event = InputEvent();
113 UInt_t trig = ((AliInputEventHandler*)(am->GetInputEventHandler()))->IsEventSelected();
114 for (
Int_t i=0;i<31;++i) {
119 Double_t vz =
event->GetPrimaryVertex()->GetZ();
122 Int_t run =
event->GetRunNumber();
123 Int_t vzn =
event->GetPrimaryVertex()->GetNContributors();
124 if ((vzn<1)&&(run>0))
128 if (TMath::Abs(vz)>10)
132 if ((run>=188356&&run<=188366) || (run>=195344&&run<=197388)) {
133 AliAnalysisUtils anau;
134 if (anau.IsFirstEventInChunk(event))
136 if (!anau.IsVertexSelected2013pA(event))
144 AliCentrality *cent = InputEvent()->GetCentrality();
145 Double_t v0acent = cent->GetCentralityPercentile(
"V0A");
146 fHists[10]->Fill(v0acent);
147 Double_t znacent = cent->GetCentralityPercentile(
"ZNA");
148 fHists[11]->Fill(znacent);
149 Double_t v0mcent = cent->GetCentralityPercentile(
"V0M");
150 fHists[12]->Fill(v0mcent);
155 for (
Int_t i=0; i<ntracks; ++i) {
156 AliVTrack *track =
dynamic_cast<AliVTrack*
>(
fTracks->At(i));
159 if (track->Charge()==0)
169 fHists[20]->Fill(phi,eta);
172 if (TMath::Abs(eta)<0.8) {
173 fHists[23]->Fill(pt,v0acent);
174 fHists[24]->Fill(pt,znacent);
177 fHists[25+ttype]->Fill(phi,pt);
178 if (track->IsExtrapolatedToEMCAL()) {
179 Double_t dphi = TVector2::Phi_mpi_pi(phi-track->GetTrackPhiOnEMCal());
180 fHists[28]->Fill(dphi,pt);
182 AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(track,440);
183 if (track->IsExtrapolatedToEMCAL()) {
184 Double_t dphi = TVector2::Phi_mpi_pi(phi-track->GetTrackPhiOnEMCal());
185 fHists[29]->Fill(dphi,pt);
188 if (track->IsEMCAL() && track->IsExtrapolatedToEMCAL()) {
189 Int_t id = track->GetEMCALcluster();
190 AliVCluster *clus = InputEvent()->GetCaloCluster(
id);
193 clus->GetPosition(pos);
195 Double_t dphi = TVector2::Phi_mpi_pi(vpos.Phi()-track->GetTrackPhiOnEMCal());
196 fHists[30]->Fill(dphi,pt);
199 if (track->IsExtrapolatedToEMCAL()) {
200 Double_t phi1 = track->GetTrackPhiOnEMCal();
201 AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(track,440);
202 Double_t phi2 = track->GetTrackPhiOnEMCal();
203 Double_t dphi = TVector2::Phi_mpi_pi(phi1-phi2);
204 fHists[31]->Fill(dphi,pt);
213 for (
Int_t iMu = 0; iMu<aod->GetNumberOfTracks(); ++iMu) {
214 AliAODTrack* muonTrack =
static_cast<AliAODTrack*
>(aod->GetTrack(iMu));
217 if (!muonTrack->IsMuonTrack())
219 Double_t dThetaAbs = TMath::ATan(muonTrack->GetRAtAbsorberEnd()/505.)* TMath::RadToDeg();
220 if ((dThetaAbs<2.) || (dThetaAbs>10.))
223 if ((dEta<-4.) || (dEta>-2.5))
226 if (muonTrack->GetMatchTrigger()<0.5)
232 fHists[50]->Fill(phiMu,etaMu);
233 fHists[51]->Fill(phiMu,ptMu);
234 fHists[52]->Fill(etaMu,ptMu);
235 fHists[53]->Fill(ptMu,v0acent);
236 fHists[54]->Fill(ptMu,znacent);
241 for (
Int_t iMu = 0; iMu<esd->GetNumberOfMuonTracks(); ++iMu) {
242 AliESDMuonTrack* muonTrack = esd->GetMuonTrack(iMu);
245 if (!muonTrack->ContainTrackerData())
247 Double_t thetaTrackAbsEnd = TMath::ATan(muonTrack->GetRAtAbsorberEnd()/505.) * TMath::RadToDeg();
248 if ((thetaTrackAbsEnd < 2.) || (thetaTrackAbsEnd > 10.))
251 if ((eta < -4.) || (eta > -2.5))
254 if (!muonTrack->ContainTriggerData())
256 if (muonTrack->GetMatchTrigger() < 0.5)
302 if (tname.Contains(
"mc"))
306 Int_t Mall=0,M=0,Mall2=0;
307 Double_t ptmaxall=0,ptsumall=0,pt2sumall=0,ptsumall2=0;
318 for (
Int_t i =0; i<ntracks; ++i) {
319 AliVParticle *track =
dynamic_cast<AliVParticle*
>(
fTracks->At(i));
322 if (track->Charge()==0)
325 if ((eta<5.1)&&(eta>2.8))
327 else if ((eta>-3.7)&&(eta<-1.7))
329 if (TMath::Abs(eta)<1.4) {
332 if ((eta<etamin) || (eta>etamax))
349 if ((pt<ptmin) || (pt>ptmax))
360 Q2r += TMath::Cos(2*phi);
361 Q2i += TMath::Sin(2*phi);
362 Q3r += TMath::Cos(3*phi);
363 Q3i += TMath::Sin(3*phi);
364 Q4r += TMath::Cos(4*phi);
365 Q4i += TMath::Sin(4*phi);
366 Q6r += TMath::Cos(6*phi);
367 Q6i += TMath::Sin(6*phi);
382 for (
Int_t i=0; i<ntracks; ++i) {
383 AliVParticle *track1 =
dynamic_cast<AliVParticle*
>(
fTracks->At(i));
386 if (track1->Charge()==0)
389 if ((eta1<etamin) || (eta1>etamax))
392 if ((pt1<ptmin) || (pt1>ptmax))
395 for (
Int_t j = i+1; j<ntracks; ++j) {
396 AliVParticle *track2 =
dynamic_cast<AliVParticle*
>(
fTracks->At(j));
399 if (track2->Charge()==0)
402 if ((eta2<etamin) || (eta2>etamax))
405 if ((pt2<ptmin) || (pt2>ptmax))
409 Double_t deta=TMath::Abs(eta1-eta2);
412 Double_t dphi=TVector2::Phi_0_2pi(phi1-track2->Phi());
414 v2g+=TMath::Cos(2*dphi);
415 v3g+=TMath::Cos(3*dphi);
418 v2g14+=TMath::Cos(2*dphi);
419 v3g14+=TMath::Cos(3*dphi);
423 v2g18+=TMath::Cos(2*dphi);
424 v3g18+=TMath::Cos(3*dphi);
442 std::complex<double> q2(Q2r,Q2i);
443 std::complex<double> q3(Q3r,Q3i);
444 std::complex<double> q4(Q4r,Q4i);
445 std::complex<double> q6(Q6r,Q6i);
446 Double_t Q22 = std::abs(q2)*std::abs(q2);
447 Double_t Q32 = std::abs(q3)*std::abs(q3);
448 Double_t Q42 = std::abs(q4)*std::abs(q4);
449 Double_t Q62 = std::abs(q6)*std::abs(q6);
450 Double_t Q32re = std::real(q6*std::conj(q3)*std::conj(q3));
451 Double_t Q42re = std::real(q4*std::conj(q2)*std::conj(q2));
452 Double_t Q6are = std::real(q4*q2*std::conj(q2)*std::conj(q2)*std::conj(q2));
453 Double_t Q6bre = std::real(q6*std::conj(q2)*std::conj(q2)*std::conj(q2));
454 Double_t Q6cre = std::real(q6*std::conj(q4)*std::conj(q2));
457 Double_t tsax = (tsa00+tsa11)*(tsa00+tsa11)-4*(tsa00*tsa11-tsa10*tsa10);
459 Double_t l1 = 0.5*(tsa00+tsa11+TMath::Sqrt(tsax))/ptsumall;
460 Double_t l2 = 0.5*(tsa00+tsa11-TMath::Sqrt(tsax))/ptsumall;
461 tsall = 2*l2/(l1+l2);
465 Double_t tsx = (ts00+ts11)*(ts00+ts11)-4*(ts00*ts11-ts10*ts10);
467 Double_t l1 = 0.5*(ts00+ts11+TMath::Sqrt(tsx))/ptsumall;
468 Double_t l2 = 0.5*(ts00+ts11-TMath::Sqrt(tsx))/ptsumall;
476 AliCentrality *cent = InputEvent()->GetCentrality();
487 AliAnalysisUtils anau;
488 AliVEvent *
event = InputEvent();
491 fNtupCumInfo->
fTrig = ((AliInputEventHandler*)(am->GetInputEventHandler()))->IsEventSelected();
526 AliVVZERO *vzero = InputEvent()->GetVZEROData();
530 AliCentrality *cent = InputEvent()->GetCentrality();
538 AliVZDC *vZDC = InputEvent()->GetZDCData();
539 const Double_t *znaTowers = vZDC->GetZNATowerEnergy();
554 Bool_t fillCumHist = kTRUE;
556 Int_t run = InputEvent()->GetRunNumber();
558 if ((run>=188356&&run<=188366) || (run>=195344&&run<=197388)) {
559 if (anau.IsFirstEventInChunk(event))
560 fillCumHist = kFALSE;
561 if (!anau.IsVertexSelected2013pA(event))
562 fillCumHist = kFALSE;
565 Double_t vz = InputEvent()->GetPrimaryVertex()->GetZ();
566 if (TMath::Abs(vz)>10)
567 fillCumHist = kFALSE;
570 AliVVZERO *vzero = InputEvent()->GetVZEROData();
573 Double_t v0m = vzero->GetMTotV0A()+vzero->GetMTotV0C();
580 fHists[114]->Fill(M,(Q22-M)/M/(M-1));
581 fHists[120]->Fill(M,(Q32-M)/M/(M-1));
584 fHists[124]->Fill(M,v2g14);
585 fHists[125]->Fill(M,v3g14);
586 fHists[126]->Fill(M,v2g18);
587 fHists[127]->Fill(M,v3g18);
590 Double_t qc4tmp = (Q22*Q22+Q42-2*Q42re-4*(M-2)*Q22+2*M*(M-3));
591 fHists[115]->Fill(M,qc4tmp/M/(M-1)/(M-2)/(M-3));
592 qc4tmp = (Q32*Q32+Q62-2*Q32re-4*(M-2)*Q32+2*M*(M-3));
593 fHists[121]->Fill(M,qc4tmp/M/(M-1)/(M-2)/(M-3));
596 Double_t qc6tmp = Q22*Q22*Q22 + 9*Q42*Q22 - 6*Q6are
598 + 18*(M-4)*Q42re + 4*Q62
599 - 9*(M-4)*Q22*Q22 - 9*(M-4)*Q42
602 fHists[116]->Fill(M,qc6tmp/M/(M-1)/(M-2)/(M-3)/(M-4)/(M-5));
608 for (
Int_t i =0; i<ntracks; ++i) {
609 AliVParticle *track1 =
dynamic_cast<AliVParticle*
>(
fTracks->At(i));
618 if ((eta1<etamin) || (eta1>etamax))
620 if ((pt1<ptmin) || (pt1>ptmax))
622 for (
Int_t j =0; j<ntracks; ++j) {
623 AliVParticle *track2 =
dynamic_cast<AliVParticle*
>(
fTracks->At(j));
627 if ((eta2<etamin) || (eta2>etamax))
630 if ((pt2<ptmin) || (pt2>ptmax))
635 while (dphi<-TMath::Pi())
636 dphi+=TMath::TwoPi();
637 while (dphi>3*TMath::Pi()/2)
638 dphi-=TMath::TwoPi();
683 fHists[0] =
new TH1D(
"fTrigBits",
";bit",32,-0.5,31.5);
685 fHists[1] =
new TH1D(
"fVertexZ",
";vertex z (cm)",51,-25.5,25.5);
687 fHists[2] =
new TH1D(
"fVertexZnc",
";vertex z (cm)",51,-25.5,25.5);
689 fHists[9] =
new TProfile(
"fAccepted",
"",1,0.5,1.5);
691 fHists[10] =
new TH1D(
"fV0ACent",
";percentile",20,0,100);
693 fHists[11] =
new TH1D(
"fZNACent",
";percentile",20,0,100);
695 fHists[12] =
new TH1D(
"fV0MCent",
";percentile",20,0,100);
699 fHists[20] =
new TH2D(
"fPhiEtaTracks",
";#phi;#eta",60,0,TMath::TwoPi(),20,-2,2);
702 fHists[21] =
new TH2D(
"fPhiPtTracks",
";#phi;p_{T} (GeV/c)",60,0,TMath::TwoPi(),40,0,20);
705 fHists[22] =
new TH2D(
"fEtaPtTracks",
";#eta;p_{T} (GeV/c)",20,-2,2,40,0,20);
708 fHists[23] =
new TH2D(
"fPtV0ATracks",
";#p_{T} (GeV/c);percentile",100,0,20,20,0,100);
711 fHists[24] =
new TH2D(
"fPtZNATracks",
";#p_{T} (GeV/c);percentile",100,0,20,20,0,100);
714 fHists[25] =
new TH2D(
"fPhiPtTracks_type0",
";#phi;p_{T} (GeV/c)",60,0,TMath::TwoPi(),40,0,20);
717 fHists[26] =
new TH2D(
"fPhiPtTracks_type1",
";#phi;p_{T} (GeV/c)",60,0,TMath::TwoPi(),40,0,20);
720 fHists[27] =
new TH2D(
"fPhiPtTracks_type2",
";#phi;p_{T} (GeV/c)",60,0,TMath::TwoPi(),40,0,20);
723 fHists[28] =
new TH2D(
"fDPhiPtTracks",
";#Delta#phi;p_{T} (GeV/c)",60,-TMath::Pi(),TMath::Pi(),40,0,20);
726 fHists[29] =
new TH2D(
"fDPhiPtTracks2",
";#Delta#phi;p_{T} (GeV/c)",60,-TMath::Pi(),TMath::Pi(),40,0,20);
729 fHists[30] =
new TH2D(
"fDPhiPtClusTracks",
";#Delta#phi;p_{T} (GeV/c)",60,-TMath::Pi(),TMath::Pi(),40,0,20);
732 fHists[31] =
new TH2D(
"fDPhiPtReTracks",
";#Delta#phi;p_{T} (GeV/c)",60,-TMath::Pi(),TMath::Pi(),40,0,20);
738 fHists[50] =
new TH2D(
"fPhiEtaMuonTracks",
";#phi;#eta",60,0,TMath::TwoPi(),15,-4,-2.5);
741 fHists[51] =
new TH2D(
"fPhiPtMuonTracks",
";#phi;p_{T} (GeV/c)",60,0,TMath::TwoPi(),200,0,20);
744 fHists[52] =
new TH2D(
"fEtaPtMuonTracks",
";#eta;p_{T} (GeV/c)",15,-4,-2.5,200,0,20);
747 fHists[53] =
new TH2D(
"fPtV0AMuonTracks",
";#p_{T} (GeV/c);percentile",100,0,10,20,0,100);
750 fHists[54] =
new TH2D(
"fPtZNAMuonTracks",
";#p_{T} (GeV/c);percentile",100,0,10,20,0,100);
756 fHists[100] =
new TH3D(
"fCumPhiEtaCl1",
";#Delta#phi;#Delta#eta",32,-TMath::Pi()/2,3*TMath::Pi()/2,60,-3,3,10,0,100);
758 fHists[101] =
new TH3D(
"fCumPhiEtaV0A",
";#Delta#phi;#Delta#eta",32,-TMath::Pi()/2,3*TMath::Pi()/2,60,-3,3,10,0,100);
760 fHists[102] =
new TH3D(
"fCumPhiEtaZNA",
";#Delta#phi;#Delta#eta",32,-TMath::Pi()/2,3*TMath::Pi()/2,60,-3,3,10,0,100);
762 fHists[103] =
new TH3D(
"fCumPtEtaCl1",
";p_{T} (GeV/c);#eta",100,0,25,20,-2,2,10,0,100);
764 fHists[104] =
new TH3D(
"fCumPtEtaV0A",
";p_{T} (GeV/c);#eta",100,0,25,20,-2,2,10,0,100);
766 fHists[105] =
new TH3D(
"fCumPtEtaZNA",
";p_{T} (GeV/c);#eta",100,0,25,20,-2,2,10,0,100);
774 fHists[109] =
new TH1D(
"fCumCl1Cent",
";percentile",10,0,100);
776 fHists[110] =
new TH1D(
"fCumV0ACent",
";percentile",10,0,100);
778 fHists[111] =
new TH1D(
"fCumZNACent",
";percentile",10,0,100);
815 fHists[128] =
new TH3D(
"fDPhiDEtaTracks",
";#Delta#phi;#Delta#eta;M",64,-0.5*TMath::Pi(),1.5*TMath::Pi(),60,-3,3,
823 fNtupCum =
new TTree(
"NtupCum",
"Ntuple for cumulant analysis");
829 f->SetCompressionLevel(2);
831 fNtupCum->SetAutoFlush(-4*1024*1024);
850 f->SetCompressionLevel(2);
852 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()