1 #ifndef ALIPERFORMANCEPTCALIBMC_H
2 #define ALIPERFORMANCEPTCALIBMC_H
3 //----------------------------------------------------------------------------------------------------
4 // Class to study systematic shifts in pt and charge/pt respectively. Furthermore a comparison between
5 // either ESD or TPC and MC track momenta is included.
6 // Track cuts and a user defined shift in 1/pt can be switched on and off by user.
8 // Analysis with class AliPerfAnalyzeInvPt via AliPerformancePtCalibMC::Analyse().:
9 // Projection of 1/pt vs theta and vs phi resp. Histograms will be fitted with either
10 // polynomial or gaussian fit function to extract minimum position of 1/pt.
11 // Fit options and theta, phi bins can be set by user.
12 // Attention: use the Set* functions of AliPerformancePtCalibMC when running AliPerformancePtCalibMC::Analyse().
14 // Author: S. Schuchmann 11/13/2009
15 //----------------------------------------------------------------------------------------------------
28 class AliTrackReference;
31 class AliESDfriendTrack;
35 class AliESDtrackCuts;
37 #include "THnSparse.h"
38 #include "AliPerformanceObject.h"
40 class AliPerformancePtCalibMC : public AliPerformanceObject {
42 AliPerformancePtCalibMC(const char *name= "AliPerformancePtCalibMC", const char *title="AliPerformancePtCalibMC");
43 virtual ~AliPerformancePtCalibMC() ;
49 virtual void Exec(AliMCEvent* const mcEvent, AliESDEvent *const esdEvent, AliESDfriend *const esdFriend, const Bool_t bUseMC, const Bool_t bUseESDfriend);
51 // Merge output objects (needed by PROOF)
52 virtual Long64_t Merge(TCollection* const list);
54 // Analyse output histograms
55 virtual void Analyse();
57 // Get analysis folder
58 virtual TFolder* GetAnalysisFolder() const {return fAnalysisFolder;}
60 // Options for track cuts
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
65 void SetAliESDtrackCuts( AliESDtrackCuts* esdTrackCuts) { fESDTrackCuts = esdTrackCuts;fESDcuts=kTRUE;}//esd track cuts
67 void SetAnalysePions(const Bool_t anaPions) {fPions = anaPions;}
68 //user defined shift in charge/pt
69 void SetPtShift(const Double_t shiftVal); //sets user defined shift in charge/pt
71 // setters for analysis with AliPerformancePtCalibMC::Analyse()
72 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)
73 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)
74 void SetMakeFitOption(const Bool_t setGausFit, const Double_t exclusionR,const Double_t fitR );// set fit options
75 void SetDoRebin(const Int_t rebin){if(rebin) {fDoRebin = kTRUE; fRebin = rebin;}}
76 void SetAnaMCOff() {fAnaMC = kFALSE;} // switch analysis of MC true tracks off
77 const TList *GetHistoList() {return fList;} // get list of histograms
80 // Create folder for analysed histograms
81 TFolder *CreateFolder(TString folder = "folderPtCalib",TString title = "Analysed PtCalib histograms");
83 // Export objects to folder
84 TFolder *ExportToFolder(TObjArray * array=0);
87 void SetAliRecInfoCuts(AliRecInfoCuts* const cuts=0) {fCutsRC = cuts;}
88 void SetAliMCInfoCuts(AliMCInfoCuts* const cuts=0) {fCutsMC = cuts;}
90 AliRecInfoCuts* GetAliRecInfoCuts() const {return fCutsRC;}
91 AliMCInfoCuts* GetAliMCInfoCuts() const {return fCutsMC;}
94 // variables for fitting in Analyse() function
95 Double_t fThetaBins[100];// array of theta bins for projection of charge/pt vs theta
96 Double_t fPhiBins[100]; // array of phi bins for projection of charge/pt vs theta
98 Int_t fNThetaBins;// sets number of theta bins
99 Int_t fNPhiBins ;// sets number of phi bins
100 Double_t fMaxPhi;// max phi for 2D projection on theta and charge/pt axis
101 Double_t fMinPhi;// min phi for 2D projection on theta and charge/pt axis
102 Double_t fMaxTheta;// max theta for 2D projection on phi and charge/pt axis
103 Double_t fMinTheta;// min theta for 2D projection on phi and charge/pt axis
104 Double_t fRange;// sets fit range
105 Double_t fExclRange ;// sets range of rejection of points around 0
106 Bool_t fFitGaus ;// flag for usage of gaussian fit function
107 Bool_t fDoRebin;// flag for rebin 1D histos before fitting
108 Int_t fRebin;// number of bins for rebin
109 Bool_t fAnaMC;// flag for analysis of MC tracks
113 // option for user defined shift in charge/pt
114 Bool_t fShift;//flag for shift in charge/pt
115 Double_t fDeltaInvP;// shift value of charge/pt
118 Bool_t fOptTPC;// flag for reading of TPC tracks in Exec
119 Bool_t fESDcuts;//flag for usage of esd track cuts
120 Bool_t fPions;// flag for analzsing pions instead of all charged particles
122 //ESD track cut values
123 Double_t fEtaAcceptance;//sets value of eta window
124 AliRecInfoCuts* fCutsRC; // selection cuts for reconstructed tracks
125 AliMCInfoCuts* fCutsMC; // selection cuts for MC tracks
128 TList *fList;// list of histograms
130 // histograms and THnSparse
131 THnSparseF *fHistInvPtPtThetaPhi;// is filled with charge/pt, pt, theta, phi for ESD or TPC
133 TH1F *fHistPtShift0;//if shift in charge/pt is set by user, this histogram shows pt wihtout shift
134 TH1F *fHistPrimaryVertexPosX;// primary vertex position x
135 TH1F *fHistPrimaryVertexPosY;// primary vertex position y
136 TH1F *fHistPrimaryVertexPosZ;// primary vertex position z
137 TH1F *fHistTrackMultiplicity; // track multiplicity
138 TH1F *fHistTrackMultiplicityCuts;//track multiplicity after all cuts are applied
140 TH2F *fHistTPCMomentaPosP;//TPC p vs global esd track p for positive tracks
141 TH2F *fHistTPCMomentaNegP;//TPC p vs global esd track p for negative tracks
142 TH2F *fHistTPCMomentaPosPt;//TPC pt vs global esd track p positive tracks
143 TH2F *fHistTPCMomentaNegPt;//TPC pt vs global esd track p for negative tracks
145 THnSparseF *fHistInvPtPtThetaPhiMC;// is filled with charge/pt, pt, theta, phi for MC true
147 TH2F *fHistInvPtMCESD;// charge/pt of ESD vs MC
148 TH2F *fHistInvPtMCTPC;// charge/pt of TPC vs MC
149 TH2F *fHistPtMCESD;//pt of ESD vs MC
150 TH2F *fHistPtMCTPC;//pt of TPC vs MC
151 TH2F *fHistMomresMCESD; //(pt ESD - pt MC)/ptMC vs pt MC
152 TH2F *fHistMomresMCTPC; //(pt TPC - pt MC)/ptMC vs pt MC
153 TH2F *fHistTPCMomentaPosInvPtMC;//TPC-MC of 1/pt vs global ESD-MC of charge/pt of positive tracks
154 TH2F *fHistTPCMomentaNegInvPtMC;//TPC-MC of 1/pt vs global ESD-MC of charge/pt of negative tracks
155 TH2F *fHistTPCMomentaPosPtMC;//TPC-MC of pt vs global ESD-MC of pt of positive tracks
156 TH2F *fHistTPCMomentaNegPtMC;//TPC-MC of pt vs global ESD-MC of pt of negative tracks
158 TH1F *fHistESDMomentaPosInvPtMC;//ESD-MC of charge/pt of positive tracks
159 TH1F *fHistESDMomentaNegInvPtMC;//ESD-MC of charge/pt of negative tracks
160 TH1F *fHistESDMomentaPosPtMC;//ESD-MC of pt of positive tracks
161 TH1F *fHistESDMomentaNegPtMC;//ESD-MC of pt of negative tracks
163 TH1F *fHistUserPtShift;// shows the shift value if set by user
164 TH2F *fHistdedxPions;// dEdx vs cahrge*pt
166 AliESDtrackCuts* fESDTrackCuts;// esd track cuts
169 TFolder *fAnalysisFolder; // folder for analysed histograms
171 AliPerformancePtCalibMC(const AliPerformancePtCalibMC&); // not implemented
172 AliPerformancePtCalibMC& operator=(const AliPerformancePtCalibMC&); // not implemented
174 ClassDef(AliPerformancePtCalibMC, 1);