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
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 HcalDcsMapAddons::Helper &helper)
 
 HcalDcsMap (const HcalDcsMap &src)
 
 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::HcalDcsMap ( )
inline

Definition at line 46 of file HcalDcsMap.h.

46 {}
HcalDcsMap::HcalDcsMap ( const HcalDcsMapAddons::Helper helper)

Definition at line 18 of file HcalDcsMap.cc.

References initialize().

18  : mItems(helper.mItems.begin(), helper.mItems.end()) {
19  initialize();
20 }
std::set< HcalDcsMap::Item, LessByDcsId > mItems
Definition: HcalDcsMap.h:154
void initialize()
Definition: HcalDcsMap.cc:169
std::vector< Item > mItems
Definition: HcalDcsMap.h:122
HcalDcsMap::~HcalDcsMap ( )

Definition at line 22 of file HcalDcsMap.cc.

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

Definition at line 24 of file HcalDcsMap.cc.

std::vector< const Item * > mItemsByDcsId
Definition: HcalDcsMap.h:124
std::vector< Item > mItems
Definition: HcalDcsMap.h:122
std::vector< const Item * > mItemsById
Definition: HcalDcsMap.h:123
HcalDcsMap::HcalDcsMap ( HcalDcsMap &&  other)

Definition at line 39 of file HcalDcsMap.cc.

References swap().

39 : HcalDcsMap() { other.swap(*this); }
void swap(HcalDcsMap &other)
Definition: HcalDcsMap.cc:33

Member Function Documentation

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

Definition at line 120 of file HcalDcsMap.cc.

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

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 }
tuple result
Definition: mps_fire.py:311
std::vector< Item > mItems
Definition: HcalDcsMap.h:122
std::vector< HcalGenericDetId > HcalDcsMap::allHcalDetId ( ) const
protected

Definition at line 129 of file HcalDcsMap.cc.

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

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 }
tuple result
Definition: mps_fire.py:311
std::vector< Item > mItems
Definition: HcalDcsMap.h:122
HcalDcsMap::const_iterator HcalDcsMap::beginByDcsId ( void  ) const

Definition at line 47 of file HcalDcsMap.cc.

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

47  {
48  const_iterator _iter;
49  _iter.fIter = mItemsByDcsId.begin();
50  return _iter;
51 }
std::vector< const Item * > mItemsByDcsId
Definition: HcalDcsMap.h:124
HcalDcsMap::const_iterator HcalDcsMap::beginById ( void  ) const

Definition at line 41 of file HcalDcsMap.cc.

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

41  {
42  const_iterator _iter;
43  _iter.fIter = mItemsById.begin();
44  return _iter;
45 }
std::vector< const Item * > mItemsById
Definition: HcalDcsMap.h:123
HcalDcsMap::const_iterator HcalDcsMap::endByDcsId ( void  ) const

Definition at line 59 of file HcalDcsMap.cc.

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

59  {
60  const_iterator _iter;
61  _iter.fIter = mItemsByDcsId.end();
62  return _iter;
63 }
std::vector< const Item * > mItemsByDcsId
Definition: HcalDcsMap.h:124
HcalDcsMap::const_iterator HcalDcsMap::endById ( void  ) const

Definition at line 53 of file HcalDcsMap.cc.

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

53  {
54  const_iterator _iter;
55  _iter.fIter = mItemsById.end();
56  return _iter;
57 }
std::vector< const Item * > mItemsById
Definition: HcalDcsMap.h:123
const HcalDcsMap::Item * HcalDcsMap::findByDcsId ( unsigned long  fDcsId) const

Definition at line 95 of file HcalDcsMap.cc.

References mItemsByDcsId, and filterCSVwithJSON::target.

Referenced by lookup().

95  {
96  Item target(0, fDcsId);
97  return HcalObjectAddons::findByT<Item, HcalDcsMapAddons::LessByDcsId>(&target, mItemsByDcsId);
98 }
std::vector< const Item * > mItemsByDcsId
Definition: HcalDcsMap.h:124
const HcalDcsMap::Item * HcalDcsMap::findById ( unsigned long  fId) const

Definition at line 90 of file HcalDcsMap.cc.

References mItemsById, and filterCSVwithJSON::target.

Referenced by lookup().

90  {
91  Item target(fId, 0);
92  return HcalObjectAddons::findByT<Item, HcalDcsMapAddons::LessById>(&target, mItemsById);
93 }
std::vector< const Item * > mItemsById
Definition: HcalDcsMap.h:123
void HcalDcsMap::initialize ( )

Definition at line 169 of file HcalDcsMap.cc.

References sortByDcsId(), and sortById().

Referenced by HcalDcsMap().

169  {
170  sortById();
171  sortByDcsId();
172 }
void sortById()
Definition: HcalDcsMap.cc:164
void sortByDcsId()
Definition: HcalDcsMap.cc:165
HcalDetId HcalDcsMap::lookup ( HcalDcsDetId  fId) const

Definition at line 100 of file HcalDcsMap.cc.

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

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 }
int subchannel() const
Definition: HcalDcsDetId.h:58
uint32_t mId
Definition: HcalDcsMap.h:40
HcalOtherSubdetector subdet() const
get the category
int slice() const
Definition: HcalDcsDetId.h:56
const Item * findByDcsId(unsigned long fDcsId) const
Definition: HcalDcsMap.cc:95
int ring() const
Definition: HcalDcsDetId.h:55
HcalDcsDetId HcalDcsMap::lookup ( HcalDetId  fId,
HcalDcsDetId::DcsType  type 
) const

Definition at line 113 of file HcalDcsMap.cc.

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

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 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const Item * findById(unsigned long fId) const
Definition: HcalDcsMap.cc:90
HcalDcsMap & HcalDcsMap::operator= ( const HcalDcsMap rhs)

Definition at line 27 of file HcalDcsMap.cc.

References swap(), and groupFilesInBlocks::temp.

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

Definition at line 165 of file HcalDcsMap.cc.

References mItems, and mItemsByDcsId.

Referenced by initialize().

165  {
166  HcalObjectAddons::sortByT<Item, HcalDcsMapAddons::LessByDcsId>(mItems, mItemsByDcsId);
167 }
std::vector< const Item * > mItemsByDcsId
Definition: HcalDcsMap.h:124
std::vector< Item > mItems
Definition: HcalDcsMap.h:122
void HcalDcsMap::sortById ( )

Definition at line 164 of file HcalDcsMap.cc.

References mItems, and mItemsById.

Referenced by initialize().

164 { HcalObjectAddons::sortByT<Item, HcalDcsMapAddons::LessById>(mItems, mItemsById); }
std::vector< Item > mItems
Definition: HcalDcsMap.h:122
std::vector< const Item * > mItemsById
Definition: HcalDcsMap.h:123
void HcalDcsMap::swap ( HcalDcsMap other)

Definition at line 33 of file HcalDcsMap.cc.

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

Referenced by HcalDcsMap(), and operator=().

33  {
34  std::swap(mItems, other.mItems);
37 }
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
std::vector< const Item * > mItemsByDcsId
Definition: HcalDcsMap.h:124
std::vector< Item > mItems
Definition: HcalDcsMap.h:122
std::vector< const Item * > mItemsById
Definition: HcalDcsMap.h:123

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 126 of file HcalDcsMap.h.

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

Definition at line 126 of file HcalDcsMap.h.

Member Data Documentation

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

Definition at line 124 of file HcalDcsMap.h.

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

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

Definition at line 123 of file HcalDcsMap.h.

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