CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ME0GeometryParsFromDD.cc
Go to the documentation of this file.
11 
12 void
14  const MuonDDDConstants& muonConstants,
15  RecoIdealGeometry& rgeo )
16 {
17  std::string attribute = "ReadOutName";
18  std::string value = "MuonME0Hits";
19 
20  // Asking only for the MuonME0's
21  DDSpecificsMatchesValueFilter filter{DDValue(attribute, value, 0.0)};
22  DDFilteredView fview( *cview, filter );
23 
24  this->buildGeometry( fview, muonConstants, rgeo );
25 }
26 
27 void
29  const MuonDDDConstants& muonConstants,
30  RecoIdealGeometry& rgeo )
31 {
32  bool doSubDets = fview.firstChild();
33 
34  while( doSubDets )
35  {
36  // Get the Base Muon Number
37  MuonDDDNumbering mdddnum( muonConstants );
38  MuonBaseNumber mbn = mdddnum.geoHistoryToBaseNumber( fview.geoHistory());
39 
40  // Get the The ME0 det Id
41  ME0NumberingScheme me0num( muonConstants );
42  ME0DetId rollDetId( me0num.baseNumberToUnitNumber( mbn ));
43 
44  std::vector<double> dpar = fview.logicalPart().solid().parameters();
45  std::vector<double> pars;
46  pars.push_back( dpar[4]); // half bottom edge
47  pars.push_back( dpar[8]); // half top edge
48  pars.push_back( dpar[0]); // half apothem
49  pars.push_back( 0.4 ); // half thickness
50  pars.push_back( 0.0 ); // nStrips
51  pars.push_back( 0.0 ); // nPads
52 
53  std::string name = fview.logicalPart().name().name();
54  std::vector<std::string> strpars;
55  strpars.push_back( name );
56 
57  DDRotationMatrix rota = fview.rotation();
58 
59  // ROOT::Math way
60  DD3Vector x, y, z;
61  rota.GetComponents( x, y, z );
62  std::vector<double> vrot(9);
63  vrot[0] = x.X();
64  vrot[1] = x.Y();
65  vrot[2] = x.Z();
66  vrot[3] = y.X();
67  vrot[4] = y.Y();
68  vrot[5] = y.Z();
69  vrot[6] = z.X();
70  vrot[7] = z.Y();
71  vrot[8] = z.Z();
72 
73  DDTranslation tran = fview.translation();
74  std::vector<double> vtra(3);
75  vtra[0] = tran.x();
76  vtra[1] = tran.y();
77  vtra[2] = tran.z();
78 
79  rgeo.insert( rollDetId.rawId(), vtra, vrot, pars, strpars );
80  doSubDets = fview.nextSibling(); // go to next layer
81  }
82 }
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:147
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
const N & name() const
Definition: DDBase.h:78
bool nextSibling()
set the current node to the next sibling ...
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
bool insert(DetId id, const std::vector< double > &trans, const std::vector< double > &rot, const std::vector< double > &pars)
void build(const DDCompactView *, const MuonDDDConstants &, RecoIdealGeometry &)
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
type of data representation of DDCompactView
Definition: DDCompactView.h:90
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
Definition: DDTranslation.h:6
Definition: value.py:1
void buildGeometry(DDFilteredView &, const MuonDDDConstants &, RecoIdealGeometry &)
virtual int baseNumberToUnitNumber(const MuonBaseNumber &)
bool firstChild()
set the current node to the first child ...
const DDTranslation & translation() const
The absolute translation of the current node.
MuonBaseNumber geoHistoryToBaseNumber(const DDGeoHistory &history)
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
const std::string & name() const
Returns the name.
Definition: DDName.cc:90