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 buildGeometry (DDFilteredView &, const MuonDDDConstants &, RecoIdealGeometry &)
 

Detailed Description

Definition at line 9 of file ME0GeometryParsFromDD.h.

Constructor & Destructor Documentation

ME0GeometryParsFromDD::ME0GeometryParsFromDD ( void  )
inline

Definition at line 13 of file ME0GeometryParsFromDD.h.

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

Definition at line 15 of file ME0GeometryParsFromDD.h.

References build(), and buildGeometry().

15 {}

Member Function Documentation

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

Definition at line 13 of file ME0GeometryParsFromDD.cc.

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

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

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 }
Definition: value.py:1
void buildGeometry(DDFilteredView &, const MuonDDDConstants &, RecoIdealGeometry &)
void ME0GeometryParsFromDD::buildGeometry ( DDFilteredView fview,
const MuonDDDConstants muonConstants,
RecoIdealGeometry rgeo 
)
private

Definition at line 28 of file ME0GeometryParsFromDD.cc.

References ME0NumberingScheme::baseNumberToUnitNumber(), DDFilteredView::firstChild(), DDFilteredView::geoHistory(), MuonDDDNumbering::geoHistoryToBaseNumber(), RecoIdealGeometry::insert(), DDFilteredView::logicalPart(), DDName::name(), dataset::name, DDBase< N, C >::name(), DDFilteredView::nextSibling(), DDSolid::parameters(), DDFilteredView::rotation(), DDLogicalPart::solid(), AlCaHLTBitMon_QueryRunRegistry::string, DDFilteredView::translation(), x, y, and z.

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

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)
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
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
bool firstChild()
set the current node to the first child ...
const DDTranslation & translation() const
The absolute translation of the current node.
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