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 <algorithm>
8 #include <boost/cstdint.hpp>
9 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
10 #include <atomic>
11 #endif
12 
14 
15 public:
18 
19  // swap function
21  // copy-ctor
23  // copy assignment operator
25  // move constructor
26 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
28 #endif
29 
30  // Load a new entry
31  bool loadObject(int type, int pixels, float parLin1,
32  float parLin2, float parLin3, float crossTalk,
33  int auxi1=0, float auxi2=0);
34 
36  unsigned int getTypes() const {return mPItems.size();}
37  int getType(unsigned int k) const {return mPItems[k].type_;}
39  int getPixels(int type) const;
41  std::vector<float> getNonLinearities(int type) const;
43  float getCrossTalk(int type) const;
45  int getAuxi1(int type) const;
46  float getAuxi2(int type) const;
47 
48  // sorting
49  void sortByType() const;
50  void sort() {}
51 
52  class PrecisionItem {
53  public:
56  }
57  PrecisionItem (int type, int pixels, float parLin1, float parLin2,
58  float parLin3, float crossTalk, int auxi1, float auxi2) :
59  type_(type), pixels_(pixels), parLin1_(parLin1), parLin2_(parLin2),
60  parLin3_(parLin3), crossTalk_(crossTalk), auxi1_(auxi1), auxi2_(auxi2) {}
61 
62  int type_;
63  int pixels_;
64  float parLin1_;
65  float parLin2_;
66  float parLin3_;
67  float crossTalk_;
68  int auxi1_;
69  float auxi2_;
70 
72  };
73 
74 protected:
75  const PrecisionItem* findByType (int type) const;
76 
77  std::vector<PrecisionItem> mPItems;
78 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
79  mutable std::atomic<std::vector<const PrecisionItem*>*> mPItemsByType COND_TRANSIENT;
80 #else
81  mutable std::vector<const PrecisionItem*>* mPItemsByType COND_TRANSIENT;
82 #endif
83 
85 };
86 
87 #endif
type
Definition: HCALResponse.h:21
PrecisionItem(int type, int pixels, float parLin1, float parLin2, float parLin3, float crossTalk, int auxi1, float auxi2)
std::atomic< std::vector< const PrecisionItem * > * > mPItemsByType
void swap(HcalSiPMCharacteristics &other)
float getCrossTalk(int type) const
get cross talk
HcalSiPMCharacteristics & operator=(const HcalSiPMCharacteristics &rhs)
bool loadObject(int type, int pixels, float parLin1, float parLin2, float parLin3, float crossTalk, int auxi1=0, float auxi2=0)
const PrecisionItem * findByType(int type) const
unsigned int getTypes() const
get # of types
int k[5][pyjets_maxn]
#define COND_TRANSIENT
Definition: Serializable.h:61
int getAuxi1(int type) const
get auxiliary words
int getType(unsigned int k) const
std::vector< float > getNonLinearities(int type) const
get nonlinearity constants
#define COND_SERIALIZABLE
Definition: Serializable.h:38
float getAuxi2(int type) const
int getPixels(int type) const
get # of pixels
std::vector< PrecisionItem > mPItems