1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. */
2 /* See cxx source for full Copyright notice */
5 #ifndef ALIANALYSISTASKRHOVNMODULATION_H
6 #define ALIANALYSISTASKRHOVNMODULATION_H
8 #include <AliAnalysisTaskEmcalJet.h>
9 #include <AliEmcalJet.h>
10 #include <AliVEvent.h>
11 #include <AliVTrack.h>
12 #include <AliVCluster.h>
13 #include <TClonesArray.h>
22 class AliAnalysisTaskRhoVnModulation : public AliAnalysisTaskEmcalJet
26 enum fitModulationType { kNoFit, kV2, kV3, kCombined, kUser, kFourierSeries }; // fit type
27 enum runModeType { kLocal, kGrid }; // run mode type
28 enum dataType { kESD, kAOD, kESDMC, kAODMC }; // data type
29 enum detectorType { kTPC, kTPCSUB, kVZEROA, kVZEROC}; // detector that was used
30 // constructors, destructor
31 AliAnalysisTaskRhoVnModulation();
32 AliAnalysisTaskRhoVnModulation(const char *name, runModeType type);
33 virtual ~AliAnalysisTaskRhoVnModulation();
35 // setting up the task and technical aspects
36 Bool_t InitializeAnalysis();
37 virtual void UserCreateOutputObjects();
39 TH1F* BookTH1F(const char* name, const char* x, Int_t bins, Double_t min, Double_t max, Int_t c = -1, Bool_t append = kTRUE);
40 TH2F* BookTH2F(const char* name, const char* x, const char* y, Int_t binsx, Double_t minx, Double_t maxx, Int_t binsy, Double_t miny, Double_t maxy, Int_t c = -1, Bool_t append = kTRUE);
41 /* inline */ Double_t PhaseShift(Double_t x) const {
42 while (x>=TMath::TwoPi())x-=TMath::TwoPi();
43 while (x<0.)x+=TMath::TwoPi();
45 /* inline */ Double_t ChiSquarePDF(Int_t ndf, Double_t x) const {
46 Double_t n(ndf/2.), denom(TMath::Power(2, n)*TMath::Gamma(n));
47 if (denom!=0) return ((1./denom)*TMath::Power(x, n-1)*TMath::Exp(-x/2.));
49 // note that the cdf of the chisquare distribution is the normalized lower incomplete gamma function
50 /* inline */ Double_t ChiSquareCDF(Int_t ndf, Double_t x) const { return TMath::Gamma(ndf/2., x/2.); }
51 /* inline */ Double_t RhoVal() const { return (fRho) ? fRho->GetVal(): -999.;}
52 /* inline */ Double_t RhoVal(Double_t phi, Double_t r, Double_t n) const {
53 if(!fFitModulation) return RhoVal(); // coverity
54 switch (fFitModulationType) {
55 case kNoFit : return RhoVal();
57 Double_t denom(2*r*fFitModulation->GetParameter(0));
58 return (denom <= 0.) ? RhoVal() : n*(fFitModulation->Integral(phi-r, phi+r)/denom);
62 // setters - analysis setup
63 void SetDebugMode(Int_t d) {fDebug = d;}
64 void SetFillQAHistograms(Bool_t qa) {fFillQAHistograms = qa;}
65 void SetCentralityClasses(TArrayI* c) {fCentralityClasses = c;}
66 void SetNameJetClones(const char* name) {fNameJetClones = name; }
67 void SetNamePicoTrackClones(const char* name) {fNamePicoTrackClones = name; }
68 void SetNameRho(const char* name) {fNameRho = name; }
69 void SetRandomSeed(TRandom3* r) {if (fRandom) delete fRandom; fRandom = r; }
70 void SetModulationFit(TF1* fit) {if (fFitModulation) delete fFitModulation;
71 fFitModulation = fit; }
72 void SetModulationFitMinMaxP(Float_t m, Float_t n) {fMinPvalue = m; fMaxPvalue = n; }
73 void SetModulationFitType(fitModulationType type) {fFitModulationType = type; }
74 void SetModulationFitOptions(TString opt) {fFitModulationOptions = opt; }
75 void SetReferenceDetector(detectorType type) {fDetectorType = type; }
76 void SetUsePtWeight(Bool_t w) {fUsePtWeight = w; }
77 void SetRunModeType(runModeType type) {fRunModeType = type; }
78 void SetAbsVertexZ(Float_t v) {fAbsVertexZ = v; }
79 void SetMinDistanceRctoLJ(Float_t m) {fMinDisanceRCtoLJ = m; }
80 void SetRandomConeRadius(Float_t r) {fRandomConeRadius = r; }
81 void SetForceAbsVnHarmonics(Bool_t f) {fAbsVnHarmonics = f; }
82 void SetExcludeLeadingJetsFromFit(Float_t n) {fExcludeLeadingJetsFromFit = n; }
83 void SetRebinSwapHistoOnTheFly(Bool_t r) {fRebinSwapHistoOnTheFly = r; }
84 void SetSaveThisPercentageOfFits(Float_t p) {fPercentageOfFits = p; }
85 void SetUseV0EventPlaneFromHeader(Bool_t h) {fUseV0EventPlaneFromHeader = h;}
86 void SetSetPtSub(Bool_t s) {fSetPtSub = s; }
87 // 'trivial' helper calculations
88 void CalculateEventPlaneVZERO(Double_t vzero[2][2]) const;
89 void CalculateEventPlaneTPC(Double_t* tpc);
90 void CalculateEventPlaneResolution(Double_t vzero[2][2], Double_t* tpc) const;
91 void CalculateRandomCone(Float_t &pt, Float_t &eta, Float_t &phi, AliEmcalJet* jet = 0x0, Bool_t randomize = 0) const;
93 Bool_t CorrectRho(Double_t* params, Double_t psi2, Double_t psi3, Double_t psi2b, Double_t psi3b);
94 // event and track selection
95 /* inline */ Bool_t PassesCuts(const AliVTrack* track) const {
96 if(!track) return kFALSE;
97 return (track->Pt() < fTrackPtCut || track->Eta() < fTrackMinEta || track->Eta() > fTrackMaxEta || track->Phi() < fTrackMinPhi || track->Phi() > fTrackMaxPhi) ? kFALSE : kTRUE; }
98 /* inline */ Bool_t PassesCuts(const AliEmcalJet* jet) const {
99 if(!jet || fJetRadius <= 0) return kFALSE;
100 return (jet->Pt() < fJetPtCut || jet->Area()/(fJetRadius*fJetRadius*TMath::Pi()) < fPercAreaCut || jet->Eta() < fJetMinEta || jet->Eta() > fJetMaxEta || jet->Phi() < fJetMinPhi || jet->Phi() > fJetMaxPhi) ? kFALSE : kTRUE; }
101 Bool_t PassesCuts(AliVEvent* event);
102 Bool_t PassesCuts(const AliVCluster* track) const;
103 // filling histograms
104 void FillHistogramsAfterSubtraction(Double_t vzero[2][2], Double_t* tpc) const;
105 void FillTrackHistograms() const;
106 void FillClusterHistograms() const;
107 void FillCorrectedClusterHistograms() const;
108 void FillEventPlaneHistograms(Double_t vzero[2][2], Double_t* tpc) const;
109 void FillRhoHistograms() const;
110 void FillDeltaPtHistograms(Double_t psi2, Double_t psi3) const;
111 void FillJetHistograms(Double_t vzero[2][2], Double_t* psi) const;
112 void FillDeltaPhiHistograms(Double_t vzero[2][2], Double_t* tpc) const;
113 void FillQAHistograms(AliVTrack* vtrack) const;
114 void FillQAHistograms(AliVEvent* vevent);
115 virtual void Terminate(Option_t* option);
117 // analysis flags and settings
118 Int_t fDebug; // debug level (0 none, 1 fcn calls, 2 verbose)
119 Bool_t fInitialized; //! is the analysis initialized?
120 Bool_t fFillQAHistograms; // fill qa histograms
121 TArrayI* fCentralityClasses; //-> centrality classes (maximum 10)
123 Int_t fNAcceptedTracks; //! number of accepted tracks
124 fitModulationType fFitModulationType; // fit modulation type
125 Bool_t fUsePtWeight; // use dptdphi instead of dndphi
126 detectorType fDetectorType; // type of detector used for modulation fit
127 TString fFitModulationOptions; // fit options for modulation fit
128 runModeType fRunModeType; // run mode type
129 dataType fDataType; // datatype
130 TRandom3* fRandom; //-> dont use gRandom to not interfere with other tasks
131 Int_t fMappedRunNumber; //! mapped runnumer (for QA)
132 Int_t fInCentralitySelection; //! centrality bin
133 TF1* fFitModulation; //-> modulation fit for rho
134 Float_t fMinPvalue; // minimum value of p
135 Float_t fMaxPvalue; // maximum value of p
136 const char* fNameJetClones; //! collection of tclones array with jets
137 const char* fNamePicoTrackClones; //! collection of tclones with pico tracks
138 const char* fNameRho; //! name of rho
140 Float_t fAbsVertexZ; // cut on zvertex
141 // general qa histograms
142 TH1F* fHistCentrality; //! accepted centrality
143 TH1F* fHistVertexz; //! accepted verte
144 TH2F* fHistRunnumbersPhi; //! run numbers averaged phi
145 TH2F* fHistRunnumbersEta; //! run numbers averaged eta
146 TH1F* fHistPvaluePDF; //! pdf value of chisquare p
147 TH1F* fHistPvalueCDF; //! cdf value of chisquare p
149 Float_t fMinDisanceRCtoLJ; // min distance between rc and leading jet
150 Float_t fRandomConeRadius; // radius of random cone
151 Bool_t fAbsVnHarmonics; // force postive local rho
152 Float_t fExcludeLeadingJetsFromFit; // exclude n leading jets from fit
153 Bool_t fRebinSwapHistoOnTheFly; // rebin swap histo on the fly
154 Float_t fPercentageOfFits; // save this percentage of fits
155 Bool_t fUseV0EventPlaneFromHeader; // use the vzero event plane from the header
156 Bool_t fSetPtSub; // store the subtracted pt in the jet
157 // transient object pointers
158 TList* fOutputList; //! output list
159 TList* fOutputListGood; //! output list for local analysis
160 TList* fOutputListBad; //! output list for local analysis
161 TH1F* fHistAnalysisSummary; //! analysis summary
162 TH1F* fHistSwap; //! swap histogram
163 TProfile* fProfV2; //! extracted v2
164 TProfile* fProfV2Resolution[10]; //! resolution parameters for v2
165 TProfile* fProfV3; //! extracted v3
166 TProfile* fProfV3Resolution[10]; //! resolution parameters for v3
167 // qa histograms for accepted pico tracks
168 TH1F* fHistPicoTrackPt[10]; //! pt of all charged tracks
169 TH2F* fHistPicoCat1[10]; //! pico tracks spd hit and refit
170 TH2F* fHistPicoCat2[10]; //! pico tracks wo spd hit w refit, constrained
171 TH2F* fHistPicoCat3[10]; //! pico tracks wo spd hit wo refit, constrained
172 // qa histograms for accepted emcal clusters
173 /* TH1F* fHistClusterPt[10]; //! pt uncorrected emcal clusters */
174 /* TH1F* fHistClusterPhi[10]; //! phi uncorrected emcal clusters */
175 /* TH1F* fHistClusterEta[10]; //! eta uncorrected emcal clusters */
176 // qa histograms for accepted emcal clusters aftehadronic correction
177 /* TH1F* fHistClusterCorrPt[10]; //! pt corrected emcal clusters */
178 /* TH1F* fHistClusterCorrPhi[10]; //! phi corrected emcal clusters */
179 /* TH1F* fHistClusterCorrEta[10]; //! eta corrected emcal clusters */
181 TProfile* fHistPsiControl; //! event plane control histogram
182 TProfile* fHistPsiSpread; //! event plane spread histogram
183 TH1F* fHistPsiVZEROA; //! psi 2 from vzero a
184 TH1F* fHistPsiVZEROC; //! psi 2 from vzero c
185 TH1F* fHistPsiTPC; //! psi 2 from tpc
186 TH1F* fHistPsiTPCSUBA; //! psi 2 from tpc subevent a
187 TH1F* fHistPsiTPCSUBB; //! psi 2 from tpc subevent b
189 TH1F* fHistRhoPackage[10]; //! rho as estimated by emcal jet package
190 TH1F* fHistRho[10]; //! background
191 TH2F* fHistRhoVsMult; //! rho versus multiplicity
192 TH2F* fHistRhoVsCent; //! rho veruss centrality
193 TH2F* fHistRhoAVsMult; //! rho * A vs multiplicity for all jets
194 TH2F* fHistRhoAVsCent; //! rho * A vs centrality for all jets
195 // delta pt distributions
196 TH2F* fHistRCPhiEta[10]; //! random cone eta and phi
197 TH2F* fHistRhoVsRCPt[10]; //! rho * A vs rcpt
198 TH1F* fHistRCPt[10]; //! rcpt
199 TH2F* fHistDeltaPtDeltaPhi2[10]; //! dpt vs dphi
200 TH2F* fHistDeltaPtDeltaPhi3[10]; //! dpt vs dphi
201 TH2F* fHistRCPhiEtaExLJ[10]; //! random cone eta and phi, excl leading jet
202 TH2F* fHistRhoVsRCPtExLJ[10]; //! rho * A vs rcpt, excl leading jet
203 TH1F* fHistRCPtExLJ[10]; //! rcpt, excl leading jet
204 TH2F* fHistDeltaPtDeltaPhi2ExLJ[10]; //! dpt vs dphi, excl leading jet
205 TH2F* fHistDeltaPtDeltaPhi3ExLJ[10]; //! dpt vs dphi, excl leading jet
206 TH2F* fHistRCPhiEtaRand[10]; //! random cone eta and phi, randomized
207 TH2F* fHistRhoVsRCPtRand[10]; //! rho * A vs rcpt, randomized
208 TH1F* fHistRCPtRand[10]; //! rcpt, randomized
209 TH2F* fHistDeltaPtDeltaPhi2Rand[10]; //! dpt vs dphi, randomized
210 TH2F* fHistDeltaPtDeltaPhi3Rand[10]; //! dpt vs dphi, randomized
211 // jet histograms (after kinematic cuts)
212 TH1F* fHistJetPtRaw[10]; //! jet pt - no background subtraction
213 TH1F* fHistJetPt[10]; //! pt of found jets (background subtracted)
214 TH2F* fHistJetEtaPhi[10]; //! eta and phi correlation
215 TH2F* fHistJetPtArea[10]; //! jet pt versus area
216 TH2F* fHistJetPtConstituents[10]; //! jet pt versus number of constituents
217 TH2F* fHistJetEtaRho[10]; //! jet eta versus jet rho
218 // in plane, out of plane jet spectra
219 TH2F* fHistJetPsiTPCPt[10]; //! psi tpc versus pt
220 TH2F* fHistJetPsiVZEROAPt[10]; //! psi vzeroa versus pt
221 TH2F* fHistJetPsiVZEROCPt[10]; //! psi vzeroc versus pt
223 TH1F* fHistDeltaPhi2VZEROA[10]; //! phi minus psi_A
224 TH1F* fHistDeltaPhi2VZEROC[10]; //! phi minus psi_C
225 TH1F* fHistDeltaPhi2TPC[10]; //! phi minus psi_TPC
226 TH1F* fHistDeltaPhi3VZEROA[10]; //! phi minus psi_A
227 TH1F* fHistDeltaPhi3VZEROC[10]; //! phi minus psi_C
228 TH1F* fHistDeltaPhi3TPC[10]; //! phi minus psi_TPC
230 AliAnalysisTaskRhoVnModulation(const AliAnalysisTaskRhoVnModulation&); // not implemented
231 AliAnalysisTaskRhoVnModulation& operator=(const AliAnalysisTaskRhoVnModulation&); // not implemented
233 ClassDef(AliAnalysisTaskRhoVnModulation, 7);