1 #ifndef ALIMUONPADSTATUSMAKER_H
2 #define ALIMUONPADSTATUSMAKER_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
10 /// \class AliMUONPadStatusMaker
11 /// \brief Make a 2DStore of pad statuses, using different sources of information
13 // Author Laurent Aphecetche
19 # include "TVector2.h"
23 class AliMUONCalibrationData;
24 class AliMUONVCalibParam;
25 class AliMUONVTrackerData;
28 class AliMUONPadStatusMaker : public TObject
31 AliMUONPadStatusMaker(const AliMUONCalibrationData& calibData);
32 virtual ~AliMUONPadStatusMaker();
34 /** Get access to internal status store (for debug only, as it may not be complete,
35 depending on whether you've already called PadStatus for all possible de,manu
36 combinations or not...
38 AliMUONVStore* StatusStore() const { return fStatus; }
40 AliMUONVCalibParam* PadStatus(Int_t detElemId, Int_t manuId) const;
42 Int_t PadStatus(Int_t detElemId, Int_t manuId, Int_t manuChannel) const;
44 AliMUONVStore* NeighboursStore() const;
46 AliMUONVCalibParam* Neighbours(Int_t detElemId, Int_t manuId) const;
48 static TString AsString(Int_t status);
50 static TString AsCondition(Int_t status);
52 /// Return Low and High limits for a0 parameter of gain (linear slope)
53 TVector2 GainA1Limits() const { return fGainA1Limits; }
54 /// Return Low and High limits for a1 parameter of gain (parabolic term)
55 TVector2 GainA2Limits() const { return fGainA2Limits; }
56 /// Return Low and High limits for thres parameter of gain
57 TVector2 GainThresLimits() const { return fGainThresLimits; }
59 /// Return Low and High threshold for St12 HV
60 TVector2 HVSt12Limits() const { return fHVSt12Limits; }
61 /// Return Low and High threshold for St345 HV
62 TVector2 HVSt345Limits() const { return fHVSt345Limits; }
64 /// Return Low and High threshold for pedestal mean
65 TVector2 PedMeanLimits() const { return fPedMeanLimits; }
66 /// Return Low and High threshold for pedestal sigma
67 TVector2 PedSigmaLimits() const { return fPedSigmaLimits; }
69 /// Set Low and High limits for a0 parameter of gain (linear slope)
70 void GainA1Limits(float low, float high) { fGainA1Limits.Set(low,high); }
71 /// Set Low and High limits for a1 parameter of gain (parabolic term)
72 void GainA2Limits(float low, float high) { fGainA2Limits.Set(low,high); }
73 /// Set Low and High limits for thres parameter of gain
74 void GainThresLimits(float low, float high) { fGainThresLimits.Set(low,high); }
76 /// Set Low and High threshold for St12 HV
77 void SetHVSt12Limits(float low, float high) { fHVSt12Limits.Set(low,high); }
78 /// Set Low and High threshold for St345 HV
79 void SetHVSt345Limits(float low, float high) { fHVSt345Limits.Set(low,high); }
81 /// Set Low and High threshold for pedestal mean
82 void SetPedMeanLimits(float low, float high) { fPedMeanLimits.Set(low,high); }
83 /// Set Low and High threshold for pedestal sigma
84 void SetPedSigmaLimits(float low, float high) { fPedSigmaLimits.Set(low,high); }
86 /// Set Low and High threshold for gain a0 term
87 void SetGainA1Limits(float low, float high) { fGainA1Limits.Set(low,high); }
88 /// Set Low and High threshold for gain a1 term
89 void SetGainA2Limits(float low, float high) { fGainA2Limits.Set(low,high); }
90 /// Set Low and High threshold for gain threshold term
91 void SetGainThresLimits(float low, float high) { fGainThresLimits.Set(low,high); }
93 /// Set Low and High manu occupancy limits
94 void SetManuOccupancyLimits(float low, float high) { fManuOccupancyLimits.Set(low,high); }
95 /// Get manu occupancy limits
96 TVector2 ManuOccupancyLimits() const { return fManuOccupancyLimits; }
100 AliMUONPadStatusMaker(const AliMUONPadStatusMaker&);
102 AliMUONPadStatusMaker& operator=(const AliMUONPadStatusMaker&);
104 static void DecodeStatus(Int_t status, Int_t& pedStatus, Int_t& hvStatus,
105 Int_t& gainStatus, Int_t& otherStatus);
106 static Int_t BuildStatus(Int_t pedStatus, Int_t hvStatus,
107 Int_t gainStatus, Int_t otherStatus);
109 AliMUONVCalibParam* ComputeStatus(Int_t detElemId, Int_t manuId) const;
111 Bool_t HVSt12Status(Int_t detElemId, Int_t sector,
112 Bool_t& hvChannelTooLow,
113 Bool_t& hvChannelTooHigh,
114 Bool_t& hvChannelON) const;
117 Bool_t HVSt345Status(Int_t detElemId, Int_t pcbIndex,
118 Bool_t& hvChannelTooLow,
119 Bool_t& hvChannelTooHigh,
121 Bool_t& hvSwitchON) const;
123 Int_t HVStatus(Int_t detElemId, Int_t manuId) const;
125 Int_t OtherStatus(Int_t detElemId, Int_t manuId) const;
127 void SetHVStatus(Int_t detElemId, Int_t index, Int_t status) const;
140 kGainA1TooLow = (1<<1),
141 kGainA1TooHigh = (1<<2),
142 kGainA2TooLow = (1<<3),
143 kGainA2TooHigh = (1<<4),
144 kGainThresTooLow = (1<<5),
145 kGainThresTooHigh = (1<<6),
147 kGainMissing = kMissing // please always use last bit for meaning "missing"
154 kPedMeanZero = (1<<1),
155 kPedMeanTooLow = (1<<2),
156 kPedMeanTooHigh = (1<<3),
157 kPedSigmaTooLow = (1<<4),
158 kPedSigmaTooHigh = (1<<5),
160 kPedMissing = kMissing // please always use last bit for meaning "missing"
170 kHVChannelOFF = (1<<3),
171 kHVSwitchOFF = (1<<4),
173 kHVMissing = kMissing // please always use last bit for meaning "missing"
179 kManuOccupancyTooLow = (1<<1),
180 kManuOccupancyTooHigh = (1<<2)
183 const AliMUONCalibrationData& fCalibrationData; //!< helper class to get data access (not owner)
185 TVector2 fGainA1Limits; //!< Low and High threshold for gain a0 parameter
186 TVector2 fGainA2Limits; //!< Low and High threshold for gain a1 parameter
187 TVector2 fGainThresLimits; //!< Low and High threshold for gain threshold parameter
189 TVector2 fHVSt12Limits; //!< Low and High threshold for St12 HV
190 TVector2 fHVSt345Limits; //!< Low and High threshold for St345 HV
192 TVector2 fPedMeanLimits; //!< Low and High threshold for pedestal mean
193 TVector2 fPedSigmaLimits; //!< Low and High threshold for pedestal sigma
195 TVector2 fManuOccupancyLimits; //!< Low and High manu occupancy limits
197 AliMUONVStore* fStatus; //!< statuses of the pads
199 mutable TExMap* fHV; //!< cache of hv statuses
201 AliMUONVStore* fPedestals; //!< pedestal values
202 AliMUONVStore* fGains; //!< gain values
204 AliMUONVTrackerData* fTrackerData; //!< to get occupancies...
206 ClassDef(AliMUONPadStatusMaker,0) // Creates pad statuses from ped,gain,hv