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);
34 // AliFMDPedestalDA& operator = (const AliFMDPedestalDA & pedDA) ;
39 virtual ~AliFMDPedestalDA();
48 * Add a channel to the containers.
50 * @param sectorArray Array of sectors
56 void AddChannelContainer(TObjArray* sectorArray, UShort_t det,
57 Char_t ring, UShort_t sec, UShort_t strip);
59 * Fill ADC values from a digit into the corresponding histogram.
61 * @param digit Digit to fill ADC values for.
63 void FillChannels(AliFMDDigit* digit);
65 * Analyse a strip. That is, compute the mean and spread of the ADC
66 * spectra for all strips. Also output on files the values.
72 * @param h Summary histogram with bins for sector and strip
74 void Analyse(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip);
76 * Write headers to files.
79 void WriteHeaderToFile();
81 * Called at the end of an event.
86 * Called at the end of a job. Fills in missing time-bins and
90 void Terminate(TFile* );
93 * Get the histogram corresponding to a strip sample.
99 * @param sample Sample
101 * @return ADC spectra of a strip.
103 TH1S* GetChannel(UShort_t det, Char_t ring, UShort_t sec,
104 UShort_t strip, UInt_t sample);
106 * Calculate the hardware index
108 * @param ddl DDL number
109 * @param board Board number
110 * @param altro ALTRO number
111 * @param chan Channel number
113 * @return Index into hardware cache.
115 Int_t HWIndex(UShort_t ddl, UShort_t board, UShort_t altro,
116 UShort_t chan) const;
117 void FillinTimebins(std::ofstream& out, UShort_t ddl);
119 Int_t fCurrentChannel;
120 /** Pedestal summary */
124 /** Output file for zero-suppression for FMD1 */
125 std::ofstream fZSfileFMD1;
126 /** Output file for zero-suppression for FMD2 */
127 std::ofstream fZSfileFMD2;
128 /** Output file for zero-suppression for FMD3 */
129 std::ofstream fZSfileFMD3;
130 /** The minimum timebin seen for all channels */
132 /** The maximum timebin seen for all channels */
135 void MakeSummary(UShort_t det, Char_t ring);
143 ClassDef(AliFMDPedestalDA,0)
147 AliFMDPedestalDA::HWIndex(UShort_t ddl, UShort_t b, UShort_t a, UShort_t c)const
149 // Save some array entries
150 UShort_t lb = (b > 1 ? b-16+2 : b);
151 const Int_t kNDDL = 3;
152 const Int_t kNBoard = 4;
153 const Int_t kNAltro = 3;
154 const Int_t kNChannel = 16;
155 Int_t idx = c + kNChannel * (a + kNAltro * (lb + kNBoard * ddl));
156 if (idx > kNDDL * kNBoard * kNAltro * kNChannel) return -1;