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 30 of file ME0GeometryBuilderFromDDD.cc.

References LogDebug.

31 {
32  LogDebug("ME0GeometryBuilderfromDDD") <<"[ME0GeometryBuilderFromDDD::constructor]";
33 }
#define LogDebug(id)
ME0GeometryBuilderFromDDD::~ME0GeometryBuilderFromDDD ( )

Definition at line 35 of file ME0GeometryBuilderFromDDD.cc.

36 { }

Member Function Documentation

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

Definition at line 38 of file ME0GeometryBuilderFromDDD.cc.

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

Referenced by ME0GeometryESModule::produce().

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

Definition at line 58 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, y, and z.

Referenced by build().

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