1 #ifndef ALIFMDPEDESTALDA_H
2 #define ALIFMDPEDESTALDA_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
7 * See cxx source for full Copyright notice
9 // This class implements the pedestal detector algorithm (DA) for the FMD.
10 // It uses 51200 TH1S histograms to store the data for each channel of the FMD.
11 // The mean and standard deviation of a histogram define the pedestal and
12 // the noise for that channel.
15 #include "AliFMDBaseDA.h"
17 #include "TObjArray.h"
20 class AliFMDPedestalDA: public AliFMDBaseDA
31 * @param pedDA Object to copy from
33 AliFMDPedestalDA(const AliFMDPedestalDA & pedDA);
37 * @param pedDA Object to assign from
39 AliFMDPedestalDA& operator=(const AliFMDPedestalDA&) { return *this; }
44 virtual ~AliFMDPedestalDA();
53 * Add a channel to the containers.
55 * @param sectorArray Array of sectors
61 void AddChannelContainer(TObjArray* sectorArray, UShort_t det,
62 Char_t ring, UShort_t sec, UShort_t strip);
64 * Fill ADC values from a digit into the corresponding histogram.
66 * @param digit Digit to fill ADC values for.
68 void FillChannels(AliFMDDigit* digit);
70 * Analyse a strip. That is, compute the mean and spread of the ADC
71 * spectra for all strips. Also output on files the values.
77 * @param h Summary histogram with bins for sector and strip
79 void Analyse(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip);
81 * Write headers to files.
84 void WriteHeaderToFile();
86 * Called at the end of an event.
91 * Called at the end of a job. Fills in missing time-bins and
95 void Terminate(TFile* );
98 * Get the histogram corresponding to a strip sample.
100 * @param det Detector
104 * @param sample Sample
106 * @return ADC spectra of a strip.
108 TH1S* GetChannel(UShort_t det, Char_t ring, UShort_t sec,
109 UShort_t strip, UInt_t sample);
111 * Calculate the hardware index
113 * @param ddl DDL number
114 * @param board Board number
115 * @param altro ALTRO number
116 * @param chan Channel number
118 * @return Index into hardware cache.
120 Int_t HWIndex(UShort_t ddl, UShort_t board, UShort_t altro,
121 UShort_t chan) const;
122 void FillinTimebins(std::ofstream& out, UShort_t ddl);
124 Int_t fCurrentChannel; //The current channel
125 /** Pedestal summary */
126 TH1F fPedSummary; //Summary of pedestals
128 TH1F fNoiseSummary; //Summary of noises
129 /** Output file for zero-suppression for FMD1 */
130 std::ofstream fZSfileFMD1; //Stream for ZS FMD1
131 /** Output file for zero-suppression for FMD2 */
132 std::ofstream fZSfileFMD2; //Stream for ZS FMD2
133 /** Output file for zero-suppression for FMD3 */
134 std::ofstream fZSfileFMD3; //Stream for ZS FMD3
135 /** The minimum timebin seen for all channels */
136 TArrayS fMinTimebin; //minimum timebin
137 /** The maximum timebin seen for all channels */
138 TArrayS fMaxTimebin; //maximum timebin
140 void MakeSummary(UShort_t det, Char_t ring);
142 TH2* fSummaryFMD1i; //Summary of FMD1
143 TH2* fSummaryFMD2i; //Summary of FMD2I
144 TH2* fSummaryFMD2o; //Summary of FMD2O
145 TH2* fSummaryFMD3i; //Summary of FMD3I
146 TH2* fSummaryFMD3o; //Summary of FMD3O
148 ClassDef(AliFMDPedestalDA,0)
152 AliFMDPedestalDA::HWIndex(UShort_t ddl, UShort_t b,
153 UShort_t a, UShort_t c) const
155 // Save some array entries
156 UShort_t lb = (b > 1 ? b-16+2 : b);
157 const Int_t kNDDL = 3;
158 const Int_t kNBoard = 4;
159 const Int_t kNAltro = 3;
160 const Int_t kNChannel = 16;
161 Int_t idx = c + kNChannel * (a + kNAltro * (lb + kNBoard * ddl));
162 if (idx > kNDDL * kNBoard * kNAltro * kNChannel) return -1;