CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
ME0GeometryParsFromDD Class Reference

#include <ME0GeometryParsFromDD.h>

Public Member Functions

void build (const DDCompactView *, const MuonGeometryConstants &, RecoIdealGeometry &)
 
 ME0GeometryParsFromDD (void)
 
 ~ME0GeometryParsFromDD (void)
 

Private Member Functions

void buildChamber (DDFilteredView &fv, ME0DetId detId, RecoIdealGeometry &rgeo)
 
void buildEtaPartition (DDFilteredView &fv, ME0DetId detId, RecoIdealGeometry &rgeo)
 
void buildGeometry (DDFilteredView &, const MuonGeometryConstants &, RecoIdealGeometry &)
 
void buildLayer (DDFilteredView &fv, ME0DetId detId, RecoIdealGeometry &rgeo)
 
std::vector< double > getDimension (DDFilteredView &fv)
 
std::vector< double > getRotation (DDFilteredView &fv)
 
std::vector< double > getTranslation (DDFilteredView &fv)
 

Detailed Description

Definition at line 12 of file ME0GeometryParsFromDD.h.

Constructor & Destructor Documentation

◆ ME0GeometryParsFromDD()

ME0GeometryParsFromDD::ME0GeometryParsFromDD ( void  )
inline

Definition at line 14 of file ME0GeometryParsFromDD.h.

14 {}

◆ ~ME0GeometryParsFromDD()

ME0GeometryParsFromDD::~ME0GeometryParsFromDD ( void  )
inline

Definition at line 16 of file ME0GeometryParsFromDD.h.

16 {}

Member Function Documentation

◆ build()

void ME0GeometryParsFromDD::build ( const DDCompactView cview,
const MuonGeometryConstants muonConstants,
RecoIdealGeometry rgeo 
)

Definition at line 13 of file ME0GeometryParsFromDD.cc.

15  {
16  std::string attribute = "MuStructure";
17  std::string value = "MuonEndCapME0";
18 
19  // Asking only for the MuonME0's
21  DDFilteredView fview(*cview, filter);
22 
23  this->buildGeometry(fview, muonConstants, rgeo);
24 }

References buildGeometry(), ALCARECOTkAlBeamHalo_cff::filter, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ME0RecoIdealDBLoader::beginRun().

◆ buildChamber()

void ME0GeometryParsFromDD::buildChamber ( DDFilteredView fv,
ME0DetId  detId,
RecoIdealGeometry rgeo 
)
private

Definition at line 80 of file ME0GeometryParsFromDD.cc.

80  {
81  LogDebug("ME0GeometryParsFromDD") << "buildChamber " << fv.logicalPart().name().name() << " " << detId << std::endl;
82 
83  std::vector<double> pars = getDimension(fv);
84  std::vector<double> vtra = getTranslation(fv);
85  std::vector<double> vrot = getRotation(fv);
86 
87  rgeo.insert(detId.chamberId().rawId(), vtra, vrot, pars, {fv.logicalPart().name().name()});
88 }

References ME0DetId::chamberId(), getDimension(), getRotation(), getTranslation(), RecoIdealGeometry::insert(), LogDebug, DDFilteredView::logicalPart(), DDName::name(), DDBase< N, C >::name(), and DetId::rawId().

Referenced by buildGeometry().

◆ buildEtaPartition()

void ME0GeometryParsFromDD::buildEtaPartition ( DDFilteredView fv,
ME0DetId  detId,
RecoIdealGeometry rgeo 
)
private

Definition at line 100 of file ME0GeometryParsFromDD.cc.

100  {
101  LogDebug("ME0GeometryParsFromDD") << "buildEtaPartition " << fv.logicalPart().name().name() << " " << detId
102  << std::endl;
103 
104  // EtaPartition specific parameter (nstrips and npads)
105  DDValue numbOfStrips("nStrips");
106  DDValue numbOfPads("nPads");
107  const std::vector<const DDsvalues_type*>& specs = fv.specifics();
108  double nStrips = 0., nPads = 0.;
109  for (auto const& is : specs) {
110  if (DDfetch(is, numbOfStrips))
111  nStrips = numbOfStrips.doubles()[0];
112  if (DDfetch(is, numbOfPads))
113  nPads = numbOfPads.doubles()[0];
114  }
115  LogDebug("ME0GeometryParsFromDD") << ((nStrips == 0.) ? ("No nStrips found!!")
116  : ("Number of strips: " + std::to_string(nStrips)));
117  LogDebug("ME0GeometryParsFromDD") << ((nPads == 0.) ? ("No nPads found!!")
118  : ("Number of pads: " + std::to_string(nPads)));
119 
120  std::vector<double> pars = getDimension(fv);
121  pars.emplace_back(nStrips);
122  pars.emplace_back(nPads);
123  std::vector<double> vtra = getTranslation(fv);
124  std::vector<double> vrot = getRotation(fv);
125 
126  rgeo.insert(detId.rawId(), vtra, vrot, pars, {fv.logicalPart().name().name()});
127 }

References DDfetch(), DDValue::doubles(), getDimension(), getRotation(), getTranslation(), RecoIdealGeometry::insert(), LogDebug, DDFilteredView::logicalPart(), DDName::name(), DDBase< N, C >::name(), me0TriggerPseudoDigis_cff::nStrips, DetId::rawId(), DDFilteredView::specifics(), and HistogramManager_cfi::specs.

Referenced by buildGeometry().

◆ buildGeometry()

void ME0GeometryParsFromDD::buildGeometry ( DDFilteredView fv,
const MuonGeometryConstants muonConstants,
RecoIdealGeometry rgeo 
)
private

Definition at line 26 of file ME0GeometryParsFromDD.cc.

28  {
29  LogDebug("ME0GeometryParsFromDD") << "Building the geometry service";
30  LogDebug("ME0GeometryParsFromDD") << "About to run through the ME0 structure\n"
31  << " First logical part " << fv.logicalPart().name().name();
32 
33  MuonGeometryNumbering muonDDDNumbering(muonConstants);
34  ME0NumberingScheme me0Numbering(muonConstants);
35 
36  bool doChambers = fv.firstChild();
37  LogDebug("ME0GeometryParsFromDD") << "doChamber = " << doChambers;
38  // loop over superchambers
39  while (doChambers) {
40  // getting chamber id from eta partitions
41  fv.firstChild();
42  fv.firstChild();
43  ME0DetId detIdCh =
44  ME0DetId(me0Numbering.baseNumberToUnitNumber(muonDDDNumbering.geoHistoryToBaseNumber(fv.geoHistory())));
45  // back to chambers
46  fv.parent();
47  fv.parent();
48 
49  buildChamber(fv, detIdCh, rgeo);
50 
51  // loop over chambers
52  // only 1 chamber
53  bool doLayers = fv.firstChild();
54  while (doLayers) {
55  // get layer ID
56  fv.firstChild();
57  ME0DetId detIdLa =
58  ME0DetId(me0Numbering.baseNumberToUnitNumber(muonDDDNumbering.geoHistoryToBaseNumber(fv.geoHistory())));
59  fv.parent();
60  // build layer
61  buildLayer(fv, detIdLa, rgeo);
62 
63  // loop over ME0EtaPartitions
64  bool doEtaPart = fv.firstChild();
65  while (doEtaPart) {
66  ME0DetId detId =
67  ME0DetId(me0Numbering.baseNumberToUnitNumber(muonDDDNumbering.geoHistoryToBaseNumber(fv.geoHistory())));
68  buildEtaPartition(fv, detId, rgeo);
69 
70  doEtaPart = fv.nextSibling();
71  }
72  fv.parent();
73  doLayers = fv.nextSibling();
74  }
75  fv.parent();
76  doChambers = fv.nextSibling();
77  }
78 }

References ME0NumberingScheme::baseNumberToUnitNumber(), buildChamber(), buildEtaPartition(), buildLayer(), DDFilteredView::firstChild(), DDFilteredView::geoHistory(), MuonGeometryNumbering::geoHistoryToBaseNumber(), LogDebug, DDFilteredView::logicalPart(), DDName::name(), DDBase< N, C >::name(), DDFilteredView::nextSibling(), and DDFilteredView::parent().

Referenced by build().

◆ buildLayer()

void ME0GeometryParsFromDD::buildLayer ( DDFilteredView fv,
ME0DetId  detId,
RecoIdealGeometry rgeo 
)
private

Definition at line 90 of file ME0GeometryParsFromDD.cc.

90  {
91  LogDebug("ME0GeometryParsFromDD") << "buildLayer " << fv.logicalPart().name().name() << " " << detId << std::endl;
92 
93  std::vector<double> pars = getDimension(fv);
94  std::vector<double> vtra = getTranslation(fv);
95  std::vector<double> vrot = getRotation(fv);
96 
97  rgeo.insert(detId.layerId().rawId(), vtra, vrot, pars, {fv.logicalPart().name().name()});
98 }

References getDimension(), getRotation(), getTranslation(), RecoIdealGeometry::insert(), ME0DetId::layerId(), LogDebug, DDFilteredView::logicalPart(), DDName::name(), DDBase< N, C >::name(), and DetId::rawId().

Referenced by buildGeometry().

◆ getDimension()

std::vector< double > ME0GeometryParsFromDD::getDimension ( DDFilteredView fv)
private

Definition at line 129 of file ME0GeometryParsFromDD.cc.

129  {
130  std::vector<double> dpar = fv.logicalPart().solid().parameters();
131  //dpar[4] bottom width is along local X
132  //dpar[8] top width is along local X
133  //dpar[3] thickness is long local Z
134  //dpar[0] length is along local Y
135  LogDebug("ME0GeometryParsFromDD") << "dimension dx1 " << dpar[4] << ", dx2 " << dpar[8] << ", dy " << dpar[0]
136  << ", dz " << dpar[3];
137  return {dpar[4], dpar[8], dpar[0], dpar[3]};
138 }

References LogDebug, DDFilteredView::logicalPart(), DDSolid::parameters(), and DDLogicalPart::solid().

Referenced by buildChamber(), buildEtaPartition(), and buildLayer().

◆ getRotation()

std::vector< double > ME0GeometryParsFromDD::getRotation ( DDFilteredView fv)
private

Definition at line 145 of file ME0GeometryParsFromDD.cc.

145  {
146  const DDRotationMatrix& rota = fv.rotation(); //.Inverse();
147  DD3Vector x, y, z;
148  rota.GetComponents(x, y, z);
149  return {x.X(), x.Y(), x.Z(), y.X(), y.Y(), y.Z(), z.X(), z.Y(), z.Z()};
150 }

References DDFilteredView::rotation(), x, y, and z.

Referenced by buildChamber(), buildEtaPartition(), and buildLayer().

◆ getTranslation()

std::vector< double > ME0GeometryParsFromDD::getTranslation ( DDFilteredView fv)
private

Definition at line 140 of file ME0GeometryParsFromDD.cc.

140  {
141  const DDTranslation& tran = fv.translation();
142  return {tran.x(), tran.y(), tran.z()};
143 }

References DDFilteredView::translation().

Referenced by buildChamber(), buildEtaPartition(), and buildLayer().

ME0GeometryParsFromDD::buildEtaPartition
void buildEtaPartition(DDFilteredView &fv, ME0DetId detId, RecoIdealGeometry &rgeo)
Definition: ME0GeometryParsFromDD.cc:100
DDAxes::y
ME0GeometryParsFromDD::buildLayer
void buildLayer(DDFilteredView &fv, ME0DetId detId, RecoIdealGeometry &rgeo)
Definition: ME0GeometryParsFromDD.cc:90
DDFilteredView::logicalPart
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
Definition: DDFilteredView.cc:16
HistogramManager_cfi.specs
specs
Definition: HistogramManager_cfi.py:80
ME0GeometryParsFromDD::getDimension
std::vector< double > getDimension(DDFilteredView &fv)
Definition: ME0GeometryParsFromDD.cc:129
ME0GeometryParsFromDD::buildGeometry
void buildGeometry(DDFilteredView &, const MuonGeometryConstants &, RecoIdealGeometry &)
Definition: ME0GeometryParsFromDD.cc:26
DDAxes::x
DDFilteredView::parent
bool parent()
set the current node to the parent node ...
Definition: DDFilteredView.cc:161
ME0DetId::layerId
ME0DetId layerId() const
Return the corresponding LayerId (mask eta partition)
Definition: ME0DetId.h:55
DDFilteredView::firstChild
bool firstChild()
set the current node to the first child ...
Definition: DDFilteredView.cc:86
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
DDBase::name
const N & name() const
Definition: DDBase.h:59
DDAxes::z
ME0GeometryParsFromDD::buildChamber
void buildChamber(DDFilteredView &fv, ME0DetId detId, RecoIdealGeometry &rgeo)
Definition: ME0GeometryParsFromDD.cc:80
DDFilteredView::nextSibling
bool nextSibling()
set the current node to the next sibling ...
Definition: DDFilteredView.cc:124
DDfetch
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:79
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
ME0GeometryParsFromDD::getRotation
std::vector< double > getRotation(DDFilteredView &fv)
Definition: ME0GeometryParsFromDD.cc:145
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DD3Vector
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
Definition: PGeometricDetBuilder.cc:19
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
value
Definition: value.py:1
DDName::name
const std::string & name() const
Returns the name.
Definition: DDName.cc:41
DDFilteredView::geoHistory
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
Definition: DDFilteredView.cc:30
ME0DetId
Definition: ME0DetId.h:16
DDFilteredView::specifics
std::vector< const DDsvalues_type * > specifics() const
Definition: DDFilteredView.cc:32
me0TriggerPseudoDigis_cff.nStrips
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
Definition: me0TriggerPseudoDigis_cff.py:26
ME0NumberingScheme
Definition: ME0NumberingScheme.h:9
ME0DetId::chamberId
ME0DetId chamberId() const
Return the corresponding ChamberId (mask layers)
Definition: ME0DetId.h:53
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
DDRotationMatrix
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
Definition: DDRotationMatrix.h:8
DDValue
Definition: DDValue.h:21
DDFilteredView::translation
const DDTranslation & translation() const
The absolute translation of the current node.
Definition: DDFilteredView.cc:26
DDSolid::parameters
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:121
DDSpecificsMatchesValueFilter
Definition: DDFilter.h:70
DDFilteredView::rotation
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
Definition: DDFilteredView.cc:28
MuonGeometryNumbering
Definition: MuonGeometryNumbering.h:24
DDFilteredView
Definition: DDFilteredView.h:20
RecoIdealGeometry::insert
bool insert(DetId id, const std::vector< double > &trans, const std::vector< double > &rot, const std::vector< double > &pars)
Definition: RecoIdealGeometry.h:33
DDLogicalPart::solid
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
Definition: DDLogicalPart.cc:120
ME0GeometryParsFromDD::getTranslation
std::vector< double > getTranslation(DDFilteredView &fv)
Definition: ME0GeometryParsFromDD.cc:140