CMS 3D CMS Logo

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

#include <HcalFrontEndMap.h>

Classes

class  PrecisionItem
 

Public Member Functions

std::vector< DetIdallDetIds () const
 
std::vector< std::string > allRBXs () const
 
std::vector< int > allRMs () const
 
const PrecisionItemfindById (uint32_t fId) const
 
 HcalFrontEndMap ()
 
 HcalFrontEndMap (const HcalFrontEndMapAddons::Helper &helper)
 
 HcalFrontEndMap (const HcalFrontEndMap &src)
 
 HcalFrontEndMap (HcalFrontEndMap &&other)
 
void initialize ()
 
const std::string lookupRBX (DetId fId) const
 brief lookup the RBX associated with the given logical id More...
 
const int lookupRBXIndex (DetId fId) const
 
const int lookupRM (DetId fId) const
 brief lookup the RM associated with the given logical id More...
 
const int lookupRMIndex (DetId fId) const
 
const int maxRMIndex () const
 
HcalFrontEndMapoperator= (const HcalFrontEndMap &rhs)
 
void sortById ()
 
void swap (HcalFrontEndMap &other)
 
 ~HcalFrontEndMap ()
 

Protected Attributes

std::vector< PrecisionItemmPItems
 
std::vector< const PrecisionItem * > mPItemsById
 

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

Definition at line 23 of file HcalFrontEndMap.h.

Constructor & Destructor Documentation

HcalFrontEndMap::HcalFrontEndMap ( )
inline

Definition at line 39 of file HcalFrontEndMap.h.

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

39 {}
HcalFrontEndMap::HcalFrontEndMap ( const HcalFrontEndMapAddons::Helper helper)

Definition at line 11 of file HcalFrontEndMap.cc.

References initialize().

12  : mPItems(helper.mPItems.begin(), helper.mPItems.end()) {
13  initialize();
14 }
std::set< HcalFrontEndMap::PrecisionItem, LessById > mPItems
std::vector< PrecisionItem > mPItems
HcalFrontEndMap::~HcalFrontEndMap ( )

Definition at line 16 of file HcalFrontEndMap.cc.

16 {}
HcalFrontEndMap::HcalFrontEndMap ( const HcalFrontEndMap src)

Definition at line 19 of file HcalFrontEndMap.cc.

19 : mPItems(src.mPItems), mPItemsById(src.mPItemsById) {}
std::vector< const PrecisionItem * > mPItemsById
std::vector< PrecisionItem > mPItems
HcalFrontEndMap::HcalFrontEndMap ( HcalFrontEndMap &&  other)

Definition at line 35 of file HcalFrontEndMap.cc.

References trackingPlots::other.

35 : HcalFrontEndMap() { other.swap(*this); }
void swap(HcalFrontEndMap &other)

Member Function Documentation

std::vector< DetId > HcalFrontEndMap::allDetIds ( ) const

Definition at line 84 of file HcalFrontEndMap.cc.

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

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

84  {
85  std::vector<DetId> result;
86  for (std::vector<PrecisionItem>::const_iterator item = mPItems.begin(); item != mPItems.end(); item++)
87  if (item->mId)
88  result.push_back(DetId(item->mId));
89  return result;
90 }
Definition: DetId.h:17
std::vector< PrecisionItem > mPItems
std::vector< std::string > HcalFrontEndMap::allRBXs ( ) const

Definition at line 101 of file HcalFrontEndMap.cc.

References spr::find(), B2GTnPMonitor_cfi::item, mPItems, and mps_fire::result.

101  {
102  std::vector<std::string> result;
103  for (std::vector<PrecisionItem>::const_iterator item = mPItems.begin(); item != mPItems.end(); item++) {
104  if (std::find(result.begin(), result.end(), item->mRBX) == result.end())
105  result.push_back(item->mRBX);
106  }
107  return result;
108 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::vector< PrecisionItem > mPItems
std::vector< int > HcalFrontEndMap::allRMs ( ) const

Definition at line 92 of file HcalFrontEndMap.cc.

References spr::find(), B2GTnPMonitor_cfi::item, mPItems, and mps_fire::result.

92  {
93  std::vector<int> result;
94  for (std::vector<PrecisionItem>::const_iterator item = mPItems.begin(); item != mPItems.end(); item++) {
95  if (std::find(result.begin(), result.end(), item->mRM) == result.end())
96  result.push_back(item->mRM);
97  }
98  return result;
99 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::vector< PrecisionItem > mPItems
const HcalFrontEndMap::PrecisionItem * HcalFrontEndMap::findById ( uint32_t  fId) const

Definition at line 37 of file HcalFrontEndMap.cc.

References mPItemsById, and filterCSVwithJSON::target.

Referenced by lookupRBX(), lookupRBXIndex(), lookupRM(), and lookupRMIndex().

37  {
38  PrecisionItem target(fId, 0, "");
39  return HcalObjectAddons::findByT<PrecisionItem, HcalFrontEndMapAddons::LessById>(&target, mPItemsById);
40 }
std::vector< const PrecisionItem * > mPItemsById
void HcalFrontEndMap::initialize ( )
const std::string HcalFrontEndMap::lookupRBX ( DetId  fId) const

brief lookup the RBX associated with the given logical id

Definition at line 71 of file HcalFrontEndMap.cc.

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

Referenced by HcalDbASCIIIO::createObject< HcalFrontEndMap >(), and HBHEIsolatedNoiseReflagger::DumpHBHEHitMap().

71  {
72  const PrecisionItem* item = findById(fId.rawId());
73  return (item ? item->mRBX : "");
74 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const PrecisionItem * findById(uint32_t fId) const
const int HcalFrontEndMap::lookupRBXIndex ( DetId  fId) const

Definition at line 76 of file HcalFrontEndMap.cc.

References findById(), triggerObjects_cff::id, B2GTnPMonitor_cfi::item, HcalFrontEndMap::PrecisionItem::mRBX, HcalFrontEndMap::PrecisionItem::mRM, and DetId::rawId().

Referenced by HBHEHitMapOrganizer::HBHEHitMapOrganizer().

76  {
77  const PrecisionItem* item = findById(fId.rawId());
79  if (item)
80  id = HcalFrontEndId(item->mRBX, item->mRM, 0, 1, 0, 1, 0);
81  return id.rbxIndex();
82 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const PrecisionItem * findById(uint32_t fId) const
const int HcalFrontEndMap::lookupRM ( DetId  fId) const

brief lookup the RM associated with the given logical id

Definition at line 58 of file HcalFrontEndMap.cc.

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

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

58  {
59  const PrecisionItem* item = findById(fId.rawId());
60  return (item ? item->mRM : 0);
61 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const PrecisionItem * findById(uint32_t fId) const
const int HcalFrontEndMap::lookupRMIndex ( DetId  fId) const

Definition at line 63 of file HcalFrontEndMap.cc.

References findById(), triggerObjects_cff::id, B2GTnPMonitor_cfi::item, HcalFrontEndMap::PrecisionItem::mRBX, HcalFrontEndMap::PrecisionItem::mRM, and DetId::rawId().

Referenced by HBHEIsolatedNoiseReflagger::DumpHBHEHitMap(), HBHEHitMapOrganizer::getHPDNeighbors(), HBHEHitMapOrganizer::HBHEHitMapOrganizer(), HBHEStatusBitSetter::rememberHit(), and HBHEStatusBitSetter::SetFlagsFromRecHits().

63  {
64  const PrecisionItem* item = findById(fId.rawId());
66  if (item)
67  id = HcalFrontEndId(item->mRBX, item->mRM, 0, 1, 0, 1, 0);
68  return id.rmIndex();
69 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const PrecisionItem * findById(uint32_t fId) const
const int HcalFrontEndMap::maxRMIndex ( ) const
inline
HcalFrontEndMap & HcalFrontEndMap::operator= ( const HcalFrontEndMap rhs)

Definition at line 22 of file HcalFrontEndMap.cc.

References swap(), and groupFilesInBlocks::temp.

22  {
23  HcalFrontEndMap temp(rhs);
24  temp.swap(*this);
25  return *this;
26 }
template<class Archive >
void HcalFrontEndMap::serialize ( Archive &  ar,
const unsigned int  version 
)
private
void HcalFrontEndMap::sortById ( )

Definition at line 110 of file HcalFrontEndMap.cc.

References mPItems, and mPItemsById.

Referenced by initialize().

110  {
111  HcalObjectAddons::sortByT<PrecisionItem, HcalFrontEndMapAddons::LessById>(mPItems, mPItemsById);
112 }
std::vector< const PrecisionItem * > mPItemsById
std::vector< PrecisionItem > mPItems
void HcalFrontEndMap::swap ( HcalFrontEndMap other)

Definition at line 29 of file HcalFrontEndMap.cc.

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

Referenced by operator=().

29  {
30  std::swap(mPItems, other.mPItems);
32 }
std::vector< const PrecisionItem * > mPItemsById
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
std::vector< PrecisionItem > mPItems

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 79 of file HcalFrontEndMap.h.

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

Definition at line 79 of file HcalFrontEndMap.h.

Member Data Documentation

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

Definition at line 77 of file HcalFrontEndMap.h.

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