Refactoring of dN/deta task to common base class
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / AliForwarddNdetaTask.h
CommitLineData
b2e7f2d6 1//
2// Task to analyse the AOD for for dN/deta in the forward regions
3//
4#ifndef ALIFORWARDDNDETATASK_H
5#define ALIFORWARDDNDETATASK_H
6#include <AliAnalysisTaskSE.h>
ec82df5b 7//#include <AliAODForwardMult.h>
b2e7f2d6 8class TList;
9class TH2D;
10class TH1D;
11
12/**
13 * Task to determine the
14 */
15class AliForwarddNdetaTask : public AliAnalysisTaskSE
16{
17public:
18 /**
19 * Constructor
20 *
21 */
22 AliForwarddNdetaTask();
23 /**
24 * Constructor
25 *
26 * @param name Name of task
27 * @param maxVtx Set @f$v_z@f$ range
28 */
29 AliForwarddNdetaTask(const char* name);
30
31 void SetVertexRange(Double_t min, Double_t max) { fVtxMin=min; fVtxMax=max; }
32 void SetRebinning(Int_t rebin) { fRebin = rebin; }
33 void SetTriggerMask(UShort_t mask) { fTriggerMask = mask; }
34 void SetTriggerMask(const char* mask);
35 /**
36 * Destructor
37 *
38 */
39 virtual ~AliForwarddNdetaTask();
40 /**
41 * Initialise on master - does nothing
42 *
43 */
44 virtual void Init() {}
45 /**
46 * Create output objects.
47 *
48 * This is called once per slave process
49 */
50 virtual void UserCreateOutputObjects();
51 /**
52 * Process a single event
53 *
54 * @param option Not used
55 */
56 virtual void UserExec(Option_t* option);
57 /**
58 * Called at end of event processing..
59 *
60 * This is called once in the master
61 *
62 * @param option Not used
63 */
64 virtual void Terminate(Option_t* option);
65protected:
66 AliForwarddNdetaTask(const AliForwarddNdetaTask&);
67 AliForwarddNdetaTask& operator=(const AliForwarddNdetaTask&) { return *this; }
68 /**
69 * Clone a 2D histogram
70 *
71 * @param in Histogram to clone.
72 * @param name New name of clone.
73 *
74 * @return The clone
75 */
76 TH2D* CloneHist(TH2D* in, const char* name);
77 /**
78 * Make a copy of the input histogram and rebin that histogram
79 *
80 * @param h Histogram to rebin
81 *
82 * @return New (rebinned) histogram
83 */
84 TH1D* Rebin(const TH1D* h) const;
85 /**
86 * Set histogram graphical options, etc.
87 *
88 * @param h Histogram to modify
89 * @param colour Marker color
90 * @param marker Marker style
91 * @param title Title of histogram
92 * @param ytitle Title on y-axis.
93 */
94 void SetHistogramAttributes(TH1D* h, Int_t colour, Int_t marker, const char* title,
95 const char* ytitle="#frac{1}{N} #frac{dN_{ch}}{d#eta}");
96 /**
97 * Trigger histogram bins
98 */
99 enum {
100 kAll = 1,
101 kB = 2,
102 kA = 3,
103 kC = 4,
104 kE = 5,
105 kMB = 6,
106 kWithTrigger= 7,
107 kWithVertex = 8,
108 kAccepted = 9
109 };
110
111 TH2D* fSumForward; // Sum of histograms
112 TH2D* fSumForwardMC; // Sum of MC histograms (if any)
113 TH2D* fSumPrimary; // Sum of primary histograms
114 TH2D* fSumCentral; // Sum of central histograms
115 TH2D* fCentral; //! Cache of central histogram
116 TH2D* fPrimary; //! Cache of primary histogram
117
118 TList* fSums; // Container of sums
119 TList* fOutput; // Container of outputs
120
121 TH1D* fTriggers; // Histogram of triggers
122
123 Double_t fVtxMin; // Minimum v_z
124 Double_t fVtxMax; // Maximum v_z
125 Int_t fTriggerMask; // Trigger mask
126 Int_t fRebin; // Rebinning factor
127 Bool_t fCutEdges; // Whether to cut edges when rebinning
128 TNamed* fSNNString; //
129 TNamed* fSysString; //
130
131 ClassDef(AliForwarddNdetaTask,1); // Determine multiplicity in central area
132};
133
134#endif