CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Friends
HcalElectronicsMap Class Reference

#include <HcalElectronicsMap.h>

Classes

class  PrecisionItem
 
class  TriggerItem
 

Public Member Functions

std::vector< HcalElectronicsIdallElectronicsId () const
 
std::vector< HcalElectronicsIdallElectronicsIdPrecision () const
 
std::vector< HcalElectronicsIdallElectronicsIdTrigger () const
 
std::vector< HcalGenericDetIdallPrecisionId () const
 
std::vector< HcalTrigTowerDetIdallTriggerId () const
 
 HcalElectronicsMap ()
 
 HcalElectronicsMap (const HcalElectronicsMapAddons::Helper &helper)
 
 HcalElectronicsMap (const HcalElectronicsMap &src)
 
 HcalElectronicsMap (HcalElectronicsMap &&other)
 
void initialize ()
 
const DetId lookup (HcalElectronicsId fId) const
 lookup the logical detid associated with the given electronics id More...
 
const HcalElectronicsId lookup (DetId fId) const
 brief lookup the electronics detid associated with the given logical id More...
 
bool lookup (const HcalElectronicsId pId, HcalElectronicsId &eid, HcalGenericDetId &did) const
 brief lookup the DetId and full electronics id associated with this partial (dcc/spigot/fiber/fiberchan) id More...
 
bool lookup (const HcalElectronicsId pId, HcalElectronicsId &eid, HcalTrigTowerDetId &did) const
 brief lookup the DetId and full electronics id associated with this partial (dcc/spigot/slb/slbchan) id More...
 
const DetId lookupTrigger (HcalElectronicsId fId) const
 brief lookup the trigger logical detid associated with the given electronics id More...
 
const HcalElectronicsId lookupTrigger (DetId fId) const
 brief lookup the electronics detid associated with the given trigger logical id More...
 
HcalElectronicsMapoperator= (const HcalElectronicsMap &rhs)
 
void swap (HcalElectronicsMap &other)
 
 ~HcalElectronicsMap ()
 

Protected Member Functions

const PrecisionItemfindById (unsigned long fId) const
 
const TriggerItemfindByTrigId (unsigned long fTrigId) const
 
const PrecisionItemfindPByElId (unsigned long fElId) const
 
const TriggerItemfindTByElId (unsigned long fElId) const
 

Protected Attributes

std::vector< PrecisionItemmPItems
 
std::vector< const
PrecisionItem * > 
mPItemsById
 
std::vector< TriggerItemmTItems
 
std::vector< const TriggerItem * > mTItemsByTrigId
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 
void sortById ()
 
void sortByTriggerId ()
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Author
Fedor Ratnikov (UMd) POOL object to store map between detector ID, electronics ID and trigger ID $Author: ratnikov
Date:
2007/12/10 18:36:43
Revision:
1.16
Author
Fedor Ratnikov (UMd) POOL object to store mapping for Hcal channels $Author: ratnikov
Date:
2007/09/18 06:48:38
Revision:
1.22

Definition at line 31 of file HcalElectronicsMap.h.

Constructor & Destructor Documentation

HcalElectronicsMap::HcalElectronicsMap ( )
inline

Definition at line 53 of file HcalElectronicsMap.h.

53 {}
HcalElectronicsMap::HcalElectronicsMap ( const HcalElectronicsMapAddons::Helper helper)

Definition at line 17 of file HcalElectronicsMap.cc.

References initialize().

18  : mPItems(helper.mPItems), mTItems(helper.mTItems) {
19  initialize();
20 }
std::vector< PrecisionItem > mPItems
std::vector< HcalElectronicsMap::TriggerItem > mTItems
std::vector< TriggerItem > mTItems
std::vector< HcalElectronicsMap::PrecisionItem > mPItems
HcalElectronicsMap::~HcalElectronicsMap ( )

Definition at line 22 of file HcalElectronicsMap.cc.

22 {}
HcalElectronicsMap::HcalElectronicsMap ( const HcalElectronicsMap src)

Definition at line 24 of file HcalElectronicsMap.cc.

std::vector< PrecisionItem > mPItems
std::vector< const PrecisionItem * > mPItemsById
std::vector< TriggerItem > mTItems
std::vector< const TriggerItem * > mTItemsByTrigId
HcalElectronicsMap::HcalElectronicsMap ( HcalElectronicsMap &&  other)

Definition at line 40 of file HcalElectronicsMap.cc.

40 { other.swap(*this); }
void swap(HcalElectronicsMap &other)

Member Function Documentation

std::vector< HcalElectronicsId > HcalElectronicsMap::allElectronicsId ( ) const

Definition at line 110 of file HcalElectronicsMap.cc.

References B2GTnPMonitor_cfi::item, mPItems, mTItems, and mps_fire::result.

Referenced by HcalLuttoDB::analyze(), LEDTask::bookHistograms(), and DigiTask::bookHistograms().

110  {
111  std::vector<HcalElectronicsId> result;
112  for (std::vector<PrecisionItem>::const_iterator item = mPItems.begin(); item != mPItems.end(); item++)
113  if (item->mElId)
114  result.push_back(HcalElectronicsId(item->mElId));
115  for (std::vector<TriggerItem>::const_iterator item = mTItems.begin(); item != mTItems.end(); item++)
116  if (item->mElId)
117  result.push_back(HcalElectronicsId(item->mElId));
118 
119  return result;
120 }
std::vector< PrecisionItem > mPItems
tuple result
Definition: mps_fire.py:311
std::vector< TriggerItem > mTItems
Readout chain identification for Hcal.
std::vector< HcalElectronicsId > HcalElectronicsMap::allElectronicsIdPrecision ( ) const
std::vector< HcalElectronicsId > HcalElectronicsMap::allElectronicsIdTrigger ( ) const

Definition at line 130 of file HcalElectronicsMap.cc.

References B2GTnPMonitor_cfi::item, mTItems, and mps_fire::result.

Referenced by HcalTrigPrimDigiProducer::beginRun(), hcal::raw::ElectronicsMappingGPU::ElectronicsMappingGPU(), EMap::EMap(), hcaldqm::electronicsmap::ElectronicsMap::initialize(), and HcaluLUTTPGCoder::update().

130  {
131  std::vector<HcalElectronicsId> result;
132  for (std::vector<TriggerItem>::const_iterator item = mTItems.begin(); item != mTItems.end(); item++)
133  if (item->mElId)
134  result.push_back(HcalElectronicsId(item->mElId));
135 
136  return result;
137 }
tuple result
Definition: mps_fire.py:311
std::vector< TriggerItem > mTItems
Readout chain identification for Hcal.
std::vector< HcalGenericDetId > HcalElectronicsMap::allPrecisionId ( ) const

Definition at line 139 of file HcalElectronicsMap.cc.

References B2GTnPMonitor_cfi::item, mPItems, and mps_fire::result.

Referenced by PedestalTask::_dump(), LEDTask::_dump(), LaserTask::_dump(), hcaldqm::DigiRunSummary::beginRun(), hcaldqm::ContainerXXX< STDTYPE >::book(), hcaldqm::ContainerProf1D::book(), hcaldqm::ContainerProf2D::book(), hcaldqm::Container2D::book(), hcaldqm::Container1D::book(), PedestalTask::bookHistograms(), FCDTask::bookHistograms(), RecHitTask::bookHistograms(), DigiTask::bookHistograms(), hcaldqm::RecoRunSummary::endJob(), hcaldqm::DigiRunSummary::endJob(), hcaldqm::RawRunSummary::endLuminosityBlock(), hcaldqm::DigiRunSummary::endLuminosityBlock(), and hcaldqm::Container1D::load().

139  {
140  std::vector<HcalGenericDetId> result;
141  std::set<unsigned long> allIds;
142  for (std::vector<PrecisionItem>::const_iterator item = mPItems.begin(); item != mPItems.end(); item++)
143  if (item->mId)
144  allIds.insert(item->mId);
145  for (std::set<unsigned long>::const_iterator channel = allIds.begin(); channel != allIds.end(); channel++) {
146  result.push_back(HcalGenericDetId(*channel));
147  }
148  return result;
149 }
std::vector< PrecisionItem > mPItems
tuple result
Definition: mps_fire.py:311
std::vector< HcalTrigTowerDetId > HcalElectronicsMap::allTriggerId ( ) const

Definition at line 151 of file HcalElectronicsMap.cc.

References B2GTnPMonitor_cfi::item, mTItems, and mps_fire::result.

Referenced by hcaldqm::ContainerXXX< STDTYPE >::book(), hcaldqm::ContainerProf1D::book(), hcaldqm::ContainerProf2D::book(), hcaldqm::Container2D::book(), hcaldqm::Container1D::book(), hcaldqm::TPRunSummary::endJob(), hcaldqm::electronicsmap::ElectronicsMap::initialize(), and hcaldqm::Container1D::load().

151  {
152  std::vector<HcalTrigTowerDetId> result;
153  std::set<unsigned long> allIds;
154  for (std::vector<TriggerItem>::const_iterator item = mTItems.begin(); item != mTItems.end(); item++)
155  if (item->mTrigId)
156  allIds.insert(item->mTrigId);
157  for (std::set<unsigned long>::const_iterator channel = allIds.begin(); channel != allIds.end(); channel++)
158  result.push_back(HcalTrigTowerDetId(*channel));
159  return result;
160 }
tuple result
Definition: mps_fire.py:311
std::vector< TriggerItem > mTItems
const HcalElectronicsMap::PrecisionItem * HcalElectronicsMap::findById ( unsigned long  fId) const
protected

Definition at line 42 of file HcalElectronicsMap.cc.

References mPItemsById, and filterCSVwithJSON::target.

Referenced by lookup().

42  {
43  PrecisionItem target(fId, 0);
44  return HcalObjectAddons::findByT<PrecisionItem, HcalElectronicsMapAddons::LessById>(&target, mPItemsById);
45 }
std::vector< const PrecisionItem * > mPItemsById
const HcalElectronicsMap::TriggerItem * HcalElectronicsMap::findByTrigId ( unsigned long  fTrigId) const
protected

Definition at line 65 of file HcalElectronicsMap.cc.

References mTItemsByTrigId, and filterCSVwithJSON::target.

Referenced by lookupTrigger().

65  {
66  TriggerItem target(fTrigId, 0);
67  return HcalObjectAddons::findByT<TriggerItem, HcalElectronicsMapAddons::LessByTrigId>(&target, mTItemsByTrigId);
68 }
std::vector< const TriggerItem * > mTItemsByTrigId
const HcalElectronicsMap::PrecisionItem * HcalElectronicsMap::findPByElId ( unsigned long  fElId) const
protected

Definition at line 47 of file HcalElectronicsMap.cc.

References runTauDisplay::eid, mps_fire::i, HcalElectronicsId::linearIndex(), HcalElectronicsMap::PrecisionItem::mElId, and mPItems.

Referenced by lookup().

47  {
48  HcalElectronicsId eid(fElId);
49  const PrecisionItem* i = &(mPItems[eid.linearIndex()]);
50 
51  if (i != nullptr && i->mElId != fElId)
52  i = nullptr;
53  return i;
54 }
std::vector< PrecisionItem > mPItems
Readout chain identification for Hcal.
const HcalElectronicsMap::TriggerItem * HcalElectronicsMap::findTByElId ( unsigned long  fElId) const
protected

Definition at line 56 of file HcalElectronicsMap.cc.

References runTauDisplay::eid, mps_fire::i, HcalElectronicsId::linearIndex(), HcalElectronicsMap::TriggerItem::mElId, and mTItems.

Referenced by lookupTrigger().

56  {
57  HcalElectronicsId eid(fElId);
58  const TriggerItem* i = &(mTItems[eid.linearIndex()]);
59 
60  if (i != nullptr && i->mElId != fElId)
61  i = nullptr;
62  return i;
63 }
std::vector< TriggerItem > mTItems
Readout chain identification for Hcal.
void HcalElectronicsMap::initialize ( )

Definition at line 206 of file HcalElectronicsMap.cc.

Referenced by HcalElectronicsMap().

206  {
207  sortById();
208  sortByTriggerId();
209 }
const DetId HcalElectronicsMap::lookup ( HcalElectronicsId  fId) const
const HcalElectronicsId HcalElectronicsMap::lookup ( DetId  fId) const

brief lookup the electronics detid associated with the given logical id

Definition at line 75 of file HcalElectronicsMap.cc.

References findById(), B2GTnPMonitor_cfi::item, HcalElectronicsMap::PrecisionItem::mElId, and DetId::rawId().

75  {
76  const PrecisionItem* item = findById(fId.rawId());
77  return HcalElectronicsId(item ? item->mElId : 0);
78 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const PrecisionItem * findById(unsigned long fId) const
Readout chain identification for Hcal.
bool HcalElectronicsMap::lookup ( const HcalElectronicsId  pId,
HcalElectronicsId eid,
HcalGenericDetId did 
) const

brief lookup the DetId and full electronics id associated with this partial (dcc/spigot/fiber/fiberchan) id

Definition at line 90 of file HcalElectronicsMap.cc.

References mps_fire::i, HcalElectronicsId::linearIndex(), HcalElectronicsMap::PrecisionItem::mElId, HcalElectronicsMap::PrecisionItem::mId, and mPItems.

90  {
91  const PrecisionItem* i = &(mPItems[pid.linearIndex()]);
92  if (i != nullptr && i->mId != 0) {
93  eid = HcalElectronicsId(i->mElId);
94  did = HcalGenericDetId(i->mId);
95  return true;
96  } else
97  return false;
98 }
std::vector< PrecisionItem > mPItems
Readout chain identification for Hcal.
bool HcalElectronicsMap::lookup ( const HcalElectronicsId  pId,
HcalElectronicsId eid,
HcalTrigTowerDetId did 
) const

brief lookup the DetId and full electronics id associated with this partial (dcc/spigot/slb/slbchan) id

Definition at line 100 of file HcalElectronicsMap.cc.

References mps_fire::i, HcalElectronicsId::linearIndex(), HcalElectronicsMap::TriggerItem::mElId, mTItems, and HcalElectronicsMap::TriggerItem::mTrigId.

100  {
101  const TriggerItem* i = &(mTItems[pid.linearIndex()]);
102  if (i != nullptr && i->mTrigId != 0) {
103  eid = HcalElectronicsId(i->mElId);
104  did = HcalGenericDetId(i->mTrigId);
105  return true;
106  } else
107  return false;
108 }
std::vector< TriggerItem > mTItems
Readout chain identification for Hcal.
const DetId HcalElectronicsMap::lookupTrigger ( HcalElectronicsId  fId) const

brief lookup the trigger logical detid associated with the given electronics id

Definition at line 80 of file HcalElectronicsMap.cc.

References findTByElId(), B2GTnPMonitor_cfi::item, HcalElectronicsMap::TriggerItem::mTrigId, and HcalElectronicsId::rawId().

Referenced by HcalLuttoDB::analyze(), HcalTrigPrimDigiProducer::beginRun(), hcaldqm::Container2D::book(), hcal::raw::ElectronicsMappingGPU::ElectronicsMappingGPU(), EMap::EMap(), hcaldqm::electronicsmap::ElectronicsMap::initialize(), HcalUnpacker::unpackUTCA(), HcalUnpacker::unpackVME(), and HcaluLUTTPGCoder::update().

80  {
81  const TriggerItem* item = findTByElId(fId.rawId());
82  return DetId(item ? item->mTrigId : 0);
83 }
constexpr uint32_t rawId() const
Definition: DetId.h:17
const TriggerItem * findTByElId(unsigned long fElId) const
const HcalElectronicsId HcalElectronicsMap::lookupTrigger ( DetId  fId) const

brief lookup the electronics detid associated with the given trigger logical id

Definition at line 85 of file HcalElectronicsMap.cc.

References findByTrigId(), B2GTnPMonitor_cfi::item, HcalElectronicsMap::TriggerItem::mElId, and DetId::rawId().

85  {
86  const TriggerItem* item = findByTrigId(fId.rawId());
87  return HcalElectronicsId(item ? item->mElId : 0);
88 }
const TriggerItem * findByTrigId(unsigned long fTrigId) const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
Readout chain identification for Hcal.
HcalElectronicsMap & HcalElectronicsMap::operator= ( const HcalElectronicsMap rhs)

Definition at line 27 of file HcalElectronicsMap.cc.

References swap(), and groupFilesInBlocks::temp.

27  {
29  temp.swap(*this);
30  return *this;
31 }
template<class Archive >
void HcalElectronicsMap::serialize ( Archive &  ar,
const unsigned int  version 
)
private
void HcalElectronicsMap::sortById ( )
private

Definition at line 198 of file HcalElectronicsMap.cc.

198  {
199  HcalObjectAddons::sortByT<PrecisionItem, HcalElectronicsMapAddons::LessById>(mPItems, mPItemsById);
200 }
std::vector< PrecisionItem > mPItems
std::vector< const PrecisionItem * > mPItemsById
void HcalElectronicsMap::sortByTriggerId ( )
private

Definition at line 202 of file HcalElectronicsMap.cc.

202  {
203  HcalObjectAddons::sortByT<TriggerItem, HcalElectronicsMapAddons::LessByTrigId>(mTItems, mTItemsByTrigId);
204 }
std::vector< TriggerItem > mTItems
std::vector< const TriggerItem * > mTItemsByTrigId
void HcalElectronicsMap::swap ( HcalElectronicsMap other)

Definition at line 33 of file HcalElectronicsMap.cc.

References mPItems, mPItemsById, mTItems, mTItemsByTrigId, and std::swap().

Referenced by operator=().

33  {
34  std::swap(mPItems, other.mPItems);
35  std::swap(mTItems, other.mTItems);
38 }
std::vector< PrecisionItem > mPItems
std::vector< const PrecisionItem * > mPItemsById
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
std::vector< TriggerItem > mTItems
std::vector< const TriggerItem * > mTItemsByTrigId

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 113 of file HcalElectronicsMap.h.

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 113 of file HcalElectronicsMap.h.

Member Data Documentation

std::vector<PrecisionItem> HcalElectronicsMap::mPItems
protected
std::vector<const PrecisionItem*> HcalElectronicsMap::mPItemsById
protected

Definition at line 105 of file HcalElectronicsMap.h.

Referenced by findById(), and swap().

std::vector<TriggerItem> HcalElectronicsMap::mTItems
protected
std::vector<const TriggerItem*> HcalElectronicsMap::mTItemsByTrigId
protected

Definition at line 106 of file HcalElectronicsMap.h.

Referenced by findByTrigId(), and swap().