CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
CSCRecoConditions Class Reference

#include <CSCRecoConditions.h>

Public Member Functions

float anodeBXoffset (const CSCDetId &detId) const
 
float averageGain () const
 return average gain over entire CSC system More...
 
bool badStrip (const CSCDetId &id, int geomStrip, int nstrips) const
 Is the strip bad? More...
 
const std::bitset< 112 > & badWireWord (const CSCDetId &id) const
 Get bad wiregroup word. More...
 
float chamberTimingCorrection (const CSCDetId &id) const
 
float chipCorrection (const CSCDetId &detId, int channel) const
 All other functions are accessed by geometrical strip label (i.e. strip number according to local coordinates) More...
 
void crossTalk (const CSCDetId &id, int centralStrip, std::vector< float > &xtalks) const
 
 CSCRecoConditions (const edm::ParameterSet &pset, edm::ConsumesCollector)
 
void fillBadChannelWords (const CSCDetId &id)
 fill bad strip & bad wiregroup bitsets from conditions data More...
 
float gain (const CSCDetId &id, int geomStrip) const
 channels and geomstrips count from 1 More...
 
float gasGainCorrection (const CSCDetId &id, int strip, int wireGroup) const
 returns gas-gain correction More...
 
void initializeEvent (const edm::EventSetup &es)
 fetch the cond data from the database More...
 
bool nearBadStrip (const CSCDetId &id, int geomStrip, int nstrips) const
 Is a neighbour bad? More...
 
void noiseMatrix (const CSCDetId &id, int centralStrip, std::vector< float > &nme) const
 
float pedestal (const CSCDetId &id, int channel) const
 static pedestal in ADC counts for strip channel (e.g. 1-16 for ganged ME1a, 1-48 for unganged ME1a) More...
 
float pedestalSigma (const CSCDetId &id, int channel) const
 sigma of static pedestal in ADC counts for strip channel (e.g. 1-16 for ganged ME1a, 1-48 for unganged ME1a) More...
 
void stripWeights (const CSCDetId &id, short int nstrips, float *weights) const
 
 ~CSCRecoConditions ()
 

Private Member Functions

float stripWeight (const CSCDetId &id, int geomStrip) const
 return gain weight for given strip channel More...
 

Private Attributes

CSCConditions theConditions
 

Detailed Description

Wrap CSCConditions class for use in CSC local reconstruction, in analogy with wrapper classes Rick uses in CSCDigitizer.

CSCConditions encapsulates the conditions data (e.g. calibration data) from the database and presents it as CSCRecHitD requires (and that is somewhat historical!)

All functions in public interface accept CSCDetId for ME1A (i.e. ring 4) with channel number 1-16 (and not the raw ME11 channel 65-80).

Author
Tim Cox - UC Davis

Definition at line 25 of file CSCRecoConditions.h.

Constructor & Destructor Documentation

◆ CSCRecoConditions()

CSCRecoConditions::CSCRecoConditions ( const edm::ParameterSet pset,
edm::ConsumesCollector  cc 
)
explicit

Definition at line 6 of file CSCRecoConditions.cc.

6 : theConditions(ps, cc) {}

◆ ~CSCRecoConditions()

CSCRecoConditions::~CSCRecoConditions ( )

Definition at line 8 of file CSCRecoConditions.cc.

8 {}

Member Function Documentation

◆ anodeBXoffset()

float CSCRecoConditions::anodeBXoffset ( const CSCDetId detId) const

Definition at line 168 of file CSCRecoConditions.cc.

168 { return theConditions.anodeBXoffset(id); }

References CSCConditions::anodeBXoffset(), and theConditions.

Referenced by CSCMake2DRecHit::findWireBx().

◆ averageGain()

float CSCRecoConditions::averageGain ( ) const
inline

return average gain over entire CSC system

Definition at line 40 of file CSCRecoConditions.h.

40 { return theConditions.averageGain(); }

References CSCConditions::averageGain(), and theConditions.

Referenced by stripWeight().

◆ badStrip()

bool CSCRecoConditions::badStrip ( const CSCDetId id,
int  geomStrip,
int  nstrips 
) const

Is the strip bad?

Is strip itself a bad strip?

Definition at line 138 of file CSCRecoConditions.cc.

138  {
139  // input nstrips is no. of strips in the layer (could get this from CSCChamberSpecs or CSCLayerGeometry
140  // but then need a CSCLayer*)
141 
142  bool bad = true; // if geomStrip out of range, call strip bad
143 
144  if (id != theConditions.idOfBadChannelWords()) {
145  bad = false; // if bad channel words for this id not filled, call strip good
146  return bad;
147  }
148 
149  if (geomStrip > 0 && geomStrip <= nstrips) {
150  bad = false; // default to good
151  int geomChan = theConditions.channelFromStrip(id, geomStrip);
152  int rawChan = theConditions.rawStripChannel(id, geomChan);
153  if (rawChan > 0 && rawChan < 113) {
154  const std::bitset<112>& badStrips = theConditions.badStripWord();
155  bad = badStrips.test(rawChan - 1); // 112 bits max, labelled 0-111.
156  }
157  }
158  return bad;
159 }

References CSCConditions::badStripWord(), CSCConditions::channelFromStrip(), CSCConditions::idOfBadChannelWords(), CSCConditions::rawStripChannel(), and theConditions.

Referenced by CSCRecoBadChannelsAnalyzer::analyze(), CSCHitFromStripOnly::isDeadStrip(), and nearBadStrip().

◆ badWireWord()

const std::bitset< 112 > & CSCRecoConditions::badWireWord ( const CSCDetId id) const

Get bad wiregroup word.

Definition at line 162 of file CSCRecoConditions.cc.

162 { return theConditions.badWireWord(); }

References CSCConditions::badWireWord(), and theConditions.

Referenced by CSCHitFromWireOnly::isDeadWG().

◆ chamberTimingCorrection()

float CSCRecoConditions::chamberTimingCorrection ( const CSCDetId id) const

Definition at line 164 of file CSCRecoConditions.cc.

164  {
166 }

References CSCConditions::chamberTimingCorrection(), and theConditions.

Referenced by CSCMake2DRecHit::hitFromStripAndWire().

◆ chipCorrection()

float CSCRecoConditions::chipCorrection ( const CSCDetId detId,
int  channel 
) const

All other functions are accessed by geometrical strip label (i.e. strip number according to local coordinates)

Definition at line 36 of file CSCRecoConditions.cc.

36  {
37  // geometric strip to geometric channel (e.g. ME1a, 1-48->1-16 ganged or 1-48 unganged)
38  int geomChannel = theConditions.channelFromStrip(id, geomStrip);
39  return theConditions.chipCorrection(id, geomChannel);
40 }

References CSCConditions::channelFromStrip(), CSCConditions::chipCorrection(), and theConditions.

Referenced by CSCMake2DRecHit::hitFromStripAndWire().

◆ crossTalk()

void CSCRecoConditions::crossTalk ( const CSCDetId id,
int  centralStrip,
std::vector< float > &  xtalks 
) const

fill crosstalk information for 3 neighbouring strips as linear vector (must be allocated by caller) Note that centralStrip is a 'geomStrip' and e.g. always ranges 1-48 in ME1a.

Definition at line 115 of file CSCRecoConditions.cc.

115  {
116  // xtalks will be filled with crosstalk for geomStrip and its immediate neighbours
117 
118  xtalks.clear();
119 
120  for (short int i = geomStrip - 1; i < geomStrip + 2; ++i) {
121  int geomChannel = theConditions.channelFromStrip(id, i);
122  std::vector<float> ct(4);
123  theConditions.crossTalk(id, geomChannel, ct);
124  xtalks.push_back(ct[0]);
125  xtalks.push_back(ct[1]);
126  xtalks.push_back(ct[2]);
127  xtalks.push_back(ct[3]);
128  }
129 }

References CSCConditions::channelFromStrip(), CSCConditions::crossTalk(), mps_fire::i, and theConditions.

Referenced by CSCXonStrip_MatchGatti::findXOnStrip().

◆ fillBadChannelWords()

void CSCRecoConditions::fillBadChannelWords ( const CSCDetId id)

fill bad strip & bad wiregroup bitsets from conditions data

Fill badStrip word and badWire word for given CSC layer, id.

Definition at line 13 of file CSCRecoConditions.cc.

References CSCConditions::fillBadChannelWords(), and theConditions.

Referenced by CSCRecoBadChannelsAnalyzer::analyze(), and CSCRecHitDBuilder::build().

◆ gain()

float CSCRecoConditions::gain ( const CSCDetId id,
int  geomStrip 
) const

channels and geomstrips count from 1

return gain for given strip

Definition at line 28 of file CSCRecoConditions.cc.

28  {
29  LogTrace("CSCRecoConditions") << id << " geomChannel " << geomChannel << " gain "
30  << theConditions.gain(id, geomChannel);
31  return theConditions.gain(id, geomChannel);
32 }

References CSCConditions::gain(), LogTrace, and theConditions.

Referenced by stripWeight().

◆ gasGainCorrection()

float CSCRecoConditions::gasGainCorrection ( const CSCDetId id,
int  strip,
int  wireGroup 
) const

returns gas-gain correction

Definition at line 170 of file CSCRecoConditions.cc.

170  {
171  int geomChannel = theConditions.channelFromStrip(id, geomStrip);
172  return theConditions.gasGainCorrection(id, geomChannel, wiregroup);
173 }

References CSCConditions::channelFromStrip(), CSCConditions::gasGainCorrection(), and theConditions.

Referenced by CSCMake2DRecHit::hitFromStripAndWire().

◆ initializeEvent()

void CSCRecoConditions::initializeEvent ( const edm::EventSetup es)

fetch the cond data from the database

Definition at line 10 of file CSCRecoConditions.cc.

References CSCConditions::initializeEvent(), and theConditions.

Referenced by CSCRecoBadChannelsAnalyzer::analyze(), and CSCRecHitDProducer::produce().

◆ nearBadStrip()

bool CSCRecoConditions::nearBadStrip ( const CSCDetId id,
int  geomStrip,
int  nstrips 
) const

Is a neighbour bad?

Is an immediate neighbour a bad strip?

Definition at line 132 of file CSCRecoConditions.cc.

132  {
133  bool nearBad = (badStrip(id, geomStrip - 1, nstrips) || badStrip(id, geomStrip + 1, nstrips));
134  return nearBad;
135 }

References badStrip().

Referenced by CSCRecoBadChannelsAnalyzer::analyze(), and CSCHitFromStripOnly::isNearDeadStrip().

◆ noiseMatrix()

void CSCRecoConditions::noiseMatrix ( const CSCDetId id,
int  centralStrip,
std::vector< float > &  nme 
) const

fill expanded noise matrix for 3 neighbouring strips as linear vector (must be allocated by caller) Note that centralStrip is a 'geomStrip' and ranges 1-48 in ME1a.

Definition at line 68 of file CSCRecoConditions.cc.

68  {
69  // nMatrix will be filled with expanded noise matrix elements for strip 'geomStrip' and its immediate neighbours
70 
71  nMatrix.clear();
72 
73  // These are ME1/2 constants as fall-back
74  const float fakeme12[15] = {8.64, 3.47, 2.45, 8.60, 3.28, 1.88, 8.61, 3.18, 1.99, 7.67, 2.64, 0., 7.71, 0., 0.};
75 
76  float elem[15];
77 
78  for (short int i = geomStrip - 1; i < geomStrip + 2; ++i) {
79  std::vector<float> me(12);
80 
81  float w = stripWeight(id, i);
82  w = w * w;
83  int geomChannel = theConditions.channelFromStrip(id, i);
84  theConditions.noiseMatrixElements(id, geomChannel, me);
85  for (short int j = 0; j < 11; ++j) {
86  elem[j] = me[j] * w;
87  }
88  elem[11] = 0.;
89  elem[12] = me[11] * w;
90  elem[13] = 0.;
91  elem[14] = 0.;
92 
93  // Test that elements make sense:
94  bool isFlawed = false;
95  for (short int k = 0; k < 15; ++k) {
96  if (elem[k] < 0.001)
97  elem[k] = 0.001; // fix if too small...
98  if (elem[k] > 50.)
99  isFlawed = true; // fail if too big...
100  }
101 
102  if (isFlawed) {
103  // These are fake ME1/2:
104  for (short int m = 0; m < 15; ++m) {
105  elem[m] = fakeme12[m];
106  }
107  }
108 
109  for (int k = 0; k < 15; ++k) {
110  nMatrix.push_back(elem[k]);
111  }
112  }
113 }

References CSCConditions::channelFromStrip(), mps_fire::i, dqmiolumiharvest::j, dqmdumpme::k, visualization-live-secondInstance_cfg::m, hlt_dqm_clientPB-live_cfg::me, CSCConditions::noiseMatrixElements(), stripWeight(), theConditions, and w.

Referenced by CSCXonStrip_MatchGatti::findXOnStrip().

◆ pedestal()

float CSCRecoConditions::pedestal ( const CSCDetId id,
int  geomChannel 
) const

static pedestal in ADC counts for strip channel (e.g. 1-16 for ganged ME1a, 1-48 for unganged ME1a)

gains & pedestals are requested by geometric channel (as in CSCStripDigi- e.g. 1-16 for ganged ME1a, and with any readout flips already removed)

Definition at line 18 of file CSCRecoConditions.cc.

18  {
19  LogTrace("CSCRecoConditions") << id << " geomChannel " << geomChannel << " pedestal "
20  << theConditions.pedestal(id, geomChannel);
21  return theConditions.pedestal(id, geomChannel);
22 }

References LogTrace, CSCConditions::pedestal(), and theConditions.

◆ pedestalSigma()

float CSCRecoConditions::pedestalSigma ( const CSCDetId id,
int  channel 
) const

sigma of static pedestal in ADC counts for strip channel (e.g. 1-16 for ganged ME1a, 1-48 for unganged ME1a)

Definition at line 24 of file CSCRecoConditions.cc.

24  {
25  return theConditions.pedestalSigma(id, geomChannel);
26 }

References CSCConditions::pedestalSigma(), and theConditions.

◆ stripWeight()

float CSCRecoConditions::stripWeight ( const CSCDetId id,
int  geomStrip 
) const
private

return gain weight for given strip channel

Definition at line 56 of file CSCRecoConditions.cc.

56  {
57  int geomChannel = theConditions.channelFromStrip(id, geomStrip);
58  float w = averageGain() / gain(id, geomChannel); // averageGain() from CSCConditions
59  // Weights are forced to lie within 0.5 and 1.5
60  if (w > 1.5)
61  w = 1.5;
62  if (w < 0.5)
63  w = 0.5;
64  LogTrace("CSCRecoConditions") << id << " geomStrip " << geomStrip << " stripWeight " << w;
65  return w;
66 }

References averageGain(), CSCConditions::channelFromStrip(), gain(), LogTrace, theConditions, and w.

Referenced by noiseMatrix(), and stripWeights().

◆ stripWeights()

void CSCRecoConditions::stripWeights ( const CSCDetId id,
short int  nstrips,
float *  weights 
) const

calculate gain weights for all strips in a CSC layer (total in layer = nstrips) this is averageGain()/gain for each strip filled into a C-array which caller must have allocated. values are constrained to be in [0.5, 1.5]

Definition at line 47 of file CSCRecoConditions.cc.

47  {
48  for (short int i = 1; i < nstrips + 1; ++i) {
49  weights[i - 1] = stripWeight(id, i);
50  }
51 }

References mps_fire::i, stripWeight(), and HLT_FULL_cff::weights.

Referenced by CSCHitFromStripOnly::runStrip().

Member Data Documentation

◆ theConditions

CSCConditions CSCRecoConditions::theConditions
private
mps_fire.i
i
Definition: mps_fire.py:428
pixelTrack::Quality::bad
CSCConditions::idOfBadChannelWords
const CSCDetId & idOfBadChannelWords() const
the offline CSCDetId of current bad channel words
Definition: CSCConditions.h:108
CSCRecoConditions::gain
float gain(const CSCDetId &id, int geomStrip) const
channels and geomstrips count from 1
Definition: CSCRecoConditions.cc:28
CSCRecoConditions::averageGain
float averageGain() const
return average gain over entire CSC system
Definition: CSCRecoConditions.h:40
CSCConditions::pedestal
float pedestal(const CSCDetId &detId, int channel) const
static ped in ADC counts
Definition: CSCConditions.cc:245
CSCConditions::channelFromStrip
int channelFromStrip(const CSCDetId &id, int geomStrip) const
feedthrough for external access
Definition: CSCConditions.cc:410
CSCConditions::fillBadChannelWords
void fillBadChannelWords(const CSCDetId &id)
Definition: CSCConditions.cc:127
CSCConditions::gain
float gain(const CSCDetId &detId, int channel) const
gain per channel
Definition: CSCConditions.cc:237
CSCConditions::noiseMatrixElements
void noiseMatrixElements(const CSCDetId &id, int channel, std::vector< float > &me) const
Definition: CSCConditions.cc:293
CSCConditions::badWireWord
const std::bitset< 112 > & badWireWord() const
bad wiregroup channel word for a CSCLayer - 1 bit per channel
Definition: CSCConditions.h:105
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
w
const double w
Definition: UKUtility.cc:23
HLT_FULL_cff.weights
weights
Definition: HLT_FULL_cff.py:99207
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:78
dqmdumpme.k
k
Definition: dqmdumpme.py:60
CSCRecoConditions::stripWeight
float stripWeight(const CSCDetId &id, int geomStrip) const
return gain weight for given strip channel
Definition: CSCRecoConditions.cc:56
CSCRecoConditions::badStrip
bool badStrip(const CSCDetId &id, int geomStrip, int nstrips) const
Is the strip bad?
Definition: CSCRecoConditions.cc:138
CSCConditions::gasGainCorrection
float gasGainCorrection(const CSCDetId &detId, int strip, int wire) const
Definition: CSCConditions.cc:398
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
CSCRecoConditions::theConditions
CSCConditions theConditions
Definition: CSCRecoConditions.h:90
CSCConditions::rawStripChannel
int rawStripChannel(const CSCDetId &id, int geomChannel) const
Definition: CSCConditions.cc:414
CSCConditions::initializeEvent
void initializeEvent(const edm::EventSetup &es)
fetch database content via EventSetup
Definition: CSCConditions.cc:74
cc
CSCConditions::pedestalSigma
float pedestalSigma(const CSCDetId &detId, int channel) const
static ped rms in ADC counts
Definition: CSCConditions.cc:253
CSCConditions::chamberTimingCorrection
float chamberTimingCorrection(const CSCDetId &detId) const
chamber timing correction in ns given detId of chamber
Definition: CSCConditions.cc:333
CSCConditions::badStripWord
const std::bitset< 112 > & badStripWord() const
bad strip channel word for a CSCLayer - 1 bit per channel
Definition: CSCConditions.h:102
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
CSCConditions::crossTalk
void crossTalk(const CSCDetId &id, int channel, std::vector< float > &ct) const
Definition: CSCConditions.cc:310