]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/FORWARD/analysis2/AliForwardCorrectionManager.h
Merge branch 'workdir'
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AliForwardCorrectionManager.h
CommitLineData
7984e5f7 1//
2// Manager (singleton) of corrections
3//
4#ifndef ALIFORWARDCORRECTIONMANAGER_H
5#define ALIFORWARDCORRECTIONMANAGER_H
ffca499d 6/**
7 * @file AliForwardCorrectionManager.h
8 * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
9 * @date Wed Mar 23 14:04:27 2011
10 *
11 * @brief
12 *
13 *
bd6f5206 14 * @ingroup pwglf_forward_aod
ffca499d 15 */
8449e3e0 16#include "AliCorrectionManagerBase.h"
0bd4b00f 17#include <TString.h>
19abe41d 18class TBrowser;
fb3430ac 19class AliFMDCorrELossFit;
fb3430ac 20class AliFMDCorrDoubleHit;
21class AliFMDCorrVertexBias;
22class AliFMDCorrMergingEfficiency;
23class AliFMDCorrAcceptance;
8449e3e0 24class AliFMDCorrSecondaryMap;
25class TAxis;
0bd4b00f 26
7c1a1f1d 27/**
28 * Manager (singleton) of corrections
19abe41d 29 *
30 * Note, that this class has a custom streamer. That is to ensure
31 * that the singleton pointer is correctly set on reading in an object
32 * of this type.
7c1a1f1d 33 *
bd6f5206 34 * @ingroup pwglf_forward_corr
35 * @ingroup pwglf_forward_aod
7c1a1f1d 36 */
8449e3e0 37class AliForwardCorrectionManager : public AliCorrectionManagerBase
0bd4b00f 38{
8449e3e0 39private:
40 /**
41 * Enumeration of things that can be read in
42 */
43 enum EId {
44 kIdSecondaryMap = 0,
45 kIdELossFits,
46 kIdVertexBias,
47 kIdMergingEfficiency,
48 kIdDoubleHit,
49 kIdAcceptance
50 };
0bd4b00f 51public:
52 /**
53 * Enumeration of things that can be read in
54 */
55 enum ECorrection {
56 kSecondaryMap = 0x01,
57 kELossFits = 0x02,
58 kVertexBias = 0x04,
59 kMergingEfficiency = 0x08,
60 kDoubleHit = 0x10,
72cc12cd 61 kAcceptance = 0x20,
8449e3e0 62 kDefault = (kSecondaryMap|kELossFits|kAcceptance),
0bd4b00f 63 kAll = (kSecondaryMap|
64 kELossFits|
65 kVertexBias|
66 kMergingEfficiency|
72cc12cd 67 kDoubleHit|
68 kAcceptance)
0bd4b00f 69 };
19abe41d 70 /**
71 * Default constructor. This is public for the sake of the ROOT I/O
72 * system, but should never be used outside of that system - that
73 * is, do not use this constructor
74 */
75 AliForwardCorrectionManager();
0bd4b00f 76 /**
77 * Access to the singleton object
78 *
79 * @return Reference to the singleton object
80 */
81 static AliForwardCorrectionManager& Instance();
8449e3e0 82
cc83fca2 83 /**
8449e3e0 84 * Append the content of the file @a addition to the @a destination
85 * file for this manager. This used TFileMerger::PartialMerge
86 *
87 * @param destination Filename of destination storage (in OADB_PATH)
88 * @param addition Filename of addition.
89 *
90 * @return true on success
cc83fca2 91 */
8449e3e0 92 virtual Bool_t Append(const TString& addition,
93 const TString& destination="") const;
94
fb3430ac 95 /**
8449e3e0 96 * @return name of object
fb3430ac 97 */
8449e3e0 98 const Char_t* GetName() const { return "forwardCorrections"; }
290052e7 99 /**
100 * Set path to corrections
101 *
102 * @param d Path
103 */
8449e3e0 104 void SetSecondaryMapPath(const char* d)
105 {
106 SetCorrectionFile(kIdSecondaryMap, d);
107 }
290052e7 108 /**
109 * Set path to corrections
110 *
111 * @param d Path
112 */
8449e3e0 113 void SetDoubleHitPath(const char* d)
114 {
115 SetCorrectionFile(kIdDoubleHit, d);
116 }
290052e7 117 /**
118 * Set path to corrections
119 *
120 * @param d Path
121 */
8449e3e0 122 void SetELossFitsPath(const char* d)
123 {
124 SetCorrectionFile(kIdELossFits, d);
125 }
290052e7 126 /**
127 * Set path to corrections
128 *
129 * @param d Path
130 */
8449e3e0 131 void SetVertexBiasPath(const char* d)
132 {
133 SetCorrectionFile(kIdVertexBias, d);
134 }
290052e7 135 /**
136 * Set path to corrections
137 *
138 * @param d Path
139 */
8449e3e0 140 void SetMergingEffPath(const char* d)
141 {
142 SetCorrectionFile(kIdMergingEfficiency, d);
143 }
290052e7 144 /**
145 * Set path to corrections
146 *
147 * @param d Path
148 */
8449e3e0 149 void SetAcceptancePath(const char* d)
150 {
151 SetCorrectionFile(kIdAcceptance, d);
152 }
0bd4b00f 153 /**
154 * Read in corrections based on the parameters given
155 *
c8b1a7db 156 * @param runNumber Run number
0bd4b00f 157 * @param collisionSystem Collision system
158 * @param cmsNN Center of mass energy per nuclean pair [GeV]
159 * @param field Magnetic field setting [kG]
7c1a1f1d 160 * @param mc Monte-carlo switch
0bd4b00f 161 * @param what What to read in.
162 * @param force Force (re-)reading of specified things
c8b1a7db 163 * @param satelliteCollisions For satellite collisions
0bd4b00f 164 *
165 * @return
166 */
8449e3e0 167 Bool_t Init(ULong_t runNumber,
168 UShort_t collisionSystem,
0bd4b00f 169 UShort_t cmsNN,
170 Short_t field,
171 Bool_t mc=false,
8449e3e0 172 Bool_t satelliteCollisions=false,
173 UInt_t what=kDefault,
0bd4b00f 174 Bool_t force=false);
7984e5f7 175 /**
176 * Read in correction based on passed parameters
177 *
c8b1a7db 178 * @param runNumber Run number
7984e5f7 179 * @param collisionSystem Collision system string
180 * @param cmsNN Center of mass energy per nucleon pair [GeV]
181 * @param field Magnetic field [kG]
182 * @param mc Monte-carlo switch
183 * @param what What to read in
184 * @param force Force (re-)reading of specified things
c8b1a7db 185 * @param satelliteCollisions For satellite collisions
7984e5f7 186 *
187 * @return true on success
188 */
8449e3e0 189 Bool_t Init(ULong_t runNumber,
190 const char* collisionSystem,
0bd4b00f 191 Float_t cmsNN,
192 Float_t field,
193 Bool_t mc=false,
8449e3e0 194 Bool_t satelliteCollisions=false,
195 UInt_t what=kDefault,
0bd4b00f 196 Bool_t force=false);
8449e3e0 197 /**
198 * Parse string with fields in it, and return the corresponding bit mask
199 *
200 * @param what The string
201 *
202 * @return The corresponding bit mask
203 */
204 static UInt_t ParseFields(const TString& what);
0bd4b00f 205 /**
206 * Get the eta axis
207 *
208 * @return Eta axis or null
209 */
210 const TAxis* GetEtaAxis() const;
211 /**
212 * Get the vertex axis
213 *
214 * @return The vertex axis or null
215 */
216 const TAxis* GetVertexAxis() const;
217 /**
218 * Get the energy loss fit correction object.
219 *
220 * @return Get the energy loss fits corrections object or null pointer
221 */
8449e3e0 222 const AliFMDCorrELossFit* GetELossFit() const;
223 /**
224 * Alias for GetELossFit
225 *
226 * @return Get the energy loss fits corrections object or null pointer
227 */
228 const AliFMDCorrELossFit* GetELossFits() const { return GetELossFits(); }
0bd4b00f 229 /**
230 * Get the secondary correction map
231 *
232 * @return Get the secondary correction map object or null
233 */
8449e3e0 234 const AliFMDCorrSecondaryMap* GetSecondaryMap() const;
0bd4b00f 235 /**
236 * Get the double hit correction object
237 *
238 * @return Get the double hit correction object or null
239 */
8449e3e0 240 const AliFMDCorrDoubleHit* GetDoubleHit() const;
0bd4b00f 241 /**
242 * Get the vertex bias correction object
243 *
244 * @return Get the vertex bias correction object or null
245 */
8449e3e0 246 const AliFMDCorrVertexBias* GetVertexBias() const;
72cc12cd 247 /**
248 * Get the merging efficiency
249 *
250 *
251 * @return Get the vertex efficiency correction
252 */
8449e3e0 253 const AliFMDCorrMergingEfficiency* GetMergingEfficiency() const;
72cc12cd 254 /**
255 * Get the acceptance correction due to dead channels
256 *
257 *
258 * @return Acceptance correction due to dead channels
259 */
8449e3e0 260 const AliFMDCorrAcceptance* GetAcceptance() const;
19abe41d 261private:
0bd4b00f 262 /**
8449e3e0 263 * Non-default constructor - initializes corrections - used by
264 * singleton access member function Instance
0bd4b00f 265 *
8449e3e0 266 * @param notUsed Ignored
0bd4b00f 267 */
8449e3e0 268 AliForwardCorrectionManager(Bool_t notUsed);
0bd4b00f 269
270 /** Static singleton instance */
fb3430ac 271 static AliForwardCorrectionManager* fgInstance; // Skeleton
8449e3e0 272
0bd4b00f 273 /**
274 * @{
275 * @name Object name
276 */
277 static const Char_t* fgkSecondaryMapSkel; // Name of correction object
278 static const Char_t* fgkDoubleHitSkel; // Name of correction object
279 static const Char_t* fgkELossFitsSkel; // Name of correction object
280 static const Char_t* fgkVertexBiasSkel; // Name of correction object
281 static const Char_t* fgkMergingEffSkel; // Name of correction object
72cc12cd 282 static const Char_t* fgkAcceptanceSkel; // Name of correction object
0bd4b00f 283 /*
284 * @}
285 */
8449e3e0 286 ClassDef(AliForwardCorrectionManager,4) // Manager of corrections
0bd4b00f 287};
0bd4b00f 288
289#endif
290// Local Variables:
291// mode: C++
292// End:
293