CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
edm::ESGetToken< CSCIndexerBase, CSCIndexerRecord > indexerToken_
edm::ESHandle< CSCDBNoiseMatrix > theNoiseMatrix
edm::ESHandle< CSCBadWires > theBadWires
uint16_t *__restrict__ id
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
edm::ESGetToken< CSCDBGains, CSCDBGainsRcd > gainsToken_
void fillBadChannelWords(const CSCDetId &id)
CSCConditions(const edm::ParameterSet &ps, edm::ConsumesCollector)
edm::ESGetToken< CSCDBCrosstalk, CSCDBCrosstalkRcd > crosstalkToken_
edm::ESHandle< CSCChamberTimeCorrections > theChamberTimingCorrections
float gainSigma(const CSCDetId &detId, int channel) const
overall calibration precision
Definition: CSCConditions.h:69
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
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
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
edm::ESGetToken< CSCChamberTimeCorrections, CSCChamberTimeCorrectionsRcd > chamberTimingCorrectionsToken_
float anodeBXoffset(const CSCDetId &detId) const
anode bx offset in bx given detId of chamber
void fillBadWireWord(const CSCDetId &id)
bool useTimingCorrections_
edm::ESGetToken< CSCDBPedestals, CSCDBPedestalsRcd > pedestalsToken_
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
int rawStripChannel(const CSCDetId &id, int geomChannel) const
edm::ESGetToken< CSCBadWires, CSCBadWiresRcd > badWiresToken_
edm::ESHandle< CSCBadChambers > theBadChambers
int channelFromStrip(const CSCDetId &id, int geomStrip) const
feedthrough for external access
edm::ESHandle< CSCDBGains > theGains
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 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
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
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
edm::ESGetToken< CSCChannelMapperBase, CSCChannelMapperRecord > mapperToken_