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 #include <boost/cstdint.hpp>
10 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
11 #include <atomic>
12 #endif
13 
14 //forward declarations
16  class Helper;
17 }
18 
20 
21 public:
22 
23  class PrecisionItem {
24  public:
25  PrecisionItem () {type_=auxi1_=pixels_=0;
26  parLin1_= parLin2_=parLin3_=crossTalk_=auxi2_=0;
27  }
28  PrecisionItem (int type, int pixels, float parLin1, float parLin2,
29  float parLin3, float crossTalk, int auxi1, float auxi2) :
30  type_(type), pixels_(pixels), parLin1_(parLin1), parLin2_(parLin2),
31  parLin3_(parLin3), crossTalk_(crossTalk), auxi1_(auxi1), auxi2_(auxi2) {}
32 
33  int type_;
34  int pixels_;
35  float parLin1_;
36  float parLin2_;
37  float parLin3_;
38  float crossTalk_;
39  int auxi1_;
40  float auxi2_;
41 
43  };
44 
48 
49  // swap function
51  // copy-ctor
53  // copy assignment operator
54  HcalSiPMCharacteristics& operator=(const HcalSiPMCharacteristics& rhs);
55  // move constructor
56 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
58 #endif
59 
61  unsigned int getTypes() const {return mPItems.size();}
62  int getType(unsigned int k) const {return mPItems[k].type_;}
64  int getPixels(int type) const;
66  std::vector<float> getNonLinearities(int type) const;
68  float getCrossTalk(int type) const;
70  int getAuxi1(int type) const;
71  float getAuxi2(int type) const;
72 
73  const PrecisionItem* findByType (int type) const;
74 
75  // sorting
76  void sortByType();
77  void initialize();
78 
79 protected:
80 
81  std::vector<PrecisionItem> mPItems;
82  std::vector<const PrecisionItem*> mPItemsByType COND_TRANSIENT;
83 
85 };
86 
88  class LessByType {
89  public:
94  };
95  class Helper {
96  public:
97  Helper();
98  // Load a new entry
99  bool loadObject(int type, int pixels, float parLin1,
100  float parLin2, float parLin3, float crossTalk,
101  int auxi1=0, float auxi2=0);
102 
103  std::set<HcalSiPMCharacteristics::PrecisionItem,LessByType> mPItems;
104  };
105 }
106 
107 #endif
type
Definition: HCALResponse.h:21
static AlgebraicMatrix initialize()
Definition: helper.py:1
bool equal(const HcalSiPMCharacteristics::PrecisionItem *a, const HcalSiPMCharacteristics::PrecisionItem *b)
bool good(const HcalSiPMCharacteristics::PrecisionItem &a)
PrecisionItem(int type, int pixels, float parLin1, float parLin2, float parLin3, float crossTalk, int auxi1, float auxi2)
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:116
unsigned int getTypes() const
get # of types
int k[5][pyjets_maxn]
std::set< HcalSiPMCharacteristics::PrecisionItem, LessByType > mPItems
#define COND_TRANSIENT
Definition: Serializable.h:61
int getType(unsigned int k) const
double b
Definition: hdecay.h:120
#define COND_SERIALIZABLE
Definition: Serializable.h:38
double a
Definition: hdecay.h:121
std::vector< PrecisionItem > mPItems