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 38 of file HcalFrontEndMap.h.

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

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

Definition at line 11 of file HcalFrontEndMap.cc.

References initialize().

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

Definition at line 18 of file HcalFrontEndMap.cc.

18  {
19 }
HcalFrontEndMap::HcalFrontEndMap ( const HcalFrontEndMap src)

Definition at line 22 of file HcalFrontEndMap.cc.

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

Definition at line 39 of file HcalFrontEndMap.cc.

References trackingPlots::other.

39  : HcalFrontEndMap() {
40  other.swap(*this);
41 }
void swap(HcalFrontEndMap &other)

Member Function Documentation

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

Definition at line 92 of file HcalFrontEndMap.cc.

References mPItems, and mps_fire::result.

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

92  {
93  std::vector <DetId> result;
94  for (std::vector<PrecisionItem>::const_iterator item = mPItems.begin ();
95  item != mPItems.end (); item++)
96  if (item->mId) result.push_back(DetId(item->mId));
97  return result;
98 }
Definition: DetId.h:18
std::vector< PrecisionItem > mPItems
std::vector< std::string > HcalFrontEndMap::allRBXs ( ) const

Definition at line 110 of file HcalFrontEndMap.cc.

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

110  {
111  std::vector <std::string> result;
112  for (std::vector<PrecisionItem>::const_iterator item = mPItems.begin ();
113  item != mPItems.end (); item++) {
114  if (std::find(result.begin(),result.end(),item->mRBX) == result.end())
115  result.push_back(item->mRBX);
116  }
117  return result;
118 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
std::vector< PrecisionItem > mPItems
std::vector< int > HcalFrontEndMap::allRMs ( ) const

Definition at line 100 of file HcalFrontEndMap.cc.

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

100  {
101  std::vector <int> result;
102  for (std::vector<PrecisionItem>::const_iterator item = mPItems.begin ();
103  item != mPItems.end (); item++) {
104  if (std::find(result.begin(),result.end(),item->mRM) == result.end())
105  result.push_back(item->mRM);
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:20
std::vector< PrecisionItem > mPItems
const HcalFrontEndMap::PrecisionItem * HcalFrontEndMap::findById ( uint32_t  fId) const

Definition at line 43 of file HcalFrontEndMap.cc.

References mPItemsById, and edmPickEvents::target.

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

43  {
44  PrecisionItem target (fId, 0, "");
45  return HcalObjectAddons::findByT<PrecisionItem,HcalFrontEndMapAddons::LessById>(&target,mPItemsById);
46 }
std::vector< const PrecisionItem * > mPItemsById
void HcalFrontEndMap::initialize ( )

Definition at line 124 of file HcalFrontEndMap.cc.

References sortById().

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

124  {
126  }
const std::string HcalFrontEndMap::lookupRBX ( DetId  fId) const

brief lookup the RBX associated with the given logical id

Definition at line 80 of file HcalFrontEndMap.cc.

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

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

80  {
81  const PrecisionItem* item = findById (fId.rawId ());
82  return (item ? item->mRBX : "");
83 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
const PrecisionItem * findById(uint32_t fId) const
const int HcalFrontEndMap::lookupRBXIndex ( DetId  fId) const

Definition at line 85 of file HcalFrontEndMap.cc.

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

Referenced by HBHEHitMapOrganizer::HBHEHitMapOrganizer().

85  {
86  const PrecisionItem* item = findById (fId.rawId ());
88  if (item) id = HcalFrontEndId(item->mRBX,item->mRM,0,1,0,1,0);
89  return id.rbxIndex();
90 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
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 68 of file HcalFrontEndMap.cc.

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

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

68  {
69  const PrecisionItem* item = findById (fId.rawId ());
70  return (item ? item->mRM : 0);
71 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
const PrecisionItem * findById(uint32_t fId) const
const int HcalFrontEndMap::lookupRMIndex ( DetId  fId) const

Definition at line 73 of file HcalFrontEndMap.cc.

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

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

73  {
74  const PrecisionItem* item = findById (fId.rawId ());
76  if (item) id = HcalFrontEndId(item->mRBX,item->mRM,0,1,0,1,0);
77  return id.rmIndex();
78 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
const PrecisionItem * findById(uint32_t fId) const
const int HcalFrontEndMap::maxRMIndex ( ) const
inline
HcalFrontEndMap & HcalFrontEndMap::operator= ( const HcalFrontEndMap rhs)

Definition at line 26 of file HcalFrontEndMap.cc.

References swap(), and groupFilesInBlocks::temp.

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

Definition at line 120 of file HcalFrontEndMap.cc.

References mPItems, and mPItemsById.

Referenced by initialize().

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

Definition at line 33 of file HcalFrontEndMap.cc.

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

Referenced by operator=().

33  {
34  std::swap(mPItems, other.mPItems);
36 }
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().