]>
Commit | Line | Data |
---|---|---|
8449e3e0 | 1 | // |
2 | // Manager (singleton) of corrections | |
3 | // | |
4 | #ifndef ALICENTRALCORRECTIONMANAGER_H | |
5 | #define ALICENTRALCORRECTIONMANAGER_H | |
6 | /** | |
7 | * @file AliCentralCorrectionManager.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 | * | |
14 | * @ingroup pwglf_forward_aod | |
15 | */ | |
16 | #include "AliCorrectionManagerBase.h" | |
17 | #include <TString.h> | |
18 | class TBrowser; | |
19 | class AliCentralCorrAcceptance; | |
20 | class AliCentralCorrSecondaryMap; | |
21 | class TAxis; | |
22 | ||
23 | /** | |
24 | * Manager (singleton) of corrections | |
25 | * | |
26 | * Note, that this class has a custom streamer. That is to ensure | |
27 | * that the singleton pointer is correctly set on reading in an object | |
28 | * of this type. | |
29 | * | |
30 | * @ingroup pwglf_forward_corr | |
31 | * @ingroup pwglf_forward_aod | |
32 | */ | |
33 | class AliCentralCorrectionManager : public AliCorrectionManagerBase | |
34 | { | |
35 | private: | |
36 | /** | |
37 | * Enumeration of things that can be read in | |
38 | */ | |
39 | enum EId { | |
40 | kIdSecondaryMap = 0, | |
41 | kIdAcceptance | |
42 | }; | |
43 | public: | |
44 | /** | |
45 | * Enumeration of things that can be read in | |
46 | */ | |
47 | enum ECorrection { | |
48 | kSecondaryMap = 0x01, | |
49 | kAcceptance = 0x02, | |
50 | kDefault = (kSecondaryMap|kAcceptance), | |
51 | kAll = (kSecondaryMap|kAcceptance) | |
52 | }; | |
53 | /** | |
54 | * Default constructor. This is public for the sake of the ROOT I/O | |
55 | * system, but should never be used outside of that system - that | |
56 | * is, do not use this constructor | |
57 | */ | |
58 | AliCentralCorrectionManager(); | |
59 | /** | |
60 | * Access to the singleton object | |
61 | * | |
62 | * @return Reference to the singleton object | |
63 | */ | |
64 | static AliCentralCorrectionManager& Instance(); | |
65 | ||
66 | /** | |
67 | * Append the content of the file @a addition to the @a destination | |
68 | * file for this manager. This used TFileMerger::PartialMerge | |
69 | * | |
70 | * @param destination Filename of destination storage (in OADB_PATH) | |
71 | * @param addition Filename of addition. | |
72 | * | |
73 | * @return true on success | |
74 | */ | |
75 | virtual Bool_t Append(const TString& addition, | |
76 | const TString& destination="") const; | |
77 | ||
78 | /** | |
79 | * @return name of the object | |
80 | */ | |
81 | const Char_t* GetName() const { return "centralCorrections"; } | |
82 | /** | |
83 | * Set path to corrections | |
84 | * | |
85 | * @param d Path | |
86 | */ | |
87 | void SetSecondaryMapPath(const char* d) | |
88 | { | |
89 | SetCorrectionFile(kIdSecondaryMap, d); | |
90 | } | |
91 | /** | |
92 | * Set path to corrections | |
93 | * | |
94 | * @param d Path | |
95 | */ | |
96 | void SetAcceptancePath(const char* d) | |
97 | { | |
98 | SetCorrectionFile(kIdAcceptance, d); | |
99 | } | |
100 | /** | |
101 | * Read in corrections based on the parameters given | |
102 | * | |
c8b1a7db | 103 | * @param runNumber Run number |
8449e3e0 | 104 | * @param collisionSystem Collision system |
105 | * @param cmsNN Center of mass energy per nuclean pair [GeV] | |
106 | * @param field Magnetic field setting [kG] | |
107 | * @param mc Monte-carlo switch | |
108 | * @param what What to read in. | |
109 | * @param force Force (re-)reading of specified things | |
c8b1a7db | 110 | * @param satelliteCollisions For satellite collisions |
8449e3e0 | 111 | * |
112 | * @return | |
113 | */ | |
114 | Bool_t Init(ULong_t runNumber, | |
115 | UShort_t collisionSystem, | |
116 | UShort_t cmsNN, | |
117 | Short_t field, | |
118 | Bool_t mc=false, | |
119 | Bool_t satelliteCollisions=false, | |
120 | UInt_t what=kDefault, | |
121 | Bool_t force=false); | |
122 | /** | |
123 | * Read in correction based on passed parameters | |
124 | * | |
c8b1a7db | 125 | * @param runNumber Run number |
8449e3e0 | 126 | * @param collisionSystem Collision system string |
127 | * @param cmsNN Center of mass energy per nucleon pair [GeV] | |
128 | * @param field Magnetic field [kG] | |
129 | * @param mc Monte-carlo switch | |
130 | * @param what What to read in | |
131 | * @param force Force (re-)reading of specified things | |
c8b1a7db | 132 | * @param satelliteCollisions For satellite collisions |
8449e3e0 | 133 | * |
134 | * @return true on success | |
135 | */ | |
136 | Bool_t Init(ULong_t runNumber, | |
137 | const char* collisionSystem, | |
138 | Float_t cmsNN, | |
139 | Float_t field, | |
140 | Bool_t mc=false, | |
141 | Bool_t satelliteCollisions=false, | |
142 | UInt_t what=kStandard, | |
143 | Bool_t force=false); | |
144 | /** | |
145 | * Get the vertex axis | |
146 | * | |
147 | * @return The vertex axis or null | |
148 | */ | |
149 | const TAxis* GetVertexAxis() const; | |
c8b1a7db | 150 | /** |
151 | * Get the @f$\eta@f$ axis | |
152 | * | |
153 | * @return The @f$\eta@f$ axis or null | |
154 | */ | |
155 | const TAxis* GetEtaAxis() const { return 0; } | |
8449e3e0 | 156 | /** |
157 | * Get the secondary correction map | |
158 | * | |
159 | * @return Get the secondary correction map object or null | |
160 | */ | |
161 | const AliCentralCorrSecondaryMap* GetSecondaryMap() const; | |
162 | /** | |
163 | * Get the acceptance correction due to dead channels | |
164 | * | |
165 | * | |
166 | * @return Acceptance correction due to dead channels | |
167 | */ | |
168 | const AliCentralCorrAcceptance* GetAcceptance() const; | |
169 | private: | |
170 | /** | |
171 | * Non-default constructor - initializes corrections - used by | |
172 | * singleton access member function Instance | |
173 | * | |
174 | * @param notUsed Ignored | |
175 | */ | |
176 | AliCentralCorrectionManager(Bool_t notUsed); | |
177 | ||
178 | /** Static singleton instance */ | |
179 | static AliCentralCorrectionManager* fgInstance; // Skeleton | |
180 | ||
181 | /** | |
182 | * @{ | |
183 | * @name Object name | |
184 | */ | |
185 | static const Char_t* fgkSecondaryMapSkel; // Name of correction object | |
186 | static const Char_t* fgkAcceptanceSkel; // Name of correction object | |
187 | /* | |
188 | * @} | |
189 | */ | |
190 | ClassDef(AliCentralCorrectionManager,2) // Manager of corrections | |
191 | }; | |
192 | ||
193 | #endif | |
194 | // Local Variables: | |
195 | // mode: C++ | |
196 | // End: | |
197 |