CMS 3D CMS Logo

CSCConditions.h
Go to the documentation of this file.
1 #ifndef CSCCalibration_CSCConditions_h
2 #define CSCCalibration_CSCConditions_h
3 
23 #include <bitset>
24 #include <vector>
25 
26 class CSCDBGains;
27 class CSCDBPedestals;
28 class CSCDBCrosstalk;
29 class CSCBadStrips;
30 class CSCBadWires;
31 class CSCBadChambers;
35 class CSCIndexerBase;
37 
59 public:
62 
64  void initializeEvent(const edm::EventSetup &es);
65 
67  float gain(const CSCDetId &detId, int channel) const;
69  float gainSigma(const CSCDetId &detId, int channel) const { return 0.005; }
70 
72  float pedestal(const CSCDetId &detId, int channel) const;
74  float pedestalSigma(const CSCDetId &detId, int channel) const;
75 
77  float crosstalkSlope(const CSCDetId &detId, int channel, bool leftRight) const;
79  float crosstalkIntercept(const CSCDetId &detId, int channel, bool leftRight) const;
80 
82  const CSCDBNoiseMatrix::Item &noiseMatrix(const CSCDetId &detId, int channel) const;
83 
86  void noiseMatrixElements(const CSCDetId &id, int channel, std::vector<float> &me) const;
87 
90  void crossTalk(const CSCDetId &id, int channel, std::vector<float> &ct) const;
91 
93  float chipCorrection(const CSCDetId &detId, int channel) const;
94 
96  float chamberTimingCorrection(const CSCDetId &detId) const;
97 
99  float anodeBXoffset(const CSCDetId &detId) const;
100 
102  const std::bitset<112> &badStripWord() const { return badStripWord_; }
103 
105  const std::bitset<112> &badWireWord() const { return badWireWord_; }
106 
109 
110  void print() const;
111 
113  bool isInBadChamber(const CSCDetId &id) const;
114 
116  bool readBadChannels() const { return readBadChannels_; }
117 
119  bool readBadChambers() const { return readBadChambers_; }
120 
123 
126  void fillBadChannelWords(const CSCDetId &id);
127 
130  float averageGain() const;
131 
134  float gasGainCorrection(const CSCDetId &detId, int strip, int wire) const;
135 
138 
140  int channelFromStrip(const CSCDetId &id, int geomStrip) const;
141  int rawStripChannel(const CSCDetId &id, int geomChannel) const;
142 
143 private:
145  void fillBadStripWord(const CSCDetId &id);
146  void fillBadWireWord(const CSCDetId &id);
150 
151  // handles to conditions data
152 
163 
164  // handles to algorithm versions
165 
168 
169  //EventSetup Tokens for Handles
182 
183  // logical flags controlling some conditions data usage
184 
185  bool readBadChannels_; // flag whether or not to even attempt reading bad
186  // channel info from db
187  bool readBadChambers_; // flag whether or not to even attempt reading bad
188  // chamber info from db
189  bool useTimingCorrections_; // flag whether or not to even attempt reading
190  // timing correction info from db
191  bool useGasGainCorrections_; // flag whether or not to even attempt reading
192  // gas-gain correction info from db
193 
194  // Cache bad channel content for current CSC layer
196  std::bitset<112> badStripWord_;
197  std::bitset<112> badWireWord_;
198 
199  mutable float theAverageGain; // average over entire system, subject to some
200  // constraints!
201 
203  //@@ remove until we have real information to use
204  // edm::ESWatcher<CSCBadStripsRcd> badStripsWatcher_;
205  // edm::ESWatcher<CSCBadWiresRcd> badWiresWatcher_;
206 
207  // Total number of CSC layers in the system, with full ME42 installed.
208  enum elayers { MAX_LAYERS = 3240 };
209 };
210 
211 #endif
edm::ESGetToken< CSCDBNoiseMatrix, CSCDBNoiseMatrixRcd > noiseMatrixToken_
edm::ESHandle< CSCDBGasGainCorrection > theGasGainCorrections
const CSCDetId & idOfBadChannelWords() const
the offline CSCDetId of current bad channel words
edm::ESGetToken< CSCIndexerBase, CSCIndexerRecord > indexerToken_
edm::ESHandle< CSCDBNoiseMatrix > theNoiseMatrix
edm::ESHandle< CSCBadWires > theBadWires
float pedestal(const CSCDetId &detId, int channel) const
static ped in ADC counts
int channelFromStrip(const CSCDetId &id, int geomStrip) const
feedthrough for external access
edm::ESGetToken< CSCDBGains, CSCDBGainsRcd > gainsToken_
void fillBadChannelWords(const CSCDetId &id)
CSCConditions(const edm::ParameterSet &ps, edm::ConsumesCollector)
bool isInBadChamber(const CSCDetId &id) const
Is the gven chamber flagged as bad?
edm::ESGetToken< CSCDBCrosstalk, CSCDBCrosstalkRcd > crosstalkToken_
edm::ESHandle< CSCChamberTimeCorrections > theChamberTimingCorrections
float gainSigma(const CSCDetId &detId, int channel) const
overall calibration precision
Definition: CSCConditions.h:69
edm::ESHandle< CSCBadStrips > theBadStrips
edm::ESGetToken< CSCBadStrips, CSCBadStripsRcd > badStripsToken_
float chipCorrection(const CSCDetId &detId, int channel) const
chip speed correction in ns given detId (w/layer) and strip channel
const std::bitset< 112 > & badWireWord() const
bad wiregroup channel word for a CSCLayer - 1 bit per channel
bool readBadChannels() const
did we request reading bad channel info from db?
edm::ESHandle< CSCIndexerBase > indexer_
bool useTimingCorrections() const
did we request reading timing correction info from db?
edm::ESWatcher< CSCDBGainsRcd > gainsWatcher_
edm::ESGetToken< CSCChamberTimeCorrections, CSCChamberTimeCorrectionsRcd > chamberTimingCorrectionsToken_
void fillBadWireWord(const CSCDetId &id)
bool useTimingCorrections_
edm::ESGetToken< CSCDBPedestals, CSCDBPedestalsRcd > pedestalsToken_
std::bitset< 112 > badWireWord_
edm::ESHandle< CSCChannelMapperBase > mapper_
bool useGasGainCorrections_
void noiseMatrixElements(const CSCDetId &id, int channel, std::vector< float > &me) const
float gain(const CSCDetId &detId, int channel) const
gain per channel
void print() const
bool useGasGainCorrections() const
did we request reading gas gain correction info from db?
edm::ESGetToken< CSCBadWires, CSCBadWiresRcd > badWiresToken_
float averageGain() const
edm::ESHandle< CSCBadChambers > theBadChambers
float anodeBXoffset(const CSCDetId &detId) const
anode bx offset in bx given detId of chamber
edm::ESHandle< CSCDBGains > theGains
int rawStripChannel(const CSCDetId &id, int geomChannel) const
edm::ESGetToken< CSCDBGasGainCorrection, CSCDBGasGainCorrectionRcd > gasGainCorrectionsToken_
edm::ESGetToken< CSCDBChipSpeedCorrection, CSCDBChipSpeedCorrectionRcd > chipCorrectionsToken_
void initializeEvent(const edm::EventSetup &es)
fetch database content via EventSetup
void fillBadStripWord(const CSCDetId &id)
fill bad channel words for offline id
edm::ESGetToken< CSCBadChambers, CSCBadChambersRcd > badChambersToken_
float chamberTimingCorrection(const CSCDetId &detId) const
chamber timing correction in ns given detId of chamber
float gasGainCorrection(const CSCDetId &detId, int strip, int wire) const
float crosstalkIntercept(const CSCDetId &detId, int channel, bool leftRight) const
crosstalk intercept for left and right
float crosstalkSlope(const CSCDetId &detId, int channel, bool leftRight) const
crosstalk slope for left and right
edm::ESHandle< CSCDBChipSpeedCorrection > theChipCorrections
edm::ESHandle< CSCDBCrosstalk > theCrosstalk
float pedestalSigma(const CSCDetId &detId, int channel) const
static ped rms in ADC counts
void setIdOfBadChannelWords(const CSCDetId &id)
bool readBadChambers() const
did we request reading bad chamber info from db?
void crossTalk(const CSCDetId &id, int channel, std::vector< float > &ct) const
float theAverageGain
const CSCDBNoiseMatrix::Item & noiseMatrix(const CSCDetId &detId, int channel) const
raw noise matrix (unscaled short int elements)
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
edm::ESGetToken< CSCChannelMapperBase, CSCChannelMapperRecord > mapperToken_