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 Attributes
GEMGeometryBuilderFromCondDB Class Reference

#include <GEMGeometryBuilderFromCondDB.h>

Public Member Functions

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

Private Attributes

bool theComp11Flag
 

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 ( bool  comp11)

Implementation of the GEM Geometry Builder from DDD stored in CondDB

Author
M. Maggi - INFN Bari

Definition at line 27 of file GEMGeometryBuilderFromCondDB.cc.

27  :
28  theComp11Flag(comp11)
29 { }
GEMGeometryBuilderFromCondDB::~GEMGeometryBuilderFromCondDB ( )

Definition at line 31 of file GEMGeometryBuilderFromCondDB.cc.

32 { }

Member Function Documentation

GEMGeometry * GEMGeometryBuilderFromCondDB::build ( const RecoIdealGeometry rgeo)

Definition at line 34 of file GEMGeometryBuilderFromCondDB.cc.

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

Referenced by GEMGeometryESModule::produce().

35 {
36  const std::vector<DetId>& detids(rgeo.detIds());
38 
40  std::vector<double>::const_iterator tranStart;
41  std::vector<double>::const_iterator shapeStart;
42  std::vector<double>::const_iterator rotStart;
43  std::vector<std::string>::const_iterator strStart;
44 
45  for (unsigned int id = 0; id < detids.size(); ++id)
46  {
47  GEMDetId gemid(detids[id]);
48  // GEMDetId chid(gemid.region(),gemid.ring(),gemid.station(),
49  // gemid.sector(),gemid.layer(),gemid.subsector(),0);
50 
51  tranStart = rgeo.tranStart(id);
52  shapeStart = rgeo.shapeStart(id);
53  rotStart = rgeo.rotStart(id);
54  strStart = rgeo.strStart(id);
55  name = *(strStart);
56 
57  Surface::PositionType pos(*(tranStart)/cm,*(tranStart+1)/cm, *(tranStart+2)/cm);
58  // CLHEP way
59  Surface::RotationType rot(*(rotStart+0), *(rotStart+1), *(rotStart+2),
60  *(rotStart+3), *(rotStart+4), *(rotStart+5),
61  *(rotStart+6), *(rotStart+7), *(rotStart+8));
62 
63  Bounds* bounds = 0;
64  float be = *(shapeStart+0)/cm;
65  float te = *(shapeStart+1)/cm;
66  float ap = *(shapeStart+2)/cm;
67  float ti = *(shapeStart+3)/cm;
68  float nstrip = *(shapeStart+4);
69  float npad = *(shapeStart+5);
70  // TrapezoidalPlaneBounds*
71  bounds = new TrapezoidalPlaneBounds(be, te, ap, ti);
72 
73  std::vector<float> pars;
74  pars.push_back(be); //b/2;
75  pars.push_back(te); //B/2;
76  pars.push_back(ap); //h/2;
77  pars.push_back(nstrip);
78  pars.push_back(npad);
79 
81 
82  //Change of axes for the forward
83  Basic3DVector<float> newX(1.,0.,0.);
84  Basic3DVector<float> newY(0.,0.,1.);
85  // if (tran[2] > 0. )
86  newY *= -1;
87  Basic3DVector<float> newZ(0.,1.,0.);
88  rot.rotateAxes (newX, newY, newZ);
89 
90 
91  BoundPlane* bp = new BoundPlane(pos, rot, bounds);
93  GEMEtaPartition* gep=new GEMEtaPartition(gemid, surf, e_p_specs);
94  geometry->add(gep);
95 
96 
97  std::list<GEMEtaPartition *> gepls;
98  /*
99  if (chids.find(chid)!=chids.end()){
100  gepls = chids[chid];
101  }
102  */
103  gepls.push_back(gep);
104  //chids[chid]=gepls;
105 
106  }
107  /*
108  // Create the GEMChambers and store them on the Geometry
109 
110  for( std::map<GEMDetId, std::list<GEMEtaPartition *> >::iterator ich=chids.begin();
111  ich != chids.end(); ich++){
112  GEMDetId chid = ich->first;
113  std::list<GEMEtaPartition * > gepls = ich->second;
114 
115  // compute the overall boundplane. At the moment we use just the last
116  // surface
117  BoundPlane* bp=0;
118  for(std::list<GEMEtaPartition *>::iterator gepl=gepls.begin();
119  gepl!=gepls.end(); gepl++){
120  const BoundPlane& bps = (*gepl)->surface();
121  bp = const_cast<BoundPlane *>(&bps);
122  }
123 
124  ReferenceCountingPointer<BoundPlane> surf(bp);
125  // Create the chamber
126  GEMChamber* ch = new GEMChamber (chid, surf);
127  // Add the etaps to rhe chamber
128  for(std::list<GEMEtaPartition *>::iterator gepl=gepls.begin();
129  gepl!=gepls.end(); gepl++){
130  ch->add(*gepl);
131  }
132  // Add the chamber to the geometry
133  geometry->add(ch);
134 
135  }
136  */
137  return geometry;
138 }
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

Member Data Documentation

bool GEMGeometryBuilderFromCondDB::theComp11Flag
private

Definition at line 34 of file GEMGeometryBuilderFromCondDB.h.