CMS 3D CMS Logo

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

#include <MuonGeometryNumbering.h>

Public Member Functions

MuonBaseNumber geoHistoryToBaseNumber (const DDGeoHistory &history) const
 
MuonBaseNumber geoHistoryToBaseNumber (const cms::ExpandedNodes &) const
 
 MuonGeometryNumbering (const MuonGeometryConstants &muonConstants)
 
 ~MuonGeometryNumbering ()
 

Private Member Functions

int getInt (const std::string &s, const DDLogicalPart &part) const
 

Private Attributes

int theBasePart
 
int theLevelPart
 
int theStartCopyNo
 
int theSuperPart
 

Detailed Description

class to handle the conversion to MuonBaseNumber from tree of DDD GeoHistory;
in the xml muon constant section one has to define level, super and base constants (eg. 1000,100,1) and the start value of the copy numbers (0 or 1)

Author
Arno Straessner, CERN arno..nosp@m.stra.nosp@m.essne.nosp@m.r@ce.nosp@m.rn.ch

Definition at line 24 of file MuonGeometryNumbering.h.

Constructor & Destructor Documentation

◆ MuonGeometryNumbering()

MuonGeometryNumbering::MuonGeometryNumbering ( const MuonGeometryConstants muonConstants)

Definition at line 8 of file MuonGeometryNumbering.cc.

References MuonGeometryConstants::getValue(), theBasePart, theLevelPart, theStartCopyNo, and theSuperPart.

8  {
9  // Get constant values from muonConstants
10  theLevelPart = muonConstants.getValue("level");
11  theSuperPart = muonConstants.getValue("super");
12  theBasePart = muonConstants.getValue("base");
13  theStartCopyNo = muonConstants.getValue("xml_starts_with_copyno");
14 
15  // some consistency checks
16 
17  if (theBasePart != 1) {
18  edm::LogWarning("MuonGeom") << "MuonGeometryNumbering finds unusual base constant:" << theBasePart;
19  }
20  if (theSuperPart < 100) {
21  edm::LogWarning("MuonGeom") << "MuonGeometryNumbering finds unusual super constant:" << theSuperPart;
22  }
23  if (theLevelPart < 10 * theSuperPart) {
24  edm::LogWarning("MuonGeom") << "MuonGeometryNumbering finds unusual level constant:" << theLevelPart;
25  }
26  if ((theStartCopyNo != 0) && (theStartCopyNo != 1)) {
27  edm::LogWarning("MuonGeom") << "MuonGeometryNumbering finds unusual start value for copy numbers:"
28  << theStartCopyNo;
29  }
30 
31 #ifdef EDM_ML_DEBUG
32  edm::LogVerbatim("MuonGeom") << "MuonGeometryNumbering configured with"
33  << " Level = " << theLevelPart << " Super = " << theSuperPart
34  << " Base = " << theBasePart << " StartCopyNo = " << theStartCopyNo;
35 #endif
36 }
int getValue(const std::string &name) const
Log< level::Info, true > LogVerbatim
Log< level::Warning, false > LogWarning

◆ ~MuonGeometryNumbering()

MuonGeometryNumbering::~MuonGeometryNumbering ( )
inline

Definition at line 27 of file MuonGeometryNumbering.h.

27 {}

Member Function Documentation

◆ geoHistoryToBaseNumber() [1/2]

MuonBaseNumber MuonGeometryNumbering::geoHistoryToBaseNumber ( const DDGeoHistory history) const

Definition at line 38 of file MuonGeometryNumbering.cc.

References mps_fire::end, getInt(), isotrackTrainRegressor::history, mps_fire::i, EgammaValidation_cff::num, HLT_IsoTrack_cff::offset, makeGlobalPositionRcd_cfg::tag, theLevelPart, theStartCopyNo, and theSuperPart.

Referenced by CSCGeometryParsFromDD::build(), GEMGeometryBuilder::build(), DTGeometryBuilderFromDDD::buildChamber(), DTGeometryBuilderFromDD4hep::buildChamber(), cms::DTGeometryBuilder::buildChamber(), ME0GeometryParsFromDD::buildGeometry(), RPCGeometryBuilder::buildGeometry(), RPCGeometryParsFromDD::buildGeometry(), GEMGeometryParsFromDD::buildGeometry(), ME0GeometryBuilder::buildGeometry(), DTGeometryParserFromDDD::buildLayer(), DTGeometryBuilderFromDDD::buildLayer(), DTGeometryBuilderFromDD4hep::buildLayer(), cms::DTGeometryBuilder::buildLayer(), DTGeometryBuilderFromDDD::buildSuperLayer(), DTGeometryBuilderFromDD4hep::buildSuperLayer(), cms::DTGeometryBuilder::buildSuperLayer(), DTGeometryParsFromDD::insertChamber(), DTGeometryParsFromDD::insertLayer(), and DTGeometryParsFromDD::insertSuperLayer().

38  {
40 
41 #ifdef EDM_ML_DEBUG
42  edm::LogVerbatim("MuonGeom") << "MuonGeometryNumbering create MuonBaseNumber for " << history;
43 #endif
44 
45  //loop over all parents and check
46  DDGeoHistory::const_iterator cur = history.begin();
47  DDGeoHistory::const_iterator end = history.end();
48  while (cur != end) {
49  const DDLogicalPart &ddlp = cur->logicalPart();
50  const int tag = getInt("CopyNoTag", ddlp) / theLevelPart;
51  if (tag > 0) {
52  const int offset = getInt("CopyNoOffset", ddlp);
53  const int copyno = (cur->copyno()) + offset % theSuperPart;
54  const int super = offset / theSuperPart;
55  num.addBase(tag, super, copyno - theStartCopyNo);
56  }
57  cur++;
58  }
59 
60 #ifdef EDM_ML_DEBUG
61  edm::LogVerbatim("MuonGeom") << "MuonGeometryNumbering::" << num.getLevels();
62  for (int i = 1; i <= num.getLevels(); i++) {
63  edm::LogVerbatim("MuonGeom") << "[" << i << "] " << num.getSuperNo(i) << " " << num.getBaseNo(i);
64  }
65 #endif
66 
67  return num;
68 }
Log< level::Info, true > LogVerbatim
int getInt(const std::string &s, const DDLogicalPart &part) const
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93

◆ geoHistoryToBaseNumber() [2/2]

MuonBaseNumber MuonGeometryNumbering::geoHistoryToBaseNumber ( const cms::ExpandedNodes nodes) const

◆ getInt()

int MuonGeometryNumbering::getInt ( const std::string &  s,
const DDLogicalPart part 
) const
private

Definition at line 87 of file MuonGeometryNumbering.cc.

References DDfetch(), createfilelist::int, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, mps_fire::result, alignCSCRings::s, groupFilesInBlocks::temp, and heppy_batch::val.

Referenced by geoHistoryToBaseNumber().

87  {
88  DDValue val(s);
89  std::vector<const DDsvalues_type *> result = part.specifics();
90  std::vector<const DDsvalues_type *>::iterator it = result.begin();
91  bool foundIt = false;
92  for (; it != result.end(); ++it) {
93  foundIt = DDfetch(*it, val);
94  if (foundIt)
95  break;
96  }
97  if (foundIt) {
98  std::vector<double> temp = val.doubles();
99  if (temp.size() != 1) {
100  edm::LogError("MuonGeom") << "MuonGeometryNumbering:: ERROR: I need only 1 " << s << " in DDLogicalPart "
101  << part.name();
102  abort();
103  }
104  return int(temp[0]);
105  } else
106  return 0;
107 }
Log< level::Error, false > LogError
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:79
part
Definition: HCALResponse.h:20

Member Data Documentation

◆ theBasePart

int MuonGeometryNumbering::theBasePart
private

Definition at line 37 of file MuonGeometryNumbering.h.

Referenced by MuonGeometryNumbering().

◆ theLevelPart

int MuonGeometryNumbering::theLevelPart
private

Definition at line 35 of file MuonGeometryNumbering.h.

Referenced by geoHistoryToBaseNumber(), and MuonGeometryNumbering().

◆ theStartCopyNo

int MuonGeometryNumbering::theStartCopyNo
private

Definition at line 38 of file MuonGeometryNumbering.h.

Referenced by geoHistoryToBaseNumber(), and MuonGeometryNumbering().

◆ theSuperPart

int MuonGeometryNumbering::theSuperPart
private

Definition at line 36 of file MuonGeometryNumbering.h.

Referenced by geoHistoryToBaseNumber(), and MuonGeometryNumbering().