CMS 3D CMS Logo

List of all members | Public Member Functions
GEMGeometryBuilderFromCondDB Class Reference

#include <GEMGeometryBuilderFromCondDB.h>

Public Member Functions

GEMGeometrybuild (const RecoIdealGeometry &rgeo)
 
 GEMGeometryBuilderFromCondDB ()
 
 ~GEMGeometryBuilderFromCondDB ()
 

Detailed Description

Build the GEMGeometry from the DDD description stored in Condition DB

Author
M. Maggi - INFN Bari

Definition at line 21 of file GEMGeometryBuilderFromCondDB.h.

Constructor & Destructor Documentation

GEMGeometryBuilderFromCondDB::GEMGeometryBuilderFromCondDB ( )

Implementation of the GEM Geometry Builder from DDD stored in CondDB

Author
M. Maggi - INFN Bari

Definition at line 27 of file GEMGeometryBuilderFromCondDB.cc.

28 { }
GEMGeometryBuilderFromCondDB::~GEMGeometryBuilderFromCondDB ( )

Definition at line 30 of file GEMGeometryBuilderFromCondDB.cc.

31 { }

Member Function Documentation

GEMGeometry * GEMGeometryBuilderFromCondDB::build ( const RecoIdealGeometry rgeo)

Definition at line 33 of file GEMGeometryBuilderFromCondDB.cc.

References RecoIdealGeometry::detIds(), GeomDetEnumerators::GEM, geometry, hcalTTPDigis_cfi::id, dataset::name, gen::npad, makeMuonMisalignmentScenario::rot, TkRotation< T >::rotateAxes(), RecoIdealGeometry::rotStart(), RecoIdealGeometry::shapeStart(), AlCaHLTBitMon_QueryRunRegistry::string, RecoIdealGeometry::strStart(), and RecoIdealGeometry::tranStart().

Referenced by GEMGeometryESModule::produce().

34 {
35  const std::vector<DetId>& detids(rgeo.detIds());
37 
39  std::vector<double>::const_iterator tranStart;
40  std::vector<double>::const_iterator shapeStart;
41  std::vector<double>::const_iterator rotStart;
42  std::vector<std::string>::const_iterator strStart;
43 
44  for (unsigned int id = 0; id < detids.size(); ++id)
45  {
46  GEMDetId gemid(detids[id]);
47  // GEMDetId chid(gemid.region(),gemid.ring(),gemid.station(),
48  // gemid.sector(),gemid.layer(),gemid.subsector(),0);
49 
50  tranStart = rgeo.tranStart(id);
51  shapeStart = rgeo.shapeStart(id);
52  rotStart = rgeo.rotStart(id);
53  strStart = rgeo.strStart(id);
54  name = *(strStart);
55 
56  Surface::PositionType pos(*(tranStart)/cm,*(tranStart+1)/cm, *(tranStart+2)/cm);
57  // CLHEP way
58  Surface::RotationType rot(*(rotStart+0), *(rotStart+1), *(rotStart+2),
59  *(rotStart+3), *(rotStart+4), *(rotStart+5),
60  *(rotStart+6), *(rotStart+7), *(rotStart+8));
61 
62  Bounds* bounds = 0;
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.push_back(be); //b/2;
74  pars.push_back(te); //B/2;
75  pars.push_back(ap); //h/2;
76  pars.push_back(nstrip);
77  pars.push_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 
90  BoundPlane* bp = new BoundPlane(pos, rot, bounds);
92  GEMEtaPartition* gep=new GEMEtaPartition(gemid, surf, e_p_specs);
93  geometry->add(gep);
94 
95 
96  std::list<GEMEtaPartition *> gepls;
97  /*
98  if (chids.find(chid)!=chids.end()){
99  gepls = chids[chid];
100  }
101  */
102  gepls.push_back(gep);
103  //chids[chid]=gepls;
104 
105  }
106  /*
107  // Create the GEMChambers and store them on the Geometry
108 
109  for( std::map<GEMDetId, std::list<GEMEtaPartition *> >::iterator ich=chids.begin();
110  ich != chids.end(); ich++){
111  GEMDetId chid = ich->first;
112  std::list<GEMEtaPartition * > gepls = ich->second;
113 
114  // compute the overall boundplane. At the moment we use just the last
115  // surface
116  BoundPlane* bp=0;
117  for(std::list<GEMEtaPartition *>::iterator gepl=gepls.begin();
118  gepl!=gepls.end(); gepl++){
119  const BoundPlane& bps = (*gepl)->surface();
120  bp = const_cast<BoundPlane *>(&bps);
121  }
122 
123  ReferenceCountingPointer<BoundPlane> surf(bp);
124  // Create the chamber
125  GEMChamber* ch = new GEMChamber (chid, surf);
126  // Add the etaps to rhe chamber
127  for(std::list<GEMEtaPartition *>::iterator gepl=gepls.begin();
128  gepl!=gepls.end(); gepl++){
129  ch->add(*gepl);
130  }
131  // Add the chamber to the geometry
132  geometry->add(ch);
133 
134  }
135  */
136  return geometry;
137 }
Plane BoundPlane
Definition: Plane.h:95
std::vector< double >::const_iterator rotStart(size_t ind) const
std::vector< std::string >::const_iterator strStart(size_t ind) const
std::vector< double >::const_iterator tranStart(size_t ind) const
const std::vector< DetId > & detIds() const
ESHandle< TrackerGeometry > geometry
std::vector< double >::const_iterator shapeStart(size_t ind) const
Definition: Bounds.h:22