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"
19 class AliFMDPedestalDA: public AliFMDBaseDA
30 * @param pedDA Object to copy from
32 AliFMDPedestalDA(const AliFMDPedestalDA & pedDA);
33 // AliFMDPedestalDA& operator = (const AliFMDPedestalDA & pedDA) ;
38 virtual ~AliFMDPedestalDA();
47 * Add a channel to the containers.
49 * @param sectorArray Array of sectors
55 void AddChannelContainer(TObjArray* sectorArray, UShort_t det,
56 Char_t ring, UShort_t sec, UShort_t strip);
58 * Fill ADC values from a digit into the corresponding histogram.
60 * @param digit Digit to fill ADC values for.
62 void FillChannels(AliFMDDigit* digit);
64 * Analyse a strip. That is, compute the mean and spread of the ADC
65 * spectra for all strips. Also output on files the values.
72 void Analyse(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip);
74 * Write headers to files.
77 void WriteHeaderToFile();
79 * Called at the end of an event.
84 * Called at the end of a job. Fills in missing time-bins and
88 void Terminate(TFile* );
91 * Get the histogram corresponding to a strip sample.
97 * @param sample Sample
99 * @return ADC spectra of a strip.
101 TH1S* GetChannel(UShort_t det, Char_t ring, UShort_t sec,
102 UShort_t strip, UInt_t sample);
104 * Calculate the hardware index
106 * @param ddl DDL number
107 * @param board Board number
108 * @param altro ALTRO number
109 * @param chan Channel number
111 * @return Index into hardware cache.
113 Int_t HWIndex(UShort_t ddl, UShort_t board, UShort_t altro,
114 UShort_t chan) const;
115 void FillinTimebins(std::ofstream& out, UShort_t ddl);
117 Int_t fCurrentChannel;
118 /** Pedestal summary */
122 /** Output file for zero-suppression for FMD1 */
123 std::ofstream fZSfileFMD1;
124 /** Output file for zero-suppression for FMD2 */
125 std::ofstream fZSfileFMD2;
126 /** Output file for zero-suppression for FMD3 */
127 std::ofstream fZSfileFMD3;
128 /** The minimum timebin seen for all channels */
130 /** The maximum timebin seen for all channels */
134 ClassDef(AliFMDPedestalDA,0)
138 AliFMDPedestalDA::HWIndex(UShort_t ddl, UShort_t b, UShort_t a, UShort_t c)const
140 // Save some array entries
141 UShort_t lb = (b > 1 ? b-16+2 : b);
142 const Int_t kNDDL = 3;
143 const Int_t kNBoard = 4;
144 const Int_t kNAltro = 3;
145 const Int_t kNChannel = 16;
146 Int_t idx = c + kNChannel * (a + kNAltro * (lb + kNBoard * ddl));
147 if (idx > kNDDL * kNBoard * kNAltro * kNChannel) return -1;