]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONPadStatusMaker.h
Bug coreected in PTM gain array indexes
[u/mrichter/AliRoot.git] / MUON / AliMUONPadStatusMaker.h
CommitLineData
2c780493 1#ifndef ALIMUONPADSTATUSMAKER_H
2#define ALIMUONPADSTATUSMAKER_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5* See cxx source for full Copyright notice */
6
7// $Id$
8
1ed747b4 9/// \ingroup rec
2c780493 10/// \class AliMUONPadStatusMaker
11/// \brief Make a 2DStore of pad statuses, using different sources of information
12///
78649106 13// Author Laurent Aphecetche
2c780493 14
15#ifndef ROOT_TObject
16# include "TObject.h"
17#endif
18#ifndef ROOT_TVector2
19# include "TVector2.h"
20#endif
21
49e396d9 22class TExMap;
2c780493 23class AliMUONCalibrationData;
411a502a 24class AliMUONRecoParam;
49e396d9 25class AliMUONVCalibParam;
004a9ccd 26class AliMUONVTrackerData;
8d8e920c 27class AliMUONVStore;
2c780493 28
29class AliMUONPadStatusMaker : public TObject
30{
31public:
32 AliMUONPadStatusMaker(const AliMUONCalibrationData& calibData);
33 virtual ~AliMUONPadStatusMaker();
0045b488 34
35 /// Get the reference to the calibrationdata object we use.
36 const AliMUONCalibrationData& CalibrationData() const { return fkCalibrationData; }
37
49e396d9 38 /** Get access to internal status store (for debug only, as it may not be complete,
39 depending on whether you've already called PadStatus for all possible de,manu
40 combinations or not...
41 */
42 AliMUONVStore* StatusStore() const { return fStatus; }
2c780493 43
49e396d9 44 AliMUONVCalibParam* PadStatus(Int_t detElemId, Int_t manuId) const;
96199305 45
49e396d9 46 Int_t PadStatus(Int_t detElemId, Int_t manuId, Int_t manuChannel) const;
47
48 AliMUONVStore* NeighboursStore() const;
49
50 AliMUONVCalibParam* Neighbours(Int_t detElemId, Int_t manuId) const;
51
52 static TString AsString(Int_t status);
004a9ccd 53
54 static TString AsCondition(Int_t status);
55
49e396d9 56 /// Return Low and High limits for a0 parameter of gain (linear slope)
49e396d9 57 TVector2 GainA1Limits() const { return fGainA1Limits; }
004a9ccd 58 /// Return Low and High limits for a1 parameter of gain (parabolic term)
59 TVector2 GainA2Limits() const { return fGainA2Limits; }
49e396d9 60 /// Return Low and High limits for thres parameter of gain
61 TVector2 GainThresLimits() const { return fGainThresLimits; }
62
71a2d3aa 63 /// Return Low and High threshold for St12 HV
2c780493 64 TVector2 HVSt12Limits() const { return fHVSt12Limits; }
71a2d3aa 65 /// Return Low and High threshold for St345 HV
2c780493 66 TVector2 HVSt345Limits() const { return fHVSt345Limits; }
67
71a2d3aa 68 /// Return Low and High threshold for pedestal mean
2c780493 69 TVector2 PedMeanLimits() const { return fPedMeanLimits; }
71a2d3aa 70 /// Return Low and High threshold for pedestal sigma
2c780493 71 TVector2 PedSigmaLimits() const { return fPedSigmaLimits; }
72
49e396d9 73 /// Set Low and High limits for a0 parameter of gain (linear slope)
49e396d9 74 void GainA1Limits(float low, float high) { fGainA1Limits.Set(low,high); }
004a9ccd 75 /// Set Low and High limits for a1 parameter of gain (parabolic term)
76 void GainA2Limits(float low, float high) { fGainA2Limits.Set(low,high); }
49e396d9 77 /// Set Low and High limits for thres parameter of gain
78 void GainThresLimits(float low, float high) { fGainThresLimits.Set(low,high); }
79
71a2d3aa 80 /// Set Low and High threshold for St12 HV
2c780493 81 void SetHVSt12Limits(float low, float high) { fHVSt12Limits.Set(low,high); }
71a2d3aa 82 /// Set Low and High threshold for St345 HV
2c780493 83 void SetHVSt345Limits(float low, float high) { fHVSt345Limits.Set(low,high); }
84
71a2d3aa 85 /// Set Low and High threshold for pedestal mean
2c780493 86 void SetPedMeanLimits(float low, float high) { fPedMeanLimits.Set(low,high); }
71a2d3aa 87 /// Set Low and High threshold for pedestal sigma
2c780493 88 void SetPedSigmaLimits(float low, float high) { fPedSigmaLimits.Set(low,high); }
89
004a9ccd 90 /// Set Low and High threshold for gain a0 term
91 void SetGainA1Limits(float low, float high) { fGainA1Limits.Set(low,high); }
92 /// Set Low and High threshold for gain a1 term
93 void SetGainA2Limits(float low, float high) { fGainA2Limits.Set(low,high); }
94 /// Set Low and High threshold for gain threshold term
95 void SetGainThresLimits(float low, float high) { fGainThresLimits.Set(low,high); }
96
97 /// Set Low and High manu occupancy limits
98 void SetManuOccupancyLimits(float low, float high) { fManuOccupancyLimits.Set(low,high); }
99 /// Get manu occupancy limits
100 TVector2 ManuOccupancyLimits() const { return fManuOccupancyLimits; }
411a502a 101
102 /// Set Low and High bus patch occupancy limits
103 void SetBuspatchOccupancyLimits(float low, float high) { fBuspatchOccupancyLimits.Set(low,high); }
104 /// Get bus patch occupancy limits
105 TVector2 BuspatchOccupancyLimits() const { return fBuspatchOccupancyLimits; }
106
107 /// Set Low and High DE occupancy limits
108 void SetDEOccupancyLimits(float low, float high) { fDEOccupancyLimits.Set(low,high); }
109 /// Get DE occupancy limits
110 TVector2 DEOccupancyLimits() const { return fDEOccupancyLimits; }
111
112 void SetLimits(const AliMUONRecoParam& recoParams);
113
114 void Report(UInt_t mask);
004a9ccd 115
2c780493 116private:
71a2d3aa 117 /// Not implemented
2c780493 118 AliMUONPadStatusMaker(const AliMUONPadStatusMaker&);
71a2d3aa 119 /// Not implemented
2c780493 120 AliMUONPadStatusMaker& operator=(const AliMUONPadStatusMaker&);
49e396d9 121
004a9ccd 122 static void DecodeStatus(Int_t status, Int_t& pedStatus, Int_t& hvStatus,
123 Int_t& gainStatus, Int_t& otherStatus);
124 static Int_t BuildStatus(Int_t pedStatus, Int_t hvStatus,
125 Int_t gainStatus, Int_t otherStatus);
2c780493 126
49e396d9 127 AliMUONVCalibParam* ComputeStatus(Int_t detElemId, Int_t manuId) const;
128
129 Bool_t HVSt12Status(Int_t detElemId, Int_t sector,
130 Bool_t& hvChannelTooLow,
131 Bool_t& hvChannelTooHigh,
132 Bool_t& hvChannelON) const;
2c780493 133
2c780493 134
49e396d9 135 Bool_t HVSt345Status(Int_t detElemId, Int_t pcbIndex,
136 Bool_t& hvChannelTooLow,
137 Bool_t& hvChannelTooHigh,
138 Bool_t& hvChannelON,
139 Bool_t& hvSwitchON) const;
2c780493 140
49e396d9 141 Int_t HVStatus(Int_t detElemId, Int_t manuId) const;
142
7eafe398 143 Int_t OccupancyStatus(Int_t detElemId, Int_t manuId) const;
004a9ccd 144
49e396d9 145 void SetHVStatus(Int_t detElemId, Int_t index, Int_t status) const;
2c780493 146
2c780493 147private:
71a2d3aa 148 /// General status
96199305 149 enum EGeneralStatus
150 {
151 kMissing = (1<<7)
152 };
49e396d9 153
154 /// Gain status
155 enum EGainStatus
156 {
157 kGainOK = 0,
004a9ccd 158 kGainA1TooLow = (1<<1),
159 kGainA1TooHigh = (1<<2),
160 kGainA2TooLow = (1<<3),
161 kGainA2TooHigh = (1<<4),
49e396d9 162 kGainThresTooLow = (1<<5),
163 kGainThresTooHigh = (1<<6),
164
165 kGainMissing = kMissing // please always use last bit for meaning "missing"
166 };
96199305 167
71a2d3aa 168 /// Pedestal status
2c780493 169 enum EPedestalStatus
170 {
171 kPedOK = 0,
172 kPedMeanZero = (1<<1),
173 kPedMeanTooLow = (1<<2),
174 kPedMeanTooHigh = (1<<3),
175 kPedSigmaTooLow = (1<<4),
96199305 176 kPedSigmaTooHigh = (1<<5),
177
178 kPedMissing = kMissing // please always use last bit for meaning "missing"
2c780493 179 };
180
71a2d3aa 181 /// HV Error
2c780493 182 enum EHVError
183 {
184 kHVOK = 0,
185 kHVError = (1<<0),
186 kHVTooLow = (1<<1),
187 kHVTooHigh = (1<<2),
188 kHVChannelOFF = (1<<3),
96199305 189 kHVSwitchOFF = (1<<4),
190
191 kHVMissing = kMissing // please always use last bit for meaning "missing"
2c780493 192 };
193
004a9ccd 194 /// Other
7eafe398 195 enum EOccupancyStatus
004a9ccd 196 {
197 kManuOccupancyTooLow = (1<<1),
2b8a1212 198 kManuOccupancyTooHigh = (1<<2),
7eafe398 199 kBusPatchOccupancyTooLow = (1<<3),
200 kBusPatchOccupancyTooHigh = (1<<4),
201 kDEOccupancyTooLow = (1<<5),
4eef97dc 202 kDEOccupancyTooHigh = (1<<6)
004a9ccd 203 };
204
72dae9ff 205 const AliMUONCalibrationData& fkCalibrationData; //!< helper class to get data access (not owner)
2c780493 206
004a9ccd 207 TVector2 fGainA1Limits; //!< Low and High threshold for gain a0 parameter
208 TVector2 fGainA2Limits; //!< Low and High threshold for gain a1 parameter
49e396d9 209 TVector2 fGainThresLimits; //!< Low and High threshold for gain threshold parameter
210
2c780493 211 TVector2 fHVSt12Limits; //!< Low and High threshold for St12 HV
212 TVector2 fHVSt345Limits; //!< Low and High threshold for St345 HV
49e396d9 213
214 TVector2 fPedMeanLimits; //!< Low and High threshold for pedestal mean
215 TVector2 fPedSigmaLimits; //!< Low and High threshold for pedestal sigma
004a9ccd 216
217 TVector2 fManuOccupancyLimits; //!< Low and High manu occupancy limits
411a502a 218 TVector2 fBuspatchOccupancyLimits; //!< Low and High buspatch occupancy limits
7eafe398 219 TVector2 fDEOccupancyLimits; //!< Low and High DE occupancy limits
004a9ccd 220
49e396d9 221 AliMUONVStore* fStatus; //!< statuses of the pads
222
223 mutable TExMap* fHV; //!< cache of hv statuses
224
225 AliMUONVStore* fPedestals; //!< pedestal values
226 AliMUONVStore* fGains; //!< gain values
2c780493 227
004a9ccd 228 AliMUONVTrackerData* fTrackerData; //!< to get occupancies...
229
2c780493 230 ClassDef(AliMUONPadStatusMaker,0) // Creates pad statuses from ped,gain,hv
231};
232
233#endif