CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
RPCGeometryBuilderFromDDD Class Reference

#include <RPCGeometryBuilderFromDDD.h>

Public Member Functions

RPCGeometrybuild (const DDCompactView *cview, const MuonDDDConstants &muonConstants)
 
RPCGeometrybuild (const cms::DDCompactView *cview, const cms::MuonNumbering &muonConstants)
 
 RPCGeometryBuilderFromDDD (bool comp11)
 
 ~RPCGeometryBuilderFromDDD ()
 

Private Member Functions

RPCGeometrybuildGeometry (DDFilteredView &fview, const MuonDDDConstants &muonConstants)
 
RPCGeometrybuildGeometry (cms::DDFilteredView &fview, const cms::MuonNumbering &muonConstants)
 

Private Attributes

std::map< RPCDetId, std::list< RPCRoll * > > chids
 
std::unique_ptr< cms::RPCNumberingSchemerpcnum_ = nullptr
 
bool theComp11Flag
 

Detailed Description

Definition at line 35 of file RPCGeometryBuilderFromDDD.h.

Constructor & Destructor Documentation

RPCGeometryBuilderFromDDD::RPCGeometryBuilderFromDDD ( bool  comp11)

Definition at line 41 of file RPCGeometryBuilderFromDDD.cc.

RPCGeometryBuilderFromDDD::~RPCGeometryBuilderFromDDD ( )

Definition at line 43 of file RPCGeometryBuilderFromDDD.cc.

43 {}

Member Function Documentation

RPCGeometry * RPCGeometryBuilderFromDDD::build ( const DDCompactView cview,
const MuonDDDConstants muonConstants 
)

Definition at line 46 of file RPCGeometryBuilderFromDDD.cc.

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

Referenced by RPCGeometryESModule::produce().

46  {
47  const std::string attribute = "ReadOutName";
48  const std::string value = "MuonRPCHits";
49  DDSpecificsMatchesValueFilter filter{DDValue(attribute, value, 0.0)};
50  DDFilteredView fview(*cview, filter);
51  return this->buildGeometry(fview, muonConstants);
52 }
RPCGeometry * buildGeometry(DDFilteredView &fview, const MuonDDDConstants &muonConstants)
Definition: value.py:1
RPCGeometry * RPCGeometryBuilderFromDDD::build ( const cms::DDCompactView cview,
const cms::MuonNumbering muonConstants 
)

Definition at line 54 of file RPCGeometryBuilderFromDDD.cc.

References buildGeometry(), cms::DDCompactView::detector(), cms::DDSpecParRegistry::filter(), cms::DDCompactView::specpars(), AlCaHLTBitMon_QueryRunRegistry::string, and cms::DDDetector::worldVolume().

55  {
56  const std::string attribute = "ReadOutName";
57  const std::string value = "MuonRPCHits";
58  cms::DDFilteredView fview(cview->detector(), cview->detector()->worldVolume());
59  cms::DDSpecParRefs refs;
60  const cms::DDSpecParRegistry& mypar = cview->specpars();
61  mypar.filter(refs, attribute, value);
62  fview.mergedSpecifics(refs);
63  return this->buildGeometry(fview, muonConstants);
64 }
Volume worldVolume() const
Handle to the world volume containing everything.
Definition: DDDetector.cc:41
void filter(DDSpecParRefs &, std::string_view, std::string_view) const
RPCGeometry * buildGeometry(DDFilteredView &fview, const MuonDDDConstants &muonConstants)
Definition: value.py:1
std::vector< const DDSpecPar * > DDSpecParRefs
DDSpecParRegistry const & specpars() const
Definition: DDCompactView.h:33
const cms::DDDetector * detector() const
Definition: DDCompactView.h:32
RPCGeometry * RPCGeometryBuilderFromDDD::buildGeometry ( DDFilteredView fview,
const MuonDDDConstants muonConstants 
)
private

Definition at line 66 of file RPCGeometryBuilderFromDDD.cc.

References RPCChamber::add(), RPCGeometry::add(), RPCNumberingScheme::baseNumberToUnitNumber(), Surface::bounds(), chids, geant_units::operators::convertMmToCm(), DDfetch(), DDValue::doubles(), DDFilteredView::firstChild(), dqmMemoryStats::float, DDFilteredView::geoHistory(), MuonDDDNumbering::geoHistoryToBaseNumber(), geometry, createfilelist::int, RPCDetId::layer(), Bounds::length(), LogDebug, DDFilteredView::logicalPart(), SiStripPI::max, min(), Skims_PA_cff::name, DDName::name(), DDBase< N, C >::name(), DDFilteredView::nextSibling(), me0TriggerPseudoDigis_cff::nStrips, DDSolid::parameters(), alignCSCRings::r, RPCDetId::region(), RPCDetId::ring(), makeMuonMisalignmentScenario::rot, TkRotation< T >::rotateAxes(), DDFilteredView::rotation(), GeomDetEnumerators::RPCBarrel, GeomDetEnumerators::RPCEndcap, RPCDetId::sector(), DDLogicalPart::solid(), DDFilteredView::specifics(), HistogramManager_cfi::specs, RPCDetId::station(), AlCaHLTBitMon_QueryRunRegistry::string, RPCDetId::subsector(), theComp11Flag, Calorimetry_cff::thickness, DDFilteredView::translation(), w2, ApeEstimator_cff::width, x, y, and z.

Referenced by build().

66  {
67  LogDebug("RPCGeometryBuilderFromDDD") << "Building the geometry service";
69  LogDebug("RPCGeometryBuilderFromDDD") << "About to run through the RPC structure\n"
70  << " First logical part " << fview.logicalPart().name().name();
71  bool doSubDets = fview.firstChild();
72  LogDebug("RPCGeometryBuilderFromDDD") << "doSubDets = " << doSubDets;
73  while (doSubDets) {
74  LogDebug("RPCGeometryBuilderFromDDD") << "start the loop";
75  MuonDDDNumbering mdddnum(muonConstants);
76  LogDebug("RPCGeometryBuilderFromDDD") << "Getting the Muon base Number";
77  MuonBaseNumber mbn = mdddnum.geoHistoryToBaseNumber(fview.geoHistory());
78  LogDebug("RPCGeometryBuilderFromDDD") << "Start the Rpc Numbering Schema";
79  RPCNumberingScheme rpcnum(muonConstants);
80  LogDebug("RPCGeometryBuilderFromDDD") << "Getting the Unit Number";
81  const int detid = rpcnum.baseNumberToUnitNumber(mbn);
82  LogDebug("RPCGeometryBuilderFromDDD") << "Getting the RPC det Id " << detid;
83  RPCDetId rpcid(detid);
84  RPCDetId chid(rpcid.region(), rpcid.ring(), rpcid.station(), rpcid.sector(), rpcid.layer(), rpcid.subsector(), 0);
85  LogDebug("RPCGeometryBuilderFromDDD") << "The RPCDetid is " << rpcid;
86 
87  DDValue numbOfStrips("nStrips");
88 
89  std::vector<const DDsvalues_type*> specs(fview.specifics());
90  int nStrips = 0;
91  for (auto& spec : specs) {
92  if (DDfetch(spec, numbOfStrips)) {
93  nStrips = int(numbOfStrips.doubles()[0]);
94  }
95  }
96 
97  LogDebug("RPCGeometryBuilderFromDDD") << ((nStrips == 0) ? ("No strip found!!") : (""));
98 
99  std::vector<double> dpar = fview.logicalPart().solid().parameters();
100  std::string name = fview.logicalPart().name().name();
101  DDTranslation tran = fview.translation();
102  DDRotationMatrix rota = fview.rotation();
106 
107  DD3Vector x, y, z;
108  rota.GetComponents(x, y, z);
109  Surface::RotationType rot(float(x.X()),
110  float(x.Y()),
111  float(x.Z()),
112  float(y.X()),
113  float(y.Y()),
114  float(y.Z()),
115  float(z.X()),
116  float(z.Y()),
117  float(z.Z()));
118 
119  RPCRollSpecs* rollspecs = nullptr;
120  Bounds* bounds = nullptr;
121 
122  if (dpar.size() == 3) {
123  const float width = geant_units::operators::convertMmToCm(dpar[0]);
124  const float length = geant_units::operators::convertMmToCm(dpar[1]);
125  const float thickness = geant_units::operators::convertMmToCm(dpar[2]);
126  bounds = new RectangularPlaneBounds(width, length, thickness);
127  const std::vector<float> pars = {width, length, float(numbOfStrips.doubles()[0])};
128 
129  if (!theComp11Flag) {
130  if (tran.z() > -1500.) {
131  Basic3DVector<float> newX(-1., 0., 0.);
132  Basic3DVector<float> newY(0., -1., 0.);
133  Basic3DVector<float> newZ(0., 0., 1.);
134  rot.rotateAxes(newX, newY, newZ);
135  }
136  }
137 
138  rollspecs = new RPCRollSpecs(GeomDetEnumerators::RPCBarrel, name, pars);
139  LogDebug("RPCGeometryBuilderFromDDD")
140  << "Barrel " << name << " par " << width << " " << length << " " << thickness;
141 
142  } else {
143  const float be = geant_units::operators::convertMmToCm(dpar[4]);
144  const float te = geant_units::operators::convertMmToCm(dpar[8]);
145  const float ap = geant_units::operators::convertMmToCm(dpar[0]);
146  const float ti = 0.4;
147 
148  bounds = new TrapezoidalPlaneBounds(be, te, ap, ti);
149 
150  const std::vector<float> pars = {float(geant_units::operators::convertMmToCm(dpar[4])),
153  float(numbOfStrips.doubles()[0])};
154  LogDebug("RPCGeometryBuilderFromDDD")
155  << "Forward " << name << " par " << dpar[4] << " " << dpar[8] << " " << dpar[3] << " " << dpar[0];
156 
157  rollspecs = new RPCRollSpecs(GeomDetEnumerators::RPCEndcap, name, pars);
158 
159  Basic3DVector<float> newX(1., 0., 0.);
160  Basic3DVector<float> newY(0., 0., 1.);
161  newY *= -1;
162  Basic3DVector<float> newZ(0., 1., 0.);
163  rot.rotateAxes(newX, newY, newZ);
164  }
165  LogDebug("RPCGeometryBuilderFromDDD") << " Number of strips " << nStrips;
166 
167  BoundPlane* bp = new BoundPlane(pos, rot, bounds);
169  RPCRoll* r = new RPCRoll(rpcid, surf, rollspecs);
170  geometry->add(r);
171 
172  auto rls = chids.find(chid);
173  if (rls == chids.end())
174  rls = chids.insert(std::make_pair(chid, std::list<RPCRoll*>())).first;
175  rls->second.emplace_back(r);
176 
177  doSubDets = fview.nextSibling();
178  }
179  for (auto& ich : chids) {
180  const RPCDetId& chid = ich.first;
181  const auto& rls = ich.second;
182 
183  BoundPlane* bp = nullptr;
184  if (!rls.empty()) {
185  const auto& refSurf = (*rls.begin())->surface();
186  if (chid.region() == 0) {
187  float corners[6] = {0, 0, 0, 0, 0, 0};
188  for (auto rl : rls) {
189  const double h2 = rl->surface().bounds().length() / 2;
190  const double w2 = rl->surface().bounds().width() / 2;
191  const auto x1y1AtRef = refSurf.toLocal(rl->toGlobal(LocalPoint(-w2, -h2, 0)));
192  const auto x2y2AtRef = refSurf.toLocal(rl->toGlobal(LocalPoint(+w2, +h2, 0)));
193  corners[0] = std::min(corners[0], x1y1AtRef.x());
194  corners[1] = std::min(corners[1], x1y1AtRef.y());
195  corners[2] = std::max(corners[2], x2y2AtRef.x());
196  corners[3] = std::max(corners[3], x2y2AtRef.y());
197  corners[4] = std::min(corners[4], x1y1AtRef.z());
198  corners[5] = std::max(corners[5], x1y1AtRef.z());
199  }
200  const LocalPoint lpOfCentre((corners[0] + corners[2]) / 2, (corners[1] + corners[3]) / 2, 0);
201  const auto gpOfCentre = refSurf.toGlobal(lpOfCentre);
202  auto bounds = new RectangularPlaneBounds(
203  (corners[2] - corners[0]) / 2, (corners[3] - corners[1]) / 2, (corners[5] - corners[4]) + 0.5);
204  bp = new BoundPlane(gpOfCentre, refSurf.rotation(), bounds);
205  } else {
206  float cornersLo[3] = {0, 0, 0}, cornersHi[3] = {0, 0, 0};
207  float cornersZ[2] = {0, 0};
208  for (auto rl : rls) {
209  const double h2 = rl->surface().bounds().length() / 2;
210  const double w2 = rl->surface().bounds().width() / 2;
211  const auto& topo = dynamic_cast<const TrapezoidalStripTopology&>(rl->specificTopology());
212  const double r = topo.radius();
213  const double wAtLo = w2 / r * (r - h2);
214  const double wAtHi = w2 / r * (r + h2);
215 
216  const auto x1y1AtRef = refSurf.toLocal(rl->toGlobal(LocalPoint(-wAtLo, -h2, 0)));
217  const auto x2y1AtRef = refSurf.toLocal(rl->toGlobal(LocalPoint(+wAtLo, -h2, 0)));
218  const auto x1y2AtRef = refSurf.toLocal(rl->toGlobal(LocalPoint(-wAtHi, +h2, 0)));
219  const auto x2y2AtRef = refSurf.toLocal(rl->toGlobal(LocalPoint(+wAtHi, +h2, 0)));
220 
221  cornersLo[0] = std::min(cornersLo[0], x1y1AtRef.x());
222  cornersLo[1] = std::max(cornersLo[1], x2y1AtRef.x());
223  cornersLo[2] = std::min(cornersLo[2], x1y1AtRef.y());
224 
225  cornersHi[0] = std::min(cornersHi[0], x1y2AtRef.x());
226  cornersHi[1] = std::max(cornersHi[1], x2y2AtRef.x());
227  cornersHi[2] = std::max(cornersHi[2], x1y2AtRef.y());
228 
229  cornersZ[0] = std::min(cornersZ[0], x1y1AtRef.z());
230  cornersZ[1] = std::max(cornersZ[1], x1y1AtRef.z());
231  }
232  const LocalPoint lpOfCentre((cornersHi[0] + cornersHi[1]) / 2, (cornersLo[2] + cornersHi[2]) / 2, 0);
233  const auto gpOfCentre = refSurf.toGlobal(lpOfCentre);
234  auto bounds = new TrapezoidalPlaneBounds((cornersLo[1] - cornersLo[0]) / 2,
235  (cornersHi[1] - cornersHi[0]) / 2,
236  (cornersHi[2] - cornersLo[2]) / 2,
237  (cornersZ[1] - cornersZ[0]) + 0.5);
238  bp = new BoundPlane(gpOfCentre, refSurf.rotation(), bounds);
239  }
240  }
241 
243  RPCChamber* ch = new RPCChamber(chid, surf);
244  for (auto rl : rls)
245  ch->add(rl);
246  geometry->add(ch);
247  }
248 
249  return geometry;
250 }
#define LogDebug(id)
void add(RPCRoll *rl)
Add Roll to the chamber which takes ownership.
Definition: RPCChamber.cc:32
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:121
virtual float length() const =0
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
const N & name() const
Definition: DDBase.h:59
common ppss p3p6s2 common epss epspn46 common const1 w2
Definition: inclppp.h:1
bool nextSibling()
set the current node to the next sibling ...
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
Plane BoundPlane
Definition: Plane.h:94
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:58
const Bounds & bounds() const
Definition: Surface.h:89
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:79
void add(RPCRoll *roll)
Add a RPC roll to the Geometry.
Definition: RPCGeometry.cc:52
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
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
T min(T a, T b)
Definition: MathUtil.h:58
ESHandle< TrackerGeometry > geometry
bool firstChild()
set the current node to the first child ...
constexpr NumType convertMmToCm(NumType millimeters)
Definition: GeantUnits.h:62
Definition: Bounds.h:20
const DDTranslation & translation() const
The absolute translation of the current node.
std::vector< const DDsvalues_type * > specifics() const
std::map< RPCDetId, std::list< RPCRoll * > > chids
const std::string & name() const
Returns the name.
Definition: DDName.cc:40
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53
RPCGeometry * RPCGeometryBuilderFromDDD::buildGeometry ( cms::DDFilteredView fview,
const cms::MuonNumbering muonConstants 
)
private

Definition at line 253 of file RPCGeometryBuilderFromDDD.cc.

References RPCChamber::add(), RPCGeometry::add(), cms::RPCNumberingScheme::baseNumberToUnitNumber(), Surface::bounds(), chids, cms::DDFilteredView::firstChild(), dqmMemoryStats::float, cms::MuonNumbering::geoHistoryToBaseNumber(), geometry, cms::DDFilteredView::get(), cms::DDFilteredView::history(), cms::DDFilteredView::isABox(), RPCDetId::layer(), Bounds::length(), SiStripPI::max, min(), Skims_PA_cff::name, cms::DDFilteredView::name(), me0TriggerPseudoDigis_cff::nStrips, cms::DDFilteredView::parameters(), alignCSCRings::r, RPCDetId::region(), RPCDetId::ring(), cms::DDFilteredView::rot(), makeMuonMisalignmentScenario::rot, TkRotation< T >::rotateAxes(), GeomDetEnumerators::RPCBarrel, GeomDetEnumerators::RPCEndcap, RPCDetId::sector(), RPCDetId::station(), AlCaHLTBitMon_QueryRunRegistry::string, RPCDetId::subsector(), theComp11Flag, Calorimetry_cff::thickness, cms::DDFilteredView::trans(), cms::MuonNumbering::values(), w2, ApeEstimator_cff::width, x, y, and z.

254  {
256 
257  while (fview.firstChild()) {
258  MuonBaseNumber mbn = muonConstants.geoHistoryToBaseNumber(fview.history());
259 
260  cms::RPCNumberingScheme rpcnum(muonConstants.values());
261 
262  rpcnum.baseNumberToUnitNumber(mbn);
263  int detid = rpcnum.getDetId();
264 
265  RPCDetId rpcid(detid);
266  RPCDetId chid(rpcid.region(), rpcid.ring(), rpcid.station(), rpcid.sector(), rpcid.layer(), rpcid.subsector(), 0);
267 
268  auto nStrips = fview.get<double>("nStrips");
269 
270  std::vector<double> dpar = fview.parameters();
271 
272  std::string_view name = fview.name();
273 
274  const Double_t* tran = fview.trans();
275  DDRotationMatrix rota;
276  fview.rot(rota);
277 
278  Surface::PositionType pos(tran[0], tran[1], tran[2]);
279 
280  DD3Vector x, y, z;
281  rota.GetComponents(x, y, z);
282  Surface::RotationType rot(float(x.X()),
283  float(x.Y()),
284  float(x.Z()),
285  float(y.X()),
286  float(y.Y()),
287  float(y.Z()),
288  float(z.X()),
289  float(z.Y()),
290  float(z.Z()));
291 
292  RPCRollSpecs* rollspecs = nullptr;
293  Bounds* bounds = nullptr;
294 
295  if (fview.isABox() == 1) {
296  const float width = dpar[0];
297  const float length = dpar[1];
298  const float thickness = dpar[2];
299 
300  bounds = new RectangularPlaneBounds(width, length, thickness);
301 
302  const std::vector<float> pars = {width, length, float(nStrips)};
303 
304  if (!theComp11Flag) {
305  if (tran[2] > -1500.) {
306  Basic3DVector<float> newX(-1., 0., 0.);
307  Basic3DVector<float> newY(0., -1., 0.);
308  Basic3DVector<float> newZ(0., 0., 1.);
309  rot.rotateAxes(newX, newY, newZ);
310  }
311  }
312 
313  rollspecs = new RPCRollSpecs(GeomDetEnumerators::RPCBarrel, std::string(name), pars);
314 
315  } else {
316  const float be = dpar[0];
317  const float te = dpar[1];
318  const float ap = dpar[3];
319  const float ti = 0.4;
320 
321  bounds = new TrapezoidalPlaneBounds(be, te, ap, ti);
322  const std::vector<float> pars = {float(dpar[0]), float(dpar[1]), float(dpar[3]), float(nStrips)};
323 
324  rollspecs = new RPCRollSpecs(GeomDetEnumerators::RPCEndcap, std::string(name), pars);
325 
326  Basic3DVector<float> newX(1., 0., 0.);
327  Basic3DVector<float> newY(0., 0., 1.);
328  newY *= -1;
329  Basic3DVector<float> newZ(0., 1., 0.);
330  rot.rotateAxes(newX, newY, newZ);
331  }
332 
333  BoundPlane* bp = new BoundPlane(pos, rot, bounds);
335  RPCRoll* r = new RPCRoll(rpcid, surf, rollspecs);
336  geometry->add(r);
337 
338  auto rls = chids.find(chid);
339  if (rls == chids.end())
340  rls = chids.insert(std::make_pair(chid, std::list<RPCRoll*>())).first;
341  rls->second.emplace_back(r);
342  }
343 
344  for (auto& ich : chids) {
345  const RPCDetId& chid = ich.first;
346  const auto& rls = ich.second;
347 
348  BoundPlane* bp = nullptr;
349  if (!rls.empty()) {
350  const auto& refSurf = (*rls.begin())->surface();
351  if (chid.region() == 0) {
352  float corners[6] = {0, 0, 0, 0, 0, 0};
353  for (auto rl : rls) {
354  const double h2 = rl->surface().bounds().length() / 2;
355  const double w2 = rl->surface().bounds().width() / 2;
356  const auto x1y1AtRef = refSurf.toLocal(rl->toGlobal(LocalPoint(-w2, -h2, 0)));
357  const auto x2y2AtRef = refSurf.toLocal(rl->toGlobal(LocalPoint(+w2, +h2, 0)));
358  corners[0] = std::min(corners[0], x1y1AtRef.x());
359  corners[1] = std::min(corners[1], x1y1AtRef.y());
360  corners[2] = std::max(corners[2], x2y2AtRef.x());
361  corners[3] = std::max(corners[3], x2y2AtRef.y());
362 
363  corners[4] = std::min(corners[4], x1y1AtRef.z());
364  corners[5] = std::max(corners[5], x1y1AtRef.z());
365  }
366  const LocalPoint lpOfCentre((corners[0] + corners[2]) / 2, (corners[1] + corners[3]) / 2, 0);
367  const auto gpOfCentre = refSurf.toGlobal(lpOfCentre);
368  auto bounds = new RectangularPlaneBounds(
369  (corners[2] - corners[0]) / 2, (corners[3] - corners[1]) / 2, (corners[5] - corners[4]) + 0.5);
370  bp = new BoundPlane(gpOfCentre, refSurf.rotation(), bounds);
371 
372  } else {
373  float cornersLo[3] = {0, 0, 0}, cornersHi[3] = {0, 0, 0};
374  float cornersZ[2] = {0, 0};
375  for (auto rl : rls) {
376  const double h2 = rl->surface().bounds().length() / 2;
377  const double w2 = rl->surface().bounds().width() / 2;
378  const auto& topo = dynamic_cast<const TrapezoidalStripTopology&>(rl->specificTopology());
379  const double r = topo.radius();
380  const double wAtLo = w2 / r * (r - h2);
381  const double wAtHi = w2 / r * (r + h2);
382  const auto x1y1AtRef = refSurf.toLocal(rl->toGlobal(LocalPoint(-wAtLo, -h2, 0)));
383  const auto x2y1AtRef = refSurf.toLocal(rl->toGlobal(LocalPoint(+wAtLo, -h2, 0)));
384  const auto x1y2AtRef = refSurf.toLocal(rl->toGlobal(LocalPoint(-wAtHi, +h2, 0)));
385  const auto x2y2AtRef = refSurf.toLocal(rl->toGlobal(LocalPoint(+wAtHi, +h2, 0)));
386 
387  cornersLo[0] = std::min(cornersLo[0], x1y1AtRef.x());
388  cornersLo[1] = std::max(cornersLo[1], x2y1AtRef.x());
389  cornersLo[2] = std::min(cornersLo[2], x1y1AtRef.y());
390 
391  cornersHi[0] = std::min(cornersHi[0], x1y2AtRef.x());
392  cornersHi[1] = std::max(cornersHi[1], x2y2AtRef.x());
393  cornersHi[2] = std::max(cornersHi[2], x1y2AtRef.y());
394 
395  cornersZ[0] = std::min(cornersZ[0], x1y1AtRef.z());
396  cornersZ[1] = std::max(cornersZ[1], x1y1AtRef.z());
397  }
398  const LocalPoint lpOfCentre((cornersHi[0] + cornersHi[1]) / 2, (cornersLo[2] + cornersHi[2]) / 2, 0);
399  const auto gpOfCentre = refSurf.toGlobal(lpOfCentre);
400  auto bounds = new TrapezoidalPlaneBounds((cornersLo[1] - cornersLo[0]) / 2,
401  (cornersHi[1] - cornersHi[0]) / 2,
402  (cornersHi[2] - cornersLo[2]) / 2,
403  (cornersZ[1] - cornersZ[0]) + 0.5);
404  bp = new BoundPlane(gpOfCentre, refSurf.rotation(), bounds);
405  }
406  }
407 
409 
410  RPCChamber* ch = new RPCChamber(chid, surf);
411 
412  for (auto rl : rls)
413  ch->add(rl);
414 
415  geometry->add(ch);
416  }
417  return geometry;
418 }
void add(RPCRoll *rl)
Add Roll to the chamber which takes ownership.
Definition: RPCChamber.cc:32
virtual float length() const =0
common ppss p3p6s2 common epss epspn46 common const1 w2
Definition: inclppp.h:1
Plane BoundPlane
Definition: Plane.h:94
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:58
const Bounds & bounds() const
Definition: Surface.h:89
void add(RPCRoll *roll)
Add a RPC roll to the Geometry.
Definition: RPCGeometry.cc:52
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
Definition: DDTranslation.h:6
const ExpandedNodes & history()
The numbering history of the current node.
const Double_t * rot() const
The absolute rotation of the current node.
const MuonBaseNumber geoHistoryToBaseNumber(const cms::ExpandedNodes &) const
T min(T a, T b)
Definition: MathUtil.h:58
std::string_view name() const
bool firstChild()
set the current node to the first child
T get(const std::string &) const
extract attribute value
const Double_t * trans() const
The absolute translation of the current node.
bool isABox() const
const MuonConstants & values() const
ESHandle< TrackerGeometry > geometry
Definition: Bounds.h:20
const std::vector< double > parameters() const
extract shape parameters
std::map< RPCDetId, std::list< RPCRoll * > > chids
void baseNumberToUnitNumber(const MuonBaseNumber &)
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53

Member Data Documentation

std::map<RPCDetId, std::list<RPCRoll*> > RPCGeometryBuilderFromDDD::chids
private

Definition at line 52 of file RPCGeometryBuilderFromDDD.h.

Referenced by buildGeometry().

std::unique_ptr<cms::RPCNumberingScheme> RPCGeometryBuilderFromDDD::rpcnum_ = nullptr
private

Definition at line 54 of file RPCGeometryBuilderFromDDD.h.

bool RPCGeometryBuilderFromDDD::theComp11Flag
private

Definition at line 55 of file RPCGeometryBuilderFromDDD.h.

Referenced by buildGeometry().