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 MuonDDDConstants &, 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 MuonDDDConstants &, 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 ( void  )
inline

Definition at line 16 of file ME0GeometryParsFromDD.h.

16 {}
ME0GeometryParsFromDD::~ME0GeometryParsFromDD ( void  )
inline

Member Function Documentation

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

Definition at line 14 of file ME0GeometryParsFromDD.cc.

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

Referenced by ME0RecoIdealDBLoader::beginRun(), and ~ME0GeometryParsFromDD().

17 {
18  std::string attribute = "MuStructure";
19  std::string value = "MuonEndCapME0";
20 
21  // Asking only for the MuonME0's
22  DDSpecificsMatchesValueFilter filter{DDValue(attribute, value, 0.0)};
23  DDFilteredView fview(*cview,filter);
24 
25  this->buildGeometry( fview, muonConstants, rgeo );
26 }
Definition: value.py:1
void buildGeometry(DDFilteredView &, const MuonDDDConstants &, RecoIdealGeometry &)
void ME0GeometryParsFromDD::buildChamber ( DDFilteredView fv,
ME0DetId  detId,
RecoIdealGeometry rgeo 
)
private

Definition at line 84 of file ME0GeometryParsFromDD.cc.

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

Referenced by buildGeometry(), and ~ME0GeometryParsFromDD().

85 {
86  LogDebug("ME0GeometryParsFromDD") << "buildChamber "<<fv.logicalPart().name().name()
87  <<" "<< detId <<std::endl;
88 
89  std::vector<double> pars = getDimension(fv);
90  std::vector<double> vtra = getTranslation(fv);
91  std::vector<double> vrot = getRotation(fv);
92 
93  rgeo.insert(detId.chamberId().rawId(), vtra, vrot, pars, {fv.logicalPart().name().name()});
94 }
#define LogDebug(id)
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
const N & name() const
Definition: DDBase.h:78
std::vector< double > getDimension(DDFilteredView &fv)
ME0DetId chamberId() const
Return the corresponding ChamberId (mask layers)
Definition: ME0DetId.h:67
bool insert(DetId id, const std::vector< double > &trans, const std::vector< double > &rot, const std::vector< double > &pars)
uint32_t rawId() const
get the raw id
Definition: DetId.h:44
std::vector< double > getRotation(DDFilteredView &fv)
std::vector< double > getTranslation(DDFilteredView &fv)
const std::string & name() const
Returns the name.
Definition: DDName.cc:90
void ME0GeometryParsFromDD::buildEtaPartition ( DDFilteredView fv,
ME0DetId  detId,
RecoIdealGeometry rgeo 
)
private

Definition at line 110 of file ME0GeometryParsFromDD.cc.

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

Referenced by buildGeometry(), and ~ME0GeometryParsFromDD().

111 {
112  LogDebug("ME0GeometryParsFromDD") << "buildEtaPartition "<<fv.logicalPart().name().name()
113  <<" "<< detId <<std::endl;
114 
115  // EtaPartition specific parameter (nstrips and npads)
116  DDValue numbOfStrips("nStrips");
117  DDValue numbOfPads("nPads");
118  const std::vector<const DDsvalues_type*> & specs = fv.specifics();
119  double nStrips = 0., nPads = 0.;
120  for ( auto const & is: specs){
121  if (DDfetch( is, numbOfStrips)) nStrips = numbOfStrips.doubles()[0];
122  if (DDfetch( is, numbOfPads)) nPads = numbOfPads.doubles()[0];
123  }
124  LogDebug("ME0GeometryParsFromDD")
125  << ((nStrips == 0. ) ? ("No nStrips found!!") : ("Number of strips: " + std::to_string(nStrips)));
126  LogDebug("ME0GeometryParsFromDD")
127  << ((nPads == 0. ) ? ("No nPads found!!") : ("Number of pads: " + std::to_string(nPads)));
128 
129  std::vector<double> pars = getDimension(fv);
130  pars.emplace_back(nStrips);
131  pars.emplace_back(nPads);
132  std::vector<double> vtra = getTranslation(fv);
133  std::vector<double> vrot = getRotation(fv);
134 
135  rgeo.insert(detId.rawId(), vtra, vrot, pars, {fv.logicalPart().name().name()});
136 }
#define LogDebug(id)
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
const N & name() const
Definition: DDBase.h:78
std::vector< double > getDimension(DDFilteredView &fv)
bool insert(DetId id, const std::vector< double > &trans, const std::vector< double > &rot, const std::vector< double > &pars)
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:81
uint32_t rawId() const
get the raw id
Definition: DetId.h:44
std::vector< double > getRotation(DDFilteredView &fv)
std::vector< const DDsvalues_type * > specifics() const
std::vector< double > getTranslation(DDFilteredView &fv)
const std::string & name() const
Returns the name.
Definition: DDName.cc:90
void ME0GeometryParsFromDD::buildGeometry ( DDFilteredView fv,
const MuonDDDConstants muonConstants,
RecoIdealGeometry rgeo 
)
private

Definition at line 29 of file ME0GeometryParsFromDD.cc.

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

Referenced by build(), and ~ME0GeometryParsFromDD().

32 {
33  LogDebug("ME0GeometryParsFromDD") <<"Building the geometry service";
34  LogDebug("ME0GeometryParsFromDD") << "About to run through the ME0 structure\n"
35  <<" First logical part "
36  <<fv.logicalPart().name().name();
37 
38  MuonDDDNumbering muonDDDNumbering(muonConstants);
39  ME0NumberingScheme me0Numbering(muonConstants);
40 
41  bool doChambers = fv.firstChild();
42  LogDebug("ME0GeometryParsFromDD") << "doChamber = " << doChambers;
43  // loop over superchambers
44  while (doChambers){
45 
46  // getting chamber id from eta partitions
47  fv.firstChild();fv.firstChild();
48  ME0DetId detIdCh = ME0DetId(me0Numbering.baseNumberToUnitNumber(muonDDDNumbering.geoHistoryToBaseNumber(fv.geoHistory())));
49  // back to chambers
50  fv.parent();fv.parent();
51 
52  buildChamber(fv, detIdCh, rgeo);
53 
54  // loop over chambers
55  // only 1 chamber
56  bool doLayers = fv.firstChild();
57  while (doLayers){
58 
59  // get layer ID
60  fv.firstChild();
61  ME0DetId detIdLa = ME0DetId(me0Numbering.baseNumberToUnitNumber(muonDDDNumbering.geoHistoryToBaseNumber(fv.geoHistory())));
62  fv.parent();
63  // build layer
64  buildLayer(fv, detIdLa, rgeo);
65 
66  // loop over ME0EtaPartitions
67  bool doEtaPart = fv.firstChild();
68  while (doEtaPart){
69 
70  ME0DetId detId = ME0DetId(me0Numbering.baseNumberToUnitNumber(muonDDDNumbering.geoHistoryToBaseNumber(fv.geoHistory())));
71  buildEtaPartition(fv, detId, rgeo);
72 
73  doEtaPart = fv.nextSibling();
74  }
75  fv.parent();
76  doLayers = fv.nextSibling();
77  }
78  fv.parent();
79  doChambers = fv.nextSibling();
80  }
81 }
#define LogDebug(id)
bool parent()
set the current node to the parent node ...
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
void buildEtaPartition(DDFilteredView &fv, ME0DetId detId, RecoIdealGeometry &rgeo)
const N & name() const
Definition: DDBase.h:78
bool nextSibling()
set the current node to the next sibling ...
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
void buildChamber(DDFilteredView &fv, ME0DetId detId, RecoIdealGeometry &rgeo)
bool firstChild()
set the current node to the first child ...
void buildLayer(DDFilteredView &fv, ME0DetId detId, RecoIdealGeometry &rgeo)
const std::string & name() const
Returns the name.
Definition: DDName.cc:90
void ME0GeometryParsFromDD::buildLayer ( DDFilteredView fv,
ME0DetId  detId,
RecoIdealGeometry rgeo 
)
private

Definition at line 97 of file ME0GeometryParsFromDD.cc.

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

Referenced by buildGeometry(), and ~ME0GeometryParsFromDD().

98 {
99  LogDebug("ME0GeometryParsFromDD") << "buildLayer "<<fv.logicalPart().name().name()
100  <<" "<< detId <<std::endl;
101 
102  std::vector<double> pars = getDimension(fv);
103  std::vector<double> vtra = getTranslation(fv);
104  std::vector<double> vrot = getRotation(fv);
105 
106  rgeo.insert(detId.layerId().rawId(), vtra, vrot, pars, {fv.logicalPart().name().name()});
107 }
#define LogDebug(id)
ME0DetId layerId() const
Return the corresponding LayerId (mask eta partition)
Definition: ME0DetId.h:71
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
const N & name() const
Definition: DDBase.h:78
std::vector< double > getDimension(DDFilteredView &fv)
bool insert(DetId id, const std::vector< double > &trans, const std::vector< double > &rot, const std::vector< double > &pars)
uint32_t rawId() const
get the raw id
Definition: DetId.h:44
std::vector< double > getRotation(DDFilteredView &fv)
std::vector< double > getTranslation(DDFilteredView &fv)
const std::string & name() const
Returns the name.
Definition: DDName.cc:90
std::vector< double > ME0GeometryParsFromDD::getDimension ( DDFilteredView fv)
private

Definition at line 138 of file ME0GeometryParsFromDD.cc.

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

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

139 {
140  std::vector<double> dpar = fv.logicalPart().solid().parameters();
141  //dpar[4] bottom width is along local X
142  //dpar[8] top width is along local X
143  //dpar[3] thickness is long local Z
144  //dpar[0] length is along local Y
145  LogDebug("ME0GeometryParsFromDD") << "dimension dx1 "<< dpar[4] << ", dx2 "<< dpar[8] << ", dy "<< dpar[0] << ", dz "<< dpar[3];
146  return {dpar[4], dpar[8], dpar[0], dpar[3]};
147 }
#define LogDebug(id)
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:150
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
std::vector< double > ME0GeometryParsFromDD::getRotation ( DDFilteredView fv)
private

Definition at line 155 of file ME0GeometryParsFromDD.cc.

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

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

156 {
157  const DDRotationMatrix& rota = fv.rotation();//.Inverse();
158  DD3Vector x, y, z;
159  rota.GetComponents(x,y,z);
160  return { x.X(), x.Y(), x.Z(),
161  y.X(), y.Y(), y.Z(),
162  z.X(), z.Y(), z.Z() };
163 }
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
Definition: DDTranslation.h:6
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
std::vector< double > ME0GeometryParsFromDD::getTranslation ( DDFilteredView fv)
private

Definition at line 149 of file ME0GeometryParsFromDD.cc.

References DDFilteredView::translation().

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

150 {
151  const DDTranslation& tran = fv.translation();
152  return {tran.x(), tran.y(), tran.z()};
153 }
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
const DDTranslation & translation() const
The absolute translation of the current node.