CMS 3D CMS Logo

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

#include <MuonDDDConstants.h>

Public Member Functions

void addValue (const std::string &name, const int &value)
 
int getValue (const std::string &name) const
 
 MuonDDDConstants (const DDCompactView &cpv)
 
 ~MuonDDDConstants ()
 

Private Member Functions

 MuonDDDConstants ()
 

Private Attributes

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

Detailed Description

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

Author
Arno Straessner, CERN arno..nosp@m.stra.nosp@m.essne.nosp@m.r@ce.nosp@m.rn.ch modified by: Michael Case, micha.nosp@m.el.c.nosp@m.ase@c.nosp@m.ern..nosp@m.ch, 2006/10/05

Definition at line 21 of file MuonDDDConstants.h.

Constructor & Destructor Documentation

MuonDDDConstants::MuonDDDConstants ( const DDCompactView cpv)

Definition at line 13 of file MuonDDDConstants.cc.

References addValue(), gather_cfg::cout, Exception, ALCARECOTkAlBeamHalo_cff::filter, DDFilteredView::firstChild(), createfilelist::int, DDFilteredView::mergedSpecifics(), mps_alisetup::msg, and AlCaHLTBitMon_QueryRunRegistry::string.

13  {
14 #ifdef LOCAL_DEBUG
15  std::cout << "MuonDDDConstants;:MuonDDDConstants ( const DDCompactView& cpv ) constructor " << std::endl;
16 #endif
17  std::string attribute = "OnlyForMuonNumbering";
18 
20  DDFilteredView fview(cpv,filter);
21 
22  DDValue val2("level");
23  const DDsvalues_type params(fview.mergedSpecifics());
24 
25  fview.firstChild();
26 
27  const DDsvalues_type mySpecs (fview.mergedSpecifics());
28 #ifdef LOCAL_DEBUG
29  std::cout << "mySpecs.size() = " << mySpecs.size() << std::endl;
30 #endif
31  if ( mySpecs.size() < 25 ) {
32  edm::LogError("MuonDDDConstants") << " MuonDDDConstants: Missing SpecPars from DetectorDescription." << std::endl;
33  std::string msg = "MuonDDDConstants does not have the appropriate number of SpecPars associated";
34  msg+= " with the part //MUON.";
35  throw cms::Exception("GeometryBuildFailure", msg);
36  }
37 
38  DDsvalues_type::const_iterator bit = mySpecs.begin();
39  DDsvalues_type::const_iterator eit = mySpecs.end();
40  for ( ; bit != eit; ++bit ) {
41  if ( bit->second.isEvaluated() ) {
42  this->addValue( bit->second.name(), int(bit->second.doubles()[0]) );
43 #ifdef LOCAL_DEBUG
44  std::cout << "adding DDConstant of " << bit->second.name() << " = " << int(bit->second.doubles()[0]) << std::endl;
45 #endif
46  }
47  }
48 
49 }
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
std::maps an index to a DDValue. The index corresponds to the index assigned to the name of the std::...
Definition: DDsvalues.h:20
void addValue(const std::string &name, const int &value)
MuonDDDConstants::~MuonDDDConstants ( )

Definition at line 51 of file MuonDDDConstants.cc.

51  {
52  // std::cout << "destructed!!!" << std::endl;
53 }
MuonDDDConstants::MuonDDDConstants ( )
private

Member Function Documentation

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

Definition at line 76 of file MuonDDDConstants.cc.

References dataset::name, namesAndValues_, and relativeConstraints::value.

Referenced by MuonDDDConstants().

76  {
78 }
std::map< std::string, int > namesAndValues_
int MuonDDDConstants::getValue ( const std::string &  name) const

Definition at line 55 of file MuonDDDConstants.cc.

References gather_cfg::cout, Exception, and namesAndValues_.

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

55  {
56 #ifdef LOCAL_DEBUG
57  std::cout << "about to look for ... " << name << std::endl;
58 #endif
59  if ( namesAndValues_.size() == 0 ) {
60  std::cout << "MuonDDDConstants::getValue HAS NO VALUES!" << std::endl;
61  throw cms::Exception("GeometryBuildFailure", "MuonDDDConstants does not have requested value for " + name);
62  }
63 
64  std::map<std::string, int>::const_iterator findIt = namesAndValues_.find(name);
65 
66  if ( findIt == namesAndValues_.end() ) {
67  std::cout << "MuonDDDConstants::getValue was asked for " << name << " and had NO clue!" << std::endl;
68  throw cms::Exception("GeometryBuildFailure", "MuonDDDConstants does not have requested value for " + name);
69  }
70 #ifdef LOCAL_DEBUG
71  std::cout << "Value for " << name << " is " << findIt->second << std::endl;
72 #endif
73  return findIt->second;
74 }
std::map< std::string, int > namesAndValues_

Member Data Documentation

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

Definition at line 32 of file MuonDDDConstants.h.

Referenced by addValue(), and getValue().