CMS 3D CMS Logo

SiStripApvGain.h
Go to the documentation of this file.
1 #ifndef SiStripApvGain_h
2 #define SiStripApvGain_h
3 
5 
6 #include <vector>
7 #include <map>
8 #include <iostream>
10 #include <cstdint>
11 
12 class TrackerTopology;
13 
26 public:
27  typedef std::vector<float>::const_iterator ContainerIterator;
28  typedef std::pair<ContainerIterator, ContainerIterator> Range;
29  typedef std::vector<unsigned int> Registry;
30  typedef Registry::iterator RegistryIterator;
31  typedef Registry::const_iterator RegistryConstIterator;
32  typedef std::vector<float> InputVector;
33 
43 
45  return v_begin + *(ibegin_begin + (idet - detid_begin));
46  }
48  return v_begin + *(iend_begin + (idet - detid_begin));
49  }
50  };
51 
54 
57  p.detid_begin = v_detids.begin();
58  p.detid_end = v_detids.end();
59  p.ibegin_begin = v_ibegin.begin();
60  p.ibegin_end = v_ibegin.end();
61  p.iend_begin = v_iend.begin();
62  p.iend_end = v_iend.end();
63  p.v_begin = v_gains.begin();
64  p.v_end = v_gains.end();
65 
66  return p;
67  }
68 
69  bool put(const uint32_t& detID, Range input);
70  const Range getRange(const uint32_t detID) const;
71  Range getRangeByPos(unsigned short pos) const;
72  void getDetIds(std::vector<uint32_t>& DetIds_) const;
73 
74 #ifdef EDM_ML_DEBUG
75  static float getStripGain(const uint16_t& strip, const Range& range);
76  static float getApvGain(const uint16_t& apv, const Range& range);
77 #else
78  static float getStripGain(uint16_t strip, const Range& range) {
79  uint16_t apv = strip / 128;
80  return *(range.first + apv);
81  }
82  static float getApvGain(uint16_t apv, const Range& range) { return *(range.first + apv); }
83 #endif
84 
85  void printDebug(std::stringstream& ss, const TrackerTopology* trackerTopo) const;
86  void printSummary(std::stringstream& ss, const TrackerTopology* trackerTopo) const;
87 
88 private:
89  std::vector<float> v_gains;
90  std::vector<unsigned int> v_detids;
91  std::vector<unsigned int> v_ibegin;
92  std::vector<unsigned int> v_iend;
93 
95 };
96 
97 #endif
SiStripApvGain::RegistryPointers::getLastElement
ContainerIterator getLastElement(RegistryConstIterator &idet)
Definition: SiStripApvGain.h:47
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
SiStripApvGain::RegistryPointers::getFirstElement
ContainerIterator getFirstElement(RegistryConstIterator &idet)
Definition: SiStripApvGain.h:44
SiStripApvGain::RegistryPointers
Definition: SiStripApvGain.h:34
input
static const std::string input
Definition: EdmProvDump.cc:48
MessageLogger.h
SiStripApvGain::getStripGain
static float getStripGain(uint16_t strip, const Range &range)
Definition: SiStripApvGain.h:78
SiStripApvGain::v_iend
std::vector< unsigned int > v_iend
Definition: SiStripApvGain.h:92
SiStripApvGain::SiStripApvGain
SiStripApvGain()
Definition: SiStripApvGain.h:52
TrackerTopology
Definition: TrackerTopology.h:16
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
SiStripApvGain::printSummary
void printSummary(std::stringstream &ss, const TrackerTopology *trackerTopo) const
Definition: SiStripApvGain.cc:99
pos
Definition: PixelAliasList.h:18
SiStripApvGain::RegistryPointers::detid_begin
RegistryConstIterator detid_begin
Definition: SiStripApvGain.h:35
COND_SERIALIZABLE
#define COND_SERIALIZABLE
Definition: Serializable.h:39
SiStripApvGain::v_ibegin
std::vector< unsigned int > v_ibegin
Definition: SiStripApvGain.h:91
SiStripApvGain::RegistryPointers::ibegin_end
RegistryConstIterator ibegin_end
Definition: SiStripApvGain.h:38
SiStripApvGain::v_gains
std::vector< float > v_gains
Definition: SiStripApvGain.h:89
SiStripApvGain::getRange
const Range getRange(const uint32_t detID) const
Definition: SiStripApvGain.cc:30
SiStripApvGain::RegistryConstIterator
Registry::const_iterator RegistryConstIterator
Definition: SiStripApvGain.h:31
SiStripApvGain::printDebug
void printDebug(std::stringstream &ss, const TrackerTopology *trackerTopo) const
Definition: SiStripApvGain.cc:85
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
SiStripApvGain::Registry
std::vector< unsigned int > Registry
Definition: SiStripApvGain.h:29
SiStripApvGain::put
bool put(const uint32_t &detID, Range input)
Definition: SiStripApvGain.cc:8
SiStripApvGain::RegistryPointers::v_end
ContainerIterator v_end
Definition: SiStripApvGain.h:42
SiStripApvGain::RegistryPointers::detid_end
RegistryConstIterator detid_end
Definition: SiStripApvGain.h:36
SiStripApvGain::RegistryIterator
Registry::iterator RegistryIterator
Definition: SiStripApvGain.h:30
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
Serializable.h
SiStripApvGain::v_detids
std::vector< unsigned int > v_detids
Definition: SiStripApvGain.h:90
SiStripApvGain::getRegistryPointers
RegistryPointers getRegistryPointers() const
Definition: SiStripApvGain.h:55
SiStripApvGain::getRangeByPos
Range getRangeByPos(unsigned short pos) const
Definition: SiStripApvGain.cc:44
SiStripApvGain::~SiStripApvGain
~SiStripApvGain()
Definition: SiStripApvGain.h:53
SiStripApvGain::ContainerIterator
std::vector< float >::const_iterator ContainerIterator
Definition: SiStripApvGain.h:27
SiStripApvGain::RegistryPointers::iend_end
RegistryConstIterator iend_end
Definition: SiStripApvGain.h:40
SiStripApvGain::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripApvGain.h:28
SiStripApvGain::RegistryPointers::iend_begin
RegistryConstIterator iend_begin
Definition: SiStripApvGain.h:39
SiStripApvGain::RegistryPointers::v_begin
ContainerIterator v_begin
Definition: SiStripApvGain.h:41
SiStripApvGain::getDetIds
void getDetIds(std::vector< uint32_t > &DetIds_) const
Definition: SiStripApvGain.cc:53
SiStripApvGain::RegistryPointers::ibegin_begin
RegistryConstIterator ibegin_begin
Definition: SiStripApvGain.h:37
SiStripApvGain
Definition: SiStripApvGain.h:25
SiStripApvGain::getApvGain
static float getApvGain(uint16_t apv, const Range &range)
Definition: SiStripApvGain.h:82
SiStripApvGain::InputVector
std::vector< float > InputVector
Definition: SiStripApvGain.h:32