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
CSCConditions::thePedestals
edm::ESHandle< CSCDBPedestals > thePedestals
Definition: CSCConditions.h:145
CSCBadStripsRcd.h
CSCConditions::noiseMatrix
const CSCDBNoiseMatrix::Item & noiseMatrix(const CSCDetId &detId, int channel) const
raw noise matrix (unscaled short int elements)
Definition: CSCConditions.cc:273
CSCConditions::theBadWires
edm::ESHandle< CSCBadWires > theBadWires
Definition: CSCConditions.h:148
CSCDBChipSpeedCorrection
Definition: CSCDBChipSpeedCorrection.h:9
CSCConditions::indexer_
edm::ESHandle< CSCIndexerBase > indexer_
Definition: CSCConditions.h:156
CSCConditions::gainsWatcher_
edm::ESWatcher< CSCDBGainsRcd > gainsWatcher_
Definition: CSCConditions.h:178
CSCConditions::idOfBadChannelWords_
CSCDetId idOfBadChannelWords_
Definition: CSCConditions.h:171
CSCConditions::readBadChambers_
bool readBadChambers_
Definition: CSCConditions.h:163
CSCBadStrips
Definition: CSCBadStrips.h:8
CSCConditions::useTimingCorrections_
bool useTimingCorrections_
Definition: CSCConditions.h:165
edm::ESWatcher< CSCDBGainsRcd >
ESHandle.h
CSCConditions::gainSigma
float gainSigma(const CSCDetId &detId, int channel) const
overall calibration precision
Definition: CSCConditions.h:59
CSCBadWiresRcd.h
CSCConditions::readBadChambers
bool readBadChambers() const
did we request reading bad chamber info from db?
Definition: CSCConditions.h:109
CSCConditions::idOfBadChannelWords
const CSCDetId & idOfBadChannelWords() const
the offline CSCDetId of current bad channel words
Definition: CSCConditions.h:98
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
CSCConditions::theBadStrips
edm::ESHandle< CSCBadStrips > theBadStrips
Definition: CSCConditions.h:147
CSCConditions::theNoiseMatrix
edm::ESHandle< CSCDBNoiseMatrix > theNoiseMatrix
Definition: CSCConditions.h:146
CSCDBNoiseMatrix::Item
Definition: CSCDBNoiseMatrix.h:14
CSCConditions::readBadChannels_
bool readBadChannels_
Definition: CSCConditions.h:161
CSCConditions::readBadChannels
bool readBadChannels() const
did we request reading bad channel info from db?
Definition: CSCConditions.h:106
CSCConditions::badStripWord_
std::bitset< 112 > badStripWord_
Definition: CSCConditions.h:172
CSCConditions::elayers
elayers
Definition: CSCConditions.h:184
CSCConditions::useTimingCorrections
bool useTimingCorrections() const
did we request reading timing correction info from db?
Definition: CSCConditions.h:112
CSCConditions::pedestal
float pedestal(const CSCDetId &detId, int channel) const
static ped in ADC counts
Definition: CSCConditions.cc:237
CSCBadChambers
Definition: CSCBadChambers.h:9
CSCConditions::channelFromStrip
int channelFromStrip(const CSCDetId &id, int geomStrip) const
feedthrough for external access
Definition: CSCConditions.cc:402
CSCConditions::fillBadWireWord
void fillBadWireWord(const CSCDetId &id)
Definition: CSCConditions.cc:182
CSCConditions::fillBadChannelWords
void fillBadChannelWords(const CSCDetId &id)
Definition: CSCConditions.cc:119
CSCDetId.h
CSCConditions::isInBadChamber
bool isInBadChamber(const CSCDetId &id) const
Is the gven chamber flagged as bad?
Definition: CSCConditions.cc:215
CSCDBGains
Definition: CSCDBGains.h:9
CSCConditions::theChamberTimingCorrections
edm::ESHandle< CSCChamberTimeCorrections > theChamberTimingCorrections
Definition: CSCConditions.h:151
CSCDBCrosstalk
Definition: CSCDBCrosstalk.h:9
CSCConditions::gain
float gain(const CSCDetId &detId, int channel) const
gain per channel
Definition: CSCConditions.cc:229
CSCDBGasGainCorrection
Definition: CSCDBGasGainCorrection.h:9
CSCConditions::noiseMatrixElements
void noiseMatrixElements(const CSCDetId &id, int channel, std::vector< float > &me) const
Definition: CSCConditions.cc:285
CSCConditions
Definition: CSCConditions.h:48
CSCConditions::badWireWord
const std::bitset< 112 > & badWireWord() const
bad wiregroup channel word for a CSCLayer - 1 bit per channel
Definition: CSCConditions.h:95
CSCConditions::crosstalkIntercept
float crosstalkIntercept(const CSCDetId &detId, int channel, bool leftRight) const
crosstalk intercept for left and right
Definition: CSCConditions.cc:253
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:314
CSCDBPedestals
Definition: CSCDBPedestals.h:9
CSCConditions::CSCConditions
CSCConditions(const edm::ParameterSet &ps)
Definition: CSCConditions.cc:37
CSCConditions::theBadChambers
edm::ESHandle< CSCBadChambers > theBadChambers
Definition: CSCConditions.h:149
CSCConditions::theGains
edm::ESHandle< CSCDBGains > theGains
Definition: CSCConditions.h:143
edm::ESHandle< CSCDBGains >
CSCConditions::~CSCConditions
~CSCConditions()
Definition: CSCConditions.cc:64
CSCConditions::badWireWord_
std::bitset< 112 > badWireWord_
Definition: CSCConditions.h:173
CSCConditions::mapper_
edm::ESHandle< CSCChannelMapperBase > mapper_
Definition: CSCConditions.h:157
CSCConditions::setIdOfBadChannelWords
void setIdOfBadChannelWords(const CSCDetId &id)
Definition: CSCConditions.h:139
edm::ParameterSet
Definition: ParameterSet.h:36
CSCChamberTimeCorrections
Definition: CSCChamberTimeCorrections.h:9
CSCConditions::gasGainCorrection
float gasGainCorrection(const CSCDetId &detId, int strip, int wire) const
Definition: CSCConditions.cc:390
CSCBadWires
Definition: CSCBadWires.h:8
CSCConditions::print
void print() const
Definition: CSCConditions.cc:410
CSCConditions::useGasGainCorrections
bool useGasGainCorrections() const
did we request reading gas gain correction info from db?
Definition: CSCConditions.h:127
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:337
CSCConditions::averageGain
float averageGain() const
Definition: CSCConditions.cc:352
CSCDBNoiseMatrix.h
CSCConditions::rawStripChannel
int rawStripChannel(const CSCDetId &id, int geomChannel) const
Definition: CSCConditions.cc:406
CSCIndexerBase
Definition: CSCIndexerBase.h:69
edm::EventSetup
Definition: EventSetup.h:57
CSCConditions::initializeEvent
void initializeEvent(const edm::EventSetup &es)
fetch database content via EventSetup
Definition: CSCConditions.cc:66
CSCConditions::MAX_LAYERS
Definition: CSCConditions.h:184
CSCConditions::pedestalSigma
float pedestalSigma(const CSCDetId &detId, int channel) const
static ped rms in ADC counts
Definition: CSCConditions.cc:245
CSCConditions::fillBadStripWord
void fillBadStripWord(const CSCDetId &id)
fill bad channel words for offline id
Definition: CSCConditions.cc:143
CSCConditions::chamberTimingCorrection
float chamberTimingCorrection(const CSCDetId &detId) const
chamber timing correction in ns given detId of chamber
Definition: CSCConditions.cc:325
CSCConditions::useGasGainCorrections_
bool useGasGainCorrections_
Definition: CSCConditions.h:167
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:263
ESWatcher.h
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
CSCConditions::theChipCorrections
edm::ESHandle< CSCDBChipSpeedCorrection > theChipCorrections
Definition: CSCConditions.h:150
CSCDBGainsRcd.h
CSCConditions::theAverageGain
float theAverageGain
Definition: CSCConditions.h:175
CSCConditions::theCrosstalk
edm::ESHandle< CSCDBCrosstalk > theCrosstalk
Definition: CSCConditions.h:144
CSCConditions::badStripWord
const std::bitset< 112 > & badStripWord() const
bad strip channel word for a CSCLayer - 1 bit per channel
Definition: CSCConditions.h:92
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
CSCConditions::theGasGainCorrections
edm::ESHandle< CSCDBGasGainCorrection > theGasGainCorrections
Definition: CSCConditions.h:152
CSCConditions::crossTalk
void crossTalk(const CSCDetId &id, int channel, std::vector< float > &ct) const
Definition: CSCConditions.cc:302