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
CSCConditions::thePedestals
edm::ESHandle< CSCDBPedestals > thePedestals
Definition: CSCConditions.h:155
CSCBadStripsRcd.h
CSCConditions::noiseMatrix
const CSCDBNoiseMatrix::Item & noiseMatrix(const CSCDetId &detId, int channel) const
raw noise matrix (unscaled short int elements)
Definition: CSCConditions.cc:281
CSCConditions::theBadWires
edm::ESHandle< CSCBadWires > theBadWires
Definition: CSCConditions.h:158
CSCDBChipSpeedCorrection
Definition: CSCDBChipSpeedCorrection.h:9
CSCConditions::indexer_
edm::ESHandle< CSCIndexerBase > indexer_
Definition: CSCConditions.h:166
CSCConditions::gainsWatcher_
edm::ESWatcher< CSCDBGainsRcd > gainsWatcher_
Definition: CSCConditions.h:202
CSCConditions::idOfBadChannelWords_
CSCDetId idOfBadChannelWords_
Definition: CSCConditions.h:195
CSCConditions::readBadChambers_
bool readBadChambers_
Definition: CSCConditions.h:187
CSCBadStrips
Definition: CSCBadStrips.h:8
CSCConditions::crosstalkToken_
edm::ESGetToken< CSCDBCrosstalk, CSCDBCrosstalkRcd > crosstalkToken_
Definition: CSCConditions.h:171
CSCConditions::useTimingCorrections_
bool useTimingCorrections_
Definition: CSCConditions.h:189
CSCConditions::CSCConditions
CSCConditions(const edm::ParameterSet &ps, edm::ConsumesCollector)
Definition: CSCConditions.cc:25
edm::ESWatcher< CSCDBGainsRcd >
ESHandle.h
CSCChamberTimeCorrectionsRcd.h
CSCConditions::noiseMatrixToken_
edm::ESGetToken< CSCDBNoiseMatrix, CSCDBNoiseMatrixRcd > noiseMatrixToken_
Definition: CSCConditions.h:173
CSCConditions::gainSigma
float gainSigma(const CSCDetId &detId, int channel) const
overall calibration precision
Definition: CSCConditions.h:69
CSCBadWiresRcd.h
CSCConditions::readBadChambers
bool readBadChambers() const
did we request reading bad chamber info from db?
Definition: CSCConditions.h:119
CSCConditions::idOfBadChannelWords
const CSCDetId & idOfBadChannelWords() const
the offline CSCDetId of current bad channel words
Definition: CSCConditions.h:108
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
CSCConditions::theBadStrips
edm::ESHandle< CSCBadStrips > theBadStrips
Definition: CSCConditions.h:157
CSCConditions::indexerToken_
edm::ESGetToken< CSCIndexerBase, CSCIndexerRecord > indexerToken_
Definition: CSCConditions.h:180
CSCConditions::theNoiseMatrix
edm::ESHandle< CSCDBNoiseMatrix > theNoiseMatrix
Definition: CSCConditions.h:156
CSCDBNoiseMatrix::Item
Definition: CSCDBNoiseMatrix.h:14
CSCConditions::readBadChannels_
bool readBadChannels_
Definition: CSCConditions.h:185
CSCConditions::readBadChannels
bool readBadChannels() const
did we request reading bad channel info from db?
Definition: CSCConditions.h:116
CSCConditions::badStripWord_
std::bitset< 112 > badStripWord_
Definition: CSCConditions.h:196
CSCConditions::elayers
elayers
Definition: CSCConditions.h:208
CSCConditions::useTimingCorrections
bool useTimingCorrections() const
did we request reading timing correction info from db?
Definition: CSCConditions.h:122
CSCConditions::pedestal
float pedestal(const CSCDetId &detId, int channel) const
static ped in ADC counts
Definition: CSCConditions.cc:245
CSCBadChambers
Definition: CSCBadChambers.h:9
CSCConditions::channelFromStrip
int channelFromStrip(const CSCDetId &id, int geomStrip) const
feedthrough for external access
Definition: CSCConditions.cc:410
ESGetToken.h
CSCConditions::fillBadWireWord
void fillBadWireWord(const CSCDetId &id)
Definition: CSCConditions.cc:190
CSCConditions::fillBadChannelWords
void fillBadChannelWords(const CSCDetId &id)
Definition: CSCConditions.cc:127
CSCDetId.h
CSCConditions::isInBadChamber
bool isInBadChamber(const CSCDetId &id) const
Is the gven chamber flagged as bad?
Definition: CSCConditions.cc:223
CSCDBGains
Definition: CSCDBGains.h:9
CSCConditions::theChamberTimingCorrections
edm::ESHandle< CSCChamberTimeCorrections > theChamberTimingCorrections
Definition: CSCConditions.h:161
CSCDBCrosstalk
Definition: CSCDBCrosstalk.h:9
CSCConditions::gain
float gain(const CSCDetId &detId, int channel) const
gain per channel
Definition: CSCConditions.cc:237
CSCDBGasGainCorrection
Definition: CSCDBGasGainCorrection.h:9
CSCConditions::noiseMatrixElements
void noiseMatrixElements(const CSCDetId &id, int channel, std::vector< float > &me) const
Definition: CSCConditions.cc:293
CSCConditions
Definition: CSCConditions.h:58
CSCConditions::badWireWord
const std::bitset< 112 > & badWireWord() const
bad wiregroup channel word for a CSCLayer - 1 bit per channel
Definition: CSCConditions.h:105
CSCConditions::badStripsToken_
edm::ESGetToken< CSCBadStrips, CSCBadStripsRcd > badStripsToken_
Definition: CSCConditions.h:174
CSCConditions::crosstalkIntercept
float crosstalkIntercept(const CSCDetId &detId, int channel, bool leftRight) const
crosstalk intercept for left and right
Definition: CSCConditions.cc:261
CSCDBNoiseMatrixRcd.h
CSCConditions::chipCorrection
float chipCorrection(const CSCDetId &detId, int channel) const
chip speed correction in ns given detId (w/layer) and strip channel
Definition: CSCConditions.cc:322
CSCDBPedestals
Definition: CSCDBPedestals.h:9
CSCConditions::badWiresToken_
edm::ESGetToken< CSCBadWires, CSCBadWiresRcd > badWiresToken_
Definition: CSCConditions.h:175
CSCConditions::theBadChambers
edm::ESHandle< CSCBadChambers > theBadChambers
Definition: CSCConditions.h:159
CSCConditions::theGains
edm::ESHandle< CSCDBGains > theGains
Definition: CSCConditions.h:153
edm::ESHandle< CSCDBGains >
CSCConditions::~CSCConditions
~CSCConditions()
Definition: CSCConditions.cc:72
CSCConditions::badWireWord_
std::bitset< 112 > badWireWord_
Definition: CSCConditions.h:197
CSCConditions::gainsToken_
edm::ESGetToken< CSCDBGains, CSCDBGainsRcd > gainsToken_
Definition: CSCConditions.h:170
CSCConditions::pedestalsToken_
edm::ESGetToken< CSCDBPedestals, CSCDBPedestalsRcd > pedestalsToken_
Definition: CSCConditions.h:172
CSCConditions::mapper_
edm::ESHandle< CSCChannelMapperBase > mapper_
Definition: CSCConditions.h:167
CSCConditions::badChambersToken_
edm::ESGetToken< CSCBadChambers, CSCBadChambersRcd > badChambersToken_
Definition: CSCConditions.h:176
CSCConditions::setIdOfBadChannelWords
void setIdOfBadChannelWords(const CSCDetId &id)
Definition: CSCConditions.h:149
CSCIndexerRecord.h
edm::ParameterSet
Definition: ParameterSet.h:47
CSCChamberTimeCorrections
Definition: CSCChamberTimeCorrections.h:9
CSCConditions::gasGainCorrection
float gasGainCorrection(const CSCDetId &detId, int strip, int wire) const
Definition: CSCConditions.cc:398
CSCBadWires
Definition: CSCBadWires.h:8
CSCConditions::print
void print() const
Definition: CSCConditions.cc:418
CSCDBGasGainCorrectionRcd.h
CSCConditions::useGasGainCorrections
bool useGasGainCorrections() const
did we request reading gas gain correction info from db?
Definition: CSCConditions.h:137
CSCDetId
Definition: CSCDetId.h:26
CSCConditions::anodeBXoffset
float anodeBXoffset(const CSCDetId &detId) const
anode bx offset in bx given detId of chamber
Definition: CSCConditions.cc:345
CSCConditions::averageGain
float averageGain() const
Definition: CSCConditions.cc:360
CSCDBNoiseMatrix.h
CSCConditions::rawStripChannel
int rawStripChannel(const CSCDetId &id, int geomChannel) const
Definition: CSCConditions.cc:414
CSCIndexerBase
Definition: CSCIndexerBase.h:69
edm::EventSetup
Definition: EventSetup.h:57
CSCConditions::chamberTimingCorrectionsToken_
edm::ESGetToken< CSCChamberTimeCorrections, CSCChamberTimeCorrectionsRcd > chamberTimingCorrectionsToken_
Definition: CSCConditions.h:178
CSCConditions::initializeEvent
void initializeEvent(const edm::EventSetup &es)
fetch database content via EventSetup
Definition: CSCConditions.cc:74
CSCConditions::MAX_LAYERS
Definition: CSCConditions.h:208
CSCConditions::gasGainCorrectionsToken_
edm::ESGetToken< CSCDBGasGainCorrection, CSCDBGasGainCorrectionRcd > gasGainCorrectionsToken_
Definition: CSCConditions.h:179
CSCChannelMapperRecord.h
CSCConditions::pedestalSigma
float pedestalSigma(const CSCDetId &detId, int channel) const
static ped rms in ADC counts
Definition: CSCConditions.cc:253
edm::ESGetToken< CSCDBGains, CSCDBGainsRcd >
CSCConditions::chipCorrectionsToken_
edm::ESGetToken< CSCDBChipSpeedCorrection, CSCDBChipSpeedCorrectionRcd > chipCorrectionsToken_
Definition: CSCConditions.h:177
CSCBadChambersRcd.h
CSCDBCrosstalkRcd.h
CSCConditions::fillBadStripWord
void fillBadStripWord(const CSCDetId &id)
fill bad channel words for offline id
Definition: CSCConditions.cc:151
CSCConditions::chamberTimingCorrection
float chamberTimingCorrection(const CSCDetId &detId) const
chamber timing correction in ns given detId of chamber
Definition: CSCConditions.cc:333
CSCConditions::useGasGainCorrections_
bool useGasGainCorrections_
Definition: CSCConditions.h:191
CSCChannelMapperBase
Definition: CSCChannelMapperBase.h:42
Frameworkfwd.h
CSCConditions::crosstalkSlope
float crosstalkSlope(const CSCDetId &detId, int channel, bool leftRight) const
crosstalk slope for left and right
Definition: CSCConditions.cc:271
ESWatcher.h
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
CSCConditions::theChipCorrections
edm::ESHandle< CSCDBChipSpeedCorrection > theChipCorrections
Definition: CSCConditions.h:160
CSCDBGainsRcd.h
CSCConditions::theAverageGain
float theAverageGain
Definition: CSCConditions.h:199
CSCConditions::theCrosstalk
edm::ESHandle< CSCDBCrosstalk > theCrosstalk
Definition: CSCConditions.h:154
CSCConditions::badStripWord
const std::bitset< 112 > & badStripWord() const
bad strip channel word for a CSCLayer - 1 bit per channel
Definition: CSCConditions.h:102
ConsumesCollector.h
CSCConditions::mapperToken_
edm::ESGetToken< CSCChannelMapperBase, CSCChannelMapperRecord > mapperToken_
Definition: CSCConditions.h:181
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
CSCConditions::theGasGainCorrections
edm::ESHandle< CSCDBGasGainCorrection > theGasGainCorrections
Definition: CSCConditions.h:162
CSCDBChipSpeedCorrectionRcd.h
CSCConditions::crossTalk
void crossTalk(const CSCDetId &id, int channel, std::vector< float > &ct) const
Definition: CSCConditions.cc:310
CSCDBPedestalsRcd.h
edm::ConsumesCollector
Definition: ConsumesCollector.h:45