CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
MuonGeometryConstants Class Reference

#include <MuonGeometryConstants.h>

Public Member Functions

void addValue (const std::string &name, const int &value)
 
std::pair< std::string, int > getEntry (const unsigned int k) const
 
int getValue (const std::string &name) const
 
 MuonGeometryConstants ()
 
unsigned size () const
 

Private Member Functions

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

Private Attributes

std::map< std::string, int > namesAndValues_
 

Friends

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

Detailed Description

this class reads the constant section of the muon-numbering xml-file

Author
Sunanda Banerjee modified by: Taken from MuonDDDConstants

Definition at line 20 of file MuonGeometryConstants.h.

Constructor & Destructor Documentation

◆ MuonGeometryConstants()

MuonGeometryConstants::MuonGeometryConstants ( )
inline

Definition at line 22 of file MuonGeometryConstants.h.

22 {}

Member Function Documentation

◆ addValue()

void MuonGeometryConstants::addValue ( const std::string &  name,
const int &  value 
)

◆ getEntry()

std::pair<std::string, int> MuonGeometryConstants::getEntry ( const unsigned int  k) const
inline

Definition at line 27 of file MuonGeometryConstants.h.

27  {
28  auto itr = namesAndValues_.begin();
29  for (unsigned int i = 0; i < k; ++i)
30  ++itr;
31  if (k < size())
32  return std::pair<std::string, int>(itr->first, itr->second);
33  else
34  return std::pair<std::string, int>("Not Found", 0);
35  }

References mps_fire::i, dqmdumpme::k, namesAndValues_, and size().

◆ getValue()

int MuonGeometryConstants::getValue ( const std::string &  name) const

Definition at line 8 of file MuonGeometryConstants.cc.

8  {
9 #ifdef EDM_ML_DEBUG
10  edm::LogVerbatim("Geometry") << "about to look for ... " << name << std::endl;
11 #endif
12  if (namesAndValues_.empty())
13  throw cms::Exception("GeometryBuildFailure", "MuonGeometryConstants does not have requested value for " + name);
14 
15  std::map<std::string, int>::const_iterator findIt = namesAndValues_.find(name);
16  if (findIt == namesAndValues_.end())
17  throw cms::Exception("GeometryBuildFailure", "MuonGeometryConstants does not have requested value for " + name);
18 
19 #ifdef EDM_ML_DEBUG
20  edm::LogVerbatim("Geometry") << "MuonGeometryConstants::Value for " << name << " is " << findIt->second;
21 #endif
22  return findIt->second;
23 }

References Skims_PA_cff::name, and namesAndValues_.

Referenced by GEMNumberingScheme::initMe(), ME0NumberingScheme::initMe(), CSCNumberingScheme::initMe(), RPCNumberingScheme::initMe(), DTNumberingScheme::initMe(), MuonDDDNumbering::MuonDDDNumbering(), MuonG4Numbering::MuonG4Numbering(), and MuonRPCFrameRotation::MuonRPCFrameRotation().

◆ serialize()

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

◆ size()

unsigned MuonGeometryConstants::size ( void  ) const
inline

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 39 of file MuonGeometryConstants.h.

◆ cond::serialization::access

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

Definition at line 39 of file MuonGeometryConstants.h.

Member Data Documentation

◆ namesAndValues_

std::map<std::string, int> MuonGeometryConstants::namesAndValues_
private

Definition at line 38 of file MuonGeometryConstants.h.

Referenced by addValue(), getEntry(), getValue(), and size().

MuonGeometryConstants::namesAndValues_
std::map< std::string, int > namesAndValues_
Definition: MuonGeometryConstants.h:38
mps_fire.i
i
Definition: mps_fire.py:355
dqmdumpme.k
k
Definition: dqmdumpme.py:60
edm::LogVerbatim
Definition: MessageLogger.h:297
itr
std::vector< std::pair< float, float > >::iterator itr
Definition: HGCDigitizer.cc:28
relativeConstraints.value
value
Definition: relativeConstraints.py:53
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
MuonGeometryConstants::size
unsigned size() const
Definition: MuonGeometryConstants.h:26
cms::Exception
Definition: Exception.h:70