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 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 48 of file HcalDcsMap.h.

References trackingPlots::other, TrackRefitter_38T_cff::src, and edm::swap().

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

Definition at line 18 of file HcalDcsMap.cc.

References initialize().

18  :
19  mItems(helper.mItems.begin(),helper.mItems.end())
20 {
21  initialize();
22 }
void initialize()
Definition: HcalDcsMap.cc:188
std::vector< Item > mItems
Definition: HcalDcsMap.h:123
std::set< HcalDcsMap::Item, LessByDcsId > mItems
Definition: HcalDcsMap.h:171
HcalDcsMap::~HcalDcsMap ( )

Definition at line 24 of file HcalDcsMap.cc.

24  {
25 }
HcalDcsMap::HcalDcsMap ( const HcalDcsMap src)

Definition at line 27 of file HcalDcsMap.cc.

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

Definition at line 44 of file HcalDcsMap.cc.

References trackingPlots::other.

45  : HcalDcsMap() {
46  other.swap(*this);
47 }
void swap(HcalDcsMap &other)
Definition: HcalDcsMap.cc:38

Member Function Documentation

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

Definition at line 137 of file HcalDcsMap.cc.

References mItems, and mps_fire::result.

137  {
138  std::vector <HcalDcsDetId> result;
139  for (std::vector<Item>::const_iterator item = mItems.begin (); item != mItems.end (); item++)
140  if (item->mDcsId) result.push_back(HcalDcsDetId(item->mDcsId));
141  return result;
142 }
std::vector< Item > mItems
Definition: HcalDcsMap.h:123
std::vector< HcalGenericDetId > HcalDcsMap::allHcalDetId ( ) const
protected

Definition at line 145 of file HcalDcsMap.cc.

References mItems, and mps_fire::result.

145  {
146  std::vector <HcalGenericDetId> result;
147  std::set <unsigned long> allIds;
148  for (std::vector<Item>::const_iterator item = mItems.begin (); item != mItems.end (); item++)
149  if (item->mId) allIds.insert (item->mId);
150  for (std::set <unsigned long>::const_iterator channel = allIds.begin (); channel != allIds.end (); channel++) {
151  result.push_back (HcalGenericDetId (*channel));
152  }
153  return result;
154 }
std::vector< Item > mItems
Definition: HcalDcsMap.h:123
HcalDcsMap::const_iterator HcalDcsMap::beginByDcsId ( void  ) const

Definition at line 55 of file HcalDcsMap.cc.

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

55  {
56  const_iterator _iter;
57  _iter.fIter = mItemsByDcsId.begin();
58  return _iter;
59 }
std::vector< const Item * > mItemsByDcsId
Definition: HcalDcsMap.h:125
HcalDcsMap::const_iterator HcalDcsMap::beginById ( void  ) const

Definition at line 49 of file HcalDcsMap.cc.

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

Referenced by HcalDbASCIIIO::createObject< HcalDcsMap >().

49  {
50  const_iterator _iter;
51  _iter.fIter = mItemsById.begin();
52  return _iter;
53 }
std::vector< const Item * > mItemsById
Definition: HcalDcsMap.h:124
HcalDcsMap::const_iterator HcalDcsMap::endByDcsId ( void  ) const

Definition at line 67 of file HcalDcsMap.cc.

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

67  {
68  const_iterator _iter;
69  _iter.fIter = mItemsByDcsId.end();
70  return _iter;
71 }
std::vector< const Item * > mItemsByDcsId
Definition: HcalDcsMap.h:125
HcalDcsMap::const_iterator HcalDcsMap::endById ( void  ) const

Definition at line 61 of file HcalDcsMap.cc.

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

Referenced by HcalDbASCIIIO::createObject< HcalDcsMap >().

61  {
62  const_iterator _iter;
63  _iter.fIter = mItemsById.end();
64  return _iter;
65 }
std::vector< const Item * > mItemsById
Definition: HcalDcsMap.h:124
const HcalDcsMap::Item * HcalDcsMap::findByDcsId ( unsigned long  fDcsId) const

Definition at line 107 of file HcalDcsMap.cc.

References mItemsByDcsId, and edmPickEvents::target.

Referenced by lookup().

107  {
108  Item target(0,fDcsId);
109  return HcalObjectAddons::findByT<Item,HcalDcsMapAddons::LessByDcsId>(&target,mItemsByDcsId);
110 }
std::vector< const Item * > mItemsByDcsId
Definition: HcalDcsMap.h:125
const HcalDcsMap::Item * HcalDcsMap::findById ( unsigned long  fId) const

Definition at line 102 of file HcalDcsMap.cc.

References mItemsById, and edmPickEvents::target.

Referenced by lookup().

102  {
103  Item target(fId,0);
104  return HcalObjectAddons::findByT<Item,HcalDcsMapAddons::LessById>(&target,mItemsById);
105 }
std::vector< const Item * > mItemsById
Definition: HcalDcsMap.h:124
void HcalDcsMap::initialize ( )

Definition at line 188 of file HcalDcsMap.cc.

References sortByDcsId(), and sortById().

Referenced by cond::createPayload< HcalCalibrationQIEData >(), and HcalDcsMap().

188  {
189  sortById();
190  sortByDcsId();
191 }
void sortById()
Definition: HcalDcsMap.cc:181
void sortByDcsId()
Definition: HcalDcsMap.cc:184
HcalDetId HcalDcsMap::lookup ( HcalDcsDetId  fId) const

Definition at line 112 of file HcalDcsMap.cc.

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

112  {
113  // DCS type is a part of DcsDetId but it does not make sense to keep
114  // duplicate records in the map for DCS channels where only type is different.
115  // Hence, the type in HcalDcsDetId is always forced to DCSUNKNOWN
116  HcalDcsDetId fDcsId_notype(fId.subdet(),
117  fId.ring(), // side is already included
118  fId.slice(),
120  fId.subchannel());
121  auto item = HcalDcsMap::findByDcsId (fDcsId_notype.rawId ());
122  return item ? item->mId : 0;
123 }
int subchannel() const
Definition: HcalDcsDetId.h:49
uint32_t mId
Definition: HcalDcsMap.h:42
HcalOtherSubdetector subdet() const
get the category
int slice() const
Definition: HcalDcsDetId.h:47
const Item * findByDcsId(unsigned long fDcsId) const
Definition: HcalDcsMap.cc:107
int ring() const
Definition: HcalDcsDetId.h:46
HcalDcsDetId HcalDcsMap::lookup ( HcalDetId  fId,
HcalDcsDetId::DcsType  type 
) const

Definition at line 125 of file HcalDcsMap.cc.

References electrons_cff::_id, findById(), and DetId::rawId().

125  {
126  auto item = HcalDcsMap::findById (fId.rawId ());
127  HcalDcsDetId _id(item ? item->mId : 0);
128  return HcalDcsDetId(_id.subdet(),
129  _id.zside()*_id.ring(),
130  _id.slice(),
131  type,
132  _id.subchannel()
133  );
134 }
type
Definition: HCALResponse.h:21
const Item * findById(unsigned long fId) const
Definition: HcalDcsMap.cc:102
uint32_t rawId() const
get the raw id
Definition: DetId.h:44
HcalDcsMap & HcalDcsMap::operator= ( const HcalDcsMap rhs)

Definition at line 32 of file HcalDcsMap.cc.

References swap(), and groupFilesInBlocks::temp.

32  {
33  HcalDcsMap temp(rhs);
34  temp.swap(*this);
35  return *this;
36 }
template<class Archive >
void HcalDcsMap::serialize ( Archive &  ar,
const unsigned int  version 
)
private
void HcalDcsMap::sortByDcsId ( )

Definition at line 184 of file HcalDcsMap.cc.

References mItems, and mItemsByDcsId.

Referenced by initialize().

184  {
185  HcalObjectAddons::sortByT<Item,HcalDcsMapAddons::LessByDcsId>(mItems,mItemsByDcsId);
186 }
std::vector< const Item * > mItemsByDcsId
Definition: HcalDcsMap.h:125
std::vector< Item > mItems
Definition: HcalDcsMap.h:123
void HcalDcsMap::sortById ( )

Definition at line 181 of file HcalDcsMap.cc.

References mItems, and mItemsById.

Referenced by initialize().

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

Definition at line 38 of file HcalDcsMap.cc.

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

Referenced by operator=().

38  {
39  std::swap(mItems, other.mItems);
42 }
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
std::vector< const Item * > mItemsByDcsId
Definition: HcalDcsMap.h:125
std::vector< Item > mItems
Definition: HcalDcsMap.h:123
std::vector< const Item * > mItemsById
Definition: HcalDcsMap.h:124

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 127 of file HcalDcsMap.h.

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

Definition at line 127 of file HcalDcsMap.h.

Member Data Documentation

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

Definition at line 125 of file HcalDcsMap.h.

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

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

Definition at line 124 of file HcalDcsMap.h.

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