]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/FORWARD/analysis2/AliCentralMultiplicityTask.h
Mega commit of many changes to PWGLFforward
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AliCentralMultiplicityTask.h
CommitLineData
6f791cc3 1//
2// Base class for classes that calculate the multiplicity in the
3// SPD clusters event-by-event
4//
5#ifndef ALICENTRALMULTIPLICITYTASK_H
6#define ALICENTRALMULTIPLICITYTASK_H
ffca499d 7/**
8 * @file AliCentralMultiplicityTask.h
9 * @author Hans Hjersing Dalsgaard
10 * @date Wed Mar 23 14:00:03 2011
11 *
12 * @brief
13 *
bd6f5206 14 * @ingroup pwglf_forward_aod
ffca499d 15 *
16 */
6f791cc3 17#include <AliAnalysisTaskSE.h>
52047b6f 18#include "AliFMDEventInspector.h"
6f791cc3 19#include "AliAODCentralMult.h"
8449e3e0 20class AliCentralCorrectionManager;
6f791cc3 21class AliESDEvent;
52047b6f 22class AliMultiplicity;
6f791cc3 23class TH2D;
24class TList;
25class TTree;
8449e3e0 26class TObjArray;
6f791cc3 27
6f791cc3 28/**
29 * Class that calculates the multiplicity in the
30 * central region event-by-event
31 *
32 * @par Inputs:
33 * - AliESDEvent
34 *
35 * @par Outputs:
36 * - AliAODCentralMult
37 *
38 * @par Histograms
39 *
40 * @par Corrections used
41 *
bd6f5206 42 * @ingroup pwglf_forward_tasks
43 * @ingroup pwglf_forward_aod
6f791cc3 44 *
45 */
46class AliCentralMultiplicityTask : public AliAnalysisTaskSE
47{
48public:
49 /**
50 * @{
51 * @name Interface methods
52 */
53 /**
54 * Constructor
55 *
56 * @param name Name of task
57 */
58 AliCentralMultiplicityTask(const char* name);
59 /**
9c825779 60 * Constructor
61 *
62 * Reserved for ROOT's I/O system - do not use
6f791cc3 63 */
9c825779 64 AliCentralMultiplicityTask();
6f791cc3 65 /**
66 * Copy constructor
67 *
68 * @param o Object to copy from
69 */
9c825779 70 AliCentralMultiplicityTask(const AliCentralMultiplicityTask& o);
6f791cc3 71 /**
72 * Assignment operator
73 *
74 * @param o Object to assign from
75 *
76 * @return Reference to this object
77 */
9c825779 78 AliCentralMultiplicityTask& operator=(const AliCentralMultiplicityTask& o);
2a276c75 79 /**
80 * Configure this task via a macro
81 *
82 * @param macro Macro to configure va
83 *
84 * @return true on success, false otherwise
85 */
86 virtual Bool_t Configure(const char* macro="CentralAODConfig.C");
6f791cc3 87 /**
88 * Create output objects
89 *
90 */
91 virtual void UserCreateOutputObjects();
92 /**
93 * Process each event
94 *
95 * @param option Not used
96 */
97 virtual void UserExec(Option_t* option);
98 /**
99 * End of job
100 *
101 * @param option Not used
102 */
103 virtual void Terminate(Option_t* option);
6f791cc3 104 /**
105 * Print information
106 *
107 * @param option Not used
108 */
109 virtual void Print(Option_t* option="") const;
3b2bfb07 110 /**
111 * Set whether to use the secondary corrections
112 *
113 * @param use Whether to use secondary corrections
114 */
115 virtual void SetUseSecondary(Bool_t use) { fUseSecondary = use; }
9453b19e 116 /**
117 * Set whether to use the acceptance corrections
118 *
119 * @param use Whether to use acceptance corrections
120 */
121 virtual void SetUseAcceptance(Bool_t use) { fUseAcceptance = use; }
8449e3e0 122 /**
123 * Set whether to make diagnostics or not
124 *
125 * @param use If true, store some extra diagnostic histograms
126 */
127 virtual void SetMakeDiagnostics(Bool_t use=true) { fStore = use; }
128 /**
129 * Get the event inspector
130 *
131 * @return Reference to used event inspector
132 */
52047b6f 133 AliFMDEventInspector& GetInspector() { return fInspector; }
8449e3e0 134 /**
135 * Get the event inspector
6f791cc3 136 *
8449e3e0 137 * @return Reference to used event inspector
6f791cc3 138 */
8449e3e0 139 const AliFMDEventInspector& GetInspector() const { return fInspector; }
6f791cc3 140
8449e3e0 141protected:
52047b6f 142 /**
143 * Get the ESD event and initialise manager on first event if not
144 * done already
145 *
146 * @return Pointer to valid ESD event object
147 */
148 virtual AliESDEvent* GetESDEvent();
149 /**
150 * Mark this event for storage in AOD output
151 *
152 */
153 virtual void MarkEventForStore() const;
154 /**
155 * Process the ESD SPD information
156 *
157 * @param hist Histogram to fill
158 * @param spdmult SPD multiplicity object
159 */
160 virtual void ProcessESD(TH2D& hist, const AliMultiplicity* spdmult) const;
161 /**
8449e3e0 162 * Find our eta limits
52047b6f 163 *
52047b6f 164 */
8449e3e0 165 virtual void FindEtaLimits();
166
167 struct VtxBin : public TObject
168 {
169 VtxBin(Int_t iVz=0, Double_t minIpZ=0, Double_t maxIpZ=0);
170 VtxBin(const VtxBin& o);
171 VtxBin& operator=(const VtxBin& o);
172
173 const char* GetName() const;
174 void SetupForData(TList* l, TH2* coverage, Bool_t store=true);
175 void Correct(TH2D& aodHist,
176 Bool_t useSecondary,
177 Bool_t useAcceptance,
178 Bool_t sum=true) const;
179 void Print(Option_t* option="") const;
180
181 Int_t fId; // Vertex bin number
182 Double_t fMinIpZ; // Least value of ipZ
183 Double_t fMaxIpZ; // Largest value of ipZ
184 Int_t fEtaMin; // Smallest eta bin to use
185 Int_t fEtaMax; // Largest eta bin to use
186 TH2* fSec; // Our secondary correction
187 TH1* fAcc; // Our acceptance correction
188 mutable TH2* fHits; // Diagnostics sum
3e478dba 189
8449e3e0 190 ClassDef(VtxBin,1);
191 };
192
6f791cc3 193protected:
28b4012a 194 AliFMDEventInspector fInspector; // Inspect events
8449e3e0 195 TList* fList; // Output list
28b4012a 196 AliAODCentralMult fAODCentral; // Output object
28b4012a 197 Bool_t fUseSecondary; // Whether to secondary map
198 Bool_t fUseAcceptance; // Whether to use acceptance corr.
199 Bool_t fFirstEventSeen; // Have we seen first event
200 Int_t fIvz; // Event's vertex bin
201 TH2D* fNClusterTracklet; // # of clusters vs tracklets
202 TH2D* fClusterPerTracklet; // Clusters per tracklet.
203 TH1D* fNCluster; //! Number of clusters
204 TH1D* fNTracklet; //! number of tracklets
8449e3e0 205 TObjArray* fVtxList; //! Array of vertex bins
206 Bool_t fStore; // Store diagnostics
207private:
208 AliCentralCorrectionManager* fCorrManager;
209 ClassDef(AliCentralMultiplicityTask,5) // Forward multiplicity class
6f791cc3 210};
211
212#endif
213// Local Variables:
214// mode: C++
215// End:
216