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() [1/4]

HcalFrontEndMap::HcalFrontEndMap ( )
inline

Definition at line 39 of file HcalFrontEndMap.h.

39 {}

◆ HcalFrontEndMap() [2/4]

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 }
Definition: helper.py:1
std::vector< PrecisionItem > mPItems

◆ ~HcalFrontEndMap()

HcalFrontEndMap::~HcalFrontEndMap ( )

Definition at line 16 of file HcalFrontEndMap.cc.

16 {}

◆ HcalFrontEndMap() [3/4]

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() [4/4]

HcalFrontEndMap::HcalFrontEndMap ( HcalFrontEndMap &&  other)

Definition at line 35 of file HcalFrontEndMap.cc.

References trackingPlots::other.

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

Member Function Documentation

◆ allDetIds()

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

Definition at line 84 of file HcalFrontEndMap.cc.

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

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

◆ allRBXs()

std::vector< std::string > HcalFrontEndMap::allRBXs ( ) const

Definition at line 101 of file HcalFrontEndMap.cc.

References spr::find(), B2GTnPMonitor_cfi::item, 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

◆ allRMs()

std::vector< int > HcalFrontEndMap::allRMs ( ) const

Definition at line 92 of file HcalFrontEndMap.cc.

References spr::find(), B2GTnPMonitor_cfi::item, 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

◆ findById()

const HcalFrontEndMap::PrecisionItem * HcalFrontEndMap::findById ( uint32_t  fId) const

Definition at line 37 of file HcalFrontEndMap.cc.

References mPItemsById, and filterCSVwithJSON::target.

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

◆ initialize()

void HcalFrontEndMap::initialize ( )

Definition at line 114 of file HcalFrontEndMap.cc.

References sortById().

Referenced by HcalFrontEndMap().

◆ lookupRBX()

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 B2GTnPMonitor_cfi::item, and DetId::rawId().

Referenced by HBHEIsolatedNoiseReflagger::DumpHBHEHitMap().

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

◆ lookupRBXIndex()

const int HcalFrontEndMap::lookupRBXIndex ( DetId  fId) const

Definition at line 76 of file HcalFrontEndMap.cc.

References triggerObjects_cff::id, B2GTnPMonitor_cfi::item, 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 }
const PrecisionItem * findById(uint32_t fId) const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57

◆ lookupRM()

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 B2GTnPMonitor_cfi::item, and DetId::rawId().

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

◆ lookupRMIndex()

const int HcalFrontEndMap::lookupRMIndex ( DetId  fId) const

Definition at line 63 of file HcalFrontEndMap.cc.

References triggerObjects_cff::id, B2GTnPMonitor_cfi::item, 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 }
const PrecisionItem * findById(uint32_t fId) const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57

◆ maxRMIndex()

const int HcalFrontEndMap::maxRMIndex ( ) const
inline

Definition at line 58 of file HcalFrontEndMap.h.

References HcalFrontEndId::maxRmIndex.

Referenced by HBHEStatusBitSetter::SetFrontEndMap().

static const int maxRmIndex

◆ operator=()

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

Definition at line 22 of file HcalFrontEndMap.cc.

References groupFilesInBlocks::temp.

22  {
23  HcalFrontEndMap temp(rhs);
24  temp.swap(*this);
25  return *this;
26 }

◆ serialize()

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

◆ sortById()

void HcalFrontEndMap::sortById ( )

Definition at line 110 of file HcalFrontEndMap.cc.

Referenced by initialize().

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

◆ swap()

void HcalFrontEndMap::swap ( HcalFrontEndMap other)

Definition at line 29 of file HcalFrontEndMap.cc.

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

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

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 79 of file HcalFrontEndMap.h.

◆ cond::serialization::access

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

Definition at line 79 of file HcalFrontEndMap.h.

Member Data Documentation

◆ mPItems

std::vector<PrecisionItem> HcalFrontEndMap::mPItems
protected

Definition at line 76 of file HcalFrontEndMap.h.

Referenced by swap().

◆ mPItemsById

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

Definition at line 77 of file HcalFrontEndMap.h.

Referenced by findById(), and swap().