]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FORWARD/analysis2/AliBasedNdetaTask.cxx
Change to raw OCDB in case not yet set
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / AliBasedNdetaTask.cxx
CommitLineData
ce85db45 1//====================================================================
2#include "AliBasedNdetaTask.h"
3#include <TMath.h>
4#include <TH2D.h>
5#include <TH1D.h>
6#include <THStack.h>
7#include <TList.h>
e58000b7 8#include <TParameter.h>
ce85db45 9#include <AliAnalysisManager.h>
10#include <AliAODEvent.h>
11#include <AliAODHandler.h>
12#include <AliAODInputHandler.h>
13#include "AliForwardUtil.h"
14#include "AliAODForwardMult.h"
3846ec25 15#include <TFile.h>
5bb5d1f6 16#include <TStyle.h>
ce85db45 17
18//____________________________________________________________________
19AliBasedNdetaTask::AliBasedNdetaTask()
20 : AliAnalysisTaskSE(),
ce85db45 21 fSums(0), // Container of sums
e1f47419 22 fOutput(0), // Container of output
ce85db45 23 fVtxMin(0), // Minimum v_z
24 fVtxMax(0), // Maximum v_z
25 fTriggerMask(0), // Trigger mask
26 fRebin(0), // Rebinning factor
27 fCutEdges(false),
28 fSymmetrice(true),
e58000b7 29 fCorrEmpty(true),
c25b5e1b 30 fUseROOTProj(false),
e58000b7 31 fTriggerEff(1),
3846ec25 32 fShapeCorr(0),
e1f47419 33 fListOfCentralities(0),
e1f47419 34 fSNNString(0),
35 fSysString(0),
e308a636 36 fCent(0),
ffca499d 37 fCentAxis(0),
0be6c8cd 38 fNormalizationScheme(kFull),
39 fSchemeString(0),
c89b9ac1 40 fTriggerString(0),
41 fFinalMCCorrFile("")
fb3430ac 42{
43 //
44 // Constructor
45 //
46}
ce85db45 47
48//____________________________________________________________________
49AliBasedNdetaTask::AliBasedNdetaTask(const char* name)
50 : AliAnalysisTaskSE(name),
ce85db45 51 fSums(0), // Container of sums
e1f47419 52 fOutput(0), // Container of output
ce85db45 53 fVtxMin(-10), // Minimum v_z
54 fVtxMax(10), // Maximum v_z
55 fTriggerMask(AliAODForwardMult::kInel),
56 fRebin(5), // Rebinning factor
57 fCutEdges(false),
58 fSymmetrice(true),
e58000b7 59 fCorrEmpty(true),
c25b5e1b 60 fUseROOTProj(false),
e58000b7 61 fTriggerEff(1),
3846ec25 62 fShapeCorr(0),
e1f47419 63 fListOfCentralities(0),
e1f47419 64 fSNNString(0),
65 fSysString(0),
e308a636 66 fCent(0),
ffca499d 67 fCentAxis(0),
0be6c8cd 68 fNormalizationScheme(kFull),
69 fSchemeString(0),
c89b9ac1 70 fTriggerString(0),
71 fFinalMCCorrFile("")
ce85db45 72{
fb3430ac 73 //
74 // Constructor
75 //
e308a636 76 fListOfCentralities = new TObjArray(1);
0be6c8cd 77
78 // Set the normalisation scheme
79 SetNormalizationScheme(kFull);
80
81 // Set the trigger mask
82 SetTriggerMask(AliAODForwardMult::kInel);
fb3430ac 83
ce85db45 84 // Output slot #1 writes into a TH1 container
85 DefineOutput(1, TList::Class());
86 DefineOutput(2, TList::Class());
87}
88
89//____________________________________________________________________
90AliBasedNdetaTask::AliBasedNdetaTask(const AliBasedNdetaTask& o)
91 : AliAnalysisTaskSE(o),
ce85db45 92 fSums(o.fSums), // TList* - Container of sums
e1f47419 93 fOutput(o.fOutput), // Container of output
ce85db45 94 fVtxMin(o.fVtxMin), // Double_t - Minimum v_z
95 fVtxMax(o.fVtxMax), // Double_t - Maximum v_z
96 fTriggerMask(o.fTriggerMask),// Int_t - Trigger mask
97 fRebin(o.fRebin), // Int_t - Rebinning factor
98 fCutEdges(o.fCutEdges), // Bool_t - Whether to cut edges when rebinning
c25b5e1b 99 fSymmetrice(o.fSymmetrice),
100 fCorrEmpty(o.fCorrEmpty),
101 fUseROOTProj(o.fUseROOTProj),
e58000b7 102 fTriggerEff(o.fTriggerEff),
3846ec25 103 fShapeCorr(o.fShapeCorr),
e1f47419 104 fListOfCentralities(o.fListOfCentralities),
e1f47419 105 fSNNString(o.fSNNString),
106 fSysString(o.fSysString),
e308a636 107 fCent(o.fCent),
ffca499d 108 fCentAxis(o.fCentAxis),
0be6c8cd 109 fNormalizationScheme(o.fNormalizationScheme),
110 fSchemeString(o.fSchemeString),
c89b9ac1 111 fTriggerString(o.fTriggerString),
112 fFinalMCCorrFile(o.fFinalMCCorrFile)
ce85db45 113{}
114
115//____________________________________________________________________
116AliBasedNdetaTask::~AliBasedNdetaTask()
117{
fb3430ac 118 //
119 // Destructor
120 //
ce85db45 121 if (fSums) {
122 fSums->Delete();
123 delete fSums;
124 fSums = 0;
125 }
e1f47419 126 if (fOutput) {
127 fOutput->Delete();
128 delete fOutput;
129 fOutput = 0;
ce85db45 130 }
131}
132
e1f47419 133//________________________________________________________________________
134void
e308a636 135AliBasedNdetaTask::SetCentralityAxis(UShort_t n, Short_t* bins)
136{
137 if (!fCentAxis) {
138 fCentAxis = new TAxis();
139 fCentAxis->SetName("centAxis");
140 fCentAxis->SetTitle("Centrality [%]");
141 }
142 TArrayD dbins(n+1);
143 for (UShort_t i = 0; i <= n; i++)
144 dbins[i] = (bins[i] == 100 ? 100.1 : bins[i]);
145 fCentAxis->Set(n, dbins.GetArray());
146}
147
148//________________________________________________________________________
149void
150AliBasedNdetaTask::AddCentralityBin(UShort_t at, Short_t low, Short_t high)
e1f47419 151{
152 //
153 // Add a centrality bin
154 //
155 // Parameters:
156 // low Low cut
157 // high High cut
158 //
e308a636 159 CentralityBin* bin = MakeCentralityBin(GetName(), low, high);
e308a636 160 fListOfCentralities->AddAtAndExpand(bin, at);
e1f47419 161}
162
163//________________________________________________________________________
164AliBasedNdetaTask::CentralityBin*
165AliBasedNdetaTask::MakeCentralityBin(const char* name,
166 Short_t low, Short_t high) const
167{
168 //
169 // Make a centrality bin
170 //
171 // Parameters:
172 // name Name used for histograms
173 // low Low cut in percent
174 // high High cut in percent
175 //
176 // Return:
177 // A newly created centrality bin
178 //
179 return new CentralityBin(name, low, high);
180}
ffca499d 181//________________________________________________________________________
182void
183AliBasedNdetaTask::SetNormalizationScheme(const char* what)
184{
185 //
186 // Set normalisation scheme
187 //
188 UShort_t scheme = 0;
189 TString twhat(what);
190 twhat.ToUpper();
191 TObjString* opt;
192 TIter next(twhat.Tokenize(" ,|"));
193 while ((opt = static_cast<TObjString*>(next()))) {
194 TString s(opt->GetString());
195 if (s.IsNull()) continue;
0be6c8cd 196 Bool_t add = true;
197 switch (s[0]) {
198 case '-': add = false; // Fall through
199 case '+': s.Remove(0,1); // Remove character
200 }
201 UShort_t bit = 0;
202 if (s.CompareTo("EVENT") == 0) bit = kEventLevel;
203 else if (s.CompareTo("SHAPE") == 0) bit = kShape;
204 else if (s.CompareTo("BACKGROUND")== 0) bit = kBackground;
205 else if (s.CompareTo("TRIGGER") == 0) bit = kTriggerEfficiency;
206 else if (s.CompareTo("FULL") == 0) bit = kFull;
207 else if (s.CompareTo("NONE") == 0) bit = kNone;
4fa8d795 208 else if (s.CompareTo("ZEROBIN") == 0) bit = kZeroBin;
ffca499d 209 else
210 Warning("SetNormalizationScheme", "Unknown option %s", s.Data());
0be6c8cd 211 if (add) scheme |= bit;
212 else scheme ^= bit;
ffca499d 213 }
214 SetNormalizationScheme(scheme);
215}
0be6c8cd 216//________________________________________________________________________
217void
218AliBasedNdetaTask::SetNormalizationScheme(UShort_t scheme)
219{
220 fNormalizationScheme = scheme;
221 TString tit = "";
222 if (scheme == kFull) tit = "FULL";
223 else {
224 if (scheme & kEventLevel) tit.Append("EVENT ");
225 if (scheme & kShape) tit.Append("SHAPE ");
226 if (scheme & kBackground) tit.Append("BACKGROUND ");
4fa8d795 227 if (scheme & kTriggerEfficiency) tit.Append("TRIGGER ");
228 if (scheme & kZeroBin) tit.Append("ZEROBIN ");
0be6c8cd 229 }
230 tit = tit.Strip(TString::kBoth);
231 if (!fSchemeString) fSchemeString = new TNamed("scheme", "");
232 fSchemeString->SetTitle(tit);
233 fSchemeString->SetUniqueID(fNormalizationScheme);
234}
ce85db45 235//________________________________________________________________________
236void
237AliBasedNdetaTask::SetTriggerMask(const char* mask)
238{
fb3430ac 239 //
240 // Set the trigger maskl
241 //
242 // Parameters:
243 // mask Trigger mask
244 //
9453b19e 245 SetTriggerMask(AliAODForwardMult::MakeTriggerMask(mask));
ce85db45 246}
0be6c8cd 247//________________________________________________________________________
248void
249AliBasedNdetaTask::SetTriggerMask(UShort_t mask)
250{
251 fTriggerMask = mask;
252 TString tit(AliAODForwardMult::GetTriggerString(mask));
253 tit = tit.Strip(TString::kBoth);
254 if (!fTriggerString) fTriggerString = new TNamed("trigger", "");
255 fTriggerString->SetTitle(tit);
256 fTriggerString->SetUniqueID(fTriggerMask);
257}
ce85db45 258
e58000b7 259//________________________________________________________________________
260void
261AliBasedNdetaTask::SetShapeCorrection(const TH1* c)
262{
fb3430ac 263 //
264 // Set the shape correction (a.k.a., track correction) for selected
265 // trigger(s)
266 //
267 // Parameters:
268 // h Correction
269 //
e58000b7 270 if (!c) return;
271 fShapeCorr = static_cast<TH1*>(c->Clone());
272 fShapeCorr->SetDirectory(0);
273}
274
ce85db45 275//________________________________________________________________________
276void
277AliBasedNdetaTask::UserCreateOutputObjects()
278{
fb3430ac 279 //
280 // Create output objects.
281 //
282 // This is called once per slave process
283 //
ce85db45 284 fSums = new TList;
285 fSums->SetName(Form("%s_sums", GetName()));
286 fSums->SetOwner();
287
e1f47419 288 // Automatically add 'all' centrality bin if nothing has been defined.
e308a636 289 AddCentralityBin(0, 0, 0);
290 if (fCentAxis && fCentAxis->GetNbins() > 0 && fCentAxis->GetXbins()) {
291 const TArrayD* bins = fCentAxis->GetXbins();
292 Int_t nbin = fCentAxis->GetNbins();
293 for (Int_t i = 0; i < nbin; i++)
294 AddCentralityBin(i+1, Short_t((*bins)[i]), Short_t((*bins)[i+1]));
295 }
9ecab72f 296 if (fCentAxis) fSums->Add(fCentAxis);
e308a636 297
ce85db45 298
e1f47419 299 // Centrality histogram
300 fCent = new TH1D("cent", "Centrality", 100, 0, 100);
301 fCent->SetDirectory(0);
302 fCent->SetXTitle(0);
303 fSums->Add(fCent);
304
305 // Loop over centrality bins
306 TIter next(fListOfCentralities);
307 CentralityBin* bin = 0;
308 while ((bin = static_cast<CentralityBin*>(next())))
309 bin->CreateOutputObjects(fSums);
ce85db45 310
311 // Check that we have an AOD input handler
312 AliAnalysisManager* am = AliAnalysisManager::GetAnalysisManager();
313 AliAODInputHandler* ah =
314 dynamic_cast<AliAODInputHandler*>(am->GetInputEventHandler());
315 if (!ah) AliFatal("No AOD input handler set in analysis manager");
316
317 // Post data for ALL output slots >0 here, to get at least an empty histogram
318 PostData(1, fSums);
319}
ce85db45 320//____________________________________________________________________
321void
322AliBasedNdetaTask::UserExec(Option_t *)
323{
fb3430ac 324 //
325 // Process a single event
326 //
327 // Parameters:
328 // option Not used
329 //
ce85db45 330 // Main loop
331 AliAODEvent* aod = dynamic_cast<AliAODEvent*>(InputEvent());
332 if (!aod) {
333 AliError("Cannot get the AOD event");
334 return;
335 }
e58000b7 336
e1f47419 337 TObject* obj = aod->FindListObject("Forward");
338 if (!obj) {
339 AliWarning("No forward object found");
340 return;
678a4979 341 }
e1f47419 342 AliAODForwardMult* forward = static_cast<AliAODForwardMult*>(obj);
e308a636 343
e1f47419 344 // Fill centrality histogram
e308a636 345 Float_t cent = forward->GetCentrality();
346 fCent->Fill(cent);
e1f47419 347
ce85db45 348 // Get the histogram(s)
e58000b7 349 TH2D* data = GetHistogram(aod, false);
ce85db45 350 TH2D* dataMC = GetHistogram(aod, true);
351
4fa8d795 352 Bool_t isZero = ((fNormalizationScheme & kZeroBin) &&
353 !forward->IsTriggerBits(AliAODForwardMult::kNClusterGt0));
354
355
e1f47419 356 // Loop over centrality bins
ffca499d 357 CentralityBin* allBin =
358 static_cast<CentralityBin*>(fListOfCentralities->At(0));
4fa8d795 359 allBin->ProcessEvent(forward, fTriggerMask, isZero,
360 fVtxMin, fVtxMax, data, dataMC);
e308a636 361
362 // Find this centrality bin
363 if (fCentAxis && fCentAxis->GetNbins() > 0) {
364 Int_t icent = fCentAxis->FindBin(cent);
365 CentralityBin* thisBin = 0;
366 if (icent >= 1 && icent <= fCentAxis->GetNbins())
367 thisBin = static_cast<CentralityBin*>(fListOfCentralities->At(icent));
368 if (thisBin)
4fa8d795 369 thisBin->ProcessEvent(forward, fTriggerMask, isZero, fVtxMin, fVtxMax,
ffca499d 370 data, dataMC);
e308a636 371 }
ce85db45 372
e1f47419 373 // Here, we get the update
374 if (!fSNNString) {
375 UShort_t sNN = forward->GetSNN();
376 fSNNString = new TNamed("sNN", "");
377 fSNNString->SetTitle(AliForwardUtil::CenterOfMassEnergyString(sNN));
378 fSNNString->SetUniqueID(sNN);
379 fSums->Add(fSNNString);
e58000b7 380
e1f47419 381 UShort_t sys = forward->GetSystem();
382 fSysString = new TNamed("sys", "");
383 fSysString->SetTitle(AliForwardUtil::CollisionSystemString(sys));
384 fSysString->SetUniqueID(sys);
385 fSums->Add(fSysString);
0be6c8cd 386
387 fSums->Add(fSchemeString);
388 fSums->Add(fTriggerString);
389
390 // Print();
3846ec25 391 }
e58000b7 392
ce85db45 393 PostData(1, fSums);
394}
395
396//________________________________________________________________________
397void
398AliBasedNdetaTask::SetHistogramAttributes(TH1D* h, Int_t colour, Int_t marker,
399 const char* title, const char* ytitle)
400{
fb3430ac 401 //
402 // Set histogram graphical options, etc.
403 //
404 // Parameters:
405 // h Histogram to modify
406 // colour Marker color
407 // marker Marker style
408 // title Title of histogram
409 // ytitle Title on y-axis.
410 //
ce85db45 411 h->SetTitle(title);
412 h->SetMarkerColor(colour);
413 h->SetMarkerStyle(marker);
9ecab72f 414 h->SetMarkerSize(marker == 29 || marker == 30 ? 1.2 : 1);
ce85db45 415 h->SetFillStyle(0);
416 h->SetYTitle(ytitle);
417 h->GetXaxis()->SetTitleFont(132);
418 h->GetXaxis()->SetLabelFont(132);
419 h->GetXaxis()->SetNdivisions(10);
420 h->GetYaxis()->SetTitleFont(132);
421 h->GetYaxis()->SetLabelFont(132);
422 h->GetYaxis()->SetNdivisions(10);
423 h->GetYaxis()->SetDecimals();
424 h->SetStats(0);
425}
426
4fa8d795 427//________________________________________________________________________
428void
429AliBasedNdetaTask::ScaleToCoverage(TH2D* copy, const TH1D* norm)
430{
431 // Normalize to the acceptance -
432 // dndeta->Divide(accNorm);
433 for (Int_t i = 1; i <= copy->GetNbinsX(); i++) {
434 Double_t a = norm->GetBinContent(i);
435 for (Int_t j = 1; j <= copy->GetNbinsY(); j++) {
436 if (a <= 0) {
437 copy->SetBinContent(i,j,0);
438 copy->SetBinError(i,j,0);
439 continue;
440 }
441 Double_t c = copy->GetBinContent(i, j);
442 Double_t e = copy->GetBinError(i, j);
443 copy->SetBinContent(i, j, c / a);
444 copy->SetBinError(i, j, e / a);
445 }
446 }
447}
448
ce85db45 449//________________________________________________________________________
450TH1D*
451AliBasedNdetaTask::ProjectX(const TH2D* h,
452 const char* name,
453 Int_t firstbin,
454 Int_t lastbin,
c25b5e1b 455 bool useRoot,
ce85db45 456 bool corr,
e1f47419 457 bool error)
ce85db45 458{
fb3430ac 459 //
460 // Project onto the X axis
461 //
462 // Parameters:
463 // h 2D histogram
464 // name New name
465 // firstbin First bin to use
466 // lastbin Last bin to use
467 // error Whether to calculate errors
468 //
469 // Return:
470 // Newly created histogram or null
471 //
ce85db45 472 if (!h) return 0;
c25b5e1b 473 if (useRoot)
474 return h->ProjectionX(name, firstbin, lastbin, (error ? "e" : ""));
ce85db45 475
476 TAxis* xaxis = h->GetXaxis();
477 TAxis* yaxis = h->GetYaxis();
478 TH1D* ret = new TH1D(name, h->GetTitle(), xaxis->GetNbins(),
479 xaxis->GetXmin(), xaxis->GetXmax());
480 static_cast<const TAttLine*>(h)->Copy(*ret);
481 static_cast<const TAttFill*>(h)->Copy(*ret);
482 static_cast<const TAttMarker*>(h)->Copy(*ret);
483 ret->GetXaxis()->ImportAttributes(xaxis);
484
485 Int_t first = firstbin;
486 Int_t last = lastbin;
487 if (first < 0) first = 0;
488 else if (first >= yaxis->GetNbins()+1) first = yaxis->GetNbins();
489 if (last < 0) last = yaxis->GetNbins();
490 else if (last > yaxis->GetNbins()+1) last = yaxis->GetNbins();
491 if (last-first < 0) {
e1f47419 492 AliWarningGeneral("AliBasedNdetaTask",
493 Form("Nothing to project [%d,%d]", first, last));
ce85db45 494 return 0;
495
496 }
497
498 // Loop over X bins
499 // AliInfo(Form("Projecting bins [%d,%d] of %s", first, last, h->GetName()));
500 Int_t ybins = (last-first+1);
501 for (Int_t xbin = 0; xbin <= xaxis->GetNbins()+1; xbin++) {
502 Double_t content = 0;
503 Double_t error2 = 0;
504 Int_t nbins = 0;
505
506
507 for (Int_t ybin = first; ybin <= last; ybin++) {
508 Double_t c1 = h->GetCellContent(xbin, ybin);
509 Double_t e1 = h->GetCellError(xbin, ybin);
510
511 // Ignore empty bins
512 if (c1 < 1e-12) continue;
513 if (e1 < 1e-12) {
514 if (error) continue;
515 e1 = 1;
516 }
517
518 content += c1;
519 error2 += e1*e1;
520 nbins++;
521 } // for (ybin)
522 if(content > 0 && nbins > 0) {
523 Double_t factor = (corr ? Double_t(ybins) / nbins : 1);
c25b5e1b 524#if 0
525 AliWarningGeneral(ret->GetName(),
526 Form("factor @ %d is %d/%d -> %f",
527 xbin, ybins, nbins, factor));
528#endif
ce85db45 529 if (error) {
530 // Calculate weighted average
531 ret->SetBinContent(xbin, content * factor);
532 ret->SetBinError(xbin, factor * TMath::Sqrt(error2));
533 }
534 else
535 ret->SetBinContent(xbin, factor * content);
536 }
537 } // for (xbin)
538
539 return ret;
540}
541
542//________________________________________________________________________
543void
544AliBasedNdetaTask::Terminate(Option_t *)
545{
fb3430ac 546 //
547 // Called at end of event processing..
548 //
549 // This is called once in the master
550 //
551 // Parameters:
552 // option Not used
553 //
ce85db45 554 // Draw result to screen, or perform fitting, normalizations Called
555 // once at the end of the query
0be6c8cd 556
ce85db45 557 fSums = dynamic_cast<TList*> (GetOutputData(1));
558 if(!fSums) {
559 AliError("Could not retrieve TList fSums");
560 return;
561 }
562
e1f47419 563 fOutput = new TList;
564 fOutput->SetName(Form("%s_result", GetName()));
565 fOutput->SetOwner();
c89b9ac1 566
0be6c8cd 567 fSNNString = static_cast<TNamed*>(fSums->FindObject("sNN"));
568 fSysString = static_cast<TNamed*>(fSums->FindObject("sys"));
569 fCentAxis = static_cast<TAxis*>(fSums->FindObject("centAxis"));
570 fSchemeString = static_cast<TNamed*>(fSums->FindObject("scheme"));
571 fTriggerString = static_cast<TNamed*>(fSums->FindObject("trigger"));
ce85db45 572
e1f47419 573 if(fSysString && fSNNString &&
574 fSysString->GetUniqueID() == AliForwardUtil::kPP)
575 LoadNormalizationData(fSysString->GetUniqueID(),
576 fSNNString->GetUniqueID());
0be6c8cd 577 // Print before we loop
578 Print();
ce85db45 579
e1f47419 580 // Loop over centrality bins
581 TIter next(fListOfCentralities);
582 CentralityBin* bin = 0;
5bb5d1f6 583 gStyle->SetPalette(1);
584 THStack* dndetaStack = new THStack("dndeta", "dN/d#eta");
585 THStack* dndetaStackRebin = new THStack(Form("dndeta_rebin%02d", fRebin),
586 "dN_{ch}/d#eta");
587 THStack* dndetaMCStack = new THStack("dndetaMC", "dN_{ch}/d#eta");
588 THStack* dndetaMCStackRebin = new THStack(Form("dndetaMC_rebin%02d", fRebin),
589 "dN_{ch}/d#eta");
590
c89b9ac1 591 TList* mclist = 0;
592 TList* truthlist = 0;
593
797161e8 594 if (fFinalMCCorrFile.Contains(".root")) {
c89b9ac1 595 TFile* ftest = TFile::Open(fFinalMCCorrFile.Data());
596 if(ftest) {
797161e8 597 mclist = dynamic_cast<TList*>(ftest->Get(Form("%sResults",GetName())));
598 truthlist = dynamic_cast<TList*>(ftest->Get("MCTruthResults"));
c89b9ac1 599 }
797161e8 600 else
601 AliWarning("MC analysis file invalid - no final MC correction possible");
c89b9ac1 602 }
9ecab72f 603 Int_t style = GetMarker();
604 Int_t color = GetColor();
c89b9ac1 605
9ecab72f 606 AliInfo(Form("Marker style=%d, color=%d", style, color));
5bb5d1f6 607 while ((bin = static_cast<CentralityBin*>(next()))) {
c89b9ac1 608
ffca499d 609 bin->End(fSums, fOutput, fNormalizationScheme, fShapeCorr, fTriggerEff,
c25b5e1b 610 fSymmetrice, fRebin, fUseROOTProj, fCorrEmpty, fCutEdges,
c89b9ac1 611 fTriggerMask, style, color, mclist, truthlist);
5bb5d1f6 612 if (fCentAxis && bin->IsAllBin()) continue;
613 TH1* dndeta = bin->GetResult(0, false, "");
614 TH1* dndetaSym = bin->GetResult(0, true, "");
615 TH1* dndetaMC = bin->GetResult(0, false, "MC");
616 TH1* dndetaMCSym = bin->GetResult(0, true, "MC");
617 if (dndeta) dndetaStack->Add(dndeta);
618 if (dndetaSym) dndetaStack->Add(dndetaSym);
619 if (dndetaMC) dndetaMCStack->Add(dndetaMC);
620 if (dndetaMCSym) dndetaMCStack->Add(dndetaMCSym);
621 if (fRebin > 1) {
622 dndeta = bin->GetResult(fRebin, false, "");
623 dndetaSym = bin->GetResult(fRebin, true, "");
624 dndetaMC = bin->GetResult(fRebin, false, "MC");
625 dndetaMCSym = bin->GetResult(fRebin, true, "MC");
626 if (dndeta) dndetaStackRebin->Add(dndeta);
627 if (dndetaSym) dndetaStackRebin->Add(dndetaSym);
628 if (dndetaMC) dndetaMCStackRebin->Add(dndetaMC);
629 if (dndetaMCSym) dndetaMCStackRebin->Add(dndetaMCSym);
630 }
631 }
632 // Output the stack
633 fOutput->Add(dndetaStack);
634
635 // If available output rebinned stack
636 if (!dndetaStackRebin->GetHists() ||
637 dndetaStackRebin->GetHists()->GetEntries() <= 0) {
638 AliWarning("No rebinned histograms found");
639 delete dndetaStackRebin;
640 dndetaStackRebin = 0;
641 }
642 if (dndetaStackRebin) fOutput->Add(dndetaStackRebin);
643
644 // If available, output track-ref stack
645 if (!dndetaMCStack->GetHists() ||
646 dndetaMCStack->GetHists()->GetEntries() <= 0) {
647 AliWarning("No MC histograms found");
648 delete dndetaMCStack;
649 dndetaMCStack = 0;
650 }
651 if (dndetaMCStack) fOutput->Add(dndetaMCStack);
652
653 // If available, output rebinned track-ref stack
654 if (!dndetaMCStackRebin->GetHists() ||
655 dndetaMCStackRebin->GetHists()->GetEntries() <= 0) {
656 AliWarning("No rebinned MC histograms found");
657 delete dndetaMCStackRebin;
658 dndetaMCStackRebin = 0;
659 }
660 if (dndetaMCStackRebin) fOutput->Add(dndetaMCStackRebin);
ce85db45 661
e1f47419 662 // Output collision energy string
663 if (fSNNString) fOutput->Add(fSNNString->Clone());
ce85db45 664
e1f47419 665 // Output collision system string
666 if (fSysString) fOutput->Add(fSysString->Clone());
ce85db45 667
e308a636 668 // Output centrality axis
669 if (fCentAxis) fOutput->Add(fCentAxis);
670
e1f47419 671 // Output trigger string
0be6c8cd 672 if (fTriggerString) fOutput->Add(fTriggerString->Clone());
673
674 // Normalization string
675 if (fSchemeString) fOutput->Add(fSchemeString->Clone());
ce85db45 676
e1f47419 677 // Output vertex axis
ce85db45 678 TAxis* vtxAxis = new TAxis(1,fVtxMin,fVtxMax);
679 vtxAxis->SetName("vtxAxis");
680 vtxAxis->SetTitle(Form("v_{z}#in[%+5.1f,%+5.1f]cm", fVtxMin,fVtxMax));
681 fOutput->Add(vtxAxis);
e1f47419 682
683 // Output trigger efficiency and shape correction
e58000b7 684 fOutput->Add(new TParameter<Double_t>("triggerEff", fTriggerEff));
685 if (fShapeCorr) fOutput->Add(fShapeCorr);
ffca499d 686
c25b5e1b 687 TNamed* options = new TNamed("options","");
688 TString str;
689 str.Append(Form("Edges %scut, ", fCutEdges ? "" : "not "));
690 str.Append(Form("Empty bins %scorrected for, ", fCorrEmpty ? "" : "not "));
691 str.Append(Form("TH2::ProjectionX %sused", fUseROOTProj ? "" : "not "));
692 options->SetTitle(str);
693 fOutput->Add(options);
694
ce85db45 695 PostData(2, fOutput);
696}
3846ec25 697//________________________________________________________________________
698void
699AliBasedNdetaTask::LoadNormalizationData(UShort_t sys, UShort_t energy)
700{
e1f47419 701 // Load the normalisation data for dN/deta for pp INEL, INEL>0, and NSD
3846ec25 702 TString type("pp");
3846ec25 703 TString snn("900");
704 if(energy == 7000) snn.Form("7000");
705 if(energy == 2750) snn.Form("2750");
706
4fa8d795 707 if(fShapeCorr && (fTriggerEff != 1)) {
e1f47419 708 AliInfo("Objects already set for normalization - no action taken");
709 return;
710 }
3846ec25 711
e1f47419 712 TFile* fin = TFile::Open(Form("$ALICE_ROOT/PWG2/FORWARD/corrections/"
713 "Normalization/normalizationHists_%s_%s.root",
714 type.Data(),snn.Data()));
715 if(!fin) {
716 AliWarning(Form("no file for normalization of %d/%d", sys, energy));
717 return;
718 }
3846ec25 719
4fa8d795 720 // Shape correction
721 if ((fNormalizationScheme & kShape) && !fShapeCorr) {
722 TString trigName("All");
723 if (fTriggerMask == AliAODForwardMult::kInel ||
724 fTriggerMask == AliAODForwardMult::kNClusterGt0)
725 trigName = "Inel";
726 else if (fTriggerMask == AliAODForwardMult::kNSD)
727 trigName = "NSD";
728 else if (fTriggerMask == AliAODForwardMult::kInelGt0)
729 trigName = "InelGt0";
730 else {
731 AliWarning(Form("Normalization for trigger %s not known, using all",
732 AliAODForwardMult::GetTriggerString(fTriggerMask)));
733 }
734
735 TString shapeCorName(Form("h%sNormalization", trigName.Data()));
736 TH2F* shapeCor = dynamic_cast<TH2F*>(fin->Get(shapeCorName));
737 if (shapeCor) SetShapeCorrection(shapeCor);
738 else {
739 AliWarning(Form("No shape correction found for %s", trigName.Data()));
740 }
741 }
ce85db45 742
e1f47419 743 // Trigger efficiency
744 TString effName(Form("%sTriggerEff",
745 fTriggerMask == AliAODForwardMult::kInel ? "inel" :
746 fTriggerMask == AliAODForwardMult::kNSD ? "nsd" :
747 fTriggerMask == AliAODForwardMult::kInelGt0 ?
748 "inelgt0" : "all"));
4fa8d795 749 TParameter<float>* eff = 0;
750 if (fNormalizationScheme & kTriggerEfficiency)
751 eff = static_cast<TParameter<float>*>(fin->Get(effName));
752 Double_t trigEff = eff ? eff->GetVal() : 1;
753 if (fTriggerEff != 1) SetTriggerEff(trigEff);
754 if (fTriggerEff < 0) fTriggerEff = 1;
3846ec25 755
b30dee70 756 // TEMPORARY FIX
757 // Rescale the shape correction by the trigger efficiency
4fa8d795 758 if (fShapeCorr) {
759 AliWarning(Form("Rescaling shape correction by trigger efficiency: "
760 "1/E_X=1/%f", trigEff));
761 fShapeCorr->Scale(1. / trigEff);
762 }
b30dee70 763
e1f47419 764 // Print - out
4fa8d795 765 if (fShapeCorr && fTriggerEff) AliInfo("Loaded objects for normalization.");
3846ec25 766}
0be6c8cd 767
768
769//________________________________________________________________________
770void
771AliBasedNdetaTask::Print(Option_t*) const
772{
773 //
774 // Print information
775 //
776 std::cout << this->ClassName() << ": " << this->GetName() << "\n"
777 << std::boolalpha
778 << " Trigger: " << (fTriggerString ?
779 fTriggerString->GetTitle() :
780 "none") << "\n"
781 << " Vertex range: [" << fVtxMin << ":" << fVtxMax << "]\n"
782 << " Rebin factor: " << fRebin << "\n"
783 << " Cut edges: " << fCutEdges << "\n"
784 << " Symmertrice: " << fSymmetrice << "\n"
c25b5e1b 785 << " Use TH2::ProjectionX: " << fUseROOTProj << "\n"
0be6c8cd 786 << " Correct for empty: " << fCorrEmpty << "\n"
787 << " Normalization scheme: " << (fSchemeString ?
788 fSchemeString->GetTitle() :
789 "none") <<"\n"
790 << " Trigger efficiency: " << fTriggerEff << "\n"
791 << " Shape correction: " << (fShapeCorr ?
792 fShapeCorr->GetName() :
793 "none") << "\n"
794 << " sqrt(s_NN): " << (fSNNString ?
795 fSNNString->GetTitle() :
796 "unknown") << "\n"
797 << " Collision system: " << (fSysString ?
798 fSysString->GetTitle() :
799 "unknown") << "\n"
800 << " Centrality bins: " << (fCentAxis ? "" : "none");
801 if (fCentAxis) {
802 Int_t nBins = fCentAxis->GetNbins();
803 const Double_t* bins = fCentAxis->GetXbins()->GetArray();
804 for (Int_t i = 0; i <= nBins; i++)
805 std::cout << (i==0 ? "" : "-") << bins[i];
806 }
807 std::cout << std::noboolalpha << std::endl;
808
809}
810
ce85db45 811//________________________________________________________________________
812TH1D*
e1f47419 813AliBasedNdetaTask::Rebin(const TH1D* h, Int_t rebin, Bool_t cutEdges)
ce85db45 814{
fb3430ac 815 //
816 // Make a copy of the input histogram and rebin that histogram
817 //
818 // Parameters:
819 // h Histogram to rebin
820 //
821 // Return:
822 // New (rebinned) histogram
823 //
e1f47419 824 if (rebin <= 1) return 0;
ce85db45 825
826 Int_t nBins = h->GetNbinsX();
e1f47419 827 if(nBins % rebin != 0) {
828 AliWarningGeneral("AliBasedNdetaTask",
829 Form("Rebin factor %d is not a devisor of current number "
830 "of bins %d in the histogram %s",
831 rebin, nBins, h->GetName()));
ce85db45 832 return 0;
833 }
834
835 // Make a copy
836 TH1D* tmp = static_cast<TH1D*>(h->Clone(Form("%s_rebin%02d",
e1f47419 837 h->GetName(), rebin)));
838 tmp->Rebin(rebin);
ce85db45 839 tmp->SetDirectory(0);
840
841 // The new number of bins
e1f47419 842 Int_t nBinsNew = nBins / rebin;
ce85db45 843 for(Int_t i = 1;i<= nBinsNew; i++) {
844 Double_t content = 0;
845 Double_t sumw = 0;
846 Double_t wsum = 0;
847 Int_t nbins = 0;
e1f47419 848 for(Int_t j = 1; j<=rebin;j++) {
849 Int_t bin = (i-1)*rebin + j;
ce85db45 850 Double_t c = h->GetBinContent(bin);
ce85db45 851 if (c <= 0) continue;
678a4979 852
e1f47419 853 if (cutEdges) {
ce85db45 854 if (h->GetBinContent(bin+1)<=0 ||
3846ec25 855 h->GetBinContent(bin-1)<=0) {
e1f47419 856#if 0
857 AliWarningGeneral("AliBasedNdetaTask",
858 Form("removing bin %d=%f of %s (%d=%f,%d=%f)",
859 bin, c, h->GetName(),
860 bin+1, h->GetBinContent(bin+1),
861 bin-1, h->GetBinContent(bin-1)));
862#endif
ce85db45 863 continue;
864 }
865 }
866 Double_t e = h->GetBinError(bin);
867 Double_t w = 1 / (e*e); // 1/c/c
868 content += c;
869 sumw += w;
870 wsum += w * c;
871 nbins++;
872 }
873
874 if(content > 0 && nbins > 0) {
875 tmp->SetBinContent(i, wsum / sumw);
876 tmp->SetBinError(i,1./TMath::Sqrt(sumw));
877 }
878 }
879
880 return tmp;
881}
882
883//__________________________________________________________________
ce85db45 884TH1*
e1f47419 885AliBasedNdetaTask::Symmetrice(const TH1* h)
ce85db45 886{
fb3430ac 887 //
888 // Make an extension of @a h to make it symmetric about 0
889 //
890 // Parameters:
891 // h Histogram to symmertrice
892 //
893 // Return:
894 // Symmetric extension of @a h
895 //
ce85db45 896 Int_t nBins = h->GetNbinsX();
897 TH1* s = static_cast<TH1*>(h->Clone(Form("%s_mirror", h->GetName())));
898 s->SetTitle(Form("%s (mirrored)", h->GetTitle()));
899 s->Reset();
900 s->SetBins(nBins, -h->GetXaxis()->GetXmax(), -h->GetXaxis()->GetXmin());
901 s->SetMarkerColor(h->GetMarkerColor());
902 s->SetMarkerSize(h->GetMarkerSize());
9ecab72f 903 s->SetMarkerStyle(FlipHollowStyle(h->GetMarkerStyle()));
ce85db45 904 s->SetFillColor(h->GetFillColor());
905 s->SetFillStyle(h->GetFillStyle());
906 s->SetDirectory(0);
907
908 // Find the first and last bin with data
909 Int_t first = nBins+1;
910 Int_t last = 0;
911 for (Int_t i = 1; i <= nBins; i++) {
912 if (h->GetBinContent(i) <= 0) continue;
913 first = TMath::Min(first, i);
914 last = TMath::Max(last, i);
915 }
916
917 Double_t xfirst = h->GetBinCenter(first-1);
918 Int_t f1 = h->GetXaxis()->FindBin(-xfirst);
919 Int_t l2 = s->GetXaxis()->FindBin(xfirst);
920 for (Int_t i = f1, j=l2; i <= last; i++,j--) {
921 s->SetBinContent(j, h->GetBinContent(i));
922 s->SetBinError(j, h->GetBinError(i));
923 }
924 // Fill in overlap bin
925 s->SetBinContent(l2+1, h->GetBinContent(first));
926 s->SetBinError(l2+1, h->GetBinError(first));
927 return s;
928}
e1f47419 929
9ecab72f 930//__________________________________________________________________
931Int_t
932AliBasedNdetaTask::GetMarkerStyle(UShort_t bits)
933{
934 Int_t base = bits & (0xFE);
935 Bool_t hollow = bits & kHollow;
936 switch (base) {
937 case kCircle: return (hollow ? 24 : 20);
938 case kSquare: return (hollow ? 25 : 21);
939 case kUpTriangle: return (hollow ? 26 : 22);
940 case kDownTriangle: return (hollow ? 32 : 23);
941 case kDiamond: return (hollow ? 27 : 33);
942 case kCross: return (hollow ? 28 : 34);
943 case kStar: return (hollow ? 30 : 29);
944 }
945 return 1;
946}
947//__________________________________________________________________
948UShort_t
949AliBasedNdetaTask::GetMarkerBits(Int_t style)
950{
951 UShort_t bits = 0;
952 switch (style) {
953 case 24: case 25: case 26: case 27: case 28: case 30: case 32:
954 bits |= kHollow; break;
955 }
956 switch (style) {
957 case 20: case 24: bits |= kCircle; break;
958 case 21: case 25: bits |= kSquare; break;
959 case 22: case 26: bits |= kUpTriangle; break;
960 case 23: case 32: bits |= kDownTriangle; break;
961 case 27: case 33: bits |= kDiamond; break;
962 case 28: case 34: bits |= kCross; break;
963 case 29: case 30: bits |= kStar; break;
964 }
965 return bits;
966}
967//__________________________________________________________________
968Int_t
969AliBasedNdetaTask::FlipHollowStyle(Int_t style)
970{
971 UShort_t bits = GetMarkerBits(style);
972 Int_t ret = GetMarkerStyle(bits ^ kHollow);
973 return ret;
974}
975
4fa8d795 976//====================================================================
977void
978AliBasedNdetaTask::Sum::Init(TList* list, const TH2D* data, Int_t col)
979{
980 TString n(GetHistName(0));
981 TString n0(GetHistName(1));
982 const char* postfix = GetTitle();
983
984 fSum = static_cast<TH2D*>(data->Clone(n));
985 if (postfix) fSum->SetTitle(Form("%s (%s)", data->GetTitle(), postfix));
986 fSum->SetDirectory(0);
987 fSum->SetMarkerColor(col);
9ecab72f 988 fSum->SetMarkerStyle(GetMarkerStyle(kCircle|kSolid));
4fa8d795 989 fSum->Reset();
990 list->Add(fSum);
991
992 fSum0 = static_cast<TH2D*>(data->Clone(n0));
993 if (postfix)
994 fSum0->SetTitle(Form("%s 0-bin (%s)", data->GetTitle(), postfix));
995 else
996 fSum0->SetTitle(Form("%s 0-bin", data->GetTitle()));
997 fSum0->SetDirectory(0);
998 fSum0->SetMarkerColor(col);
9ecab72f 999 fSum0->SetMarkerStyle(GetMarkerStyle(kCross|kHollow));
4fa8d795 1000 fSum0->Reset();
1001 list->Add(fSum0);
1002
1003 fEvents = new TH1I(GetHistName(2), "Event types", 2, -.5, 1.5);
1004 fEvents->SetDirectory(0);
1005 fEvents->GetXaxis()->SetBinLabel(1, "Non-zero");
1006 fEvents->GetXaxis()->SetBinLabel(2, "Zero");
1007 list->Add(fEvents);
1008}
1009
1010//____________________________________________________________________
1011TString
1012AliBasedNdetaTask::Sum::GetHistName(Int_t what) const
1013{
1014 TString n(GetName());
1015 if (what == 1) n.Append("0");
1016 else if (what == 2) n.Append("Events");
1017 const char* postfix = GetTitle();
1018 if (postfix && postfix[0] != '\0') n.Append(postfix);
1019 return n;
1020}
1021
1022//____________________________________________________________________
1023void
1024AliBasedNdetaTask::Sum::Add(const TH2D* data, Bool_t isZero)
1025{
1026
1027 if (isZero) fSum0->Add(data);
1028 else fSum->Add(data);
1029 fEvents->Fill(isZero ? 1 : 0);
1030}
1031
1032//____________________________________________________________________
1033TH2D*
1034AliBasedNdetaTask::Sum::GetSum(const TList* input,
1035 TList* output,
1036 Double_t& ntotal,
1037 Double_t epsilon0,
1038 Double_t epsilon,
1039 Int_t marker,
1040 Bool_t rootProj,
1041 Bool_t corrEmpty) const
1042{
1043 TH2D* sum = static_cast<TH2D*>(input->FindObject(GetHistName(0)));
1044 TH2D* sum0 = static_cast<TH2D*>(input->FindObject(GetHistName(1)));
1045 TH1I* events = static_cast<TH1I*>(input->FindObject(GetHistName(2)));
9ecab72f 1046 if (!sum || !sum0 || !events) {
1047 AliWarning(Form("Failed to find one or more histograms: "
1048 "%s (%p) %s (%p) %s (%p)",
1049 GetHistName(0).Data(), sum,
1050 GetHistName(1).Data(), sum0,
1051 GetHistName(2).Data(), events));
1052 return 0;
1053 }
1054
1055 TH2D* ret = static_cast<TH2D*>(sum->Clone(sum->GetName()));
4fa8d795 1056 ret->SetDirectory(0);
1057 ret->Reset();
1058 Int_t n = Int_t(events->GetBinContent(1));
1059 Int_t n0 = Int_t(events->GetBinContent(2));
1060
9ecab72f 1061 AliInfo(Form("Adding histograms %s and %s with weights %f and %f resp.",
1062 sum0->GetName(), sum->GetName(), 1./epsilon, 1./epsilon0));
4fa8d795 1063 // Generate merged histogram
9ecab72f 1064 ret->Add(sum0, sum, 1. / epsilon0, 1. / epsilon);
4fa8d795 1065 ntotal = n / epsilon + n0 / epsilon0;
1066
1067 TList* out = new TList;
1068 out->SetOwner();
1069 const char* postfix = GetTitle();
1070 if (!postfix) postfix = "";
1071 out->SetName(Form("partial%s", postfix));
1072 output->Add(out);
1073
1074 // Now make copies, normalize them, and store in output list
1075 TH2D* sumCopy = static_cast<TH2D*>(sum->Clone("sum"));
1076 TH2D* sum0Copy = static_cast<TH2D*>(sum0->Clone("sum0"));
1077 TH2D* retCopy = static_cast<TH2D*>(ret->Clone("sumAll"));
9ecab72f 1078 sumCopy->SetMarkerStyle(FlipHollowStyle(marker));
4fa8d795 1079 sumCopy->SetDirectory(0);
9ecab72f 1080 sum0Copy->SetMarkerStyle(GetMarkerStyle(GetMarkerBits(marker)+4));
4fa8d795 1081 sum0Copy->SetDirectory(0);
1082 retCopy->SetMarkerStyle(marker);
1083 retCopy->SetDirectory(0);
1084
1085 TH1D* norm = ProjectX(sum, "norm", 0, 0, rootProj, corrEmpty, false);
1086 TH1D* norm0 = ProjectX(sum0, "norm0", 0, 0, rootProj, corrEmpty, false);
1087 TH1D* normAll = ProjectX(ret, "normAll", 0, 0, rootProj, corrEmpty, false);
1088 norm->SetDirectory(0);
1089 norm0->SetDirectory(0);
1090 normAll->SetDirectory(0);
1091
1092 ScaleToCoverage(sumCopy, norm);
1093 ScaleToCoverage(sum0Copy, norm0);
1094 ScaleToCoverage(retCopy, normAll);
1095
1096 Int_t nY = sum->GetNbinsY();
1097 TH1D* sumCopyPx = ProjectX(sumCopy, "average", 1, nY,rootProj,corrEmpty);
1098 TH1D* sum0CopyPx = ProjectX(sum0Copy, "average0", 1, nY,rootProj,corrEmpty);
1099 TH1D* retCopyPx = ProjectX(retCopy, "averageAll", 1, nY,rootProj,corrEmpty);
1100 sumCopyPx->SetDirectory(0);
1101 sum0CopyPx->SetDirectory(0);
1102 retCopyPx->SetDirectory(0);
1103
1104 // Scale our 1D histograms
1105 sumCopyPx->Scale(1., "width");
1106 sum0CopyPx->Scale(1., "width");
1107 retCopyPx->Scale(1., "width");
1108
1109 AliInfo(Form("Maximum %f,%f changed to %f", sumCopyPx->GetMaximum(),
1110 sum0CopyPx->GetMaximum(), retCopyPx->GetMaximum()));
1111
1112 // Scale the normalization - they should be 1 at the maximum
1113 norm->Scale(n > 0 ? 1. / n : 1);
1114 norm0->Scale(n0 > 0 ? 1. / n0 : 1);
1115 normAll->Scale(ntotal > 0 ? 1. / ntotal : 1);
1116
1117 out->Add(sumCopy);
1118 out->Add(sum0Copy);
1119 out->Add(retCopy);
1120 out->Add(sumCopyPx);
1121 out->Add(sum0CopyPx);
1122 out->Add(retCopyPx);
1123 out->Add(norm);
1124 out->Add(norm0);
1125 out->Add(normAll);
1126
1127 AliInfo(Form("Returning (1/%f * %s + 1/%f * %s), "
1128 "1/%f * %d + 1/%f * %d = %d",
1129 epsilon0, sum0->GetName(), epsilon, sum->GetName(),
1130 epsilon0, n0, epsilon, n, int(ntotal)));
1131#if 0
1132 for (Int_t i = 1; i <= ret->GetNbinsX(); i++) {
1133 Double_t nc = sum->GetBinContent(i, 0);
1134 Double_t nc0 = sum0->GetBinContent(i, 0);
1135 ret->SetBinContent(i, 0, nc + nc0); // Just count events
1136 }
1137#endif
1138
1139 return ret;
1140}
1141
e1f47419 1142//====================================================================
1143AliBasedNdetaTask::CentralityBin::CentralityBin()
1144 : TNamed("", ""),
1145 fSums(0),
1146 fOutput(0),
1147 fSum(0),
1148 fSumMC(0),
1149 fTriggers(0),
1150 fLow(0),
c89b9ac1 1151 fHigh(0),
1152 fDoFinalMCCorrection(false)
e1f47419 1153{
1154 //
1155 // Constructor
1156 //
1157}
1158//____________________________________________________________________
1159AliBasedNdetaTask::CentralityBin::CentralityBin(const char* name,
1160 Short_t low, Short_t high)
1161 : TNamed(name, ""),
1162 fSums(0),
1163 fOutput(0),
1164 fSum(0),
1165 fSumMC(0),
1166 fTriggers(0),
1167 fLow(low),
c89b9ac1 1168 fHigh(high),
1169 fDoFinalMCCorrection(false)
e1f47419 1170{
1171 //
1172 // Constructor
1173 //
1174 // Parameters:
1175 // name Name used for histograms (e.g., Forward)
1176 // low Lower centrality cut in percent
1177 // high Upper centrality cut in percent
1178 //
1179 if (low <= 0 && high <= 0) {
1180 fLow = 0;
1181 fHigh = 0;
1182 SetTitle("All centralities");
1183 }
1184 else {
1185 fLow = low;
1186 fHigh = high;
1187 SetTitle(Form("Centrality bin from %3d%% to %3d%%", low, high));
1188 }
1189}
1190//____________________________________________________________________
1191AliBasedNdetaTask::CentralityBin::CentralityBin(const CentralityBin& o)
1192 : TNamed(o),
1193 fSums(o.fSums),
1194 fOutput(o.fOutput),
1195 fSum(o.fSum),
1196 fSumMC(o.fSumMC),
1197 fTriggers(o.fTriggers),
1198 fLow(o.fLow),
c89b9ac1 1199 fHigh(o.fHigh),
1200 fDoFinalMCCorrection(o.fDoFinalMCCorrection)
e1f47419 1201{
1202 //
1203 // Copy constructor
1204 //
1205 // Parameters:
1206 // other Object to copy from
1207 //
1208}
1209//____________________________________________________________________
1210AliBasedNdetaTask::CentralityBin::~CentralityBin()
1211{
1212 //
1213 // Destructor
1214 //
1215 if (fSums) fSums->Delete();
1216 if (fOutput) fOutput->Delete();
1217}
1218
1219//____________________________________________________________________
1220AliBasedNdetaTask::CentralityBin&
1221AliBasedNdetaTask::CentralityBin::operator=(const CentralityBin& o)
1222{
1223 //
1224 // Assignment operator
1225 //
1226 // Parameters:
1227 // other Object to assign from
1228 //
1229 // Return:
1230 // Reference to this
1231 //
1232 SetName(o.GetName());
1233 SetTitle(o.GetTitle());
1234 fSums = o.fSums;
1235 fOutput = o.fOutput;
1236 fSum = o.fSum;
1237 fSumMC = o.fSumMC;
1238 fTriggers = o.fTriggers;
1239 fLow = o.fLow;
1240 fHigh = o.fHigh;
c89b9ac1 1241 fDoFinalMCCorrection = o.fDoFinalMCCorrection;
e1f47419 1242
1243 return *this;
1244}
1245//____________________________________________________________________
5bb5d1f6 1246Int_t
9ecab72f 1247AliBasedNdetaTask::CentralityBin::GetColor(Int_t fallback) const
5bb5d1f6 1248{
9ecab72f 1249 if (IsAllBin()) return fallback;
5bb5d1f6 1250 Float_t fc = (fLow+double(fHigh-fLow)/2) / 100;
1251 Int_t nCol = gStyle->GetNumberOfColors();
1252 Int_t icol = TMath::Min(nCol-1,int(fc * nCol + .5));
1253 Int_t col = gStyle->GetColorPalette(icol);
1254 return col;
1255}
1256//____________________________________________________________________
e1f47419 1257const char*
1258AliBasedNdetaTask::CentralityBin::GetListName() const
1259{
1260 //
1261 // Get the list name
1262 //
1263 // Return:
1264 // List Name
1265 //
1266 if (IsAllBin()) return "all";
1267 return Form("cent%03d_%03d", fLow, fHigh);
1268}
1269//____________________________________________________________________
1270void
1271AliBasedNdetaTask::CentralityBin::CreateOutputObjects(TList* dir)
1272{
1273 //
1274 // Create output objects
1275 //
1276 // Parameters:
1277 // dir Parent list
1278 //
1279 fSums = new TList;
1280 fSums->SetName(GetListName());
1281 fSums->SetOwner();
1282 dir->Add(fSums);
1283
ffca499d 1284 fTriggers = AliAODForwardMult::MakeTriggerHistogram("triggers");
1285 fTriggers->SetDirectory(0);
e1f47419 1286 fSums->Add(fTriggers);
1287}
1288//____________________________________________________________________
1289void
1290AliBasedNdetaTask::CentralityBin::CreateSums(const TH2D* data, const TH2D* mc)
1291{
1292 //
1293 // Create sum histogram
1294 //
1295 // Parameters:
1296 // data Data histogram to clone
1297 // mc (optional) MC histogram to clone
1298 //
9ecab72f 1299 if (data) {
1300 fSum = new Sum(GetName(),"");
1301 fSum->Init(fSums, data, GetColor());
1302 }
1303
e1f47419 1304 // If no MC data is given, then do not create MC sum histogram
1305 if (!mc) return;
1306
4fa8d795 1307 fSumMC = new Sum(GetName(), "MC");
1308 fSumMC->Init(fSums, mc, GetColor());
e1f47419 1309}
1310
1311//____________________________________________________________________
1312Bool_t
1313AliBasedNdetaTask::CentralityBin::CheckEvent(const AliAODForwardMult* forward,
1314 Int_t triggerMask,
1315 Double_t vzMin, Double_t vzMax)
1316{
1317 //
1318 // Check the trigger, vertex, and centrality
1319 //
1320 // Parameters:
1321 // aod Event input
1322 //
1323 // Return:
1324 // true if the event is to be used
1325 //
1326 if (!forward) return false;
e1f47419 1327
ffca499d 1328 // We do not check for centrality here - it's already done
1329 return forward->CheckEvent(triggerMask, vzMin, vzMax, 0, 0, fTriggers);
e1f47419 1330}
1331
1332
1333//____________________________________________________________________
1334void
1335AliBasedNdetaTask::CentralityBin::ProcessEvent(const AliAODForwardMult* forward,
4fa8d795 1336 Int_t triggerMask, Bool_t isZero,
e1f47419 1337 Double_t vzMin, Double_t vzMax,
1338 const TH2D* data, const TH2D* mc)
1339{
1340 //
1341 // Process an event
1342 //
1343 // Parameters:
1344 // forward Forward data (for trigger, vertex, & centrality)
1345 // triggerMask Trigger mask
1346 // vzMin Minimum IP z coordinate
1347 // vzMax Maximum IP z coordinate
1348 // data Data histogram
1349 // mc MC histogram
1350 //
1351 if (!CheckEvent(forward, triggerMask, vzMin, vzMax)) return;
1352 if (!data) return;
1353 if (!fSum) CreateSums(data, mc);
4fa8d795 1354
1355 fSum->Add(data, isZero);
1356 if (mc) fSumMC->Add(mc, isZero);
e1f47419 1357}
1358
1359//________________________________________________________________________
b30dee70 1360Double_t
1361AliBasedNdetaTask::CentralityBin::Normalization(const TH1I& t,
1362 UShort_t scheme,
1363 Double_t trigEff,
1364 Double_t& ntotal) const
e1f47419 1365{
1366 //
b30dee70 1367 // Calculate normalization
e1f47419 1368 //
b30dee70 1369 // Parameters:
1370 // t Trigger histogram
1371 // scheme Normaliztion scheme
1372 // trigEff From MC
1373 // ntotal On return, contains the number of events.
e1f47419 1374 //
0be6c8cd 1375 Double_t nAll = t.GetBinContent(AliAODForwardMult::kBinAll);
1376 Double_t nB = t.GetBinContent(AliAODForwardMult::kBinB);
1377 Double_t nA = t.GetBinContent(AliAODForwardMult::kBinA);
1378 Double_t nC = t.GetBinContent(AliAODForwardMult::kBinC);
1379 Double_t nE = t.GetBinContent(AliAODForwardMult::kBinE);
1380 Double_t nOffline = t.GetBinContent(AliAODForwardMult::kBinOffline);
1381 Double_t nTriggered = t.GetBinContent(AliAODForwardMult::kWithTrigger);
1382 Double_t nWithVertex = t.GetBinContent(AliAODForwardMult::kWithVertex);
4fa8d795 1383 Double_t nAccepted = ntotal; // t.GetBinContent(AliAODForwardMult::kAccepted);
1384 ntotal = 0;
e1f47419 1385
e308a636 1386 if (nTriggered <= 0.1) {
e1f47419 1387 AliError("Number of triggered events <= 0");
b30dee70 1388 return -1;
e1f47419 1389 }
e308a636 1390 if (nWithVertex <= 0.1) {
1391 AliError("Number of events with vertex <= 0");
b30dee70 1392 return -1;
e1f47419 1393 }
b30dee70 1394 ntotal = nAccepted;
1395 Double_t vtxEff = nWithVertex / nTriggered;
0be6c8cd 1396 Double_t scaler = 1;
0be6c8cd 1397 Double_t beta = nA + nC - 2*nE;
b30dee70 1398
4fa8d795 1399 if (scheme & kEventLevel && !(scheme & kZeroBin)) {
0be6c8cd 1400 ntotal = nAccepted / vtxEff;
1401 scaler = vtxEff;
1402 AliInfo(Form("Calculating event normalisation as\n"
b30dee70 1403 " N = N_A * N_T / N_V = %d * %d / %d = %f (%f)",
0be6c8cd 1404 Int_t(nAccepted), Int_t(nTriggered), Int_t(nWithVertex),
b30dee70 1405 ntotal, scaler));
0be6c8cd 1406
1407 if (scheme & kBackground) {
c25b5e1b 1408 // 1 E_V E_V
1409 // s = --------- = ------------- = ------------
1410 // 1 - beta 1 - beta E_V 1 - beta N_V
1411 // --- ---- -------- ---- ---
1412 // E_V N_V N_V N_V N_T
1413 //
1414 // E_V
1415 // = ------------
1416 // 1 - beta
1417 // ----
1418 // N_T
1419 //
0be6c8cd 1420 ntotal -= nAccepted * beta / nWithVertex;
c25b5e1b 1421 // This one is direct and correct.
1422 // scaler = 1. / (1. / vtxEff - beta / nWithVertex);
1423 // A simpler expresion
1424 scaler /= (1 - beta / nTriggered); // 0.831631 -> 0.780689
0be6c8cd 1425 AliInfo(Form("Calculating event normalisation as\n"
c25b5e1b 1426 " beta = N_a + N_c + 2 N_e = %d + %d - 2 * %d = %d\n"
b30dee70 1427 " N = N - N_A * beta / N_V = %f - %d * %d / %d = %f (%f)",
c25b5e1b 1428 Int_t(nA), Int_t(nC), Int_t(nE), Int_t(beta),
0be6c8cd 1429 nAccepted / vtxEff, Int_t(nAccepted), Int_t(beta),
b30dee70 1430 Int_t(nWithVertex), ntotal, scaler));
0be6c8cd 1431 }
ffca499d 1432 }
4fa8d795 1433 if (scheme & kZeroBin) {
1434 // Calculate as
1435 //
1436 // N = N_A + 1/E_X * N_A / N_V (N_T - N_V - beta)
1437 // = N_A (1 + 1/E_X (N_T/N_V - 1 - beta / N_V))
1438 //
1439 // s = N_A/N = 1 / (1 + 1/E_X (N_T/N_V - 1 - beta / N_V))
1440 // = N_V / (N_V + 1/E_X (N_T - N_V - beta))
1441 //
1442 if (!(scheme & kBackground)) beta = 0;
1443 ntotal = nAccepted * (1 + 1/trigEff * (nTriggered / nWithVertex - 1
1444 - beta / nWithVertex));
1445 scaler = nWithVertex / (nWithVertex +
1446 1/trigEff * (nTriggered-nWithVertex-beta));
1447 AliInfo(Form("Calculating event normalisation as\n"
1448 " beta = N_a + N_c + 2 N_e = %d + %d - 2 * %d = %d\n"
1449 " N = N_A (1 + 1/E_X (N_T/N_V - 1 - beta / N_V)) = "
1450 "%d (1 + 1 / %f (%d / %d - 1 - %d / %d)) = %f (%f)",
1451 Int_t(nA), Int_t(nC), Int_t(nE), Int_t(beta),
1452 Int_t(nAccepted), trigEff, Int_t(nTriggered),
1453 Int_t(nWithVertex), Int_t(beta), Int_t(nWithVertex),
1454 ntotal, scaler));
1455 }
1456 if (scheme & kTriggerEfficiency && !(scheme & kZeroBin)) {
b30dee70 1457 ntotal /= trigEff;
1458 scaler *= trigEff;
1459 AliInfo(Form("Correcting for trigger efficiency:\n"
1460 " N = 1 / E_X * N = 1 / %f * %d = %f (%f)",
1461 trigEff, Int_t(ntotal), ntotal / trigEff, scaler));
ffca499d 1462 }
e308a636 1463
0be6c8cd 1464 AliInfo(Form("\n"
1465 " Total of %9d events for %s\n"
1466 " of these %9d have an offline trigger\n"
b30dee70 1467 " of these N_T = %9d has the selected trigger\n"
0be6c8cd 1468 " of these N_V = %9d has a vertex\n"
b30dee70 1469 " of these N_A = %9d were in the selected range\n"
0be6c8cd 1470 " Triggers by hardware type:\n"
1471 " N_b = %9d\n"
1472 " N_ac = %9d (%d+%d)\n"
1473 " N_e = %9d\n"
0be6c8cd 1474 " Vertex efficiency: %f\n"
1475 " Trigger efficiency: %f\n"
1476 " Total number of events: N = %f\n"
1477 " Scaler (N_A/N): %f",
1478 Int_t(nAll), GetTitle(), Int_t(nOffline),
b30dee70 1479 Int_t(nTriggered), Int_t(nWithVertex), Int_t(nAccepted),
0be6c8cd 1480 Int_t(nB), Int_t(nA+nC), Int_t(nA), Int_t(nC), Int_t(nE),
b30dee70 1481 vtxEff, trigEff, ntotal, scaler));
1482 return scaler;
1483}
1484
5bb5d1f6 1485//________________________________________________________________________
1486const char*
1487AliBasedNdetaTask::CentralityBin::GetResultName(Int_t rebin,
1488 Bool_t sym,
1489 const char* postfix) const
1490{
1491 static TString n;
1492 n = Form("dndeta%s%s",GetName(), postfix);
1493 if (rebin > 1) n.Append(Form("_rebin%02d", rebin));
1494 if (sym) n.Append("_mirror");
1495 return n.Data();
1496}
1497//________________________________________________________________________
1498TH1*
1499AliBasedNdetaTask::CentralityBin::GetResult(Int_t rebin,
1500 Bool_t sym,
1501 const char* postfix) const
1502{
1503 if (!fOutput) {
1504 AliWarning(Form("No output list defined in %s [%3d,%3d]", GetName(),
1505 fLow, fHigh));
1506 return 0;
1507 }
1508 TString n = GetResultName(rebin, sym, postfix);
1509 TObject* o = fOutput->FindObject(n.Data());
1510 if (!o) {
1511 // AliWarning(Form("Object %s not found in output list", n.Data()));
1512 return 0;
1513 }
1514 return static_cast<TH1*>(o);
1515}
1516
c25b5e1b 1517//________________________________________________________________________
1518void
1519AliBasedNdetaTask::CentralityBin::MakeResult(const TH2D* sum,
1520 const char* postfix,
1521 bool rootProj,
1522 bool corrEmpty,
1523 const TH1* shapeCorr,
1524 Double_t scaler,
1525 bool symmetrice,
1526 Int_t rebin,
1527 bool cutEdges,
9ecab72f 1528 Int_t marker,
c89b9ac1 1529 Int_t color,
1530 TList* mclist,
1531 TList* truthlist)
c25b5e1b 1532{
1533 //
1534 // Generate the dN/deta result from input
1535 //
1536 // Parameters:
1537 // sum Sum of 2D hists
1538 // postfix Post fix on names
1539 // rootProj Whether to use ROOT TH2::ProjectionX
1540 // corrEmpty Correct for empty bins
1541 // shapeCorr Shape correction to use
1542 // scaler Event-level normalization scaler
1543 // symmetrice Whether to make symmetric extensions
1544 // rebin Whether to rebin
1545 // cutEdges Whether to cut edges when rebinning
1546 //
1547 TH2D* copy = static_cast<TH2D*>(sum->Clone(Form("d2Ndetadphi%s%s",
1548 GetName(), postfix)));
1549 TH1D* accNorm = ProjectX(sum, Form("norm%s%s",GetName(), postfix), 0, 0,
1550 rootProj, corrEmpty, false);
1551 accNorm->SetDirectory(0);
1552
1553 // ---- Scale by shape correction ----------------------------------
1554 if (shapeCorr) copy->Divide(shapeCorr);
1555 else AliInfo("No shape correction specified, or disabled");
1556
4fa8d795 1557 // --- Normalize to the coverage -----------------------------------
1558 ScaleToCoverage(copy, accNorm);
1559
c25b5e1b 1560 // --- Event-level normalization -----------------------------------
1561 copy->Scale(scaler);
1562
1563 // --- Project on X axis -------------------------------------------
1564 TH1D* dndeta = ProjectX(copy, Form("dndeta%s%s",GetName(), postfix),
1565 1, sum->GetNbinsY(), rootProj, corrEmpty);
1566 dndeta->SetDirectory(0);
1567 // Event-level normalization
1568 dndeta->Scale(1., "width");
1569 copy->Scale(1., "width");
c89b9ac1 1570
1571 TH1D* dndetaMCCorrection = 0;
1572 TList* centlist = 0;
1573 TH1D* dndetaMCtruth = 0;
1574 TList* truthcentlist = 0;
1575
1576 // Possible final correction to <MC analysis> / <MC truth>
1577 if(mclist)
1578 centlist = static_cast<TList*> (mclist->FindObject(GetListName()));
1579 if(centlist)
797161e8 1580 dndetaMCCorrection = static_cast<TH1D*>(centlist->FindObject(Form("dndeta%s%s",GetName(), postfix)));
c89b9ac1 1581 if(truthlist)
1582 truthcentlist = static_cast<TList*> (truthlist->FindObject(GetListName()));
1583 if(truthcentlist)
1584 dndetaMCtruth = static_cast<TH1D*> (truthcentlist->FindObject("dndetaTruth"));
1585 //std::cout<<dndetaMCCorrection<<" "<<dndetaMCtruth<<std::endl;
1586 if(dndetaMCCorrection && dndetaMCtruth) {
1587 AliInfo("Correcting with final MC correction");
1588 dndetaMCCorrection->Divide(dndetaMCtruth);
1589 dndeta->Divide(dndetaMCCorrection);
1590
1591 //std::cout<<"histo "<<Form("dndeta%s%s",GetName(), postfix)<<" "<<GetListName()<<" "<<dndetaMCCorrection<<std::endl;
1592 //std::cout<<"truth "<<GetListName()<<" "<<dndetaMCtruth<<std::endl;
1593
1594 }
1595 else AliInfo("No final MC correction applied");
1596
c25b5e1b 1597 // --- Set some histogram attributes -------------------------------
5bb5d1f6 1598 TString post;
9ecab72f 1599 Int_t rColor = GetColor(color);
5bb5d1f6 1600 if (postfix && postfix[0] != '\0') post = Form(" (%s)", postfix);
9ecab72f 1601 SetHistogramAttributes(dndeta, rColor, marker,
5bb5d1f6 1602 Form("ALICE %s%s", GetName(), post.Data()));
9ecab72f 1603 SetHistogramAttributes(accNorm, rColor, marker,
5bb5d1f6 1604 Form("ALICE %s normalisation%s",
1605 GetName(), post.Data()));
c25b5e1b 1606
1607 // --- Make symmetric extensions and rebinnings --------------------
1608 if (symmetrice) fOutput->Add(Symmetrice(dndeta));
1609 fOutput->Add(dndeta);
1610 fOutput->Add(accNorm);
1611 fOutput->Add(copy);
1612 fOutput->Add(Rebin(dndeta, rebin, cutEdges));
1613 if (symmetrice) fOutput->Add(Symmetrice(Rebin(dndeta, rebin, cutEdges)));
1614}
1615
b30dee70 1616//________________________________________________________________________
1617void
1618AliBasedNdetaTask::CentralityBin::End(TList* sums,
1619 TList* results,
1620 UShort_t scheme,
1621 const TH1* shapeCorr,
1622 Double_t trigEff,
1623 Bool_t symmetrice,
1624 Int_t rebin,
c25b5e1b 1625 Bool_t rootProj,
b30dee70 1626 Bool_t corrEmpty,
1627 Bool_t cutEdges,
1628 Int_t triggerMask,
9ecab72f 1629 Int_t marker,
c89b9ac1 1630 Int_t color,
1631 TList* mclist,
1632 TList* truthlist)
b30dee70 1633{
1634 //
1635 // End of processing
1636 //
1637 // Parameters:
1638 // sums List of sums
1639 // results Output list of results
1640 // shapeCorr Shape correction or nil
1641 // trigEff Trigger efficiency
1642 // symmetrice Whether to symmetrice the results
1643 // rebin Whether to rebin the results
1644 // corrEmpty Whether to correct for empty bins
1645 // cutEdges Whether to cut edges when rebinning
1646 // triggerMask Trigger mask
1647 //
1648
1649 fSums = dynamic_cast<TList*>(sums->FindObject(GetListName()));
1650 if(!fSums) {
1651 AliError("Could not retrieve TList fSums");
1652 return;
1653 }
e1f47419 1654
b30dee70 1655 fOutput = new TList;
1656 fOutput->SetName(GetListName());
1657 fOutput->SetOwner();
1658 results->Add(fOutput);
1659
9ecab72f 1660 if (!fSum) {
1661 AliInfo("This task did not produce any output");
1662 return;
1663 }
1664
b30dee70 1665 fTriggers = static_cast<TH1I*>(fSums->FindObject("triggers"));
1666
1667 if (!fTriggers) {
1668 AliError("Couldn't find histogram 'triggers' in list");
1669 return;
1670 }
1671 if (!fSum) {
9ecab72f 1672 AliError(Form("No sum object for %s", GetName()));
b30dee70 1673 return;
1674 }
1675
b30dee70 1676 // --- Get normalization scaler ------------------------------------
4fa8d795 1677 Double_t epsilonT = trigEff;
1678 Double_t epsilonT0 = trigEff;
b30dee70 1679 // TEMPORARY FIX
1680 if (triggerMask == AliAODForwardMult::kNSD) {
1681 // This is a local change
c89b9ac1 1682 epsilonT = 0.96;
b30dee70 1683 AliWarning(Form("Using hard-coded NSD trigger efficiency of %f",epsilonT));
1684 }
4fa8d795 1685 else if (triggerMask == AliAODForwardMult::kInel) {
1686 // This is a local change
c89b9ac1 1687 epsilonT = 0.934;
4fa8d795 1688 AliWarning(Form("Using hard-coded Inel trigger efficiency of %f",epsilonT));
1689 }
1690 if (scheme & kZeroBin) {
1691 if (triggerMask==AliAODForwardMult::kInel)
1692 epsilonT0 = 0.785021; // 0.100240;
1693 else if (triggerMask==AliAODForwardMult::kInelGt0)
1694 epsilonT0 = 0;
1695 else if (triggerMask==AliAODForwardMult::kNSD)
1696 epsilonT0 = .706587;
1697 epsilonT = 1;
1698 AliWarning(Form("Using hard-coded NCluster>0 trigger efficiency of %f",
1699 epsilonT0));
1700 }
1701
1702 // Get our histograms
1703 Double_t nSum = 0;
1704 TH2D* sum = fSum->GetSum(fSums, fOutput, nSum, epsilonT0, 1,
1705 marker, rootProj, corrEmpty);
1706 Double_t nSumMC = 0;
1707 TH2D* sumMC = 0;
1708 if (fSumMC) sumMC = fSumMC->GetSum(fSums, fOutput, nSumMC,
1709 epsilonT0, 1, marker,
1710 rootProj, corrEmpty);
1711 if (!sum) {
1712 AliError("Failed to get sum from summer - bailing out");
1713 return;
1714 }
1715
1716 Double_t ntotal = nSum;
b30dee70 1717 Double_t scaler = Normalization(*fTriggers, scheme, epsilonT, ntotal);
1718 if (scaler < 0) {
1719 AliError("Failed to calculate normalization - bailing out");
1720 return;
1721 }
e1f47419 1722 fOutput->Add(fTriggers->Clone());
c25b5e1b 1723
1724 // --- Make result and store ---------------------------------------
4fa8d795 1725 MakeResult(sum, "", rootProj, corrEmpty, (scheme & kShape) ? shapeCorr : 0,
797161e8 1726 scaler, symmetrice, rebin, cutEdges, marker, color,
1727 mclist, truthlist);
e1f47419 1728
b30dee70 1729 // --- Process result from TrackRefs -------------------------------
4fa8d795 1730 if (sumMC)
1731 MakeResult(sumMC, "MC", rootProj, corrEmpty,
c25b5e1b 1732 (scheme & kShape) ? shapeCorr : 0,
4fa8d795 1733 scaler, symmetrice, rebin, cutEdges,
797161e8 1734 GetMarkerStyle(GetMarkerBits(marker)+4), color,
1735 mclist, truthlist);
4fa8d795 1736
e308a636 1737 // Temporary stuff
5bb5d1f6 1738 // if (!IsAllBin()) return;
e308a636 1739
e1f47419 1740}
1741
fb3430ac 1742//
1743// EOF
1744//