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 DDFilteredView::addFilter(), AND, buildGeometry(), ALCARECOTkAlBeamHalo_cff::filter, matches, DDSpecificsFilter::setCriteria(), AlCaHLTBitMon_QueryRunRegistry::string, and heppy_batch::val.

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

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

Definition at line 36 of file ME0GeometryParsFromDD.cc.

References ME0NumberingScheme::baseNumberToUnitNumber(), DDFilteredView::firstChild(), DDFilteredView::geoHistory(), MuonDDDNumbering::geoHistoryToBaseNumber(), RecoIdealGeometry::insert(), DDFilteredView::logicalPart(), dataset::name, DDName::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().

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
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