CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
cms::MuonNumbering Class Reference

#include <DD4hep_MuonNumbering.h>

Public Member Functions

const MuonBaseNumber geoHistoryToBaseNumber (const cms::ExpandedNodes &) const
 
const int get (const char *) const
 
void put (std::string_view, int)
 
const MuonConstantsvalues () const
 

Private Attributes

MuonConstants values_
 

Detailed Description

Definition at line 37 of file DD4hep_MuonNumbering.h.

Member Function Documentation

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

Definition at line 9 of file DD4hep_MuonNumbering.cc.

References MuonBaseNumber::addBase(), cms::ExpandedNodes::copyNos, pileupDistInMC::num, PFRecoTauDiscriminationByIsolation_cfi::offset, cms::ExpandedNodes::offsets, GlobalPosition_Frontier_DevDB_cff::tag, and cms::ExpandedNodes::tags.

Referenced by cms::DTGeometryBuilder::buildChamber(), cms::DTGeometryBuilder::buildLayer(), and cms::DTGeometryBuilder::buildSuperLayer().

9  {
11 
12  int levelPart = get("level");
13  int superPart = get("super");
14  int basePart = get("base");
15  int startCopyNo = get("xml_starts_with_copyno");
16 
17  // some consistency checks
18  if(basePart != 1) {
19  edm::LogError("Geometry") << "MuonNumbering finds unusual base constant:"
20  << basePart;
21  }
22  if(superPart < 100) {
23  edm::LogError("Geometry") << "MuonNumbering finds unusual super constant:"
24  << superPart;
25  }
26  if(levelPart < 10*superPart) {
27  edm::LogError("Geometry") << "MuonNumbering finds unusual level constant:"
28  << levelPart;
29  }
30  if((startCopyNo !=0 ) && (startCopyNo != 1)) {
31  edm::LogError("Geometry") << "MuonNumbering finds unusual start value for copy numbers:"
32  << startCopyNo;
33  }
34  int ctr(0);
35  for(auto const& it : nodes.tags) {
36  int tag = it/levelPart;
37  if(tag > 0) {
38  int offset = nodes.offsets[ctr];
39  int copyno = nodes.copyNos[ctr] + offset%superPart;
40  int super = offset/superPart;
41  num.addBase(tag, super, copyno - startCopyNo);
42  }
43  ++ctr;
44  }
45  return num;
46 }
void addBase(const int level, const int super, const int base)
std::vector< int > copyNos
Definition: ExpandedNodes.h:29
std::vector< double > offsets
Definition: ExpandedNodes.h:28
std::vector< double > tags
Definition: ExpandedNodes.h:27
const int MuonNumbering::get ( const char *  key) const
void MuonNumbering::put ( std::string_view  str,
int  num 
)

Definition at line 58 of file DD4hep_MuonNumbering.cc.

58  {
59  values_.emplace(str, num);
60 }
#define str(s)
const MuonConstants& cms::MuonNumbering::values ( ) const
inline

Definition at line 42 of file DD4hep_MuonNumbering.h.

References values_.

Referenced by DDTestMuonNumbering::analyze(), and cms::DTGeometryBuilder::build().

42  {
43  return values_;
44  }

Member Data Documentation

MuonConstants cms::MuonNumbering::values_
private

Definition at line 47 of file DD4hep_MuonNumbering.h.

Referenced by values().