CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWTGeoRecoGeometryESProducer.cc
Go to the documentation of this file.
4 
26 
27 #include "TGeoManager.h"
28 #include "TGeoArb8.h"
29 #include "TGeoMatrix.h"
30 #include "TFile.h"
31 #include "TTree.h"
32 #include "TError.h"
33 
34 # define ADD_PIXEL_TOPOLOGY( rawid, detUnit ) \
35  const PixelGeomDetUnit* det = dynamic_cast<const PixelGeomDetUnit*>( detUnit ); \
36  if( det ) \
37  { \
38  const PixelTopology& topo = det->specificTopology(); \
39  m_fwGeometry->idToName[rawid].topology[0] = topo.nrows(); \
40  m_fwGeometry->idToName[rawid].topology[1] = topo.ncolumns(); \
41  } \
42 
43 # define ADD_SISTRIP_TOPOLOGY( rawid, detUnit ) \
44  const StripGeomDetUnit* det = dynamic_cast<const StripGeomDetUnit*>( detUnit ); \
45  if( det ) \
46  { \
47  const StripTopology* topo = dynamic_cast<const StripTopology*>( &det->specificTopology()); \
48  m_fwGeometry->idToName[rawid].topology[0] = topo->nstrips(); \
49  m_fwGeometry->idToName[rawid].topology[1] = topo->stripLength(); \
50  if( const RadialStripTopology* rtop = dynamic_cast<const RadialStripTopology*>( topo )) \
51  { \
52  m_fwGeometry->idToName[rawid].topology[2] = rtop->phiPitch(); \
53  } \
54  else if( dynamic_cast<const RectangularStripTopology*>( topo )) \
55  { \
56  m_fwGeometry->idToName[rawid].topology[2] = topo->pitch(); \
57  } \
58  else if( dynamic_cast<const TrapezoidalStripTopology*>( topo )) \
59  { \
60  m_fwGeometry->idToName[rawid].topology[2] = topo->pitch(); \
61  } \
62 } \
63 
65 {
66  setWhatProduced( this );
67 }
68 
70 {}
71 
72 namespace
73 {
75  TGeoCombiTrans* createPlacement( const GeomDet *det )
76  {
77  // Position of the DetUnit's center
78  float posx = det->surface().position().x();
79  float posy = det->surface().position().y();
80  float posz = det->surface().position().z();
81 
82  TGeoTranslation trans( posx, posy, posz );
83 
84  // Add the coeff of the rotation matrix
85  // with a projection on the basis vectors
86  TkRotation<float> detRot = det->surface().rotation();
87 
88  TGeoRotation rotation;
89  const Double_t matrix[9] = { detRot.xx(), detRot.yx(), detRot.zx(),
90  detRot.xy(), detRot.yy(), detRot.zy(),
91  detRot.xz(), detRot.yz(), detRot.zz()
92  };
93  rotation.SetMatrix( matrix );
94 
95  return new TGeoCombiTrans( trans, rotation );
96  }
97 }
98 
99 boost::shared_ptr<FWTGeoRecoGeometry>
101 {
102  using namespace edm;
103 
104  m_fwGeometry = boost::shared_ptr<FWTGeoRecoGeometry>( new FWTGeoRecoGeometry );
105 
107 
108  DetId detId( DetId::Tracker, 0 );
109  m_trackerGeom = (const TrackerGeometry*) m_geomRecord->slaveGeometry( detId );
110 
111  record.getRecord<CaloGeometryRecord>().get( m_caloGeom );
112 
113  TGeoManager *geom = new TGeoManager( "cmsGeo", "CMS Detector" );
114  // NOTE: The default constructor does not create an identity matrix
115  if( 0 == gGeoIdentity )
116  {
117  gGeoIdentity = new TGeoIdentity( "Identity" );
118  }
119 
120  m_fwGeometry->manager( geom );
121 
122  // Default material is Vacuum
123  TGeoMaterial *matVacuum = new TGeoMaterial( "Vacuum", 0 ,0 ,0 );
124  // so is default medium
125  TGeoMedium *vacuum = new TGeoMedium( "Vacuum", 1, matVacuum );
126  TGeoVolume *top = geom->MakeBox( "CMS", vacuum, 270., 270., 120. );
127 
128  if( 0 == top )
129  {
130  return boost::shared_ptr<FWTGeoRecoGeometry>();
131  }
132  geom->SetTopVolume( top );
133  // ROOT chokes unless colors are assigned
134  top->SetVisibility( kFALSE );
135  top->SetLineColor( kBlue );
136 
137  addPixelBarrelGeometry( top );
139  addTIBGeometry( top );
140  addTIDGeometry( top );
141  addTOBGeometry( top );
142  addTECGeometry( top );
143  addDTGeometry( top );
144  addCSCGeometry( top );
145  addRPCGeometry( top );
146 
147  addCaloGeometry();
148 
149  geom->CloseGeometry();
150  geom->DefaultColors();
151 
152  m_nameToShape.clear();
153  m_nameToVolume.clear();
154  m_nameToMaterial.clear();
155  m_nameToMedium.clear();
156 
157  return m_fwGeometry;
158 }
159 
161 TGeoShape*
163 {
164  TGeoShape* shape = 0;
165 
166  // Trapezoidal
167  const Bounds *b = &((det->surface ()).bounds ());
168  const TrapezoidalPlaneBounds *b2 = dynamic_cast<const TrapezoidalPlaneBounds *> (b);
169  if( b2 )
170  {
171  std::array< const float, 4 > const & par = b2->parameters ();
172 
173  // These parameters are half-lengths, as in CMSIM/GEANT3
174  float hBottomEdge = par [0];
175  float hTopEdge = par [1];
176  float thickness = par [2];
177  float apothem = par [3];
178 
179  std::stringstream s;
180  s << "T_"
181  << hBottomEdge << "_"
182  << hTopEdge << "_"
183  << thickness << "_"
184  << apothem;
185  std::string name = s.str();
186 
187  // Do not create identical shape,
188  // if one already exists
189  shape = m_nameToShape[name];
190  if( 0 == shape )
191  {
192  shape = new TGeoTrap(
193  name.c_str(),
194  thickness, //dz
195  0, //theta
196  0, //phi
197  apothem, //dy1
198  hBottomEdge,//dx1
199  hTopEdge, //dx2
200  0, //alpha1
201  apothem, //dy2
202  hBottomEdge,//dx3
203  hTopEdge, //dx4
204  0); //alpha2
205 
206  m_nameToShape[name] = shape;
207  }
208  }
209  if( dynamic_cast<const RectangularPlaneBounds *> (b) != 0 )
210  {
211  // Rectangular
212  float length = det->surface().bounds().length();
213  float width = det->surface().bounds ().width();
214  float thickness = det->surface().bounds().thickness();
215 
216  std::stringstream s;
217  s << "R_"
218  << width << "_"
219  << length << "_"
220  << thickness;
221  std::string name = s.str();
222 
223  // Do not create identical shape,
224  // if one already exists
225  shape = m_nameToShape[name];
226  if( 0 == shape )
227  {
228  shape = new TGeoBBox( name.c_str(), width / 2., length / 2., thickness / 2. ); // dx, dy, dz
229 
230  m_nameToShape[name] = shape;
231  }
232  }
233 
234  return shape;
235 }
236 
238 TGeoVolume*
240 {
241  TGeoVolume* volume = m_nameToVolume[name];
242  if( 0 == volume )
243  {
244  TGeoShape* solid = createShape( det );
245  TGeoMedium* medium = m_nameToMedium[material];
246  if( 0 == medium )
247  {
248  medium = new TGeoMedium( material.c_str(), 0, createMaterial( material ));
249  m_nameToMedium[material] = medium;
250  }
251  if( solid )
252  {
253  volume = new TGeoVolume( name.c_str(),
254  solid,
255  medium );
256  m_nameToVolume[name] = volume;
257  }
258  }
259 
260  return volume;
261 }
262 
264 TGeoMaterial*
266 {
267  TGeoMaterial *material = m_nameToMaterial[name];
268 
269  if( material == 0 )
270  {
271  // FIXME: Do we need to set real parameters of the material?
272  material = new TGeoMaterial( name.c_str(),
273  0, 0, 0 );
274  m_nameToMaterial[name] = material;
275  }
276 
277  return material;
278 }
279 
280 const std::string
281 FWTGeoRecoGeometryESProducer::path( TGeoVolume* volume, const std::string& name, int copy )
282 {
283  std::stringstream outs;
284  outs << volume->GetName() << "_" << volume->GetNumber() << "/"
285  << name << "_" << copy;
286 
287  return outs.str();
288 }
289 
290 void
291 FWTGeoRecoGeometryESProducer::addCSCGeometry( TGeoVolume* top, const std::string& iName, int copy )
292 {
293  TGeoVolume *assembly = new TGeoVolumeAssembly( iName.c_str());
294  if(! m_geomRecord->slaveGeometry( CSCDetId()))
295  throw cms::Exception( "FatalError" ) << "Cannnot find CSCGeometry\n";
296 
297  const std::vector<GeomDet*>& cscGeom = m_geomRecord->slaveGeometry( CSCDetId())->dets();
298  for( std::vector<GeomDet*>::const_iterator it = cscGeom.begin(), itEnd = cscGeom.end(); it != itEnd; ++it )
299  {
300  if( CSCChamber* chamber = dynamic_cast<CSCChamber*>(*it))
301  {
302  unsigned int rawid = chamber->geographicalId();
303  std::stringstream s;
304  s << rawid;
305  std::string name = s.str();
306 
307  TGeoVolume* child = createVolume( name, chamber );
308  assembly->AddNode( child, copy, createPlacement( chamber ));
309  child->SetLineColor( kBlue );
310 
311  std::stringstream p;
312  p << path( top, iName, copy ) << "/" << name << "_" << copy;
313  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
314  }
315  else if( CSCLayer* layer = dynamic_cast<CSCLayer*>(*it))
316  {
317  unsigned int rawid = layer->geographicalId();
318  std::stringstream s;
319  s << rawid;
320  std::string name = s.str();
321 
322  TGeoVolume* child = createVolume( name, layer );
323  assembly->AddNode( child, copy, createPlacement( layer ));
324  child->SetLineColor( kBlue );
325 
326  std::stringstream p;
327  p << path( top, iName, copy ) << "/" << name << "_" << copy;
328  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
329 
330  const CSCStripTopology* stripTopology = layer->geometry()->topology();
331  m_fwGeometry->idToName[rawid].topology[0] = stripTopology->yAxisOrientation();
332  m_fwGeometry->idToName[rawid].topology[1] = stripTopology->centreToIntersection();
333  m_fwGeometry->idToName[rawid].topology[2] = stripTopology->yCentreOfStripPlane();
334  m_fwGeometry->idToName[rawid].topology[3] = stripTopology->phiOfOneEdge();
335  m_fwGeometry->idToName[rawid].topology[4] = stripTopology->stripOffset();
336  m_fwGeometry->idToName[rawid].topology[5] = stripTopology->angularWidth();
337 
338  const CSCWireTopology* wireTopology = layer->geometry()->wireTopology();
339  m_fwGeometry->idToName[rawid].topology[6] = wireTopology->wireSpacing();
340  m_fwGeometry->idToName[rawid].topology[7] = wireTopology->wireAngle();
341  }
342  }
343 
344  top->AddNode( assembly, copy );
345 }
346 
347 void
348 FWTGeoRecoGeometryESProducer::addDTGeometry( TGeoVolume* top, const std::string& iName, int copy )
349 {
350  //
351  // DT chambers geometry
352  //
353  TGeoVolume *assembly = new TGeoVolumeAssembly( iName.c_str());
354  const std::vector<GeomDet*>& dtChamberGeom = m_geomRecord->slaveGeometry( DTChamberId())->dets();
355  for( std::vector<GeomDet*>::const_iterator it = dtChamberGeom.begin(),
356  end = dtChamberGeom.end();
357  it != end; ++it )
358  {
359  if( DTChamber* chamber = dynamic_cast< DTChamber *>(*it))
360  {
361  unsigned int rawid = chamber->geographicalId().rawId();
362  std::stringstream s;
363  s << rawid;
364  std::string name = s.str();
365 
366  TGeoVolume* child = createVolume( name, chamber );
367  assembly->AddNode( child, copy, createPlacement( chamber ));
368  child->SetLineColor( kRed );
369 
370  std::stringstream p;
371  p << path( top, iName, copy ) << "/" << name << "_" << copy;
372  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
373  }
374  }
375  top->AddNode( assembly, copy );
376 
377  // Fill in DT super layer parameters
378  const std::vector<GeomDet*>& dtSuperLayerGeom = m_geomRecord->slaveGeometry( DTLayerId())->dets();
379  for( std::vector<GeomDet*>::const_iterator it = dtSuperLayerGeom.begin(),
380  end = dtSuperLayerGeom.end();
381  it != end; ++it )
382  {
383  if( DTSuperLayer* superlayer = dynamic_cast<DTSuperLayer*>(*it))
384  {
385  unsigned int rawid = superlayer->id().rawId();
386  std::stringstream s;
387  s << rawid;
388  std::string name = s.str();
389 
390  TGeoVolume* child = createVolume( name, superlayer );
391  assembly->AddNode( child, copy, createPlacement( superlayer ));
392  child->SetLineColor( kBlue );
393 
394  std::stringstream p;
395  p << path( top, iName, copy ) << "/" << name << "_" << copy;
396  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
397 
398  const BoundPlane& surf = superlayer->surface();
399  // Bounds W/H/L:
400  m_fwGeometry->idToName[rawid].topology[0] = surf.bounds().width();
401  m_fwGeometry->idToName[rawid].topology[1] = surf.bounds().thickness();
402  m_fwGeometry->idToName[rawid].topology[2] = surf.bounds().length();
403  }
404  }
405 
406  // Fill in DT layer parameters
407  const std::vector<GeomDet*>& dtLayerGeom = m_geomRecord->slaveGeometry( DTSuperLayerId())->dets();
408  for( std::vector<GeomDet*>::const_iterator it = dtLayerGeom.begin(),
409  end = dtLayerGeom.end();
410  it != end; ++it )
411  {
412  if( DTLayer* layer = dynamic_cast<DTLayer*>(*it))
413  {
414  unsigned int rawid = layer->id().rawId();
415  std::stringstream s;
416  s << rawid;
417  std::string name = s.str();
418 
419  TGeoVolume* child = createVolume( name, layer );
420  assembly->AddNode( child, copy, createPlacement( layer ));
421  child->SetLineColor( kBlue );
422 
423  std::stringstream p;
424  p << path( top, iName, copy ) << "/" << name << "_" << copy;
425  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
426 
427  const DTTopology& topo = layer->specificTopology();
428  const BoundPlane& surf = layer->surface();
429  // Topology W/H/L:
430  m_fwGeometry->idToName[rawid].topology[0] = topo.cellWidth();
431  m_fwGeometry->idToName[rawid].topology[1] = topo.cellHeight();
432  m_fwGeometry->idToName[rawid].topology[2] = topo.cellLenght();
433  m_fwGeometry->idToName[rawid].topology[3] = topo.firstChannel();
434  m_fwGeometry->idToName[rawid].topology[4] = topo.lastChannel();
435  m_fwGeometry->idToName[rawid].topology[5] = topo.channels();
436 
437  // Bounds W/H/L:
438  m_fwGeometry->idToName[rawid].topology[6] = surf.bounds().width();
439  m_fwGeometry->idToName[rawid].topology[7] = surf.bounds().thickness();
440  m_fwGeometry->idToName[rawid].topology[8] = surf.bounds().length();
441  }
442  }
443 }
444 
445 void
446 FWTGeoRecoGeometryESProducer::addRPCGeometry( TGeoVolume* top, const std::string& iName, int copy )
447 {
448  //
449  // RPC chambers geometry
450  //
451  TGeoVolume *assembly = new TGeoVolumeAssembly( iName.c_str());
452  DetId detId( DetId::Muon, 3 );
453  const RPCGeometry* rpcGeom = (const RPCGeometry*) m_geomRecord->slaveGeometry( detId );
454  for( std::vector<RPCRoll *>::const_iterator it = rpcGeom->rolls().begin(),
455  end = rpcGeom->rolls().end();
456  it != end; ++it )
457  {
458  RPCRoll* roll = (*it);
459  if( roll )
460  {
461  unsigned int rawid = roll->geographicalId().rawId();
462  std::stringstream s;
463  s << rawid;
464  std::string name = s.str();
465 
466  TGeoVolume* child = createVolume( name, roll );
467  assembly->AddNode( child, copy, createPlacement( roll ));
468  child->SetLineColor( kYellow );
469 
470  std::stringstream p;
471  p << path( top, iName, copy ) << "/" << name << "_" << copy;
472  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
473 
474  const StripTopology& topo = roll->specificTopology();
475  m_fwGeometry->idToName[rawid].topology[0] = roll->nstrips();
476  m_fwGeometry->idToName[rawid].topology[1] = topo.stripLength();
477  m_fwGeometry->idToName[rawid].topology[2] = topo.pitch();
478  }
479  }
480  top->AddNode( assembly, copy );
481 }
482 
483 void
485 {
486  TGeoVolume *assembly = new TGeoVolumeAssembly( iName.c_str());
487  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsPXB().begin(),
488  end = m_trackerGeom->detsPXB().end();
489  it != end; ++it)
490  {
491  DetId detid = ( *it )->geographicalId();
492  unsigned int rawid = detid.rawId();
493 
494  std::stringstream s;
495  s << rawid;
496  std::string name = s.str();
497 
498  TGeoVolume* child = createVolume( name, *it );
499  assembly->AddNode( child, copy, createPlacement( *it ));
500  child->SetLineColor( kGreen );
501 
502  std::stringstream p;
503  p << path( top, iName, copy ) << "/" << name << "_" << copy;
504  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
505 
506  ADD_PIXEL_TOPOLOGY( rawid, m_trackerGeom->idToDetUnit( detid ));
507  }
508 
509  top->AddNode( assembly, copy );
510 }
511 
512 void
514 {
515  TGeoVolume *assembly = new TGeoVolumeAssembly( iName.c_str());
516  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsPXF().begin(),
517  end = m_trackerGeom->detsPXF().end();
518  it != end; ++it )
519  {
520  DetId detid = ( *it )->geographicalId();
521  unsigned int rawid = detid.rawId();
522 
523  std::stringstream s;
524  s << rawid;
525  std::string name = s.str();
526 
527  TGeoVolume* child = createVolume( name, *it );
528  assembly->AddNode( child, copy, createPlacement( *it ));
529  child->SetLineColor( kGreen );
530 
531  std::stringstream p;
532  p << path( top, iName, copy ) << "/" << name << "_" << copy;
533  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
534 
535  ADD_PIXEL_TOPOLOGY( rawid, m_trackerGeom->idToDetUnit( detid ));
536  }
537 
538  top->AddNode( assembly, copy );
539 }
540 
541 void
542 FWTGeoRecoGeometryESProducer::addTIBGeometry( TGeoVolume* top, const std::string& iName, int copy )
543 {
544  TGeoVolume *assembly = new TGeoVolumeAssembly( iName.c_str());
545  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTIB().begin(),
546  end = m_trackerGeom->detsTIB().end();
547  it != end; ++it )
548  {
549  DetId detid = ( *it )->geographicalId();
550  unsigned int rawid = detid.rawId();
551  std::stringstream s;
552  s << rawid;
553  std::string name = s.str();
554 
555  TGeoVolume* child = createVolume( name, *it );
556  assembly->AddNode( child, copy, createPlacement( *it ));
557  child->SetLineColor( kGreen );
558 
559  std::stringstream p;
560  p << path( top, iName, copy ) << "/" << name << "_" << copy;
561  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
562 
563  ADD_SISTRIP_TOPOLOGY( rawid, m_trackerGeom->idToDet( detid ));
564  }
565 
566  top->AddNode( assembly, copy );
567 }
568 
569 void
570 FWTGeoRecoGeometryESProducer::addTOBGeometry( TGeoVolume* top, const std::string& iName, int copy )
571 {
572  TGeoVolume *assembly = new TGeoVolumeAssembly( iName.c_str());
573  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTOB().begin(),
574  end = m_trackerGeom->detsTOB().end();
575  it != end; ++it )
576  {
577  DetId detid = ( *it )->geographicalId();
578  unsigned int rawid = detid.rawId();
579 
580  std::stringstream s;
581  s << rawid;
582  std::string name = s.str();
583 
584  TGeoVolume* child = createVolume( name, *it );
585  assembly->AddNode( child, copy, createPlacement( *it ));
586  child->SetLineColor( kGreen );
587 
588  std::stringstream p;
589  p << path( top, iName, copy ) << "/" << name << "_" << copy;
590  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
591 
592  ADD_SISTRIP_TOPOLOGY( rawid, m_trackerGeom->idToDet( detid ));
593  }
594 
595  top->AddNode( assembly, copy );
596 }
597 
598 void
599 FWTGeoRecoGeometryESProducer::addTIDGeometry( TGeoVolume* top, const std::string& iName, int copy )
600 {
601  TGeoVolume *assembly = new TGeoVolumeAssembly( iName.c_str());
602  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTID().begin(),
603  end = m_trackerGeom->detsTID().end();
604  it != end; ++it)
605  {
606  DetId detid = ( *it )->geographicalId();
607  unsigned int rawid = detid.rawId();
608 
609  std::stringstream s;
610  s << rawid;
611  std::string name = s.str();
612 
613  TGeoVolume* child = createVolume( name, *it );
614  assembly->AddNode( child, copy, createPlacement( *it ));
615  child->SetLineColor( kGreen );
616 
617  std::stringstream p;
618  p << path( top, iName, copy ) << "/" << name << "_" << copy;
619  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
620 
621  ADD_SISTRIP_TOPOLOGY( rawid, m_trackerGeom->idToDet( detid ));
622  }
623 
624  top->AddNode( assembly, copy );
625 }
626 
627 void
628 FWTGeoRecoGeometryESProducer::addTECGeometry( TGeoVolume* top, const std::string& iName, int copy )
629 {
630  TGeoVolume *assembly = new TGeoVolumeAssembly( iName.c_str());
631  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTEC().begin(),
632  end = m_trackerGeom->detsTEC().end();
633  it != end; ++it )
634  {
635  DetId detid = ( *it )->geographicalId();
636  unsigned int rawid = detid.rawId();
637 
638  std::stringstream s;
639  s << rawid;
640  std::string name = s.str();
641 
642  TGeoVolume* child = createVolume( name, *it );
643  assembly->AddNode( child, copy, createPlacement( *it ));
644  child->SetLineColor( kGreen );
645 
646  std::stringstream p;
647  p << path( top, iName, copy ) << "/" << name << "_" << copy;
648  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
649 
650  ADD_SISTRIP_TOPOLOGY( rawid, m_trackerGeom->idToDet( detid ));
651  }
652 
653  top->AddNode( assembly, copy );
654 }
655 
656 void
658 {
659  std::vector<DetId> vid = m_caloGeom->getValidDetIds(); // Calo
660  for( std::vector<DetId>::const_iterator it = vid.begin(),
661  end = vid.end();
662  it != end; ++it )
663  {
664  const CaloCellGeometry::CornersVec& cor( m_caloGeom->getGeometry( *it )->getCorners());
665  m_fwGeometry->idToName[ it->rawId()].fillPoints( cor.begin(), cor.end());
666  }
667 }
T xx() const
virtual float length() const =0
virtual const std::array< const float, 4 > parameters() const
edm::ESHandle< CaloGeometry > m_caloGeom
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
TGeoShape * createShape(const GeomDet *det)
std::map< std::string, TGeoMedium * > m_nameToMedium
void addTOBGeometry(TGeoVolume *top, const std::string &name="TOB", int copy=1)
int nstrips() const
Definition: RPCRoll.cc:46
DTSuperLayerId
T y() const
Definition: PV3DBase.h:63
T yx() const
float cellWidth() const
Returns the cell width.
Definition: DTTopology.h:68
const Bounds & bounds() const
Definition: Surface.h:128
TGeoVolume * createVolume(const std::string &name, const GeomDet *det, const std::string &matname="Air")
double wireSpacing() const
const StripTopology & specificTopology() const
Definition: RPCRoll.cc:107
void addDTGeometry(TGeoVolume *top, const std::string &name="DT", int copy=1)
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
void addTIDGeometry(TGeoVolume *top, const std::string &name="TID", int copy=1)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
#define ADD_SISTRIP_TOPOLOGY(rawid, detUnit)
int firstChannel() const
Returns the wire number of the first wire.
Definition: DTTopology.h:78
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
virtual float thickness() const =0
T zx() const
T xy() const
int lastChannel() const
Returns the wire number of the last wire.
Definition: DTTopology.h:80
T zz() const
virtual float stripLength() const =0
float wireAngle() const
const DetContainer & detsTEC() const
void addRPCGeometry(TGeoVolume *top, const std::string &name="RPC", int copy=1)
void addCSCGeometry(TGeoVolume *top, const std::string &name="CSC", int copy=1)
std::map< std::string, TGeoShape * > m_nameToShape
T z() const
Definition: PV3DBase.h:64
const DetContainer & detsPXB() const
T zy() const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:72
#define end
Definition: vmac.h:37
float cellHeight() const
Returns the cell height.
Definition: DTTopology.h:70
T yy() const
virtual const GeomDet * idToDet(DetId) const
void addPixelBarrelGeometry(TGeoVolume *top, const std::string &name="PixelBarrel", int copy=1)
const DetContainer & detsTIB() const
void addTIBGeometry(TGeoVolume *top, const std::string &name="TIB", int copy=1)
std::map< std::string, TGeoVolume * > m_nameToVolume
Definition: DetId.h:18
virtual float stripOffset(void) const
int channels() const
Returns the number of wires in the layer.
Definition: DTTopology.h:75
#define ADD_PIXEL_TOPOLOGY(rawid, detUnit)
double b
Definition: hdecay.h:120
boost::shared_ptr< FWTGeoRecoGeometry > produce(const FWTGeoRecoGeometryRecord &)
boost::shared_ptr< FWTGeoRecoGeometry > m_fwGeometry
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
void addPixelForwardGeometry(TGeoVolume *top, const std::string &name="PixelForward", int copy=1)
T xz() const
FWTGeoRecoGeometryESProducer(const edm::ParameterSet &)
virtual float pitch() const =0
const DetContainer & detsPXF() const
const DetContainer & detsTOB() const
const RotationType & rotation() const
Definition: Bounds.h:22
void addTECGeometry(TGeoVolume *top, const std::string &name="TEC", int copy=1)
TGeoMaterial * createMaterial(const std::string &name)
std::map< std::string, TGeoMaterial * > m_nameToMaterial
float cellLenght() const
Definition: DTTopology.h:73
T x() const
Definition: PV3DBase.h:62
virtual float width() const =0
const std::string path(TGeoVolume *top, const std::string &name, int copy)
const PositionType & position() const
T yz() const
const std::vector< RPCRoll * > & rolls() const
Return a vector of all RPC rolls.
Definition: RPCGeometry.cc:67
const DetContainer & detsTID() const