CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
GEMGeometryParsFromDD Class Reference

#include <GEMGeometryParsFromDD.h>

Public Member Functions

void build (const DDCompactView *cview, const MuonDDDConstants &muonConstants, RecoIdealGeometry &rgeo)
 
 GEMGeometryParsFromDD ()
 
 ~GEMGeometryParsFromDD ()
 

Private Member Functions

void buildGeometry (DDFilteredView &fview, const MuonDDDConstants &muonConstants, RecoIdealGeometry &rgeo)
 

Detailed Description

Build the GEMGeometry ftom the DDD description

Author
M. Maggi - INFN Bari

Definition at line 19 of file GEMGeometryParsFromDD.h.

Constructor & Destructor Documentation

GEMGeometryParsFromDD::GEMGeometryParsFromDD ( )

Implementation of the GEM Geometry Builder from DDD

Author
M. Maggi - INFN Bari

Definition at line 24 of file GEMGeometryParsFromDD.cc.

25 { }
GEMGeometryParsFromDD::~GEMGeometryParsFromDD ( )

Definition at line 27 of file GEMGeometryParsFromDD.cc.

28 { }

Member Function Documentation

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

Definition at line 31 of file GEMGeometryParsFromDD.cc.

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

Referenced by GEMRecoIdealDBLoader::beginRun().

33 {
34  std::string attribute = "ReadOutName"; // could come from .orcarc
35  std::string value = "MuonGEMHits"; // could come from .orcarc
36 
37  // Asking only for the MuonGEM's
38  DDSpecificsMatchesValueFilter filter{DDValue(attribute, value, 0.0)};
39  DDFilteredView fview(*cview,filter);
40 
41  this->buildGeometry(fview, muonConstants, rgeo);
42 }
void buildGeometry(DDFilteredView &fview, const MuonDDDConstants &muonConstants, RecoIdealGeometry &rgeo)
Definition: value.py:1
void GEMGeometryParsFromDD::buildGeometry ( DDFilteredView fview,
const MuonDDDConstants muonConstants,
RecoIdealGeometry rgeo 
)
private

Definition at line 45 of file GEMGeometryParsFromDD.cc.

References GEMNumberingScheme::baseNumberToUnitNumber(), DDfetch(), DDValue::doubles(), DDFilteredView::firstChild(), objects.autophobj::float, DDFilteredView::geoHistory(), MuonDDDNumbering::geoHistoryToBaseNumber(), RecoIdealGeometry::insert(), LogDebug, DDFilteredView::logicalPart(), DDName::name(), dataset::name, DDBase< N, C >::name(), DDFilteredView::nextSibling(), DDSolid::parameters(), DetId::rawId(), DDFilteredView::rotation(), DDLogicalPart::solid(), DDFilteredView::specifics(), SiPixelPhase1DigisV_cfi::specs, AlCaHLTBitMon_QueryRunRegistry::string, DDFilteredView::translation(), x, y, and z.

Referenced by build().

46 {
47 
48  bool doSubDets = fview.firstChild();
49 
50  while (doSubDets){
51 
52  // Get the Base Muon Number
53  MuonDDDNumbering mdddnum(muonConstants);
54  MuonBaseNumber mbn = mdddnum.geoHistoryToBaseNumber(fview.geoHistory());
55 
56  // Get the The GEM det Id
57  GEMNumberingScheme gemnum(muonConstants);
58  int detid = 0;
59 
60  detid = gemnum.baseNumberToUnitNumber(mbn);
61  GEMDetId gemid(detid);
62 
63  DDValue numbOfStrips("nStrips");
64  DDValue numbOfPads("nPads");
65 
66  std::vector<const DDsvalues_type* > specs(fview.specifics());
67  std::vector<const DDsvalues_type* >::iterator is = specs.begin();
68  double nStrips = 0., nPads = 0.;
69  for (;is!=specs.end(); is++)
70  {
71  if (DDfetch( *is, numbOfStrips)) nStrips = numbOfStrips.doubles()[0];
72  if (DDfetch( *is, numbOfPads)) nPads = numbOfPads.doubles()[0];
73  }
74  LogDebug("GEMGeometryBuilderFromDDD") << ((nStrips == 0. ) ? ("No nStrips found!!") : (""));
75  LogDebug("GEMGeometryBuilderFromDDD") << ((nPads == 0. ) ? ("No nPads found!!") : (""));
76  //std::cout <<"# strips, pads: "<< nStrips<<", "<<nPads<<std::endl;
77 
78  std::vector<double> dpar = fview.logicalPart().solid().parameters();
79 
80  std::vector<std::string> strpars;
81  std::string name = fview.logicalPart().name().name();
82  strpars.emplace_back(name);
83  DDTranslation tran = fview.translation();
84 
85  DDRotationMatrix rota = fview.rotation();//.Inverse();
86  DD3Vector x, y, z;
87  rota.GetComponents(x,y,z);
88  std::vector<double> pars;
89  pars.emplace_back(dpar[4]); //b/2;
90  pars.emplace_back(dpar[8]); //B/2;
91  pars.emplace_back(dpar[0]); //h/2;
92  pars.emplace_back(0.4); // XXX: what is that? hardcoded thickness?
93  pars.emplace_back(nStrips);
94  pars.emplace_back(nPads);
95 
96  std::vector<double> vtra(3);
97  std::vector<double> vrot(9);
98  vtra[0]=(float) 1.0 * (tran.x());
99  vtra[1]=(float) 1.0 * (tran.y());
100  vtra[2]=(float) 1.0 * (tran.z());
101  vrot[0]=(float) 1.0 * x.X();
102  vrot[1]=(float) 1.0 * x.Y();
103  vrot[2]=(float) 1.0 * x.Z();
104  vrot[3]=(float) 1.0 * y.X();
105  vrot[4]=(float) 1.0 * y.Y();
106  vrot[5]=(float) 1.0 * y.Z();
107  vrot[6]=(float) 1.0 * z.X();
108  vrot[7]=(float) 1.0 * z.Y();
109  vrot[8]=(float) 1.0 * z.Z();
110  rgeo.insert(gemid.rawId(), vtra, vrot, pars, strpars);
111  doSubDets = fview.nextSibling(); // go to next layer
112  }
113 
114 }
#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 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.
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:81
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.
std::vector< const DDsvalues_type * > specifics() const
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