CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
ME0GeometryBuilderFromDDD Class Reference

#include <ME0GeometryBuilderFromDDD.h>

Public Member Functions

ME0Geometrybuild (const DDCompactView *cview, const MuonDDDConstants &muonConstants)
 
 ME0GeometryBuilderFromDDD ()
 
 ~ME0GeometryBuilderFromDDD ()
 

Private Member Functions

ME0GeometrybuildGeometry (DDFilteredView &fview, const MuonDDDConstants &muonConstants)
 

Private Attributes

std::map< ME0DetId,
std::vector< ME0DetId > > 
chids
 

Detailed Description

Build the ME0Geometry ftom the DDD description

Author
M. Maggi - INFN Bari

Definition at line 22 of file ME0GeometryBuilderFromDDD.h.

Constructor & Destructor Documentation

ME0GeometryBuilderFromDDD::ME0GeometryBuilderFromDDD ( )

Implementation of the ME0 Geometry Builder from DDD

Author
Port of: MuDDDME0Builder (ORCA)
M. Maggi - INFN Bari

Definition at line 29 of file ME0GeometryBuilderFromDDD.cc.

30 { }
ME0GeometryBuilderFromDDD::~ME0GeometryBuilderFromDDD ( )

Definition at line 32 of file ME0GeometryBuilderFromDDD.cc.

33 { }

Member Function Documentation

ME0Geometry * ME0GeometryBuilderFromDDD::build ( const DDCompactView cview,
const MuonDDDConstants muonConstants 
)

Definition at line 35 of file ME0GeometryBuilderFromDDD.cc.

References DDFilteredView::addFilter(), DDSpecificsFilter::AND, buildGeometry(), alcazmumu_cfi::filter, DDSpecificsFilter::matches, DDSpecificsFilter::setCriteria(), AlCaHLTBitMon_QueryRunRegistry::string, and relativeConstraints::value.

Referenced by ME0GeometryESModule::produce().

36 {
37  std::string attribute = "ReadOutName"; // could come from .orcarc
38  std::string value = "MuonME0Hits"; // could come from .orcarc
39  DDValue val(attribute, value, 0.0);
40 
41  // Asking only for the MuonME0's
43  filter.setCriteria(val, // name & value of a variable
46  true, // compare strings otherwise doubles
47  true // use merged-specifics or simple-specifics
48  );
49  DDFilteredView fview(*cview);
50  fview.addFilter(filter);
51 
52  return this->buildGeometry(fview, muonConstants);
53 }
ME0Geometry * buildGeometry(DDFilteredView &fview, const MuonDDDConstants &muonConstants)
void setCriteria(const DDValue &nameVal, comp_op, log_op l=AND, bool asString=true, bool merged=true)
Definition: DDFilter.cc:285
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs.
Definition: DDFilter.h:37
ME0Geometry * ME0GeometryBuilderFromDDD::buildGeometry ( DDFilteredView fview,
const MuonDDDConstants muonConstants 
)
private

Definition at line 55 of file ME0GeometryBuilderFromDDD.cc.

References ME0Geometry::add(), ME0NumberingScheme::baseNumberToUnitNumber(), DDFilteredView::firstChild(), DDFilteredView::geoHistory(), MuonDDDNumbering::geoHistoryToBaseNumber(), geometry, LogDebug, DDFilteredView::logicalPart(), GeomDetEnumerators::ME0, DDName::name(), mergeVDriftHistosByStation::name, DDBase< N, C >::name(), DDFilteredView::nextSibling(), DDSolid::parameters(), makeMuonMisalignmentScenario::rot, TkRotation< T >::rotateAxes(), DDFilteredView::rotation(), DDLogicalPart::solid(), AlCaHLTBitMon_QueryRunRegistry::string, DDFilteredView::translation(), x, detailsBasic3DVector::y, and detailsBasic3DVector::z.

Referenced by build().

56 {
57  LogDebug("ME0GeometryBuilderFromDDD") <<"Building the geometry service";
59 
60  LogDebug("ME0GeometryBuilderFromDDD") << "About to run through the ME0 structure\n"
61  <<" First logical part "
62  <<fview.logicalPart().name().name();
63 
64 
65  bool doSubDets = fview.firstChild();
66 
67  LogDebug("ME0GeometryBuilderFromDDD") << "doSubDets = " << doSubDets;
68 
69  LogDebug("ME0GeometryBuilderFromDDD") <<"start the loop";
70  while (doSubDets)
71  {
72  // Get the Base Muon Number
73  MuonDDDNumbering mdddnum(muonConstants);
74  LogDebug("ME0GeometryBuilderFromDDD") <<"Getting the Muon base Number";
75  MuonBaseNumber mbn = mdddnum.geoHistoryToBaseNumber(fview.geoHistory());
76 
77  LogDebug("ME0GeometryBuilderFromDDD") <<"Start the ME0 Numbering Schema";
78  ME0NumberingScheme me0num(muonConstants);
79 
80  ME0DetId rollDetId(me0num.baseNumberToUnitNumber(mbn));
81  LogDebug("ME0GeometryBuilderFromDDD") << "ME0 eta partition rawId: " << rollDetId.rawId() << ", detId: " << rollDetId;
82 
83  std::vector<double> dpar=fview.logicalPart().solid().parameters();
84  std::string name = fview.logicalPart().name().name();
85  DDTranslation tran = fview.translation();
86  DDRotationMatrix rota = fview.rotation();
87  Surface::PositionType pos(tran.x()/cm, tran.y()/cm, tran.z()/cm);
88  // CLHEP way
89  // Surface::RotationType rot(rota.xx(),rota.xy(),rota.xz(),
90  // rota.yx(),rota.yy(),rota.yz(),
91  // rota.zx(),rota.zy(),rota.zz());
92 
93  //ROOT::Math way
94  DD3Vector x, y, z;
95  rota.GetComponents(x,y,z);
96  // doesn't this just re-inverse???
97  Surface::RotationType rot(float(x.X()), float(x.Y()), float(x.Z()),
98  float(y.X()), float(y.Y()), float(y.Z()),
99  float(z.X()), float(z.Y()), float(z.Z()));
100 
101  float be = dpar[4]/cm; // half bottom edge
102  float te = dpar[8]/cm; // half top edge
103  float ap = dpar[0]/cm; // half apothem
104  float ti = 0.4/cm; // half thickness
105 
106  // TrapezoidalPlaneBounds*
107  Bounds* bounds = new TrapezoidalPlaneBounds(be, te, ap, ti);
108 
109  std::vector<float> pars;
110  pars.push_back(be);
111  pars.push_back(te);
112  pars.push_back(ap);
113  // pars.push_back(nStrips);
114  // pars.push_back(nPads);
115 
116  LogDebug("ME0GeometryBuilderFromDDD")
117  << "ME0 " << name << " par " << be << " " << te << " " << ap << " " << dpar[0];
118 
120 
121  //Change of axes for the forward
122  Basic3DVector<float> newX(1.,0.,0.);
123  Basic3DVector<float> newY(0.,0.,1.);
124  // if (tran.z() > 0. )
125  newY *= -1;
126  Basic3DVector<float> newZ(0.,1.,0.);
127  rot.rotateAxes (newX, newY, newZ);
128 
129  BoundPlane* bp = new BoundPlane(pos, rot, bounds);
131  ME0EtaPartition* mep = new ME0EtaPartition(rollDetId, surf, e_p_specs);
132 
133  // Add the eta partition to the geometry
134  geometry->add(mep);
135  // go to next layer
136  doSubDets = fview.nextSibling();
137  }
138  return geometry;
139 }
#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:82
bool nextSibling()
set the current node to the next sibling ...
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
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.
float float float z
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
void add(ME0EtaPartition *etaPartition)
Add a ME0 etaPartition to the Geometry.
Definition: ME0Geometry.cc:67
ESHandle< TrackerGeometry > geometry
bool firstChild()
set the current node to the first child ...
Definition: Bounds.h:22
const DDTranslation & translation() const
The absolute translation of the current node.
Definition: DDAxes.h:10
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
const std::string & name() const
Returns the name.
Definition: DDName.cc:87

Member Data Documentation

std::map<ME0DetId,std::vector<ME0DetId> > ME0GeometryBuilderFromDDD::chids
private

Definition at line 34 of file ME0GeometryBuilderFromDDD.h.