]>
Commit | Line | Data |
---|---|---|
e5c5c33f | 1 | const Int_t numberOfCentralityBins = 12; |
41f2bc59 | 2 | //TString centralityArray[numberOfCentralityBins] = {"0-4","4-5","6-14","30-40","40-50","50-60","60-70","70-80","0-100","0-1","1-2","2-3"}; |
09b14834 | 3 | TString centralityArray[numberOfCentralityBins] = {"0-100","10-20","20-30","30-40","40-50","50-60","60-70","70-80","0-100","0-1","1-2","2-3"}; |
a38fd7f3 | 4 | |
5 | const Int_t gRebin = 1; | |
07d0a35c | 6 | |
2b4abbc5 | 7 | void drawCorrelationFunctionPsi(const char* filename = "AnalysisResultsPsi_train_06feb.root", |
52daf7b2 | 8 | Int_t gCentrality = 1, |
5de9ad1a | 9 | Int_t gBit = -1, |
10 | const char* gCentralityEstimator = 0x0, | |
52daf7b2 | 11 | Bool_t kShowShuffled = kFALSE, |
12 | Bool_t kShowMixed = kTRUE, | |
6acdbcb2 | 13 | Double_t psiMin = -0.5, |
5de9ad1a | 14 | Double_t psiMax = 3.5, |
20006629 | 15 | Double_t vertexZMin = -10., |
16 | Double_t vertexZMax = 10., | |
6acdbcb2 | 17 | Double_t ptTriggerMin = -1., |
18 | Double_t ptTriggerMax = -1., | |
19 | Double_t ptAssociatedMin = -1., | |
742af4bd | 20 | Double_t ptAssociatedMax = -1., |
2b4abbc5 | 21 | Bool_t normToTrig = kTRUE, |
20006629 | 22 | Bool_t kUseVzBinning = kTRUE, |
742af4bd | 23 | Int_t rebinEta = 1, |
32e94079 | 24 | Int_t rebinPhi = 1, |
25 | TString eventClass = "EventPlane") //Can be "EventPlane", "Centrality", "Multiplicity" | |
26 | { | |
a38fd7f3 | 27 | //Macro that draws the correlation functions from the balance function |
28 | //analysis vs the reaction plane | |
29 | //Author: Panos.Christakoglou@nikhef.nl | |
2b4abbc5 | 30 | //gROOT->LoadMacro("~/SetPlotStyle.C"); |
31 | //SetPlotStyle(); | |
52daf7b2 | 32 | gStyle->SetPalette(1,0); |
33 | ||
a38fd7f3 | 34 | //Load the PWG2ebye library |
2b4abbc5 | 35 | gSystem->Load("libCore.so"); |
36 | gSystem->Load("libGeom.so"); | |
37 | gSystem->Load("libVMC.so"); | |
38 | gSystem->Load("libPhysics.so"); | |
39 | gSystem->Load("libTree.so"); | |
40 | gSystem->Load("libSTEERBase.so"); | |
41 | gSystem->Load("libESD.so"); | |
42 | gSystem->Load("libAOD.so"); | |
43 | ||
a38fd7f3 | 44 | gSystem->Load("libANALYSIS.so"); |
45 | gSystem->Load("libANALYSISalice.so"); | |
46 | gSystem->Load("libEventMixing.so"); | |
47 | gSystem->Load("libCORRFW.so"); | |
48 | gSystem->Load("libPWGTools.so"); | |
49 | gSystem->Load("libPWGCFebye.so"); | |
50 | ||
51 | //Prepare the objects and return them | |
3ce45c12 | 52 | TList *listQA = NULL; |
5de9ad1a | 53 | TList *list = GetListOfObjects(filename,gCentrality,gBit,gCentralityEstimator,0); |
52daf7b2 | 54 | TList *listShuffled = NULL; |
5de9ad1a | 55 | if(kShowShuffled) listShuffled = GetListOfObjects(filename,gCentrality,gBit,gCentralityEstimator,1); |
52daf7b2 | 56 | TList *listMixed = NULL; |
5de9ad1a | 57 | if(kShowMixed) listMixed = GetListOfObjects(filename,gCentrality,gBit,gCentralityEstimator,2); |
52daf7b2 | 58 | |
3ce45c12 | 59 | // else get the QA histograms (for convolution) |
60 | else{ | |
61 | //Open the file again | |
62 | TFile *f = TFile::Open(filename,"UPDATE"); | |
63 | if((!f)||(!f->IsOpen())) { | |
64 | Printf("The file %s is not found.",filename); | |
65 | } | |
66 | ||
2b4abbc5 | 67 | |
3ce45c12 | 68 | TDirectoryFile *dir = dynamic_cast<TDirectoryFile *>(f->Get("PWGCFEbyE.outputBalanceFunctionPsiAnalysis")); |
69 | if(!dir) { | |
70 | Printf("The TDirectoryFile is not found.",filename); | |
71 | } | |
72 | ||
73 | TString listQAName = "listQAPsi_"; | |
74 | ||
75 | listQAName += centralityArray[gCentrality-1]; | |
76 | if(gBit > -1) { | |
77 | listQAName += "_Bit"; listQAName += gBit; } | |
78 | if(gCentralityEstimator) { | |
79 | listQAName += "_"; listQAName += gCentralityEstimator;} | |
80 | ||
81 | listQA = (TList*)dir->Get(Form("%s",listQAName.Data())); | |
82 | if(!listQA) { | |
83 | Printf("TList QA not found!!!"); | |
84 | } | |
85 | } | |
86 | ||
a38fd7f3 | 87 | if(!list) { |
88 | Printf("The TList object was not created"); | |
89 | return; | |
90 | } | |
91 | else | |
3ce45c12 | 92 | draw(list,listShuffled,listMixed,listQA, |
20006629 | 93 | gCentralityEstimator,gCentrality,psiMin,psiMax,vertexZMin,vertexZMax, |
94 | ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax,normToTrig,kUseVzBinning,rebinEta,rebinPhi,eventClass); | |
a38fd7f3 | 95 | } |
96 | ||
97 | //______________________________________________________// | |
52daf7b2 | 98 | TList *GetListOfObjects(const char* filename, |
99 | Int_t gCentrality, | |
5de9ad1a | 100 | Int_t gBit, |
101 | const char *gCentralityEstimator, | |
52daf7b2 | 102 | Int_t kData = 1) { |
a38fd7f3 | 103 | //Get the TList objects (QA, bf, bf shuffled) |
a38fd7f3 | 104 | TList *listBF = 0x0; |
a38fd7f3 | 105 | |
106 | //Open the file | |
ff0805a7 | 107 | TFile *f = TFile::Open(filename,"UPDATE"); |
a38fd7f3 | 108 | if((!f)||(!f->IsOpen())) { |
109 | Printf("The file %s is not found. Aborting...",filename); | |
110 | return listBF; | |
111 | } | |
112 | //f->ls(); | |
113 | ||
6acdbcb2 | 114 | TDirectoryFile *dir = dynamic_cast<TDirectoryFile *>(f->Get("PWGCFEbyE.outputBalanceFunctionPsiAnalysis")); |
a38fd7f3 | 115 | if(!dir) { |
116 | Printf("The TDirectoryFile is not found. Aborting...",filename); | |
117 | return listBF; | |
118 | } | |
119 | //dir->ls(); | |
2b4abbc5 | 120 | |
52daf7b2 | 121 | TString listBFName; |
122 | if(kData == 0) { | |
123 | //cout<<"no shuffling - no mixing"<<endl; | |
124 | listBFName = "listBFPsi_"; | |
125 | } | |
126 | else if(kData == 1) { | |
127 | //cout<<"shuffling - no mixing"<<endl; | |
128 | listBFName = "listBFPsiShuffled_"; | |
129 | } | |
130 | else if(kData == 2) { | |
131 | //cout<<"no shuffling - mixing"<<endl; | |
132 | listBFName = "listBFPsiMixed_"; | |
133 | } | |
134 | listBFName += centralityArray[gCentrality-1]; | |
5de9ad1a | 135 | if(gBit > -1) { |
136 | listBFName += "_Bit"; listBFName += gBit; } | |
137 | if(gCentralityEstimator) { | |
138 | listBFName += "_"; listBFName += gCentralityEstimator;} | |
a38fd7f3 | 139 | |
5365d1d7 | 140 | // histograms were already retrieved (in first iteration) |
141 | if(dir->Get(Form("%s_histograms",listBFName.Data()))){ | |
142 | listBF = dynamic_cast<TList *>(dir->Get(Form("%s_histograms",listBFName.Data()))); | |
a38fd7f3 | 143 | } |
a38fd7f3 | 144 | |
5365d1d7 | 145 | // histograms were not yet retrieved (this is the first iteration) |
146 | else{ | |
147 | ||
148 | listBF = dynamic_cast<TList *>(dir->Get(listBFName.Data())); | |
149 | cout<<"======================================================="<<endl; | |
32e94079 | 150 | cout<<"List name (control): "<<listBFName.Data()<<endl; |
17d10bdd | 151 | cout<<"List name: "<<listBF->GetName()<<endl; |
5365d1d7 | 152 | //listBF->ls(); |
a38fd7f3 | 153 | |
5365d1d7 | 154 | //Get the histograms |
155 | TString histoName; | |
17d10bdd | 156 | if(kData == 0) |
157 | histoName = "fHistP"; | |
5365d1d7 | 158 | else if(kData == 1) |
17d10bdd | 159 | histoName = "fHistP_shuffle"; |
5365d1d7 | 160 | else if(kData == 2) |
17d10bdd | 161 | histoName = "fHistP"; |
162 | if(gCentralityEstimator) | |
163 | histoName += gCentralityEstimator; | |
5365d1d7 | 164 | AliTHn *fHistP = dynamic_cast<AliTHn *>(listBF->FindObject(histoName.Data())); |
165 | if(!fHistP) { | |
166 | Printf("fHistP %s not found!!!",histoName.Data()); | |
167 | break; | |
168 | } | |
169 | fHistP->FillParent(); fHistP->DeleteContainers(); | |
170 | ||
171 | if(kData == 0) | |
17d10bdd | 172 | histoName = "fHistN"; |
5365d1d7 | 173 | if(kData == 1) |
17d10bdd | 174 | histoName = "fHistN_shuffle"; |
5365d1d7 | 175 | if(kData == 2) |
17d10bdd | 176 | histoName = "fHistN"; |
177 | if(gCentralityEstimator) | |
178 | histoName += gCentralityEstimator; | |
5365d1d7 | 179 | AliTHn *fHistN = dynamic_cast<AliTHn *>(listBF->FindObject(histoName.Data())); |
180 | if(!fHistN) { | |
181 | Printf("fHistN %s not found!!!",histoName.Data()); | |
182 | break; | |
183 | } | |
184 | fHistN->FillParent(); fHistN->DeleteContainers(); | |
185 | ||
186 | if(kData == 0) | |
17d10bdd | 187 | histoName = "fHistPN"; |
5365d1d7 | 188 | if(kData == 1) |
17d10bdd | 189 | histoName = "fHistPN_shuffle"; |
5365d1d7 | 190 | if(kData == 2) |
17d10bdd | 191 | histoName = "fHistPN"; |
192 | if(gCentralityEstimator) | |
193 | histoName += gCentralityEstimator; | |
5365d1d7 | 194 | AliTHn *fHistPN = dynamic_cast<AliTHn *>(listBF->FindObject(histoName.Data())); |
195 | if(!fHistPN) { | |
196 | Printf("fHistPN %s not found!!!",histoName.Data()); | |
197 | break; | |
198 | } | |
199 | fHistPN->FillParent(); fHistPN->DeleteContainers(); | |
200 | ||
201 | if(kData == 0) | |
17d10bdd | 202 | histoName = "fHistNP"; |
5365d1d7 | 203 | if(kData == 1) |
17d10bdd | 204 | histoName = "fHistNP_shuffle"; |
5365d1d7 | 205 | if(kData == 2) |
17d10bdd | 206 | histoName = "fHistNP"; |
207 | if(gCentralityEstimator) | |
208 | histoName += gCentralityEstimator; | |
5365d1d7 | 209 | AliTHn *fHistNP = dynamic_cast<AliTHn *>(listBF->FindObject(histoName.Data())); |
210 | if(!fHistNP) { | |
211 | Printf("fHistNP %s not found!!!",histoName.Data()); | |
212 | break; | |
213 | } | |
214 | fHistNP->FillParent(); fHistNP->DeleteContainers(); | |
215 | ||
216 | if(kData == 0) | |
17d10bdd | 217 | histoName = "fHistPP"; |
5365d1d7 | 218 | if(kData == 1) |
17d10bdd | 219 | histoName = "fHistPP_shuffle"; |
5365d1d7 | 220 | if(kData == 2) |
17d10bdd | 221 | histoName = "fHistPP"; |
222 | if(gCentralityEstimator) | |
223 | histoName += gCentralityEstimator; | |
5365d1d7 | 224 | AliTHn *fHistPP = dynamic_cast<AliTHn *>(listBF->FindObject(histoName.Data())); |
225 | if(!fHistPP) { | |
226 | Printf("fHistPP %s not found!!!",histoName.Data()); | |
227 | break; | |
228 | } | |
229 | fHistPP->FillParent(); fHistPP->DeleteContainers(); | |
230 | ||
231 | if(kData == 0) | |
17d10bdd | 232 | histoName = "fHistNN"; |
5365d1d7 | 233 | if(kData == 1) |
17d10bdd | 234 | histoName = "fHistNN_shuffle"; |
5365d1d7 | 235 | if(kData == 2) |
17d10bdd | 236 | histoName = "fHistNN"; |
237 | if(gCentralityEstimator) | |
238 | histoName += gCentralityEstimator; | |
5365d1d7 | 239 | AliTHn *fHistNN = dynamic_cast<AliTHn *>(listBF->FindObject(histoName.Data())); |
240 | if(!fHistNN) { | |
241 | Printf("fHistNN %s not found!!!",histoName.Data()); | |
242 | break; | |
243 | } | |
244 | fHistNN->FillParent(); fHistNN->DeleteContainers(); | |
17d10bdd | 245 | |
5365d1d7 | 246 | dir->cd(); |
247 | listBF->Write(Form("%s_histograms",listBFName.Data()), TObject::kSingleKey); | |
248 | ||
249 | }// first iteration | |
a38fd7f3 | 250 | |
ff0805a7 | 251 | f->Close(); |
5365d1d7 | 252 | |
a38fd7f3 | 253 | return listBF; |
254 | } | |
255 | ||
256 | //______________________________________________________// | |
20006629 | 257 | void draw(TList *list, TList *listBFShuffled, TList *listBFMixed, |
258 | TList *listQA, | |
17d10bdd | 259 | const char *gCentralityEstimator, |
20006629 | 260 | Int_t gCentrality, Double_t psiMin, Double_t psiMax, |
261 | Double_t vertexZMin,Double_t vertexZMax, | |
6acdbcb2 | 262 | Double_t ptTriggerMin, Double_t ptTriggerMax, |
742af4bd | 263 | Double_t ptAssociatedMin, Double_t ptAssociatedMax, |
20006629 | 264 | Bool_t normToTrig, |
265 | Bool_t kUseVzBinning, | |
266 | Int_t rebinEta, Int_t rebinPhi,TString eventClass) { | |
a38fd7f3 | 267 | //Draws the correlation functions for every centrality bin |
52daf7b2 | 268 | //(+-), (-+), (++), (--) |
a38fd7f3 | 269 | AliTHn *hP = NULL; |
270 | AliTHn *hN = NULL; | |
271 | AliTHn *hPN = NULL; | |
272 | AliTHn *hNP = NULL; | |
273 | AliTHn *hPP = NULL; | |
274 | AliTHn *hNN = NULL; | |
275 | ||
17d10bdd | 276 | TString gHistPname = "fHistP"; |
277 | if(gCentralityEstimator) gHistPname += gCentralityEstimator; | |
278 | TString gHistNname = "fHistN"; | |
279 | if(gCentralityEstimator) gHistNname += gCentralityEstimator; | |
280 | TString gHistPNname = "fHistPN"; | |
281 | if(gCentralityEstimator) gHistPNname += gCentralityEstimator; | |
282 | TString gHistNPname = "fHistNP"; | |
283 | if(gCentralityEstimator) gHistNPname += gCentralityEstimator; | |
284 | TString gHistPPname = "fHistPP"; | |
285 | if(gCentralityEstimator) gHistPPname += gCentralityEstimator; | |
286 | TString gHistNNname = "fHistNN"; | |
287 | if(gCentralityEstimator) gHistNNname += gCentralityEstimator; | |
288 | ||
289 | hP = (AliTHn*) list->FindObject(gHistPname.Data()); | |
290 | hN = (AliTHn*) list->FindObject(gHistNname.Data()); | |
291 | hPN = (AliTHn*) list->FindObject(gHistPNname.Data()); | |
292 | hNP = (AliTHn*) list->FindObject(gHistNPname.Data()); | |
293 | hPP = (AliTHn*) list->FindObject(gHistPPname.Data()); | |
294 | hNN = (AliTHn*) list->FindObject(gHistNNname.Data()); | |
32e94079 | 295 | hNN->Print(); |
296 | ||
a38fd7f3 | 297 | |
298 | //Create the AliBalancePsi object and fill it with the AliTHn objects | |
299 | AliBalancePsi *b = new AliBalancePsi(); | |
32e94079 | 300 | b->SetEventClass(eventClass); |
a38fd7f3 | 301 | b->SetHistNp(hP); |
302 | b->SetHistNn(hN); | |
303 | b->SetHistNpn(hPN); | |
304 | b->SetHistNnp(hNP); | |
305 | b->SetHistNpp(hPP); | |
306 | b->SetHistNnn(hNN); | |
20006629 | 307 | if(kUseVzBinning) b->SetVertexZBinning(kTRUE); |
52daf7b2 | 308 | |
309 | //balance function shuffling | |
310 | AliTHn *hPShuffled = NULL; | |
311 | AliTHn *hNShuffled = NULL; | |
312 | AliTHn *hPNShuffled = NULL; | |
313 | AliTHn *hNPShuffled = NULL; | |
314 | AliTHn *hPPShuffled = NULL; | |
315 | AliTHn *hNNShuffled = NULL; | |
316 | if(listBFShuffled) { | |
317 | //listBFShuffled->ls(); | |
318 | ||
17d10bdd | 319 | gHistPname = "fHistP_shuffle"; |
320 | if(gCentralityEstimator) gHistPname += gCentralityEstimator; | |
321 | gHistNname = "fHistN_shuffle"; | |
322 | if(gCentralityEstimator) gHistNname += gCentralityEstimator; | |
323 | gHistPNname = "fHistPN_shuffle"; | |
324 | if(gCentralityEstimator) gHistPNname += gCentralityEstimator; | |
325 | gHistNPname = "fHistNP_shuffle"; | |
326 | if(gCentralityEstimator) gHistNPname += gCentralityEstimator; | |
327 | gHistPPname = "fHistPP_shuffle"; | |
328 | if(gCentralityEstimator) gHistPPname += gCentralityEstimator; | |
329 | gHistNNname = "fHistNN_shuffle"; | |
330 | if(gCentralityEstimator) gHistNNname += gCentralityEstimator; | |
331 | ||
332 | hPShuffled = (AliTHn*) listBFShuffled->FindObject(gHistPname.Data()); | |
52daf7b2 | 333 | hPShuffled->SetName("gHistPShuffled"); |
17d10bdd | 334 | hNShuffled = (AliTHn*) listBFShuffled->FindObject(gHistNname.Data()); |
52daf7b2 | 335 | hNShuffled->SetName("gHistNShuffled"); |
17d10bdd | 336 | hPNShuffled = (AliTHn*) listBFShuffled->FindObject(gHistPNname.Data()); |
52daf7b2 | 337 | hPNShuffled->SetName("gHistPNShuffled"); |
17d10bdd | 338 | hNPShuffled = (AliTHn*) listBFShuffled->FindObject(gHistNPname.Data()); |
52daf7b2 | 339 | hNPShuffled->SetName("gHistNPShuffled"); |
17d10bdd | 340 | hPPShuffled = (AliTHn*) listBFShuffled->FindObject(gHistPPname.Data()); |
52daf7b2 | 341 | hPPShuffled->SetName("gHistPPShuffled"); |
17d10bdd | 342 | hNNShuffled = (AliTHn*) listBFShuffled->FindObject(gHistNNname.Data()); |
52daf7b2 | 343 | hNNShuffled->SetName("gHistNNShuffled"); |
344 | ||
345 | AliBalancePsi *bShuffled = new AliBalancePsi(); | |
32e94079 | 346 | bShuffled->SetEventClass(eventClass); |
52daf7b2 | 347 | bShuffled->SetHistNp(hPShuffled); |
348 | bShuffled->SetHistNn(hNShuffled); | |
349 | bShuffled->SetHistNpn(hPNShuffled); | |
350 | bShuffled->SetHistNnp(hNPShuffled); | |
351 | bShuffled->SetHistNpp(hPPShuffled); | |
352 | bShuffled->SetHistNnn(hNNShuffled); | |
20006629 | 353 | if(kUseVzBinning) bShuffled->SetVertexZBinning(kTRUE); |
52daf7b2 | 354 | } |
355 | ||
356 | //balance function mixing | |
357 | AliTHn *hPMixed = NULL; | |
358 | AliTHn *hNMixed = NULL; | |
359 | AliTHn *hPNMixed = NULL; | |
360 | AliTHn *hNPMixed = NULL; | |
361 | AliTHn *hPPMixed = NULL; | |
362 | AliTHn *hNNMixed = NULL; | |
363 | ||
364 | if(listBFMixed) { | |
365 | //listBFMixed->ls(); | |
366 | ||
17d10bdd | 367 | gHistPname = "fHistP"; |
368 | if(gCentralityEstimator) gHistPname += gCentralityEstimator; | |
369 | gHistNname = "fHistN"; | |
370 | if(gCentralityEstimator) gHistNname += gCentralityEstimator; | |
371 | gHistPNname = "fHistPN"; | |
372 | if(gCentralityEstimator) gHistPNname += gCentralityEstimator; | |
373 | gHistNPname = "fHistNP"; | |
374 | if(gCentralityEstimator) gHistNPname += gCentralityEstimator; | |
375 | gHistPPname = "fHistPP"; | |
376 | if(gCentralityEstimator) gHistPPname += gCentralityEstimator; | |
377 | gHistNNname = "fHistNN"; | |
378 | if(gCentralityEstimator) gHistNNname += gCentralityEstimator; | |
379 | hPMixed = (AliTHn*) listBFMixed->FindObject(gHistPname.Data()); | |
52daf7b2 | 380 | hPMixed->SetName("gHistPMixed"); |
17d10bdd | 381 | hNMixed = (AliTHn*) listBFMixed->FindObject(gHistNname.Data()); |
52daf7b2 | 382 | hNMixed->SetName("gHistNMixed"); |
17d10bdd | 383 | hPNMixed = (AliTHn*) listBFMixed->FindObject(gHistPNname.Data()); |
52daf7b2 | 384 | hPNMixed->SetName("gHistPNMixed"); |
17d10bdd | 385 | hNPMixed = (AliTHn*) listBFMixed->FindObject(gHistNPname.Data()); |
52daf7b2 | 386 | hNPMixed->SetName("gHistNPMixed"); |
17d10bdd | 387 | hPPMixed = (AliTHn*) listBFMixed->FindObject(gHistPPname.Data()); |
52daf7b2 | 388 | hPPMixed->SetName("gHistPPMixed"); |
17d10bdd | 389 | hNNMixed = (AliTHn*) listBFMixed->FindObject(gHistNNname.Data()); |
52daf7b2 | 390 | hNNMixed->SetName("gHistNNMixed"); |
391 | ||
392 | AliBalancePsi *bMixed = new AliBalancePsi(); | |
32e94079 | 393 | bMixed->SetEventClass(eventClass); |
52daf7b2 | 394 | bMixed->SetHistNp(hPMixed); |
395 | bMixed->SetHistNn(hNMixed); | |
396 | bMixed->SetHistNpn(hPNMixed); | |
397 | bMixed->SetHistNnp(hNPMixed); | |
398 | bMixed->SetHistNpp(hPPMixed); | |
399 | bMixed->SetHistNnn(hNNMixed); | |
20006629 | 400 | if(kUseVzBinning) bMixed->SetVertexZBinning(kTRUE); |
52daf7b2 | 401 | } |
402 | ||
3ce45c12 | 403 | |
77b9ff18 | 404 | TH2D *gHistPN[4]; |
405 | TH2D *gHistNP[4]; | |
406 | TH2D *gHistPP[4]; | |
407 | TH2D *gHistNN[4]; | |
a38fd7f3 | 408 | |
77b9ff18 | 409 | TCanvas *cPN[4]; |
410 | TCanvas *cNP[4]; | |
411 | TCanvas *cPP[4]; | |
412 | TCanvas *cNN[4]; | |
a38fd7f3 | 413 | TString histoTitle, pngName; |
3ce45c12 | 414 | |
415 | // if no mixing then divide by convoluted histograms | |
416 | if(!listBFMixed && listQA){ | |
3ce45c12 | 417 | |
e5c5c33f | 418 | if(!listQA->FindObject("fHistEtaPhiPos") || !listQA->FindObject("fHistEtaPhiNeg")){ |
3ce45c12 | 419 | |
e5c5c33f | 420 | Printf("fHistEtaPhiPos or fHistEtaPhiNeg not found! --> no convolution"); |
421 | listQA = NULL; | |
3ce45c12 | 422 | |
e5c5c33f | 423 | } |
424 | else{ | |
3ce45c12 | 425 | |
e5c5c33f | 426 | TH2D* fHistPos = (TH2D*)((TH3D*)listQA->FindObject("fHistEtaPhiPos"))->Project3D("xy"); |
427 | fHistPos->GetYaxis()->SetRangeUser(-0.79,0.79); | |
e5c5c33f | 428 | |
429 | TH2D* fHistNeg = (TH2D*)((TH3D*)listQA->FindObject("fHistEtaPhiNeg"))->Project3D("xy"); | |
430 | fHistNeg->GetYaxis()->SetRangeUser(-0.79,0.79); | |
e5c5c33f | 431 | |
432 | gHistPN[2] = convolute2D(fHistPos, fHistNeg, "hConvPN"); | |
433 | gHistPN[2]->Scale(1./gHistPN[2]->GetBinContent(gHistPN[2]->FindBin(0,0))); | |
434 | ||
435 | gHistNP[2] = convolute2D(fHistNeg, fHistPos, "hConvNP"); | |
436 | gHistNP[2]->Scale(1./gHistNP[2]->GetBinContent(gHistNP[2]->FindBin(0,0))); | |
437 | ||
438 | gHistNN[2] = convolute2D(fHistNeg, fHistNeg, "hConvNN"); | |
439 | gHistNN[2]->Scale(1./gHistNN[2]->GetBinContent(gHistNN[2]->FindBin(0,0))); | |
440 | ||
441 | gHistPP[2] = convolute2D(fHistPos, fHistPos, "hConvPP"); | |
442 | gHistPP[2]->Scale(1./gHistPP[2]->GetBinContent(gHistPP[2]->FindBin(0,0))); | |
443 | } | |
3ce45c12 | 444 | } |
6acdbcb2 | 445 | |
52daf7b2 | 446 | //(+-) |
32e94079 | 447 | if(eventClass == "Centrality"){ |
448 | histoTitle = "(+-) | Centrality: "; | |
449 | histoTitle += psiMin; | |
450 | histoTitle += " - "; | |
451 | histoTitle += psiMax; | |
452 | histoTitle += " % "; | |
3b8a460b | 453 | histoTitle += " (0^{o} < #varphi^{t} - #Psi_{2} < 180^{o})"; |
32e94079 | 454 | } |
455 | else if(eventClass == "Multiplicity"){ | |
456 | histoTitle = "(+-) | Multiplicity: "; | |
457 | histoTitle += psiMin; | |
458 | histoTitle += " - "; | |
459 | histoTitle += psiMax; | |
460 | histoTitle += " tracks"; | |
3b8a460b | 461 | histoTitle += " (0^{o} < #varphi^{t} - #Psi_{2} < 180^{o})"; |
32e94079 | 462 | } |
463 | else{ // "EventPlane" (default) | |
464 | histoTitle = "(+-) | Centrality: "; | |
465 | histoTitle += centralityArray[gCentrality-1]; | |
466 | histoTitle += "%"; | |
467 | if((psiMin == -0.5)&&(psiMax == 0.5)) | |
3b8a460b | 468 | histoTitle += " (-7.5^{o} < #varphi^{t} - #Psi_{2} < 7.5^{o})"; |
32e94079 | 469 | else if((psiMin == 0.5)&&(psiMax == 1.5)) |
3b8a460b | 470 | histoTitle += " (37.5^{o} < #varphi^{t} - #Psi_{2} < 52.5^{o})"; |
32e94079 | 471 | else if((psiMin == 1.5)&&(psiMax == 2.5)) |
3b8a460b | 472 | histoTitle += " (82.5^{o} < #varphi^{t} - #Psi_{2} < 97.5^{o})"; |
32e94079 | 473 | else |
3b8a460b | 474 | histoTitle += " (0^{o} < #varphi^{t} - #Psi_{2} < 180^{o})"; |
32e94079 | 475 | } |
20006629 | 476 | gHistPN[0] = b->GetCorrelationFunctionPN(psiMin,psiMax,vertexZMin,vertexZMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax); |
faa03677 | 477 | if(rebinEta > 1 || rebinPhi > 1){ |
478 | gHistPN[0]->Rebin2D(rebinEta,rebinPhi); | |
479 | gHistPN[0]->Scale(1./(Double_t)(rebinEta*rebinPhi)); | |
480 | } | |
52daf7b2 | 481 | gHistPN[0]->GetYaxis()->SetTitleOffset(1.5); |
77b9ff18 | 482 | gHistPN[0]->GetYaxis()->SetTitle("#Delta #varphi (rad)"); |
52daf7b2 | 483 | gHistPN[0]->SetTitle(histoTitle.Data()); |
484 | cPN[0] = new TCanvas("cPN0","",0,0,600,500); | |
485 | cPN[0]->SetFillColor(10); cPN[0]->SetHighLightColor(10); | |
5de9ad1a | 486 | gHistPN[0]->DrawCopy("surf1fb"); |
487 | gPad->SetTheta(30); // default is 30 | |
488 | //gPad->SetPhi(130); // default is 30 | |
489 | gPad->SetPhi(-60); // default is 30 | |
490 | gPad->Update(); | |
6acdbcb2 | 491 | pngName = "DeltaPhiDeltaEta.Centrality"; |
52daf7b2 | 492 | pngName += centralityArray[gCentrality-1]; |
6acdbcb2 | 493 | pngName += ".Psi"; pngName += psiMin; pngName += "To"; pngName += psiMax; |
494 | pngName += ".PositiveNegative.png"; | |
5c9b4733 | 495 | //cPN[0]->SaveAs(pngName.Data()); |
6acdbcb2 | 496 | |
52daf7b2 | 497 | if(listBFShuffled) { |
34616eda | 498 | |
499 | histoTitle.ReplaceAll("(+-)","(+-) shuffled"); | |
52daf7b2 | 500 | |
20006629 | 501 | gHistPN[1] = bShuffled->GetCorrelationFunctionPN(psiMin,psiMax,vertexZMin,vertexZMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax); |
faa03677 | 502 | if(rebinEta > 1 || rebinPhi > 1){ |
503 | gHistPN[1]->Rebin2D(rebinEta,rebinPhi); | |
504 | gHistPN[1]->Scale(1./(Double_t)(rebinEta*rebinPhi)); | |
505 | } | |
52daf7b2 | 506 | gHistPN[1]->GetYaxis()->SetTitleOffset(1.5); |
77b9ff18 | 507 | gHistPN[1]->GetYaxis()->SetTitle("#Delta #varphi (rad)"); |
52daf7b2 | 508 | gHistPN[1]->SetTitle(histoTitle.Data()); |
509 | cPN[1] = new TCanvas("cPN1","",0,100,600,500); | |
510 | cPN[1]->SetFillColor(10); | |
511 | cPN[1]->SetHighLightColor(10); | |
5de9ad1a | 512 | gHistPN[1]->DrawCopy("surf1fb"); |
513 | gPad->SetTheta(30); // default is 30 | |
514 | //gPad->SetPhi(130); // default is 30 | |
515 | gPad->SetPhi(-60); // default is 30 | |
516 | gPad->Update(); | |
52daf7b2 | 517 | pngName = "DeltaPhiDeltaEtaShuffled.Centrality"; |
518 | pngName += centralityArray[gCentrality-1]; | |
519 | pngName += ".Psi"; pngName += psiMin; pngName += "To"; pngName += psiMax; | |
520 | pngName += ".PositiveNegative.png"; | |
5c9b4733 | 521 | //cPN[1]->SaveAs(pngName.Data()); |
52daf7b2 | 522 | } |
523 | ||
524 | if(listBFMixed) { | |
34616eda | 525 | |
526 | if(histoTitle.Contains("shuffled")) histoTitle.ReplaceAll("(+-) shuffled","(+-) mixed"); | |
527 | else histoTitle.ReplaceAll("(+-)","(+-) mixed"); | |
52daf7b2 | 528 | |
742af4bd | 529 | // if normalization to trigger then do not divide Event mixing by number of trigger particles |
20006629 | 530 | gHistPN[2] = bMixed->GetCorrelationFunctionPN(psiMin,psiMax,vertexZMin,vertexZMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax); |
faa03677 | 531 | if(rebinEta > 1 || rebinPhi > 1){ |
532 | gHistPN[2]->Rebin2D(rebinEta,rebinPhi); | |
533 | gHistPN[2]->Scale(1./(Double_t)(rebinEta*rebinPhi)); | |
534 | } | |
742af4bd | 535 | |
536 | // normalization to 1 at (0,0) --> Jan Fietes method | |
537 | if(normToTrig){ | |
538 | Double_t mixedNorm = gHistPN[2]->Integral(gHistPN[2]->GetXaxis()->FindBin(0-10e-5),gHistPN[2]->GetXaxis()->FindBin(0+10e-5),1,gHistPN[2]->GetNbinsX()); | |
539 | mixedNorm /= gHistPN[2]->GetNbinsY()*(gHistPN[2]->GetXaxis()->FindBin(0.01) - gHistPN[2]->GetXaxis()->FindBin(-0.01) + 1); | |
540 | gHistPN[2]->Scale(1./mixedNorm); | |
541 | } | |
542 | ||
52daf7b2 | 543 | gHistPN[2]->GetYaxis()->SetTitleOffset(1.5); |
77b9ff18 | 544 | gHistPN[2]->GetYaxis()->SetTitle("#Delta #varphi (rad)"); |
52daf7b2 | 545 | gHistPN[2]->SetTitle(histoTitle.Data()); |
546 | cPN[2] = new TCanvas("cPN2","",0,200,600,500); | |
547 | cPN[2]->SetFillColor(10); | |
548 | cPN[2]->SetHighLightColor(10); | |
5de9ad1a | 549 | gHistPN[2]->DrawCopy("surf1fb"); |
550 | gPad->SetTheta(30); // default is 30 | |
551 | //gPad->SetPhi(130); // default is 30 | |
552 | gPad->SetPhi(-60); // default is 30 | |
553 | gPad->Update(); | |
52daf7b2 | 554 | pngName = "DeltaPhiDeltaEtaMixed.Centrality"; |
555 | pngName += centralityArray[gCentrality-1]; | |
556 | pngName += ".Psi"; pngName += psiMin; pngName += "To"; pngName += psiMax; | |
557 | pngName += ".PositiveNegative.png"; | |
5c9b4733 | 558 | //cPN[2]->SaveAs(pngName.Data()); |
77b9ff18 | 559 | |
560 | //Correlation function (+-) | |
34616eda | 561 | gHistPN[3] = b->GetCorrelationFunction("PN",psiMin,psiMax,vertexZMin,vertexZMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax,bMixed); |
77b9ff18 | 562 | gHistPN[3]->GetXaxis()->SetRangeUser(-1.5,1.5); |
41f2bc59 | 563 | if(normToTrig) |
564 | gHistPN[3]->GetZaxis()->SetTitle("#frac{1}{N_{trig}}#frac{d^{2}N_{assoc}}{d#Delta#eta#Delta#varphi} (rad^{-1})"); | |
565 | else | |
566 | gHistPN[3]->GetZaxis()->SetTitle("C_{+-}(#Delta#eta,#Delta#varphi)"); | |
2b4abbc5 | 567 | //gHistPN[3]->SetTitle("C_{+-}(#Delta#eta,#Delta#varphi)"); |
77b9ff18 | 568 | cPN[3] = new TCanvas("cPN3","",0,300,600,500); |
569 | cPN[3]->SetFillColor(10); | |
570 | cPN[3]->SetHighLightColor(10); | |
571 | gHistPN[3]->DrawCopy("surf1fb"); | |
572 | gPad->SetTheta(30); // default is 30 | |
573 | //gPad->SetPhi(130); // default is 30 | |
574 | gPad->SetPhi(-60); // default is 30 | |
575 | gPad->Update(); | |
576 | pngName = "CorrelationFunction.Centrality"; | |
577 | pngName += centralityArray[gCentrality-1]; | |
578 | pngName += ".Psi"; pngName += psiMin; pngName += "To"; pngName += psiMax; | |
579 | pngName += ".PositiveNegative.png"; | |
5c9b4733 | 580 | //cPN[3]->SaveAs(pngName.Data()); |
52daf7b2 | 581 | } |
3ce45c12 | 582 | // if no mixing then divide by convoluted histograms |
583 | else if(listQA){ | |
34616eda | 584 | |
585 | if(histoTitle.Contains("shuffled")) histoTitle.ReplaceAll("(+-) shuffled","(+-) convoluted"); | |
586 | else histoTitle.ReplaceAll("(+-)","(+-) convoluted"); | |
3ce45c12 | 587 | |
faa03677 | 588 | if(rebinEta > 1 || rebinPhi > 1){ |
589 | gHistPN[2]->Rebin2D(rebinEta,rebinPhi); | |
590 | gHistPN[0]->Scale(1./(Double_t)(rebinEta*rebinPhi)); | |
591 | } | |
592 | ||
3ce45c12 | 593 | // normalization to 1 at (0,0) --> Jan Fietes method |
594 | if(normToTrig){ | |
595 | Double_t mixedNorm = gHistPN[2]->Integral(gHistPN[2]->GetXaxis()->FindBin(0-10e-5),gHistPN[2]->GetXaxis()->FindBin(0+10e-5),1,gHistPN[2]->GetNbinsX()); | |
596 | mixedNorm /= gHistPN[2]->GetNbinsY()*(gHistPN[2]->GetXaxis()->FindBin(0.01) - gHistPN[2]->GetXaxis()->FindBin(-0.01) + 1); | |
597 | gHistPN[2]->Scale(1./mixedNorm); | |
598 | } | |
599 | ||
600 | gHistPN[2]->GetYaxis()->SetTitleOffset(1.5); | |
601 | gHistPN[2]->GetYaxis()->SetTitle("#Delta #varphi (rad)"); | |
602 | gHistPN[2]->SetTitle(histoTitle.Data()); | |
603 | cPN[2] = new TCanvas("cPN2","",0,200,600,500); | |
604 | cPN[2]->SetFillColor(10); | |
605 | cPN[2]->SetHighLightColor(10); | |
606 | gHistPN[2]->DrawCopy("surf1fb"); | |
607 | gPad->SetTheta(30); // default is 30 | |
608 | //gPad->SetPhi(130); // default is 30 | |
609 | gPad->SetPhi(-60); // default is 30 | |
610 | gPad->Update(); | |
611 | pngName = "DeltaPhiDeltaEtaMixed.Centrality"; | |
612 | pngName += centralityArray[gCentrality-1]; | |
613 | pngName += ".Psi"; pngName += psiMin; pngName += "To"; pngName += psiMax; | |
614 | pngName += ".PositiveNegative.png"; | |
615 | //cPN[2]->SaveAs(pngName.Data()); | |
616 | ||
617 | //Correlation function (+-) | |
618 | gHistPN[3] = dynamic_cast<TH2D *>(gHistPN[0]->Clone()); | |
619 | gHistPN[3]->Divide(gHistPN[2]); | |
620 | gHistPN[3]->GetXaxis()->SetRangeUser(-1.5,1.5); | |
41f2bc59 | 621 | if(normToTrig) |
622 | gHistPN[3]->GetZaxis()->SetTitle("#frac{1}{N_{trig}}#frac{d^{2}N_{assoc}}{d#Delta#eta#Delta#varphi} (rad^{-1})"); | |
623 | else | |
624 | gHistPN[3]->GetZaxis()->SetTitle("C_{+-}(#Delta#eta,#Delta#varphi)"); | |
2b4abbc5 | 625 | //gHistPN[3]->SetTitle("C_{+-}(#Delta#eta,#Delta#varphi)"); |
3ce45c12 | 626 | cPN[3] = new TCanvas("cPN3","",0,300,600,500); |
627 | cPN[3]->SetFillColor(10); | |
628 | cPN[3]->SetHighLightColor(10); | |
629 | gHistPN[3]->DrawCopy("surf1fb"); | |
630 | gPad->SetTheta(30); // default is 30 | |
631 | //gPad->SetPhi(130); // default is 30 | |
632 | gPad->SetPhi(-60); // default is 30 | |
633 | gPad->Update(); | |
634 | pngName = "CorrelationFunction.Centrality"; | |
635 | pngName += centralityArray[gCentrality-1]; | |
636 | pngName += ".Psi"; pngName += psiMin; pngName += "To"; pngName += psiMax; | |
637 | pngName += ".PositiveNegative.png"; | |
638 | //cPN[3]->SaveAs(pngName.Data()); | |
639 | } | |
52daf7b2 | 640 | |
641 | //(-+) | |
32e94079 | 642 | if(eventClass == "Centrality"){ |
643 | histoTitle = "(-+) | Centrality: "; | |
644 | histoTitle += psiMin; | |
645 | histoTitle += " - "; | |
646 | histoTitle += psiMax; | |
647 | histoTitle += " % "; | |
3b8a460b | 648 | histoTitle += " (0^{o} < #varphi^{t} - #Psi_{2} < 180^{o})"; |
32e94079 | 649 | } |
650 | else if(eventClass == "Multiplicity"){ | |
651 | histoTitle = "(-+) | Multiplicity: "; | |
652 | histoTitle += psiMin; | |
653 | histoTitle += " - "; | |
654 | histoTitle += psiMax; | |
655 | histoTitle += " tracks"; | |
3b8a460b | 656 | histoTitle += " (0^{o} < #varphi^{t} - #Psi_{2} < 180^{o})"; |
32e94079 | 657 | } |
658 | else{ // "EventPlane" (default) | |
659 | histoTitle = "(-+) | Centrality: "; | |
660 | histoTitle += centralityArray[gCentrality-1]; | |
661 | histoTitle += "%"; | |
662 | if((psiMin == -0.5)&&(psiMax == 0.5)) | |
3b8a460b | 663 | histoTitle += " (-7.5^{o} < #varphi^{t} - #Psi_{2} < 7.5^{o})"; |
32e94079 | 664 | else if((psiMin == 0.5)&&(psiMax == 1.5)) |
3b8a460b | 665 | histoTitle += " (37.5^{o} < #varphi^{t} - #Psi_{2} < 52.5^{o})"; |
32e94079 | 666 | else if((psiMin == 1.5)&&(psiMax == 2.5)) |
3b8a460b | 667 | histoTitle += " (82.5^{o} < #varphi^{t} - #Psi_{2} < 97.5^{o})"; |
32e94079 | 668 | else |
3b8a460b | 669 | histoTitle += " (0^{o} < #varphi^{t} - #Psi_{2} < 180^{o})"; |
32e94079 | 670 | } |
52daf7b2 | 671 | |
20006629 | 672 | gHistNP[0] = b->GetCorrelationFunctionNP(psiMin,psiMax,vertexZMin,vertexZMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax); |
faa03677 | 673 | if(rebinEta > 1 || rebinPhi > 1){ |
674 | gHistNP[0]->Rebin2D(rebinEta,rebinPhi); | |
675 | gHistNP[0]->Scale(1./(Double_t)(rebinEta*rebinPhi)); | |
676 | } | |
52daf7b2 | 677 | gHistNP[0]->GetYaxis()->SetTitleOffset(1.5); |
77b9ff18 | 678 | gHistNP[0]->GetYaxis()->SetTitle("#Delta #varphi (rad)"); |
52daf7b2 | 679 | gHistNP[0]->SetTitle(histoTitle.Data()); |
680 | cNP[0] = new TCanvas("cNP0","",100,0,600,500); | |
681 | cNP[0]->SetFillColor(10); | |
682 | cNP[0]->SetHighLightColor(10); | |
5de9ad1a | 683 | gHistNP[0]->DrawCopy("surf1fb"); |
684 | gPad->SetTheta(30); // default is 30 | |
685 | //gPad->SetPhi(130); // default is 30 | |
686 | gPad->SetPhi(-60); // default is 30 | |
687 | gPad->Update(); | |
6acdbcb2 | 688 | pngName = "DeltaPhiDeltaEta.Centrality"; |
52daf7b2 | 689 | pngName += centralityArray[gCentrality-1]; |
6acdbcb2 | 690 | pngName += ".Psi"; pngName += psiMin; pngName += "To"; pngName += psiMax; |
691 | pngName += ".NegativePositive.png"; | |
5c9b4733 | 692 | //cNP[0]->SaveAs(pngName.Data()); |
52daf7b2 | 693 | |
694 | if(listBFShuffled) { | |
34616eda | 695 | |
696 | histoTitle.ReplaceAll("(-+)","(-+) shuffled"); | |
52daf7b2 | 697 | |
20006629 | 698 | gHistNP[1] = bShuffled->GetCorrelationFunctionNP(psiMin,psiMax,vertexZMin,vertexZMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax); |
faa03677 | 699 | if(rebinEta > 1 || rebinPhi > 1){ |
700 | gHistNP[1]->Rebin2D(rebinEta,rebinPhi); | |
701 | gHistNP[1]->Scale(1./(Double_t)(rebinEta*rebinPhi)); | |
702 | } | |
52daf7b2 | 703 | gHistNP[1]->GetYaxis()->SetTitleOffset(1.5); |
77b9ff18 | 704 | gHistNP[1]->GetYaxis()->SetTitle("#Delta #varphi (rad)"); |
52daf7b2 | 705 | gHistNP[1]->SetTitle(histoTitle.Data()); |
706 | cNP[1] = new TCanvas("cNP1","",100,100,600,500); | |
707 | cNP[1]->SetFillColor(10); | |
708 | cNP[1]->SetHighLightColor(10); | |
5de9ad1a | 709 | gHistNP[1]->DrawCopy("surf1fb"); |
710 | gPad->SetTheta(30); // default is 30 | |
711 | //gPad->SetPhi(130); // default is 30 | |
712 | gPad->SetPhi(-60); // default is 30 | |
713 | gPad->Update(); | |
52daf7b2 | 714 | pngName = "DeltaPhiDeltaEtaShuffled.Centrality"; |
715 | pngName += centralityArray[gCentrality-1]; | |
716 | pngName += ".Psi"; pngName += psiMin; pngName += "To"; pngName += psiMax; | |
717 | pngName += ".NegativePositive.png"; | |
5c9b4733 | 718 | //cNP[1]->SaveAs(pngName.Data()); |
52daf7b2 | 719 | } |
720 | ||
721 | if(listBFMixed) { | |
34616eda | 722 | |
723 | if(histoTitle.Contains("shuffled")) histoTitle.ReplaceAll("(-+) shuffled","(-+) mixed"); | |
724 | else histoTitle.ReplaceAll("(-+)","(-+) mixed"); | |
725 | ||
742af4bd | 726 | // if normalization to trigger then do not divide Event mixing by number of trigger particles |
20006629 | 727 | gHistNP[2] = bMixed->GetCorrelationFunctionNP(psiMin,psiMax,vertexZMin,vertexZMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax); |
faa03677 | 728 | if(rebinEta > 1 || rebinPhi > 1){ |
729 | gHistNP[2]->Rebin2D(rebinEta,rebinPhi); | |
730 | gHistNP[2]->Scale(1./(Double_t)(rebinEta*rebinPhi)); | |
731 | } | |
742af4bd | 732 | // normalization to 1 at (0,0) --> Jan Fietes method |
733 | if(normToTrig){ | |
734 | Double_t mixedNorm = gHistNP[2]->Integral(gHistNP[2]->GetXaxis()->FindBin(0-10e-5),gHistNP[2]->GetXaxis()->FindBin(0+10e-5),1,gHistNP[2]->GetNbinsX()); | |
735 | mixedNorm /= gHistNP[2]->GetNbinsY()*(gHistNP[2]->GetXaxis()->FindBin(0.01) - gHistNP[2]->GetXaxis()->FindBin(-0.01) + 1); | |
736 | gHistNP[2]->Scale(1./mixedNorm); | |
737 | } | |
738 | ||
52daf7b2 | 739 | gHistNP[2]->GetYaxis()->SetTitleOffset(1.5); |
77b9ff18 | 740 | gHistNP[2]->GetYaxis()->SetTitle("#Delta #varphi (rad)"); |
52daf7b2 | 741 | gHistNP[2]->SetTitle(histoTitle.Data()); |
742 | cNP[2] = new TCanvas("cNP2","",100,200,600,500); | |
743 | cNP[2]->SetFillColor(10); | |
744 | cNP[2]->SetHighLightColor(10); | |
5de9ad1a | 745 | gHistNP[2]->DrawCopy("surf1fb"); |
746 | gPad->SetTheta(30); // default is 30 | |
747 | //gPad->SetPhi(130); // default is 30 | |
748 | gPad->SetPhi(-60); // default is 30 | |
749 | gPad->Update(); | |
52daf7b2 | 750 | pngName = "DeltaPhiDeltaEtaMixed.Centrality"; |
751 | pngName += centralityArray[gCentrality-1]; | |
752 | pngName += ".Psi"; pngName += psiMin; pngName += "To"; pngName += psiMax; | |
753 | pngName += ".NegativePositive.png"; | |
5c9b4733 | 754 | //cNP[2]->SaveAs(pngName.Data()); |
77b9ff18 | 755 | |
756 | //Correlation function (-+) | |
34616eda | 757 | gHistNP[3] = b->GetCorrelationFunction("NP",psiMin,psiMax,vertexZMin,vertexZMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax,bMixed); |
77b9ff18 | 758 | gHistNP[3]->GetXaxis()->SetRangeUser(-1.5,1.5); |
41f2bc59 | 759 | if(normToTrig) |
760 | gHistNP[3]->GetZaxis()->SetTitle("#frac{1}{N_{trig}}#frac{d^{2}N_{assoc}}{d#Delta#eta#Delta#varphi} (rad^{-1})"); | |
761 | else | |
762 | gHistNP[3]->GetZaxis()->SetTitle("C_{-+}(#Delta#eta,#Delta#varphi)"); | |
2b4abbc5 | 763 | //gHistNP[3]->SetTitle("C_{+-}(#Delta#eta,#Delta#varphi)"); |
77b9ff18 | 764 | cNP[3] = new TCanvas("cNP3","",100,300,600,500); |
765 | cNP[3]->SetFillColor(10); | |
766 | cNP[3]->SetHighLightColor(10); | |
767 | gHistNP[3]->DrawCopy("surf1fb"); | |
768 | gPad->SetTheta(30); // default is 30 | |
769 | //gPad->SetPhi(130); // default is 30 | |
770 | gPad->SetPhi(-60); // default is 30 | |
771 | gPad->Update(); | |
772 | pngName = "CorrelationFunction.Centrality"; | |
773 | pngName += centralityArray[gCentrality-1]; | |
774 | pngName += ".Psi"; pngName += psiMin; pngName += "To"; pngName += psiMax; | |
775 | pngName += ".NegativePositive.png"; | |
5c9b4733 | 776 | //cNP[3]->SaveAs(pngName.Data()); |
52daf7b2 | 777 | } |
3ce45c12 | 778 | // if no mixing then divide by convoluted histograms |
779 | else if(listQA){ | |
34616eda | 780 | |
781 | if(histoTitle.Contains("shuffled")) histoTitle.ReplaceAll("(-+) shuffled","(-+) convoluted"); | |
782 | else histoTitle.ReplaceAll("(-+)","(-+) convoluted"); | |
3ce45c12 | 783 | |
faa03677 | 784 | if(rebinEta > 1 || rebinPhi > 1){ |
785 | gHistNP[2]->Rebin2D(rebinEta,rebinPhi); | |
786 | gHistNP[2]->Scale(1./(Double_t)(rebinEta*rebinPhi)); | |
787 | } | |
3ce45c12 | 788 | |
789 | // normalization to 1 at (0,0) --> Jan Fietes method | |
790 | if(normToTrig){ | |
791 | Double_t mixedNorm = gHistNP[2]->Integral(gHistNP[2]->GetXaxis()->FindBin(0-10e-5),gHistNP[2]->GetXaxis()->FindBin(0+10e-5),1,gHistNP[2]->GetNbinsX()); | |
792 | mixedNorm /= gHistNP[2]->GetNbinsY()*(gHistNP[2]->GetXaxis()->FindBin(0.01) - gHistNP[2]->GetXaxis()->FindBin(-0.01) + 1); | |
793 | gHistNP[2]->Scale(1./mixedNorm); | |
794 | } | |
795 | ||
796 | gHistNP[2]->GetYaxis()->SetTitleOffset(1.5); | |
797 | gHistNP[2]->GetYaxis()->SetTitle("#Delta #varphi (rad)"); | |
798 | gHistNP[2]->SetTitle(histoTitle.Data()); | |
799 | cNP[2] = new TCanvas("cNP2","",100,200,600,500); | |
800 | cNP[2]->SetFillColor(10); | |
801 | cNP[2]->SetHighLightColor(10); | |
802 | gHistNP[2]->DrawCopy("surf1fb"); | |
803 | gPad->SetTheta(30); // default is 30 | |
804 | //gPad->SetPhi(130); // default is 30 | |
805 | gPad->SetPhi(-60); // default is 30 | |
806 | gPad->Update(); | |
807 | pngName = "DeltaPhiDeltaEtaMixed.Centrality"; | |
808 | pngName += centralityArray[gCentrality-1]; | |
809 | pngName += ".Psi"; pngName += psiMin; pngName += "To"; pngName += psiMax; | |
810 | pngName += ".NegativePositive.png"; | |
811 | //cNP[2]->SaveAs(pngName.Data()); | |
812 | ||
813 | //Correlation function (-+) | |
814 | gHistNP[3] = dynamic_cast<TH2D *>(gHistNP[0]->Clone()); | |
815 | gHistNP[3]->Divide(gHistNP[2]); | |
816 | gHistNP[3]->GetXaxis()->SetRangeUser(-1.5,1.5); | |
41f2bc59 | 817 | if(normToTrig) |
818 | gHistNP[3]->GetZaxis()->SetTitle("#frac{1}{N_{trig}}#frac{d^{2}N_{assoc}}{d#Delta#eta#Delta#varphi} (rad^{-1})"); | |
819 | else | |
820 | gHistNP[3]->GetZaxis()->SetTitle("C_{-+}(#Delta#eta,#Delta#varphi)"); | |
2b4abbc5 | 821 | //gHistNP[3]->SetTitle("C_{-+}(#Delta#eta,#Delta#varphi)"); |
3ce45c12 | 822 | cNP[3] = new TCanvas("cNP3","",100,300,600,500); |
823 | cNP[3]->SetFillColor(10); | |
824 | cNP[3]->SetHighLightColor(10); | |
825 | gHistNP[3]->DrawCopy("surf1fb"); | |
826 | gPad->SetTheta(30); // default is 30 | |
827 | //gPad->SetPhi(130); // default is 30 | |
828 | gPad->SetPhi(-60); // default is 30 | |
829 | gPad->Update(); | |
830 | pngName = "CorrelationFunction.Centrality"; | |
831 | pngName += centralityArray[gCentrality-1]; | |
832 | pngName += ".Psi"; pngName += psiMin; pngName += "To"; pngName += psiMax; | |
833 | pngName += ".NegativePositive.png"; | |
834 | //cNP[3]->SaveAs(pngName.Data()); | |
835 | } | |
836 | ||
837 | ||
52daf7b2 | 838 | //(++) |
32e94079 | 839 | if(eventClass == "Centrality"){ |
840 | histoTitle = "(++) | Centrality: "; | |
841 | histoTitle += psiMin; | |
842 | histoTitle += " - "; | |
843 | histoTitle += psiMax; | |
844 | histoTitle += " % "; | |
3b8a460b | 845 | histoTitle += " (0^{o} < #varphi^{t} - #Psi_{2} < 180^{o})"; |
32e94079 | 846 | } |
847 | else if(eventClass == "Multiplicity"){ | |
848 | histoTitle = "(++) | Multiplicity: "; | |
849 | histoTitle += psiMin; | |
850 | histoTitle += " - "; | |
851 | histoTitle += psiMax; | |
852 | histoTitle += " tracks"; | |
3b8a460b | 853 | histoTitle += " (0^{o} < #varphi^{t} - #Psi_{2} < 180^{o})"; |
32e94079 | 854 | } |
855 | else{ // "EventPlane" (default) | |
856 | histoTitle = "(++) | Centrality: "; | |
857 | histoTitle += centralityArray[gCentrality-1]; | |
858 | histoTitle += "%"; | |
859 | if((psiMin == -0.5)&&(psiMax == 0.5)) | |
3b8a460b | 860 | histoTitle += " (-7.5^{o} < #varphi^{t} - #Psi_{2} < 7.5^{o})"; |
32e94079 | 861 | else if((psiMin == 0.5)&&(psiMax == 1.5)) |
3b8a460b | 862 | histoTitle += " (37.5^{o} < #varphi^{t} - #Psi_{2} < 52.5^{o})"; |
32e94079 | 863 | else if((psiMin == 1.5)&&(psiMax == 2.5)) |
3b8a460b | 864 | histoTitle += " (82.5^{o} < #varphi^{t} - #Psi_{2} < 97.5^{o})"; |
32e94079 | 865 | else |
3b8a460b | 866 | histoTitle += " (0^{o} < #varphi^{t} - #Psi_{2} < 180^{o})"; |
32e94079 | 867 | } |
52daf7b2 | 868 | |
20006629 | 869 | gHistPP[0] = b->GetCorrelationFunctionPP(psiMin,psiMax,vertexZMin,vertexZMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax); |
faa03677 | 870 | if(rebinEta > 1 || rebinPhi > 1){ |
871 | gHistPP[0]->Rebin2D(rebinEta,rebinPhi); | |
872 | gHistPP[0]->Scale(1./(Double_t)(rebinEta*rebinPhi)); | |
873 | } | |
52daf7b2 | 874 | gHistPP[0]->GetYaxis()->SetTitleOffset(1.5); |
77b9ff18 | 875 | gHistPP[0]->GetYaxis()->SetTitle("#Delta #varphi (rad)"); |
52daf7b2 | 876 | gHistPP[0]->SetTitle(histoTitle.Data()); |
877 | cPP[0] = new TCanvas("cPP0","",200,0,600,500); | |
878 | cPP[0]->SetFillColor(10); | |
879 | cPP[0]->SetHighLightColor(10); | |
5de9ad1a | 880 | gHistPP[0]->DrawCopy("surf1fb"); |
881 | gPad->SetTheta(30); // default is 30 | |
882 | //gPad->SetPhi(130); // default is 30 | |
883 | gPad->SetPhi(-60); // default is 30 | |
884 | gPad->Update(); | |
6acdbcb2 | 885 | pngName = "DeltaPhiDeltaEta.Centrality"; |
52daf7b2 | 886 | pngName += centralityArray[gCentrality-1]; |
6acdbcb2 | 887 | pngName += ".Psi"; pngName += psiMin; pngName += "To"; pngName += psiMax; |
888 | pngName += ".PositivePositive.png"; | |
5c9b4733 | 889 | //cPP[0]->SaveAs(pngName.Data()); |
6acdbcb2 | 890 | |
52daf7b2 | 891 | if(listBFShuffled) { |
34616eda | 892 | |
893 | histoTitle.ReplaceAll("(++)","(++) shuffled"); | |
52daf7b2 | 894 | |
20006629 | 895 | gHistPP[1] = bShuffled->GetCorrelationFunctionPP(psiMin,psiMax,vertexZMin,vertexZMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax); |
faa03677 | 896 | if(rebinEta > 1 || rebinPhi > 1){ |
897 | gHistPP[1]->Rebin2D(rebinEta,rebinPhi); | |
898 | gHistPP[1]->Scale(1./(Double_t)(rebinEta*rebinPhi)); | |
899 | } | |
52daf7b2 | 900 | gHistPP[1]->GetYaxis()->SetTitleOffset(1.5); |
77b9ff18 | 901 | gHistPP[1]->GetYaxis()->SetTitle("#Delta #varphi (rad)"); |
52daf7b2 | 902 | gHistPP[1]->SetTitle(histoTitle.Data()); |
903 | cPP[1] = new TCanvas("cPP1","",200,100,600,500); | |
904 | cPP[1]->SetFillColor(10); | |
905 | cPP[1]->SetHighLightColor(10); | |
5de9ad1a | 906 | gHistPP[1]->DrawCopy("surf1fb"); |
907 | gPad->SetTheta(30); // default is 30 | |
908 | //gPad->SetPhi(130); // default is 30 | |
909 | gPad->SetPhi(-60); // default is 30 | |
910 | gPad->Update(); | |
52daf7b2 | 911 | pngName = "DeltaPhiDeltaEtaShuffled.Centrality"; |
912 | pngName += centralityArray[gCentrality-1]; | |
913 | pngName += ".Psi"; pngName += psiMin; pngName += "To"; pngName += psiMax; | |
914 | pngName += ".PositivePositive.png"; | |
5c9b4733 | 915 | //cPP[1]->SaveAs(pngName.Data()); |
52daf7b2 | 916 | } |
917 | ||
918 | if(listBFMixed) { | |
34616eda | 919 | |
920 | if(histoTitle.Contains("shuffled")) histoTitle.ReplaceAll("(++) shuffled","(++) mixed"); | |
921 | else histoTitle.ReplaceAll("(++)","(++) mixed"); | |
52daf7b2 | 922 | |
742af4bd | 923 | // if normalization to trigger then do not divide Event mixing by number of trigger particles |
20006629 | 924 | gHistPP[2] = bMixed->GetCorrelationFunctionPP(psiMin,psiMax,vertexZMin,vertexZMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax); |
faa03677 | 925 | if(rebinEta > 1 || rebinPhi > 1){ |
926 | gHistPP[2]->Rebin2D(rebinEta,rebinPhi); | |
927 | gHistPP[2]->Scale(1./(Double_t)(rebinEta*rebinPhi)); | |
928 | } | |
742af4bd | 929 | // normalization to 1 at (0,0) --> Jan Fietes method |
930 | if(normToTrig){ | |
931 | Double_t mixedNorm = gHistPP[2]->Integral(gHistPP[2]->GetXaxis()->FindBin(0-10e-5),gHistPP[2]->GetXaxis()->FindBin(0+10e-5),1,gHistPP[2]->GetNbinsX()); | |
932 | mixedNorm /= gHistPP[2]->GetNbinsY()*(gHistPP[2]->GetXaxis()->FindBin(0.01) - gHistPP[2]->GetXaxis()->FindBin(-0.01) + 1); | |
933 | gHistPP[2]->Scale(1./mixedNorm); | |
934 | } | |
935 | ||
52daf7b2 | 936 | gHistPP[2]->GetYaxis()->SetTitleOffset(1.5); |
77b9ff18 | 937 | gHistPP[2]->GetYaxis()->SetTitle("#Delta #varphi (rad)"); |
52daf7b2 | 938 | gHistPP[2]->SetTitle(histoTitle.Data()); |
939 | cPP[2] = new TCanvas("cPP2","",200,200,600,500); | |
940 | cPP[2]->SetFillColor(10); | |
941 | cPP[2]->SetHighLightColor(10); | |
5de9ad1a | 942 | gHistPP[2]->DrawCopy("surf1fb"); |
943 | gPad->SetTheta(30); // default is 30 | |
944 | //gPad->SetPhi(130); // default is 30 | |
945 | gPad->SetPhi(-60); // default is 30 | |
946 | gPad->Update(); | |
52daf7b2 | 947 | pngName = "DeltaPhiDeltaEtaMixed.Centrality"; |
948 | pngName += centralityArray[gCentrality-1]; | |
949 | pngName += ".Psi"; pngName += psiMin; pngName += "To"; pngName += psiMax; | |
950 | pngName += ".PositivePositive.png"; | |
5c9b4733 | 951 | //cPP[2]->SaveAs(pngName.Data()); |
77b9ff18 | 952 | |
953 | //Correlation function (++) | |
34616eda | 954 | gHistPP[3] = b->GetCorrelationFunction("PP",psiMin,psiMax,vertexZMin,vertexZMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax,bMixed); |
77b9ff18 | 955 | gHistPP[3]->GetXaxis()->SetRangeUser(-1.5,1.5); |
41f2bc59 | 956 | if(normToTrig) |
957 | gHistPP[3]->GetZaxis()->SetTitle("#frac{1}{N_{trig}}#frac{d^{2}N_{assoc}}{d#Delta#eta#Delta#varphi} (rad^{-1})"); | |
958 | else | |
959 | gHistPP[3]->GetZaxis()->SetTitle("C_{++}(#Delta#eta,#Delta#varphi)"); | |
2b4abbc5 | 960 | // gHistPP[3]->SetTitle("C_{++}(#Delta#eta,#Delta#varphi)"); |
77b9ff18 | 961 | cPP[3] = new TCanvas("cPP3","",200,300,600,500); |
962 | cPP[3]->SetFillColor(10); | |
963 | cPP[3]->SetHighLightColor(10); | |
964 | gHistPP[3]->DrawCopy("surf1fb"); | |
965 | gPad->SetTheta(30); // default is 30 | |
966 | //gPad->SetPhi(130); // default is 30 | |
967 | gPad->SetPhi(-60); // default is 30 | |
968 | gPad->Update(); | |
969 | pngName = "CorrelationFunction.Centrality"; | |
970 | pngName += centralityArray[gCentrality-1]; | |
971 | pngName += ".Psi"; pngName += psiMin; pngName += "To"; pngName += psiMax; | |
972 | pngName += ".PositivePositive.png"; | |
5c9b4733 | 973 | //cPP[3]->SaveAs(pngName.Data()); |
52daf7b2 | 974 | } |
3ce45c12 | 975 | // if no mixing then divide by convoluted histograms |
976 | else if(listQA){ | |
34616eda | 977 | |
978 | if(histoTitle.Contains("shuffled")) histoTitle.ReplaceAll("(++) shuffled","(++) convoluted"); | |
979 | else histoTitle.ReplaceAll("(++)","(++) convoluted"); | |
3ce45c12 | 980 | |
faa03677 | 981 | if(rebinEta > 1 || rebinPhi > 1){ |
982 | gHistPP[2]->Rebin2D(rebinEta,rebinPhi); | |
983 | gHistPP[2]->Scale(1./(Double_t)(rebinEta*rebinPhi)); | |
984 | } | |
3ce45c12 | 985 | // normalization to 1 at (0,0) --> Jan Fietes method |
986 | if(normToTrig){ | |
987 | Double_t mixedNorm = gHistPP[2]->Integral(gHistPP[2]->GetXaxis()->FindBin(0-10e-5),gHistPP[2]->GetXaxis()->FindBin(0+10e-5),1,gHistPP[2]->GetNbinsX()); | |
988 | mixedNorm /= gHistPP[2]->GetNbinsY()*(gHistPP[2]->GetXaxis()->FindBin(0.01) - gHistPP[2]->GetXaxis()->FindBin(-0.01) + 1); | |
989 | gHistPP[2]->Scale(1./mixedNorm); | |
990 | } | |
991 | ||
992 | gHistPP[2]->GetYaxis()->SetTitleOffset(1.5); | |
993 | gHistPP[2]->GetYaxis()->SetTitle("#Delta #varphi (rad)"); | |
994 | gHistPP[2]->SetTitle(histoTitle.Data()); | |
995 | cPP[2] = new TCanvas("cPP2","",200,200,600,500); | |
996 | cPP[2]->SetFillColor(10); | |
997 | cPP[2]->SetHighLightColor(10); | |
998 | gHistPP[2]->DrawCopy("surf1fb"); | |
999 | gPad->SetTheta(30); // default is 30 | |
1000 | //gPad->SetPhi(130); // default is 30 | |
1001 | gPad->SetPhi(-60); // default is 30 | |
1002 | gPad->Update(); | |
1003 | pngName = "DeltaPhiDeltaEtaMixed.Centrality"; | |
1004 | pngName += centralityArray[gCentrality-1]; | |
1005 | pngName += ".Psi"; pngName += psiMin; pngName += "To"; pngName += psiMax; | |
1006 | pngName += ".PositivePositive.png"; | |
1007 | //cPP[2]->SaveAs(pngName.Data()); | |
1008 | ||
1009 | //Correlation function (++) | |
1010 | gHistPP[3] = dynamic_cast<TH2D *>(gHistPP[0]->Clone()); | |
1011 | gHistPP[3]->Divide(gHistPP[2]); | |
1012 | gHistPP[3]->GetXaxis()->SetRangeUser(-1.5,1.5); | |
41f2bc59 | 1013 | if(normToTrig) |
1014 | gHistPP[3]->GetZaxis()->SetTitle("#frac{1}{N_{trig}}#frac{d^{2}N_{assoc}}{d#Delta#eta#Delta#varphi} (rad^{-1})"); | |
1015 | else | |
1016 | gHistPP[3]->GetZaxis()->SetTitle("C_{++}(#Delta#eta,#Delta#varphi)"); | |
2b4abbc5 | 1017 | //gHistPP[3]->SetTitle("C_{++}(#Delta#eta,#Delta#varphi)"); |
3ce45c12 | 1018 | cPP[3] = new TCanvas("cPP3","",200,300,600,500); |
1019 | cPP[3]->SetFillColor(10); | |
1020 | cPP[3]->SetHighLightColor(10); | |
1021 | gHistPP[3]->DrawCopy("surf1fb"); | |
1022 | gPad->SetTheta(30); // default is 30 | |
1023 | //gPad->SetPhi(130); // default is 30 | |
1024 | gPad->SetPhi(-60); // default is 30 | |
1025 | gPad->Update(); | |
1026 | pngName = "CorrelationFunction.Centrality"; | |
1027 | pngName += centralityArray[gCentrality-1]; | |
1028 | pngName += ".Psi"; pngName += psiMin; pngName += "To"; pngName += psiMax; | |
1029 | pngName += ".PositivePositive.png"; | |
1030 | //cPP[3]->SaveAs(pngName.Data()); | |
1031 | } | |
52daf7b2 | 1032 | |
1033 | //(--) | |
32e94079 | 1034 | if(eventClass == "Centrality"){ |
1035 | histoTitle = "(--) | Centrality: "; | |
1036 | histoTitle += psiMin; | |
1037 | histoTitle += " - "; | |
1038 | histoTitle += psiMax; | |
1039 | histoTitle += " % "; | |
3b8a460b | 1040 | histoTitle += " (0^{o} < #varphi^{t} - #Psi_{2} < 180^{o})"; |
32e94079 | 1041 | } |
1042 | else if(eventClass == "Multiplicity"){ | |
1043 | histoTitle = "(--) | Multiplicity: "; | |
1044 | histoTitle += psiMin; | |
1045 | histoTitle += " - "; | |
1046 | histoTitle += psiMax; | |
1047 | histoTitle += " tracks"; | |
3b8a460b | 1048 | histoTitle += " (0^{o} < #varphi^{t} - #Psi_{2} < 180^{o})"; |
32e94079 | 1049 | } |
1050 | else{ // "EventPlane" (default) | |
1051 | histoTitle = "(--) | Centrality: "; | |
1052 | histoTitle += centralityArray[gCentrality-1]; | |
1053 | histoTitle += "%"; | |
1054 | if((psiMin == -0.5)&&(psiMax == 0.5)) | |
3b8a460b | 1055 | histoTitle += " (-7.5^{o} < #varphi^{t} - #Psi_{2} < 7.5^{o})"; |
32e94079 | 1056 | else if((psiMin == 0.5)&&(psiMax == 1.5)) |
3b8a460b | 1057 | histoTitle += " (37.5^{o} < #varphi^{t} - #Psi_{2} < 52.5^{o})"; |
32e94079 | 1058 | else if((psiMin == 1.5)&&(psiMax == 2.5)) |
3b8a460b | 1059 | histoTitle += " (82.5^{o} < #varphi^{t} - #Psi_{2} < 97.5^{o})"; |
32e94079 | 1060 | else |
3b8a460b | 1061 | histoTitle += " (0^{o} < #varphi^{t} - #Psi_{2} < 180^{o})"; |
32e94079 | 1062 | } |
52daf7b2 | 1063 | |
20006629 | 1064 | gHistNN[0] = b->GetCorrelationFunctionNN(psiMin,psiMax,vertexZMin,vertexZMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax); |
faa03677 | 1065 | if(rebinEta > 1 || rebinPhi > 1){ |
1066 | gHistNN[0]->Rebin2D(rebinEta,rebinPhi); | |
1067 | gHistNN[0]->Scale(1./(Double_t)(rebinEta*rebinPhi)); | |
1068 | } | |
52daf7b2 | 1069 | gHistNN[0]->GetYaxis()->SetTitleOffset(1.5); |
77b9ff18 | 1070 | gHistNN[0]->GetYaxis()->SetTitle("#Delta #varphi (rad)"); |
52daf7b2 | 1071 | gHistNN[0]->SetTitle(histoTitle.Data()); |
1072 | cNN[0] = new TCanvas("cNN0","",300,0,600,500); | |
1073 | cNN[0]->SetFillColor(10); | |
1074 | cNN[0]->SetHighLightColor(10); | |
5de9ad1a | 1075 | gHistNN[0]->DrawCopy("surf1fb"); |
1076 | gPad->SetTheta(30); // default is 30 | |
1077 | gPad->SetPhi(-60); // default is 30 | |
1078 | //gPad->SetPhi(-60); // default is 30 | |
1079 | gPad->Update(); | |
6acdbcb2 | 1080 | pngName = "DeltaPhiDeltaEta.Centrality"; |
52daf7b2 | 1081 | pngName += centralityArray[gCentrality-1]; |
6acdbcb2 | 1082 | pngName += ".Psi"; pngName += psiMin; pngName += "To"; pngName += psiMax; |
1083 | pngName += ".NegativeNegative.png"; | |
5c9b4733 | 1084 | //cNN[0]->SaveAs(pngName.Data()); |
52daf7b2 | 1085 | |
1086 | if(listBFShuffled) { | |
34616eda | 1087 | |
1088 | histoTitle.ReplaceAll("(--)","(--) shuffled"); | |
52daf7b2 | 1089 | |
20006629 | 1090 | gHistNN[1] = bShuffled->GetCorrelationFunctionNN(psiMin,psiMax,vertexZMin,vertexZMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax); |
faa03677 | 1091 | if(rebinEta > 1 || rebinPhi > 1){ |
1092 | gHistNN[1]->Rebin2D(rebinEta,rebinPhi); | |
1093 | gHistNN[1]->Scale(1./(Double_t)(rebinEta*rebinPhi)); | |
1094 | } | |
52daf7b2 | 1095 | gHistNN[1]->GetYaxis()->SetTitleOffset(1.5); |
77b9ff18 | 1096 | gHistNN[1]->GetYaxis()->SetTitle("#Delta #varphi (rad)"); |
52daf7b2 | 1097 | gHistNN[1]->SetTitle(histoTitle.Data()); |
1098 | cNN[1] = new TCanvas("cNN1","",300,100,600,500); | |
1099 | cNN[1]->SetFillColor(10); | |
1100 | cNN[1]->SetHighLightColor(10); | |
5de9ad1a | 1101 | gHistNN[1]->DrawCopy("surf1fb"); |
1102 | gPad->SetTheta(30); // default is 30 | |
1103 | //gPad->SetPhi(130); // default is 30 | |
1104 | gPad->SetPhi(-60); // default is 30 | |
1105 | gPad->Update(); | |
52daf7b2 | 1106 | pngName = "DeltaPhiDeltaEtaShuffled.Centrality"; |
1107 | pngName += centralityArray[gCentrality-1]; | |
1108 | pngName += ".Psi"; pngName += psiMin; pngName += "To"; pngName += psiMax; | |
1109 | pngName += ".NegativeNegative.png"; | |
5c9b4733 | 1110 | //cNN[1]->SaveAs(pngName.Data()); |
52daf7b2 | 1111 | } |
1112 | ||
1113 | if(listBFMixed) { | |
34616eda | 1114 | |
1115 | if(histoTitle.Contains("shuffled")) histoTitle.ReplaceAll("(--) shuffled","(--) mixed"); | |
1116 | else histoTitle.ReplaceAll("(--)","(--) mixed"); | |
52daf7b2 | 1117 | |
742af4bd | 1118 | // if normalization to trigger then do not divide Event mixing by number of trigger particles |
20006629 | 1119 | gHistNN[2] = bMixed->GetCorrelationFunctionNN(psiMin,psiMax,vertexZMin,vertexZMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax); |
faa03677 | 1120 | if(rebinEta > 1 || rebinPhi > 1){ |
1121 | gHistNN[2]->Rebin2D(rebinEta,rebinPhi); | |
1122 | gHistNN[2]->Scale(1./(Double_t)(rebinEta*rebinPhi)); | |
1123 | } | |
742af4bd | 1124 | // normalization to 1 at (0,0) --> Jan Fietes method |
1125 | if(normToTrig){ | |
1126 | Double_t mixedNorm = gHistNN[2]->Integral(gHistNN[2]->GetXaxis()->FindBin(0-10e-5),gHistNN[2]->GetXaxis()->FindBin(0+10e-5),1,gHistNN[2]->GetNbinsX()); | |
1127 | mixedNorm /= gHistNN[2]->GetNbinsY()*(gHistNN[2]->GetXaxis()->FindBin(0.01) - gHistNN[2]->GetXaxis()->FindBin(-0.01) + 1); | |
1128 | gHistNN[2]->Scale(1./mixedNorm); | |
1129 | } | |
1130 | ||
52daf7b2 | 1131 | gHistNN[2]->GetYaxis()->SetTitleOffset(1.5); |
77b9ff18 | 1132 | gHistNN[2]->GetYaxis()->SetTitle("#Delta #varphi (rad)"); |
52daf7b2 | 1133 | gHistNN[2]->SetTitle(histoTitle.Data()); |
1134 | cNN[2] = new TCanvas("cNN2","",300,200,600,500); | |
1135 | cNN[2]->SetFillColor(10); | |
1136 | cNN[2]->SetHighLightColor(10); | |
5de9ad1a | 1137 | gHistNN[2]->DrawCopy("surf1fb"); |
1138 | gPad->SetTheta(30); // default is 30 | |
1139 | //gPad->SetPhi(130); // default is 30 | |
1140 | gPad->SetPhi(-60); // default is 30 | |
1141 | gPad->Update(); | |
52daf7b2 | 1142 | pngName = "DeltaPhiDeltaEtaMixed.Centrality"; |
1143 | pngName += centralityArray[gCentrality-1]; | |
1144 | pngName += ".Psi"; pngName += psiMin; pngName += "To"; pngName += psiMax; | |
1145 | pngName += ".NegativeNegative.png"; | |
5c9b4733 | 1146 | //cNN[2]->SaveAs(pngName.Data()); |
77b9ff18 | 1147 | |
1148 | //Correlation function (--) | |
34616eda | 1149 | gHistNN[3] = b->GetCorrelationFunction("NN",psiMin,psiMax,vertexZMin,vertexZMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax,bMixed); |
77b9ff18 | 1150 | gHistNN[3]->GetXaxis()->SetRangeUser(-1.5,1.5); |
41f2bc59 | 1151 | if(normToTrig) |
1152 | gHistNN[3]->GetZaxis()->SetTitle("#frac{1}{N_{trig}}#frac{d^{2}N_{assoc}}{d#Delta#eta#Delta#varphi} (rad^{-1})"); | |
1153 | else | |
1154 | gHistNN[3]->GetZaxis()->SetTitle("C_{--}(#Delta#eta,#Delta#varphi)"); | |
2b4abbc5 | 1155 | // gHistNN[3]->SetTitle("C_{--}(#Delta#eta,#Delta#varphi)"); |
77b9ff18 | 1156 | cNN[3] = new TCanvas("cNN3","",300,300,600,500); |
1157 | cNN[3]->SetFillColor(10); | |
1158 | cNN[3]->SetHighLightColor(10); | |
1159 | gHistNN[3]->DrawCopy("surf1fb"); | |
1160 | gPad->SetTheta(30); // default is 30 | |
1161 | //gPad->SetPhi(130); // default is 30 | |
1162 | gPad->SetPhi(-60); // default is 30 | |
1163 | gPad->Update(); | |
1164 | pngName = "CorrelationFunction.Centrality"; | |
1165 | pngName += centralityArray[gCentrality-1]; | |
1166 | pngName += ".Psi"; pngName += psiMin; pngName += "To"; pngName += psiMax; | |
1167 | pngName += ".NegativeNegative.png"; | |
5c9b4733 | 1168 | //cNN[3]->SaveAs(pngName.Data()); |
52daf7b2 | 1169 | } |
3ce45c12 | 1170 | // if no mixing then divide by convoluted histograms |
1171 | else if(listQA){ | |
34616eda | 1172 | |
1173 | if(histoTitle.Contains("shuffled")) histoTitle.ReplaceAll("(--) shuffled","(--) convoluted"); | |
1174 | else histoTitle.ReplaceAll("(--)","(--) convoluted"); | |
3ce45c12 | 1175 | |
faa03677 | 1176 | if(rebinEta > 1 || rebinPhi > 1){ |
1177 | gHistNN[2]->Rebin2D(rebinEta,rebinPhi); | |
1178 | gHistNN[2]->Scale(1./(Double_t)(rebinEta*rebinPhi)); | |
1179 | } | |
3ce45c12 | 1180 | // normalization to 1 at (0,0) --> Jan Fietes method |
1181 | if(normToTrig){ | |
1182 | Double_t mixedNorm = gHistNN[2]->Integral(gHistNN[2]->GetXaxis()->FindBin(0-10e-5),gHistNN[2]->GetXaxis()->FindBin(0+10e-5),1,gHistNN[2]->GetNbinsX()); | |
1183 | mixedNorm /= gHistNN[2]->GetNbinsY()*(gHistNN[2]->GetXaxis()->FindBin(0.01) - gHistNN[2]->GetXaxis()->FindBin(-0.01) + 1); | |
1184 | gHistNN[2]->Scale(1./mixedNorm); | |
1185 | } | |
1186 | ||
1187 | gHistNN[2]->GetYaxis()->SetTitleOffset(1.5); | |
1188 | gHistNN[2]->GetYaxis()->SetTitle("#Delta #varphi (rad)"); | |
1189 | gHistNN[2]->SetTitle(histoTitle.Data()); | |
1190 | cNN[2] = new TCanvas("cNN2","",300,200,600,500); | |
1191 | cNN[2]->SetFillColor(10); | |
1192 | cNN[2]->SetHighLightColor(10); | |
1193 | gHistNN[2]->DrawCopy("surf1fb"); | |
1194 | gPad->SetTheta(30); // default is 30 | |
1195 | //gPad->SetPhi(130); // default is 30 | |
1196 | gPad->SetPhi(-60); // default is 30 | |
1197 | gPad->Update(); | |
1198 | pngName = "DeltaPhiDeltaEtaMixed.Centrality"; | |
1199 | pngName += centralityArray[gCentrality-1]; | |
1200 | pngName += ".Psi"; pngName += psiMin; pngName += "To"; pngName += psiMax; | |
1201 | pngName += ".NegativeNegative.png"; | |
1202 | //cNN[2]->SaveAs(pngName.Data()); | |
1203 | ||
1204 | //Correlation function (--) | |
1205 | gHistNN[3] = dynamic_cast<TH2D *>(gHistNN[0]->Clone()); | |
1206 | gHistNN[3]->Divide(gHistNN[2]); | |
1207 | gHistNN[3]->GetXaxis()->SetRangeUser(-1.5,1.5); | |
41f2bc59 | 1208 | if(normToTrig) |
1209 | gHistNN[3]->GetZaxis()->SetTitle("#frac{1}{N_{trig}}#frac{d^{2}N_{assoc}}{d#Delta#eta#Delta#varphi} (rad^{-1})"); | |
1210 | else | |
1211 | gHistNN[3]->GetZaxis()->SetTitle("C_{--}(#Delta#eta,#Delta#varphi)"); | |
2b4abbc5 | 1212 | //gHistNN[3]->SetTitle("C_{--}(#Delta#eta,#Delta#varphi)"); |
3ce45c12 | 1213 | cNN[3] = new TCanvas("cNN3","",300,300,600,500); |
1214 | cNN[3]->SetFillColor(10); | |
1215 | cNN[3]->SetHighLightColor(10); | |
1216 | gHistNN[3]->DrawCopy("surf1fb"); | |
1217 | gPad->SetTheta(30); // default is 30 | |
1218 | //gPad->SetPhi(130); // default is 30 | |
1219 | gPad->SetPhi(-60); // default is 30 | |
1220 | gPad->Update(); | |
1221 | pngName = "CorrelationFunction.Centrality"; | |
1222 | pngName += centralityArray[gCentrality-1]; | |
1223 | pngName += ".Psi"; pngName += psiMin; pngName += "To"; pngName += psiMax; | |
1224 | pngName += ".NegativeNegative.png"; | |
1225 | //cNN[3]->SaveAs(pngName.Data()); | |
1226 | } | |
5c9b4733 | 1227 | |
1228 | //Write to output file | |
32e94079 | 1229 | TString newFileName = "correlationFunction."; |
1230 | if(eventClass == "Centrality"){ | |
1231 | newFileName += Form("Centrality%.1fTo%.1f",psiMin,psiMax); | |
1232 | newFileName += ".PsiAll.PttFrom"; | |
1233 | } | |
1234 | else if(eventClass == "Multiplicity"){ | |
1235 | newFileName += Form("Multiplicity%.0fTo%.0f",psiMin,psiMax); | |
1236 | newFileName += ".PsiAll.PttFrom"; | |
1237 | } | |
1238 | else{ // "EventPlane" (default) | |
1239 | newFileName += "Centrality"; | |
1240 | newFileName += gCentrality; newFileName += ".Psi"; | |
1241 | if((psiMin == -0.5)&&(psiMax == 0.5)) newFileName += "InPlane.Ptt"; | |
1242 | else if((psiMin == 0.5)&&(psiMax == 1.5)) newFileName += "Intermediate.Ptt"; | |
1243 | else if((psiMin == 1.5)&&(psiMax == 2.5)) newFileName += "OutOfPlane.Ptt"; | |
1244 | else if((psiMin == 2.5)&&(psiMax == 3.5)) newFileName += "Rest.PttFrom"; | |
1245 | else newFileName += "All.PttFrom"; | |
1246 | } | |
5c9b4733 | 1247 | newFileName += Form("%.1f",ptTriggerMin); newFileName += "To"; |
1248 | newFileName += Form("%.1f",ptTriggerMax); newFileName += "PtaFrom"; | |
1249 | newFileName += Form("%.1f",ptAssociatedMin); newFileName += "To"; | |
1250 | newFileName += Form("%.1f",ptAssociatedMax); | |
09b14834 | 1251 | |
1252 | newFileName += "_"; | |
1253 | newFileName += Form("%.1f",psiMin); | |
1254 | newFileName += "-"; | |
1255 | newFileName += Form("%.1f",psiMax); | |
5c9b4733 | 1256 | newFileName += ".root"; |
09b14834 | 1257 | |
5c9b4733 | 1258 | TFile *newFile = TFile::Open(newFileName.Data(),"recreate"); |
1259 | gHistPN[0]->SetName("gHistPNRaw"); gHistPN[0]->Write(); | |
1260 | gHistNP[0]->SetName("gHistNPRaw"); gHistNP[0]->Write(); | |
1261 | gHistPP[0]->SetName("gHistPPRaw"); gHistPP[0]->Write(); | |
1262 | gHistNN[0]->SetName("gHistNNRaw"); gHistNN[0]->Write(); | |
1263 | if(listBFShuffled) { | |
1264 | gHistPN[1]->SetName("gHistPNShuffled"); gHistPN[1]->Write(); | |
1265 | gHistNP[1]->SetName("gHistNPShuffled"); gHistNP[1]->Write(); | |
1266 | gHistPP[1]->SetName("gHistPPShuffled"); gHistPP[1]->Write(); | |
1267 | gHistNN[1]->SetName("gHistNNShuffled"); gHistNN[1]->Write(); | |
1268 | } | |
3ce45c12 | 1269 | if(listBFMixed || (!listBFMixed&&listQA)) { |
5c9b4733 | 1270 | gHistPN[2]->SetName("gHistPNMixed"); gHistPN[2]->Write(); |
1271 | gHistNP[2]->SetName("gHistNPMixed"); gHistNP[2]->Write(); | |
1272 | gHistPP[2]->SetName("gHistPPMixed"); gHistPP[2]->Write(); | |
1273 | gHistNN[2]->SetName("gHistNNMixed"); gHistNN[2]->Write(); | |
1274 | ||
1275 | gHistPN[3]->SetName("gHistPNCorrelationFunctions"); gHistPN[3]->Write(); | |
1276 | gHistNP[3]->SetName("gHistNPCorrelationFunctions"); gHistNP[3]->Write(); | |
1277 | gHistPP[3]->SetName("gHistPPCorrelationFunctions"); gHistPP[3]->Write(); | |
1278 | gHistNN[3]->SetName("gHistNNCorrelationFunctions"); gHistNN[3]->Write(); | |
1279 | } | |
1280 | newFile->Close(); | |
07d0a35c | 1281 | |
1282 | // some cleaning | |
1283 | for(Int_t i = 0; i < 4; i++){ | |
1284 | ||
1285 | if(!listBFShuffled && i == 1) continue; | |
1286 | if(!listBFMixed && (i == 2 || i == 3)) continue; | |
1287 | ||
1288 | if(gHistPP[i]) delete gHistPP[i]; | |
1289 | if(gHistPN[i]) delete gHistPN[i]; | |
1290 | if(gHistNP[i]) delete gHistNP[i]; | |
1291 | if(gHistNN[i]) delete gHistNN[i]; | |
1292 | ||
1293 | if(cPN[i]) delete cPN[i]; | |
1294 | if(cNP[i]) delete cNP[i]; | |
1295 | if(cPP[i]) delete cPP[i]; | |
1296 | if(cNN[i]) delete cNN[i]; | |
1297 | } | |
1298 | ||
1299 | delete hP; | |
1300 | delete hN; | |
1301 | delete hPP; | |
1302 | delete hPN; | |
1303 | delete hNP; | |
1304 | delete hNN; | |
1305 | ||
1306 | delete hPMixed; | |
1307 | delete hNMixed; | |
1308 | delete hPPMixed; | |
1309 | delete hPNMixed; | |
1310 | delete hNPMixed; | |
1311 | delete hNNMixed; | |
1312 | ||
1313 | delete hPShuffled; | |
1314 | delete hNShuffled; | |
1315 | delete hPPShuffled; | |
1316 | delete hPNShuffled; | |
1317 | delete hNPShuffled; | |
1318 | delete hNNShuffled; | |
1319 | ||
5c9b4733 | 1320 | } |
1321 | ||
1322 | //____________________________________________________________// | |
3b8a460b | 1323 | void drawCorrelationFunctions(const char* lhcPeriod = "LHC10h", |
1324 | const char* gCentralityEstimator = "V0M", | |
1325 | Int_t gBit = 128, | |
1326 | const char* gEventPlaneEstimator = "VZERO", | |
5c9b4733 | 1327 | Int_t gCentrality = 1, |
1328 | Double_t psiMin = -0.5, Double_t psiMax = 3.5, | |
20006629 | 1329 | Double_t vertexZMin = -10., |
1330 | Double_t vertexZMax = 10., | |
5c9b4733 | 1331 | Double_t ptTriggerMin = -1., |
1332 | Double_t ptTriggerMax = -1., | |
1333 | Double_t ptAssociatedMin = -1., | |
3b8a460b | 1334 | Double_t ptAssociatedMax = -1., |
1335 | Bool_t kFit = kFALSE) { | |
5c9b4733 | 1336 | //Macro that draws the charge dependent correlation functions |
1337 | //for each centrality bin for the different pT of trigger and | |
1338 | //associated particles | |
1339 | //Author: Panos.Christakoglou@nikhef.nl | |
1340 | TGaxis::SetMaxDigits(3); | |
1341 | ||
1342 | //Get the input file | |
09b14834 | 1343 | /* TString filename = lhcPeriod; |
3b8a460b | 1344 | filename += "/Centrality"; filename += gCentralityEstimator; |
1345 | filename += "_Bit"; filename += gBit; | |
1346 | filename += "_"; filename += gEventPlaneEstimator; | |
1347 | filename +="/PttFrom"; | |
1348 | filename += Form("%.1f",ptTriggerMin); filename += "To"; | |
1349 | filename += Form("%.1f",ptTriggerMax); filename += "PtaFrom"; | |
1350 | filename += Form("%.1f",ptAssociatedMin); filename += "To"; | |
09b14834 | 1351 | filename += Form("%.1f",ptAssociatedMax); */ |
1352 | ||
1353 | TString filename = "correlationFunction.Centrality"; | |
5c9b4733 | 1354 | filename += gCentrality; filename += ".Psi"; |
1355 | if((psiMin == -0.5)&&(psiMax == 0.5)) filename += "InPlane.Ptt"; | |
1356 | else if((psiMin == 0.5)&&(psiMax == 1.5)) filename += "Intermediate.Ptt"; | |
1357 | else if((psiMin == 1.5)&&(psiMax == 2.5)) filename += "OutOfPlane.Ptt"; | |
1358 | else if((psiMin == 2.5)&&(psiMax == 3.5)) filename += "Rest.Ptt"; | |
1359 | else filename += "All.PttFrom"; | |
1360 | filename += Form("%.1f",ptTriggerMin); filename += "To"; | |
1361 | filename += Form("%.1f",ptTriggerMax); filename += "PtaFrom"; | |
1362 | filename += Form("%.1f",ptAssociatedMin); filename += "To"; | |
1363 | filename += Form("%.1f",ptAssociatedMax); | |
09b14834 | 1364 | |
1365 | filename += "_"; | |
1366 | filename += Form("%.1f",psiMin); | |
1367 | filename += "-"; | |
1368 | filename += Form("%.1f",psiMax); | |
5c9b4733 | 1369 | filename += ".root"; |
1370 | ||
1371 | //Open the file | |
1372 | TFile *f = TFile::Open(filename.Data()); | |
1373 | if((!f)||(!f->IsOpen())) { | |
1374 | Printf("The file %s is not found. Aborting...",filename); | |
3b8a460b | 1375 | return; |
5c9b4733 | 1376 | } |
1377 | //f->ls(); | |
1378 | ||
1379 | //Latex | |
1380 | TString centralityLatex = "Centrality: "; | |
1381 | centralityLatex += centralityArray[gCentrality-1]; | |
1382 | centralityLatex += "%"; | |
1383 | ||
1384 | TString psiLatex; | |
1385 | if((psiMin == -0.5)&&(psiMax == 0.5)) | |
3b8a460b | 1386 | psiLatex = " -7.5^{o} < #varphi^{t} - #Psi_{2} < 7.5^{o}"; |
5c9b4733 | 1387 | else if((psiMin == 0.5)&&(psiMax == 1.5)) |
3b8a460b | 1388 | psiLatex = " 37.5^{o} < #varphi^{t} - #Psi_{2} < 52.5^{o}"; |
5c9b4733 | 1389 | else if((psiMin == 1.5)&&(psiMax == 2.5)) |
3b8a460b | 1390 | psiLatex = " 82.5^{o} < #varphi^{t} - #Psi_{2} < 97.5^{o}"; |
5c9b4733 | 1391 | else |
3b8a460b | 1392 | psiLatex = " 0^{o} < #varphi^{t} - #Psi_{2} < 180^{o}"; |
5c9b4733 | 1393 | |
1394 | TString pttLatex = Form("%.1f",ptTriggerMin); | |
1395 | pttLatex += " < p_{T,trig} < "; pttLatex += Form("%.1f",ptTriggerMax); | |
1396 | pttLatex += " GeV/c"; | |
1397 | ||
1398 | TString ptaLatex = Form("%.1f",ptAssociatedMin); | |
1399 | ptaLatex += " < p_{T,assoc} < "; ptaLatex += Form("%.1f",ptAssociatedMax); | |
1400 | ptaLatex += " GeV/c"; | |
1401 | ||
1402 | TLatex *latexInfo1 = new TLatex(); | |
1403 | latexInfo1->SetNDC(); | |
1404 | latexInfo1->SetTextSize(0.045); | |
1405 | latexInfo1->SetTextColor(1); | |
1406 | ||
1407 | TString pngName; | |
1408 | ||
1409 | //============================================================// | |
1410 | //Get the +- correlation function | |
1411 | TH2D *gHistPN = dynamic_cast<TH2D *>(f->Get("gHistPNCorrelationFunctions")); | |
1412 | gHistPN->SetStats(kFALSE); | |
2b4abbc5 | 1413 | gHistPN->SetTitle("C_{+-}(#Delta#eta,#Delta#varphi)"); |
3b8a460b | 1414 | gHistPN->GetXaxis()->SetRangeUser(-1.4,1.4); |
5c9b4733 | 1415 | gHistPN->GetXaxis()->CenterTitle(); |
1416 | gHistPN->GetXaxis()->SetTitleOffset(1.2); | |
1417 | gHistPN->GetYaxis()->CenterTitle(); | |
1418 | gHistPN->GetYaxis()->SetTitleOffset(1.2); | |
2b4abbc5 | 1419 | gHistPN->GetZaxis()->SetTitleOffset(1.5); |
5c9b4733 | 1420 | TCanvas *cPN = new TCanvas("cPN","",0,0,600,500); |
1421 | cPN->SetFillColor(10); cPN->SetHighLightColor(10); | |
1422 | cPN->SetLeftMargin(0.15); | |
1423 | gHistPN->DrawCopy("surf1fb"); | |
2b4abbc5 | 1424 | |
5c9b4733 | 1425 | gPad->SetTheta(30); // default is 30 |
1426 | gPad->SetPhi(-60); // default is 30 | |
1427 | gPad->Update(); | |
1428 | ||
3b8a460b | 1429 | latexInfo1->DrawLatex(0.6,0.95,centralityLatex.Data()); |
1430 | latexInfo1->DrawLatex(0.6,0.89,psiLatex.Data()); | |
1431 | latexInfo1->DrawLatex(0.6,0.83,pttLatex.Data()); | |
1432 | latexInfo1->DrawLatex(0.6,0.77,ptaLatex.Data()); | |
5c9b4733 | 1433 | |
1434 | pngName = "CorrelationFunction.Centrality"; | |
1435 | pngName += centralityArray[gCentrality-1]; | |
1436 | pngName += ".Psi"; | |
1437 | if((psiMin == -0.5)&&(psiMax == 0.5)) pngName += "InPlane.Ptt"; | |
1438 | else if((psiMin == 0.5)&&(psiMax == 1.5)) pngName += "Intermediate.Ptt"; | |
1439 | else if((psiMin == 1.5)&&(psiMax == 2.5)) pngName += "OutOfPlane.Ptt"; | |
1440 | else if((psiMin == 2.5)&&(psiMax == 3.5)) pngName += "Rest.Ptt"; | |
1441 | else pngName += "All.PttFrom"; | |
1442 | pngName += Form("%.1f",ptTriggerMin); pngName += "To"; | |
1443 | pngName += Form("%.1f",ptTriggerMax); pngName += "PtaFrom"; | |
1444 | pngName += Form("%.1f",ptAssociatedMin); pngName += "To"; | |
1445 | pngName += Form("%.1f",ptAssociatedMax); | |
1446 | pngName += ".PositiveNegative.png"; | |
1447 | cPN->SaveAs(pngName.Data()); | |
3b8a460b | 1448 | if(kFit) |
20006629 | 1449 | fitCorrelationFunctions(gCentrality, psiMin, psiMax,vertexZMin, vertexZMax, |
3b8a460b | 1450 | ptTriggerMin,ptTriggerMax, |
1451 | ptAssociatedMin, ptAssociatedMax,gHistPN); | |
1452 | ||
5c9b4733 | 1453 | //============================================================// |
1454 | //Get the -+ correlation function | |
1455 | TH2D *gHistNP = dynamic_cast<TH2D *>(f->Get("gHistNPCorrelationFunctions")); | |
1456 | gHistNP->SetStats(kFALSE); | |
2b4abbc5 | 1457 | gHistNP->SetTitle("C_{-+}(#Delta#eta,#Delta#varphi)"); |
3b8a460b | 1458 | gHistNP->GetXaxis()->SetRangeUser(-1.4,1); |
5c9b4733 | 1459 | gHistNP->GetXaxis()->CenterTitle(); |
1460 | gHistNP->GetXaxis()->SetTitleOffset(1.2); | |
1461 | gHistNP->GetYaxis()->CenterTitle(); | |
1462 | gHistNP->GetYaxis()->SetTitleOffset(1.2); | |
2b4abbc5 | 1463 | gHistNP->GetZaxis()->SetTitleOffset(1.5); |
5c9b4733 | 1464 | TCanvas *cNP = new TCanvas("cNP","",50,50,600,500); |
1465 | cNP->SetFillColor(10); cNP->SetHighLightColor(10); | |
1466 | cNP->SetLeftMargin(0.15); | |
1467 | gHistNP->DrawCopy("surf1fb"); | |
2b4abbc5 | 1468 | |
5c9b4733 | 1469 | gPad->SetTheta(30); // default is 30 |
1470 | gPad->SetPhi(-60); // default is 30 | |
1471 | gPad->Update(); | |
1472 | ||
3b8a460b | 1473 | latexInfo1->DrawLatex(0.6,0.95,centralityLatex.Data()); |
1474 | latexInfo1->DrawLatex(0.6,0.89,psiLatex.Data()); | |
1475 | latexInfo1->DrawLatex(0.6,0.83,pttLatex.Data()); | |
1476 | latexInfo1->DrawLatex(0.6,0.77,ptaLatex.Data()); | |
5c9b4733 | 1477 | |
1478 | pngName = "CorrelationFunction.Centrality"; | |
1479 | pngName += centralityArray[gCentrality-1]; | |
1480 | pngName += ".Psi"; | |
1481 | if((psiMin == -0.5)&&(psiMax == 0.5)) pngName += "InPlane.Ptt"; | |
1482 | else if((psiMin == 0.5)&&(psiMax == 1.5)) pngName += "Intermediate.Ptt"; | |
1483 | else if((psiMin == 1.5)&&(psiMax == 2.5)) pngName += "OutOfPlane.Ptt"; | |
1484 | else if((psiMin == 2.5)&&(psiMax == 3.5)) pngName += "Rest.Ptt"; | |
1485 | else pngName += "All.PttFrom"; | |
1486 | pngName += Form("%.1f",ptTriggerMin); pngName += "To"; | |
1487 | pngName += Form("%.1f",ptTriggerMax); pngName += "PtaFrom"; | |
1488 | pngName += Form("%.1f",ptAssociatedMin); pngName += "To"; | |
1489 | pngName += Form("%.1f",ptAssociatedMax); | |
1490 | pngName += ".NegativePositive.png"; | |
1491 | cNP->SaveAs(pngName.Data()); | |
1492 | ||
3b8a460b | 1493 | if(kFit) |
20006629 | 1494 | fitCorrelationFunctions(gCentrality, psiMin, psiMax,vertexZMin, vertexZMax, |
3b8a460b | 1495 | ptTriggerMin,ptTriggerMax, |
1496 | ptAssociatedMin, ptAssociatedMax,gHistNP); | |
1497 | ||
5c9b4733 | 1498 | //============================================================// |
1499 | //Get the ++ correlation function | |
1500 | TH2D *gHistPP = dynamic_cast<TH2D *>(f->Get("gHistPPCorrelationFunctions")); | |
1501 | gHistPP->SetStats(kFALSE); | |
2b4abbc5 | 1502 | gHistPP->SetTitle("C_{++}(#Delta#eta,#Delta#varphi)"); |
3b8a460b | 1503 | gHistPP->GetXaxis()->SetRangeUser(-1.4,1.4); |
5c9b4733 | 1504 | gHistPP->GetXaxis()->CenterTitle(); |
1505 | gHistPP->GetXaxis()->SetTitleOffset(1.2); | |
1506 | gHistPP->GetYaxis()->CenterTitle(); | |
1507 | gHistPP->GetYaxis()->SetTitleOffset(1.2); | |
2b4abbc5 | 1508 | gHistPP->GetZaxis()->SetTitleOffset(1.5); |
5c9b4733 | 1509 | TCanvas *cPP = new TCanvas("cPP","",100,100,600,500); |
1510 | cPP->SetFillColor(10); cPP->SetHighLightColor(10); | |
1511 | cPP->SetLeftMargin(0.15); | |
1512 | gHistPP->DrawCopy("surf1fb"); | |
2b4abbc5 | 1513 | |
5c9b4733 | 1514 | gPad->SetTheta(30); // default is 30 |
1515 | gPad->SetPhi(-60); // default is 30 | |
1516 | gPad->Update(); | |
1517 | ||
3b8a460b | 1518 | latexInfo1->DrawLatex(0.6,0.95,centralityLatex.Data()); |
1519 | latexInfo1->DrawLatex(0.6,0.89,psiLatex.Data()); | |
1520 | latexInfo1->DrawLatex(0.6,0.83,pttLatex.Data()); | |
1521 | latexInfo1->DrawLatex(0.6,0.77,ptaLatex.Data()); | |
5c9b4733 | 1522 | |
1523 | pngName = "CorrelationFunction.Centrality"; | |
1524 | pngName += centralityArray[gCentrality-1]; | |
1525 | pngName += ".Psi"; | |
1526 | if((psiMin == -0.5)&&(psiMax == 0.5)) pngName += "InPlane.Ptt"; | |
1527 | else if((psiMin == 0.5)&&(psiMax == 1.5)) pngName += "Intermediate.Ptt"; | |
1528 | else if((psiMin == 1.5)&&(psiMax == 2.5)) pngName += "OutOfPlane.Ptt"; | |
1529 | else if((psiMin == 2.5)&&(psiMax == 3.5)) pngName += "Rest.Ptt"; | |
1530 | else pngName += "All.PttFrom"; | |
1531 | pngName += Form("%.1f",ptTriggerMin); pngName += "To"; | |
1532 | pngName += Form("%.1f",ptTriggerMax); pngName += "PtaFrom"; | |
1533 | pngName += Form("%.1f",ptAssociatedMin); pngName += "To"; | |
1534 | pngName += Form("%.1f",ptAssociatedMax); | |
1535 | pngName += ".PositivePositive.png"; | |
1536 | cPP->SaveAs(pngName.Data()); | |
1537 | ||
3b8a460b | 1538 | if(kFit) |
20006629 | 1539 | fitCorrelationFunctions(gCentrality, psiMin, psiMax,vertexZMin, vertexZMax, |
3b8a460b | 1540 | ptTriggerMin,ptTriggerMax, |
1541 | ptAssociatedMin, ptAssociatedMax,gHistPP); | |
1542 | ||
5c9b4733 | 1543 | //============================================================// |
1544 | //Get the -- correlation function | |
1545 | TH2D *gHistNN = dynamic_cast<TH2D *>(f->Get("gHistNNCorrelationFunctions")); | |
1546 | gHistNN->SetStats(kFALSE); | |
2b4abbc5 | 1547 | gHistNN->SetTitle("C_{--}(#Delta#eta,#Delta#varphi)"); |
3b8a460b | 1548 | gHistNN->GetXaxis()->SetRangeUser(-1.4,1.4); |
5c9b4733 | 1549 | gHistNN->GetXaxis()->CenterTitle(); |
1550 | gHistNN->GetXaxis()->SetTitleOffset(1.2); | |
1551 | gHistNN->GetYaxis()->CenterTitle(); | |
1552 | gHistNN->GetYaxis()->SetTitleOffset(1.2); | |
2b4abbc5 | 1553 | gHistNN->GetZaxis()->SetTitleOffset(1.5); |
5c9b4733 | 1554 | TCanvas *cNN = new TCanvas("cNN","",150,150,600,500); |
1555 | cNN->SetFillColor(10); cNN->SetHighLightColor(10); | |
1556 | cNN->SetLeftMargin(0.15); | |
1557 | gHistNN->DrawCopy("surf1fb"); | |
2b4abbc5 | 1558 | |
5c9b4733 | 1559 | gPad->SetTheta(30); // default is 30 |
1560 | gPad->SetPhi(-60); // default is 30 | |
1561 | gPad->Update(); | |
1562 | ||
3b8a460b | 1563 | latexInfo1->DrawLatex(0.6,0.95,centralityLatex.Data()); |
1564 | latexInfo1->DrawLatex(0.6,0.89,psiLatex.Data()); | |
1565 | latexInfo1->DrawLatex(0.6,0.83,pttLatex.Data()); | |
1566 | latexInfo1->DrawLatex(0.6,0.77,ptaLatex.Data()); | |
5c9b4733 | 1567 | |
1568 | pngName = "CorrelationFunction.Centrality"; | |
1569 | pngName += centralityArray[gCentrality-1]; | |
1570 | pngName += ".Psi"; | |
1571 | if((psiMin == -0.5)&&(psiMax == 0.5)) pngName += "InPlane.Ptt"; | |
1572 | else if((psiMin == 0.5)&&(psiMax == 1.5)) pngName += "Intermediate.Ptt"; | |
1573 | else if((psiMin == 1.5)&&(psiMax == 2.5)) pngName += "OutOfPlane.Ptt"; | |
1574 | else if((psiMin == 2.5)&&(psiMax == 3.5)) pngName += "Rest.Ptt"; | |
1575 | else pngName += "All.PttFrom"; | |
1576 | pngName += Form("%.1f",ptTriggerMin); pngName += "To"; | |
1577 | pngName += Form("%.1f",ptTriggerMax); pngName += "PtaFrom"; | |
1578 | pngName += Form("%.1f",ptAssociatedMin); pngName += "To"; | |
1579 | pngName += Form("%.1f",ptAssociatedMax); | |
1580 | pngName += ".NegativeNegative.png"; | |
1581 | cNN->SaveAs(pngName.Data()); | |
24ca71a6 | 1582 | |
3b8a460b | 1583 | if(kFit) |
20006629 | 1584 | fitCorrelationFunctions(gCentrality, psiMin, psiMax,vertexZMin, vertexZMax, |
3b8a460b | 1585 | ptTriggerMin,ptTriggerMax, |
1586 | ptAssociatedMin, ptAssociatedMax,gHistNN); | |
a38fd7f3 | 1587 | } |
1588 | ||
3b8a460b | 1589 | //____________________________________________________________// |
2340240c | 1590 | void drawProjections(Bool_t kProjectInEta = kFALSE, |
41f2bc59 | 1591 | Int_t binMin = 1, |
1592 | Int_t binMax = 80, | |
3b8a460b | 1593 | Int_t gCentrality = 1, |
1594 | Double_t psiMin = -0.5, | |
1595 | Double_t psiMax = 3.5, | |
1596 | Double_t ptTriggerMin = -1., | |
1597 | Double_t ptTriggerMax = -1., | |
1598 | Double_t ptAssociatedMin = -1., | |
41f2bc59 | 1599 | Double_t ptAssociatedMax = -1., |
2340240c | 1600 | Bool_t kUseZYAM = kFALSE, |
1601 | TString eventClass = "Centrality") { | |
2b4abbc5 | 1602 | //Macro that draws the charge dependent correlation functions PROJECTIONS |
1603 | //for each centrality bin for the different pT of trigger and | |
1604 | //associated particles | |
1605 | TGaxis::SetMaxDigits(3); | |
1606 | ||
1607 | //Get the input file | |
09b14834 | 1608 | /*TString filename = lhcPeriod; |
3b8a460b | 1609 | filename += "/Centrality"; filename += gCentralityEstimator; |
1610 | filename += "_Bit"; filename += gBit; | |
1611 | filename += "_"; filename += gEventPlaneEstimator; | |
1612 | filename +="/PttFrom"; | |
1613 | filename += Form("%.1f",ptTriggerMin); filename += "To"; | |
1614 | filename += Form("%.1f",ptTriggerMax); filename += "PtaFrom"; | |
1615 | filename += Form("%.1f",ptAssociatedMin); filename += "To"; | |
09b14834 | 1616 | filename += Form("%.1f",ptAssociatedMax); */ |
1617 | ||
2340240c | 1618 | TString filename = "correlationFunction."; |
1619 | if(eventClass == "Centrality"){ | |
1620 | filename += Form("Centrality%.1fTo%.1f",psiMin,psiMax); | |
1621 | filename += ".PsiAll.PttFrom"; | |
1622 | } | |
1623 | else if(eventClass == "Multiplicity"){ | |
1624 | filename += Form("Multiplicity%.0fTo%.0f",psiMin,psiMax); | |
1625 | filename += ".PsiAll.PttFrom"; | |
1626 | } | |
1627 | else{ // "EventPlane" (default) | |
1628 | filename += "Centrality"; | |
1629 | filename += gCentrality; filename += ".Psi"; | |
1630 | if((psiMin == -0.5)&&(psiMax == 0.5)) filename += "InPlane.Ptt"; | |
1631 | else if((psiMin == 0.5)&&(psiMax == 1.5)) filename += "Intermediate.Ptt"; | |
1632 | else if((psiMin == 1.5)&&(psiMax == 2.5)) filename += "OutOfPlane.Ptt"; | |
1633 | else if((psiMin == 2.5)&&(psiMax == 3.5)) filename += "Rest.PttFrom"; | |
1634 | else filename += "All.PttFrom"; | |
1635 | } | |
2b4abbc5 | 1636 | filename += Form("%.1f",ptTriggerMin); filename += "To"; |
1637 | filename += Form("%.1f",ptTriggerMax); filename += "PtaFrom"; | |
1638 | filename += Form("%.1f",ptAssociatedMin); filename += "To"; | |
1639 | filename += Form("%.1f",ptAssociatedMax); | |
2340240c | 1640 | //if(k2pMethod) filename += "_2pMethod"; |
09b14834 | 1641 | |
1642 | filename += "_"; | |
1643 | filename += Form("%.1f",psiMin); | |
1644 | filename += "-"; | |
1645 | filename += Form("%.1f",psiMax); | |
2340240c | 1646 | |
2b4abbc5 | 1647 | filename += ".root"; |
1648 | ||
1649 | //Open the file | |
1650 | TFile *f = TFile::Open(filename.Data()); | |
1651 | if((!f)||(!f->IsOpen())) { | |
1652 | Printf("The file %s is not found. Aborting...",filename); | |
1653 | return listBF; | |
1654 | } | |
1655 | //f->ls(); | |
1656 | ||
1657 | //Latex | |
1658 | TString centralityLatex = "Centrality: "; | |
2340240c | 1659 | if(eventClass == "Centrality") |
1660 | centralityLatex += Form("%.0f - %.0f",psiMin,psiMax); | |
1661 | else | |
1662 | centralityLatex += centralityArray[gCentrality-1]; | |
1663 | centralityLatex += " %"; | |
2b4abbc5 | 1664 | |
1665 | TString psiLatex; | |
1666 | if((psiMin == -0.5)&&(psiMax == 0.5)) | |
3b8a460b | 1667 | psiLatex = " -7.5^{o} < #varphi^{t} - #Psi_{2} < 7.5^{o}"; |
2b4abbc5 | 1668 | else if((psiMin == 0.5)&&(psiMax == 1.5)) |
3b8a460b | 1669 | psiLatex = " 37.5^{o} < #varphi^{t} - #Psi_{2} < 52.5^{o}"; |
2b4abbc5 | 1670 | else if((psiMin == 1.5)&&(psiMax == 2.5)) |
3b8a460b | 1671 | psiLatex = " 82.5^{o} < #varphi^{t} - #Psi_{2} < 97.5^{o}"; |
2b4abbc5 | 1672 | else |
3b8a460b | 1673 | psiLatex = " 0^{o} < #varphi^{t} - #Psi_{2} < 180^{o}"; |
2b4abbc5 | 1674 | |
1675 | TString pttLatex = Form("%.1f",ptTriggerMin); | |
1676 | pttLatex += " < p_{T,trig} < "; pttLatex += Form("%.1f",ptTriggerMax); | |
1677 | pttLatex += " GeV/c"; | |
1678 | ||
1679 | TString ptaLatex = Form("%.1f",ptAssociatedMin); | |
1680 | ptaLatex += " < p_{T,assoc} < "; ptaLatex += Form("%.1f",ptAssociatedMax); | |
1681 | ptaLatex += " GeV/c"; | |
1682 | ||
1683 | TLatex *latexInfo1 = new TLatex(); | |
1684 | latexInfo1->SetNDC(); | |
1685 | latexInfo1->SetTextSize(0.045); | |
1686 | latexInfo1->SetTextColor(1); | |
1687 | ||
1688 | TString pngName; | |
1689 | ||
1690 | //============================================================// | |
1691 | //Get the +- correlation function | |
1692 | TH2D *gHistPN = dynamic_cast<TH2D *>(f->Get("gHistPNCorrelationFunctions")); | |
1693 | gHistPN->SetStats(kFALSE); | |
1694 | gHistPN->SetTitle("C_{+-}(#Delta#eta,#Delta#varphi)"); | |
3b8a460b | 1695 | gHistPN->GetXaxis()->SetRangeUser(-1.4,1.4); |
2b4abbc5 | 1696 | gHistPN->GetXaxis()->CenterTitle(); |
1697 | gHistPN->GetXaxis()->SetTitleOffset(1.2); | |
1698 | gHistPN->GetYaxis()->CenterTitle(); | |
1699 | gHistPN->GetYaxis()->SetTitleOffset(1.2); | |
1700 | gHistPN->GetZaxis()->SetTitleOffset(1.5); | |
1701 | TCanvas *cPN = new TCanvas("cPN","",0,0,600,500); | |
1702 | cPN->SetFillColor(10); | |
1703 | cPN->SetHighLightColor(10); | |
1704 | cPN->SetLeftMargin(0.15); | |
2b4abbc5 | 1705 | |
1706 | //================// | |
3b8a460b | 1707 | TH1D* gHistPNprojection = 0x0; |
1708 | Double_t sum = 0.0; | |
1709 | Double_t gError = 0.0; | |
1710 | Int_t nCounter = 0; | |
41f2bc59 | 1711 | //projection in delta eta |
3b8a460b | 1712 | if(kProjectInEta) { |
1713 | gHistPNprojection = new TH1D("gHistPNprojection","",gHistPN->GetNbinsX(),gHistPN->GetXaxis()->GetXmin(),gHistPN->GetXaxis()->GetXmax()); | |
1714 | for(Int_t iBinX = 1; iBinX <= gHistPN->GetNbinsX(); iBinX++) { | |
1715 | sum = 0.; gError = 0.0; nCounter = 0; | |
41f2bc59 | 1716 | for(Int_t iBinY = binMin; iBinY <= binMax; iBinY++) { |
3b8a460b | 1717 | sum += gHistPN->GetBinContent(iBinX,iBinY); |
1718 | if(gHistPN->GetBinContent(iBinX,iBinY) != 0.) nCounter += 1; | |
1719 | Double_t exy = gHistPN->GetCellError(iBinX,iBinY); | |
1720 | gError += exy*exy; | |
1721 | } | |
1722 | if(nCounter != 0) { | |
1723 | sum /= nCounter; | |
1724 | gError = TMath::Sqrt(gError)/nCounter; | |
1725 | } | |
1726 | gHistPNprojection->SetBinContent(iBinX,sum); | |
1727 | gHistPNprojection->SetBinError(iBinX,gError); | |
1728 | } | |
1729 | gHistPNprojection->GetXaxis()->SetRangeUser(-1.4,1.4); | |
41f2bc59 | 1730 | if(kUseZYAM) |
1731 | gHistPNprojection->GetYaxis()->SetTitle("#frac{1}{N_{trig}}#frac{dN_{assoc}}{#Delta#eta} - b_{ZYAM}"); | |
1732 | else | |
1733 | gHistPNprojection->GetYaxis()->SetTitle("C_{+-}(#Delta#eta)"); | |
3b8a460b | 1734 | gHistPNprojection->GetXaxis()->SetTitle("#Delta#eta"); |
41f2bc59 | 1735 | }//projection in delta eta |
1736 | //projection in delta phi | |
3b8a460b | 1737 | else { |
1738 | gHistPNprojection = new TH1D("gHistPNprojection","",gHistPN->GetNbinsY(),gHistPN->GetYaxis()->GetXmin(),gHistPN->GetYaxis()->GetXmax()); | |
1739 | for(Int_t iBinY = 1; iBinY <= gHistPN->GetNbinsY(); iBinY++) { | |
1740 | sum = 0.; gError = 0.0; nCounter = 0; | |
09b14834 | 1741 | for(Int_t iBinX = binMin; iBinX <= binMax; iBinX++) { |
1742 | //for(Int_t iBinX = 1; iBinX <= gHistPN->GetNbinsX(); iBinX++) { | |
3b8a460b | 1743 | sum += gHistPN->GetBinContent(iBinX,iBinY); |
1744 | if(gHistPN->GetBinContent(iBinX,iBinY) != 0.) nCounter += 1; | |
1745 | Double_t exy = gHistPN->GetCellError(iBinX,iBinY); | |
1746 | gError += exy*exy; | |
1747 | } | |
1748 | if(nCounter != 0) { | |
1749 | sum /= nCounter; | |
1750 | gError = TMath::Sqrt(gError)/nCounter; | |
1751 | } | |
1752 | gHistPNprojection->SetBinContent(iBinY,sum); | |
1753 | gHistPNprojection->SetBinError(iBinY,gError); | |
1754 | } | |
41f2bc59 | 1755 | if(kUseZYAM) |
1756 | gHistPNprojection->GetYaxis()->SetTitle("#frac{1}{N_{trig}}#frac{dN_{assoc}}{#Delta#varphi} - b_{ZYAM} (rad^{-1})"); | |
1757 | else | |
1758 | gHistPNprojection->GetYaxis()->SetTitle("C_{+-}(#Delta#varphi)"); | |
3b8a460b | 1759 | gHistPNprojection->GetXaxis()->SetTitle("#Delta#varphi (rad)"); |
2b4abbc5 | 1760 | } |
41f2bc59 | 1761 | |
3b8a460b | 1762 | //ZYAM |
41f2bc59 | 1763 | if(kUseZYAM) { |
1764 | Double_t reference = gHistPNprojection->GetBinContent(gHistPNprojection->GetMinimumBin()); | |
1765 | for(Int_t iBinX = 1; iBinX <= gHistPNprojection->GetNbinsX(); iBinX++) | |
1766 | gHistPNprojection->SetBinContent(iBinX,gHistPNprojection->GetBinContent(iBinX) - reference); | |
1767 | } | |
3b8a460b | 1768 | |
2b4abbc5 | 1769 | gHistPNprojection->GetYaxis()->SetTitleOffset(1.5); |
3b8a460b | 1770 | gHistPNprojection->SetMarkerStyle(20); |
1771 | gHistPNprojection->SetStats(kFALSE); | |
1772 | gHistPNprojection->DrawCopy("E"); | |
2b4abbc5 | 1773 | //=================// |
1774 | ||
1775 | gPad->SetTheta(30); // default is 30 | |
1776 | gPad->SetPhi(-60); // default is 30 | |
1777 | gPad->Update(); | |
1778 | ||
3b8a460b | 1779 | latexInfo1->DrawLatex(0.6,0.95,centralityLatex.Data()); |
1780 | latexInfo1->DrawLatex(0.6,0.89,psiLatex.Data()); | |
1781 | latexInfo1->DrawLatex(0.6,0.83,pttLatex.Data()); | |
1782 | latexInfo1->DrawLatex(0.6,0.77,ptaLatex.Data()); | |
2b4abbc5 | 1783 | |
2340240c | 1784 | pngName = filename; |
1785 | if(kProjectInEta) pngName.ReplaceAll(".root","_DeltaEtaProjection"); | |
1786 | else pngName.ReplaceAll(".root","_DeltaPhiProjection"); | |
2b4abbc5 | 1787 | pngName += ".PositiveNegative.png"; |
1788 | cPN->SaveAs(pngName.Data()); | |
1789 | ||
1790 | //============================================================// | |
1791 | //Get the -+ correlation function | |
1792 | TH2D *gHistNP = dynamic_cast<TH2D *>(f->Get("gHistNPCorrelationFunctions")); | |
1793 | gHistNP->SetStats(kFALSE); | |
1794 | gHistNP->SetTitle("C_{-+}(#Delta#eta,#Delta#varphi)"); | |
3b8a460b | 1795 | gHistNP->GetXaxis()->SetRangeUser(-1.4,1.4); |
2b4abbc5 | 1796 | gHistNP->GetXaxis()->CenterTitle(); |
1797 | gHistNP->GetXaxis()->SetTitleOffset(1.2); | |
1798 | gHistNP->GetYaxis()->CenterTitle(); | |
1799 | gHistNP->GetYaxis()->SetTitleOffset(1.2); | |
1800 | gHistNP->GetZaxis()->SetTitleOffset(1.5); | |
1801 | TCanvas *cNP = new TCanvas("cNP","",50,50,600,500); | |
1802 | cNP->SetFillColor(10); cNP->SetHighLightColor(10); | |
1803 | cNP->SetLeftMargin(0.15); | |
2b4abbc5 | 1804 | |
1805 | //================// | |
3b8a460b | 1806 | TH1D* gHistNPprojection = 0x0; |
1807 | Double_t sum = 0.0; | |
1808 | Double_t gError = 0.0; | |
1809 | Int_t nCounter = 0; | |
1810 | if(kProjectInEta) { | |
1811 | gHistNPprojection = new TH1D("gHistNPprojection","",gHistNP->GetNbinsX(),gHistNP->GetXaxis()->GetXmin(),gHistNP->GetXaxis()->GetXmax()); | |
1812 | for(Int_t iBinX = 1; iBinX <= gHistNP->GetNbinsX(); iBinX++) { | |
1813 | sum = 0.; gError = 0.0; nCounter = 0; | |
09b14834 | 1814 | for(Int_t iBinY = binMin; iBinY <= binMax; iBinY++) { |
1815 | //for(Int_t iBinY = 1; iBinY <= gHistNP->GetNbinsY(); iBinY++) { | |
3b8a460b | 1816 | sum += gHistNP->GetBinContent(iBinX,iBinY); |
1817 | if(gHistNP->GetBinContent(iBinX,iBinY) != 0.) nCounter += 1; | |
1818 | Double_t exy = gHistNP->GetCellError(iBinX,iBinY); | |
1819 | gError += exy*exy; | |
1820 | } | |
1821 | if(nCounter != 0) { | |
1822 | sum /= nCounter; | |
1823 | gError = TMath::Sqrt(gError)/nCounter; | |
1824 | } | |
1825 | gHistNPprojection->SetBinContent(iBinX,sum); | |
1826 | gHistNPprojection->SetBinError(iBinX,gError); | |
1827 | } | |
1828 | gHistNPprojection->GetXaxis()->SetRangeUser(-1.4,1.4); | |
41f2bc59 | 1829 | if(kUseZYAM) |
1830 | gHistNPprojection->GetYaxis()->SetTitle("#frac{1}{N_{trig}}#frac{dN_{assoc}}{#Delta#eta} - b_{ZYAM}"); | |
1831 | else | |
1832 | gHistNPprojection->GetYaxis()->SetTitle("C_{-+}(#Delta#eta)"); | |
3b8a460b | 1833 | gHistNPprojection->GetXaxis()->SetTitle("#Delta#eta"); |
2b4abbc5 | 1834 | } |
3b8a460b | 1835 | else { |
1836 | gHistNPprojection = new TH1D("gHistNPprojection","",gHistNP->GetNbinsY(),gHistNP->GetYaxis()->GetXmin(),gHistNP->GetYaxis()->GetXmax()); | |
1837 | for(Int_t iBinY = 1; iBinY <= gHistNP->GetNbinsY(); iBinY++) { | |
1838 | sum = 0.; gError = 0.0; nCounter = 0; | |
09b14834 | 1839 | for(Int_t iBinX = binMin; iBinX <= binMax; iBinX++) { |
1840 | //for(Int_t iBinX = 1; iBinX <= gHistNP->GetNbinsX(); iBinX++) { | |
3b8a460b | 1841 | sum += gHistNP->GetBinContent(iBinX,iBinY); |
1842 | if(gHistNP->GetBinContent(iBinX,iBinY) != 0.) nCounter += 1; | |
1843 | Double_t exy = gHistNP->GetCellError(iBinX,iBinY); | |
1844 | gError += exy*exy; | |
1845 | } | |
1846 | if(nCounter != 0) { | |
1847 | sum /= nCounter; | |
1848 | gError = TMath::Sqrt(gError)/nCounter; | |
1849 | } | |
1850 | gHistNPprojection->SetBinContent(iBinY,sum); | |
1851 | gHistNPprojection->SetBinError(iBinY,gError); | |
1852 | } | |
41f2bc59 | 1853 | if(kUseZYAM) |
1854 | gHistNPprojection->GetYaxis()->SetTitle("#frac{1}{N_{trig}}#frac{dN_{assoc}}{#Delta#varphi} - b_{ZYAM} (rad^{-1})"); | |
1855 | else | |
1856 | gHistNPprojection->GetYaxis()->SetTitle("C_{-+}(#Delta#varphi)"); | |
3b8a460b | 1857 | gHistNPprojection->GetXaxis()->SetTitle("#Delta#varphi (rad)"); |
2b4abbc5 | 1858 | } |
3b8a460b | 1859 | //ZYAM |
41f2bc59 | 1860 | if(kUseZYAM) { |
1861 | Double_t reference = gHistNPprojection->GetBinContent(gHistNPprojection->GetMinimumBin()); | |
3b8a460b | 1862 | for(Int_t iBinX = 1; iBinX <= gHistNPprojection->GetNbinsX(); iBinX++) |
1863 | gHistNPprojection->SetBinContent(iBinX,gHistNPprojection->GetBinContent(iBinX) - reference); | |
41f2bc59 | 1864 | } |
3b8a460b | 1865 | |
2b4abbc5 | 1866 | gHistNPprojection->GetYaxis()->SetTitleOffset(1.5); |
3b8a460b | 1867 | gHistNPprojection->SetMarkerStyle(20); |
1868 | gHistNPprojection->SetStats(kFALSE); | |
1869 | gHistNPprojection->DrawCopy("E"); | |
2b4abbc5 | 1870 | //================// |
1871 | ||
1872 | gPad->SetTheta(30); // default is 30 | |
1873 | gPad->SetPhi(-60); // default is 30 | |
1874 | gPad->Update(); | |
1875 | ||
3b8a460b | 1876 | latexInfo1->DrawLatex(0.6,0.95,centralityLatex.Data()); |
1877 | latexInfo1->DrawLatex(0.6,0.89,psiLatex.Data()); | |
1878 | latexInfo1->DrawLatex(0.6,0.83,pttLatex.Data()); | |
1879 | latexInfo1->DrawLatex(0.6,0.77,ptaLatex.Data()); | |
2b4abbc5 | 1880 | |
2340240c | 1881 | pngName = filename; |
1882 | if(kProjectInEta) pngName.ReplaceAll(".root","_DeltaEtaProjection"); | |
1883 | else pngName.ReplaceAll(".root","_DeltaPhiProjection"); | |
2b4abbc5 | 1884 | pngName += ".NegativePositive.png"; |
1885 | cNP->SaveAs(pngName.Data()); | |
1886 | ||
1887 | //============================================================// | |
1888 | //Get the ++ correlation function | |
1889 | TH2D *gHistPP = dynamic_cast<TH2D *>(f->Get("gHistPPCorrelationFunctions")); | |
1890 | gHistPP->SetStats(kFALSE); | |
1891 | gHistPP->SetTitle("C_{++}(#Delta#eta,#Delta#varphi)"); | |
3b8a460b | 1892 | gHistPP->GetXaxis()->SetRangeUser(-1.4,1.4); |
2b4abbc5 | 1893 | gHistPP->GetXaxis()->CenterTitle(); |
1894 | gHistPP->GetXaxis()->SetTitleOffset(1.2); | |
1895 | gHistPP->GetYaxis()->CenterTitle(); | |
1896 | gHistPP->GetYaxis()->SetTitleOffset(1.2); | |
1897 | gHistPP->GetZaxis()->SetTitleOffset(1.5); | |
1898 | TCanvas *cPP = new TCanvas("cPP","",100,100,600,500); | |
1899 | cPP->SetFillColor(10); cPP->SetHighLightColor(10); | |
1900 | cPP->SetLeftMargin(0.15); | |
3b8a460b | 1901 | |
2b4abbc5 | 1902 | //=================// |
1903 | TH1D* gHistPPprojection = 0x0; | |
3b8a460b | 1904 | Double_t sum = 0.0; |
1905 | Double_t gError = 0.0; | |
1906 | Int_t nCounter = 0; | |
1907 | if(kProjectInEta) { | |
1908 | gHistPPprojection = new TH1D("gHistPPprojection","",gHistPP->GetNbinsX(),gHistPP->GetXaxis()->GetXmin(),gHistPP->GetXaxis()->GetXmax()); | |
1909 | for(Int_t iBinX = 1; iBinX <= gHistPP->GetNbinsX(); iBinX++) { | |
1910 | sum = 0.; gError = 0.0; nCounter = 0; | |
09b14834 | 1911 | for(Int_t iBinY = binMin; iBinY <= binMax; iBinY++) { |
1912 | //for(Int_t iBinY = 1; iBinY <= gHistPP->GetNbinsY(); iBinY++) { | |
3b8a460b | 1913 | sum += gHistPP->GetBinContent(iBinX,iBinY); |
1914 | if(gHistPP->GetBinContent(iBinX,iBinY) != 0.) nCounter += 1; | |
1915 | Double_t exy = gHistPP->GetCellError(iBinX,iBinY); | |
1916 | gError += exy*exy; | |
1917 | } | |
1918 | if(nCounter != 0) { | |
1919 | sum /= nCounter; | |
1920 | gError = TMath::Sqrt(gError)/nCounter; | |
1921 | } | |
1922 | gHistPPprojection->SetBinContent(iBinX,sum); | |
1923 | gHistPPprojection->SetBinError(iBinX,gError); | |
1924 | } | |
1925 | gHistPPprojection->GetXaxis()->SetRangeUser(-1.4,1.4); | |
41f2bc59 | 1926 | if(kUseZYAM) |
1927 | gHistPPprojection->GetYaxis()->SetTitle("#frac{1}{N_{trig}}#frac{dN_{assoc}}{#Delta#eta} - b_{ZYAM}"); | |
1928 | else | |
1929 | gHistPPprojection->GetYaxis()->SetTitle("C_{++}(#Delta#eta)"); | |
3b8a460b | 1930 | gHistPPprojection->GetXaxis()->SetTitle("#Delta#eta"); |
2b4abbc5 | 1931 | } |
3b8a460b | 1932 | else { |
1933 | gHistPPprojection = new TH1D("gHistPPprojection","",gHistPP->GetNbinsY(),gHistPP->GetYaxis()->GetXmin(),gHistPP->GetYaxis()->GetXmax()); | |
1934 | for(Int_t iBinY = 1; iBinY <= gHistPP->GetNbinsY(); iBinY++) { | |
1935 | sum = 0.; gError = 0.0; nCounter = 0; | |
09b14834 | 1936 | for(Int_t iBinX = binMin; iBinX <= binMax; iBinX++) { |
1937 | //for(Int_t iBinX = 1; iBinX <= gHistPP->GetNbinsX(); iBinX++) { | |
3b8a460b | 1938 | sum += gHistPP->GetBinContent(iBinX,iBinY); |
1939 | if(gHistPP->GetBinContent(iBinX,iBinY) != 0.) nCounter += 1; | |
1940 | Double_t exy = gHistPP->GetCellError(iBinX,iBinY); | |
1941 | gError += exy*exy; | |
1942 | } | |
1943 | if(nCounter != 0) { | |
1944 | sum /= nCounter; | |
1945 | gError = TMath::Sqrt(gError)/nCounter; | |
1946 | } | |
1947 | gHistPPprojection->SetBinContent(iBinY,sum); | |
1948 | gHistPPprojection->SetBinError(iBinY,gError); | |
1949 | } | |
41f2bc59 | 1950 | if(kUseZYAM) |
1951 | gHistPPprojection->GetYaxis()->SetTitle("#frac{1}{N_{trig}}#frac{dN_{assoc}}{#Delta#varphi} - b_{ZYAM} (rad^{-1})"); | |
1952 | else | |
1953 | gHistPPprojection->GetYaxis()->SetTitle("C_{++}(#Delta#varphi)"); | |
3b8a460b | 1954 | gHistPPprojection->GetXaxis()->SetTitle("#Delta#varphi (rad)"); |
2b4abbc5 | 1955 | } |
3b8a460b | 1956 | //ZYAM |
41f2bc59 | 1957 | if(kUseZYAM) { |
1958 | Double_t reference = gHistPPprojection->GetBinContent(gHistPPprojection->GetMinimumBin()); | |
1959 | for(Int_t iBinX = 1; iBinX <= gHistPPprojection->GetNbinsX(); iBinX++) | |
1960 | gHistPPprojection->SetBinContent(iBinX,gHistPPprojection->GetBinContent(iBinX) - reference); | |
1961 | } | |
1962 | ||
2b4abbc5 | 1963 | gHistPPprojection->GetYaxis()->SetTitleOffset(1.5); |
3b8a460b | 1964 | gHistPPprojection->SetMarkerStyle(20); |
1965 | gHistPPprojection->SetStats(kFALSE); | |
1966 | gHistPPprojection->DrawCopy("E"); | |
2b4abbc5 | 1967 | //================// |
1968 | ||
1969 | gPad->SetTheta(30); // default is 30 | |
1970 | gPad->SetPhi(-60); // default is 30 | |
1971 | gPad->Update(); | |
1972 | ||
3b8a460b | 1973 | latexInfo1->DrawLatex(0.6,0.95,centralityLatex.Data()); |
1974 | latexInfo1->DrawLatex(0.6,0.89,psiLatex.Data()); | |
1975 | latexInfo1->DrawLatex(0.6,0.83,pttLatex.Data()); | |
1976 | latexInfo1->DrawLatex(0.6,0.77,ptaLatex.Data()); | |
2b4abbc5 | 1977 | |
2340240c | 1978 | pngName = filename; |
1979 | if(kProjectInEta) pngName.ReplaceAll(".root","_DeltaEtaProjection"); | |
1980 | else pngName.ReplaceAll(".root","_DeltaPhiProjection"); | |
2b4abbc5 | 1981 | pngName += ".PositivePositive.png"; |
1982 | cPP->SaveAs(pngName.Data()); | |
1983 | ||
1984 | //============================================================// | |
1985 | //Get the -- correlation function | |
1986 | TH2D *gHistNN = dynamic_cast<TH2D *>(f->Get("gHistNNCorrelationFunctions")); | |
1987 | gHistNN->SetStats(kFALSE); | |
1988 | gHistNN->SetTitle("C_{--}(#Delta#eta,#Delta#varphi)"); | |
3b8a460b | 1989 | gHistNN->GetXaxis()->SetRangeUser(-1.4,1.4); |
2b4abbc5 | 1990 | gHistNN->GetXaxis()->CenterTitle(); |
1991 | gHistNN->GetXaxis()->SetTitleOffset(1.2); | |
1992 | gHistNN->GetYaxis()->CenterTitle(); | |
1993 | gHistNN->GetYaxis()->SetTitleOffset(1.2); | |
1994 | gHistNN->GetZaxis()->SetTitleOffset(1.5); | |
1995 | TCanvas *cNN = new TCanvas("cNN","",150,150,600,500); | |
1996 | cNN->SetFillColor(10); cNN->SetHighLightColor(10); | |
1997 | cNN->SetLeftMargin(0.15); | |
2b4abbc5 | 1998 | |
1999 | //=================// | |
3b8a460b | 2000 | TH1D* gHistNNprojection = 0x0; |
2001 | Double_t sum = 0.0; | |
2002 | Double_t gError = 0.0; | |
2003 | Int_t nCounter = 0; | |
2004 | if(kProjectInEta) { | |
2005 | gHistNNprojection = new TH1D("gHistNNprojection","",gHistNN->GetNbinsX(),gHistNN->GetXaxis()->GetXmin(),gHistNN->GetXaxis()->GetXmax()); | |
2006 | for(Int_t iBinX = 1; iBinX <= gHistNN->GetNbinsX(); iBinX++) { | |
2007 | sum = 0.; gError = 0.0; nCounter = 0; | |
09b14834 | 2008 | for(Int_t iBinY = binMin; iBinY <= binMax; iBinY++) { |
2009 | //for(Int_t iBinY = 1; iBinY <= gHistNN->GetNbinsY(); iBinY++) { | |
3b8a460b | 2010 | sum += gHistNN->GetBinContent(iBinX,iBinY); |
2011 | if(gHistNN->GetBinContent(iBinX,iBinY) != 0.) nCounter += 1; | |
2012 | Double_t exy = gHistNN->GetCellError(iBinX,iBinY); | |
2013 | gError += exy*exy; | |
2014 | } | |
2015 | if(nCounter != 0) { | |
2016 | sum /= nCounter; | |
2017 | gError = TMath::Sqrt(gError)/nCounter; | |
2018 | } | |
2019 | gHistNNprojection->SetBinContent(iBinX,sum); | |
2020 | gHistNNprojection->SetBinError(iBinX,gError); | |
2021 | } | |
2022 | gHistNNprojection->GetXaxis()->SetRangeUser(-1.4,1.4); | |
41f2bc59 | 2023 | if(kUseZYAM) |
2024 | gHistNNprojection->GetYaxis()->SetTitle("#frac{1}{N_{trig}}#frac{dN_{assoc}}{#Delta#eta} - b_{ZYAM}"); | |
2025 | else | |
2026 | gHistNNprojection->GetYaxis()->SetTitle("C_{--}(#Delta#eta)"); | |
3b8a460b | 2027 | gHistNNprojection->GetXaxis()->SetTitle("#Delta#eta"); |
2b4abbc5 | 2028 | } |
3b8a460b | 2029 | else { |
2030 | gHistNNprojection = new TH1D("gHistNNprojection","",gHistNN->GetNbinsY(),gHistNN->GetYaxis()->GetXmin(),gHistNN->GetYaxis()->GetXmax()); | |
2031 | for(Int_t iBinY = 1; iBinY <= gHistNN->GetNbinsY(); iBinY++) { | |
2032 | sum = 0.; gError = 0.0; nCounter = 0; | |
09b14834 | 2033 | for(Int_t iBinX = binMin; iBinX <= binMax; iBinX++) { |
2034 | //for(Int_t iBinX = 1; iBinX <= gHistNN->GetNbinsX(); iBinX++) { | |
3b8a460b | 2035 | sum += gHistNN->GetBinContent(iBinX,iBinY); |
2036 | if(gHistNN->GetBinContent(iBinX,iBinY) != 0.) nCounter += 1; | |
2037 | Double_t exy = gHistNN->GetCellError(iBinX,iBinY); | |
2038 | gError += exy*exy; | |
2039 | } | |
2040 | if(nCounter != 0) { | |
2041 | sum /= nCounter; | |
2042 | gError = TMath::Sqrt(gError)/nCounter; | |
2043 | } | |
2044 | gHistNNprojection->SetBinContent(iBinY,sum); | |
2045 | gHistNNprojection->SetBinError(iBinY,gError); | |
2046 | } | |
41f2bc59 | 2047 | if(kUseZYAM) |
2048 | gHistNNprojection->GetYaxis()->SetTitle("#frac{1}{N_{trig}}#frac{dN_{assoc}}{#Delta#varphi} - b_{ZYAM} (rad^{-1})"); | |
2049 | else | |
2050 | gHistNNprojection->GetYaxis()->SetTitle("C_{--}(#Delta#varphi)"); | |
3b8a460b | 2051 | gHistNNprojection->GetXaxis()->SetTitle("#Delta#varphi (rad)"); |
2b4abbc5 | 2052 | } |
3b8a460b | 2053 | //ZYAM |
41f2bc59 | 2054 | if(kUseZYAM) { |
2055 | Double_t reference = gHistNNprojection->GetBinContent(gHistNNprojection->GetMinimumBin()); | |
2056 | for(Int_t iBinX = 1; iBinX <= gHistNNprojection->GetNbinsX(); iBinX++) | |
2057 | gHistNNprojection->SetBinContent(iBinX,gHistNNprojection->GetBinContent(iBinX) - reference); | |
2058 | } | |
2b4abbc5 | 2059 | |
2b4abbc5 | 2060 | gHistNNprojection->GetYaxis()->SetTitleOffset(1.5); |
3b8a460b | 2061 | gHistNNprojection->SetMarkerStyle(20); |
2062 | gHistNNprojection->SetStats(kFALSE); | |
2063 | gHistNNprojection->DrawCopy("E"); | |
2b4abbc5 | 2064 | //=================// |
2065 | ||
2066 | gPad->SetTheta(30); // default is 30 | |
2067 | gPad->SetPhi(-60); // default is 30 | |
2068 | gPad->Update(); | |
2069 | ||
3b8a460b | 2070 | latexInfo1->DrawLatex(0.6,0.95,centralityLatex.Data()); |
2071 | latexInfo1->DrawLatex(0.6,0.89,psiLatex.Data()); | |
2072 | latexInfo1->DrawLatex(0.6,0.83,pttLatex.Data()); | |
2073 | latexInfo1->DrawLatex(0.6,0.77,ptaLatex.Data()); | |
2b4abbc5 | 2074 | |
2340240c | 2075 | pngName = filename; |
2076 | if(kProjectInEta) pngName.ReplaceAll(".root","_DeltaEtaProjection"); | |
2077 | else pngName.ReplaceAll(".root","_DeltaPhiProjection"); | |
2b4abbc5 | 2078 | pngName += ".NegativeNegative.png"; |
2079 | cNN->SaveAs(pngName.Data()); | |
2080 | ||
17c69b4e | 2081 | TString outFileName = filename; |
2082 | if(kProjectInEta) outFileName.ReplaceAll(".root","_DeltaEtaProjection.root"); | |
2083 | else outFileName.ReplaceAll(".root","_DeltaPhiProjection.root"); | |
2084 | TFile *fProjection = TFile::Open(outFileName.Data(),"recreate"); | |
3b8a460b | 2085 | gHistNPprojection->Write(); |
2086 | gHistPNprojection->Write(); | |
2087 | gHistNNprojection->Write(); | |
2088 | gHistPPprojection->Write(); | |
2b4abbc5 | 2089 | fProjection->Close(); |
2b4abbc5 | 2090 | } |
742af4bd | 2091 | |
5c9b4733 | 2092 | //____________________________________________________________// |
2093 | void fitCorrelationFunctions(Int_t gCentrality = 1, | |
2094 | Double_t psiMin = -0.5, Double_t psiMax = 3.5, | |
20006629 | 2095 | Double_t vertexZMin = -10.,Double_t vertexZMax = 10., |
5c9b4733 | 2096 | Double_t ptTriggerMin = -1., |
2097 | Double_t ptTriggerMax = -1., | |
2098 | Double_t ptAssociatedMin = -1., | |
2099 | Double_t ptAssociatedMax = -1., | |
2100 | TH2D *gHist) { | |
07d0a35c | 2101 | |
2102 | cout<<"FITTING FUNCTION"<<endl; | |
2103 | ||
5c9b4733 | 2104 | //near side peak: [1]*TMath::Exp(-TMath::Power((0.5*TMath::Power((x/[2]),2)+0.5*TMath::Power((y/[3]),2)),[4])) |
2105 | //away side ridge: [5]*TMath::Exp(-TMath::Power((0.5*TMath::Power(((y-TMath::Pi())/[6]),2)),[7])) | |
2106 | //longitudinal ridge: [8]*TMath::Exp(-TMath::Power((0.5*TMath::Power((x/[9]),2)),[10])) | |
2107 | //wing structures: [11]*TMath::Power(x,2) | |
2108 | //flow contribution (v1 up to v4): 2.*([12]*TMath::Cos(y) + [13]*TMath::Cos(2.*y) + [14]*TMath::Cos(3.*y) + [15]*TMath::Cos(4.*y)) | |
24ca71a6 | 2109 | TF2 *gFitFunction = new TF2("gFitFunction","[0]+[1]*TMath::Exp(-TMath::Power((0.5*TMath::Power((x/[2]),2)+0.5*TMath::Power((y/[3]),2)),[4]))+[5]*TMath::Exp(-TMath::Power((0.5*TMath::Power(((y-TMath::Pi())/[6]),2)),[7]))+[8]*TMath::Exp(-TMath::Power((0.5*TMath::Power(((x+[17])/[9]),2)),[10]))+[8]*TMath::Exp(-TMath::Power((0.5*TMath::Power(((x-[17])/[9]),2)),[10]))+[11]*TMath::Power(x,2)+2.*[12]*([13]*TMath::Cos(y) + [14]*TMath::Cos(2.*y) + [15]*TMath::Cos(3.*y) + [16]*TMath::Cos(4.*y))",-2.0,2.0,-TMath::Pi()/2.,3.*TMath::Pi()/2.); |
5c9b4733 | 2110 | gFitFunction->SetName("gFitFunction"); |
742af4bd | 2111 | |
2112 | ||
5c9b4733 | 2113 | //Normalization |
742af4bd | 2114 | gFitFunction->SetParName(0,"N1"); |
5c9b4733 | 2115 | //near side peak |
742af4bd | 2116 | gFitFunction->SetParName(1,"N_{near side}");gFitFunction->FixParameter(1,0.0); |
2117 | gFitFunction->SetParName(2,"Sigma_{near side}(delta eta)"); gFitFunction->FixParameter(2,0.0); | |
2118 | gFitFunction->SetParName(3,"Sigma_{near side}(delta phi)"); gFitFunction->FixParameter(3,0.0); | |
2119 | gFitFunction->SetParName(4,"Exponent_{near side}"); gFitFunction->FixParameter(4,1.0); | |
5c9b4733 | 2120 | //away side ridge |
742af4bd | 2121 | gFitFunction->SetParName(5,"N_{away side}"); gFitFunction->FixParameter(5,0.0); |
2122 | gFitFunction->SetParName(6,"Sigma_{away side}(delta phi)"); gFitFunction->FixParameter(6,0.0); | |
2123 | gFitFunction->SetParName(7,"Exponent_{away side}"); gFitFunction->FixParameter(7,1.0); | |
24ca71a6 | 2124 | //longitudinal ridge |
742af4bd | 2125 | gFitFunction->SetParName(8,"N_{long. ridge}"); gFitFunction->SetParameter(8,0.05);// |
2126 | gFitFunction->FixParameter(8,0.0); | |
2127 | gFitFunction->SetParName(9,"Sigma_{long. ridge}(delta eta)"); gFitFunction->FixParameter(9,0.0); | |
2128 | gFitFunction->SetParName(10,"Exponent_{long. ridge}"); gFitFunction->FixParameter(10,1.0); | |
5c9b4733 | 2129 | //wing structures |
742af4bd | 2130 | gFitFunction->SetParName(11,"N_{wing}"); gFitFunction->FixParameter(11,0.0); |
5c9b4733 | 2131 | //flow contribution |
742af4bd | 2132 | gFitFunction->SetParName(12,"N_{flow}"); gFitFunction->SetParameter(12,0.2);gFitFunction->SetParLimits(12,0.0,10); |
2133 | gFitFunction->SetParName(13,"V1"); gFitFunction->SetParameter(13,0.005);gFitFunction->SetParLimits(13,0.0,10); | |
2134 | gFitFunction->SetParName(14,"V2"); gFitFunction->SetParameter(14,0.1);gFitFunction->SetParLimits(14,0.0,10); | |
2135 | gFitFunction->SetParName(15,"V3"); gFitFunction->SetParameter(15,0.05);gFitFunction->SetParLimits(15,0.0,10); | |
2136 | gFitFunction->SetParName(16,"V4"); gFitFunction->SetParameter(16,0.005);gFitFunction->SetParLimits(16,0.0,10); | |
2137 | gFitFunction->SetParName(17,"Offset"); gFitFunction->FixParameter(17,0.0); | |
2138 | ||
2139 | // flow parameters | |
2140 | Double_t fNV = 0.; | |
2141 | Double_t fV1 = 0.; | |
2142 | Double_t fV2 = 0.; | |
2143 | Double_t fV3 = 0.; | |
2144 | Double_t fV4 = 0.; | |
2145 | ||
2146 | //Fitting the correlation function (first the edges to extract flow) | |
2147 | gHist->Fit("gFitFunction","nm","",1.0,1.6); | |
2148 | ||
2149 | fNV += gFitFunction->GetParameter(12); | |
2150 | fV1 += gFitFunction->GetParameter(13); | |
2151 | fV2 += gFitFunction->GetParameter(14); | |
2152 | fV3 += gFitFunction->GetParameter(15); | |
2153 | fV4 += gFitFunction->GetParameter(16); | |
2154 | ||
2155 | gHist->Fit("gFitFunction","nm","",-1.6,-1.0); | |
2156 | ||
2157 | fNV += gFitFunction->GetParameter(12); | |
2158 | fV1 += gFitFunction->GetParameter(13); | |
2159 | fV2 += gFitFunction->GetParameter(14); | |
2160 | fV3 += gFitFunction->GetParameter(15); | |
2161 | fV4 += gFitFunction->GetParameter(16); | |
2162 | ||
2163 | // Now fit the whole with fixed flow | |
2164 | gFitFunction->FixParameter(12,fNV/2.); | |
2165 | gFitFunction->FixParameter(13,fV1/2.); | |
2166 | gFitFunction->FixParameter(14,fV2/2.); | |
2167 | gFitFunction->FixParameter(15,fV3/2.); | |
2168 | gFitFunction->FixParameter(16,fV4/2.); | |
2169 | ||
2170 | gFitFunction->ReleaseParameter(0);gFitFunction->SetParameter(0,1.0); | |
2171 | gFitFunction->ReleaseParameter(1);gFitFunction->SetParameter(1,0.3); | |
2172 | gFitFunction->ReleaseParameter(2);gFitFunction->SetParameter(2,0.3);gFitFunction->SetParLimits(2,0.05,0.7); | |
2173 | gFitFunction->ReleaseParameter(3);gFitFunction->SetParameter(3,0.3);gFitFunction->SetParLimits(3,0.05,1.7); | |
2174 | //gFitFunction->ReleaseParameter(4);gFitFunction->SetParameter(4,1.0);gFitFunction->SetParLimits(4,0.0,2.0); | |
2175 | gFitFunction->ReleaseParameter(5);gFitFunction->SetParameter(5,1.0);//gFitFunction->SetParLimits(5,0.0,10); | |
2176 | gFitFunction->ReleaseParameter(6);gFitFunction->SetParameter(6,0.5);//gFitFunction->SetParLimits(6,0.0,10); | |
2177 | //gFitFunction->ReleaseParameter(7);gFitFunction->SetParameter(7,1.0);gFitFunction->SetParLimits(7,0.0,2.0); | |
478c95cf | 2178 | //gFitFunction->ReleaseParameter(8);gFitFunction->SetParameter(8,0.05); |
2179 | //gFitFunction->ReleaseParameter(9);gFitFunction->SetParameter(9,0.6);gFitFunction->SetParLimits(9,0.1,10.0); | |
742af4bd | 2180 | //gFitFunction->ReleaseParameter(10);gFitFunction->SetParameter(10,1.0);gFitFunction->SetParLimits(10,0.0,2.0); |
2181 | gFitFunction->ReleaseParameter(17);gFitFunction->SetParameter(17,0.7);gFitFunction->SetParLimits(17,0.0,0.9); | |
2182 | ||
5c9b4733 | 2183 | gHist->Fit("gFitFunction","nm"); |
2184 | ||
742af4bd | 2185 | |
5c9b4733 | 2186 | //Cloning the histogram |
2187 | TString histoName = gHist->GetName(); histoName += "Fit"; | |
2188 | TH2D *gHistFit = new TH2D(histoName.Data(),";#Delta#eta;#Delta#varphi (rad);C(#Delta#eta,#Delta#varphi)",gHist->GetNbinsX(),gHist->GetXaxis()->GetXmin(),gHist->GetXaxis()->GetXmax(),gHist->GetNbinsY(),gHist->GetYaxis()->GetXmin(),gHist->GetYaxis()->GetXmax()); | |
2189 | TH2D *gHistResidual = dynamic_cast<TH2D *>(gHist->Clone()); | |
2190 | gHistResidual->SetName("gHistResidual"); | |
2191 | gHistResidual->Sumw2(); | |
2192 | ||
2193 | for(Int_t iBinDeltaEta = 1; iBinDeltaEta <= gHist->GetNbinsX(); iBinDeltaEta++) { | |
2194 | for(Int_t iBinDeltaPhi = 1; iBinDeltaPhi <= gHist->GetNbinsY(); iBinDeltaPhi++) { | |
2195 | gHistFit->SetBinContent(iBinDeltaEta,iBinDeltaPhi,gFitFunction->Eval(gHist->GetXaxis()->GetBinCenter(iBinDeltaEta),gHist->GetYaxis()->GetBinCenter(iBinDeltaPhi))); | |
2196 | } | |
2197 | } | |
2198 | gHistResidual->Add(gHistFit,-1); | |
2199 | ||
2200 | //Write to output file | |
2201 | TString newFileName = "correlationFunctionFit"; | |
2202 | if(histoName.Contains("PN")) newFileName += "PN"; | |
2203 | else if(histoName.Contains("NP")) newFileName += "NP"; | |
2204 | else if(histoName.Contains("PP")) newFileName += "PP"; | |
2205 | else if(histoName.Contains("NN")) newFileName += "NN"; | |
2206 | newFileName += ".Centrality"; | |
2207 | newFileName += gCentrality; newFileName += ".Psi"; | |
2208 | if((psiMin == -0.5)&&(psiMax == 0.5)) newFileName += "InPlane.Ptt"; | |
2209 | else if((psiMin == 0.5)&&(psiMax == 1.5)) newFileName += "Intermediate.Ptt"; | |
2210 | else if((psiMin == 1.5)&&(psiMax == 2.5)) newFileName += "OutOfPlane.Ptt"; | |
2211 | else if((psiMin == 2.5)&&(psiMax == 3.5)) newFileName += "Rest.PttFrom"; | |
2212 | else newFileName += "All.PttFrom"; | |
2213 | newFileName += Form("%.1f",ptTriggerMin); newFileName += "To"; | |
2214 | newFileName += Form("%.1f",ptTriggerMax); newFileName += "PtaFrom"; | |
2215 | newFileName += Form("%.1f",ptAssociatedMin); newFileName += "To"; | |
2216 | newFileName += Form("%.1f",ptAssociatedMax); | |
09b14834 | 2217 | |
2218 | newFileName += "_"; | |
2219 | newFileName += Form("%.1f",psiMin); | |
2220 | newFileName += "-"; | |
2221 | newFileName += Form("%.1f",psiMax); | |
2222 | ||
5c9b4733 | 2223 | newFileName += ".root"; |
2224 | TFile *newFile = TFile::Open(newFileName.Data(),"recreate"); | |
5ea3b761 | 2225 | gHist->Write(); |
5c9b4733 | 2226 | gHistFit->Write(); |
2227 | gHistResidual->Write(); | |
2228 | gFitFunction->Write(); | |
2229 | newFile->Close(); | |
2230 | ||
2231 | ||
2232 | } | |
24ca71a6 | 2233 | |
3b8a460b | 2234 | //____________________________________________________________// |
2235 | TH2D *convolute2D(TH2D* h1, TH2D* h2, TString hname) { | |
3ce45c12 | 2236 | // |
2237 | // this function does the convolution of 2 eta or phi "efficiencies" in a deta or dphi "efficiency" | |
2238 | // and returns a new histogram which is normalized to the number of bin combinations | |
2239 | ||
2240 | // histogram definition | |
2241 | TH2D *hConv = NULL; | |
1b5c6300 | 2242 | hConv = new TH2D(hname.Data(),hname.Data(), h1->GetNbinsY(),-2,2,h1->GetNbinsX(),-TMath::Pi()/2.,3*TMath::Pi()/2.); |
3ce45c12 | 2243 | |
2244 | Double_t x1 = 0.; | |
2245 | Double_t x2 = 0.; | |
2246 | Double_t y1 = 0.; | |
2247 | Double_t y2 = 0.; | |
2248 | Double_t z1 = 0.; | |
2249 | Double_t z2 = 0.; | |
2250 | Double_t dx = 0.; | |
2251 | Double_t dy = 0.; | |
2252 | Double_t dz = 0.; | |
2253 | ||
2254 | ||
2255 | // convolution | |
2256 | for(Int_t i = 0; i < h1->GetNbinsX(); i ++){ | |
2257 | cout<<"CONVOLUTING BIN = "<<i<<" of "<<h1->GetNbinsX()<<endl; | |
2258 | for(Int_t j = 0; j < h1->GetNbinsY(); j ++){ | |
2259 | for(Int_t k = 0; k < h2->GetNbinsX(); k ++){ | |
2260 | for(Int_t l = 0; l < h2->GetNbinsY(); l ++){ | |
2261 | ||
2262 | x1 = (Double_t)h1->GetXaxis()->GetBinCenter(i+1); | |
2263 | y1 = (Double_t)h1->GetYaxis()->GetBinCenter(j+1); | |
2264 | x2 = (Double_t)h2->GetXaxis()->GetBinCenter(k+1); | |
2265 | y2 = (Double_t)h2->GetYaxis()->GetBinCenter(l+1); | |
2266 | ||
2267 | z1 = (Double_t)h1->GetBinContent(i+1,j+1); | |
2268 | z2 = (Double_t)h2->GetBinContent(k+1,l+1); | |
2269 | ||
1b5c6300 | 2270 | // need the gymnastics to keep the same binning |
2271 | dx = x1 - x2 - (h1->GetXaxis()->GetBinWidth(1)/2.); | |
2272 | if(gRandom->Gaus() > 0) dy = y1 - y2 + (h1->GetYaxis()->GetBinWidth(1)/2.); | |
2273 | else dy = y1 - y2 - (h1->GetYaxis()->GetBinWidth(1)/2.); | |
3ce45c12 | 2274 | |
2275 | if(dx>3./2.*TMath::Pi()) dx = dx - 2.*TMath::Pi(); | |
2276 | if(dx<-1./2.*TMath::Pi()) dx = 2*TMath::Pi() + dx; | |
2277 | ||
2278 | dz = z1*z2; | |
2279 | ||
2280 | hConv->Fill(dy,dx,dz); | |
2281 | ||
2282 | } | |
2283 | } | |
2284 | } | |
2285 | } | |
2286 | ||
2287 | return hConv; | |
2288 | ||
2289 | } |