]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGPP/TPC/AliPerformancePtCalib.h
Updates in D+ histos and ntuples (Renu, Francesco, Elena)
[u/mrichter/AliRoot.git] / PWGPP / TPC / AliPerformancePtCalib.h
1
2 #ifndef ALIPERFORMANCEPTCALIB_H
3 #define ALIPERFORMANCEPTCALIB_H
4 //----------------------------------------------------------------------------------------------------
5 // Class to study systematic shifts in pt and charge/pt respectively.Furthermore a comparison between
6 // ESD and TPC track momenta is included.
7 // Track cuts and a user defined shift in charge/pt can be switched on and off by user.
8 //
9 // Analysis with class AliPerfAnalyzeInvPt via AliPerformancePtCalib::Analyse(). :
10 // Projection of charge/pt vs theta and vs phi resp. Histograms will be fitted with either
11 // polynomial or gaussian fit function to extract minimum position of 1/pt.
12 // Fit options and theta, phi bins can be set by user.
13 // Attention: use the Set* functions of AliPerformancePtCalib when running AliPerformancePtCalib::Analyse().
14 //
15 // Author: S. Schuchmann 11/13/2009 
16 //----------------------------------------------------------------------------------------------------
17
18 class TString;
19 class TNamed;
20 class TCanvas;
21 class TH1F;
22 class TH2F;
23 class TList;
24
25 class AliESDVertex;
26 class AliESDtrack;
27 class AliMCEvent;
28 class AliStack;
29 class AliTrackReference;
30 class AliESDEvent; 
31 class AliESDfriend; 
32 class AliESDfriendTrack; 
33 class AliMCInfoCuts;
34 class AliRecInfoCuts;
35 class AliESDtrackCuts;
36 class AliESDpid;
37
38 #include "THnSparse.h"
39 #include "AliPerformanceObject.h"
40
41 class AliPerformancePtCalib : public AliPerformanceObject {
42 public:
43    AliPerformancePtCalib(); 
44    AliPerformancePtCalib(Char_t* name, Char_t* title);//, Int_t analysisMode, Bool_t hptGenerator);
45    virtual ~AliPerformancePtCalib();
46
47    // Init data members
48    virtual void  Init();
49
50    // Execute analysis
51    virtual void  Exec(AliMCEvent* const mcEvent, AliESDEvent *const esdEvent, AliESDfriend *const esdFriend, const Bool_t bUseMC, const Bool_t bUseESDfriend);
52
53    // Merge output objects (needed by PROOF) 
54    virtual Long64_t Merge(TCollection* const list);
55
56    // Analyse output histograms
57    virtual void Analyse();
58
59    // Get analysis folder
60    virtual TFolder* GetAnalysisFolder() const {return fAnalysisFolder;}
61  
62    void SetReadTPCTracks(const Bool_t readTPC)        {fOptTPC   = readTPC;}//read only ESD tracks
63    void SetEtaRange(const Double_t eta)               {fEtaAcceptance =  eta ;}//sets eta window
64   
65    void SetAliESDtrackCuts( AliESDtrackCuts* esdTrackCuts) { fESDTrackCuts = esdTrackCuts;fESDcuts=kTRUE;}//esd track cuts
66
67    void SetAnalysePions(const Bool_t anaPions) {fPions = anaPions;}
68    void SetPtShift(const Double_t shiftVal); // set user defined shift in charge/pt
69
70    // setters for analysis with AliPerformancePtCalib::Analyse()  
71    void SetProjBinsPhi(const Double_t *pBins,const Int_t sizep,const Double_t minTheta, const Double_t maxTheta);// set phi bins for projection and theta range selection (rad)
72    void SetProjBinsTheta(const Double_t *tBins, const Int_t sizet,const Double_t minPhi, const Double_t maxPhi);// set theta bins for projection and phi range selection (rad)
73    void SetMakeFitOption(const Bool_t setGausFit, const Double_t exclusionR,const Double_t fitR );//set fit options
74    void SetDoRebin(const Int_t rebin){if(rebin) {fDoRebin = kTRUE; fRebin = rebin;}}
75    const TList *GetHistoList() {return fList;}// get list of histograms for analysis
76
77    // Create folder for analysed histograms
78    TFolder *CreateFolder(TString folder = "folderPtCalib",TString title = "Analysed PtCalib histograms");
79
80    // Export objects to folder
81    TFolder *ExportToFolder(TObjArray * array=0);
82
83    // Selection cuts
84    void SetAliRecInfoCuts(AliRecInfoCuts* const cuts=0) {fCutsRC = cuts;}   
85    void SetAliMCInfoCuts(AliMCInfoCuts* const cuts=0) {fCutsMC = cuts;}  
86
87    AliRecInfoCuts*  GetAliRecInfoCuts() const {return fCutsRC;}  
88    AliMCInfoCuts*   GetAliMCInfoCuts()  const {return fCutsMC;}
89
90 protected:
91    // variables for fitting in Analyse() function
92    Double_t fThetaBins[100];// array of theta bins for projection of 1/pt vs theta
93    Double_t fPhiBins[100]; // array of phi bins for projection of 1/pt vs theta
94
95    Int_t fNThetaBins;// sets number of theta bins
96    Int_t fNPhiBins ;// sets number of phi bins
97    Double_t fMaxPhi;// max phi for 2D projection on theta and charge/pt axis
98    Double_t fMinPhi;// min phi for 2D projection on theta and charge/pt axis
99    Double_t fMaxTheta;// max theta for 2D projection on phi and charge/pt axis
100    Double_t fMinTheta;// min theta for 2D projection on phi and charge/pt axis
101    Double_t fRange;// sets fit range
102    Double_t fExclRange ;// sets range of rejection of points around 0
103    Bool_t fFitGaus ;// flag for usage of gaussian fit function
104    Bool_t fDoRebin;// flag for rebin 1D histos before fitting
105    Int_t fRebin;// number of bins for rebin
106     
107 private:
108    // option for user defined shift in charge/pt
109    Bool_t fShift;//flag for shift in charge/pt
110    Double_t fDeltaInvP;// shift value of charge/pt
111    
112    //options for cuts
113    Bool_t fOptTPC;// flag for reading of TPC tracks in Exec
114    Bool_t fESDcuts;//flag for usage of esd track cuts
115    Bool_t fPions;// flag for analzsing pions instead of all charged particles
116
117    //ESD track cut values
118    Double_t fEtaAcceptance;//sets value of eta window
119
120    AliRecInfoCuts* fCutsRC;     // selection cuts for reconstructed tracks
121    AliMCInfoCuts*  fCutsMC;     // selection cuts for MC tracks
122   
123
124     
125    TList       *fList;// list of histograms
126    
127    //histograms and THnSparse
128    THnSparseF  *fHistInvPtPtThetaPhi;// is filled with charge/pt, pt, theta, phi for ESD or TPC
129
130    TH1F        *fHistPtShift0;//if shift in charge/pt is set by user, this histogram shows pt wihtout shift
131    TH1F        *fHistPrimaryVertexPosX;// primary vertex position x          
132    TH1F        *fHistPrimaryVertexPosY;// primary vertex position y        
133    TH1F        *fHistPrimaryVertexPosZ;// primary vertex position z        
134    TH1F        *fHistTrackMultiplicity; // track multiplicity         
135    TH1F        *fHistTrackMultiplicityCuts;//track multiplicity after all cuts are applied
136
137    TH2F        *fHistTPCMomentaPosP;//TPC p vs global esd track p for positive tracks
138    TH2F        *fHistTPCMomentaNegP;//TPC p vs global esd track p for negative tracks
139    TH2F        *fHistTPCMomentaPosPt;//TPC pt vs global esd track p positive tracks
140    TH2F        *fHistTPCMomentaNegPt;//TPC pt vs global esd track p for negative tracks
141    
142
143    TH1F        *fHistUserPtShift;// shows the shift value if set by user
144    TH2F        *fHistdedxPions;// dEdx vs cahrge*pt
145    
146    AliESDtrackCuts* fESDTrackCuts;// esd track cuts
147    //pid
148    AliESDpid *fESDpid;
149    // analysis folder 
150    TFolder *fAnalysisFolder; // folder for analysed histograms
151
152    AliPerformancePtCalib(const AliPerformancePtCalib&);            // not implemented 
153    AliPerformancePtCalib& operator=(const AliPerformancePtCalib&); // not implemented 
154
155    ClassDef(AliPerformancePtCalib, 1); 
156 };
157
158 #endif