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 HcalFrontEndMap &src)
 
 HcalFrontEndMap (const HcalFrontEndMapAddons::Helper &helper)
 
 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.

12  : mPItems(helper.mPItems.begin(), helper.mPItems.end()) {
13  initialize();
14 }

References initialize().

◆ ~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) {}

◆ HcalFrontEndMap() [4/4]

HcalFrontEndMap::HcalFrontEndMap ( HcalFrontEndMap &&  other)

Definition at line 35 of file HcalFrontEndMap.cc.

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

References trackingPlots::other.

Member Function Documentation

◆ allDetIds()

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

Definition at line 84 of file HcalFrontEndMap.cc.

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 }

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

◆ allRBXs()

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

Definition at line 101 of file HcalFrontEndMap.cc.

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 }

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

◆ allRMs()

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

Definition at line 92 of file HcalFrontEndMap.cc.

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 }

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

◆ findById()

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

Definition at line 37 of file HcalFrontEndMap.cc.

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

References mPItemsById, and filterCSVwithJSON::target.

◆ 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.

71  {
72  const PrecisionItem* item = findById(fId.rawId());
73  return (item ? item->mRBX : "");
74 }

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

Referenced by HBHEIsolatedNoiseReflagger::DumpHBHEHitMap().

◆ lookupRBXIndex()

const int HcalFrontEndMap::lookupRBXIndex ( DetId  fId) const

Definition at line 76 of file HcalFrontEndMap.cc.

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 }

References triggerObjects_cff::id, B2GTnPMonitor_cfi::item, and DetId::rawId().

Referenced by HBHEHitMapOrganizer::HBHEHitMapOrganizer().

◆ 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.

58  {
59  const PrecisionItem* item = findById(fId.rawId());
60  return (item ? item->mRM : 0);
61 }

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

◆ lookupRMIndex()

const int HcalFrontEndMap::lookupRMIndex ( DetId  fId) const

◆ maxRMIndex()

const int HcalFrontEndMap::maxRMIndex ( ) const
inline

Definition at line 58 of file HcalFrontEndMap.h.

References HcalFrontEndId::maxRmIndex.

Referenced by HBHEStatusBitSetter::SetFrontEndMap().

◆ operator=()

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

Definition at line 22 of file HcalFrontEndMap.cc.

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

References groupFilesInBlocks::temp.

◆ 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.

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

Referenced by initialize().

◆ swap()

void HcalFrontEndMap::swap ( HcalFrontEndMap other)

Definition at line 29 of file HcalFrontEndMap.cc.

29  {
30  std::swap(mPItems, other.mPItems);
31  std::swap(mPItemsById, other.mPItemsById);
32 }

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

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().

HcalFrontEndMap::initialize
void initialize()
Definition: HcalFrontEndMap.cc:114
HcalFrontEndMap::sortById
void sortById()
Definition: HcalFrontEndMap.cc:110
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
HcalFrontEndMap::mPItems
std::vector< PrecisionItem > mPItems
Definition: HcalFrontEndMap.h:76
DetId
Definition: DetId.h:17
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
HcalFrontEndId::maxRmIndex
static const int maxRmIndex
Definition: HcalFrontEndId.h:21
HcalFrontEndId
Definition: HcalFrontEndId.h:8
trackingPlots.other
other
Definition: trackingPlots.py:1467
TrackRefitter_38T_cff.src
src
Definition: TrackRefitter_38T_cff.py:24
helper
Definition: helper.py:1
HcalFrontEndMap::HcalFrontEndMap
HcalFrontEndMap()
Definition: HcalFrontEndMap.h:39
HcalFrontEndMap::mPItemsById
std::vector< const PrecisionItem * > mPItemsById
Definition: HcalFrontEndMap.h:77
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
HcalFrontEndMap
Definition: HcalFrontEndMap.h:23
filterCSVwithJSON.target
target
Definition: filterCSVwithJSON.py:32
mps_fire.result
result
Definition: mps_fire.py:311
HcalFrontEndMap::findById
const PrecisionItem * findById(uint32_t fId) const
Definition: HcalFrontEndMap.cc:37