CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Friends
HcalDcsMap Class Reference

#include <HcalDcsMap.h>

Classes

class  const_iterator
 
class  Item
 

Public Member Functions

const_iterator beginByDcsId (void) const
 
const_iterator beginById (void) const
 
const_iterator endByDcsId (void) const
 
const_iterator endById (void) const
 
const ItemfindByDcsId (unsigned long fDcsId) const
 
const ItemfindById (unsigned long fId) const
 
 HcalDcsMap ()
 
 HcalDcsMap (const HcalDcsMap &src)
 
 HcalDcsMap (const HcalDcsMapAddons::Helper &helper)
 
 HcalDcsMap (HcalDcsMap &&other)
 
void initialize ()
 
HcalDetId lookup (HcalDcsDetId fId) const
 
HcalDcsDetId lookup (HcalDetId fId, HcalDcsDetId::DcsType type) const
 
HcalDcsMapoperator= (const HcalDcsMap &rhs)
 
void sortByDcsId ()
 
void sortById ()
 
void swap (HcalDcsMap &other)
 
 ~HcalDcsMap ()
 

Protected Member Functions

std::vector< HcalDcsDetIdallHcalDcsDetId () const
 
std::vector< HcalGenericDetIdallHcalDetId () const
 

Protected Attributes

std::vector< ItemmItems
 
std::vector< const Item * > mItemsByDcsId
 
std::vector< const Item * > mItemsById
 

Private Member Functions

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

Friends

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

Detailed Description

Author
Gena Kukartsev POOL object to store map between detector ID and DCS ID Inspired by HcalElectronicsMap $Author: kukartse
Date
2007/12/14 13:31:21
Revision
1.1
Author
Gena Kukartsev POOL object to store map between detector ID and DCS ID Inspired by HcalElectronicsMap $Author: kukartse
Date
2010/02/22 21:08:07
Revision
1.1

Definition at line 34 of file HcalDcsMap.h.

Constructor & Destructor Documentation

◆ HcalDcsMap() [1/4]

HcalDcsMap::HcalDcsMap ( )
inline

Definition at line 46 of file HcalDcsMap.h.

46 {}

◆ HcalDcsMap() [2/4]

HcalDcsMap::HcalDcsMap ( const HcalDcsMapAddons::Helper helper)

Definition at line 18 of file HcalDcsMap.cc.

18  : mItems(helper.mItems.begin(), helper.mItems.end()) {
19  initialize();
20 }

References initialize().

◆ ~HcalDcsMap()

HcalDcsMap::~HcalDcsMap ( )

Definition at line 22 of file HcalDcsMap.cc.

22 {}

◆ HcalDcsMap() [3/4]

HcalDcsMap::HcalDcsMap ( const HcalDcsMap src)

Definition at line 24 of file HcalDcsMap.cc.

25  : mItems(src.mItems), mItemsById(src.mItemsById), mItemsByDcsId(src.mItemsByDcsId) {}

◆ HcalDcsMap() [4/4]

HcalDcsMap::HcalDcsMap ( HcalDcsMap &&  other)

Definition at line 39 of file HcalDcsMap.cc.

39 : HcalDcsMap() { other.swap(*this); }

References trackingPlots::other.

Member Function Documentation

◆ allHcalDcsDetId()

std::vector< HcalDcsDetId > HcalDcsMap::allHcalDcsDetId ( ) const
protected

Definition at line 120 of file HcalDcsMap.cc.

120  {
121  std::vector<HcalDcsDetId> result;
122  for (std::vector<Item>::const_iterator item = mItems.begin(); item != mItems.end(); item++)
123  if (item->mDcsId)
124  result.push_back(HcalDcsDetId(item->mDcsId));
125  return result;
126 }

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

◆ allHcalDetId()

std::vector< HcalGenericDetId > HcalDcsMap::allHcalDetId ( ) const
protected

Definition at line 129 of file HcalDcsMap.cc.

129  {
130  std::vector<HcalGenericDetId> result;
131  std::set<unsigned long> allIds;
132  for (std::vector<Item>::const_iterator item = mItems.begin(); item != mItems.end(); item++)
133  if (item->mId)
134  allIds.insert(item->mId);
135  for (std::set<unsigned long>::const_iterator channel = allIds.begin(); channel != allIds.end(); channel++) {
136  result.push_back(HcalGenericDetId(*channel));
137  }
138  return result;
139 }

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

◆ beginByDcsId()

HcalDcsMap::const_iterator HcalDcsMap::beginByDcsId ( void  ) const

Definition at line 47 of file HcalDcsMap.cc.

47  {
48  const_iterator _iter;
49  _iter.fIter = mItemsByDcsId.begin();
50  return _iter;
51 }

References HcalDcsMap::const_iterator::fIter, and mItemsByDcsId.

◆ beginById()

HcalDcsMap::const_iterator HcalDcsMap::beginById ( void  ) const

Definition at line 41 of file HcalDcsMap.cc.

41  {
42  const_iterator _iter;
43  _iter.fIter = mItemsById.begin();
44  return _iter;
45 }

References HcalDcsMap::const_iterator::fIter, and mItemsById.

◆ endByDcsId()

HcalDcsMap::const_iterator HcalDcsMap::endByDcsId ( void  ) const

Definition at line 59 of file HcalDcsMap.cc.

59  {
60  const_iterator _iter;
61  _iter.fIter = mItemsByDcsId.end();
62  return _iter;
63 }

References HcalDcsMap::const_iterator::fIter, and mItemsByDcsId.

◆ endById()

HcalDcsMap::const_iterator HcalDcsMap::endById ( void  ) const

Definition at line 53 of file HcalDcsMap.cc.

53  {
54  const_iterator _iter;
55  _iter.fIter = mItemsById.end();
56  return _iter;
57 }

References HcalDcsMap::const_iterator::fIter, and mItemsById.

◆ findByDcsId()

const HcalDcsMap::Item * HcalDcsMap::findByDcsId ( unsigned long  fDcsId) const

Definition at line 95 of file HcalDcsMap.cc.

95  {
96  Item target(0, fDcsId);
97  return HcalObjectAddons::findByT<Item, HcalDcsMapAddons::LessByDcsId>(&target, mItemsByDcsId);
98 }

References mItemsByDcsId, and filterCSVwithJSON::target.

Referenced by lookup().

◆ findById()

const HcalDcsMap::Item * HcalDcsMap::findById ( unsigned long  fId) const

Definition at line 90 of file HcalDcsMap.cc.

90  {
91  Item target(fId, 0);
92  return HcalObjectAddons::findByT<Item, HcalDcsMapAddons::LessById>(&target, mItemsById);
93 }

References mItemsById, and filterCSVwithJSON::target.

Referenced by lookup().

◆ initialize()

void HcalDcsMap::initialize ( )

Definition at line 169 of file HcalDcsMap.cc.

169  {
170  sortById();
171  sortByDcsId();
172 }

References sortByDcsId(), and sortById().

Referenced by HcalDcsMap().

◆ lookup() [1/2]

HcalDetId HcalDcsMap::lookup ( HcalDcsDetId  fId) const

Definition at line 100 of file HcalDcsMap.cc.

100  {
101  // DCS type is a part of DcsDetId but it does not make sense to keep
102  // duplicate records in the map for DCS channels where only type is different.
103  // Hence, the type in HcalDcsDetId is always forced to DCSUNKNOWN
104  HcalDcsDetId fDcsId_notype(fId.subdet(),
105  fId.ring(), // side is already included
106  fId.slice(),
108  fId.subchannel());
109  auto item = HcalDcsMap::findByDcsId(fDcsId_notype.rawId());
110  return item ? item->mId : 0;
111 }

References HcalDcsDetId::DCSUNKNOWN, findByDcsId(), B2GTnPMonitor_cfi::item, HcalDcsDetId::ring(), HcalDcsDetId::slice(), HcalDcsDetId::subchannel(), and HcalOtherDetId::subdet().

◆ lookup() [2/2]

HcalDcsDetId HcalDcsMap::lookup ( HcalDetId  fId,
HcalDcsDetId::DcsType  type 
) const

Definition at line 113 of file HcalDcsMap.cc.

113  {
114  auto item = HcalDcsMap::findById(fId.rawId());
115  HcalDcsDetId _id(item ? item->mId : 0);
116  return HcalDcsDetId(_id.subdet(), _id.zside() * _id.ring(), _id.slice(), type, _id.subchannel());
117 }

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

◆ operator=()

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

Definition at line 27 of file HcalDcsMap.cc.

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

References groupFilesInBlocks::temp.

◆ serialize()

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

◆ sortByDcsId()

void HcalDcsMap::sortByDcsId ( )

Definition at line 165 of file HcalDcsMap.cc.

165  {
166  HcalObjectAddons::sortByT<Item, HcalDcsMapAddons::LessByDcsId>(mItems, mItemsByDcsId);
167 }

References mItems, and mItemsByDcsId.

Referenced by initialize().

◆ sortById()

void HcalDcsMap::sortById ( )

Definition at line 164 of file HcalDcsMap.cc.

164 { HcalObjectAddons::sortByT<Item, HcalDcsMapAddons::LessById>(mItems, mItemsById); }

References mItems, and mItemsById.

Referenced by initialize().

◆ swap()

void HcalDcsMap::swap ( HcalDcsMap other)

Definition at line 33 of file HcalDcsMap.cc.

33  {
34  std::swap(mItems, other.mItems);
35  std::swap(mItemsById, other.mItemsById);
36  std::swap(mItemsByDcsId, other.mItemsByDcsId);
37 }

References mItems, mItemsByDcsId, mItemsById, trackingPlots::other, and std::swap().

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 126 of file HcalDcsMap.h.

◆ cond::serialization::access

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

Definition at line 126 of file HcalDcsMap.h.

Member Data Documentation

◆ mItems

std::vector<Item> HcalDcsMap::mItems
protected

◆ mItemsByDcsId

std::vector<const Item*> HcalDcsMap::mItemsByDcsId
protected

Definition at line 124 of file HcalDcsMap.h.

Referenced by beginByDcsId(), endByDcsId(), findByDcsId(), sortByDcsId(), and swap().

◆ mItemsById

std::vector<const Item*> HcalDcsMap::mItemsById
protected

Definition at line 123 of file HcalDcsMap.h.

Referenced by beginById(), endById(), findById(), sortById(), and swap().

HcalDcsDetId::DCSUNKNOWN
Definition: HcalDcsDetId.h:42
HcalDcsMap::mItemsById
std::vector< const Item * > mItemsById
Definition: HcalDcsMap.h:123
HcalDcsDetId
Definition: HcalDcsDetId.h:27
HcalGenericDetId
Definition: HcalGenericDetId.h:15
HcalDcsDetId::ring
int ring() const
Definition: HcalDcsDetId.h:55
HcalDcsMap
Definition: HcalDcsMap.h:34
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
HcalDcsMap::initialize
void initialize()
Definition: HcalDcsMap.cc:169
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
HcalDcsMap::sortById
void sortById()
Definition: HcalDcsMap.cc:164
trackingPlots.other
other
Definition: trackingPlots.py:1465
TrackRefitter_38T_cff.src
src
Definition: TrackRefitter_38T_cff.py:24
helper
Definition: helper.py:1
HcalDcsMap::findById
const Item * findById(unsigned long fId) const
Definition: HcalDcsMap.cc:90
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
HcalDcsDetId::subchannel
int subchannel() const
Definition: HcalDcsDetId.h:58
HcalDcsDetId::slice
int slice() const
Definition: HcalDcsDetId.h:56
type
type
Definition: HCALResponse.h:21
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
HcalDcsMap::mItems
std::vector< Item > mItems
Definition: HcalDcsMap.h:122
HcalDcsMap::sortByDcsId
void sortByDcsId()
Definition: HcalDcsMap.cc:165
HcalDcsMap::mItemsByDcsId
std::vector< const Item * > mItemsByDcsId
Definition: HcalDcsMap.h:124
filterCSVwithJSON.target
target
Definition: filterCSVwithJSON.py:32
mps_fire.result
result
Definition: mps_fire.py:303
HcalOtherDetId::subdet
HcalOtherSubdetector subdet() const
get the category
Definition: HcalOtherDetId.h:30
HcalDcsMap::findByDcsId
const Item * findByDcsId(unsigned long fDcsId) const
Definition: HcalDcsMap.cc:95
HcalDcsMap::HcalDcsMap
HcalDcsMap()
Definition: HcalDcsMap.h:46