]>
Commit | Line | Data |
---|---|---|
4060dd2d | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
ba06aaec | 15 | //------------------------------------------------------------------------------ |
16 | // Implementation of AliPerformancePtCalibMC class. It compares ESD, TPC track | |
4060dd2d | 17 | // momenta with MC information to study charge/pt spectra. |
18 | // The output can be analysed with AliPerfAnalyzeInvPt via AliPerformancePtCalibMC::Analyse(): | |
19 | // Projection of charge/pt vs theta and vs phi resp. histoprams will be fitted with either | |
20 | // polynomial or gaussian fit function to extract minimum position of charge/pt. | |
ba06aaec | 21 | // Fit options and theta, phi bins can be set by user. |
4060dd2d | 22 | // Attention: use the Set functions of AliPerformancePtCalibMC when running |
ba06aaec | 23 | // AliPerformancePtCalibMC::Analyse() |
24 | // The result of the analysis (histograms/graphs) are stored in the folder which is | |
4060dd2d | 25 | // a data member of AliPerformancePtCalibMC. |
ba06aaec | 26 | // |
27 | // Author: S.Schuchmann 11/13/2009 | |
28 | //------------------------------------------------------------------------------ | |
29 | ||
30 | /* | |
31 | ||
4060dd2d | 32 | // after running the performance task, read the file, and get component |
ba06aaec | 33 | |
34 | TFile f("Output.root"); | |
4060dd2d | 35 | AliPerformancePtCalibMC *compObj = (AliPerformancePtCalibMC*)coutput->FindObject("AliPerformancePtCalibMC"); |
ba06aaec | 36 | |
4060dd2d | 37 | // set phi and theta bins for fitting and analyse comparison data |
38 | compObj->SetProjBinsTheta(thetaBins,nThetaBins,minPhi, maxPhi); | |
39 | compObj->SetProjBinsPhi(phiBins,nPhiBins,minTheta,maxTheta); | |
40 | compObj->SetMakeFitOption(kFALSE,exclRange,fitRange); | |
41 | compObj->SetDoRebin(rebin); | |
42 | //compObj->SetAnaMCOff(); | |
ba06aaec | 43 | compObj->Analyse(); |
4060dd2d | 44 | //details see functions of this class |
ba06aaec | 45 | |
46 | // the output histograms/graphs will be stored in the folder "folderRes" | |
47 | compObj->GetAnalysisFolder()->ls("*"); | |
48 | ||
49 | // user can save whole comparison object (or only folder with anlysed histograms) | |
50 | // in the seperate output file (e.g.) | |
51 | TFile fout("Analysed_InvPt.root","recreate"); | |
52 | compObj->Write(); // compObj->GetAnalysisFolder()->Write(); | |
53 | fout.Close(); | |
54 | ||
55 | */ | |
56 | ||
57 | ||
acb9d358 | 58 | #include "TH1F.h" |
59 | #include "TH2F.h" | |
4060dd2d | 60 | #include "THnSparse.h" |
ba06aaec | 61 | #include "TList.h" |
acb9d358 | 62 | #include "TMath.h" |
ba06aaec | 63 | #include "TFolder.h" |
acb9d358 | 64 | |
acb9d358 | 65 | #include "AliESDEvent.h" |
acb9d358 | 66 | #include "AliESDtrack.h" |
67 | #include "AliESDtrackCuts.h" | |
acb9d358 | 68 | #include "AliMCEvent.h" |
69 | #include "AliStack.h" | |
ba06aaec | 70 | #include "AliESDfriendTrack.h" |
71 | #include "AliESDfriend.h" | |
acb9d358 | 72 | |
73 | #include "AliPerformancePtCalibMC.h" | |
74 | #include "AliPerfAnalyzeInvPt.h" | |
ba06aaec | 75 | |
acb9d358 | 76 | |
77 | using namespace std; | |
78 | ||
79 | ClassImp(AliPerformancePtCalibMC) | |
80 | ||
81 | //________________________________________________________________________ | |
82 | AliPerformancePtCalibMC::AliPerformancePtCalibMC() : | |
83 | AliPerformanceObject("AliPerformancePtCalibMC"), | |
ba06aaec | 84 | // option parameter for AliPerformancePtCalibMC::Analyse() |
acb9d358 | 85 | fNThetaBins(0), |
86 | fNPhiBins(0), | |
4060dd2d | 87 | fMaxPhi(0), |
88 | fMinPhi(0), | |
89 | fMaxTheta(0), | |
90 | fMinTheta(0), | |
acb9d358 | 91 | fRange(0), |
92 | fExclRange(0), | |
93 | fFitGaus(0) , | |
4060dd2d | 94 | fDoRebin(0), |
95 | fRebin(0), | |
acb9d358 | 96 | fAnaMC(0), |
ba06aaec | 97 | // option parameter for user defined charge/pt shift |
acb9d358 | 98 | fShift(0), |
ba06aaec | 99 | fDeltaInvP(0), |
acb9d358 | 100 | //options for cuts |
101 | fOptTPC(0), | |
102 | fESDcuts(0), | |
ba06aaec | 103 | fEtaAcceptance(0), |
acb9d358 | 104 | fCutsRC(0), |
105 | fCutsMC(0), | |
106 | fList(0), | |
4060dd2d | 107 | |
acb9d358 | 108 | // histograms |
4060dd2d | 109 | fHistInvPtPtThetaPhi(0), |
acb9d358 | 110 | fHistPtShift0(0), |
111 | fHistPrimaryVertexPosX(0), | |
112 | fHistPrimaryVertexPosY(0), | |
113 | fHistPrimaryVertexPosZ(0), | |
114 | fHistTrackMultiplicity(0), | |
115 | fHistTrackMultiplicityCuts(0), | |
116 | fHistTPCMomentaPosP(0), | |
117 | fHistTPCMomentaNegP(0), | |
118 | fHistTPCMomentaPosPt(0), | |
119 | fHistTPCMomentaNegPt(0), | |
4060dd2d | 120 | fHistInvPtPtThetaPhiMC(0), |
acb9d358 | 121 | fHistInvPtMCESD(0), |
122 | fHistInvPtMCTPC(0), | |
123 | fHistPtMCESD(0), | |
124 | fHistPtMCTPC(0), | |
125 | fHistMomresMCESD(0), | |
126 | fHistMomresMCTPC(0), | |
127 | fHistTPCMomentaPosInvPtMC(0), | |
128 | fHistTPCMomentaNegInvPtMC(0), | |
129 | fHistTPCMomentaPosPtMC(0), | |
130 | fHistTPCMomentaNegPtMC(0), | |
131 | fHistESDMomentaPosInvPtMC(0), | |
132 | fHistESDMomentaNegInvPtMC(0), | |
133 | fHistESDMomentaPosPtMC(0), | |
134 | fHistESDMomentaNegPtMC(0), | |
135 | fHistUserPtShift(0), | |
4060dd2d | 136 | |
137 | //esd track cuts | |
acb9d358 | 138 | fESDTrackCuts(0), |
139 | // analysis folder | |
140 | fAnalysisFolder(0) | |
141 | { | |
142 | // Dummy constructor | |
143 | ||
144 | ||
ba06aaec | 145 | fShift = kFALSE; // shift in charge/pt yes/no |
146 | fDeltaInvP = 0.00; // shift value | |
acb9d358 | 147 | //options for cuts |
4060dd2d | 148 | |
acb9d358 | 149 | fOptTPC = kTRUE; // read TPC tracks yes/no |
4060dd2d | 150 | fESDcuts = kFALSE; |
acb9d358 | 151 | fCutsRC = NULL; |
152 | fCutsMC = NULL; | |
4060dd2d | 153 | |
ba06aaec | 154 | fEtaAcceptance = 0.8; |
ba06aaec | 155 | |
156 | // options for function AliPerformancePtCalibMC::Analyse() | |
157 | fFitGaus = kFALSE;// use gaussian function for fitting charge/pt yes/no | |
158 | fNThetaBins = 0; //number of theta bins | |
159 | fNPhiBins = 0; //number of phi bins | |
4060dd2d | 160 | fMaxPhi = 6.5;// max phi for 2D projection on theta and charge/pt axis |
161 | fMinPhi = 0.0;// min phi for 2D projection on theta and charge/pt axis | |
162 | fMaxTheta = 3.0;// max theta for 2D projection on phi and charge/pt axis | |
163 | fMinTheta = 0.0;// min theta for 2D projection on phi and charge/pt axis | |
ba06aaec | 164 | fRange = 0; //fit range around 0 |
165 | fExclRange =0; //range of rejection of points around 0 | |
166 | fAnaMC = kTRUE; // analyse MC tracks yes/no | |
4060dd2d | 167 | fDoRebin = kFALSE; |
168 | fRebin = 0; | |
acb9d358 | 169 | |
170 | Init(); | |
171 | } | |
172 | ||
173 | //________________________________________________________________________ | |
4060dd2d | 174 | AliPerformancePtCalibMC::AliPerformancePtCalibMC(const char *name= "AliPerformancePtCalibMC", const char *title="AliPerformancePtCalibMC"): |
acb9d358 | 175 | AliPerformanceObject(name,title), |
ba06aaec | 176 | // option parameter for AliPerformancePtCalibMC::Analyse() |
acb9d358 | 177 | fNThetaBins(0), |
41fefc69 | 178 | fNPhiBins(0), |
179 | fMaxPhi(0), | |
180 | fMinPhi(0), | |
181 | fMaxTheta(0), | |
182 | fMinTheta(0), | |
183 | fRange(0), | |
184 | fExclRange(0), | |
185 | fFitGaus(0) , | |
186 | fDoRebin(0), | |
187 | fRebin(0), | |
188 | fAnaMC(0), | |
189 | // option parameter for user defined charge/pt shift | |
190 | fShift(0), | |
191 | fDeltaInvP(0), | |
192 | //options for cuts | |
193 | fOptTPC(0), | |
194 | fESDcuts(0), | |
195 | fEtaAcceptance(0), | |
196 | fCutsRC(0), | |
197 | fCutsMC(0), | |
198 | fList(0), | |
4060dd2d | 199 | |
41fefc69 | 200 | // histograms |
201 | fHistInvPtPtThetaPhi(0), | |
202 | fHistPtShift0(0), | |
203 | fHistPrimaryVertexPosX(0), | |
204 | fHistPrimaryVertexPosY(0), | |
205 | fHistPrimaryVertexPosZ(0), | |
206 | fHistTrackMultiplicity(0), | |
207 | fHistTrackMultiplicityCuts(0), | |
208 | fHistTPCMomentaPosP(0), | |
209 | fHistTPCMomentaNegP(0), | |
210 | fHistTPCMomentaPosPt(0), | |
211 | fHistTPCMomentaNegPt(0), | |
212 | fHistInvPtPtThetaPhiMC(0), | |
213 | fHistInvPtMCESD(0), | |
214 | fHistInvPtMCTPC(0), | |
215 | fHistPtMCESD(0), | |
216 | fHistPtMCTPC(0), | |
217 | fHistMomresMCESD(0), | |
218 | fHistMomresMCTPC(0), | |
219 | fHistTPCMomentaPosInvPtMC(0), | |
220 | fHistTPCMomentaNegInvPtMC(0), | |
221 | fHistTPCMomentaPosPtMC(0), | |
222 | fHistTPCMomentaNegPtMC(0), | |
223 | fHistESDMomentaPosInvPtMC(0), | |
224 | fHistESDMomentaNegInvPtMC(0), | |
225 | fHistESDMomentaPosPtMC(0), | |
226 | fHistESDMomentaNegPtMC(0), | |
227 | fHistUserPtShift(0), | |
4060dd2d | 228 | |
41fefc69 | 229 | //esd track cuts |
230 | fESDTrackCuts(0), | |
231 | // analysis folder | |
232 | fAnalysisFolder(0) | |
acb9d358 | 233 | { |
4060dd2d | 234 | // Dummy constructor |
235 | ||
236 | ||
ba06aaec | 237 | fShift = kFALSE; // shift in charge/pt yes/no |
238 | fDeltaInvP = 0.00; // shift value | |
acb9d358 | 239 | //options for cuts |
4060dd2d | 240 | |
acb9d358 | 241 | fOptTPC = kTRUE; // read TPC tracks yes/no |
4060dd2d | 242 | fESDcuts = kFALSE; |
acb9d358 | 243 | fCutsRC = NULL; |
244 | fCutsMC = NULL; | |
4060dd2d | 245 | |
ba06aaec | 246 | fEtaAcceptance = 0.8; |
ba06aaec | 247 | |
248 | // options for function AliPerformancePtCalibMC::Analyse() | |
249 | fFitGaus = kFALSE;// use gaussian function for fitting charge/pt yes/no | |
250 | fNThetaBins = 0; //number of theta bins | |
251 | fNPhiBins = 0; //number of phi bins | |
4060dd2d | 252 | fMaxPhi = 6.5;// max phi for 2D projection on theta and charge/pt axis |
253 | fMinPhi = 0.0;// min phi for 2D projection on theta and charge/pt axis | |
254 | fMaxTheta = 3.0;// max theta for 2D projection on phi and charge/pt axis | |
255 | fMinTheta = 0.0;// min theta for 2D projection on phi and charge/pt axis | |
ba06aaec | 256 | fRange = 0; //fit range around 0 |
257 | fExclRange =0; //range of rejection of points around 0 | |
258 | fAnaMC = kTRUE; // analyse MC tracks yes/no | |
4060dd2d | 259 | fDoRebin = kFALSE;// flag for rebin |
260 | fRebin = 0;// bins for rebin | |
261 | ||
acb9d358 | 262 | Init(); |
263 | } | |
264 | ||
265 | //________________________________________________________________________ | |
266 | AliPerformancePtCalibMC::~AliPerformancePtCalibMC() { | |
ba06aaec | 267 | // |
268 | // destructor | |
269 | // | |
4060dd2d | 270 | |
271 | if(fList) delete fList; | |
272 | // histograms | |
273 | if(fHistInvPtPtThetaPhi) delete fHistInvPtPtThetaPhi;fHistInvPtPtThetaPhi=0; | |
274 | if(fHistPtShift0) delete fHistPtShift0;fHistPtShift0=0; | |
275 | if(fHistPrimaryVertexPosX) delete fHistPrimaryVertexPosX;fHistPrimaryVertexPosX=0; | |
276 | if(fHistPrimaryVertexPosY) delete fHistPrimaryVertexPosY;fHistPrimaryVertexPosY=0; | |
277 | if(fHistPrimaryVertexPosZ) delete fHistPrimaryVertexPosZ;fHistPrimaryVertexPosZ=0; | |
278 | if(fHistTrackMultiplicity) delete fHistTrackMultiplicity;fHistTrackMultiplicity=0; | |
279 | if(fHistTrackMultiplicityCuts) delete fHistTrackMultiplicityCuts;fHistTrackMultiplicityCuts=0; | |
280 | ||
281 | if(fHistTPCMomentaPosP) delete fHistTPCMomentaPosP;fHistTPCMomentaPosP=0; | |
282 | if(fHistTPCMomentaNegP) delete fHistTPCMomentaNegP;fHistTPCMomentaNegP=0; | |
283 | if(fHistTPCMomentaPosPt) delete fHistTPCMomentaPosPt;fHistTPCMomentaPosPt=0; | |
284 | if(fHistTPCMomentaNegPt) delete fHistTPCMomentaNegPt ;fHistTPCMomentaNegPt=0; | |
285 | if(fHistUserPtShift) delete fHistUserPtShift;fHistUserPtShift=0; | |
286 | if(fHistInvPtPtThetaPhiMC) delete fHistInvPtPtThetaPhiMC;fHistInvPtPtThetaPhiMC=0; | |
287 | if(fHistInvPtMCESD) delete fHistInvPtMCESD;fHistInvPtMCESD=0; | |
288 | if(fHistInvPtMCTPC) delete fHistInvPtMCTPC;fHistInvPtMCTPC=0; | |
289 | if(fHistPtMCESD) delete fHistPtMCESD;fHistPtMCESD=0; | |
290 | if(fHistPtMCTPC) delete fHistPtMCTPC;fHistPtMCTPC=0; | |
291 | if(fHistMomresMCESD) delete fHistMomresMCESD;fHistMomresMCESD=0; | |
292 | if(fHistMomresMCTPC) delete fHistMomresMCTPC;fHistMomresMCTPC=0; | |
293 | if(fHistTPCMomentaPosInvPtMC) delete fHistTPCMomentaPosInvPtMC;fHistTPCMomentaPosInvPtMC=0; | |
294 | if(fHistTPCMomentaNegInvPtMC) delete fHistTPCMomentaNegInvPtMC;fHistTPCMomentaNegInvPtMC=0; | |
295 | if(fHistTPCMomentaPosPtMC) delete fHistTPCMomentaPosPtMC;fHistTPCMomentaPosPtMC=0; | |
296 | if(fHistTPCMomentaNegPtMC) delete fHistTPCMomentaNegPtMC;fHistTPCMomentaNegPtMC=0; | |
297 | if(fHistESDMomentaPosInvPtMC) delete fHistESDMomentaPosInvPtMC;fHistESDMomentaPosInvPtMC=0; | |
298 | if(fHistESDMomentaNegInvPtMC) delete fHistESDMomentaNegInvPtMC;fHistESDMomentaNegInvPtMC=0; | |
299 | if(fHistESDMomentaPosPtMC) delete fHistESDMomentaPosPtMC;fHistESDMomentaPosPtMC=0; | |
300 | if(fHistESDMomentaNegPtMC) delete fHistESDMomentaNegPtMC;fHistESDMomentaNegPtMC=0; | |
301 | ||
302 | ||
303 | ||
304 | //esd track cuts | |
305 | if(fESDTrackCuts) delete fESDTrackCuts; | |
306 | if(fAnalysisFolder) delete fAnalysisFolder; fAnalysisFolder=0; | |
307 | ||
308 | ||
309 | ||
acb9d358 | 310 | } |
311 | ||
312 | //________________________________________________________________________ | |
313 | void AliPerformancePtCalibMC::Init() | |
314 | { | |
315 | // Create histograms | |
316 | // Called once | |
317 | ||
318 | fList = new TList(); | |
319 | ||
320 | // init folder | |
321 | fAnalysisFolder = CreateFolder("folderPt_TPC","Analysis Pt Resolution Folder"); | |
aa4776c7 | 322 | |
acb9d358 | 323 | // Primary Vertex: |
324 | fHistPrimaryVertexPosX = new TH1F("fHistPrimaryVertexPosX", "Primary Vertex Position X;Primary Vertex Position X (cm);Events",100,-0.5,0.5); | |
325 | fList->Add(fHistPrimaryVertexPosX); | |
326 | fHistPrimaryVertexPosY = new TH1F("fHistPrimaryVertexPosY", "Primary Vertex Position Y;Primary Vertex Position Y (cm);Events",100,-0.5,0.5); | |
327 | fList->Add(fHistPrimaryVertexPosY); | |
328 | fHistPrimaryVertexPosZ = new TH1F("fHistPrimaryVertexPosZ", "Primary Vertex Position Z;Primary Vertex Position Z (cm);Events",200,-2.0,2.0); | |
329 | fList->Add(fHistPrimaryVertexPosZ); | |
330 | ||
331 | // Multiplicity: | |
332 | fHistTrackMultiplicity = new TH1F("fHistTrackMultiplicity", "Multiplicity distribution;Number of tracks;Events", 250, 0, 250); | |
333 | fList->Add(fHistTrackMultiplicity); | |
334 | fHistTrackMultiplicityCuts = new TH1F("fHistTrackMultiplicityCuts", "Multiplicity distribution;Number of tracks after cuts;Events", 250, 0, 250); | |
335 | fList->Add(fHistTrackMultiplicityCuts); | |
336 | ||
337 | // momentum histos | |
4060dd2d | 338 | fHistPtShift0 = new TH1F("fHistPtShift0","1/pt dN/pt vs. pt of ESD track ",800,-20.0,20.0); |
acb9d358 | 339 | fList->Add(fHistPtShift0); |
4060dd2d | 340 | const Int_t invPtDims = 4; |
aa4776c7 | 341 | fMaxPhi=6.52; |
4060dd2d | 342 | fMinPhi=0.0; |
343 | fMaxTheta=3.0; | |
344 | fMinTheta=0.0; | |
345 | Double_t xminInvPt[invPtDims] = {-4.5,-20.0,fMinTheta,fMinPhi}; | |
346 | Double_t xmaxInvPt[invPtDims] = {4.5,20.0,fMaxTheta,fMaxPhi}; | |
aa4776c7 | 347 | Int_t binsInvPt[invPtDims] = {450,400,150,163}; |
4060dd2d | 348 | |
349 | fHistInvPtPtThetaPhi = new THnSparseF("fHistInvPtPtThetaPhi","1/pt vs pt vs #theta vs #phi ",invPtDims,binsInvPt,xminInvPt,xmaxInvPt); | |
350 | fList->Add(fHistInvPtPtThetaPhi); | |
351 | ||
352 | // momentum test histos | |
acb9d358 | 353 | fHistTPCMomentaPosP = new TH2F("fHistTPCMomentaPosP","TPC p vs global esd track p pos",300,0.0,15.0,300,0.0,15.0); |
354 | fList->Add(fHistTPCMomentaPosP); | |
355 | fHistTPCMomentaNegP = new TH2F("fHistTPCMomentaNegP","TPC p vs global esd track p neg",300,0.0,15.0,300,0.0,15.0); | |
356 | fList->Add(fHistTPCMomentaNegP); | |
357 | fHistTPCMomentaPosPt = new TH2F("fHistTPCMomentaPosPt","TPC pt vs global esd track pt pos",300,0.0,15.0,300,0.0,15.0); | |
358 | fList->Add(fHistTPCMomentaPosPt); | |
359 | fHistTPCMomentaNegPt = new TH2F("fHistTPCMomentaNegPt","TPC pt vs global esd track pt neg",300,0.0,15.0,300,0.0,15.0); | |
360 | fList->Add(fHistTPCMomentaNegPt); | |
361 | ||
4060dd2d | 362 | // momentum test histos MC |
aa4776c7 | 363 | fHistTPCMomentaPosInvPtMC = new TH2F("fHistTPCMomentaPosInvPtMC","TPC-MC of 1/pt vs global ESD-MC of 1/pt pos",250, -5.0, 5.0,250, -5.0,5.0); |
acb9d358 | 364 | fList->Add(fHistTPCMomentaPosInvPtMC); |
aa4776c7 | 365 | fHistTPCMomentaNegInvPtMC = new TH2F("fHistTPCMomentaNegInvPtMC","TPC-MC of 1/pt vs global ESD-MC 1/pt neg",250, -5.0, 5.0,250, -5.0, 5.0); |
acb9d358 | 366 | fList->Add(fHistTPCMomentaNegInvPtMC); |
aa4776c7 | 367 | fHistTPCMomentaPosPtMC = new TH2F("fHistTPCMomentaPosPtMC","(TPC-MC)/MC^2 of pt vs global (ESD-MC)/MC^2 of pt pos",200,-2.0,2.0,200,-2.0,2.0); |
acb9d358 | 368 | fList->Add(fHistTPCMomentaPosPtMC); |
aa4776c7 | 369 | fHistTPCMomentaNegPtMC = new TH2F("fHistTPCMomentaNegPtMC","(TPC-MC/)MC^2 of pt vs global (ESD-MC)/MC^2 of pt neg",200,-2.0,2.0,200,-2.0,2.0); |
acb9d358 | 370 | fList->Add(fHistTPCMomentaNegPtMC); |
aa4776c7 | 371 | fHistESDMomentaPosInvPtMC = new TH1F("fHistESDMomentaPosInvPtMC","ESD-MC of 1/pt pos ",200, -2.0, 2.0); |
acb9d358 | 372 | fList->Add(fHistESDMomentaPosInvPtMC); |
aa4776c7 | 373 | fHistESDMomentaNegInvPtMC = new TH1F("fHistESDMomentaNegInvPtMC","ESD-MC of 1/pt neg",200, -2.0, 2.0); |
acb9d358 | 374 | fList->Add(fHistESDMomentaNegInvPtMC); |
aa4776c7 | 375 | fHistESDMomentaPosPtMC = new TH1F("fHistESDMomentaPosPtMC","(ESD-MC)/MC^2 of pt pos",200,-2.0,2.0); |
acb9d358 | 376 | fList->Add(fHistESDMomentaPosPtMC); |
aa4776c7 | 377 | fHistESDMomentaNegPtMC = new TH1F("fHistESDMomentaNegPtMC","(ESD-MC)/MC^2 of pt neg",200,-2.0,2.0); |
acb9d358 | 378 | fList->Add(fHistESDMomentaNegPtMC); |
379 | ||
4060dd2d | 380 | // MC only info |
381 | fHistInvPtPtThetaPhiMC = new THnSparseF("fHistInvPtPtThetaPhiMC","MC 1/pt vs pt vs #theta vs #phi ",invPtDims,binsInvPt,xminInvPt,xmaxInvPt); | |
382 | fList->Add(fHistInvPtPtThetaPhiMC); | |
383 | ||
acb9d358 | 384 | |
385 | //correlation histos MC ESD or TPC | |
aa4776c7 | 386 | fHistInvPtMCESD = new TH2F("fHistInvPtMCESD","inv pt ESD vs MC",450, -4.5, 4.5,450, -4.5, 4.5); |
acb9d358 | 387 | fList->Add(fHistInvPtMCESD); |
aa4776c7 | 388 | fHistPtMCESD = new TH2F("fHistPtMCESD"," pt ESD vs MC",500, 0.0, 50.0,500, 0.0, 50.0); |
acb9d358 | 389 | fList->Add(fHistPtMCESD); |
aa4776c7 | 390 | fHistInvPtMCTPC = new TH2F("fHistInvPtMCTPC","inv pt TPC vs MC",450, -4.5, 4.5,450, -4.5, 4.5); |
acb9d358 | 391 | fList->Add(fHistInvPtMCTPC); |
aa4776c7 | 392 | fHistPtMCTPC = new TH2F("fHistPtMCTPC"," pt TPC vs MC",500, 0.0, 50.0,500, 0.0,50.0); |
acb9d358 | 393 | fList->Add(fHistPtMCTPC); |
aa4776c7 | 394 | fHistMomresMCESD = new TH2F("fHistMomresMCESD"," (pt ESD - pt MC)/ptMC vs pt MC",500, 0.0, 50.0,200, -2.0, 2.0); |
395 | fList->Add(fHistMomresMCESD); | |
396 | fHistMomresMCTPC = new TH2F("fHistMomresMCTPC"," (pt TPC - pt MC)/ptMC vs pt MC",500, 0.0, 50.0,200, -2.0, 2.0); | |
acb9d358 | 397 | fList->Add(fHistMomresMCTPC); |
398 | ||
399 | ||
400 | //user pt shift check | |
401 | fHistUserPtShift = new TH1F("fHistUserPtShift","user defined shift in 1/pt",100,-0.5,1.5); | |
402 | fList->Add(fHistUserPtShift); | |
403 | ||
404 | // esd track cuts | |
aa4776c7 | 405 | fESDTrackCuts =NULL; |
4060dd2d | 406 | |
acb9d358 | 407 | |
408 | } | |
409 | ||
410 | //________________________________________________________________________ | |
ba06aaec | 411 | void AliPerformancePtCalibMC::SetPtShift(const Double_t shiftVal ) { |
412 | ||
413 | //set user defined shift in charge/pt | |
414 | ||
415 | if(shiftVal) { fShift=kTRUE; fDeltaInvP = shiftVal; } | |
acb9d358 | 416 | } |
417 | ||
418 | //________________________________________________________________________ | |
4060dd2d | 419 | void AliPerformancePtCalibMC::Exec(AliMCEvent* const mcEvent, AliESDEvent *const esdEvent, AliESDfriend *const /*esdFriend*/, const Bool_t /*bUseMC*/, const Bool_t /*bUseESDfriend*/) |
acb9d358 | 420 | { |
ba06aaec | 421 | //exec: read MC and esd or tpc tracks |
422 | ||
4060dd2d | 423 | AliStack* stack = NULL; |
acb9d358 | 424 | |
ba06aaec | 425 | if (!esdEvent) { |
426 | Printf("ERROR: Event not available"); | |
427 | return; | |
428 | } | |
429 | ||
aa4776c7 | 430 | |
ba06aaec | 431 | fHistTrackMultiplicity->Fill(esdEvent->GetNumberOfTracks()); |
432 | ||
433 | if (!mcEvent) { | |
434 | Printf("ERROR: Could not retrieve MC event"); | |
435 | return; | |
436 | } | |
437 | stack = mcEvent->Stack(); | |
438 | if (!stack) { | |
439 | Printf("ERROR: Could not retrieve stack"); | |
440 | return; | |
441 | } | |
442 | ||
4060dd2d | 443 | |
4060dd2d | 444 | //vertex info for cut |
41fefc69 | 445 | //const AliESDVertex *vtx = esdEvent->GetPrimaryVertex(); |
446 | //if (!vtx->GetStatus()) return ; | |
447 | ||
ba06aaec | 448 | if(fShift) fHistUserPtShift->Fill(fDeltaInvP); |
acb9d358 | 449 | |
ba06aaec | 450 | // read primary vertex info |
451 | Double_t tPrimaryVtxPosition[3]; | |
452 | // Double_t tPrimaryVtxCov[3]; | |
453 | const AliESDVertex *primaryVtx = esdEvent->GetPrimaryVertexTPC(); | |
acb9d358 | 454 | |
ba06aaec | 455 | tPrimaryVtxPosition[0] = primaryVtx->GetXv(); |
456 | tPrimaryVtxPosition[1] = primaryVtx->GetYv(); | |
457 | tPrimaryVtxPosition[2] = primaryVtx->GetZv(); | |
acb9d358 | 458 | |
ba06aaec | 459 | fHistPrimaryVertexPosX->Fill(tPrimaryVtxPosition[0]); |
460 | fHistPrimaryVertexPosY->Fill(tPrimaryVtxPosition[1]); | |
461 | fHistPrimaryVertexPosZ->Fill(tPrimaryVtxPosition[2]); | |
acb9d358 | 462 | |
463 | ||
ba06aaec | 464 | //fill histos for pt spectra and shift of transverse momentum |
465 | Int_t count=0; | |
acb9d358 | 466 | |
ba06aaec | 467 | for(Int_t j = 0;j<esdEvent->GetNumberOfTracks();j++){ |
468 | AliESDtrack *esdTrack = esdEvent->GetTrack(j); | |
469 | if(!esdTrack) continue; | |
acb9d358 | 470 | |
471 | //esd track cuts | |
4060dd2d | 472 | if(fESDcuts){ |
ba06aaec | 473 | if(!fESDTrackCuts->AcceptTrack(esdTrack)) continue; |
474 | } | |
4060dd2d | 475 | |
ba06aaec | 476 | // get MC info |
477 | Int_t esdLabel = esdTrack->GetLabel(); | |
478 | if(esdLabel<0) continue; | |
479 | TParticle * partMC = stack->Particle(esdLabel); | |
480 | if (!partMC) continue; | |
acb9d358 | 481 | |
ba06aaec | 482 | // fill correlation histos MC ESD |
483 | Double_t pESD = esdTrack->GetP(); | |
484 | Double_t ptESD = esdTrack->GetSignedPt(); | |
acb9d358 | 485 | |
ba06aaec | 486 | if(!ptESD || !(partMC->Pt()) ) continue; |
487 | Double_t mcPt = partMC->Pt(); | |
488 | Double_t invPtMC = 1.0/mcPt; | |
489 | Int_t signMC = partMC->GetPdgCode(); | |
490 | //MC only | |
491 | if(signMC>0) signMC = 1; | |
492 | else signMC = -1; | |
493 | ||
4060dd2d | 494 | //fill MC information |
495 | Double_t thetaMC = partMC->Theta(); | |
496 | Double_t phiMC = partMC->Phi(); | |
497 | ||
498 | Double_t momAngMC[4] = {signMC*(fabs(invPtMC)),signMC*(fabs(mcPt)),thetaMC,phiMC}; | |
499 | ||
500 | // fill only if MC track is in eta acceptance of TPC in order to be compareable to TPC tracks | |
aa4776c7 | 501 | if(fabs( partMC->Eta())< fEtaAcceptance) { |
4060dd2d | 502 | fHistInvPtPtThetaPhiMC->Fill(momAngMC); |
503 | ||
504 | //correlation histos MC ESD | |
aa4776c7 | 505 | fHistInvPtMCESD->Fill(signMC*(fabs(invPtMC)),1.0/ptESD); |
4060dd2d | 506 | fHistPtMCESD->Fill(fabs(mcPt),fabs(ptESD)); |
507 | } | |
aa4776c7 | 508 | |
4060dd2d | 509 | // fill histos TPC or ESD |
ba06aaec | 510 | if(fOptTPC){ |
511 | //TPC tracks and MC tracks | |
512 | const AliExternalTrackParam *tpcTrack = esdTrack->GetTPCInnerParam(); | |
513 | if(!tpcTrack) continue; | |
aa4776c7 | 514 | if(fabs(tpcTrack->Eta())>= fEtaAcceptance) continue; |
acb9d358 | 515 | |
ba06aaec | 516 | Double_t signedPt = tpcTrack->GetSignedPt(); |
517 | Double_t invPt = 0.0; | |
518 | if(signedPt) { | |
519 | invPt = 1.0/signedPt; | |
acb9d358 | 520 | |
4060dd2d | 521 | fHistPtShift0->Fill(signedPt);//changed |
acb9d358 | 522 | |
4060dd2d | 523 | if(fShift){Printf("user shift of momentum SET to non zero value!"); |
ba06aaec | 524 | invPt += fDeltaInvP; //shift momentum for tests |
525 | if(invPt) signedPt = 1.0/invPt; | |
526 | else continue; | |
527 | } | |
acb9d358 | 528 | |
acb9d358 | 529 | |
aa4776c7 | 530 | Double_t theta = tpcTrack->Theta(); |
531 | Double_t phi = tpcTrack->Phi(); | |
4060dd2d | 532 | |
533 | Double_t momAng[4] = {invPt,signedPt,theta,phi}; | |
534 | fHistInvPtPtThetaPhi->Fill(momAng); | |
acb9d358 | 535 | |
ba06aaec | 536 | //correlation histos MC TPC |
aa4776c7 | 537 | fHistInvPtMCTPC->Fill(signMC*(fabs(invPtMC)),invPt); |
ba06aaec | 538 | fHistPtMCTPC->Fill(fabs(mcPt),fabs(signedPt)); |
acb9d358 | 539 | |
ba06aaec | 540 | //compare to MC info |
541 | Double_t ptDiffESD = (fabs(ptESD)-fabs(mcPt))/pow(mcPt,2); | |
542 | Double_t ptDiffTPC = (fabs(signedPt)-fabs(mcPt))/pow(mcPt,2); | |
543 | Double_t invPtDiffESD = fabs(1.0/ptESD)-1.0/fabs(mcPt); | |
544 | Double_t invPtDiffTPC = fabs(invPt)-1.0/fabs(mcPt); | |
4060dd2d | 545 | Double_t pTPC = tpcTrack->GetP(); |
aa4776c7 | 546 | |
ba06aaec | 547 | if(esdTrack->GetSign()>0){//compare momenta ESD track and TPC track |
548 | fHistTPCMomentaPosP->Fill(fabs(pESD),fabs(pTPC)); | |
549 | fHistTPCMomentaPosPt->Fill(fabs(ptESD),fabs(signedPt)); | |
550 | fHistTPCMomentaPosInvPtMC->Fill(invPtDiffESD,invPtDiffTPC); | |
551 | fHistTPCMomentaPosPtMC->Fill(ptDiffESD,ptDiffTPC); | |
552 | } | |
553 | else{ | |
554 | fHistTPCMomentaNegP->Fill(fabs(pESD),fabs(pTPC)); | |
555 | fHistTPCMomentaNegPt->Fill(fabs(ptESD),fabs(signedPt)); | |
556 | fHistTPCMomentaNegInvPtMC->Fill(invPtDiffESD,invPtDiffTPC); | |
557 | fHistTPCMomentaNegPtMC->Fill(ptDiffESD,ptDiffTPC); | |
558 | } | |
aa4776c7 | 559 | fHistMomresMCESD->Fill(fabs(mcPt),(fabs(mcPt)-fabs(ptESD))/fabs(mcPt)); |
560 | fHistMomresMCTPC->Fill(fabs(mcPt),(fabs(mcPt)-fabs(signedPt))/fabs(mcPt)); | |
ba06aaec | 561 | count++; |
562 | } | |
563 | else continue; | |
acb9d358 | 564 | } |
acb9d358 | 565 | |
aa4776c7 | 566 | else{ |
567 | // ESD tracks and MC tracks | |
568 | if(fabs(esdTrack->Eta())>= fEtaAcceptance) continue; | |
569 | Double_t invPt = 0.0; | |
acb9d358 | 570 | |
aa4776c7 | 571 | if(ptESD) { |
572 | invPt = 1.0/ptESD; | |
573 | fHistPtShift0->Fill(ptESD); | |
acb9d358 | 574 | |
aa4776c7 | 575 | if(fShift){Printf("user shift of momentum SET to non zero value!"); |
576 | invPt += fDeltaInvP; //shift momentum for tests | |
577 | if(invPt) ptESD = 1.0/invPt; | |
578 | else continue; | |
579 | } | |
580 | ||
581 | Double_t theta = esdTrack->Theta(); | |
582 | Double_t phi = esdTrack->Phi(); | |
583 | ||
584 | Double_t momAng[4] = {invPt,ptESD,theta,phi}; | |
585 | fHistInvPtPtThetaPhi->Fill(momAng); | |
586 | ||
587 | //differences MC ESD tracks | |
588 | Double_t ptDiffESD = (fabs(ptESD)-fabs(mcPt))/pow(mcPt,2); | |
589 | Double_t invPtdiffESD = fabs(1.0/ptESD)-1.0/fabs(mcPt); | |
590 | if(esdTrack->GetSign()>0){ | |
591 | fHistESDMomentaPosInvPtMC->Fill(invPtdiffESD); | |
592 | fHistESDMomentaPosPtMC->Fill(ptDiffESD); | |
593 | } | |
594 | else{ | |
595 | fHistESDMomentaNegInvPtMC->Fill(invPtdiffESD); | |
596 | fHistESDMomentaNegPtMC->Fill(ptDiffESD); | |
597 | } | |
acb9d358 | 598 | |
aa4776c7 | 599 | fHistMomresMCESD->Fill(fabs(mcPt),(fabs(mcPt)-fabs(ptESD))/fabs(mcPt)); |
600 | count++; | |
601 | } | |
602 | } | |
603 | } | |
acb9d358 | 604 | |
aa4776c7 | 605 | fHistTrackMultiplicityCuts->Fill(count); |
acb9d358 | 606 | |
607 | } | |
608 | ||
acb9d358 | 609 | //______________________________________________________________________________________________________________________ |
610 | ||
611 | void AliPerformancePtCalibMC::Analyse() | |
612 | { | |
613 | ||
ba06aaec | 614 | // analyse charge/pt spectra in bins of theta and phi. Bins can be set by user |
615 | ||
4060dd2d | 616 | |
617 | THnSparseF *copyTHnSparseTheta; | |
618 | THnSparseF *copyTHnSparsePhi; | |
619 | ||
620 | if(fAnaMC){ | |
621 | Printf("AliPerformancePtCalibMC::Analyse: analysing MC!"); | |
622 | copyTHnSparseTheta = (THnSparseF*)fHistInvPtPtThetaPhiMC->Clone("copyTHnSparseThetaMC"); | |
623 | copyTHnSparsePhi = (THnSparseF*)fHistInvPtPtThetaPhiMC->Clone("copyTHnSparsePhiMC"); | |
624 | } | |
625 | else { | |
626 | Printf("AliPerformancePtCalibMC::Analyse: analysing ESD (reco)!"); | |
627 | copyTHnSparseTheta = (THnSparseF*)fHistInvPtPtThetaPhi->Clone("copyTHnSparseTheta"); | |
628 | copyTHnSparsePhi = (THnSparseF*)fHistInvPtPtThetaPhi->Clone("copyTHnSparsePhi"); | |
629 | } | |
630 | ||
631 | copyTHnSparseTheta->GetAxis(3)->SetRangeUser(fMinPhi,fMaxPhi); | |
632 | copyTHnSparsePhi->GetAxis(2)->SetRangeUser(fMinTheta,fMaxTheta); | |
633 | ||
634 | TH2F *histInvPtTheta = (TH2F*)copyTHnSparseTheta->Projection(2,0); | |
635 | TH2F *histInvPtPhi = (TH2F*)copyTHnSparsePhi->Projection(3,0); | |
636 | ||
ba06aaec | 637 | AliPerfAnalyzeInvPt *ana = new AliPerfAnalyzeInvPt("AliPerfAnalyzeInvPt","AliPerfAnalyzeInvPt"); |
acb9d358 | 638 | |
ba06aaec | 639 | TH1::AddDirectory(kFALSE); |
acb9d358 | 640 | |
ba06aaec | 641 | ana->SetProjBinsTheta(fThetaBins,fNThetaBins); |
642 | ana->SetProjBinsPhi(fPhiBins,fNPhiBins); | |
643 | ana->SetMakeFitOption(fFitGaus,fExclRange,fRange); | |
4060dd2d | 644 | if(fDoRebin) ana->SetDoRebin(fRebin); |
ba06aaec | 645 | TObjArray *aFolderObj = new TObjArray; |
4060dd2d | 646 | |
647 | ana->StartAnalysis(histInvPtTheta,histInvPtPhi, aFolderObj); | |
648 | ||
ba06aaec | 649 | // export objects to analysis folder |
650 | fAnalysisFolder = ExportToFolder(aFolderObj); | |
acb9d358 | 651 | |
ba06aaec | 652 | // delete only TObjArray |
653 | if(aFolderObj) delete aFolderObj; | |
654 | if(ana) delete ana; | |
acb9d358 | 655 | |
656 | } | |
657 | ||
658 | //______________________________________________________________________________________________________________________ | |
659 | TFolder* AliPerformancePtCalibMC::ExportToFolder(TObjArray * array) | |
660 | { | |
ba06aaec | 661 | // recreate folder avery time and export objects to new one |
662 | // | |
663 | AliPerformancePtCalibMC * comp=this; | |
664 | TFolder *folder = comp->GetAnalysisFolder(); | |
665 | ||
666 | TString name, title; | |
667 | TFolder *newFolder = 0; | |
668 | Int_t i = 0; | |
669 | Int_t size = array->GetSize(); | |
670 | ||
671 | if(folder) { | |
672 | // get name and title from old folder | |
673 | name = folder->GetName(); | |
674 | title = folder->GetTitle(); | |
675 | ||
676 | // delete old one | |
677 | delete folder; | |
678 | ||
679 | // create new one | |
680 | newFolder = CreateFolder(name.Data(),title.Data()); | |
681 | newFolder->SetOwner(); | |
682 | ||
683 | // add objects to folder | |
684 | while(i < size) { | |
685 | newFolder->Add(array->At(i)); | |
686 | i++; | |
687 | } | |
688 | } | |
689 | ||
690 | return newFolder; | |
acb9d358 | 691 | } |
692 | ||
693 | //______________________________________________________________________________________________________________________ | |
694 | Long64_t AliPerformancePtCalibMC::Merge(TCollection* const list) | |
695 | { | |
ba06aaec | 696 | // Merge list of objects (needed by PROOF) |
acb9d358 | 697 | |
ba06aaec | 698 | if (!list) |
699 | return 0; | |
acb9d358 | 700 | |
ba06aaec | 701 | if (list->IsEmpty()) |
702 | return 1; | |
acb9d358 | 703 | |
ba06aaec | 704 | TIterator* iter = list->MakeIterator(); |
705 | TObject* obj = 0; | |
acb9d358 | 706 | |
ba06aaec | 707 | // collection of generated histograms |
708 | Int_t count=0; | |
709 | while((obj = iter->Next()) != 0) | |
710 | { | |
711 | AliPerformancePtCalibMC* entry = dynamic_cast<AliPerformancePtCalibMC*>(obj); | |
712 | if (!entry) continue; | |
4060dd2d | 713 | fHistInvPtPtThetaPhi->Add(entry->fHistInvPtPtThetaPhi); |
714 | ||
715 | fHistInvPtPtThetaPhiMC->Add(entry->fHistInvPtPtThetaPhiMC); | |
716 | ||
ba06aaec | 717 | fHistInvPtMCESD->Add(entry->fHistInvPtMCESD); |
718 | fHistPtMCESD->Add(entry->fHistPtMCESD); | |
719 | fHistInvPtMCTPC->Add(entry->fHistInvPtMCTPC); | |
720 | fHistPtMCTPC->Add(entry->fHistPtMCTPC); | |
721 | fHistMomresMCESD->Add(entry->fHistMomresMCESD); | |
722 | fHistMomresMCTPC->Add(entry->fHistMomresMCTPC); | |
723 | ||
724 | fHistPtShift0->Add(entry->fHistPtShift0); | |
725 | fHistPrimaryVertexPosX->Add(entry->fHistPrimaryVertexPosX); | |
726 | fHistPrimaryVertexPosY->Add(entry->fHistPrimaryVertexPosY); | |
727 | fHistPrimaryVertexPosZ->Add(entry->fHistPrimaryVertexPosZ); | |
728 | fHistTrackMultiplicity->Add(entry->fHistTrackMultiplicity); | |
729 | fHistTrackMultiplicityCuts->Add(entry->fHistTrackMultiplicityCuts); | |
acb9d358 | 730 | |
ba06aaec | 731 | fHistTPCMomentaPosP->Add(entry->fHistTPCMomentaPosP); |
732 | fHistTPCMomentaNegP->Add(entry->fHistTPCMomentaNegP); | |
733 | fHistTPCMomentaPosPt->Add(entry->fHistTPCMomentaPosPt); | |
734 | fHistTPCMomentaNegPt->Add(entry->fHistTPCMomentaNegPt); | |
735 | fHistTPCMomentaPosInvPtMC->Add(entry->fHistTPCMomentaPosInvPtMC); | |
736 | fHistTPCMomentaNegInvPtMC->Add(entry->fHistTPCMomentaNegInvPtMC); | |
737 | fHistTPCMomentaPosPtMC->Add(entry->fHistTPCMomentaPosPtMC); | |
738 | fHistTPCMomentaNegPtMC->Add(entry->fHistTPCMomentaNegPtMC); | |
739 | fHistESDMomentaPosInvPtMC->Add(entry->fHistESDMomentaPosInvPtMC); | |
740 | fHistESDMomentaNegInvPtMC->Add(entry->fHistESDMomentaNegInvPtMC); | |
741 | fHistESDMomentaPosPtMC->Add(entry->fHistESDMomentaPosPtMC); | |
742 | fHistESDMomentaNegPtMC->Add(entry->fHistESDMomentaNegPtMC); | |
743 | count++; | |
744 | } | |
acb9d358 | 745 | |
ba06aaec | 746 | return count; |
acb9d358 | 747 | } |
748 | ||
749 | //______________________________________________________________________________________________________________________ | |
750 | TFolder* AliPerformancePtCalibMC::CreateFolder(TString name,TString title) { | |
ba06aaec | 751 | // create folder for analysed histograms |
752 | // | |
753 | TFolder *folder = 0; | |
754 | folder = new TFolder(name.Data(),title.Data()); | |
acb9d358 | 755 | |
ba06aaec | 756 | return folder; |
acb9d358 | 757 | } |
758 | ||
759 | ||
760 | // set variables for Analyse() | |
acb9d358 | 761 | //______________________________________________________________________________________________________________________ |
4060dd2d | 762 | void AliPerformancePtCalibMC::SetProjBinsPhi(const Double_t *phiBinArray,const Int_t nphBins, const Double_t minTheta, const Double_t maxTheta){ |
ba06aaec | 763 | // set phi bins for Analyse() |
4060dd2d | 764 | // set phi bins as array and set number of this array which is equal to number of bins analysed |
765 | // the last analysed bin will always be the projection from first to last bin in the array | |
ba06aaec | 766 | if(nphBins){ |
767 | fNPhiBins = nphBins; | |
acb9d358 | 768 | |
ba06aaec | 769 | for(Int_t k = 0;k<fNPhiBins;k++){ |
770 | fPhiBins[k] = phiBinArray[k]; | |
771 | } | |
4060dd2d | 772 | Printf("AliPerformancePtCalibMC::SetProjBinsPhi: number of bins in phi set to %i",fNPhiBins); |
773 | } | |
774 | else Printf("Warning AliPerformancePtCalibMC::SetProjBinsPhi: number of bins in phi NOT set!!! Default values are taken."); | |
775 | ||
776 | if(fabs(minTheta-maxTheta)<0.001){ | |
777 | Printf("AliPerformancePtCalibMC::SetProjBinsPhi: theta range for projection for projection on phi and charge/pt is too small. whole range of theta selected."); | |
778 | } | |
779 | else{ | |
780 | Printf("AliPerformancePtCalibMC::SetProjBinsPhi: theta range for projection on phi and charge/pt is selected by user: %1.3f - %1.3f rad",minTheta,maxTheta); | |
781 | fMinTheta = minTheta; | |
782 | fMaxTheta = maxTheta; | |
acb9d358 | 783 | } |
acb9d358 | 784 | } |
785 | //____________________________________________________________________________________________________________________________________________ | |
4060dd2d | 786 | void AliPerformancePtCalibMC::SetProjBinsTheta(const Double_t *thetaBinArray, const Int_t nthBins, const Double_t minPhi, const Double_t maxPhi){ |
ba06aaec | 787 | // set theta bins for Analyse() |
4060dd2d | 788 | // set theta bins as array and set number of this array which is equal to number of bins analysed |
789 | // the last analysed bin will always be the projection from first to last bin in the array | |
ba06aaec | 790 | if(nthBins){ |
791 | fNThetaBins = nthBins; | |
792 | for(Int_t k = 0;k<fNThetaBins;k++){ | |
793 | fThetaBins[k] = thetaBinArray[k]; | |
794 | } | |
4060dd2d | 795 | Printf("AliPerformancePtCalibMC::SetProjBinsTheta: number of bins in theta set to %i",fNThetaBins); |
796 | } | |
797 | else Printf("Warning AliPerformancePtCalibMC::SetProjBinsTheta: number of bins in theta NOT set!!! Default values are taken."); | |
798 | ||
799 | if(fabs(minPhi-maxPhi)<0.001){ | |
800 | Printf("AliPerformancePtCalibMC::SetProjBinsTheta: phi range for projection for projection on theta and charge/pt is too small. whole range of phi selected."); | |
801 | } | |
802 | else{ | |
803 | Printf("AliPerformancePtCalibMC::SetProjBinsTheta: phi range for projection on theta and charge/pt is selected by user: %1.3f - %1.3f rad",minPhi,maxPhi); | |
804 | fMinPhi = minPhi; | |
805 | fMaxPhi = maxPhi; | |
acb9d358 | 806 | } |
acb9d358 | 807 | } |
4060dd2d | 808 | |
acb9d358 | 809 | //____________________________________________________________________________________________________________________________________________ |
810 | void AliPerformancePtCalibMC::SetMakeFitOption(const Bool_t setGausFit, const Double_t exclusionR,const Double_t fitR ){ | |
811 | ||
4060dd2d | 812 | // set the fit options: |
813 | // for usage of gaussian function instead of polynomial (default) set setGausFit=kTRUE | |
814 | // set the range of rejection of points around 0 via exclusionR | |
815 | // set the fit range around 0 with fitR | |
acb9d358 | 816 | |
817 | fFitGaus = setGausFit; | |
818 | fExclRange = exclusionR; | |
819 | fRange = fitR; | |
820 | ||
4060dd2d | 821 | if(fFitGaus) Printf("AliPerformancePtCalibMC::SetMakeFitOption: set MakeGausFit with fit range %2.3f and exclusion range in fabs(1/pt): %2.3f",fRange,fExclRange); |
822 | else Printf("AliPerformancePtCalibMC::SetMakeFitOption: set standard polynomial fit with fit range %2.3f and exclusion range in fabs(1/pt): %2.3f",fRange,fExclRange); | |
acb9d358 | 823 | |
824 | } |