AliPhysics  ba8894a (ba8894a)
AliAnalysisTaskLocalRho.h
Go to the documentation of this file.
1 #ifndef ALIANALYSISTASKLOCALRHO_H
2 #define ALIANALYSISTASKLOCALRHO_H
3 
4 // $Id$
5 
6 // uncomment of define externally to enable debug information
7 //#define ALIANALYSISTASKLOCALRHO_DEBUG_FLAG_0
8 
10 #include <AliEmcalJet.h>
11 #include <AliVEvent.h>
12 #include <AliVTrack.h>
13 #include <AliVCluster.h>
14 #include <TClonesArray.h>
15 #include <TMath.h>
16 #include <TRandom3.h>
17 #include <AliLog.h>
18 #include <AliJetContainer.h>
19 
20 class TF1;
21 class THF1;
22 class THF2;
23 class TProfile;
25 
27  public:
28  // enumerators
30  enum detectorType { kTPC, kVZEROA, kVZEROC, kVZEROComb}; // detector that was used
31  enum qcRecovery { kFixedRho, kNegativeVn, kTryFit }; // how to deal with negative cn value for qcn value
32  enum runModeType { kLocal, kGrid }; // run mode type
33  // constructors, destructor
35  AliAnalysisTaskLocalRho(const char *name, runModeType type);
36  virtual ~AliAnalysisTaskLocalRho();
37  // setting up the task and technical aspects
38  void ExecOnce();
40  virtual void UserCreateOutputObjects();
41  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);
42  TH2F* BookTH2F(const char* name, const char* x, const char* y, Int_t binsx, Double_t minx, Double_t maxx,
43  Int_t binsy, Double_t miny, Double_t maxy, Int_t c = -1, Bool_t append = kTRUE);
44  virtual Bool_t Run();
45  /* inline */ Double_t PhaseShift(Double_t x) const {
46  while (x>=TMath::TwoPi())x-=TMath::TwoPi();
47  while (x<0.)x+=TMath::TwoPi();
48  return x; }
49  /* inline */ Double_t PhaseShift(Double_t x, Double_t n) const {
50  x = PhaseShift(x);
51  if(TMath::Nint(n)==2) while (x>TMath::Pi()) x-=TMath::Pi();
52  if(TMath::Nint(n)==3) {
53  if(x>2.*TMath::TwoPi()/n) x = TMath::TwoPi() - x;
54  if(x>TMath::TwoPi()/n) x = TMath::TwoPi()-(x+TMath::TwoPi()/n);
55  }
56  return x; }
57  /* inline */ Double_t ChiSquarePDF(Int_t ndf, Double_t x) const {
58  Double_t n(ndf/2.), denom(TMath::Power(2, n)*TMath::Gamma(n));
59  if (denom!=0) return ((1./denom)*TMath::Power(x, n-1)*TMath::Exp(-x/2.));
60  return -999; }
61  // the cdf of the chisquare distribution is the normalized lower incomplete gamma function
62  /* inline */ Double_t ChiSquareCDF(Int_t ndf, Double_t x) const { return TMath::Gamma(ndf/2., x/2.); }
63  // setters - setup how to run
68  // setters - analysis details
70  void SetIntegratedFlow(TH1F* i, TH1F* j) {fUserSuppliedV2 = i; fUserSuppliedV3 = j; }
71  void SetOnTheFlyResCorrection(TH1F* r2, TH1F* r3) {fUserSuppliedR2 = r2; fUserSuppliedR3 = r3; }
72  void SetModulationFit(TF1* fit);
80  void SetRunModeType(runModeType type) {fRunModeType = type; }
87  // getters
89  // numerical evaluations
90  void CalculateEventPlaneVZERO(Double_t vzero[2][2]) const;
95  // helper calculations for the q-cumulant analysis, also used by AliAnalyisTaskJetFlow
96  void QCnQnk(Int_t n, Int_t k, Double_t &reQ, Double_t &imQ);
97  Double_t QCnS(Int_t i, Int_t j);
98  Double_t QCnM();
99  Double_t QCnM11();
100  Double_t QCnM1111();
101  Bool_t QCnRecovery(Double_t psi2, Double_t psi3);
102  // analysis details
103  Bool_t CorrectRho(Double_t psi2, Double_t psi3);
104  void FillEventPlaneHistograms(Double_t psi2, Double_t psi3) const;
105  void FillAnalysisSummaryHistogram() const;
106  // track selection
107  /* inline */ Bool_t PassesCuts(AliVTrack* track) const { UInt_t rejectionReason = 0; return GetParticleContainer(0)->AcceptParticle(track, rejectionReason);} // due to framework updates
108  /* inline */ Bool_t PassesCuts(AliEmcalJet* jet) { return AcceptJet(jet, 0);}
109  virtual void Terminate(Option_t* option);
110 
111  private:
113  Bool_t fAttachToEvent; // attach local rho to the event
114  Bool_t fFillHistograms; // fill qa histograms
115  Bool_t fNoEventWeightsForQC; // don't store event weights for qc analysis
116  Bool_t fUseScaledRho; // use scaled rho
117  TArrayI* fCentralityClasses; // centrality classes (maximum 10) used for QA
118  TH1F* fUserSuppliedV2; // histo with integrated v2
119  TH1F* fUserSuppliedV3; // histo with integrated v3
120  TH1F* fUserSuppliedR2; // correct the extracted v2 with this r
121  TH1F* fUserSuppliedR3; // correct the extracted v3 with this r
125  fitModulationType fFitModulationType; // fit modulation type
126  qcRecovery fQCRecovery; // recovery type for e-by-e qc method
127  Bool_t fUsePtWeight; // use dptdphi instead of dndphi
128  Bool_t fUsePtWeightErrorPropagation; // recalculate the bin error on the dpt dphi histogram
129  detectorType fDetectorType; // type of detector used for modulation fit
130  TString fFitModulationOptions; // fit options for modulation fit
131  runModeType fRunModeType; // run mode type
132  TF1* fFitModulation; // modulation fit for rho
133  Float_t fMinPvalue; // minimum value of p
134  Float_t fMaxPvalue; // maximum value of p
135  // additional jet cuts (most are inherited)
136  Float_t fLocalJetMinEta; // local eta cut for jets
137  Float_t fLocalJetMaxEta; // local eta cut for jets
138  Float_t fLocalJetMinPhi; // local phi cut for jets
139  Float_t fLocalJetMaxPhi; // local phi cut for jets
140  Float_t fSoftTrackMinPt; // min pt for soft tracks
141  Float_t fSoftTrackMaxPt; // max pt for soft tracks
142  // general qa histograms
145  // general settings
146  Bool_t fAbsVnHarmonics; // force postive local rho
147  Float_t fExcludeLeadingJetsFromFit; // exclude n leading jets from fit
148  Bool_t fRebinSwapHistoOnTheFly; // rebin swap histo on the fly
149  Float_t fPercentageOfFits; // save this percentage of fits
150  Bool_t fUseV0EventPlaneFromHeader; // use the vzero event plane from the header
151  // transient object pointers
155  TH1F* fHistSwap;
157  TProfile* fProfV2;
158  TProfile* fProfV2Cumulant;
159  TProfile* fProfV3;
160  TProfile* fProfV3Cumulant;
161  TH1F* fHistPsi2[10];
162  TH1F* fHistPsi3[10];
163 
164  AliAnalysisTaskLocalRho(const AliAnalysisTaskLocalRho&); // not implemented
165  AliAnalysisTaskLocalRho& operator=(const AliAnalysisTaskLocalRho&); // not implemented
166 
167  ClassDef(AliAnalysisTaskLocalRho, 6);
168 };
169 #endif
Double_t ChiSquarePDF(Int_t ndf, Double_t x) const
Double_t QCnS(Int_t i, Int_t j)
void CalculateEventPlaneCombinedVZERO(Double_t *comb) const
Double_t PhaseShift(Double_t x, Double_t n) const
virtual Bool_t Run()
Run function. This is the core function of the analysis and contains the user code. Therefore users have to implement this function.
void CalculateEventPlaneTPC(Double_t *tpc)
virtual void Terminate(Option_t *option)
double Double_t
Definition: External.C:58
Definition: External.C:236
Bool_t PassesCuts(AliVTrack *track) const
Bool_t QCnRecovery(Double_t psi2, Double_t psi3)
Bool_t fAbsVnHarmonics
status of rho vs centrality
void SetSoftTrackMinMaxPt(Float_t min, Float_t max)
Double_t ChiSquareCDF(Int_t ndf, Double_t x) const
void SetRebinSwapHistoOnTheFly(Bool_t r)
TH1F * fHistAnalysisSummary
swap histogram
TCanvas * c
Definition: TestFitELoss.C:172
TH1F * fHistPsi2[10]
v3 cumulant
void SetOnTheFlyResCorrection(TH1F *r2, TH1F *r3)
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Get particle container attached to this task.
void CalculateEventPlaneVZERO(Double_t vzero[2][2]) const
TString fLocalRhoName
name for local rho
Bool_t CorrectRho(Double_t psi2, Double_t psi3)
Int_t fNAcceptedTracksQCn
number of accepted tracks
int Int_t
Definition: External.C:63
void SetExcludeLeadingJetsFromFit(Float_t n)
unsigned int UInt_t
Definition: External.C:33
float Float_t
Definition: External.C:68
void SetSaveThisPercentageOfFits(Float_t p)
Bool_t PassesCuts(AliEmcalJet *jet)
void SetReferenceDetector(detectorType type)
TList * fOutputListBad
output list for local analysis
void SetQCnRecoveryType(qcRecovery type)
void QCnQnk(Int_t n, Int_t k, Double_t &reQ, Double_t &imQ)
void ExecOnce()
Perform steps needed to initialize the analysis.
virtual Bool_t AcceptParticle(const AliVParticle *vp, UInt_t &rejectionReason) const
void SetUsePtWeightErrorPropagation(Bool_t w)
void SetCentralityClasses(TArrayI *c)
void SetModulationFitOptions(TString opt)
fitModulationType fFitModulationType
centrality bin, only for QA plots
void SetRunModeType(runModeType type)
TList * fOutputListGood
output list
TH2F * fHistRhoStatusCent
cdf value of chisquare p
TProfile * fProfV3
v2 cumulant
void FillEventPlaneHistograms(Double_t psi2, Double_t psi3) const
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)
void SetModulationFitType(fitModulationType type)
TProfile * fProfV3Cumulant
extracted v3
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:51
void SetUseV0EventPlaneFromHeader(Bool_t h)
TH1F * fHistSwap
output list for local analysis
Int_t fInCentralitySelection
accepted tracks for QCn
AliAnalysisTaskLocalRho & operator=(const AliAnalysisTaskLocalRho &)
void SetModulationFitMinMaxP(Float_t m, Float_t n)
const char Option_t
Definition: External.C:48
TProfile * fProfV2Cumulant
extracted v2
virtual Bool_t AcceptJet(AliEmcalJet *jet, Int_t c=0)
bool Bool_t
Definition: External.C:53
Double_t PhaseShift(Double_t x) const
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)
Bool_t fAttachToEvent
is the analysis initialized?
void SetIntegratedFlow(TH1F *i, TH1F *j)