Overlaps corrected, new shape of sectors
[u/mrichter/AliRoot.git] / FMD / FMDutil / AliFMDGainDA.h
CommitLineData
18216140 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"
6cf6e7a0 14#include "TH1F.h"
18216140 15#include "TObjArray.h"
6cf6e7a0 16// #include "TGraphErrors.h"
17class TGraphErrors;
18class TH1S;
18216140 19
6cf6e7a0 20class AliFMDGainDA: public AliFMDBaseDA
21{
22public:
3490bd31 23 typedef AliFMDBaseDA::Array Array;
6cf6e7a0 24 /**
25 * Constructor
26 *
27 */
18216140 28 AliFMDGainDA() ;
6cf6e7a0 29 /**
30 * Copy constructor
31 *
32 * @param gainDA Object to copy from
33 */
18216140 34 AliFMDGainDA(const AliFMDGainDA & gainDA) ;
6cf6e7a0 35 /**
8e23c82d 36 * Assignment operator
37 *
38 * @param gainDA Object to assign from
39 */
40 AliFMDGainDA& operator=(const AliFMDGainDA&) { return *this; }
41 /**
6cf6e7a0 42 * Destructor
43 *
44 */
18216140 45 virtual ~AliFMDGainDA();
32d43296 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);
6cf6e7a0 67 /**
68 * Initialize
69 *
70 */
18216140 71 void Init();
6cf6e7a0 72 /**
73 * Set the maximum pulse size
74 *
75 * @param highPulse Maximum pulse size
76 */
18216140 77 void SetMaxPulse(Int_t highPulse = 256) {fHighPulse = highPulse; }
6cf6e7a0 78 /**
79 * Set the number of strips per input channel
80 *
81 * @param nStrips Number of strips per channel
82 */
18216140 83 void SetNumberOfStrips(Int_t nStrips) {fNumberOfStripsPerChip = nStrips;}
84
6cf6e7a0 85protected:
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 */
3490bd31 95 void AddChannelContainer(Array* sectorArray,
6cf6e7a0 96 UShort_t det, Char_t ring,
97 UShort_t sec, UShort_t strip);
98 /**
a31ea3ce 99 * Add summary(s) for sectors
100 *
101 * @param secArray
102 * @param det
103 * @param ring
104 * @param sector
105 * @param nStrip
106 */
3490bd31 107 virtual void AddSectorSummary(Array* secArray, UShort_t det,
a31ea3ce 108 Char_t ring, UShort_t sector,
109 UShort_t nStrip);
110 /**
6cf6e7a0 111 * Fill channel histogram
112 *
113 * @param digit Digit to fill from
114 */
18216140 115 void FillChannels(AliFMDDigit* digit);
6cf6e7a0 116 /**
117 * Analyse the result
118 *
2a082c96 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
6cf6e7a0 124 */
18216140 125 void Analyse(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip);
6cf6e7a0 126 /**
127 * Write out the header
128 */
18216140 129 void WriteHeaderToFile();
6cf6e7a0 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 */
18216140 146 void ResetPulseAndUpdateChannel();
6cf6e7a0 147 /**
148 * End of event
149 *
150 */
18216140 151 void FinishEvent();
6cf6e7a0 152 /**
153 * End of job
154 *
155 * @param dummy Not used
156 */
157 void Terminate(TFile* dummy);
a31ea3ce 158 /**
159 * Initialize container
160 *
161 * @param dir Directory to make containers in
162 */
163 virtual void InitContainer(TDirectory* dir);
2a082c96 164
6cf6e7a0 165private:
166 /**
167 * Get the channel histogram
168 *
169 * @param det Detector #
170 * @param ring Ring identifier
171 * @param sec Sector number
a31ea3ce 172 * @param va VA chip number
6cf6e7a0 173 *
174 * @return Histogram
175 */
176 TH1S* GetChannelHistogram(UShort_t det, Char_t ring, UShort_t sec,
a31ea3ce 177 UShort_t va);
6cf6e7a0 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);
a31ea3ce 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);
6cf6e7a0 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
18216140 206
6cf6e7a0 207 TH1F fSummaryGains; // Summary histogram
208 Int_t fCurrentSummaryStrip; // Current strip for summary
2a082c96 209
210 void MakeSummary(UShort_t det, Char_t ring);
211
8cc1cb63 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
3bae5d02 222
6cf6e7a0 223 ClassDef(AliFMDGainDA,0) // Detector algorithm for gain runs
18216140 224
225};
226#endif
6cf6e7a0 227// Local Variables:
228// mode: C++
229// End: