]>
Commit | Line | Data |
---|---|---|
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 | ||
9 | /// \ingroup rec | |
10 | /// \class AliMUONPadStatusMaker | |
11 | /// \brief Make a 2DStore of pad statuses, using different sources of information | |
12 | /// | |
13 | // Author Laurent Aphecetche | |
14 | ||
15 | #ifndef ROOT_TObject | |
16 | # include "TObject.h" | |
17 | #endif | |
18 | #ifndef ROOT_TVector2 | |
19 | # include "TVector2.h" | |
20 | #endif | |
21 | ||
22 | class TExMap; | |
23 | class AliMUONCalibrationData; | |
24 | class AliMUONVCalibParam; | |
25 | class AliMUONVStore; | |
26 | ||
27 | class AliMUONPadStatusMaker : public TObject | |
28 | { | |
29 | public: | |
30 | AliMUONPadStatusMaker(const AliMUONCalibrationData& calibData); | |
31 | virtual ~AliMUONPadStatusMaker(); | |
32 | ||
33 | /** Get access to internal status store (for debug only, as it may not be complete, | |
34 | depending on whether you've already called PadStatus for all possible de,manu | |
35 | combinations or not... | |
36 | */ | |
37 | AliMUONVStore* StatusStore() const { return fStatus; } | |
38 | ||
39 | AliMUONVCalibParam* PadStatus(Int_t detElemId, Int_t manuId) const; | |
40 | ||
41 | Int_t PadStatus(Int_t detElemId, Int_t manuId, Int_t manuChannel) const; | |
42 | ||
43 | AliMUONVStore* NeighboursStore() const; | |
44 | ||
45 | AliMUONVCalibParam* Neighbours(Int_t detElemId, Int_t manuId) const; | |
46 | ||
47 | static TString AsString(Int_t status); | |
48 | ||
49 | /// Return Low and High limits for a0 parameter of gain (linear slope) | |
50 | TVector2 GainA0Limits() const { return fGainA0Limits; } | |
51 | /// Return Low and High limits for a1 parameter of gain (parabolic term) | |
52 | TVector2 GainA1Limits() const { return fGainA1Limits; } | |
53 | /// Return Low and High limits for thres parameter of gain | |
54 | TVector2 GainThresLimits() const { return fGainThresLimits; } | |
55 | ||
56 | /// Return Low and High threshold for St12 HV | |
57 | TVector2 HVSt12Limits() const { return fHVSt12Limits; } | |
58 | /// Return Low and High threshold for St345 HV | |
59 | TVector2 HVSt345Limits() const { return fHVSt345Limits; } | |
60 | ||
61 | /// Return Low and High threshold for pedestal mean | |
62 | TVector2 PedMeanLimits() const { return fPedMeanLimits; } | |
63 | /// Return Low and High threshold for pedestal sigma | |
64 | TVector2 PedSigmaLimits() const { return fPedSigmaLimits; } | |
65 | ||
66 | /// Set Low and High limits for a0 parameter of gain (linear slope) | |
67 | void GainA0Limits(float low, float high) { fGainA0Limits.Set(low,high); } | |
68 | /// Set Low and High limits for a1 parameter of gain (parabolic term) | |
69 | void GainA1Limits(float low, float high) { fGainA1Limits.Set(low,high); } | |
70 | /// Set Low and High limits for thres parameter of gain | |
71 | void GainThresLimits(float low, float high) { fGainThresLimits.Set(low,high); } | |
72 | ||
73 | /// Set Low and High threshold for St12 HV | |
74 | void SetHVSt12Limits(float low, float high) { fHVSt12Limits.Set(low,high); } | |
75 | /// Set Low and High threshold for St345 HV | |
76 | void SetHVSt345Limits(float low, float high) { fHVSt345Limits.Set(low,high); } | |
77 | ||
78 | /// Set Low and High threshold for pedestal mean | |
79 | void SetPedMeanLimits(float low, float high) { fPedMeanLimits.Set(low,high); } | |
80 | /// Set Low and High threshold for pedestal sigma | |
81 | void SetPedSigmaLimits(float low, float high) { fPedSigmaLimits.Set(low,high); } | |
82 | ||
83 | private: | |
84 | /// Not implemented | |
85 | AliMUONPadStatusMaker(const AliMUONPadStatusMaker&); | |
86 | /// Not implemented | |
87 | AliMUONPadStatusMaker& operator=(const AliMUONPadStatusMaker&); | |
88 | ||
89 | static void DecodeStatus(Int_t status, Int_t& pedStatus, Int_t& hvStatus, Int_t& gainStatus); | |
90 | static Int_t BuildStatus(Int_t pedStatus, Int_t hvStatus, Int_t gainStatus); | |
91 | ||
92 | AliMUONVCalibParam* ComputeStatus(Int_t detElemId, Int_t manuId) const; | |
93 | ||
94 | Bool_t HVSt12Status(Int_t detElemId, Int_t sector, | |
95 | Bool_t& hvChannelTooLow, | |
96 | Bool_t& hvChannelTooHigh, | |
97 | Bool_t& hvChannelON) const; | |
98 | ||
99 | ||
100 | Bool_t HVSt345Status(Int_t detElemId, Int_t pcbIndex, | |
101 | Bool_t& hvChannelTooLow, | |
102 | Bool_t& hvChannelTooHigh, | |
103 | Bool_t& hvChannelON, | |
104 | Bool_t& hvSwitchON) const; | |
105 | ||
106 | Int_t HVStatus(Int_t detElemId, Int_t manuId) const; | |
107 | ||
108 | void SetHVStatus(Int_t detElemId, Int_t index, Int_t status) const; | |
109 | ||
110 | private: | |
111 | /// General status | |
112 | enum EGeneralStatus | |
113 | { | |
114 | kMissing = (1<<7) | |
115 | }; | |
116 | ||
117 | /// Gain status | |
118 | enum EGainStatus | |
119 | { | |
120 | kGainOK = 0, | |
121 | kGainA0TooLow = (1<<1), | |
122 | kGainA0TooHigh = (1<<2), | |
123 | kGainA1TooLow = (1<<3), | |
124 | kGainA1TooHigh = (1<<4), | |
125 | kGainThresTooLow = (1<<5), | |
126 | kGainThresTooHigh = (1<<6), | |
127 | ||
128 | kGainMissing = kMissing // please always use last bit for meaning "missing" | |
129 | }; | |
130 | ||
131 | /// Pedestal status | |
132 | enum EPedestalStatus | |
133 | { | |
134 | kPedOK = 0, | |
135 | kPedMeanZero = (1<<1), | |
136 | kPedMeanTooLow = (1<<2), | |
137 | kPedMeanTooHigh = (1<<3), | |
138 | kPedSigmaTooLow = (1<<4), | |
139 | kPedSigmaTooHigh = (1<<5), | |
140 | ||
141 | kPedMissing = kMissing // please always use last bit for meaning "missing" | |
142 | }; | |
143 | ||
144 | /// HV Error | |
145 | enum EHVError | |
146 | { | |
147 | kHVOK = 0, | |
148 | kHVError = (1<<0), | |
149 | kHVTooLow = (1<<1), | |
150 | kHVTooHigh = (1<<2), | |
151 | kHVChannelOFF = (1<<3), | |
152 | kHVSwitchOFF = (1<<4), | |
153 | ||
154 | kHVMissing = kMissing // please always use last bit for meaning "missing" | |
155 | }; | |
156 | ||
157 | const AliMUONCalibrationData& fCalibrationData; //!< helper class to get data access (not owner) | |
158 | ||
159 | TVector2 fGainA0Limits; //!< Low and High threshold for gain a0 parameter | |
160 | TVector2 fGainA1Limits; //!< Low and High threshold for gain a1 parameter | |
161 | TVector2 fGainThresLimits; //!< Low and High threshold for gain threshold parameter | |
162 | ||
163 | TVector2 fHVSt12Limits; //!< Low and High threshold for St12 HV | |
164 | TVector2 fHVSt345Limits; //!< Low and High threshold for St345 HV | |
165 | ||
166 | TVector2 fPedMeanLimits; //!< Low and High threshold for pedestal mean | |
167 | TVector2 fPedSigmaLimits; //!< Low and High threshold for pedestal sigma | |
168 | ||
169 | AliMUONVStore* fStatus; //!< statuses of the pads | |
170 | ||
171 | mutable TExMap* fHV; //!< cache of hv statuses | |
172 | ||
173 | AliMUONVStore* fPedestals; //!< pedestal values | |
174 | AliMUONVStore* fGains; //!< gain values | |
175 | ||
176 | ClassDef(AliMUONPadStatusMaker,0) // Creates pad statuses from ped,gain,hv | |
177 | }; | |
178 | ||
179 | #endif |