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