]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/FORWARD/analysis2/AliBasedNdetaTask.h
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AliBasedNdetaTask.h
CommitLineData
ce85db45 1//
2// Task to analyse the AOD for for dN/deta in the base regions
3//
4#ifndef ALIBASEDNDETATASK_H
5#define ALIBASEDNDETATASK_H
ffca499d 6/**
7 * @file AliBasedNdetaTask.h
8 * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
9 * @date Wed Mar 23 13:58:12 2011
10 *
11 * @brief
12 *
bd6f5206 13 * @ingroup pwglf_forward_dndeta
ffca499d 14 *
15 */
c8b1a7db 16#include "AliBaseAODTask.h"
e308a636 17class TAxis;
ce85db45 18class TList;
19class TH2D;
f67d699c 20class TH2F;
ce85db45 21class TH1D;
ffca499d 22class TH1I;
ce85db45 23class AliAODEvent;
e1f47419 24class AliAODForwardMult;
e308a636 25class TObjArray;
ce85db45 26
ffca499d 27/**
bd6f5206 28 * @defgroup pwglf_forward_tasks_dndeta dN/deta tasks
290052e7 29 *
30 * Code to produce @f$ dN/d\eta@f$
31 *
bd6f5206 32 * @ingroup pwglf_forward_tasks
ffca499d 33 */
34/**
bd6f5206 35 * @defgroup pwglf_forward_dndeta dN/deta
ffca499d 36 *
37 * @f$ dN/d\eta@f$ code
38 *
bd6f5206 39 * @ingroup pwglf_forward_topical
ffca499d 40 */
ce85db45 41/**
ffca499d 42 * Base class for tasks to determine @f$ dN/d\eta@f$
43 *
bd6f5206 44 * @ingroup pwglf_forward_tasks_dndeta
45 * @ingroup pwglf_forward_dndeta
ce85db45 46 */
c8b1a7db 47class AliBasedNdetaTask : public AliBaseAODTask
ce85db45 48{
49public:
ffca499d 50 /**
51 * Bit mask values of the normalisation scheme
52 */
53 enum {
54 /** Only normalize to accepted events */
55 kNone = 0,
56 /**
57 * Do the full normalisation
58 * @f[
59 * N = \frac{1}{\epsilon_X}(N_A-N_A/N_V(N_T-N_V)) =
60 * \frac{1}{\epsilon_X}\frac{1}{\epsilon_V}N_A
61 * @f]
62 */
63 kEventLevel = 0x1,
ffca499d 64 /**
65 * Do the shape correction
66 */
0be6c8cd 67 kShape = 0x2,
ffca499d 68 /**
69 * Correct for background events (A+C-E). Not implemented yet
70 */
0be6c8cd 71 kBackground = 0x4,
ffca499d 72 /**
0be6c8cd 73 * Correct for the trigger efficiency from MC
ffca499d 74 */
0be6c8cd 75 kTriggerEfficiency = 0x8,
4fa8d795 76 /**
77 * Correct using zero-bin efficiency only
78 */
79 kZeroBin = 0x10,
0be6c8cd 80 /**
81 * Do the full correction
ffca499d 82 */
0be6c8cd 83 kFull = kEventLevel | kShape | kBackground | kTriggerEfficiency,
ffca499d 84 };
ce85db45 85 /**
86 * Constructor
87 *
88 */
89 AliBasedNdetaTask();
90 /**
91 * Constructor
92 *
93 * @param name Name of task
ce85db45 94 */
95 AliBasedNdetaTask(const char* name);
e1f47419 96 /**
97 * Destructor
98 *
99 */
100 virtual ~AliBasedNdetaTask();
ce85db45 101
e1f47419 102 /**
103 * @{
104 * @name Task configuration
105 */
290052e7 106 /**
107 * Set the debug level
108 *
109 * @param level Debug level
110 */
f53fb4f6 111 virtual void SetDebugLevel(Int_t level);
ce85db45 112 /**
113 * Set the rebinning factor
114 *
115 * @param rebin Rebinning factor
116 */
117 void SetRebinning(Int_t rebin) { fRebin = rebin; }
3846ec25 118 /**
ffca499d 119 * Whether to cut edges when merging
3846ec25 120 *
ffca499d 121 * @param cut If true, cut edges
3846ec25 122 */
123 void SetCutEdges(Bool_t cut) {fCutEdges = cut;}
c25b5e1b 124 /**
125 * Set whether to correct for empty bins when projecting on the X axis.
126 *
127 * @param use Whether to correct for empty bins
128 */
129 void SetCorrEmpty(Bool_t use) { fCorrEmpty = use; }
130 /**
131 * Set whether to use the ROOT TH2::ProjectionX method when
132 * projecting on the X axis.
133 *
134 * @param use Whether to use TH2::ProjectionX
135 */
136 void SetUseROOTProjectX(Bool_t use) { fUseROOTProj = use; }
e58000b7 137 /**
138 * Trigger efficiency for selected trigger(s)
139 *
140 * @param e Trigger efficiency
141 */
142 void SetTriggerEff(Double_t e) { fTriggerEff = e; }
66cf95f2 143 /**
144 * Trigger efficiency for 0-bin for selected trigger(s)
145 *
146 * @param e Trigger efficiency for 0-bin
147 */
148 void SetTriggerEff0(Double_t e) { fTriggerEff0 = e; }
e58000b7 149 /**
150 * Set the shape correction (a.k.a., track correction) for selected
151 * trigger(s)
152 *
153 * @param h Correction
154 */
f67d699c 155 void SetShapeCorrection(const TH2F* h);
bfab35d9 156 /**
157 * Set satellite vertex flag
158 *
159 * @param satVtx
160 */
161 void SetSatelliteVertices(Bool_t satVtx) { fSatelliteVertices = satVtx; }
a76fb27d 162 /**
163 * Get a string representing the normalization scheme
164 *
165 * @param scheme Normalization scheme bits
166 *
167 * @return String representation
168 */
169 static const Char_t* NormalizationSchemeString(UShort_t scheme);
170 /**
171 * Parse a string representing the normalization scheme
172 *
173 * @param what String of the normalization scheme
174 *
175 * @return normalization scheme bits
176 */
177 static UShort_t ParseNormalizationScheme(const Char_t* what);
678a4979 178 /**
ffca499d 179 * Setthe normalisation scheme to use
180 *
181 * @param scheme Normalisation scheme
182 */
0be6c8cd 183 void SetNormalizationScheme(UShort_t scheme);
ffca499d 184 /**
185 * Space, pipe, or comma separated list of options
186 *
187 * @param what List of options
678a4979 188 */
ffca499d 189 void SetNormalizationScheme(const char* what);
c89b9ac1 190 /**
191 * Filename of final MC correction
192 *
193 * @param filename filename
194 */
195 void SetMCFinalCorrFilename(const char* filename) {
196 fFinalMCCorrFile.Clear();
197 fFinalMCCorrFile.Append(filename);
198 }
678a4979 199 /**
200 * Load the normalization data - done automatically if not set from outside
201 *
e1f47419 202 * @param sys system
203 * @param energy energy
678a4979 204 */
e1f47419 205 void LoadNormalizationData(UShort_t sys, UShort_t energy);
206 /** @} */
0be6c8cd 207 /**
208 * Print information
209 *
210 * @param option Not used
211 */
212 void Print(Option_t* option="") const;
e1f47419 213 /** @{
214 * @name Task interface
ce85db45 215 */
ce85db45 216 /**
217 * Create output objects.
218 *
219 * This is called once per slave process
c8b1a7db 220 *
221 * @return true on success
ce85db45 222 */
c8b1a7db 223 virtual Bool_t Book();
ce85db45 224 /**
225 * Process a single event
226 *
c8b1a7db 227 * @return true on success
ce85db45 228 */
c8b1a7db 229 virtual Bool_t Event(AliAODEvent& aod);
ce85db45 230 /**
ffca499d 231 * Called at end of event processing.
ce85db45 232 *
233 * This is called once in the master
234 *
c8b1a7db 235 * @return true on success
ce85db45 236 */
c8b1a7db 237 virtual Bool_t Finalize();
ffca499d 238 /* @} */
ce85db45 239
240 /**
e1f47419 241 * @{
242 * @name Services member functions
ce85db45 243 */
ce85db45 244 /**
245 * Make a copy of the input histogram and rebin that histogram
246 *
ffca499d 247 * @param h Histogram to rebin
248 * @param rebin Rebinning factor
249 * @param cutEdges Whether to cut edges when rebinning
ce85db45 250 *
251 * @return New (rebinned) histogram
252 */
e1f47419 253 static TH1D* Rebin(const TH1D* h, Int_t rebin, Bool_t cutEdges=false);
ce85db45 254 /**
255 * Make an extension of @a h to make it symmetric about 0
256 *
257 * @param h Histogram to symmertrice
258 *
259 * @return Symmetric extension of @a h
260 */
e1f47419 261 static TH1* Symmetrice(const TH1* h);
ce85db45 262 /**
263 * Project onto the X axis
264 *
265 * @param h 2D histogram
266 * @param name New name
267 * @param firstbin First bin to use
268 * @param lastbin Last bin to use
9f773c15 269 * @param useROOT Use TH2::ProjectionX instead of custom code
ffca499d 270 * @param corr Whether to do corrections or not
ce85db45 271 * @param error Whether to calculate errors
272 *
273 * @return Newly created histogram or null
274 */
e1f47419 275 static TH1D* ProjectX(const TH2D* h,
276 const char* name,
277 Int_t firstbin,
278 Int_t lastbin,
c25b5e1b 279 bool useROOT=false,
e1f47419 280 bool corr=true,
281 bool error=true);
4fa8d795 282 /**
283 * Scale the copy of the 2D histogram by coverage in supplied 1D histogram
284 *
285 * @param copy Data to scale
286 * @param norm Coverage histogram
287 */
288 static void ScaleToCoverage(TH2D* copy, const TH1D* norm);
5ca83fee 289 /**
290 * Scale the copy of the 1D histogram by coverage in supplied 1D histogram
291 *
292 * @param copy Data to scale
293 * @param norm Coverage histogram
294 */
295 static void ScaleToCoverage(TH1D* copy, const TH1D* norm);
ce85db45 296 /**
297 * Set histogram graphical options, etc.
298 *
299 * @param h Histogram to modify
300 * @param colour Marker color
301 * @param marker Marker style
302 * @param title Title of histogram
303 * @param ytitle Title on y-axis.
304 */
e1f47419 305 static void SetHistogramAttributes(TH1D* h, Int_t colour, Int_t marker,
306 const char* title,
c8b1a7db 307 const char* ytitle=0);
e1f47419 308 /** @} */
9ecab72f 309
310 /**
311 * Marker styles
312 */
313 enum {
314 kSolid = 0x000,
315 kHollow = 0x001,
316 kCircle = 0x002,
317 kSquare = 0x004,
318 kUpTriangle = 0x006,
319 kDownTriangle = 0x008,
320 kDiamond = 0x00a,
321 kCross = 0x00c,
322 kStar = 0x00e
323 };
290052e7 324 /**
325 * Get the marker style from option bits
326 *
327 * @param bits Option bits
328 *
329 * @return Marker style
330 */
9ecab72f 331 static Int_t GetMarkerStyle(UShort_t bits);
290052e7 332 /**
333 * Get the marker option bits from a style
334 *
335 * @param style Style
336 *
337 * @return option bits
338 */
9ecab72f 339 static UShort_t GetMarkerBits(Int_t style);
290052e7 340 /**
341 * Flip an option bit
342 *
343 * @param style Style parameter
344 *
345 * @return New style
346 */
9ecab72f 347 static Int_t FlipHollowStyle(Int_t style);
3d9b0442 348 /*Setter of empirical correction*/
349 void SetGlobalEmpiricalcorrection(TH2D* globalempiricalcorrection){fglobalempiricalcorrection=globalempiricalcorrection;}
e1f47419 350protected:
9ecab72f 351 /**
c8b1a7db 352 * Copy contructor - not defined
9ecab72f 353 */
e1f47419 354 AliBasedNdetaTask(const AliBasedNdetaTask&);
9ecab72f 355 /**
c8b1a7db 356 * Assignment operator - not defined
9ecab72f 357 *
358 *
359 * @return
360 */
c8b1a7db 361 AliBasedNdetaTask& operator=(const AliBasedNdetaTask&);
9ecab72f 362 // Forward declaration
e1f47419 363 class CentralityBin;
c8b1a7db 364 /**
365 * Check if the event corresponds to the selected trigger(s),
366 * vertex, and centrality. Derived classes can overload this to
367 * enable event processing - even if the event is not within cuts.
368 *
369 * @param forward Forward object
370 *
371 * @return true if the event is within the cuts.
372 */
373 virtual Bool_t CheckEvent(const AliAODForwardMult& forward);
f67d699c 374 /**
375 * Create the CentralityBin objects if not already done.
376 *
377 */
378 virtual void InitializeCentBins();
e1f47419 379 /**
380 * Retrieve the histogram
381 *
382 * @param aod AOD event
383 * @param mc Whether to get the MC histogram or not
384 *
385 * @return Retrieved histogram or null
386 */
c8b1a7db 387 virtual TH2D* GetHistogram(const AliAODEvent& aod, Bool_t mc=false) = 0;
ffca499d 388 /**
9ecab72f 389 * Get the colour to use for markers (only pp - in PbPb we use a rainbow)
ffca499d 390 *
391 * @return Marker colour
392 */
9ecab72f 393 virtual Int_t GetColor() const { return kBlack; }
ffca499d 394 /**
395 * Get the marker style
396 *
397 * @return Marker style
398 */
9ecab72f 399 virtual Int_t GetMarker() const { return GetMarkerStyle(kCircle); }
bfab35d9 400 /**
401 * Massage data histograms if needed
402 *
403 * @param vtx
404 * @param data
405 * @param mcData
406 */
407 virtual void CheckEventData(Double_t vtx,
408 TH2* data,
409 TH2* mcData);
e308a636 410 /**
411 * Add a centrality bin
412 *
ffca499d 413 * @param at Where in the list to add this bin
e308a636 414 * @param low Low cut
415 * @param high High cut
416 */
417 void AddCentralityBin(UShort_t at, Short_t low, Short_t high);
e1f47419 418 /**
419 * Make a centrality bin
420 *
421 * @param name Name used for histograms
422 * @param low Low cut in percent
423 * @param high High cut in percent
424 *
425 * @return A newly created centrality bin
426 */
427 virtual CentralityBin* MakeCentralityBin(const char* name, Short_t low,
428 Short_t high) const;
4fa8d795 429
3d9b0442 430 // function which applies empirical correction to the AOD object
431 Bool_t ApplyEmpiricalCorrection(const AliAODForwardMult* aod,TH2D* data);
4fa8d795 432 //==================================================================
9ecab72f 433 /**
434 * Class that holds the sum of the data - possibly split into 0 or
435 * non-zero bins
436 *
437 */
4fa8d795 438 struct Sum : public TNamed
439 {
440 TH2D* fSum; // Sum of non-zero events
441 TH2D* fSum0; // Sum of zero events
442 TH1I* fEvents; // Distribution of events
f53fb4f6 443 Int_t fDebug; // Debug level
9ecab72f 444 /**
445 * I/O Constructor - do not use
446 */
f53fb4f6 447 Sum() : fSum(0), fSum0(0), fEvents(0), fDebug(0) {}
9ecab72f 448 /**
449 * Constructor
450 *
451 * @param name Name
452 * @param postfix Possible post-fix
453 */
4fa8d795 454 Sum(const char* name, const char* postfix)
455 : TNamed(name,postfix),
456 fSum(0),
457 fSum0(0),
f53fb4f6 458 fEvents(0),
459 fDebug(0)
4fa8d795 460 {}
9ecab72f 461 /**
462 * Copy constructor
463 *
464 * @param o Object to copy from
465 */
4fa8d795 466 Sum(const Sum& o)
467 : TNamed(o),
468 fSum(o.fSum),
469 fSum0(o.fSum0),
f53fb4f6 470 fEvents(o.fEvents),
471 fDebug(o.fDebug)
4fa8d795 472 {}
9ecab72f 473 /**
474 * Assignment operator
475 *
476 * @param o Object to assign from
477 *
478 * @return Reference to this object
479 */
997ba0f4 480 Sum& operator=(const Sum& o)
481 {
482 if (&o == this) return *this;
4fa8d795 483 SetName(o.GetName()); fSum = o.fSum; fSum0 = o.fSum0; fEvents=o.fEvents;
484 return *this;
485 }
9ecab72f 486 /**
487 * Destructor
488 */
4fa8d795 489 ~Sum() {}
9ecab72f 490 /**
491 * Initialise this object.
492 *
493 * @param list List to add histograms to
494 * @param data Format of data to be cloned here
495 * @param col Color
496 */
4fa8d795 497 void Init(TList* list, const TH2D* data, Int_t col);
9ecab72f 498 /**
499 * Add an event
500 *
501 * @param data Data to add
502 * @param isZero If this is zero event
503 */
4fa8d795 504 void Add(const TH2D* data, Bool_t isZero=false);
f67d699c 505 /**
506 * Get the histogram name
507 *
508 * @param name Base name
509 * @param what Which one
510 * @param post Possible postfix
511 *
512 * @return Name
513 */
514 static TString GetHistName(const char* name, Int_t what=0,
515 const char* post=0);
9ecab72f 516 /**
517 * Get the histogram name
518 *
519 * @param what Which one
520 *
521 * @return Name
522 */
4fa8d795 523 TString GetHistName(Int_t what=0) const;
9ecab72f 524 /**
525 * Get the sum
526 *
9ecab72f 527 * @param o Output list
528 * @param ntotal On return, the total number of events
529 * @param zeroEff Zero-bin efficiency
530 * @param otherEff Non-zero-bin efficiency
531 * @param marker Marker to use
532 * @param rootXproj Whether to use TH2::ProjectionX
533 * @param corrEmpty Correct for empty bins
534 *
535 * @return The total sum histogram
536 */
f67d699c 537 TH2D* CalcSum(TList* o, Double_t& ntotal,
538 Double_t zeroEff, Double_t otherEff=1, Int_t marker=20,
539 Bool_t rootXproj=false, Bool_t corrEmpty=true) const;
e12f8c42 540
c8b1a7db 541 ClassDef(Sum,2); // Summed histograms
4fa8d795 542 };
4fa8d795 543
544 //==================================================================
e1f47419 545 /**
546 * Calculations done per centrality
547 *
548 */
badf1074 549 class CentralityBin : public TNamed
e1f47419 550 {
badf1074 551 public:
bfab35d9 552 /**
e1f47419 553 * Constructor
554 */
555 CentralityBin();
556 /**
557 * Constructor
558 *
559 * @param name Name used for histograms (e.g., Forward)
560 * @param low Lower centrality cut in percent
561 * @param high Upper centrality cut in percent
562 */
563 CentralityBin(const char* name, Short_t low, Short_t high);
564 /**
565 * Copy constructor
566 *
567 * @param other Object to copy from
568 */
569 CentralityBin(const CentralityBin& other);
570 /**
571 * Destructor
572 */
573 virtual ~CentralityBin();
574 /**
575 * Assignment operator
576 *
577 * @param other Object to assign from
578 *
579 * @return Reference to this
580 */
581 CentralityBin& operator=(const CentralityBin& other);
582 /**
583 * Check if this is the 'all' bin
584 *
585 * @return true if low and high cuts are both zero
586 */
587 Bool_t IsAllBin() const { return fLow == 0 && fHigh == 0; }
588 /**
589 * Get the list name
590 *
591 * @return List Name
592 */
593 const char* GetListName() const;
594 /**
595 * Create output objects
596 *
597 * @param dir Parent list
1a7e2e15 598 * @param mask Trigger mask
e1f47419 599 */
1a7e2e15 600 virtual void CreateOutputObjects(TList* dir, Int_t mask);
e1f47419 601 /**
602 * Process an event
603 *
604 * @param forward Forward data (for trigger, vertex, & centrality)
605 * @param triggerMask Trigger mask
9ecab72f 606 * @param isZero True if this is a zero bin event
e1f47419 607 * @param vzMin Minimum IP z coordinate
608 * @param vzMax Maximum IP z coordinate
609 * @param data Data histogram
610 * @param mc MC histogram
bfab35d9 611 *
612 * @return true if the event was selected
e1f47419 613 */
bfab35d9 614 virtual Bool_t ProcessEvent(const AliAODForwardMult* forward,
615 Int_t triggerMask,
616 Bool_t isZero,
617 Double_t vzMin,
618 Double_t vzMax,
619 const TH2D* data,
620 const TH2D* mc);
b30dee70 621 /**
622 * Calculate the Event-Level normalization.
623 *
624 * The full event level normalization for trigger @f$X@f$ is given by
625 * @f{eqnarray*}{
626 * N &=& \frac{1}{\epsilon_X}
627 * \left(N_A+\frac{N_A}{N_V}(N_{-V}-\beta)\right)\\
628 * &=& \frac{1}{\epsilon_X}N_A
629 * \left(1+\frac{1}{N_V}(N_T-N_V-\beta)\right)\\
630 * &=& \frac{1}{\epsilon_X}N_A
631 * \left(1+\frac{N_T}{N_V}-1-\frac{\beta}{N_V}\right)\\
632 * &=& \frac{1}{\epsilon_X}N_A
633 * \left(\frac{1}{\epsilon_V}-\frac{\beta}{N_V}\right)
634 * @f}
635 * where
636 *
637 * - @f$\epsilon_X=\frac{N_{T,X}}{N_X}@f$ is the trigger
638 * efficiency evaluated in simulation.
639 * - @f$\epsilon_V=\frac{N_V}{N_T}@f$ is the vertex efficiency
640 * evaluated from the data
641 * - @f$N_X@f$ is the Monte-Carlo truth number of events of type
642 * @f$X@f$.
643 * - @f$N_{T,X}@f$ is the Monte-Carlo truth number of events of type
644 * @f$X@f$ which was also triggered as such.
645 * - @f$N_T@f$ is the number of data events that where triggered
646 * as type @f$X@f$ and had a collision trigger (CINT1B)
647 * - @f$N_V@f$ is the number of data events that where triggered
648 * as type @f$X@f$, had a collision trigger (CINT1B), and had
649 * a vertex.
650 * - @f$N_{-V}@f$ is the number of data events that where triggered
651 * as type @f$X@f$, had a collision trigger (CINT1B), but no
652 * vertex.
653 * - @f$N_A@f$ is the number of data events that where triggered
654 * as type @f$X@f$, had a collision trigger (CINT1B), and had
655 * a vertex in the selected range.
656 * - @f$\beta=N_a+N_c-N_e@f$ is the number of control triggers that
657 * were also triggered as type @f$X@f$.
658 * - @f$N_a@f$ Number of beam-empty events also triggered as type
659 * @f$X@f$ events (CINT1-A or CINT1-AC).
660 * - @f$N_c@f$ Number of empty-beam events also triggered as type
661 * @f$X@f$ events (CINT1-C).
662 * - @f$N_e@f$ Number of empty-empty events also triggered as type
663 * @f$X@f$ events (CINT1-E).
664 *
665 * Note, that if @f$ \beta \ll N_A@f$ the last term can be ignored, and
666 * the expression simplyfies to
667 * @f[
668 * N = \frac{1}{\epsilon_X}\frac{1}{\epsilon_V}N_A
669 * @f]
670 *
671 * @param t Histogram of triggers
672 * @param scheme Normalisation scheme
673 * @param trgEff Trigger efficiency
674 * @param ntotal On return, the total number of events to normalise to.
1a7e2e15 675 * @param text If non-null, fill with normalization calculation
b30dee70 676 *
677 * @return @f$N_A/N@f$ or negative number in case of errors.
678 */
679 virtual Double_t Normalization(const TH1I& t,
680 UShort_t scheme,
681 Double_t trgEff,
1a7e2e15 682 Double_t& ntotal,
683 TString* text) const;
c25b5e1b 684 /**
685 * Generate the dN/deta result from input
686 *
687 * @param sum Sum of 2D hists
688 * @param postfix Post fix on names
689 * @param rootProj Whether to use ROOT TH2::ProjectionX
690 * @param corrEmpty Correct for empty bins
691 * @param shapeCorr Shape correction to use
692 * @param scaler Event-level normalization scaler
693 * @param symmetrice Whether to make symmetric extensions
694 * @param rebin Whether to rebin
695 * @param cutEdges Whether to cut edges when rebinning
9f773c15 696 * @param marker Marker style
c6115ede 697 * @param color Color of markers
698 * @param mclist List of MC data
699 * @param truthlist List of MC truth data
c25b5e1b 700 */
701 virtual void MakeResult(const TH2D* sum,
702 const char* postfix,
703 bool rootProj,
704 bool corrEmpty,
f67d699c 705 const TH2F* shapeCorr,
c25b5e1b 706 Double_t scaler,
707 bool symmetrice,
708 Int_t rebin,
709 bool cutEdges,
9ecab72f 710 Int_t marker,
c89b9ac1 711 Int_t color,
712 TList* mclist,
713 TList* truthlist);
e1f47419 714 /**
715 * End of processing
716 *
717 * @param sums List of sums
718 * @param results Output list of results
ffca499d 719 * @param scheme Normalisation scheme options
e1f47419 720 * @param shapeCorr Shape correction or nil
721 * @param trigEff Trigger efficiency
66cf95f2 722 * @param trigEff0 0-bin trigger efficiency
e1f47419 723 * @param symmetrice Whether to symmetrice the results
724 * @param rebin Whether to rebin the results
c25b5e1b 725 * @param rootProj If true, use TH2::ProjectionX
e1f47419 726 * @param corrEmpty Whether to correct for empty bins
727 * @param cutEdges Whether to cut edges when rebinning
e1f47419 728 * @param triggerMask Trigger mask
ffca499d 729 * @param marker Marker style
c6115ede 730 * @param color Color of markers
731 * @param mclist List of MC data
732 * @param truthlist List of MC truth data
e1f47419 733 */
734 virtual void End(TList* sums,
735 TList* results,
ffca499d 736 UShort_t scheme,
f67d699c 737 const TH2F* shapeCorr,
e1f47419 738 Double_t trigEff,
66cf95f2 739 Double_t trigEff0,
e1f47419 740 Bool_t symmetrice,
741 Int_t rebin,
c25b5e1b 742 Bool_t rootProj,
e1f47419 743 Bool_t corrEmpty,
744 Bool_t cutEdges,
ffca499d 745 Int_t triggerMask,
9ecab72f 746 Int_t marker,
c89b9ac1 747 Int_t color,
748 TList* mclist,
749 TList* truthlist);
e1f47419 750 /**
751 * @{
752 * @name Access histograms
753 */
754 /**
755 * Get sum histogram
756 *
757 * @param mc If true, return MC histogram
758 *
759 * @return Sum histogram
760 */
4fa8d795 761 const Sum* GetSum(Bool_t mc=false) const { return mc ? fSumMC : fSum; }
e1f47419 762 /**
763 * Get sum histogram
764 *
765 * @param mc If true, return MC histogram
766 *
767 * @return Sum histogram
768 */
4fa8d795 769 Sum* GetSum(Bool_t mc=false) { return mc ? fSumMC : fSum; }
e1f47419 770 /**
771 * Get trigger histogram
772 *
773 * @return Trigger histogram
774 */
ffca499d 775 const TH1I* GetTriggers() const { return fTriggers; }
e1f47419 776 /**
777 * Get trigger histogram
778 *
779 * @return Trigger histogram
780 */
bfab35d9 781 TH1I* GetTriggers() { return fTriggers; }
782 /**
783 * Get trigger histogram
784 *
785 * @return Trigger histogram
786 */
787 const TH1I* GetStatus() const { return fStatus; }
788 /**
789 * Get trigger histogram
790 *
791 * @return Trigger histogram
792 */
793 TH1I* GetStatus() { return fStatus; }
e1f47419 794 /** @} */
5bb5d1f6 795
9ecab72f 796 /**
797 * Get the color of the markers
798 *
290052e7 799 * @param fallback Fall-back color
800 *
801 * @return Color for this centrality bin
9ecab72f 802 */
803 Int_t GetColor(Int_t fallback=kRed+2) const;
804 /**
805 * Get list of results
806 *
290052e7 807 * @return List of results
9ecab72f 808 */
5bb5d1f6 809 TList* GetResults() const { return fOutput; }
9ecab72f 810 /**
c8b1a7db 811 * Get name of result histogram. Note, the returned pointer points
812 * to static memory and should be copied/used immediately.
9ecab72f 813 *
c8b1a7db 814 * @param rebin Whether to get rebinned result
815 * @param sym Whether to get symmetric extension
816 * @param postfix Possible postfix (e.g., "MC")
9ecab72f 817 *
818 * @return
819 */
5bb5d1f6 820 const char* GetResultName(Int_t rebin, Bool_t sym,
821 const char* postfix="") const;
9ecab72f 822 /**
823 * Get a result
824 *
c8b1a7db 825 * @param rebin Whether to get rebinned result
826 * @param sym Whether to get symmetric extension
827 * @param postfix Possible postfix (e.g., "MC")
828 * @param verbose If true, complain about missing histogram
9ecab72f 829 *
c8b1a7db 830 * @return Pointer to histogram or null
9ecab72f 831 */
c8b1a7db 832 TH1* GetResult(Int_t rebin,
833 Bool_t sym,
834 const char* postfix="",
835 Bool_t verbose=true) const;
290052e7 836 /**
837 * Set the debug level
838 *
839 * @param lvl Debug level
840 */
f53fb4f6 841 void SetDebugLevel(Int_t lvl);
bfab35d9 842 /**
843 * Set satellite vertex flag
844 *
845 * @param satVtx
846 */
847 void SetSatelliteVertices(Bool_t satVtx) { fSatelliteVertices = satVtx; }
e1f47419 848 protected:
290052e7 849 /**
850 * Read in sum hisotgram from list
851 *
852 * @param list List to read from
853 * @param mc True for MC input
854 *
855 * @return true if sum histogram is found
856 */
f67d699c 857 virtual Bool_t ReadSum(TList* list, bool mc=false);
e1f47419 858 /**
859 * Create sum histogram
860 *
861 * @param data Data histogram to clone
862 * @param mc (optional) MC histogram to clone
863 */
864 virtual void CreateSums(const TH2D* data, const TH2D* mc);
865 /**
866 * Check the trigger, vertex, and centrality
867 *
ffca499d 868 * @param forward Event input
869 * @param triggerMask The used trigger mask
870 * @param vzMin Least @f$ v_z@f$
871 * @param vzMax Largest @f$ v_z@f$
e1f47419 872 *
873 * @return true if the event is to be used
874 */
875 virtual Bool_t CheckEvent(const AliAODForwardMult* forward,
ffca499d 876 Int_t triggerMask,
877 Double_t vzMin,
878 Double_t vzMax);
e1f47419 879 TList* fSums; // Output list
880 TList* fOutput; // Output list
4fa8d795 881 Sum* fSum; // Sum histogram
882 Sum* fSumMC; // MC sum histogram
ffca499d 883 TH1I* fTriggers; // Trigger histogram
bfab35d9 884 TH1I* fStatus; // Trigger histogram
e1f47419 885 UShort_t fLow; // Lower limit (inclusive)
886 UShort_t fHigh; // Upper limit (exclusive)
c89b9ac1 887 Bool_t fDoFinalMCCorrection; //Do final MC correction
bfab35d9 888 Bool_t fSatelliteVertices; // Satellite vertex flag
f53fb4f6 889 Int_t fDebug; // Debug level
890
c8b1a7db 891 ClassDef(CentralityBin,4); // A centrality bin
e1f47419 892 };
ce85db45 893 Int_t fRebin; // Rebinning factor
894 Bool_t fCutEdges; // Whether to cut edges when rebinning
895 Bool_t fSymmetrice; // Whether to symmetrice data
896 Bool_t fCorrEmpty; // Correct for empty bins
c25b5e1b 897 Bool_t fUseROOTProj; // Whether to use ROOT's ProjectionX
e58000b7 898 Double_t fTriggerEff; // Trigger efficiency for selected trigger(s)
66cf95f2 899 Double_t fTriggerEff0; // Bin-0 Trigger efficiency for sel trigger(s)
f67d699c 900 TH2F* fShapeCorr; // Shape correction
e308a636 901 TObjArray* fListOfCentralities; // Centrality bins
ffca499d 902 UShort_t fNormalizationScheme; // Normalization scheme
c89b9ac1 903 TString fFinalMCCorrFile; //Filename for final MC corr
bfab35d9 904 Bool_t fSatelliteVertices; // satellite vertex flag
cd49c50b 905 TH2D* fglobalempiricalcorrection; // the ratio of PbPb analysis normal displace vertex
906 TH2D* fmeabsignalvscentr; //mean signal per event vs cent
c8b1a7db 907 ClassDef(AliBasedNdetaTask,14); // Determine charged particle density
ce85db45 908};
909
910#endif
911//
912// Local Variables:
913// mode: C++
914// End:
915//