CMS 3D CMS Logo

HcalSiPMCharacteristics.h
Go to the documentation of this file.
1 #ifndef CondFormatsHcalObjectsHcalSiPMCharacteristics_h
2 #define CondFormatsHcalObjectsHcalSiPMCharacteristics_h
3 
5 
6 #include <vector>
7 #include <set>
8 #include <algorithm>
9 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
10 #include <atomic>
11 #endif
12 
13 //forward declarations
15  class Helper;
16 }
17 
19 public:
20  class PrecisionItem {
21  public:
23  type_ = auxi1_ = pixels_ = 0;
25  }
27  int type, int pixels, float parLin1, float parLin2, float parLin3, float crossTalk, int auxi1, float auxi2)
28  : type_(type),
29  pixels_(pixels),
30  parLin1_(parLin1),
31  parLin2_(parLin2),
32  parLin3_(parLin3),
33  crossTalk_(crossTalk),
34  auxi1_(auxi1),
35  auxi2_(auxi2) {}
36 
37  int type_;
38  int pixels_;
39  float parLin1_;
40  float parLin2_;
41  float parLin3_;
42  float crossTalk_;
43  int auxi1_;
44  float auxi2_;
45 
47  };
48 
52 
53  // swap function
55  // copy-ctor
57  // copy assignment operator
59  // move constructor
60 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
62 #endif
63 
65  unsigned int getTypes() const { return mPItems.size(); }
66  int getType(unsigned int k) const { return mPItems[k].type_; }
68  int getPixels(int type) const;
70  std::vector<float> getNonLinearities(int type) const;
72  float getCrossTalk(int type) const;
74  int getAuxi1(int type) const;
75  float getAuxi2(int type) const;
76 
77  const PrecisionItem* findByType(int type) const;
78 
79  // sorting
80  void sortByType();
81  void initialize();
82 
83 protected:
84  std::vector<PrecisionItem> mPItems;
85  std::vector<const PrecisionItem*> mPItemsByType COND_TRANSIENT;
86 
88 };
89 
91  class LessByType {
92  public:
95  return a->type_ < b->type_;
96  }
99  return a.type_ < b.type_;
100  }
102  return a->type_ == b->type_;
103  }
104  bool good(const HcalSiPMCharacteristics::PrecisionItem& a) const { return a.type_; }
105  };
106  class Helper {
107  public:
108  Helper();
109  // Load a new entry
110  bool loadObject(int type,
111  int pixels,
112  float parLin1,
113  float parLin2,
114  float parLin3,
115  float crossTalk,
116  int auxi1 = 0,
117  float auxi2 = 0);
118 
119  std::set<HcalSiPMCharacteristics::PrecisionItem, LessByType> mPItems;
120  };
121 } // namespace HcalSiPMCharacteristicsAddons
122 
123 #endif
HcalSiPMCharacteristics::mPItems
std::vector< PrecisionItem > mPItems
Definition: HcalSiPMCharacteristics.h:84
HcalSiPMCharacteristics::sortByType
void sortByType()
Definition: HcalSiPMCharacteristics.cc:103
HcalSiPMCharacteristicsAddons::Helper::Helper
Helper()
Definition: HcalSiPMCharacteristics.cc:53
HcalSiPMCharacteristics::getAuxi2
float getAuxi2(int type) const
Definition: HcalSiPMCharacteristics.cc:98
HcalSiPMCharacteristics::PrecisionItem::PrecisionItem
PrecisionItem()
Definition: HcalSiPMCharacteristics.h:22
HcalSiPMCharacteristics::PrecisionItem::auxi1_
int auxi1_
Definition: HcalSiPMCharacteristics.h:43
HcalSiPMCharacteristics::PrecisionItem::parLin2_
float parLin2_
Definition: HcalSiPMCharacteristics.h:40
HcalSiPMCharacteristics::PrecisionItem
Definition: HcalSiPMCharacteristics.h:20
COND_SERIALIZABLE
#define COND_SERIALIZABLE
Definition: Serializable.h:39
HcalSiPMCharacteristics::~HcalSiPMCharacteristics
~HcalSiPMCharacteristics()
Definition: HcalSiPMCharacteristics.cc:14
HcalSiPMCharacteristics::getNonLinearities
std::vector< float > getNonLinearities(int type) const
get nonlinearity constants
Definition: HcalSiPMCharacteristics.cc:77
COND_TRANSIENT
#define COND_TRANSIENT
Definition: Serializable.h:63
HcalSiPMCharacteristics::PrecisionItem::PrecisionItem
PrecisionItem(int type, int pixels, float parLin1, float parLin2, float parLin3, float crossTalk, int auxi1, float auxi2)
Definition: HcalSiPMCharacteristics.h:26
HcalSiPMCharacteristics::PrecisionItem::parLin3_
float parLin3_
Definition: HcalSiPMCharacteristics.h:41
HcalSiPMCharacteristics::getAuxi1
int getAuxi1(int type) const
get auxiliary words
Definition: HcalSiPMCharacteristics.cc:93
HcalSiPMCharacteristics::getCrossTalk
float getCrossTalk(int type) const
get cross talk
Definition: HcalSiPMCharacteristics.cc:88
HcalSiPMCharacteristics::initialize
void initialize()
Definition: HcalSiPMCharacteristics.cc:107
HcalSiPMCharacteristics::HcalSiPMCharacteristics
HcalSiPMCharacteristics()
Definition: HcalSiPMCharacteristics.h:49
HcalSiPMCharacteristics::findByType
const PrecisionItem * findByType(int type) const
Definition: HcalSiPMCharacteristics.cc:38
HcalSiPMCharacteristicsAddons::LessByType
Definition: HcalSiPMCharacteristics.h:91
HcalSiPMCharacteristics::getType
int getType(unsigned int k) const
Definition: HcalSiPMCharacteristics.h:66
HcalSiPMCharacteristics::operator=
HcalSiPMCharacteristics & operator=(const HcalSiPMCharacteristics &rhs)
Definition: HcalSiPMCharacteristics.cc:21
trackingPlots.other
other
Definition: trackingPlots.py:1467
dqmdumpme.k
k
Definition: dqmdumpme.py:60
HcalSiPMCharacteristicsAddons::LessByType::good
bool good(const HcalSiPMCharacteristics::PrecisionItem &a) const
Definition: HcalSiPMCharacteristics.h:104
b
double b
Definition: hdecay.h:118
HcalSiPMCharacteristics::PrecisionItem::type_
int type_
Definition: HcalSiPMCharacteristics.h:37
HcalSiPMCharacteristics::swap
void swap(HcalSiPMCharacteristics &other)
Definition: HcalSiPMCharacteristics.cc:28
a
double a
Definition: hdecay.h:119
HcalSiPMCharacteristics::PrecisionItem::auxi2_
float auxi2_
Definition: HcalSiPMCharacteristics.h:44
TrackRefitter_38T_cff.src
src
Definition: TrackRefitter_38T_cff.py:24
HcalSiPMCharacteristicsAddons::LessByType::equal
bool equal(const HcalSiPMCharacteristics::PrecisionItem *a, const HcalSiPMCharacteristics::PrecisionItem *b) const
Definition: HcalSiPMCharacteristics.h:101
HcalSiPMCharacteristicsAddons::LessByType::operator()
bool operator()(const HcalSiPMCharacteristics::PrecisionItem &a, const HcalSiPMCharacteristics::PrecisionItem &b) const
Definition: HcalSiPMCharacteristics.h:97
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
HcalSiPMCharacteristics::PrecisionItem::parLin1_
float parLin1_
Definition: HcalSiPMCharacteristics.h:39
helper
Definition: helper.py:1
Serializable.h
HcalSiPMCharacteristicsAddons
Definition: HcalSiPMCharacteristics.h:14
HcalSiPMCharacteristicsAddons::Helper::mPItems
std::set< HcalSiPMCharacteristics::PrecisionItem, LessByType > mPItems
Definition: HcalSiPMCharacteristics.h:119
HcalSiPMCharacteristicsAddons::Helper::loadObject
bool loadObject(int type, int pixels, float parLin1, float parLin2, float parLin3, float crossTalk, int auxi1=0, float auxi2=0)
Definition: HcalSiPMCharacteristics.cc:55
HcalSiPMCharacteristicsAddons::LessByType::operator()
bool operator()(const HcalSiPMCharacteristics::PrecisionItem *a, const HcalSiPMCharacteristics::PrecisionItem *b) const
Definition: HcalSiPMCharacteristics.h:93
HcalSiPMCharacteristics::mPItemsByType
std::vector< const PrecisionItem * > mPItemsByType
Definition: HcalSiPMCharacteristics.h:85
HcalSiPMCharacteristics::PrecisionItem::crossTalk_
float crossTalk_
Definition: HcalSiPMCharacteristics.h:42
HcalSiPMCharacteristicsAddons::Helper
Definition: HcalSiPMCharacteristics.h:106
HcalSiPMCharacteristics::PrecisionItem::pixels_
int pixels_
Definition: HcalSiPMCharacteristics.h:38
HcalSiPMCharacteristics::getPixels
int getPixels(int type) const
get # of pixels
Definition: HcalSiPMCharacteristics.cc:72
HcalSiPMCharacteristics::getTypes
unsigned int getTypes() const
get # of types
Definition: HcalSiPMCharacteristics.h:65
HcalSiPMCharacteristics
Definition: HcalSiPMCharacteristics.h:18