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;
27 class AliMUONPadStatusMaker : public TObject
30 AliMUONPadStatusMaker(const AliMUONCalibrationData& calibData);
31 virtual ~AliMUONPadStatusMaker();
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...
37 AliMUONVStore* StatusStore() const { return fStatus; }
39 AliMUONVCalibParam* PadStatus(Int_t detElemId, Int_t manuId) const;
41 Int_t PadStatus(Int_t detElemId, Int_t manuId, Int_t manuChannel) const;
43 AliMUONVStore* NeighboursStore() const;
45 AliMUONVCalibParam* Neighbours(Int_t detElemId, Int_t manuId) const;
47 static TString AsString(Int_t status);
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; }
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; }
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; }
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); }
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); }
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); }
85 AliMUONPadStatusMaker(const AliMUONPadStatusMaker&);
87 AliMUONPadStatusMaker& operator=(const AliMUONPadStatusMaker&);
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);
92 AliMUONVCalibParam* ComputeStatus(Int_t detElemId, Int_t manuId) const;
94 Bool_t HVSt12Status(Int_t detElemId, Int_t sector,
95 Bool_t& hvChannelTooLow,
96 Bool_t& hvChannelTooHigh,
97 Bool_t& hvChannelON) const;
100 Bool_t HVSt345Status(Int_t detElemId, Int_t pcbIndex,
101 Bool_t& hvChannelTooLow,
102 Bool_t& hvChannelTooHigh,
104 Bool_t& hvSwitchON) const;
106 Int_t HVStatus(Int_t detElemId, Int_t manuId) const;
108 void SetHVStatus(Int_t detElemId, Int_t index, Int_t status) const;
121 kGainA0TooLow = (1<<1),
122 kGainA0TooHigh = (1<<2),
123 kGainA1TooLow = (1<<3),
124 kGainA1TooHigh = (1<<4),
125 kGainThresTooLow = (1<<5),
126 kGainThresTooHigh = (1<<6),
128 kGainMissing = kMissing // please always use last bit for meaning "missing"
135 kPedMeanZero = (1<<1),
136 kPedMeanTooLow = (1<<2),
137 kPedMeanTooHigh = (1<<3),
138 kPedSigmaTooLow = (1<<4),
139 kPedSigmaTooHigh = (1<<5),
141 kPedMissing = kMissing // please always use last bit for meaning "missing"
151 kHVChannelOFF = (1<<3),
152 kHVSwitchOFF = (1<<4),
154 kHVMissing = kMissing // please always use last bit for meaning "missing"
157 const AliMUONCalibrationData& fCalibrationData; //!< helper class to get data access (not owner)
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
163 TVector2 fHVSt12Limits; //!< Low and High threshold for St12 HV
164 TVector2 fHVSt345Limits; //!< Low and High threshold for St345 HV
166 TVector2 fPedMeanLimits; //!< Low and High threshold for pedestal mean
167 TVector2 fPedSigmaLimits; //!< Low and High threshold for pedestal sigma
169 AliMUONVStore* fStatus; //!< statuses of the pads
171 mutable TExMap* fHV; //!< cache of hv statuses
173 AliMUONVStore* fPedestals; //!< pedestal values
174 AliMUONVStore* fGains; //!< gain values
176 ClassDef(AliMUONPadStatusMaker,0) // Creates pad statuses from ped,gain,hv