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 HcalElectronicsMap &src)
 
 HcalElectronicsMap (const HcalElectronicsMapAddons::Helper &helper)
 
 HcalElectronicsMap (HcalElectronicsMap &&other)
 
void initialize ()
 
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 HcalElectronicsId lookup (DetId fId) const
 brief lookup the electronics detid associated with the given logical id More...
 
const DetId lookup (HcalElectronicsId fId) const
 lookup the 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...
 
const DetId lookupTrigger (HcalElectronicsId fId) const
 brief lookup the trigger logical detid associated with the given electronics 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.

18  : mPItems(helper.mPItems), mTItems(helper.mTItems) {
19  initialize();
20 }

References initialize().

◆ ~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) {}

◆ HcalElectronicsMap() [4/4]

HcalElectronicsMap::HcalElectronicsMap ( HcalElectronicsMap &&  other)

Definition at line 40 of file HcalElectronicsMap.cc.

40 { other.swap(*this); }

References trackingPlots::other.

Member Function Documentation

◆ allElectronicsId()

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

Definition at line 110 of file HcalElectronicsMap.cc.

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 }

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

Referenced by HcalLuttoDB::analyze().

◆ allElectronicsIdPrecision()

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

◆ allElectronicsIdTrigger()

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

Definition at line 130 of file HcalElectronicsMap.cc.

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 }

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

Referenced by EMap::EMap(), and hcaldqm::electronicsmap::ElectronicsMap::initialize().

◆ allPrecisionId()

std::vector< HcalGenericDetId > HcalElectronicsMap::allPrecisionId ( ) const

◆ allTriggerId()

std::vector< HcalTrigTowerDetId > HcalElectronicsMap::allTriggerId ( ) const

Definition at line 151 of file HcalElectronicsMap.cc.

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 }

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().

◆ findById()

const HcalElectronicsMap::PrecisionItem * HcalElectronicsMap::findById ( unsigned long  fId) const
protected

Definition at line 42 of file HcalElectronicsMap.cc.

42  {
43  PrecisionItem target(fId, 0);
44  return HcalObjectAddons::findByT<PrecisionItem, HcalElectronicsMapAddons::LessById>(&target, mPItemsById);
45 }

References mPItemsById, and filterCSVwithJSON::target.

Referenced by lookup().

◆ findByTrigId()

const HcalElectronicsMap::TriggerItem * HcalElectronicsMap::findByTrigId ( unsigned long  fTrigId) const
protected

Definition at line 65 of file HcalElectronicsMap.cc.

65  {
66  TriggerItem target(fTrigId, 0);
67  return HcalObjectAddons::findByT<TriggerItem, HcalElectronicsMapAddons::LessByTrigId>(&target, mTItemsByTrigId);
68 }

References mTItemsByTrigId, and filterCSVwithJSON::target.

Referenced by lookupTrigger().

◆ findPByElId()

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

Definition at line 47 of file HcalElectronicsMap.cc.

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 }

References runTauDisplay::eid, mps_fire::i, and mPItems.

Referenced by lookup().

◆ findTByElId()

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

Definition at line 56 of file HcalElectronicsMap.cc.

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 }

References runTauDisplay::eid, mps_fire::i, and mTItems.

Referenced by lookupTrigger().

◆ initialize()

void HcalElectronicsMap::initialize ( )

Definition at line 206 of file HcalElectronicsMap.cc.

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

Referenced by HcalElectronicsMap().

◆ lookup() [1/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.

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 }

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

◆ lookup() [2/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.

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 }

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

◆ lookup() [3/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.

75  {
76  const PrecisionItem* item = findById(fId.rawId());
77  return HcalElectronicsId(item ? item->mElId : 0);
78 }

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

◆ lookup() [4/4]

const DetId HcalElectronicsMap::lookup ( HcalElectronicsId  fId) const

◆ lookupTrigger() [1/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.

85  {
86  const TriggerItem* item = findByTrigId(fId.rawId());
87  return HcalElectronicsId(item ? item->mElId : 0);
88 }

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

◆ lookupTrigger() [2/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.

80  {
81  const TriggerItem* item = findTByElId(fId.rawId());
82  return DetId(item ? item->mTrigId : 0);
83 }

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

Referenced by HcalLuttoDB::analyze(), EMap::EMap(), hcaldqm::electronicsmap::ElectronicsMap::initialize(), HcalDigiToRawuHTR::produce(), HcalUnpacker::unpackUTCA(), and HcalUnpacker::unpackVME().

◆ operator=()

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

Definition at line 27 of file HcalElectronicsMap.cc.

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

References groupFilesInBlocks::temp.

◆ 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 }

◆ sortByTriggerId()

void HcalElectronicsMap::sortByTriggerId ( )
private

Definition at line 202 of file HcalElectronicsMap.cc.

202  {
203  HcalObjectAddons::sortByT<TriggerItem, HcalElectronicsMapAddons::LessByTrigId>(mTItems, mTItemsByTrigId);
204 }

◆ swap()

void HcalElectronicsMap::swap ( HcalElectronicsMap other)

Definition at line 33 of file HcalElectronicsMap.cc.

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 }

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

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().

mps_fire.i
i
Definition: mps_fire.py:428
HcalGenericDetId
Definition: HcalGenericDetId.h:15
HcalElectronicsMap::findById
const PrecisionItem * findById(unsigned long fId) const
Definition: HcalElectronicsMap.cc:42
HcalElectronicsMap::findByTrigId
const TriggerItem * findByTrigId(unsigned long fTrigId) const
Definition: HcalElectronicsMap.cc:65
HcalElectronicsMap::mTItemsByTrigId
std::vector< const TriggerItem * > mTItemsByTrigId
Definition: HcalElectronicsMap.h:106
HcalElectronicsMap::findTByElId
const TriggerItem * findTByElId(unsigned long fElId) const
Definition: HcalElectronicsMap.cc:56
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
HcalElectronicsMap::findPByElId
const PrecisionItem * findPByElId(unsigned long fElId) const
Definition: HcalElectronicsMap.cc:47
DetId
Definition: DetId.h:17
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
HcalElectronicsId
Readout chain identification for Hcal.
Definition: HcalElectronicsId.h:32
trackingPlots.other
other
Definition: trackingPlots.py:1467
TrackRefitter_38T_cff.src
src
Definition: TrackRefitter_38T_cff.py:24
helper
Definition: helper.py:1
HcalElectronicsMap::sortByTriggerId
void sortByTriggerId()
Definition: HcalElectronicsMap.cc:202
runTauDisplay.eid
eid
Definition: runTauDisplay.py:298
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
HcalElectronicsMap::mTItems
std::vector< TriggerItem > mTItems
Definition: HcalElectronicsMap.h:104
HcalElectronicsMap
Definition: HcalElectronicsMap.h:31
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
HcalElectronicsMap::sortById
void sortById()
Definition: HcalElectronicsMap.cc:198
HcalElectronicsId::rawId
constexpr uint32_t rawId() const
Definition: HcalElectronicsId.h:59
HcalElectronicsMap::mPItemsById
std::vector< const PrecisionItem * > mPItemsById
Definition: HcalElectronicsMap.h:105
HcalElectronicsMap::initialize
void initialize()
Definition: HcalElectronicsMap.cc:206
filterCSVwithJSON.target
target
Definition: filterCSVwithJSON.py:32
mps_fire.result
result
Definition: mps_fire.py:311
HcalElectronicsMap::mPItems
std::vector< PrecisionItem > mPItems
Definition: HcalElectronicsMap.h:103
HcalTrigTowerDetId
Definition: HcalTrigTowerDetId.h:14