25 #include "CLHEP/Units/GlobalSystemOfUnits.h" 30 #include <boost/lexical_cast.hpp> 34 LogDebug(
"ME0GeometryBuilderfromDDD") <<
"[ME0GeometryBuilderFromDDD::constructor]";
54 LogDebug(
"ME0GeometryBuilderFromDDD") <<
"Building the geometry service";
57 LogDebug(
"ME0GeometryBuilderFromDDD") <<
"About to run through the ME0 structure\n" 58 <<
" First logical part " 64 LogDebug(
"ME0GeometryBuilderFromDDD") <<
"doSubDets = " << doSubDets;
66 LogDebug(
"ME0GeometryBuilderFromDDD") <<
"start the loop";
73 LogDebug(
"ME0GeometryBuilderFromDDD") <<
"Getting the Muon base Number";
76 LogDebug(
"ME0GeometryBuilderFromDDD") <<
"Start the ME0 Numbering Schema";
80 LogDebug(
"ME0GeometryBuilderFromDDD") <<
"ME0 eta partition rawId: " << rollDetId.rawId() <<
", detId: " << rollDetId;
83 LogDebug(
"ME0GeometryBuilderFromDDD") <<
"ME0 chamber rawId: " <<
ME0DetId(rollDetId.chamberId()).rawId() <<
", detId: " <<
ME0DetId(rollDetId.chamberId());
89 if (rollDetId.roll()==1) ++nChambers;
104 rota.GetComponents(x,y,z);
107 float(y.X()),
float(y.Y()),
float(y.Z()),
108 float(z.X()),
float(z.Y()),
float(z.Z()));
110 float be = dpar[4]/cm;
111 float te = dpar[8]/cm;
112 float ap = dpar[0]/cm;
118 std::vector<float> pars;
119 pars.emplace_back(be);
120 pars.emplace_back(te);
121 pars.emplace_back(ap);
122 float nStrips = -999.;
124 pars.emplace_back(nStrips);
125 pars.emplace_back(nPads);
127 LogDebug(
"ME0GeometryBuilderFromDDD")
128 <<
"ME0 " << name <<
" par " << be <<
" " << te <<
" " << ap <<
" " << dpar[0];
144 ME0DetId rollDetId2(rollDetId.region(),rollDetId.layer(),rollDetId.station(),1);
148 ME0DetId layerDetId(rollDetId.layerId());
167 std::vector<ME0DetId> vDetId;
169 int oldLayerNumber = 1;
170 for (
unsigned i=1;
i<=partitions.size(); ++
i){
171 ME0DetId detId(partitions.at(
i-1)->id());
172 LogDebug(
"ME0GeometryBuilderFromDDD") <<
"Making ME0DetId = " <<detId;
179 const int layerNumber(detId.layer());
180 if (layerNumber < oldLayerNumber ||
i == partitions.size()) {
183 if (
i == partitions.size()) vDetId.emplace_back(detId);
186 ME0DetId chamberId(fId.chamberId());
187 LogDebug(
"ME0GeometryBuilderFromDDD") <<
"ME0DetId = " << fId ;
188 LogDebug(
"ME0GeometryBuilderFromDDD") <<
"ME0ChamberId = " << chamberId ;
196 LogDebug(
"ME0GeometryBuilderFromDDD") <<
"Creating chamber " << chamberId <<
" with " << vDetId.size() <<
" eta partitions";
198 for(
auto id : vDetId){
199 LogDebug(
"ME0GeometryBuilderFromDDD") <<
"Adding eta partition " <<
id <<
" to ME0 chamber";
203 LogDebug(
"ME0GeometryBuilderFromDDD") <<
"Adding the chamber to the geometry";
207 vDetId.emplace_back(detId);
208 oldLayerNumber = layerNumber;
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
ME0Geometry * build(const DDCompactView *cview, const MuonDDDConstants &muonConstants)
ME0GeometryBuilderFromDDD()
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 ME0EtaPartition * etaPartition(ME0DetId id) const
Return a etaPartition given its id.
type of data representation of DDCompactView
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
void add(ME0Layer *layer)
Add Layer to the chamber which takes ownership.
TkRotation & rotateAxes(const Basic3DVector< T > &newX, const Basic3DVector< T > &newY, const Basic3DVector< T > &newZ)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
int baseNumberToUnitNumber(const MuonBaseNumber &) override
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
ME0Geometry * buildGeometry(DDFilteredView &fview, const MuonDDDConstants &muonConstants)
const std::vector< ME0EtaPartition const * > & etaPartitions() const
Return a vector of all ME0 eta partitions.
void add(ME0EtaPartition *etaPartition)
Add a ME0 etaPartition to the Geometry.
ESHandle< TrackerGeometry > geometry
~ME0GeometryBuilderFromDDD()
bool firstChild()
set the current node to the first child ...
const DDTranslation & translation() const
The absolute translation of the current node.
MuonBaseNumber geoHistoryToBaseNumber(const DDGeoHistory &history)
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
const std::string & name() const
Returns the name.