CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 ( )
inline

Definition at line 22 of file MuonGeometryConstants.h.

22 {}

Member Function Documentation

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

Definition at line 27 of file MuonGeometryConstants.h.

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

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  }
std::map< std::string, int > namesAndValues_
int MuonGeometryConstants::getValue ( const std::string &  name) const

Definition at line 8 of file MuonGeometryConstants.cc.

References namesAndValues_.

Referenced by GEMGeometryBuilder::build(), ME0GeometryParsFromDD::buildGeometry(), GEMGeometryParsFromDD::buildGeometry(), ME0GeometryBuilder::buildGeometry(), ME0NumberingScheme::initMe(), GEMNumberingScheme::initMe(), CSCNumberingScheme::initMe(), RPCNumberingScheme::initMe(), DTNumberingScheme::initMe(), MuonG4Numbering::MuonG4Numbering(), MuonGeometryNumbering::MuonGeometryNumbering(), and MuonRPCFrameRotation::MuonRPCFrameRotation().

8  {
9 #ifdef EDM_ML_DEBUG
10  edm::LogVerbatim("MuonGeom") << "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("MuonGeom") << "MuonGeometryConstants::Value for " << name << " is " << findIt->second;
21 #endif
22  return findIt->second;
23 }
Log< level::Info, true > LogVerbatim
std::map< std::string, int > namesAndValues_
template<class Archive >
void MuonGeometryConstants::serialize ( Archive &  ar,
const unsigned int  version 
)
private
unsigned MuonGeometryConstants::size ( void  ) const
inline

Definition at line 26 of file MuonGeometryConstants.h.

References namesAndValues_.

Referenced by ntupleDataFormat._Collection::__iter__(), ntupleDataFormat._Collection::__len__(), and getEntry().

26 { return namesAndValues_.size(); }
std::map< std::string, int > namesAndValues_

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 39 of file MuonGeometryConstants.h.

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

Definition at line 39 of file MuonGeometryConstants.h.

Member Data Documentation

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

Definition at line 38 of file MuonGeometryConstants.h.

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