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 
5 
6 #include<vector>
7 #include<map>
8 #include<iostream>
9 #include<boost/cstdint.hpp>
23 
24  public:
25 
26  typedef std::vector<float>::const_iterator ContainerIterator;
27  typedef std::pair<ContainerIterator, ContainerIterator> Range;
28  typedef std::vector<unsigned int> Registry;
29  typedef Registry::iterator RegistryIterator;
30  typedef Registry::const_iterator RegistryConstIterator;
31  typedef std::vector<float> InputVector;
32 
33 
43 
46  };
47 
50 
53  p.detid_begin=v_detids.begin();
54  p.detid_end=v_detids.end();
55  p.ibegin_begin=v_ibegin.begin();
56  p.ibegin_end=v_ibegin.end();
57  p.iend_begin=v_iend.begin();
58  p.iend_end=v_iend.end();
59  p.v_begin=v_gains.begin();
60  p.v_end=v_gains.end();
61 
62  return p;
63 }
64 
65 
66  bool put(const uint32_t& detID, Range input);
67  const Range getRange(const uint32_t detID) const;
68  Range getRangeByPos(unsigned short pos) const;
69  void getDetIds(std::vector<uint32_t>& DetIds_) const;
70 
71 
72 #ifdef EDM_ML_DEBUG
73  static float getStripGain (const uint16_t& strip, const Range& range);
74  static float getApvGain (const uint16_t& apv, const Range& range);
75 #else
76  static float getStripGain (uint16_t strip, const Range& range) {uint16_t apv = strip/128; return *(range.first+apv);}
77  static float getApvGain (uint16_t apv, const Range& range) {return *(range.first+apv);}
78 #endif
79 
80 
81  void printDebug(std::stringstream & ss) const;
82  void printSummary(std::stringstream & ss) const;
83 
84  private:
85 
86  std::vector<float> v_gains;
87  std::vector<unsigned int> v_detids;
88  std::vector<unsigned int> v_ibegin;
89  std::vector<unsigned int> v_iend;
90 
92 };
93 
94 #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:43
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)
#define COND_SERIALIZABLE
Definition: Serializable.h:37
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