CMS 3D CMS Logo

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  DDValue val(attribute, value, 0.0);
20 
21  // Asking only for the MuonME0's
23  filter.setCriteria( val, // name & value of a variable
25  DDLogOp::AND,
26  true, // compare strings otherwise doubles
27  true // use merged-specifics or simple-specifics
28  );
29  DDFilteredView fview( *cview );
30  fview.addFilter( filter );
31 
32  this->buildGeometry( fview, muonConstants, rgeo );
33 }
34 
35 void
37  const MuonDDDConstants& muonConstants,
38  RecoIdealGeometry& rgeo )
39 {
40  bool doSubDets = fview.firstChild();
41 
42  while( doSubDets )
43  {
44  // Get the Base Muon Number
45  MuonDDDNumbering mdddnum( muonConstants );
46  MuonBaseNumber mbn = mdddnum.geoHistoryToBaseNumber( fview.geoHistory());
47 
48  // Get the The ME0 det Id
49  ME0NumberingScheme me0num( muonConstants );
50  ME0DetId rollDetId( me0num.baseNumberToUnitNumber( mbn ));
51 
52  std::vector<double> dpar = fview.logicalPart().solid().parameters();
53  std::vector<double> pars;
54  pars.push_back( dpar[4]); // half bottom edge
55  pars.push_back( dpar[8]); // half top edge
56  pars.push_back( dpar[0]); // half apothem
57  pars.push_back( 0.4 ); // half thickness
58  pars.push_back( 0.0 ); // nStrips
59  pars.push_back( 0.0 ); // nPads
60 
61  std::string name = fview.logicalPart().name().name();
62  std::vector<std::string> strpars;
63  strpars.push_back( name );
64 
65  DDRotationMatrix rota = fview.rotation();
66 
67  // ROOT::Math way
68  DD3Vector x, y, z;
69  rota.GetComponents( x, y, z );
70  std::vector<double> vrot(9);
71  vrot[0] = x.X();
72  vrot[1] = x.Y();
73  vrot[2] = x.Z();
74  vrot[3] = y.X();
75  vrot[4] = y.Y();
76  vrot[5] = y.Z();
77  vrot[6] = z.X();
78  vrot[7] = z.Y();
79  vrot[8] = z.Z();
80 
81  DDTranslation tran = fview.translation();
82  std::vector<double> vtra(3);
83  vtra[0] = tran.x();
84  vtra[1] = tran.y();
85  vtra[2] = tran.z();
86 
87  rgeo.insert( rollDetId.rawId(), vtra, vrot, pars, strpars );
88  doSubDets = fview.nextSibling(); // go to next layer
89  }
90 }
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:157
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
const N & name() const
Definition: DDBase.h:78
void addFilter(const DDFilter &, DDLogOp op=DDLogOp::AND)
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
void setCriteria(const DDValue &nameVal, DDCompOp, DDLogOp l=DDLogOp::AND, bool asString=true, bool merged=true)
Definition: DDFilter.cc:253
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs.
Definition: DDFilter.h:33