AliPhysics  master (3d17d9d)
AliAnalysisTaskLocalRho.h
Go to the documentation of this file.
1 /**************************************************************************************
2  * Copyright (C) 2013, Copyright Holders of the ALICE Collaboration *
3  * All rights reserved. *
4  * *
5  * Redistribution and use in source and binary forms, with or without *
6  * modification, are permitted provided that the following conditions are met: *
7  * * Redistributions of source code must retain the above copyright *
8  * notice, this list of conditions and the following disclaimer. *
9  * * Redistributions in binary form must reproduce the above copyright *
10  * notice, this list of conditions and the following disclaimer in the *
11  * documentation and/or other materials provided with the distribution. *
12  * * Neither the name of the <organization> nor the *
13  * names of its contributors may be used to endorse or promote products *
14  * derived from this software without specific prior written permission. *
15  * *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
19  * DISCLAIMED. IN NO EVENT SHALL ALICE COLLABORATION BE LIABLE FOR ANY *
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
26  **************************************************************************************/
27 #ifndef ALIANALYSISTASKLOCALRHO_H
28 #define ALIANALYSISTASKLOCALRHO_H
29 
30 // uncomment of define externally to enable debug information
31 //#define ALIANALYSISTASKLOCALRHO_DEBUG_FLAG_0
32 
34 #include <AliEmcalJet.h>
35 #include <AliVEvent.h>
36 #include <AliVTrack.h>
37 #include <AliVCluster.h>
38 #include <TClonesArray.h>
39 #include <TMath.h>
40 #include <TRandom3.h>
41 #include <AliLog.h>
42 #include <AliJetContainer.h>
43 
44 class TF1;
45 class THF1;
46 class THF2;
47 class TProfile;
49 
67  public:
68  // enumerators
70  enum detectorType { kTPC, kVZEROA, kVZEROC, kVZEROComb}; // detector that was used
71  enum qcRecovery { kFixedRho, kNegativeVn, kTryFit }; // how to deal with negative cn value for qcn value
72  enum runModeType { kLocal, kGrid }; // run mode type
73  // constructors, destructor
75  AliAnalysisTaskLocalRho(const char *name, runModeType type);
76  virtual ~AliAnalysisTaskLocalRho();
77  // setting up the task and technical aspects
78  void ExecOnce();
80  virtual void UserCreateOutputObjects();
81  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);
82  TH2F* BookTH2F(const char* name, const char* x, const char* y, Int_t binsx, Double_t minx, Double_t maxx,
83  Int_t binsy, Double_t miny, Double_t maxy, Int_t c = -1, Bool_t append = kTRUE);
84  virtual Bool_t Run();
85  /* inline */ Double_t PhaseShift(Double_t x) const {
86  while (x>=TMath::TwoPi())x-=TMath::TwoPi();
87  while (x<0.)x+=TMath::TwoPi();
88  return x; }
89  /* inline */ Double_t PhaseShift(Double_t x, Double_t n) const {
90  x = PhaseShift(x);
91  if(TMath::Nint(n)==2) while (x>TMath::Pi()) x-=TMath::Pi();
92  if(TMath::Nint(n)==3) {
93  if(x>2.*TMath::TwoPi()/n) x = TMath::TwoPi() - x;
94  if(x>TMath::TwoPi()/n) x = TMath::TwoPi()-(x+TMath::TwoPi()/n);
95  }
96  return x; }
97  /* inline */ Double_t ChiSquarePDF(Int_t ndf, Double_t x) const {
98  Double_t n(ndf/2.), denom(TMath::Power(2, n)*TMath::Gamma(n));
99  if (denom!=0) return ((1./denom)*TMath::Power(x, n-1)*TMath::Exp(-x/2.));
100  return -999; }
101  // the cdf of the chisquare distribution is the normalized lower incomplete gamma function
102  /* inline */ Double_t ChiSquareCDF(Int_t ndf, Double_t x) const { return TMath::Gamma(ndf/2., x/2.); }
103  // setters - setup how to run
108  // setters - analysis details
110  void SetIntegratedFlow(TH1F* i, TH1F* j) {fUserSuppliedV2 = i; fUserSuppliedV3 = j; }
111  void SetOnTheFlyResCorrection(TH1F* r2, TH1F* r3) {fUserSuppliedR2 = r2; fUserSuppliedR3 = r3; }
112  void SetModulationFit(TF1* fit);
127  // getters
129  // numerical evaluations
130  void CalculateEventPlaneVZERO(Double_t vzero[2][2]) const;
131  void CalculateEventPlaneTPC(Double_t* tpc);
132  void CalculateEventPlaneCombinedVZERO(Double_t* comb) const;
135  // helper calculations for the q-cumulant analysis, also used by AliAnalyisTaskJetFlow
136  void QCnQnk(Int_t n, Int_t k, Double_t &reQ, Double_t &imQ);
137  Double_t QCnS(Int_t i, Int_t j);
138  Double_t QCnM();
139  Double_t QCnM11();
140  Double_t QCnM1111();
141  Bool_t QCnRecovery(Double_t psi2, Double_t psi3);
142  // analysis details
143  Bool_t CorrectRho(Double_t psi2, Double_t psi3);
144  void FillEventPlaneHistograms(Double_t psi2, Double_t psi3) const;
145  void FillAnalysisSummaryHistogram() const;
146  // track selection
147  /* inline */ Bool_t PassesCuts(AliVTrack* track) const { UInt_t rejectionReason = 0; return GetParticleContainer(0)->AcceptParticle(track, rejectionReason);} // due to framework updates
148  /* inline */ Bool_t PassesCuts(AliEmcalJet* jet) { return AcceptJet(jet, 0);}
149  virtual void Terminate(Option_t* option);
150 
151  private:
175  // additional jet cuts (most are inherited)
182  // general qa histograms
185  // general settings
191  // transient object pointers
195  TH1F* fHistSwap;
197  TProfile* fProfV2;
198  TProfile* fProfV2Cumulant;
199  TProfile* fProfV3;
200  TProfile* fProfV3Cumulant;
201  TH1F* fHistPsi2[10];
202  TH1F* fHistPsi3[10];
203 
204  AliAnalysisTaskLocalRho(const AliAnalysisTaskLocalRho&); // not implemented
205  AliAnalysisTaskLocalRho& operator=(const AliAnalysisTaskLocalRho&); // not implemented
206 
207  ClassDef(AliAnalysisTaskLocalRho, 6);
208 };
209 #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
detectorType fDetectorType
type of detector used for modulation fit
Float_t fPercentageOfFits
save this percentage of fits
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.
TList * fOutputList
! output list
void CalculateEventPlaneTPC(Double_t *tpc)
virtual void Terminate(Option_t *option)
double Double_t
Definition: External.C:58
Bool_t fFillHistograms
fill qa histograms
Definition: External.C:236
Bool_t PassesCuts(AliVTrack *track) const
Bool_t QCnRecovery(Double_t psi2, Double_t psi3)
Bool_t fAbsVnHarmonics
force postive local rho
TH1F * fUserSuppliedV2
histo with integrated v2
Bool_t fUseScaledRho
use scaled rho
void SetSoftTrackMinMaxPt(Float_t min, Float_t max)
Double_t ChiSquareCDF(Int_t ndf, Double_t x) const
Bool_t fRebinSwapHistoOnTheFly
rebin swap histo on the fly
TCanvas * c
Definition: TestFitELoss.C:172
Float_t fExcludeLeadingJetsFromFit
exclude n leading jets from fit
TH1F * fHistPvalueCDF
! cdf value of chisquare p
Float_t fLocalJetMinPhi
local phi cut for jets
TH1F * fUserSuppliedR3
correct the extracted v2 with this r
Bool_t fUsePtWeight
use dptdphi instead of dndphi
Float_t fLocalJetMinEta
local eta cut for jets
Analysis task to estimate an event&#39;s local energy density.
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
Int_t fNAcceptedTracks
! number of accepted tracks
Bool_t CorrectRho(Double_t psi2, Double_t psi3)
TArrayI * fCentralityClasses
centrality classes (maximum 10) used for QA
Int_t fNAcceptedTracksQCn
! accepted tracks for QCn
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)
Float_t fMaxPvalue
maximum value of p
void SetReferenceDetector(detectorType type)
TList * fOutputListBad
! output list for local analysis
TH1F * fUserSuppliedV3
histo with integrated v3
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.
Bool_t fUseV0EventPlaneFromHeader
use the vzero event plane from the header
virtual Bool_t AcceptParticle(const AliVParticle *vp, UInt_t &rejectionReason) const
TProfile * fProfV2
! extracted v2
void SetUsePtWeightErrorPropagation(Bool_t w)
void SetModulationFitOptions(TString opt)
fitModulationType fFitModulationType
fit modulation type
void SetRunModeType(runModeType type)
TList * fOutputListGood
! output list for local analysis
TH2F * fHistRhoStatusCent
! status of rho vs centrality
TProfile * fProfV3
! extracted v3
TString fFitModulationOptions
fit options for modulation fit
void FillEventPlaneHistograms(Double_t psi2, Double_t psi3) const
Float_t fLocalJetMaxPhi
local phi cut for jets
Float_t fMinPvalue
minimum value of p
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
! v3 cumulant
Float_t fSoftTrackMaxPt
max pt for soft tracks
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:51
Bool_t fUsePtWeightErrorPropagation
recalculate the bin error on the dpt dphi histogram
void SetUseV0EventPlaneFromHeader(Bool_t h)
TH1F * fHistSwap
! swap histogram
Int_t fInCentralitySelection
! centrality bin, only for QA plots
AliAnalysisTaskLocalRho & operator=(const AliAnalysisTaskLocalRho &)
void SetModulationFitMinMaxP(Float_t m, Float_t n)
const char Option_t
Definition: External.C:48
TProfile * fProfV2Cumulant
! v2 cumulant
virtual Bool_t AcceptJet(AliEmcalJet *jet, Int_t c=0)
TF1 * fFitModulation
modulation fit for rho
bool Bool_t
Definition: External.C:53
Bool_t fInitialized
! is the analysis initialized?
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
attach local rho to the event
void SetIntegratedFlow(TH1F *i, TH1F *j)
qcRecovery fQCRecovery
recovery type for e-by-e qc method
Float_t fLocalJetMaxEta
local eta cut for jets
runModeType fRunModeType
run mode type
Bool_t fNoEventWeightsForQC
don&#39;t store event weights for qc analysis
Float_t fSoftTrackMinPt
min pt for soft tracks