CMS 3D CMS Logo

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() [1/4]

HcalElectronicsMap::HcalElectronicsMap ( )
inline

Definition at line 53 of file HcalElectronicsMap.h.

53 {}

◆ HcalElectronicsMap() [2/4]

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 }
Definition: helper.py:1
std::vector< PrecisionItem > mPItems
std::vector< TriggerItem > mTItems

◆ ~HcalElectronicsMap()

HcalElectronicsMap::~HcalElectronicsMap ( )

Definition at line 22 of file HcalElectronicsMap.cc.

22 {}

◆ HcalElectronicsMap() [3/4]

HcalElectronicsMap::HcalElectronicsMap ( const HcalElectronicsMap src)

Definition at line 24 of file HcalElectronicsMap.cc.

25  : mPItems(src.mPItems), mTItems(src.mTItems), mPItemsById(src.mPItemsById), mTItemsByTrigId(src.mTItemsByTrigId) {}
std::vector< PrecisionItem > mPItems
std::vector< const PrecisionItem * > mPItemsById
std::vector< TriggerItem > mTItems
std::vector< const TriggerItem * > mTItemsByTrigId

◆ HcalElectronicsMap() [4/4]

HcalElectronicsMap::HcalElectronicsMap ( HcalElectronicsMap &&  other)

Definition at line 40 of file HcalElectronicsMap.cc.

References trackingPlots::other.

40 { other.swap(*this); }

Member Function Documentation

◆ allElectronicsId()

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
std::vector< TriggerItem > mTItems
Readout chain identification for Hcal.

◆ allElectronicsIdPrecision()

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

◆ allElectronicsIdTrigger()

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(), 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 }
std::vector< TriggerItem > mTItems
Readout chain identification for Hcal.

◆ allPrecisionId()

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(), HcalQIEDataCheck::analyze(), HcalPedestalsCheck::analyze(), HcalPedestalWidthsCheck::analyze(), HcalGainsCheck::analyze(), hcaldqm::DigiRunSummary::beginRun(), hcaldqm::ContainerXXX< int >::book(), hcaldqm::ContainerProf1D::book(), hcaldqm::ContainerProf2D::book(), hcaldqm::Container2D::book(), hcaldqm::Container1D::book(), FCDTask::bookHistograms(), PedestalTask::bookHistograms(), RecHitTask::bookHistograms(), DigiTask::bookHistograms(), hcaldqm::RecoRunSummary::endJob(), hcaldqm::DigiRunSummary::endJob(), hcaldqm::RawRunSummary::endLuminosityBlock(), hcaldqm::DigiRunSummary::endLuminosityBlock(), HcalDetIdTableProducer::globalBeginRunProduce(), HcalMLTask::globalEndLuminosityBlock(), 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

◆ allTriggerId()

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< int >::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 }
std::vector< TriggerItem > mTItems

◆ findById()

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

◆ findByTrigId()

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

◆ findPByElId()

const HcalElectronicsMap::PrecisionItem * HcalElectronicsMap::findPByElId ( unsigned long  fElId) const
protected

Definition at line 47 of file HcalElectronicsMap.cc.

References runTauDisplay::eid, mps_fire::i, 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.

◆ findTByElId()

const HcalElectronicsMap::TriggerItem * HcalElectronicsMap::findTByElId ( unsigned long  fElId) const
protected

Definition at line 56 of file HcalElectronicsMap.cc.

References runTauDisplay::eid, mps_fire::i, 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.

◆ initialize()

void HcalElectronicsMap::initialize ( )

Definition at line 206 of file HcalElectronicsMap.cc.

Referenced by HcalElectronicsMap().

206  {
207  sortById();
208  sortByTriggerId();
209 }

◆ lookup() [1/4]

const DetId HcalElectronicsMap::lookup ( HcalElectronicsId  fId) const

◆ lookup() [2/4]

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, and DetId::rawId().

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

◆ lookup() [3/4]

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 runTauDisplay::eid, mps_fire::i, HcalElectronicsId::linearIndex(), 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.

◆ lookup() [4/4]

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 runTauDisplay::eid, mps_fire::i, HcalElectronicsId::linearIndex(), and mTItems.

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.

◆ lookupTrigger() [1/2]

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, and HcalElectronicsId::rawId().

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

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

◆ lookupTrigger() [2/2]

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, 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.

◆ operator=()

HcalElectronicsMap & HcalElectronicsMap::operator= ( const HcalElectronicsMap rhs)

Definition at line 27 of file HcalElectronicsMap.cc.

References groupFilesInBlocks::temp.

27  {
29  temp.swap(*this);
30  return *this;
31 }

◆ serialize()

template<class Archive >
void HcalElectronicsMap::serialize ( Archive &  ar,
const unsigned int  version 
)
private

◆ sortById()

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

◆ sortByTriggerId()

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

◆ swap()

void HcalElectronicsMap::swap ( HcalElectronicsMap other)

Definition at line 33 of file HcalElectronicsMap.cc.

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

33  {
34  std::swap(mPItems, other.mPItems);
35  std::swap(mTItems, other.mTItems);
36  std::swap(mPItemsById, other.mPItemsById);
37  std::swap(mTItemsByTrigId, other.mTItemsByTrigId);
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

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 113 of file HcalElectronicsMap.h.

◆ cond::serialization::access

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

Definition at line 113 of file HcalElectronicsMap.h.

Member Data Documentation

◆ mPItems

std::vector<PrecisionItem> HcalElectronicsMap::mPItems
protected

◆ mPItemsById

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

Definition at line 105 of file HcalElectronicsMap.h.

Referenced by findById(), and swap().

◆ mTItems

std::vector<TriggerItem> HcalElectronicsMap::mTItems
protected

◆ mTItemsByTrigId

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

Definition at line 106 of file HcalElectronicsMap.h.

Referenced by findByTrigId(), and swap().