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::HcalElectronicsMap ( )
inline
HcalElectronicsMap::HcalElectronicsMap ( const HcalElectronicsMapAddons::Helper helper)

Definition at line 17 of file HcalElectronicsMap.cc.

References initialize().

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

Definition at line 23 of file HcalElectronicsMap.cc.

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

Definition at line 25 of file HcalElectronicsMap.cc.

26  : mPItems(src.mPItems), mTItems(src.mTItems),
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 43 of file HcalElectronicsMap.cc.

References trackingPlots::other.

44 {
45  other.swap(*this);
46 }
void swap(HcalElectronicsMap &other)

Member Function Documentation

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

Definition at line 114 of file HcalElectronicsMap.cc.

References mPItems, mTItems, and mps_fire::result.

Referenced by HcalLuttoDB::analyze(), and HcalDbASCIIIO::createObject< HcalElectronicsMap >().

114  {
115  std::vector <HcalElectronicsId> result;
116  for (std::vector<PrecisionItem>::const_iterator item = mPItems.begin (); item != mPItems.end (); item++)
117  if (item->mElId) result.push_back(HcalElectronicsId(item->mElId));
118  for (std::vector<TriggerItem>::const_iterator item = mTItems.begin (); item != mTItems.end (); item++)
119  if (item->mElId) result.push_back(HcalElectronicsId(item->mElId));
120 
121  return result;
122 }
std::vector< PrecisionItem > mPItems
std::vector< TriggerItem > mTItems
Readout chain identification for Hcal.
std::vector< HcalElectronicsId > HcalElectronicsMap::allElectronicsIdPrecision ( ) const

Definition at line 124 of file HcalElectronicsMap.cc.

References mPItems, and mps_fire::result.

Referenced by hcaldqm::ContainerXXX< STDTYPE >::book(), hcaldqm::ContainerProf1D::book(), hcaldqm::ContainerProf2D::book(), hcaldqm::Container2D::book(), hcaldqm::Container1D::book(), EMap::EMap(), hcaldqm::utilities::getCrateHashMap(), hcaldqm::utilities::getCrateList(), hcaldqm::utilities::getFEDList(), hcaldqm::utilities::getFEDuTCAList(), hcaldqm::utilities::getFEDVMEList(), hcaldqm::electronicsmap::ElectronicsMap::initialize(), and hcaldqm::Container1D::load().

124  {
125  std::vector <HcalElectronicsId> result;
126  for (std::vector<PrecisionItem>::const_iterator item = mPItems.begin (); item != mPItems.end (); item++)
127  if (item->mElId) result.push_back(HcalElectronicsId(item->mElId));
128  return result;
129 }
std::vector< PrecisionItem > mPItems
Readout chain identification for Hcal.
std::vector< HcalElectronicsId > HcalElectronicsMap::allElectronicsIdTrigger ( ) const

Definition at line 131 of file HcalElectronicsMap.cc.

References mTItems, and mps_fire::result.

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

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

Definition at line 139 of file HcalElectronicsMap.cc.

References 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< STDTYPE >::book(), hcaldqm::ContainerProf1D::book(), hcaldqm::ContainerProf2D::book(), hcaldqm::Container2D::book(), hcaldqm::Container1D::book(), PedestalTask::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) allIds.insert (item->mId);
144  for (std::set <unsigned long>::const_iterator channel = allIds.begin (); channel != allIds.end (); channel++) {
145  result.push_back (HcalGenericDetId (*channel));
146  }
147  return result;
148 }
std::vector< PrecisionItem > mPItems
std::vector< HcalTrigTowerDetId > HcalElectronicsMap::allTriggerId ( ) const

Definition at line 150 of file HcalElectronicsMap.cc.

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

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

Definition at line 48 of file HcalElectronicsMap.cc.

References mPItemsById, and edmPickEvents::target.

Referenced by lookup().

48  {
49  PrecisionItem target (fId, 0);
50  return HcalObjectAddons::findByT<PrecisionItem,HcalElectronicsMapAddons::LessById>(&target,mPItemsById);
51 }
std::vector< const PrecisionItem * > mPItemsById
const HcalElectronicsMap::TriggerItem * HcalElectronicsMap::findByTrigId ( unsigned long  fTrigId) const
protected

Definition at line 70 of file HcalElectronicsMap.cc.

References mTItemsByTrigId, and edmPickEvents::target.

Referenced by lookupTrigger().

70  {
71  TriggerItem target (fTrigId,0);
72  return HcalObjectAddons::findByT<TriggerItem,HcalElectronicsMapAddons::LessByTrigId>(&target,mTItemsByTrigId);
73 }
std::vector< const TriggerItem * > mTItemsByTrigId
const HcalElectronicsMap::PrecisionItem * HcalElectronicsMap::findPByElId ( unsigned long  fElId) const
protected

Definition at line 53 of file HcalElectronicsMap.cc.

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

Referenced by lookup().

53  {
54  HcalElectronicsId eid(fElId);
55  const PrecisionItem* i=&(mPItems[eid.linearIndex()]);
56 
57  if (i!=0 && i->mElId!=fElId) i=0;
58  return i;
59 }
std::vector< PrecisionItem > mPItems
Readout chain identification for Hcal.
const HcalElectronicsMap::TriggerItem * HcalElectronicsMap::findTByElId ( unsigned long  fElId) const
protected

Definition at line 61 of file HcalElectronicsMap.cc.

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

Referenced by lookupTrigger().

61  {
62  HcalElectronicsId eid(fElId);
63  const TriggerItem* i=&(mTItems[eid.linearIndex()]);
64 
65  if (i!=0 && i->mElId!=fElId) i=0;
66  return i;
67 }
std::vector< TriggerItem > mTItems
Readout chain identification for Hcal.
void HcalElectronicsMap::initialize ( )
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 80 of file HcalElectronicsMap.cc.

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

80  {
81  const PrecisionItem* item = findById (fId.rawId ());
82  return HcalElectronicsId (item ? item->mElId : 0);
83 }
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
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 95 of file HcalElectronicsMap.cc.

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

95  {
96  const PrecisionItem* i=&(mPItems[pid.linearIndex()]);
97  if (i!=0 && i->mId!=0) {
98  eid=HcalElectronicsId(i->mElId);
99  did=HcalGenericDetId(i->mId);
100  return true;
101  } else return false;
102 }
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 104 of file HcalElectronicsMap.cc.

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

104  {
105  const TriggerItem* i=&(mTItems[pid.linearIndex()]);
106  if (i!=0 && i->mTrigId!=0) {
107  eid=HcalElectronicsId(i->mElId);
108  did=HcalGenericDetId(i->mTrigId);
109  return true;
110  } else return false;
111 }
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 85 of file HcalElectronicsMap.cc.

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

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

85  {
86  const TriggerItem* item = findTByElId (fId.rawId ());
87  return DetId (item ? item->mTrigId : 0);
88 }
uint32_t rawId() const
Definition: DetId.h:18
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 90 of file HcalElectronicsMap.cc.

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

90  {
91  const TriggerItem* item = findByTrigId (fId.rawId ());
92  return HcalElectronicsId (item ? item->mElId : 0);
93 }
const TriggerItem * findByTrigId(unsigned long fTrigId) const
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
Readout chain identification for Hcal.
HcalElectronicsMap & HcalElectronicsMap::operator= ( const HcalElectronicsMap rhs)

Definition at line 30 of file HcalElectronicsMap.cc.

References swap(), and groupFilesInBlocks::temp.

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

Definition at line 196 of file HcalElectronicsMap.cc.

References HcalElectronicsMapAddons::Helper::mPItems.

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

Definition at line 200 of file HcalElectronicsMap.cc.

References HcalElectronicsMapAddons::Helper::mTItems.

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

Definition at line 36 of file HcalElectronicsMap.cc.

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

Referenced by operator=().

36  {
37  std::swap(mPItems, other.mPItems);
38  std::swap(mTItems, other.mTItems);
41 }
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 116 of file HcalElectronicsMap.h.

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

Definition at line 116 of file HcalElectronicsMap.h.

Member Data Documentation

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

Definition at line 108 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 109 of file HcalElectronicsMap.h.

Referenced by findByTrigId(), and swap().