CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Attributes
CSCConditions Class Reference

#include <CSCConditions.h>

Public Member Functions

float anodeBXoffset (const CSCDetId &detId) const
 
float averageGain () const
 average gain over entire CSC system (logically const although must be cached here). More...
 
const std::bitset< 80 > & badStripWord (const CSCDetId &id) const
 return bad channel words per CSCLayer - 1 bit per channel More...
 
const std::bitset< 112 > & badWireWord (const CSCDetId &id) const
 
float chamberTimingCorrection (const CSCDetId &detId) const
 
float chipCorrection (const CSCDetId &detId, int channel) const
 
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 More...
 
float crosstalkIntercept (const CSCDetId &detId, int channel, bool leftRight) const
 
float crosstalkSlope (const CSCDetId &detId, int channel, bool leftRight) const
 
 CSCConditions (const edm::ParameterSet &ps)
 
void fillBadStripWords ()
 fill bad channel words More...
 
void fillBadWireWords ()
 
float gain (const CSCDetId &detId, int channel) const
 channels count from 1 More...
 
float gainSigma (const CSCDetId &detId, int channel) const
 total calibration precision More...
 
float gasGainCorrection (const CSCDetId &detId, int strip, int wire) const
 gas gain correction as a function of detId (w/layer), strip, and wire More...
 
void initializeEvent (const edm::EventSetup &es)
 fetch the maps from the database More...
 
bool isInBadChamber (const CSCDetId &id) const
 Is the gven chamber flagged as bad? More...
 
const CSCDBNoiseMatrix::ItemnoiseMatrix (const CSCDetId &detId, int channel) const
 return raw noise matrix (unscaled short int elements) More...
 
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) More...
 
float pedestal (const CSCDetId &detId, int channel) const
 in ADC counts More...
 
float pedestalSigma (const CSCDetId &detId, int channel) const
 
void print () const
 
bool readBadChambers () const
 did we request reading bad chamber info from db? More...
 
bool readBadChannels () const
 did we request reading bad channel info from db? More...
 
bool useGasGainCorrections () const
 did we request reading gas gain correction info from db? More...
 
bool useTimingCorrections () const
 did we request reading timing correction info from db? More...
 
 ~CSCConditions ()
 

Private Types

enum  elayers { MAX_LAYERS = 3240 }
 

Private Attributes

std::vector< std::bitset< 80 > > badStripWords
 
std::vector< std::bitset< 112 > > badWireWords
 
edm::ESWatcher< CSCDBGainsRcdgainsWatcher_
 
bool readBadChambers_
 
bool readBadChannels_
 
float theAverageGain
 
edm::ESHandle< CSCBadChamberstheBadChambers
 
edm::ESHandle< CSCBadStripstheBadStrips
 
edm::ESHandle< CSCBadWirestheBadWires
 
edm::ESHandle
< CSCChamberTimeCorrections
theChamberTimingCorrections
 
edm::ESHandle
< CSCDBChipSpeedCorrection
theChipCorrections
 
edm::ESHandle< CSCDBCrosstalktheCrosstalk
 
edm::ESHandle< CSCDBGainstheGains
 
edm::ESHandle
< CSCDBGasGainCorrection
theGasGainCorrections
 
edm::ESHandle< CSCDBNoiseMatrixtheNoiseMatrix
 
edm::ESHandle< CSCDBPedestalsthePedestals
 
bool useGasGainCorrections_
 
bool useTimingCorrections_
 

Detailed Description

Encapsulates a user interface into the CSC conditions

Author
Rick Wilkinson
Tim Cox

Definition at line 35 of file CSCConditions.h.

Member Enumeration Documentation

enum CSCConditions::elayers
private
Enumerator
MAX_LAYERS 

Definition at line 135 of file CSCConditions.h.

Constructor & Destructor Documentation

CSCConditions::CSCConditions ( const edm::ParameterSet ps)
explicit

Definition at line 22 of file CSCConditions.cc.

References badStripWords, badWireWords, edm::ParameterSet::getParameter(), MAX_LAYERS, readBadChambers_, readBadChannels_, useGasGainCorrections_, and useTimingCorrections_.

23 : theGains(),
24  theCrosstalk(),
25  thePedestals(),
27  theBadStrips(),
28  theBadWires(),
34  theAverageGain( -1.0 )
35 {
36  readBadChannels_ = ps.getParameter<bool>("readBadChannels");
37  readBadChambers_ = ps.getParameter<bool>("readBadChambers");
38  useTimingCorrections_ = ps.getParameter<bool>("CSCUseTimingCorrections");
39  useGasGainCorrections_ = ps.getParameter<bool>("CSCUseGasGainCorrections");
40  // set size to hold all layers, using enum defined in .h
41  badStripWords.resize( MAX_LAYERS, 0 );
42  badWireWords.resize( MAX_LAYERS, 0 );
43 }
T getParameter(std::string const &) const
edm::ESHandle< CSCDBGasGainCorrection > theGasGainCorrections
edm::ESHandle< CSCDBNoiseMatrix > theNoiseMatrix
edm::ESHandle< CSCBadWires > theBadWires
edm::ESHandle< CSCChamberTimeCorrections > theChamberTimingCorrections
edm::ESHandle< CSCBadStrips > theBadStrips
std::vector< std::bitset< 112 > > badWireWords
std::vector< std::bitset< 80 > > badStripWords
bool useTimingCorrections_
bool useGasGainCorrections_
edm::ESHandle< CSCBadChambers > theBadChambers
edm::ESHandle< CSCDBGains > theGains
edm::ESHandle< CSCDBChipSpeedCorrection > theChipCorrections
edm::ESHandle< CSCDBCrosstalk > theCrosstalk
float theAverageGain
edm::ESHandle< CSCDBPedestals > thePedestals
CSCConditions::~CSCConditions ( )

Definition at line 46 of file CSCConditions.cc.

47 {
48 }

Member Function Documentation

float CSCConditions::anodeBXoffset ( const CSCDetId detId) const

Definition at line 310 of file CSCConditions.cc.

References edm::ESHandleBase::isValid(), theChamberTimingCorrections, and useTimingCorrections().

Referenced by CSCRecoConditions::anodeBXoffset().

311 {
312  if ( useTimingCorrections() ){
314  return float ( theChamberTimingCorrections->item(detId).anode_bx_offset*1./theChamberTimingCorrections->factor_precision);
315  }
316  else
317  return 0;
318 }
edm::ESHandle< CSCChamberTimeCorrections > theChamberTimingCorrections
bool useTimingCorrections() const
did we request reading timing correction info from db?
Definition: CSCConditions.h:90
bool isValid() const
Definition: ESHandle.h:37
float CSCConditions::averageGain ( ) const

average gain over entire CSC system (logically const although must be cached here).

Return average strip gain for full CSC system. Lazy evaluation. Restrict averaging to gains between 5 and 10, and require average is between 6 or 9 otherwise fix it to 7.5. These values came from Dominique and Stan,

Definition at line 334 of file CSCConditions.cc.

References theAverageGain, and theGains.

Referenced by CSCRecoConditions::averageGain().

334  {
335 
336  const float loEdge = 5.0; // consider gains above this
337  const float hiEdge = 10.0; // consider gains below this
338  const float loLimit = 6.0; // lowest acceptable average gain
339  const float hiLimit = 9.0; // highest acceptable average gain
340  const float expectedAverage = 7.5; // default average gain
341 
342  if ( theAverageGain > 0. ) return theAverageGain; // only recalculate if necessary
343 
344  int n_strip = 0;
345  float gain_tot = 0.;
346 
347  CSCDBGains::GainContainer::const_iterator it;
348  for ( it=theGains->gains.begin(); it!=theGains->gains.end(); ++it ) {
349  float the_gain = float( it->gain_slope )/theGains->factor_gain;
350  if (the_gain > loEdge && the_gain < hiEdge ) {
351  gain_tot += the_gain;
352  ++n_strip;
353  }
354  }
355 
356  // Average gain
357  if ( n_strip > 0 ) {
358  theAverageGain = gain_tot / n_strip;
359  }
360 
361  // Average gain has been around 7.5 in real data
362  if ( theAverageGain < loLimit || theAverageGain > hiLimit ) {
363  // LogTrace("CSC") << "Average CSC strip gain = "
364  // << theAverageGain << " is reset to expected value " << expectedAverage;
365  theAverageGain = expectedAverage;
366  }
367 
368  return theAverageGain;
369 }
edm::ESHandle< CSCDBGains > theGains
float theAverageGain
const std::bitset< 80 > & CSCConditions::badStripWord ( const CSCDetId id) const

return bad channel words per CSCLayer - 1 bit per channel

Definition at line 320 of file CSCConditions.cc.

References badStripWords, and CSCIndexer::layerIndex().

Referenced by CSCRecoConditions::badStrip().

320  {
321  CSCIndexer indexer;
322  return badStripWords[indexer.layerIndex(id) - 1];
323 }
std::vector< std::bitset< 80 > > badStripWords
IndexType layerIndex(const CSCDetId &id) const
Definition: CSCIndexer.h:80
const std::bitset< 112 > & CSCConditions::badWireWord ( const CSCDetId id) const

Definition at line 325 of file CSCConditions.cc.

References badWireWords, and CSCIndexer::layerIndex().

Referenced by CSCRecoConditions::badWireWord().

325  {
326  CSCIndexer indexer;
327  return badWireWords[indexer.layerIndex(id) - 1];
328 }
std::vector< std::bitset< 112 > > badWireWords
IndexType layerIndex(const CSCDetId &id) const
Definition: CSCIndexer.h:80
float CSCConditions::chamberTimingCorrection ( const CSCDetId detId) const

Definition at line 298 of file CSCConditions.cc.

References edm::ESHandleBase::isValid(), theChamberTimingCorrections, and useTimingCorrections().

Referenced by CSCRecoConditions::chamberTimingCorrection().

299 {
300  if ( useTimingCorrections() ){
302  return float ( theChamberTimingCorrections->item(detId).cfeb_tmb_skew_delay*1./theChamberTimingCorrections->factor_precision
303  + theChamberTimingCorrections->item(detId).cfeb_timing_corr*1./theChamberTimingCorrections->factor_precision
304  + (theChamberTimingCorrections->item(detId).cfeb_cable_delay*25.)
305 );
306  }
307  else
308  return 0;
309 }
edm::ESHandle< CSCChamberTimeCorrections > theChamberTimingCorrections
bool useTimingCorrections() const
did we request reading timing correction info from db?
Definition: CSCConditions.h:90
bool isValid() const
Definition: ESHandle.h:37
float CSCConditions::chipCorrection ( const CSCDetId detId,
int  channel 
) const

Definition at line 286 of file CSCConditions.cc.

References CSCIndexer::chipIndex(), edm::ESHandleBase::isValid(), theChipCorrections, and useTimingCorrections().

Referenced by CSCRecoConditions::chipCorrection().

287 {
288  if ( useTimingCorrections() ){
289  assert(theChipCorrections.isValid());
290  CSCIndexer indexer;
291  int chip = indexer.chipIndex(stripChannel); //Converts 1-80(64) in a layer to 1-5(4), expects ME1/1a to be channel 65-80
292  //printf("CSCCondition e:%d s:%d r:%d c:%d l:%d strip:%d chip: %d\n",detId.endcap(),detId.station(), detId.ring(),detId.chamber(),detId.layer(),stripChannel,chip);
293  return float ( theChipCorrections->item(detId,chip).speedCorr )/theChipCorrections->factor_speedCorr;
294  }
295  else
296  return 0;
297 }
bool useTimingCorrections() const
did we request reading timing correction info from db?
Definition: CSCConditions.h:90
edm::ESHandle< CSCDBChipSpeedCorrection > theChipCorrections
IndexType chipIndex(IndexType ie, IndexType is, IndexType ir, IndexType ic, IndexType il, IndexType ichip) const
Definition: CSCIndexer.h:237
bool isValid() const
Definition: ESHandle.h:37
void CSCConditions::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

Definition at line 277 of file CSCConditions.cc.

References edm::ESHandleBase::isValid(), and theCrosstalk.

Referenced by CSCRecoConditions::crossTalk().

277  {
278  assert(theCrosstalk.isValid());
279  const CSCDBCrosstalk::Item & item = theCrosstalk->item(id, channel);
280  ct[0] = float ( item.xtalk_slope_left )/theCrosstalk->factor_slope;
281  ct[1] = float ( item.xtalk_intercept_left )/theCrosstalk->factor_intercept;
282  ct[2] = float ( item.xtalk_slope_right )/theCrosstalk->factor_slope;
283  ct[3] = float ( item.xtalk_intercept_right )/theCrosstalk->factor_intercept;
284 }
edm::ESHandle< CSCDBCrosstalk > theCrosstalk
bool isValid() const
Definition: ESHandle.h:37
float CSCConditions::crosstalkIntercept ( const CSCDetId detId,
int  channel,
bool  leftRight 
) const

Definition at line 233 of file CSCConditions.cc.

References edm::ESHandleBase::isValid(), and theCrosstalk.

Referenced by CSCDbStripConditions::crosstalk().

234 {
235  assert(theCrosstalk.isValid());
236  const CSCDBCrosstalk::Item & item = theCrosstalk->item(detId, channel);
237 
238  // resistive fraction is at the peak, where t=0
239  return leftRight ? float ( item.xtalk_intercept_right )/theCrosstalk->factor_intercept
240  : float ( item.xtalk_intercept_left )/theCrosstalk->factor_intercept ;
241 }
edm::ESHandle< CSCDBCrosstalk > theCrosstalk
bool isValid() const
Definition: ESHandle.h:37
float CSCConditions::crosstalkSlope ( const CSCDetId detId,
int  channel,
bool  leftRight 
) const

Definition at line 244 of file CSCConditions.cc.

References edm::ESHandleBase::isValid(), and theCrosstalk.

Referenced by CSCDbStripConditions::crosstalk().

245 {
246  assert(theCrosstalk.isValid());
247  const CSCDBCrosstalk::Item & item = theCrosstalk->item(detId, channel);
248 
249  // resistive fraction is at the peak, where t=0
250  return leftRight ? float ( item.xtalk_slope_right )/theCrosstalk->factor_slope
251  : float ( item.xtalk_slope_left )/theCrosstalk->factor_slope ;
252 }
edm::ESHandle< CSCDBCrosstalk > theCrosstalk
bool isValid() const
Definition: ESHandle.h:37
void CSCConditions::fillBadStripWords ( )

fill bad channel words

Definition at line 100 of file CSCConditions.cc.

References badStripWords, CSCIndexer::detIdFromChamberIndex(), Reference_intrackfit_cff::endcap, i, j, CSCIndexer::layerIndex(), MAX_LAYERS, readBadChannels(), relativeConstraints::ring, errorMatrix2Lands_multiChannel::start, relativeConstraints::station, and theBadStrips.

Referenced by initializeEvent().

100  {
101  // reset existing values
102  badStripWords.assign( MAX_LAYERS, 0 );
103  if ( readBadChannels() ) {
104  // unpack what we've read from theBadStrips
105 
106  // chambers is a vector<BadChamber>
107  // channels is a vector<BadChannel>
108  // Each BadChamber contains its index (1-468 or 540 w. ME42), the no. of bad channels,
109  // and the index within vector<BadChannel> where this chamber's bad channels start.
110 
111  CSCIndexer indexer;
112 
113  for ( size_t i=0; i<theBadStrips->chambers.size(); ++i ) { // loop over bad chambers
114  int indexc = theBadStrips->chambers[i].chamber_index;
115  int start = theBadStrips->chambers[i].pointer; // where this chamber's bad channels start in vector<BadChannel>
116  int nbad = theBadStrips->chambers[i].bad_channels;
117 
118  CSCDetId id = indexer.detIdFromChamberIndex( indexc ); // We need this to build layer index (1-2808)
119 
120  for ( int j=start-1; j<start-1+nbad; ++j ) { // bad channels in this chamber
121  short lay = theBadStrips->channels[j].layer; // value 1-6
122  short chan = theBadStrips->channels[j].channel; // value 1-80
123  // short f1 = theBadStrips->channels[j].flag1;
124  // short f2 = theBadStrips->channels[j].flag2;
125  // short f3 = theBadStrips->channels[j].flag3;
126  int indexl = indexer.layerIndex( id.endcap(), id.station(), id.ring(), id.chamber(), lay );
127  badStripWords[indexl-1].set( chan-1, 1 ); // set bit 0-79 in 80-bit bitset representing this layer
128  } // j
129  } // i
130 
131  }
132 }
int i
Definition: DBlmapReader.cc:9
edm::ESHandle< CSCBadStrips > theBadStrips
std::vector< std::bitset< 80 > > badStripWords
bool readBadChannels() const
did we request reading bad channel info from db?
Definition: CSCConditions.h:84
CSCDetId detIdFromChamberIndex(IndexType ici) const
Definition: CSCIndexer.cc:62
int j
Definition: DBlmapReader.cc:9
IndexType layerIndex(const CSCDetId &id) const
Definition: CSCIndexer.h:80
void CSCConditions::fillBadWireWords ( )

Definition at line 134 of file CSCConditions.cc.

References badWireWords, CSCIndexer::detIdFromChamberIndex(), Reference_intrackfit_cff::endcap, i, j, CSCIndexer::layerIndex(), MAX_LAYERS, readBadChannels(), relativeConstraints::ring, errorMatrix2Lands_multiChannel::start, relativeConstraints::station, and theBadWires.

Referenced by initializeEvent().

134  {
135  // reset existing values
136  badWireWords.assign( MAX_LAYERS, 0 );
137  if ( readBadChannels() ) {
138  // unpack what we've read from theBadWires
139  CSCIndexer indexer;
140 
141  for ( size_t i=0; i<theBadWires->chambers.size(); ++i ) { // loop over bad chambers
142  int indexc = theBadWires->chambers[i].chamber_index;
143  int start = theBadWires->chambers[i].pointer; // where this chamber's bad channels start in vector<BadChannel>
144  int nbad = theBadWires->chambers[i].bad_channels;
145 
146  CSCDetId id = indexer.detIdFromChamberIndex( indexc ); // We need this to build layer index (1-2808)
147 
148  for ( int j=start-1; j<start-1+nbad; ++j ) { // bad channels in this chamber
149  short lay = theBadWires->channels[j].layer; // value 1-6
150  short chan = theBadWires->channels[j].channel; // value 1-80
151  // short f1 = theBadWires->channels[j].flag1;
152  // short f2 = theBadWires->channels[j].flag2;
153  // short f3 = theBadWires->channels[j].flag3;
154  int indexl = indexer.layerIndex( id.endcap(), id.station(), id.ring(), id.chamber(), lay );
155  badWireWords[indexl-1].set( chan-1, 1 ); // set bit 0-111 in 112-bit bitset representing this layer
156  } // j
157  } // i
158 
159  }
160 }
int i
Definition: DBlmapReader.cc:9
edm::ESHandle< CSCBadWires > theBadWires
std::vector< std::bitset< 112 > > badWireWords
bool readBadChannels() const
did we request reading bad channel info from db?
Definition: CSCConditions.h:84
CSCDetId detIdFromChamberIndex(IndexType ici) const
Definition: CSCIndexer.cc:62
int j
Definition: DBlmapReader.cc:9
IndexType layerIndex(const CSCDetId &id) const
Definition: CSCIndexer.h:80
float CSCConditions::gain ( const CSCDetId detId,
int  channel 
) const

channels count from 1

Definition at line 212 of file CSCConditions.cc.

References edm::ESHandleBase::isValid(), and theGains.

Referenced by CSCDbStripConditions::gain(), CSCRecoConditions::gain(), and CSCRecoConditions::stripWeight().

213 {
214  assert(theGains.isValid());
215  return float( theGains->item(detId, channel).gain_slope )/theGains->factor_gain;
216 }
edm::ESHandle< CSCDBGains > theGains
bool isValid() const
Definition: ESHandle.h:37
float CSCConditions::gainSigma ( const CSCDetId detId,
int  channel 
) const
inline

total calibration precision

Definition at line 47 of file CSCConditions.h.

47 {return 0.005;}
float CSCConditions::gasGainCorrection ( const CSCDetId detId,
int  strip,
int  wire 
) const

gas gain correction as a function of detId (w/layer), strip, and wire

Definition at line 371 of file CSCConditions.cc.

References edm::ESHandleBase::isValid(), theGasGainCorrections, and useGasGainCorrections().

Referenced by CSCRecoConditions::gasGainCorrection().

372 {
373  if ( useGasGainCorrections() ){
374  assert(theGasGainCorrections.isValid());
375  //printf("CSCCondition e:%d s:%d r:%d c:%d l:%d strip:%d wire:%d\n",detId.endcap(),detId.station(),detId.ring(),detId.chamber(),detId.layer(),strip,wiregroup);
376  return float ( theGasGainCorrections->item(detId,strip,wiregroup).gainCorr );
377 
378  } else {
379  return 1.;
380  }
381 }
edm::ESHandle< CSCDBGasGainCorrection > theGasGainCorrections
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
bool useGasGainCorrections() const
did we request reading gas gain correction info from db?
bool isValid() const
Definition: ESHandle.h:37
void CSCConditions::initializeEvent ( const edm::EventSetup es)

fetch the maps from the database

Definition at line 50 of file CSCConditions.cc.

References edm::ESWatcher< T >::check(), fillBadStripWords(), fillBadWireWords(), gainsWatcher_, edm::EventSetup::get(), readBadChambers(), readBadChannels(), theAverageGain, theBadChambers, theBadStrips, theBadWires, theChamberTimingCorrections, theChipCorrections, theCrosstalk, theGains, theGasGainCorrections, theNoiseMatrix, thePedestals, useGasGainCorrections(), and useTimingCorrections().

Referenced by CSCDbStripConditions::initializeEvent(), and CSCRecoConditions::initializeEvent().

51 {
52  // Strip gains
53  es.get<CSCDBGainsRcd>().get( theGains );
54  // Strip X-talk
55  es.get<CSCDBCrosstalkRcd>().get( theCrosstalk );
56  // Strip pedestals
57  es.get<CSCDBPedestalsRcd>().get( thePedestals );
58  // Strip autocorrelation noise matrix
60 
61  if ( useTimingCorrections()){
62  // Buckeye chip speeds
64  // Cable lengths from chambers to peripheral crate and additional chamber level timing correction
66  }
67 
68  if ( readBadChannels() ) {
69  // Bad strip channels
70  es.get<CSCBadStripsRcd>().get( theBadStrips );
71  // Bad wiregroup channels
72  es.get<CSCBadWiresRcd>().get( theBadWires );
73 
74  //@@ if( badStripsWatcher_.check( es ) ) {
76  //@@ }
77  //@@ if( badWiresWatcher_.check( es ) ) {
79  //@ }
80 
81  }
82 
83  // Has GainsRcd changed?
84  if( gainsWatcher_.check( es ) ) { // Yes...
85  theAverageGain = -1.0; // ...reset, so next access will recalculate it
86  }
87 
88  if ( readBadChambers() ) {
89  // Entire bad chambers
91  }
92 
93  if ( useGasGainCorrections()){
95  }
96 
97 // print();
98 }
edm::ESHandle< CSCDBGasGainCorrection > theGasGainCorrections
edm::ESHandle< CSCDBNoiseMatrix > theNoiseMatrix
edm::ESHandle< CSCBadWires > theBadWires
void fillBadStripWords()
fill bad channel words
edm::ESHandle< CSCChamberTimeCorrections > theChamberTimingCorrections
bool useTimingCorrections() const
did we request reading timing correction info from db?
Definition: CSCConditions.h:90
edm::ESHandle< CSCBadStrips > theBadStrips
edm::ESWatcher< CSCDBGainsRcd > gainsWatcher_
bool readBadChannels() const
did we request reading bad channel info from db?
Definition: CSCConditions.h:84
edm::ESHandle< CSCBadChambers > theBadChambers
edm::ESHandle< CSCDBGains > theGains
void fillBadWireWords()
edm::ESHandle< CSCDBChipSpeedCorrection > theChipCorrections
edm::ESHandle< CSCDBCrosstalk > theCrosstalk
bool readBadChambers() const
did we request reading bad chamber info from db?
Definition: CSCConditions.h:87
const T & get() const
Definition: EventSetup.h:55
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:59
bool useGasGainCorrections() const
did we request reading gas gain correction info from db?
float theAverageGain
edm::ESHandle< CSCDBPedestals > thePedestals
bool CSCConditions::isInBadChamber ( const CSCDetId id) const

Is the gven chamber flagged as bad?

Definition at line 162 of file CSCConditions.cc.

References readBadChambers(), and theBadChambers.

Referenced by CSCDbStripConditions::isInBadChamber().

162  {
163  if ( readBadChambers() ) return theBadChambers->isInBadChamber( id );
164  else return false;
165 }
edm::ESHandle< CSCBadChambers > theBadChambers
bool readBadChambers() const
did we request reading bad chamber info from db?
Definition: CSCConditions.h:87
const CSCDBNoiseMatrix::Item & CSCConditions::noiseMatrix ( const CSCDetId detId,
int  channel 
) const

return raw noise matrix (unscaled short int elements)

Definition at line 254 of file CSCConditions.cc.

References edm::ESHandleBase::isValid(), and theNoiseMatrix.

Referenced by noiseMatrixElements().

255 {
256  assert(theNoiseMatrix.isValid());
257  return theNoiseMatrix->item(detId, channel);
258 }
edm::ESHandle< CSCDBNoiseMatrix > theNoiseMatrix
bool isValid() const
Definition: ESHandle.h:37
void CSCConditions::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)

Definition at line 260 of file CSCConditions.cc.

References noiseMatrix(), and theNoiseMatrix.

Referenced by CSCDbStripConditions::fetchNoisifier(), and CSCRecoConditions::noiseMatrix().

260  {
261  assert(me.size()>11);
262  const CSCDBNoiseMatrix::Item& item = noiseMatrix(id, channel);
263  me[0] = float ( item.elem33 )/theNoiseMatrix->factor_noise;
264  me[1] = float ( item.elem34 )/theNoiseMatrix->factor_noise;
265  me[2] = float ( item.elem35 )/theNoiseMatrix->factor_noise;
266  me[3] = float ( item.elem44 )/theNoiseMatrix->factor_noise;
267  me[4] = float ( item.elem45 )/theNoiseMatrix->factor_noise;
268  me[5] = float ( item.elem46 )/theNoiseMatrix->factor_noise;
269  me[6] = float ( item.elem55 )/theNoiseMatrix->factor_noise;
270  me[7] = float ( item.elem56 )/theNoiseMatrix->factor_noise;
271  me[8] = float ( item.elem57 )/theNoiseMatrix->factor_noise;
272  me[9] = float ( item.elem66 )/theNoiseMatrix->factor_noise;
273  me[10] = float ( item.elem67 )/theNoiseMatrix->factor_noise;
274  me[11] = float ( item.elem77 )/theNoiseMatrix->factor_noise;
275 }
edm::ESHandle< CSCDBNoiseMatrix > theNoiseMatrix
const CSCDBNoiseMatrix::Item & noiseMatrix(const CSCDetId &detId, int channel) const
return raw noise matrix (unscaled short int elements)
float CSCConditions::pedestal ( const CSCDetId detId,
int  channel 
) const

in ADC counts

Definition at line 219 of file CSCConditions.cc.

References edm::ESHandleBase::isValid(), and thePedestals.

Referenced by CSCDbStripConditions::pedestal(), and CSCRecoConditions::pedestal().

220 {
221  assert(thePedestals.isValid());
222  return float ( thePedestals->item(detId, channel).ped )/thePedestals->factor_ped;
223 }
bool isValid() const
Definition: ESHandle.h:37
edm::ESHandle< CSCDBPedestals > thePedestals
float CSCConditions::pedestalSigma ( const CSCDetId detId,
int  channel 
) const

Definition at line 226 of file CSCConditions.cc.

References edm::ESHandleBase::isValid(), and thePedestals.

Referenced by CSCDbStripConditions::pedestalSigma(), and CSCRecoConditions::pedestalSigma().

227 {
228  assert(thePedestals.isValid());
229  return float ( thePedestals->item(detId, channel).rms )/thePedestals->factor_rms;
230 }
bool isValid() const
Definition: ESHandle.h:37
edm::ESHandle< CSCDBPedestals > thePedestals
void CSCConditions::print ( void  ) const

Definition at line 167 of file CSCConditions.cc.

169 {
170 /*
171  std::cout << "SIZES: GAINS: " << theGains->gains.size()
172  << " PEDESTALS: " << thePedestals->pedestals.size()
173  << " NOISES " << theNoiseMatrix->matrix.size() << std::endl;;
174 
175  std::map< int,std::vector<CSCDBGains::Item> >::const_iterator layerGainsItr = theGains->gains.begin(),
176  lastGain = theGains->gains.end();
177  for( ; layerGainsItr != lastGain; ++layerGainsItr)
178  {
179  std::cout << "GAIN " << layerGainsItr->first
180  << " STRIPS " << layerGainsItr->second.size() << " "
181  << layerGainsItr->second[0].gain_slope
182  << " " << layerGainsItr->second[0].gain_intercept << std::endl;
183  }
184 
185  std::map< int,std::vector<CSCDBPedestals::Item> >::const_iterator pedestalItr = thePedestals->pedestals.begin(),
186  lastPedestal = thePedestals->pedestals.end();
187  for( ; pedestalItr != lastPedestal; ++pedestalItr)
188  {
189  std::cout << "PEDS " << pedestalItr->first << " "
190  << " STRIPS " << pedestalItr->second.size() << " ";
191  for(int i = 1; i < 80; ++i)
192  {
193  std::cout << pedestalItr->second[i-1].rms << " " ;
194  }
195  std::cout << std::endl;
196  }
197 
198  std::map< int,std::vector<CSCDBCrosstalk::Item> >::const_iterator crosstalkItr = theCrosstalk->crosstalk.begin(),
199  lastCrosstalk = theCrosstalk->crosstalk.end();
200  for( ; crosstalkItr != lastCrosstalk; ++crosstalkItr)
201  {
202  std::cout << "XTALKS " << crosstalkItr->first
203  << " STRIPS " << crosstalkItr->second.size() << " "
204  << crosstalkItr->second[5].xtalk_slope_left << " "
205  << crosstalkItr->second[5].xtalk_slope_right << " "
206  << crosstalkItr->second[5].xtalk_intercept_left << " "
207  << crosstalkItr->second[5].xtalk_intercept_right << std::endl;
208  }
209 */
210 }
bool CSCConditions::readBadChambers ( ) const
inline

did we request reading bad chamber info from db?

Definition at line 87 of file CSCConditions.h.

References readBadChambers_.

Referenced by initializeEvent(), and isInBadChamber().

87 { return readBadChambers_; }
bool CSCConditions::readBadChannels ( ) const
inline

did we request reading bad channel info from db?

Definition at line 84 of file CSCConditions.h.

References readBadChannels_.

Referenced by fillBadStripWords(), fillBadWireWords(), and initializeEvent().

84 { return readBadChannels_; }
bool CSCConditions::useGasGainCorrections ( ) const
inline

did we request reading gas gain correction info from db?

Definition at line 103 of file CSCConditions.h.

References useGasGainCorrections_.

Referenced by gasGainCorrection(), and initializeEvent().

103 { return useGasGainCorrections_; }
bool useGasGainCorrections_
bool CSCConditions::useTimingCorrections ( ) const
inline

did we request reading timing correction info from db?

Definition at line 90 of file CSCConditions.h.

References useTimingCorrections_.

Referenced by anodeBXoffset(), chamberTimingCorrection(), chipCorrection(), and initializeEvent().

90 { return useTimingCorrections_; }
bool useTimingCorrections_

Member Data Documentation

std::vector< std::bitset<80> > CSCConditions::badStripWords
private

Definition at line 124 of file CSCConditions.h.

Referenced by badStripWord(), CSCConditions(), and fillBadStripWords().

std::vector< std::bitset<112> > CSCConditions::badWireWords
private

Definition at line 125 of file CSCConditions.h.

Referenced by badWireWord(), CSCConditions(), and fillBadWireWords().

edm::ESWatcher<CSCDBGainsRcd> CSCConditions::gainsWatcher_
private

Definition at line 129 of file CSCConditions.h.

Referenced by initializeEvent().

bool CSCConditions::readBadChambers_
private

Definition at line 119 of file CSCConditions.h.

Referenced by CSCConditions(), and readBadChambers().

bool CSCConditions::readBadChannels_
private

Definition at line 118 of file CSCConditions.h.

Referenced by CSCConditions(), and readBadChannels().

float CSCConditions::theAverageGain
mutableprivate

Definition at line 127 of file CSCConditions.h.

Referenced by averageGain(), and initializeEvent().

edm::ESHandle<CSCBadChambers> CSCConditions::theBadChambers
private

Definition at line 113 of file CSCConditions.h.

Referenced by initializeEvent(), and isInBadChamber().

edm::ESHandle<CSCBadStrips> CSCConditions::theBadStrips
private

Definition at line 111 of file CSCConditions.h.

Referenced by fillBadStripWords(), and initializeEvent().

edm::ESHandle<CSCBadWires> CSCConditions::theBadWires
private

Definition at line 112 of file CSCConditions.h.

Referenced by fillBadWireWords(), and initializeEvent().

edm::ESHandle<CSCChamberTimeCorrections> CSCConditions::theChamberTimingCorrections
private

Definition at line 115 of file CSCConditions.h.

Referenced by anodeBXoffset(), chamberTimingCorrection(), and initializeEvent().

edm::ESHandle<CSCDBChipSpeedCorrection> CSCConditions::theChipCorrections
private

Definition at line 114 of file CSCConditions.h.

Referenced by chipCorrection(), and initializeEvent().

edm::ESHandle<CSCDBCrosstalk> CSCConditions::theCrosstalk
private

Definition at line 108 of file CSCConditions.h.

Referenced by crossTalk(), crosstalkIntercept(), crosstalkSlope(), and initializeEvent().

edm::ESHandle<CSCDBGains> CSCConditions::theGains
private

Definition at line 107 of file CSCConditions.h.

Referenced by averageGain(), gain(), and initializeEvent().

edm::ESHandle<CSCDBGasGainCorrection> CSCConditions::theGasGainCorrections
private

Definition at line 116 of file CSCConditions.h.

Referenced by gasGainCorrection(), and initializeEvent().

edm::ESHandle<CSCDBNoiseMatrix> CSCConditions::theNoiseMatrix
private

Definition at line 110 of file CSCConditions.h.

Referenced by initializeEvent(), noiseMatrix(), and noiseMatrixElements().

edm::ESHandle<CSCDBPedestals> CSCConditions::thePedestals
private

Definition at line 109 of file CSCConditions.h.

Referenced by initializeEvent(), pedestal(), and pedestalSigma().

bool CSCConditions::useGasGainCorrections_
private

Definition at line 121 of file CSCConditions.h.

Referenced by CSCConditions(), and useGasGainCorrections().

bool CSCConditions::useTimingCorrections_
private

Definition at line 120 of file CSCConditions.h.

Referenced by CSCConditions(), and useTimingCorrections().