test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCConditions.h
Go to the documentation of this file.
1 #ifndef CSCCalibration_CSCConditions_h
2 #define CSCCalibration_CSCConditions_h
3 
12 
13 #include <vector>
14 #include <bitset>
15 
16 class CSCDBGains;
17 class CSCDBPedestals;
18 class CSCDBCrosstalk;
19 class CSCBadStrips;
20 class CSCBadWires;
21 class CSCBadChambers;
25 class CSCIndexerBase;
27 
47 {
48 public:
49  explicit CSCConditions( const edm::ParameterSet& ps );
51 
53  void initializeEvent(const edm::EventSetup & es);
54 
56  float gain(const CSCDetId & detId, int channel) const;
58  float gainSigma(const CSCDetId & detId, int channel) const {return 0.005;}
59 
61  float pedestal(const CSCDetId & detId, int channel) const;
63  float pedestalSigma(const CSCDetId & detId, int channel) const;
64 
66  float crosstalkSlope(const CSCDetId & detId, int channel, bool leftRight) const;
68  float crosstalkIntercept(const CSCDetId & detId, int channel, bool leftRight) const;
69 
71  const CSCDBNoiseMatrix::Item & noiseMatrix(const CSCDetId & detId, int channel) const;
72 
74  void noiseMatrixElements( const CSCDetId& id, int channel, std::vector<float>& me ) const;
75 
77  void crossTalk( const CSCDetId& id, int channel, std::vector<float>& ct ) const;
78 
80  float chipCorrection( const CSCDetId & detId, int channel ) const;
81 
83  float chamberTimingCorrection( const CSCDetId & detId) const;
84 
86  float anodeBXoffset( const CSCDetId & detId) const;
87 
89  const std::bitset<80>& badStripWord( const CSCDetId& id ) const;
90  const std::bitset<112>& badWireWord( const CSCDetId& id ) const;
91 
92  void print() const;
93 
95  bool isInBadChamber( const CSCDetId& id ) const;
96 
98  bool readBadChannels() const { return readBadChannels_; }
99 
101  bool readBadChambers() const { return readBadChambers_; }
102 
105 
107  void fillBadStripWords();
108  void fillBadWireWords();
109 
111  float averageGain() const;
112 
114  float gasGainCorrection( const CSCDetId & detId, int strip, int wire ) const;
115 
118 
120  int channelFromStrip(const CSCDetId& id, int geomStrip) const;
121  int rawStripChannel( const CSCDetId& id, int geomChannel) const;
122 
123 private:
124 
125 // handles to conditions data
126 
137 
138 // handles to algorithm versions
139 
142 
143 // logical flags controlling some conditions data usage
144 
145  bool readBadChannels_; // flag whether or not to even attempt reading bad channel info from db
146  bool readBadChambers_; // flag whether or not to even attempt reading bad chamber info from db
147  bool useTimingCorrections_; // flag whether or not to even attempt reading timing correction info from db
148  bool useGasGainCorrections_; // flag whether or not to even attempt reading gas-gain correction info from db
149 
150  // cache bad channel words once created
151  std::vector< std::bitset<80> > badStripWords;
152  std::vector< std::bitset<112> > badWireWords;
153 
154  mutable float theAverageGain; // average over entire system, subject to some constraints!
155 
157  //@@ remove until we have real information to use
158  // edm::ESWatcher<CSCBadStripsRcd> badStripsWatcher_;
159  // edm::ESWatcher<CSCBadWiresRcd> badWiresWatcher_;
160 
161  // Total number of CSC layers in the system, with full ME42 installed.
162  enum elayers{ MAX_LAYERS = 3240 };
163 };
164 
165 #endif
166 
167 
const std::bitset< 80 > & badStripWord(const CSCDetId &id) const
bad channel words per CSCLayer - 1 bit per channel
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
fill vector (dim 12, must be allocated by caller) with noise matrix elements (scaled to float) ...
void fillBadStripWords()
fill bad channel words
edm::ESHandle< CSCChamberTimeCorrections > theChamberTimingCorrections
float gainSigma(const CSCDetId &detId, int channel) const
overall calibration precision
Definition: CSCConditions.h:58
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
std::vector< std::bitset< 112 > > badWireWords
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
fill vector (dim 4, must be allocated by caller) with crosstalk sl, il, sr, ir
std::vector< std::bitset< 80 > > badStripWords
float anodeBXoffset(const CSCDetId &detId) const
anode bx offset in bx given detId of chamber
bool useTimingCorrections_
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?
Definition: CSCConditions.h:98
bool useGasGainCorrections_
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
const std::bitset< 112 > & badWireWord(const CSCDetId &id) const
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)
void fillBadWireWords()
edm::ESHandle< CSCDBChipSpeedCorrection > theChipCorrections
edm::ESHandle< CSCDBCrosstalk > theCrosstalk
bool readBadChambers() const
did we request reading bad chamber info from db?
float gasGainCorrection(const CSCDetId &detId, int strip, int wire) const
gas gain correction as a function of detId (w/layer), strip, and wire channels
float averageGain() const
average gain over entire CSC system (logically const although must be cached here).
bool useGasGainCorrections() const
did we request reading gas gain correction info from db?
float theAverageGain
edm::ESHandle< CSCDBPedestals > thePedestals