CMS 3D CMS Logo

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

#include <MuonDDDNumbering.h>

Public Member Functions

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

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 MuonDDDNumbering.h.

Constructor & Destructor Documentation

◆ MuonDDDNumbering()

MuonDDDNumbering::MuonDDDNumbering ( const MuonGeometryConstants muonConstants)

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

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

◆ ~MuonDDDNumbering()

MuonDDDNumbering::~MuonDDDNumbering ( )
inline

Definition at line 27 of file MuonDDDNumbering.h.

27 {};

Member Function Documentation

◆ geoHistoryToBaseNumber() [1/2]

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

Definition at line 69 of file MuonDDDNumbering.cc.

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

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 MuonDDDNumbering::geoHistoryToBaseNumber ( const DDGeoHistory history) const

Definition at line 37 of file MuonDDDNumbering.cc.

37  {
39 
40 #ifdef LOCAL_DEBUG
41  edm::LogVerbatim("Geometry") << "MuonDDDNumbering create MuonBaseNumber for " << history;
42 #endif
43 
44  //loop over all parents and check
45  DDGeoHistory::const_iterator cur = history.begin();
46  DDGeoHistory::const_iterator end = history.end();
47  while (cur != end) {
48  const DDLogicalPart &ddlp = cur->logicalPart();
49  const int tag = getInt("CopyNoTag", ddlp) / theLevelPart;
50  if (tag > 0) {
51  const int offset = getInt("CopyNoOffset", ddlp);
52  const int copyno = (cur->copyno()) + offset % theSuperPart;
53  const int super = offset / theSuperPart;
54  num.addBase(tag, super, copyno - theStartCopyNo);
55  }
56  cur++;
57  }
58 
59 #ifdef LOCAL_DEBUG
60  edm::LogVerbatim("Geometry") << "MuonDDDNumbering::" << num.getLevels();
61  for (int i = 1; i <= num.getLevels(); i++) {
62  edm::LogVerbatim("Geometry") << "[" << i << "] " << num.getSuperNo(i) << " " << num.getBaseNo(i);
63  }
64 #endif
65 
66  return num;
67 }

References 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 GEMGeometryBuilderFromDDD::build(), CSCGeometryParsFromDD::build(), DTGeometryBuilderFromDDD::buildChamber(), ME0GeometryParsFromDD::buildGeometry(), GEMGeometryParsFromDD::buildGeometry(), RPCGeometryParsFromDD::buildGeometry(), ME0GeometryBuilder::buildGeometry(), RPCGeometryBuilderFromDDD::buildGeometry(), DTGeometryParserFromDDD::buildLayer(), DTGeometryBuilderFromDDD::buildLayer(), DTGeometryBuilderFromDDD::buildSuperLayer(), DTGeometryParsFromDD::insertChamber(), DTGeometryParsFromDD::insertLayer(), and DTGeometryParsFromDD::insertSuperLayer().

◆ getInt()

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

Definition at line 86 of file MuonDDDNumbering.cc.

86  {
87  DDValue val(s);
88  std::vector<const DDsvalues_type *> result = part.specifics();
89  std::vector<const DDsvalues_type *>::iterator it = result.begin();
90  bool foundIt = false;
91  for (; it != result.end(); ++it) {
92  foundIt = DDfetch(*it, val);
93  if (foundIt)
94  break;
95  }
96  if (foundIt) {
97  std::vector<double> temp = val.doubles();
98  if (temp.size() != 1) {
99  edm::LogError("Geometry") << "MuonDDDNumbering:: ERROR: I need only 1 " << s << " in DDLogicalPart "
100  << part.name();
101  abort();
102  }
103  return int(temp[0]);
104  } else
105  return 0;
106 }

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

Referenced by geoHistoryToBaseNumber().

Member Data Documentation

◆ theBasePart

int MuonDDDNumbering::theBasePart
private

Definition at line 37 of file MuonDDDNumbering.h.

Referenced by MuonDDDNumbering().

◆ theLevelPart

int MuonDDDNumbering::theLevelPart
private

Definition at line 35 of file MuonDDDNumbering.h.

Referenced by geoHistoryToBaseNumber(), and MuonDDDNumbering().

◆ theStartCopyNo

int MuonDDDNumbering::theStartCopyNo
private

Definition at line 38 of file MuonDDDNumbering.h.

Referenced by geoHistoryToBaseNumber(), and MuonDDDNumbering().

◆ theSuperPart

int MuonDDDNumbering::theSuperPart
private

Definition at line 36 of file MuonDDDNumbering.h.

Referenced by geoHistoryToBaseNumber(), and MuonDDDNumbering().

mps_fire.i
i
Definition: mps_fire.py:355
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
end
#define end
Definition: vmac.h:39
alignCSCRings.s
s
Definition: alignCSCRings.py:92
part
part
Definition: HCALResponse.h:20
MuonDDDNumbering::theStartCopyNo
int theStartCopyNo
Definition: MuonDDDNumbering.h:38
MuonDDDNumbering::theBasePart
int theBasePart
Definition: MuonDDDNumbering.h:37
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
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
MuonDDDNumbering::theLevelPart
int theLevelPart
Definition: MuonDDDNumbering.h:35
MuonDDDNumbering::getInt
int getInt(const std::string &s, const DDLogicalPart &part) const
Definition: MuonDDDNumbering.cc:86
edm::LogWarning
Definition: MessageLogger.h:141
edm::LogError
Definition: MessageLogger.h:183
dqmiodatasetharvest.ctr
ctr
Definition: dqmiodatasetharvest.py:191
DDLogicalPart
A DDLogicalPart aggregates information concerning material, solid and sensitveness ....
Definition: DDLogicalPart.h:93
createfilelist.int
int
Definition: createfilelist.py:10
edm::LogVerbatim
Definition: MessageLogger.h:297
MuonGeometryConstants::getValue
int getValue(const std::string &name) const
Definition: MuonGeometryConstants.cc:8
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
MuonBaseNumber
Definition: MuonBaseNumber.h:21
heppy_batch.val
val
Definition: heppy_batch.py:351
MuonDDDNumbering::theSuperPart
int theSuperPart
Definition: MuonDDDNumbering.h:36
DDValue
Definition: DDValue.h:21
mps_fire.result
result
Definition: mps_fire.py:303
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:78