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