33 std::memory_order_acq_rel),
34 std::memory_order_acq_rel);
44 std::vector<const HcalSiPMCharacteristics::PrecisionItem*>::const_iterator item;
47 auto const& ptr = (*
mPItemsByType.load(std::memory_order_acquire));
49 if (item == ptr.end() || (*item)->type_ !=
type)
56 float parLin2,
float parLin3,
57 float crossTalk,
int auxi1,
62 << type <<
" already exists with pixels " 63 << item->
pixels_ <<
" NoLinearity parameters " 65 << item->
parLin3_ <<
" CrossTalk parameter " 66 << item->
crossTalk_ <<
" new values " << pixels
67 <<
", " << parLin1 <<
", " << parLin2 <<
", " 68 << parLin3 <<
", " << crossTalk <<
", " << auxi1
69 <<
" and " << auxi2 <<
" are ignored";
73 parLin2,parLin3,crossTalk,
86 return (item ? item->
pixels_ : 0);
91 std::vector<float> pars;
107 return (item ? item->
auxi1_ : 0);
112 return (item ? item->
auxi2_ : 0);
117 auto ptr =
new std::vector<const PrecisionItem*>;
119 if (
i->type_) (*ptr).push_back(&(*
i));
124 std::vector<const PrecisionItem*>* expect =
nullptr;
125 bool exchanged =
mPItemsByType.compare_exchange_strong(expect, ptr, std::memory_order_acq_rel);
~HcalSiPMCharacteristics()
std::atomic< std::vector< const PrecisionItem * > * > mPItemsByType
HcalSiPMCharacteristics()
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)
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
const PrecisionItem * findByType(int type) const
int getAuxi1(int type) const
get auxiliary words
std::vector< float > getNonLinearities(int type) const
get nonlinearity constants
float getAuxi2(int type) const
int getPixels(int type) const
get # of pixels
std::vector< PrecisionItem > mPItems