]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/AliFMDPedestalDA.h
Fixing violations and warnings motivated by FC
[u/mrichter/AliRoot.git] / FMD / AliFMDPedestalDA.h
CommitLineData
178c5972 1#ifndef ALIFMDPEDESTALDA_H
2#define ALIFMDPEDESTALDA_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
5 * reserved.
6 *
7 * See cxx source for full Copyright notice
8 */
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.
13
14
15#include "AliFMDBaseDA.h"
16#include "TH1.h"
17#include "TObjArray.h"
2a082c96 18class TH2;
178c5972 19
5cf05dbb 20class AliFMDPedestalDA: public AliFMDBaseDA
21{
22public:
23 /**
24 * Constructor.
25 *
26 */
27 AliFMDPedestalDA();
28 /**
29 * Copy constructor
30 *
31 * @param pedDA Object to copy from
32 */
33 AliFMDPedestalDA(const AliFMDPedestalDA & pedDA);
8e23c82d 34 /**
35 * Assignment operator
36 *
37 * @param pedDA Object to assign from
38 */
39 AliFMDPedestalDA& operator=(const AliFMDPedestalDA&) { return *this; }
40
72bc98e7 41 // AliFMDPedestalDA& operator = (const AliFMDPedestalDA & pedDA) ;
5cf05dbb 42 /**
43 * Destructor
44 *
45 */
178c5972 46 virtual ~AliFMDPedestalDA();
5cf05dbb 47 /**
48 * Initialiser
49 *
50 */
178c5972 51 void Init();
52
5cf05dbb 53protected:
54 /**
55 * Add a channel to the containers.
56 *
57 * @param sectorArray Array of sectors
58 * @param det Detector
59 * @param ring Ring
60 * @param sec Sector
61 * @param strip Strip
62 */
63 void AddChannelContainer(TObjArray* sectorArray, UShort_t det,
64 Char_t ring, UShort_t sec, UShort_t strip);
65 /**
66 * Fill ADC values from a digit into the corresponding histogram.
67 *
68 * @param digit Digit to fill ADC values for.
69 */
178c5972 70 void FillChannels(AliFMDDigit* digit);
5cf05dbb 71 /**
72 * Analyse a strip. That is, compute the mean and spread of the ADC
73 * spectra for all strips. Also output on files the values.
74 *
75 * @param det Detector
76 * @param ring Ring
77 * @param sec Sector
78 * @param strip Strip.
2a082c96 79 * @param h Summary histogram with bins for sector and strip
5cf05dbb 80 */
178c5972 81 void Analyse(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip);
5cf05dbb 82 /**
83 * Write headers to files.
84 *
85 */
178c5972 86 void WriteHeaderToFile();
5cf05dbb 87 /**
88 * Called at the end of an event.
89 *
90 */
178c5972 91 void FinishEvent() {}
5cf05dbb 92 /**
93 * Called at the end of a job. Fills in missing time-bins and
94 * closes output files
95 *
96 */
f7f0b643 97 void Terminate(TFile* );
5cf05dbb 98private:
99 /**
100 * Get the histogram corresponding to a strip sample.
101 *
102 * @param det Detector
103 * @param ring Ring
104 * @param sec Sector
105 * @param strip Strip
106 * @param sample Sample
107 *
108 * @return ADC spectra of a strip.
109 */
110 TH1S* GetChannel(UShort_t det, Char_t ring, UShort_t sec,
111 UShort_t strip, UInt_t sample);
112 /**
113 * Calculate the hardware index
114 *
115 * @param ddl DDL number
116 * @param board Board number
117 * @param altro ALTRO number
118 * @param chan Channel number
119 *
120 * @return Index into hardware cache.
121 */
122 Int_t HWIndex(UShort_t ddl, UShort_t board, UShort_t altro,
123 UShort_t chan) const;
124 void FillinTimebins(std::ofstream& out, UShort_t ddl);
125 /** Current strip */
8e23c82d 126 Int_t fCurrentChannel; //The current channel
127 /** Pedestal summary */
128 TH1F fPedSummary; //Summary of pedestals
5cf05dbb 129 /** Noise summary */
8e23c82d 130 TH1F fNoiseSummary; //Summary of noises
5cf05dbb 131 /** Output file for zero-suppression for FMD1 */
8e23c82d 132 std::ofstream fZSfileFMD1; //Stream for ZS FMD1
5cf05dbb 133 /** Output file for zero-suppression for FMD2 */
8e23c82d 134 std::ofstream fZSfileFMD2; //Stream for ZS FMD2
5cf05dbb 135 /** Output file for zero-suppression for FMD3 */
8e23c82d 136 std::ofstream fZSfileFMD3; //Stream for ZS FMD3
5cf05dbb 137 /** The minimum timebin seen for all channels */
8e23c82d 138 TArrayS fMinTimebin; //minimum timebin
5cf05dbb 139 /** The maximum timebin seen for all channels */
8e23c82d 140 TArrayS fMaxTimebin; //maximum timebin
5cf05dbb 141
2a082c96 142 void MakeSummary(UShort_t det, Char_t ring);
143
8e23c82d 144 TH2* fSummaryFMD1i; //Summary of FMD1
145 TH2* fSummaryFMD2i; //Summary of FMD2I
146 TH2* fSummaryFMD2o; //Summary of FMD2O
147 TH2* fSummaryFMD3i; //Summary of FMD3I
148 TH2* fSummaryFMD3o; //Summary of FMD3O
7bce699b 149
178c5972 150 ClassDef(AliFMDPedestalDA,0)
178c5972 151};
5cf05dbb 152
153inline Int_t
154AliFMDPedestalDA::HWIndex(UShort_t ddl, UShort_t b, UShort_t a, UShort_t c)const
155{
156 // Save some array entries
157 UShort_t lb = (b > 1 ? b-16+2 : b);
158 const Int_t kNDDL = 3;
159 const Int_t kNBoard = 4;
160 const Int_t kNAltro = 3;
161 const Int_t kNChannel = 16;
162 Int_t idx = c + kNChannel * (a + kNAltro * (lb + kNBoard * ddl));
163 if (idx > kNDDL * kNBoard * kNAltro * kNChannel) return -1;
164 return idx;
165}
166
178c5972 167#endif
5cf05dbb 168//
169// Local Variables:
170// mode: C++
171// End:
172//