2 // Manager (singleton) of corrections
4 #ifndef ALIFORWARDCORRECTIONMANAGER_H
5 #define ALIFORWARDCORRECTIONMANAGER_H
7 * @file AliForwardCorrectionManager.h
8 * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
9 * @date Wed Mar 23 14:04:27 2011
14 * @ingroup pwglf_forward_aod
16 #include "AliCorrectionManagerBase.h"
19 class AliFMDCorrELossFit;
20 class AliFMDCorrDoubleHit;
21 class AliFMDCorrVertexBias;
22 class AliFMDCorrMergingEfficiency;
23 class AliFMDCorrAcceptance;
24 class AliFMDCorrSecondaryMap;
25 class AliFMDCorrNoiseGain;
29 * Manager (singleton) of corrections
31 * Note, that this class has a custom streamer. That is to ensure
32 * that the singleton pointer is correctly set on reading in an object
35 * @ingroup pwglf_forward_corr
36 * @ingroup pwglf_forward_aod
38 class AliForwardCorrectionManager : public AliCorrectionManagerBase
42 * Enumeration of things that can be read in
55 * Enumeration of things that can be read in
61 kMergingEfficiency = 0x08,
65 kDefault = (kSecondaryMap|kELossFits|kAcceptance),
66 kAll = (kSecondaryMap|
75 * Default constructor. This is public for the sake of the ROOT I/O
76 * system, but should never be used outside of that system - that
77 * is, do not use this constructor
79 AliForwardCorrectionManager();
81 * Access to the singleton object
83 * @return Reference to the singleton object
85 static AliForwardCorrectionManager& Instance();
88 * Append the content of the file @a addition to the @a destination
89 * file for this manager. This used TFileMerger::PartialMerge
91 * @param destination Filename of destination storage (in OADB_PATH)
92 * @param addition Filename of addition.
94 * @return true on success
96 virtual Bool_t Append(const TString& addition,
97 const TString& destination="") const;
100 * @return name of object
102 const Char_t* GetName() const { return "forwardCorrections"; }
104 * Set path to corrections
108 void SetSecondaryMapPath(const char* d)
110 SetCorrectionFile(kIdSecondaryMap, d);
113 * Set path to corrections
117 void SetDoubleHitPath(const char* d)
119 SetCorrectionFile(kIdDoubleHit, d);
122 * Set path to corrections
126 void SetELossFitsPath(const char* d)
128 SetCorrectionFile(kIdELossFits, d);
131 * Set path to corrections
135 void SetVertexBiasPath(const char* d)
137 SetCorrectionFile(kIdVertexBias, d);
140 * Set path to corrections
144 void SetMergingEffPath(const char* d)
146 SetCorrectionFile(kIdMergingEfficiency, d);
149 * Set path to corrections
153 void SetAcceptancePath(const char* d)
155 SetCorrectionFile(kIdAcceptance, d);
158 * Read in corrections based on the parameters given
160 * @param runNumber Run number
161 * @param collisionSystem Collision system
162 * @param cmsNN Center of mass energy per nuclean pair [GeV]
163 * @param field Magnetic field setting [kG]
164 * @param mc Monte-carlo switch
165 * @param what What to read in.
166 * @param force Force (re-)reading of specified things
167 * @param satelliteCollisions For satellite collisions
171 Bool_t Init(ULong_t runNumber,
172 UShort_t collisionSystem,
176 Bool_t satelliteCollisions=false,
177 UInt_t what=kDefault,
180 * Read in correction based on passed parameters
182 * @param runNumber Run number
183 * @param collisionSystem Collision system string
184 * @param cmsNN Center of mass energy per nucleon pair [GeV]
185 * @param field Magnetic field [kG]
186 * @param mc Monte-carlo switch
187 * @param what What to read in
188 * @param force Force (re-)reading of specified things
189 * @param satelliteCollisions For satellite collisions
191 * @return true on success
193 Bool_t Init(ULong_t runNumber,
194 const char* collisionSystem,
198 Bool_t satelliteCollisions=false,
199 UInt_t what=kDefault,
202 * Parse string with fields in it, and return the corresponding bit mask
204 * @param what The string
206 * @return The corresponding bit mask
208 static UInt_t ParseFields(const TString& what);
212 * @return Eta axis or null
214 const TAxis* GetEtaAxis() const;
216 * Get the vertex axis
218 * @return The vertex axis or null
220 const TAxis* GetVertexAxis() const;
222 * Get the energy loss fit correction object.
224 * @return Get the energy loss fits corrections object or null pointer
226 const AliFMDCorrELossFit* GetELossFit() const;
228 * Alias for GetELossFit
230 * @return Get the energy loss fits corrections object or null pointer
232 const AliFMDCorrELossFit* GetELossFits() const { return GetELossFit(); }
234 * Get the secondary correction map
236 * @return Get the secondary correction map object or null
238 const AliFMDCorrSecondaryMap* GetSecondaryMap() const;
240 * Get the double hit correction object
242 * @return Get the double hit correction object or null
244 const AliFMDCorrDoubleHit* GetDoubleHit() const;
246 * Get the vertex bias correction object
248 * @return Get the vertex bias correction object or null
250 const AliFMDCorrVertexBias* GetVertexBias() const;
252 * Get the merging efficiency
254 * @return Get the vertex efficiency correction
256 const AliFMDCorrMergingEfficiency* GetMergingEfficiency() const;
258 * Get the acceptance correction due to dead channels
260 * @return Acceptance correction due to dead channels
262 const AliFMDCorrAcceptance* GetAcceptance() const;
264 * Get the noise calibration. That is, the ratio
267 * \frac{\sigma_{i}}{g_{i}k}
270 * where @f$ k@f$ is a constant determined by the electronics of
271 * units DAC/MIP, and @f$ \sigma_i, g_i@f$ are the noise and gain of
272 * the @f$ i @f$ strip respectively
274 * @return Noise-gain calibration
276 const AliFMDCorrNoiseGain* GetNoiseGain() const;
279 * Non-default constructor - initializes corrections - used by
280 * singleton access member function Instance
282 * @param notUsed Ignored
284 AliForwardCorrectionManager(Bool_t notUsed);
286 /** Static singleton instance */
287 static AliForwardCorrectionManager* fgInstance; // Skeleton
293 static const Char_t* fgkSecondaryMapSkel; // Name of correction object
294 static const Char_t* fgkDoubleHitSkel; // Name of correction object
295 static const Char_t* fgkELossFitsSkel; // Name of correction object
296 static const Char_t* fgkVertexBiasSkel; // Name of correction object
297 static const Char_t* fgkMergingEffSkel; // Name of correction object
298 static const Char_t* fgkAcceptanceSkel; // Name of correction object
299 static const Char_t* fgkNoiseGainSkel; // Name of correction object
303 ClassDef(AliForwardCorrectionManager,5) // Manager of corrections