CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripApvGain.h
Go to the documentation of this file.
1 #ifndef SiStripApvGain_h
2 #define SiStripApvGain_h
3 
4 #include<vector>
5 #include<map>
6 #include<iostream>
7 #include<boost/cstdint.hpp>
21 
22  public:
23 
24  typedef std::vector<float>::const_iterator ContainerIterator;
25  typedef std::pair<ContainerIterator, ContainerIterator> Range;
26  typedef std::vector<unsigned int> Registry;
27  typedef Registry::iterator RegistryIterator;
28  typedef Registry::const_iterator RegistryConstIterator;
29  typedef std::vector<float> InputVector;
30 
31 
41 
44  };
45 
48 
51  p.detid_begin=v_detids.begin();
52  p.detid_end=v_detids.end();
53  p.ibegin_begin=v_ibegin.begin();
54  p.ibegin_end=v_ibegin.end();
55  p.iend_begin=v_iend.begin();
56  p.iend_end=v_iend.end();
57  p.v_begin=v_gains.begin();
58  p.v_end=v_gains.end();
59 
60  return p;
61 }
62 
63 
64  bool put(const uint32_t& detID, Range input);
65  const Range getRange(const uint32_t detID) const;
66  Range getRangeByPos(unsigned short pos) const;
67  void getDetIds(std::vector<uint32_t>& DetIds_) const;
68 
69 
70 #ifdef EDM_ML_DEBUG
71  static float getStripGain (const uint16_t& strip, const Range& range);
72  static float getApvGain (const uint16_t& apv, const Range& range);
73 #else
74  static float getStripGain (uint16_t strip, const Range& range) {uint16_t apv = strip/128; return *(range.first+apv);}
75  static float getApvGain (uint16_t apv, const Range& range) {return *(range.first+apv);}
76 #endif
77 
78 
79  void printDebug(std::stringstream & ss) const;
80  void printSummary(std::stringstream & ss) const;
81 
82  private:
83 
84  std::vector<float> v_gains;
85  std::vector<unsigned int> v_detids;
86  std::vector<unsigned int> v_ibegin;
87  std::vector<unsigned int> v_iend;
88 };
89 
90 #endif
ContainerIterator getFirstElement(RegistryConstIterator &idet)
RegistryConstIterator iend_end
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
void printDebug(std::stringstream &ss) const
std::vector< float > v_gains
void printSummary(std::stringstream &ss) const
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)
std::vector< float > InputVector
static float getStripGain(uint16_t strip, const Range &range)
std::vector< unsigned int > v_ibegin
const Range getRange(const uint32_t detID) const
RegistryConstIterator ibegin_end
RegistryPointers getRegistryPointers() const