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>
9 #include<boost/cstdint.hpp>
11 
12 class TrackerTopology;
13 
26 
27  public:
28 
29  typedef std::vector<float>::const_iterator ContainerIterator;
30  typedef std::pair<ContainerIterator, ContainerIterator> Range;
31  typedef std::vector<unsigned int> Registry;
32  typedef Registry::iterator RegistryIterator;
33  typedef Registry::const_iterator RegistryConstIterator;
34  typedef std::vector<float> InputVector;
35 
36 
38  RegistryConstIterator detid_begin;
39  RegistryConstIterator detid_end;
40  RegistryConstIterator ibegin_begin;
41  RegistryConstIterator ibegin_end;
42  RegistryConstIterator iend_begin;
43  RegistryConstIterator iend_end;
44  ContainerIterator v_begin;
45  ContainerIterator v_end;
46 
47  ContainerIterator getFirstElement(RegistryConstIterator& idet){return v_begin+*(ibegin_begin+(idet-detid_begin));}
48  ContainerIterator getLastElement(RegistryConstIterator& idet){return v_begin+*(iend_begin+(idet-detid_begin));}
49  };
50 
53 
56  p.detid_begin=v_detids.begin();
57  p.detid_end=v_detids.end();
58  p.ibegin_begin=v_ibegin.begin();
59  p.ibegin_end=v_ibegin.end();
60  p.iend_begin=v_iend.begin();
61  p.iend_end=v_iend.end();
62  p.v_begin=v_gains.begin();
63  p.v_end=v_gains.end();
64 
65  return p;
66 }
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 
75 #ifdef EDM_ML_DEBUG
76  static float getStripGain (const uint16_t& strip, const Range& range);
77  static float getApvGain (const uint16_t& apv, const Range& range);
78 #else
79  static float getStripGain (uint16_t strip, const Range& range) {uint16_t apv = strip/128; return *(range.first+apv);}
80  static float getApvGain (uint16_t apv, const Range& range) {return *(range.first+apv);}
81 #endif
82 
83 
84  void printDebug(std::stringstream & ss, const TrackerTopology* trackerTopo) const;
85  void printSummary(std::stringstream & ss, const TrackerTopology* trackerTopo) const;
86 
87  private:
88 
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
ContainerIterator getFirstElement(RegistryConstIterator &idet)
RegistryConstIterator iend_end
void printSummary(std::stringstream &ss, const TrackerTopology *trackerTopo) const
RegistryConstIterator iend_begin
Registry::const_iterator RegistryConstIterator
static float getApvGain(uint16_t apv, const Range &range)
Registry::iterator RegistryIterator
RegistryConstIterator detid_end
RegistryConstIterator detid_begin
Range getRangeByPos(unsigned short pos) const
std::vector< unsigned int > Registry
void getDetIds(std::vector< uint32_t > &DetIds_) const
static std::string const input
Definition: EdmProvDump.cc:44
bool put(const uint32_t &detID, Range input)
RegistryConstIterator ibegin_begin
std::vector< float > v_gains
std::pair< ContainerIterator, ContainerIterator > Range
std::vector< unsigned int > v_iend
std::vector< float >::const_iterator ContainerIterator
std::vector< unsigned int > v_detids
ContainerIterator getLastElement(RegistryConstIterator &idet)
#define COND_SERIALIZABLE
Definition: Serializable.h:38
std::vector< float > InputVector
static float getStripGain(uint16_t strip, const Range &range)
void printDebug(std::stringstream &ss, const TrackerTopology *trackerTopo) const
std::vector< unsigned int > v_ibegin
const Range getRange(const uint32_t detID) const
RegistryConstIterator ibegin_end
RegistryPointers getRegistryPointers() const