1 #ifndef ElectronicsQuantity_h 2 #define ElectronicsQuantity_h 10 #include "boost/unordered_map.hpp" 11 #include "boost/foreach.hpp" 144 typedef std::vector<std::string> (*getLabels_eid)();
241 const std::map<ElectronicsQuantityType, std::string>
name_eid = {
265 const std::map<ElectronicsQuantityType, double>
min_eid = {
289 const std::map<ElectronicsQuantityType, double>
max_eid = {
313 const std::map<ElectronicsQuantityType, double>
nbins_eid = {
344 Quantity(name_eid.at(type), isLog), _type(type)
351 {
return getValue_functions_eid.at(_type)(
eid);}
353 {
return getBin_functions_eid.at(_type)(
eid);}
356 int nbins()
override {
return nbins_eid.at(_type);}
357 double min()
override {
return min_eid.at(_type);}
358 double max()
override {
return max_eid.at(_type);}
361 {
return getLabels_functions_eid.at(_type)();}
374 {this->
setup(vFEDs);}
377 virtual void setup(std::vector<int>
const& vFEDs);
381 int nbins()
override {
return _feds.size();}
382 double min()
override {
return 0;}
383 double max()
override {
return _feds.size();}
384 std::vector<std::string> getLabels()
override;
387 typedef boost::unordered_map<int, uint32_t>
FEDMap;
393 std::vector<int> vfeds;
396 vfeds.push_back(p.first);
400 std::sort(vfeds.begin(), vfeds.end());
414 this->
setup(crates, crateHashes);
419 virtual void setup(std::vector<int> crates, CrateHashMap crateHashes);
424 return _crates.size();
426 double min()
override {
return 0;}
427 double max()
override {
return _crates.size();}
428 std::vector<std::string> getLabels()
override;
438 std::vector<int> tmpCrates;
439 std::map<int, uint32_t> tmpCrateHashes;
440 for (
auto& it_crate : _crates) {
441 tmpCrates.push_back(it_crate);
442 tmpCrateHashes[it_crate] = _crateHashes[it_crate];
std::vector< int > _crates
std::vector< std::string > getLabels_Crate()
std::vector< std::string > getLabels_Spigot()
CrateQuantity(HcalElectronicsMap const *emap)
std::vector< unsigned int > const fedListVME
const std::map< ElectronicsQuantityType, getValueType_eid > getValue_functions_eid
HcalElectronicsId getEid_FEDuTCASlot(int)
std::vector< unsigned int > const crateListuTCA
uint32_t getBin_SlotuTCA(HcalElectronicsId const &)
HcalElectronicsId getEid_SLB(int)
uint32_t getBin_SLBSLBCh(HcalElectronicsId const &)
HcalElectronicsId getEid_FiberuTCAFiberCh(int)
std::vector< std::string > getLabels_FED()
int getValue_FiberChuTCATP(HcalElectronicsId const &)
int getValue_FED(HcalElectronicsId const &)
uint32_t getBin_CrateuTCA(HcalElectronicsId const &)
int getValue_SLBSLBCh(HcalElectronicsId const &)
int getValue_SlotVME(HcalElectronicsId const &)
int getValue_Spigot(HcalElectronicsId const &)
HcalElectronicsId getEid_FiberuTCA(int)
std::vector< std::string > getLabels_SlotVME()
uint32_t getBin_FiberuTCAFiberCh(HcalElectronicsId const &)
~ElectronicsQuantity() override
ElectronicsQuantity * makeCopy() override
const std::map< ElectronicsQuantityType, getEid_eid > getEid_functions_eid
std::vector< std::string > getLabels_FiberChuTCATP()
uint32_t getBin_FiberVMEFiberCh(HcalElectronicsId const &)
int getValue_FiberuTCATP(HcalElectronicsId const &)
HcalElectronicsId getEid_SlotVME(int)
def setup(process, global_tag, zero_tesla=False)
uint32_t getBin_FEDVME(HcalElectronicsId const &)
uint32_t getBin_FiberuTCATP(HcalElectronicsId const &)
std::vector< unsigned int > const fedListuTCA
uint32_t getBin_FiberChuTCATP(HcalElectronicsId const &)
uint32_t getBin(HcalElectronicsId const &eid) override
std::vector< std::string > getLabels_FiberVMEFiberCh()
int getValue_FiberVME(HcalElectronicsId const &)
std::vector< std::string > getLabels() override
uint32_t getBin_FEDuTCASlot(HcalElectronicsId const &)
HcalElectronicsId getEid_CrateVME(int)
std::vector< std::string > getLabels_FiberuTCATPFiberChuTCATP()
std::vector< std::string > getLabels_SLB()
FEDQuantity * makeCopy() override
std::vector< std::string > getLabels_FEDuTCA()
const std::map< ElectronicsQuantityType, double > nbins_eid
~CrateQuantity() override
HcalElectronicsId getEid_SLBCh(int)
HcalElectronicsId getEid_SlotuTCA(int)
Container::value_type value_type
FEDQuantity(std::vector< int > const &vFEDs)
HcalElectronicsId getEid_Spigot(int)
int getValue_SLBCh(HcalElectronicsId const &)
std::vector< std::string > getLabels_FEDVME()
HcalElectronicsId getEid_FiberVME(int)
int getValue_FiberCh(HcalElectronicsId const &)
ElectronicsQuantity(ElectronicsQuantityType type, bool isLog=false)
uint32_t getBin_SLB(HcalElectronicsId const &)
int(* getValueType_eid)(HcalElectronicsId const &)
const std::map< ElectronicsQuantityType, double > min_eid
HcalElectronicsId getEid_FiberuTCATPFiberChuTCATP(int)
HcalElectronicsId getEid_FEDuTCA(int)
std::vector< std::string > getLabels_CrateuTCA()
uint32_t getBin_FiberVME(HcalElectronicsId const &)
int getValue_Crate(HcalElectronicsId const &)
std::vector< std::string > getLabels_SlotuTCA()
int getValue_CrateuTCA(HcalElectronicsId const &)
int getValue_FEDVME(HcalElectronicsId const &)
std::vector< std::string > getLabels_FiberuTCATP()
bool isCoordinate() override
std::vector< unsigned int > const fedList
HcalElectronicsId getEid_FEDVMESpigot(int)
uint32_t getBin_FED(HcalElectronicsId const &)
HcalElectronicsId getEid_FiberVMEFiberCh(int)
uint32_t getBin_SlotVME(HcalElectronicsId const &)
int getBin(double x, std::vector< double > boundaries)
int getValue(HcalElectronicsId const &eid) override
uint32_t getBin_FEDuTCA(HcalElectronicsId const &)
const std::map< ElectronicsQuantityType, getBinType_eid > getBin_functions_eid
uint32_t getBin_CrateVME(HcalElectronicsId const &)
CrateQuantity * makeCopy() override
int getValue_FiberuTCAFiberCh(HcalElectronicsId const &)
std::vector< std::string > getLabels_FiberVME()
std::vector< std::string > getLabels_FiberCh()
std::vector< unsigned int > const crateList
int getValue_CrateVME(HcalElectronicsId const &)
std::vector< std::string > getLabels_FEDVMESpigot()
int getValue_SlotuTCA(HcalElectronicsId const &)
uint32_t(* getBinType_eid)(HcalElectronicsId const &)
std::vector< std::string > getLabels_FEDuTCASlot()
std::vector< unsigned int > const crateListVME
std::map< int, uint32_t > CrateHashMap
int getValue_FiberVMEFiberCh(HcalElectronicsId const &)
ElectronicsQuantityType _type
uint32_t getBin_SLBCh(HcalElectronicsId const &)
uint32_t getBin_Spigot(HcalElectronicsId const &)
int getValue_FEDVMESpigot(HcalElectronicsId const &)
std::vector< std::string > getLabels_SLBCh()
int getValue_FEDuTCA(HcalElectronicsId const &)
HcalElectronicsId getEid_FiberCh(int)
HcalElectronicsId getEid_FiberChuTCATP(int)
HcalElectronicsId getEid_FED(int)
const std::map< ElectronicsQuantityType, double > max_eid
int getValue_FiberuTCATPFiberChuTCATP(HcalElectronicsId const &)
std::vector< std::string > getLabels_FiberuTCA()
std::vector< std::string > getLabels_CrateVME()
uint32_t getBin_FiberCh(HcalElectronicsId const &)
const JetExtendedData & getValue(const Container &, const reco::JetBaseRef &)
get value for the association. Throw exception if no association found
uint32_t getBin_Crate(HcalElectronicsId const &)
uint32_t getBin_FEDVMESpigot(HcalElectronicsId const &)
int getValue_FEDuTCASlot(HcalElectronicsId const &)
uint32_t getBin_FiberuTCA(HcalElectronicsId const &)
HcalElectronicsId getEid_CrateuTCA(int)
HcalElectronicsId(* getEid_eid)(int)
uint32_t getBin_FiberuTCATPFiberChuTCATP(HcalElectronicsId const &)
int getValue_SLB(HcalElectronicsId const &)
CrateQuantity(std::vector< int > crates, CrateHashMap crateHashes)
HcalElectronicsId getEid_Crate(int)
HcalElectronicsId getEid_FiberuTCATP(int)
const std::map< ElectronicsQuantityType, getLabels_eid > getLabels_functions_eid
Readout chain identification for Hcal.
boost::unordered_map< int, uint32_t > FEDMap
QuantityType type() override
HcalElectronicsId getEid_SLBSLBCh(int)
int getValue_FiberuTCA(HcalElectronicsId const &)
HcalElectronicsId getEid_FEDVME(int)
CrateHashMap _crateHashes
std::vector< std::string > getLabels_SLBSLBCh()
std::vector< std::string > getLabels_FiberuTCAFiberCh()
const std::map< ElectronicsQuantityType, std::string > name_eid