CMS 3D CMS Logo

MuonGeometryNumbering.cc
Go to the documentation of this file.
5 
6 //#define EDM_ML_DEBUG
7 
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 }
37 
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 }
69 
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 }
86 
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 }
MuonGeometryConstants
Definition: MuonGeometryConstants.h:20
mps_fire.i
i
Definition: mps_fire.py:428
DDGeoHistory
std::vector< DDExpandedNode > DDGeoHistory
Geometrical 'path' of the current node up to the root-node.
Definition: DDExpandedNode.h:82
MessageLogger.h
MuonGeometryNumbering::getInt
int getInt(const std::string &s, const DDLogicalPart &part) const
Definition: MuonGeometryNumbering.cc:87
MuonGeometryNumbering::geoHistoryToBaseNumber
MuonBaseNumber geoHistoryToBaseNumber(const DDGeoHistory &history) const
Definition: MuonGeometryNumbering.cc:38
MuonGeometryNumbering::theStartCopyNo
int theStartCopyNo
Definition: MuonGeometryNumbering.h:38
MuonGeometryConstants.h
MuonGeometryNumbering.h
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
mps_fire.end
end
Definition: mps_fire.py:242
class-composition.nodes
nodes
Definition: class-composition.py:84
DDfetch
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:79
MuonGeometryNumbering::MuonGeometryNumbering
MuonGeometryNumbering(const MuonGeometryConstants &muonConstants)
Definition: MuonGeometryNumbering.cc:8
dqmiodatasetharvest.ctr
ctr
Definition: dqmiodatasetharvest.py:191
makeGlobalPositionRcd_cfg.tag
tag
Definition: makeGlobalPositionRcd_cfg.py:6
MuonBaseNumber.h
cms::ExpandedNodes
Definition: ExpandedNodes.h:26
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
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:33
MuonBaseNumber
Definition: MuonBaseNumber.h:21
heppy_batch.val
val
Definition: heppy_batch.py:351
DDValue
Definition: DDValue.h:22
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