]>
Commit | Line | Data |
---|---|---|
1 | #ifndef ALIFMDGAINDA_H | |
2 | #define ALIFMDGAINDA_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights | |
4 | * reserved. | |
5 | * | |
6 | * See cxx source for full Copyright notice | |
7 | */ | |
8 | // This class implements the Gain detector algorithm (DA) for the FMD. | |
9 | // The gain is the response of the VA chips to a known pulse and has to be | |
10 | // calculated strip-by-strip, pulse-by-pulse. | |
11 | ||
12 | ||
13 | #include "AliFMDBaseDA.h" | |
14 | #include "TH1F.h" | |
15 | #include "TObjArray.h" | |
16 | // #include "TGraphErrors.h" | |
17 | class TGraphErrors; | |
18 | class TH1S; | |
19 | ||
20 | class AliFMDGainDA: public AliFMDBaseDA | |
21 | { | |
22 | public: | |
23 | typedef AliFMDBaseDA::Array Array; | |
24 | /** | |
25 | * Constructor | |
26 | * | |
27 | */ | |
28 | AliFMDGainDA() ; | |
29 | /** | |
30 | * Copy constructor | |
31 | * | |
32 | * @param gainDA Object to copy from | |
33 | */ | |
34 | AliFMDGainDA(const AliFMDGainDA & gainDA) ; | |
35 | /** | |
36 | * Assignment operator | |
37 | * | |
38 | * @param gainDA Object to assign from | |
39 | */ | |
40 | AliFMDGainDA& operator=(const AliFMDGainDA&) { return *this; } | |
41 | /** | |
42 | * Destructor | |
43 | * | |
44 | */ | |
45 | virtual ~AliFMDGainDA(); | |
46 | /** | |
47 | * Open our output files | |
48 | * | |
49 | * The output files are named | |
50 | * | |
51 | * gains.csv | |
52 | * conditions.csv | |
53 | * | |
54 | * or | |
55 | * | |
56 | * gains_XXXXXXXXX.csv | |
57 | * conditions_XXXXXXXXX.csv | |
58 | * | |
59 | * in case the run number is to be appended | |
60 | * | |
61 | * @param appendRun if true, append run number (9 digits, zero | |
62 | * padded) to the output file name(s). | |
63 | * | |
64 | * @return true on success | |
65 | */ | |
66 | Bool_t OpenFiles(Bool_t appendRun=false); | |
67 | /** | |
68 | * Initialize | |
69 | * | |
70 | */ | |
71 | void Init(); | |
72 | /** | |
73 | * Set the maximum pulse size | |
74 | * | |
75 | * @param highPulse Maximum pulse size | |
76 | */ | |
77 | void SetMaxPulse(Int_t highPulse = 256) {fHighPulse = highPulse; } | |
78 | /** | |
79 | * Set the number of strips per input channel | |
80 | * | |
81 | * @param nStrips Number of strips per channel | |
82 | */ | |
83 | void SetNumberOfStrips(Int_t nStrips) {fNumberOfStripsPerChip = nStrips;} | |
84 | ||
85 | protected: | |
86 | /** | |
87 | * Make a container for a channel | |
88 | * | |
89 | * @param sectorArray Sectors | |
90 | * @param det Detector # | |
91 | * @param ring Ring identifier | |
92 | * @param sec Sector number | |
93 | * @param strip Strip number | |
94 | */ | |
95 | void AddChannelContainer(Array* sectorArray, | |
96 | UShort_t det, Char_t ring, | |
97 | UShort_t sec, UShort_t strip); | |
98 | /** | |
99 | * Add summary(s) for sectors | |
100 | * | |
101 | * @param secArray | |
102 | * @param det | |
103 | * @param ring | |
104 | * @param sector | |
105 | * @param nStrip | |
106 | */ | |
107 | virtual void AddSectorSummary(Array* secArray, UShort_t det, | |
108 | Char_t ring, UShort_t sector, | |
109 | UShort_t nStrip); | |
110 | /** | |
111 | * Fill channel histogram | |
112 | * | |
113 | * @param digit Digit to fill from | |
114 | */ | |
115 | void FillChannels(AliFMDDigit* digit); | |
116 | /** | |
117 | * Analyse the result | |
118 | * | |
119 | * @param det Detector # | |
120 | * @param ring Ring identifier | |
121 | * @param sec Sector number | |
122 | * @param strip Strip number | |
123 | * @param h Summary histogram with bins for sector and strip | |
124 | */ | |
125 | void Analyse(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip); | |
126 | /** | |
127 | * Write out the header | |
128 | */ | |
129 | void WriteHeaderToFile(); | |
130 | /** | |
131 | * Go to the next sample | |
132 | * | |
133 | * @param det Detector # | |
134 | * @param ring Ring identifier | |
135 | * @param sec Sector number | |
136 | * @param strip Strip number | |
137 | */ | |
138 | void UpdatePulseAndADC(UShort_t det, | |
139 | Char_t ring, | |
140 | UShort_t sec, | |
141 | UShort_t strip); | |
142 | /** | |
143 | * Reset all | |
144 | * | |
145 | */ | |
146 | void ResetPulseAndUpdateChannel(); | |
147 | /** | |
148 | * End of event | |
149 | * | |
150 | */ | |
151 | void FinishEvent(); | |
152 | /** | |
153 | * End of job | |
154 | * | |
155 | * @param dummy Not used | |
156 | */ | |
157 | void Terminate(TFile* dummy); | |
158 | /** | |
159 | * Initialize container | |
160 | * | |
161 | * @param dir Directory to make containers in | |
162 | */ | |
163 | virtual void InitContainer(TDirectory* dir); | |
164 | ||
165 | private: | |
166 | /** | |
167 | * Get the channel histogram | |
168 | * | |
169 | * @param det Detector # | |
170 | * @param ring Ring identifier | |
171 | * @param sec Sector number | |
172 | * @param va VA chip number | |
173 | * | |
174 | * @return Histogram | |
175 | */ | |
176 | TH1S* GetChannelHistogram(UShort_t det, Char_t ring, UShort_t sec, | |
177 | UShort_t va); | |
178 | /** | |
179 | * Get strip graph | |
180 | * | |
181 | * @param det Detector # | |
182 | * @param ring Ring identifier | |
183 | * @param sec Sector number | |
184 | * @param strip Strip number | |
185 | * | |
186 | * @return Graph | |
187 | */ | |
188 | TGraphErrors* GetChannel(UShort_t det, Char_t ring, | |
189 | UShort_t sec, UShort_t strip); | |
190 | /** | |
191 | * Get the summary for a sector | |
192 | * | |
193 | * @param det Detector | |
194 | * @param ring Ring | |
195 | * @param sec Sector | |
196 | * @param pedNotNoise Option | |
197 | * | |
198 | * @return histogram | |
199 | */ | |
200 | TH1F* GetSectorSummary(UShort_t det, Char_t ring, UShort_t sec); | |
201 | Int_t fHighPulse; // Highest pulse | |
202 | TArrayS fEventsPerChannel; // # of events per pulse step | |
203 | TArrayS fCurrentPulse; // The current pulse size | |
204 | TArrayS fCurrentChannel; // The current strip number | |
205 | Int_t fNumberOfStripsPerChip; // Number of strips | |
206 | ||
207 | TH1F fSummaryGains; // Summary histogram | |
208 | Int_t fCurrentSummaryStrip; // Current strip for summary | |
209 | ||
210 | void MakeSummary(UShort_t det, Char_t ring); | |
211 | ||
212 | TH2* fGainFMD1i; // AMORE DQM histogram | |
213 | TH2* fGainFMD2i; // AMORE DQM histogram | |
214 | TH2* fGainFMD2o; // AMORE DQM histogram | |
215 | TH2* fGainFMD3i; // AMORE DQM histogram | |
216 | TH2* fGainFMD3o; // AMORE DQM histogram | |
217 | TH2* fChi2FMD1i; // AMORE DQM histogram | |
218 | TH2* fChi2FMD2i; // AMORE DQM histogram | |
219 | TH2* fChi2FMD2o; // AMORE DQM histogram | |
220 | TH2* fChi2FMD3i; // AMORE DQM histogram | |
221 | TH2* fChi2FMD3o; // AMORE DQM histogram | |
222 | ||
223 | ClassDef(AliFMDGainDA,0) // Detector algorithm for gain runs | |
224 | ||
225 | }; | |
226 | #endif | |
227 | // Local Variables: | |
228 | // mode: C++ | |
229 | // End: |