CMS 3D CMS Logo

SiStripClusterizerConditions.h
Go to the documentation of this file.
1 #ifndef CalibFormats_SiStripObjects_StripClusterizerConditions_h
2 #define CalibFormats_SiStripObjects_StripClusterizerConditions_h
3 
7 
12 public:
13  static constexpr unsigned short invalidI = std::numeric_limits<unsigned short>::max();
14 
15  struct Det {
16  bool valid() const { return ind != invalidI; }
17  uint16_t rawNoise(const uint16_t strip) const { return SiStripNoises::getRawNoise(strip, noiseRange); }
18  float noise(const uint16_t strip) const { return SiStripNoises::getNoise(strip, noiseRange); }
19  float weight(const uint16_t strip) const { return m_weight[strip / 128]; }
20  bool bad(const uint16_t strip) const { return quality->IsStripBad(qualityRange, strip); }
21  bool allBadBetween(uint16_t L, const uint16_t& R) const {
22  while (++L < R && bad(L)) {
23  };
24  return L == R;
25  }
29  float m_weight[6];
30  uint32_t detId = 0;
31  unsigned short ind = invalidI;
32  };
33 
35 
36  std::vector<uint32_t> const& allDetIds() const { return m_detIds; }
37  auto const& allDets() const { return m_dets; }
38 
39  std::vector<const FedChannelConnection*> const& currentConnection(const Det& det) const {
40  return m_connections[det.ind];
41  }
42 
43  Det const& findDetId(const uint32_t id) const {
44  auto b = m_detIds.begin();
45  auto e = m_detIds.end();
46  auto p = std::lower_bound(b, e, id);
47  if (p == e || id != (*p)) {
48 #ifdef NOT_ON_MONTECARLO
49  edm::LogWarning("StripClusterizerAlgorithm")
50  << "id " << id << " not connected. this is impossible on data " << std::endl;
51 #endif
52  static const Det dummy = Det();
53  return dummy;
54  }
55  return m_dets[p - m_detIds.begin()];
56  }
57  bool isModuleBad(const uint32_t id) const { return m_quality->IsModuleBad(id); }
58  bool isModuleUsable(const uint32_t id) const { return m_quality->IsModuleUsable(id); }
59 
60  void reserve(std::size_t length) {
61  m_detIds.reserve(length);
62  m_dets.reserve(length);
63  m_connections.reserve(length);
64  }
65  void emplace_back(uint32_t id,
66  SiStripQuality::Range qualityRange,
67  SiStripNoises::Range noiseRange,
68  const std::vector<float>& invGains,
69  const std::vector<const FedChannelConnection*>& connections) {
70  const unsigned short index = m_detIds.size();
71  m_detIds.push_back(id);
72  auto& det = m_dets.emplace_back();
73  det.quality = m_quality;
74  det.qualityRange = qualityRange;
75  det.noiseRange = noiseRange;
76  for (uint32_t i = 0; i != invGains.size(); ++i) {
77  det.m_weight[i] = invGains[i];
78  }
79  det.detId = id;
80  det.ind = index;
81  m_connections.push_back(connections);
82  }
83 
84 private:
86  std::vector<uint32_t> m_detIds;
87  std::vector<Det> m_dets;
88  std::vector<std::vector<const FedChannelConnection*>> m_connections;
89 };
90 
91 #endif // CalibFormats_SiStripObjects_StripClusterizerConditions_h
SiStripClusterizerConditions::Det::quality
SiStripQuality const * quality
Definition: SiStripClusterizerConditions.h:26
dttmaxenums::L
Definition: DTTMax.h:29
mps_fire.i
i
Definition: mps_fire.py:428
SiStripClusterizerConditions::Det::detId
uint32_t detId
Definition: SiStripClusterizerConditions.h:30
SiStripClusterizerConditions::isModuleBad
bool isModuleBad(const uint32_t id) const
Definition: SiStripClusterizerConditions.h:57
SiStripClusterizerConditions::Det::noiseRange
SiStripNoises::Range noiseRange
Definition: SiStripClusterizerConditions.h:27
SiStripClusterizerConditions::m_connections
std::vector< std::vector< const FedChannelConnection * > > m_connections
Definition: SiStripClusterizerConditions.h:88
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
SiStripQuality::IsModuleBad
bool IsModuleBad(const uint32_t &detid) const
Definition: SiStripQuality.cc:599
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
SiStripQuality::IsModuleUsable
bool IsModuleUsable(const uint32_t &detid) const
Definition: SiStripQuality.cc:585
SiStripClusterizerConditions
Definition: SiStripClusterizerConditions.h:11
SiStripClusterizerConditions::SiStripClusterizerConditions
SiStripClusterizerConditions(const SiStripQuality *quality)
Definition: SiStripClusterizerConditions.h:34
SiStripNoises.h
SiStripClusterizerConditions::Det::qualityRange
SiStripQuality::Range qualityRange
Definition: SiStripClusterizerConditions.h:28
SiStripClusterizerConditions::findDetId
Det const & findDetId(const uint32_t id) const
Definition: SiStripClusterizerConditions.h:43
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
SiStripClusterizerConditions::Det::allBadBetween
bool allBadBetween(uint16_t L, const uint16_t &R) const
Definition: SiStripClusterizerConditions.h:21
SiStripClusterizerConditions::isModuleUsable
bool isModuleUsable(const uint32_t id) const
Definition: SiStripClusterizerConditions.h:58
SiStripClusterizerConditions::Det::valid
bool valid() const
Definition: SiStripClusterizerConditions.h:16
SiStripClusterizerConditions::currentConnection
std::vector< const FedChannelConnection * > const & currentConnection(const Det &det) const
Definition: SiStripClusterizerConditions.h:39
SiStripClusterizerConditions::Det::noise
float noise(const uint16_t strip) const
Definition: SiStripClusterizerConditions.h:18
quality
const uint32_t *__restrict__ Quality * quality
Definition: CAHitNtupletGeneratorKernelsImpl.h:109
SiStripClusterizerConditions::Det::m_weight
float m_weight[6]
Definition: SiStripClusterizerConditions.h:29
SiStripClusterizerConditions::invalidI
static constexpr unsigned short invalidI
Definition: SiStripClusterizerConditions.h:13
SiStripBadStrip::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripBadStrip.h:53
SiStripClusterizerConditions::m_detIds
std::vector< uint32_t > m_detIds
Definition: SiStripClusterizerConditions.h:86
SiStripNoises::getRawNoise
static float getRawNoise(const uint16_t &strip, const Range &range)
Definition: SiStripNoises.h:66
SiStripNoises::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:47
b
double b
Definition: hdecay.h:118
SiStripQuality::IsStripBad
bool IsStripBad(const uint32_t &detid, const short &strip) const
Definition: SiStripQuality.cc:623
pfDeepBoostedJetPreprocessParams_cfi.lower_bound
lower_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:15
SiStripClusterizerConditions::m_quality
const SiStripQuality * m_quality
Definition: SiStripClusterizerConditions.h:85
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
SiStripClusterizerConditions::allDets
auto const & allDets() const
Definition: SiStripClusterizerConditions.h:37
Det
GeometricSearchDet Det
Definition: DetBelowR.h:8
SiStripClusterizerConditions::Det::bad
bool bad(const uint16_t strip) const
Definition: SiStripClusterizerConditions.h:20
SiStripClusterizerConditions::reserve
void reserve(std::size_t length)
Definition: SiStripClusterizerConditions.h:60
SiStripClusterizerConditions::Det::ind
unsigned short ind
Definition: SiStripClusterizerConditions.h:31
SiStripClusterizerConditions::Det::weight
float weight(const uint16_t strip) const
Definition: SiStripClusterizerConditions.h:19
SiStripClusterizerConditions::m_dets
std::vector< Det > m_dets
Definition: SiStripClusterizerConditions.h:87
FedChannelConnection.h
SiStripClusterizerConditions::emplace_back
void emplace_back(uint32_t id, SiStripQuality::Range qualityRange, SiStripNoises::Range noiseRange, const std::vector< float > &invGains, const std::vector< const FedChannelConnection * > &connections)
Definition: SiStripClusterizerConditions.h:65
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
SiStripClusterizerConditions::Det::rawNoise
uint16_t rawNoise(const uint16_t strip) const
Definition: SiStripClusterizerConditions.h:17
SiStripQuality.h
SiStripClusterizerConditions::Det
Definition: SiStripClusterizerConditions.h:15
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
dummy
Definition: DummySelector.h:38
SiStripNoises::getNoise
static float getNoise(uint16_t strip, const Range &range)
Definition: SiStripNoises.h:73
dttmaxenums::R
Definition: DTTMax.h:29
SiStripClusterizerConditions::allDetIds
std::vector< uint32_t > const & allDetIds() const
Definition: SiStripClusterizerConditions.h:36
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
SiStripQuality
Definition: SiStripQuality.h:32