CMS 3D CMS Logo

ME0GeometryBuilderFromCondDB.cc
Go to the documentation of this file.
1 
8 
12 
16 
19 
21 
22 #include "CLHEP/Units/GlobalSystemOfUnits.h"
23 
24 #include <iostream>
25 #include <algorithm>
26 
28 
30 
32  const std::vector<DetId>& detids(rgeo.detIds());
34 
36  std::vector<double>::const_iterator tranStart;
37  std::vector<double>::const_iterator shapeStart;
38  std::vector<double>::const_iterator rotStart;
39  std::vector<std::string>::const_iterator strStart;
40 
41  for (unsigned int id = 0; id < detids.size(); ++id) {
42  ME0DetId me0id(detids[id]);
43 
44  tranStart = rgeo.tranStart(id);
45  shapeStart = rgeo.shapeStart(id);
46  rotStart = rgeo.rotStart(id);
47  strStart = rgeo.strStart(id);
48  name = *(strStart);
49 
50  Surface::PositionType pos(*(tranStart) / cm, *(tranStart + 1) / cm, *(tranStart + 2) / cm);
51  // CLHEP way
52  Surface::RotationType rot(*(rotStart + 0),
53  *(rotStart + 1),
54  *(rotStart + 2),
55  *(rotStart + 3),
56  *(rotStart + 4),
57  *(rotStart + 5),
58  *(rotStart + 6),
59  *(rotStart + 7),
60  *(rotStart + 8));
61 
62  Bounds* bounds = nullptr;
63  float be = *(shapeStart + 0) / cm;
64  float te = *(shapeStart + 1) / cm;
65  float ap = *(shapeStart + 2) / cm;
66  float ti = *(shapeStart + 3) / cm;
67  float nstrip = *(shapeStart + 4);
68  float npad = *(shapeStart + 5);
69  // TrapezoidalPlaneBounds*
70  bounds = new TrapezoidalPlaneBounds(be, te, ap, ti);
71 
72  std::vector<float> pars;
73  pars.emplace_back(be); //b/2;
74  pars.emplace_back(te); //B/2;
75  pars.emplace_back(ap); //h/2;
76  pars.emplace_back(nstrip);
77  pars.emplace_back(npad);
78 
80 
81  //Change of axes for the forward
82  Basic3DVector<float> newX(1., 0., 0.);
83  Basic3DVector<float> newY(0., 0., 1.);
84  // if (tran[2] > 0. )
85  newY *= -1;
86  Basic3DVector<float> newZ(0., 1., 0.);
87  rot.rotateAxes(newX, newY, newZ);
88 
89  BoundPlane* bp = new BoundPlane(pos, rot, bounds);
91  ME0EtaPartition* mep = new ME0EtaPartition(me0id, surf, e_p_specs);
92  geometry->add(mep);
93  }
94  return geometry;
95 }
TkRotation< float >
geometry
ESHandle< TrackerGeometry > geometry
Definition: TkLasBeamFitter.cc:200
ME0Geometry
Definition: ME0Geometry.h:12
geometry
Definition: geometry.py:1
pos
Definition: PixelAliasList.h:18
Basic3DVector.h
Bounds
Definition: Bounds.h:18
ME0EtaPartitionSpecs.h
MuonGeometryNumbering.h
ME0GeometryBuilderFromCondDB::build
ME0Geometry * build(const RecoIdealGeometry &rgeo)
Definition: ME0GeometryBuilderFromCondDB.cc:31
ReferenceCountingPointer
Definition: ReferenceCounted.h:60
ME0GeometryBuilderFromCondDB::ME0GeometryBuilderFromCondDB
ME0GeometryBuilderFromCondDB()
Definition: ME0GeometryBuilderFromCondDB.cc:27
RecoIdealGeometry::rotStart
std::vector< double >::const_iterator rotStart(size_t ind) const
Definition: RecoIdealGeometry.h:91
DDFilteredView.h
TrapezoidalPlaneBounds.h
RectangularPlaneBounds.h
DDSolid.h
ME0NumberingScheme.h
ME0EtaPartitionSpecs
Definition: ME0EtaPartitionSpecs.h:18
Point3DBase< float, GlobalTag >
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ME0GeometryBuilderFromCondDB::~ME0GeometryBuilderFromCondDB
~ME0GeometryBuilderFromCondDB()
Definition: ME0GeometryBuilderFromCondDB.cc:29
MuonBaseNumber.h
RecoIdealGeometry::detIds
const std::vector< DetId > & detIds() const
Definition: RecoIdealGeometry.h:85
DDFilter.h
ME0DetId
Definition: ME0DetId.h:16
TrapezoidalPlaneBounds
Definition: TrapezoidalPlaneBounds.h:15
RecoIdealGeometry::tranStart
std::vector< double >::const_iterator tranStart(size_t ind) const
Definition: RecoIdealGeometry.h:87
ME0Geometry.h
BoundPlane
Plane BoundPlane
Definition: Plane.h:94
RecoIdealGeometry::strStart
std::vector< std::string >::const_iterator strStart(size_t ind) const
Definition: RecoIdealGeometry.h:101
ME0GeometryBuilderFromCondDB.h
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
BoundPlane
RecoIdealGeometry::shapeStart
std::vector< double >::const_iterator shapeStart(size_t ind) const
Definition: RecoIdealGeometry.h:95
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
gen::npad
int npad
Definition: Cascade2Hadronizer.cc:75
cms::cuda::be
int be
Definition: HistoContainer.h:126
GeomDetEnumerators::ME0
Definition: GeomDetEnumerators.h:22
Basic3DVector< float >
RecoIdealGeometry
Definition: RecoIdealGeometry.h:28
ME0EtaPartition
Definition: ME0EtaPartition.h:12