CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 8 of file DD4hep_MuonNumbering.cc.

References MuonBaseNumber::addBase(), cms::ExpandedNodes::copyNos, dqmiodatasetharvest::ctr, pileupDistInMC::num, hltrates_dqm_sourceclient-live_cfg::offset, cms::ExpandedNodes::offsets, GlobalPosition_Frontier_DevDB_cff::tag, and cms::ExpandedNodes::tags.

8  {
10 
11  int levelPart = get("level");
12  int superPart = get("super");
13  int basePart = get("base");
14  int startCopyNo = get("xml_starts_with_copyno");
15 
16  // some consistency checks
17  if (basePart != 1) {
18  edm::LogError("Geometry") << "MuonNumbering finds unusual base constant: " << basePart;
19  }
20  if (superPart < 100) {
21  edm::LogError("Geometry") << "MuonNumbering finds unusual super part: " << superPart
22  << " -- resetting super part to 100";
23  superPart = 100; // Reset to sensible value so calculations below don't go out of range
24  }
25  if (levelPart < 10 * superPart) {
26  edm::LogError("Geometry") << "MuonNumbering finds unusual level constant: " << levelPart;
27  }
28  if ((startCopyNo != 0) && (startCopyNo != 1)) {
29  edm::LogError("Geometry") << "MuonNumbering finds unusual start value for copy numbers: " << startCopyNo;
30  }
31  int ctr(0);
32  for (auto const& it : nodes.tags) {
33  int tag = it / levelPart;
34  if (tag > 0) {
35  int offset = nodes.offsets[ctr];
36  int copyno = nodes.copyNos[ctr] + offset % superPart;
37  int super = offset / superPart;
38  num.addBase(tag, super, copyno - startCopyNo);
39  }
40  ++ctr;
41  }
42  return num;
43 }
void addBase(const int level, const int super, const int base)
Log< level::Error, false > LogError
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 53 of file DD4hep_MuonNumbering.cc.

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

Definition at line 42 of file DD4hep_MuonNumbering.h.

References values_.

42 { return values_; }

Member Data Documentation

MuonConstants cms::MuonNumbering::values_
private

Definition at line 45 of file DD4hep_MuonNumbering.h.

Referenced by values().