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 cms::ExpandedNodes &) const
 
MuonBaseNumber geoHistoryToBaseNumber (const DDGeoHistory &history) 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.

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("Geometry") << "MuonGeometryNumbering finds unusual base constant:" << theBasePart;
19  }
20  if (theSuperPart < 100) {
21  edm::LogWarning("Geometry") << "MuonGeometryNumbering finds unusual super constant:" << theSuperPart;
22  }
23  if (theLevelPart < 10 * theSuperPart) {
24  edm::LogWarning("Geometry") << "MuonGeometryNumbering finds unusual level constant:" << theLevelPart;
25  }
26  if ((theStartCopyNo != 0) && (theStartCopyNo != 1)) {
27  edm::LogWarning("Geometry") << "MuonGeometryNumbering finds unusual start value for copy numbers:"
28  << theStartCopyNo;
29  }
30 
31 #ifdef EDM_ML_DEBUG
32  edm::LogVerbatim("Geometry") << "MuonGeometryNumbering configured with"
33  << " Level = " << theLevelPart << " Super = " << theSuperPart
34  << " Base = " << theBasePart << " StartCopyNo = " << theStartCopyNo;
35 #endif
36 }

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

◆ ~MuonGeometryNumbering()

MuonGeometryNumbering::~MuonGeometryNumbering ( )
inline

Definition at line 27 of file MuonGeometryNumbering.h.

27 {};

Member Function Documentation

◆ geoHistoryToBaseNumber() [1/2]

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

Definition at line 70 of file MuonGeometryNumbering.cc.

70  {
72 
73  int ctr(0);
74  for (auto const &it : nodes.tags) {
75  int tag = it / theLevelPart;
76  if (tag > 0) {
77  int offset = nodes.offsets[ctr];
78  int copyno = nodes.copyNos[ctr] + offset % theSuperPart;
79  int super = offset / theSuperPart;
80  num.addBase(tag, super, copyno - theStartCopyNo);
81  }
82  ++ctr;
83  }
84  return num;
85 }

References dqmiodatasetharvest::ctr, class-composition::nodes, EgammaValidation_cff::num, hltrates_dqm_sourceclient-live_cfg::offset, GlobalPosition_Frontier_DevDB_cff::tag, theLevelPart, theStartCopyNo, and theSuperPart.

◆ geoHistoryToBaseNumber() [2/2]

MuonBaseNumber MuonGeometryNumbering::geoHistoryToBaseNumber ( const DDGeoHistory history) const

Definition at line 38 of file MuonGeometryNumbering.cc.

38  {
40 
41 #ifdef EDM_ML_DEBUG
42  edm::LogVerbatim("Geometry") << "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("Geometry") << "MuonGeometryNumbering::" << num.getLevels();
62  for (int i = 1; i <= num.getLevels(); i++) {
63  edm::LogVerbatim("Geometry") << "[" << i << "] " << num.getSuperNo(i) << " " << num.getBaseNo(i);
64  }
65 #endif
66 
67  return num;
68 }

References mps_fire::end, getInt(), mps_fire::i, EgammaValidation_cff::num, hltrates_dqm_sourceclient-live_cfg::offset, GlobalPosition_Frontier_DevDB_cff::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().

◆ getInt()

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

Definition at line 87 of file MuonGeometryNumbering.cc.

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("Geometry") << "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 }

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

Referenced by geoHistoryToBaseNumber().

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().

mps_fire.i
i
Definition: mps_fire.py:428
MuonGeometryNumbering::getInt
int getInt(const std::string &s, const DDLogicalPart &part) const
Definition: MuonGeometryNumbering.cc:87
MuonGeometryNumbering::theStartCopyNo
int theStartCopyNo
Definition: MuonGeometryNumbering.h:38
MuonGeometryNumbering::theLevelPart
int theLevelPart
Definition: MuonGeometryNumbering.h:35
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
alignCSCRings.s
s
Definition: alignCSCRings.py:92
part
part
Definition: HCALResponse.h:20
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
mps_fire.end
end
Definition: mps_fire.py:242
class-composition.nodes
nodes
Definition: class-composition.py:75
DDfetch
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:79
dqmiodatasetharvest.ctr
ctr
Definition: dqmiodatasetharvest.py:191
DDLogicalPart
A DDLogicalPart aggregates information concerning material, solid and sensitveness ....
Definition: DDLogicalPart.h:93
MuonGeometryNumbering::theSuperPart
int theSuperPart
Definition: MuonGeometryNumbering.h:36
createfilelist.int
int
Definition: createfilelist.py:10
MuonGeometryConstants::getValue
int getValue(const std::string &name) const
Definition: MuonGeometryConstants.cc:8
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
MuonBaseNumber
Definition: MuonBaseNumber.h:21
heppy_batch.val
val
Definition: heppy_batch.py:351
DDValue
Definition: DDValue.h:21
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
mps_fire.result
result
Definition: mps_fire.py:311
MuonGeometryNumbering::theBasePart
int theBasePart
Definition: MuonGeometryNumbering.h:37
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82