CMS 3D CMS Logo

CSCConditions.h
Go to the documentation of this file.
1 #ifndef CSCCalibration_CSCConditions_h
2 #define CSCCalibration_CSCConditions_h
3 
12 
13 #include <bitset>
14 #include <vector>
15 
16 class CSCDBGains;
17 class CSCDBPedestals;
18 class CSCDBCrosstalk;
19 class CSCBadStrips;
20 class CSCBadWires;
21 class CSCBadChambers;
25 class CSCIndexerBase;
27 
49 public:
50  explicit CSCConditions(const edm::ParameterSet &ps);
52 
54  void initializeEvent(const edm::EventSetup &es);
55 
57  float gain(const CSCDetId &detId, int channel) const;
59  float gainSigma(const CSCDetId &detId, int channel) const { return 0.005; }
60 
62  float pedestal(const CSCDetId &detId, int channel) const;
64  float pedestalSigma(const CSCDetId &detId, int channel) const;
65 
67  float crosstalkSlope(const CSCDetId &detId, int channel, bool leftRight) const;
69  float crosstalkIntercept(const CSCDetId &detId, int channel, bool leftRight) const;
70 
72  const CSCDBNoiseMatrix::Item &noiseMatrix(const CSCDetId &detId, int channel) const;
73 
76  void noiseMatrixElements(const CSCDetId &id, int channel, std::vector<float> &me) const;
77 
80  void crossTalk(const CSCDetId &id, int channel, std::vector<float> &ct) const;
81 
83  float chipCorrection(const CSCDetId &detId, int channel) const;
84 
86  float chamberTimingCorrection(const CSCDetId &detId) const;
87 
89  float anodeBXoffset(const CSCDetId &detId) const;
90 
92  const std::bitset<112> &badStripWord() const { return badStripWord_; }
93 
95  const std::bitset<112> &badWireWord() const { return badWireWord_; }
96 
99 
100  void print() const;
101 
103  bool isInBadChamber(const CSCDetId &id) const;
104 
106  bool readBadChannels() const { return readBadChannels_; }
107 
109  bool readBadChambers() const { return readBadChambers_; }
110 
113 
116  void fillBadChannelWords(const CSCDetId &id);
117 
120  float averageGain() const;
121 
124  float gasGainCorrection(const CSCDetId &detId, int strip, int wire) const;
125 
128 
130  int channelFromStrip(const CSCDetId &id, int geomStrip) const;
131  int rawStripChannel(const CSCDetId &id, int geomChannel) const;
132 
133 private:
135  void fillBadStripWord(const CSCDetId &id);
136  void fillBadWireWord(const CSCDetId &id);
140 
141  // handles to conditions data
142 
153 
154  // handles to algorithm versions
155 
158 
159  // logical flags controlling some conditions data usage
160 
161  bool readBadChannels_; // flag whether or not to even attempt reading bad
162  // channel info from db
163  bool readBadChambers_; // flag whether or not to even attempt reading bad
164  // chamber info from db
165  bool useTimingCorrections_; // flag whether or not to even attempt reading
166  // timing correction info from db
167  bool useGasGainCorrections_; // flag whether or not to even attempt reading
168  // gas-gain correction info from db
169 
170  // Cache bad channel content for current CSC layer
172  std::bitset<112> badStripWord_;
173  std::bitset<112> badWireWord_;
174 
175  mutable float theAverageGain; // average over entire system, subject to some
176  // constraints!
177 
179  //@@ remove until we have real information to use
180  // edm::ESWatcher<CSCBadStripsRcd> badStripsWatcher_;
181  // edm::ESWatcher<CSCBadWiresRcd> badWiresWatcher_;
182 
183  // Total number of CSC layers in the system, with full ME42 installed.
184  enum elayers { MAX_LAYERS = 3240 };
185 };
186 
187 #endif
edm::ESHandle< CSCDBGasGainCorrection > theGasGainCorrections
edm::ESHandle< CSCDBNoiseMatrix > theNoiseMatrix
edm::ESHandle< CSCBadWires > theBadWires
float pedestalSigma(const CSCDetId &detId, int channel) const
static ped rms in ADC counts
void noiseMatrixElements(const CSCDetId &id, int channel, std::vector< float > &me) const
void fillBadChannelWords(const CSCDetId &id)
edm::ESHandle< CSCChamberTimeCorrections > theChamberTimingCorrections
float gainSigma(const CSCDetId &detId, int channel) const
overall calibration precision
Definition: CSCConditions.h:59
bool useTimingCorrections() const
did we request reading timing correction info from db?
const CSCDBNoiseMatrix::Item & noiseMatrix(const CSCDetId &detId, int channel) const
raw noise matrix (unscaled short int elements)
void print() const
edm::ESHandle< CSCBadStrips > theBadStrips
float chipCorrection(const CSCDetId &detId, int channel) const
chip speed correction in ns given detId (w/layer) and strip channel
float chamberTimingCorrection(const CSCDetId &detId) const
chamber timing correction in ns given detId of chamber
edm::ESHandle< CSCIndexerBase > indexer_
edm::ESWatcher< CSCDBGainsRcd > gainsWatcher_
void crossTalk(const CSCDetId &id, int channel, std::vector< float > &ct) const
float anodeBXoffset(const CSCDetId &detId) const
anode bx offset in bx given detId of chamber
void fillBadWireWord(const CSCDetId &id)
bool useTimingCorrections_
std::bitset< 112 > badWireWord_
float pedestal(const CSCDetId &detId, int channel) const
static ped in ADC counts
edm::ESHandle< CSCChannelMapperBase > mapper_
bool readBadChannels() const
did we request reading bad channel info from db?
bool useGasGainCorrections_
const std::bitset< 112 > & badWireWord() const
bad wiregroup channel word for a CSCLayer - 1 bit per channel
Definition: CSCConditions.h:95
int rawStripChannel(const CSCDetId &id, int geomChannel) const
edm::ESHandle< CSCBadChambers > theBadChambers
int channelFromStrip(const CSCDetId &id, int geomStrip) const
feedthrough for external access
edm::ESHandle< CSCDBGains > theGains
void initializeEvent(const edm::EventSetup &es)
fetch database content via EventSetup
void fillBadStripWord(const CSCDetId &id)
fill bad channel words for offline id
float crosstalkSlope(const CSCDetId &detId, int channel, bool leftRight) const
crosstalk slope for left and right
float crosstalkIntercept(const CSCDetId &detId, int channel, bool leftRight) const
crosstalk intercept for left and right
bool isInBadChamber(const CSCDetId &id) const
Is the gven chamber flagged as bad?
float gain(const CSCDetId &detId, int channel) const
gain per channel
CSCConditions(const edm::ParameterSet &ps)
edm::ESHandle< CSCDBChipSpeedCorrection > theChipCorrections
edm::ESHandle< CSCDBCrosstalk > theCrosstalk
bool readBadChambers() const
did we request reading bad chamber info from db?
void setIdOfBadChannelWords(const CSCDetId &id)
const CSCDetId & idOfBadChannelWords() const
the offline CSCDetId of current bad channel words
Definition: CSCConditions.h:98
float gasGainCorrection(const CSCDetId &detId, int strip, int wire) const
float averageGain() const
bool useGasGainCorrections() const
did we request reading gas gain correction info from db?
float theAverageGain
edm::ESHandle< CSCDBPedestals > thePedestals
std::bitset< 112 > badStripWord_
CSCDetId idOfBadChannelWords_
const std::bitset< 112 > & badStripWord() const
bad strip channel word for a CSCLayer - 1 bit per channel
Definition: CSCConditions.h:92