CMS 3D CMS Logo

FWRecoGeometryESProducer.cc
Go to the documentation of this file.
1 #include <fstream>
2 #include <streambuf>
3 
8 
36 
37 #include "TNamed.h"
39 
41  const GeomDet* detUnit,
42  FWRecoGeometry& fwRecoGeometry ) {
43  const PixelGeomDetUnit* det = dynamic_cast<const PixelGeomDetUnit*>( detUnit );
44  if( det )
45  {
46  const PixelTopology* topo = &det->specificTopology();
47 
48  std::pair<float,float> pitch = topo->pitch();
49  fwRecoGeometry.idToName[rawid].topology[0] = pitch.first;
50  fwRecoGeometry.idToName[rawid].topology[1] = pitch.second;
51 
52  fwRecoGeometry.idToName[rawid].topology[2] = topo->localX(0.f); // offsetX
53  fwRecoGeometry.idToName[rawid].topology[3] = topo->localY(0.f); // offsetY
54 
55  // big pixels layout
56  fwRecoGeometry.idToName[rawid].topology[4] = topo->isItBigPixelInX(80) ? 0 : 1;
57  }
58 }
59 
62 
63 # define ADD_SISTRIP_TOPOLOGY( rawid, detUnit ) \
64  const StripGeomDetUnit* det = dynamic_cast<const StripGeomDetUnit*>( detUnit ); \
65  if( det ) \
66  { \
67  if( const StripTopology* topo = dynamic_cast<const StripTopology*>( &det->specificTopology())) \
68  { \
69  fwRecoGeometry.idToName[rawid].topology[0] = 0; \
70  fwRecoGeometry.idToName[rawid].topology[1] = topo->nstrips(); \
71  fwRecoGeometry.idToName[rawid].topology[2] = topo->stripLength(); \
72  } else \
73  if( const RadialStripTopology* rtop = dynamic_cast<const RadialStripTopology*>( &(det->specificType().specificTopology()))) \
74  { \
75  fwRecoGeometry.idToName[rawid].topology[0] = 1; \
76  fwRecoGeometry.idToName[rawid].topology[3] = rtop->yAxisOrientation(); \
77  fwRecoGeometry.idToName[rawid].topology[4] = rtop->originToIntersection(); \
78  fwRecoGeometry.idToName[rawid].topology[5] = rtop->phiOfOneEdge(); \
79  fwRecoGeometry.idToName[rawid].topology[6] = rtop->angularWidth(); \
80  } \
81  else if( dynamic_cast<const RectangularStripTopology*>( &(det->specificType().specificTopology()))) \
82  { \
83  fwRecoGeometry.idToName[rawid].topology[0] = 2; \
84  fwRecoGeometry.idToName[rawid].topology[3] = topo->pitch(); \
85  } \
86  else if( dynamic_cast<const TrapezoidalStripTopology*>( &(det->specificType().specificTopology()))) \
87  { \
88  fwRecoGeometry.idToName[rawid].topology[0] = 3; \
89  fwRecoGeometry.idToName[rawid].topology[3] = topo->pitch(); \
90  } \
91  } \
92  else \
93  { \
94  const Phase2TrackerGeomDetUnit* det = dynamic_cast<const Phase2TrackerGeomDetUnit*>( detUnit ); \
95  if( det ) \
96  { \
97  if( const Phase2TrackerTopology *topo = dynamic_cast<const Phase2TrackerTopology *>( &(det->specificTopology()))) \
98  { \
99  fwRecoGeometry.idToName[rawid].topology[0] = topo->pitch().first; \
100  fwRecoGeometry.idToName[rawid].topology[1] = topo->pitch().second;\
101  } \
102  } \
103  } \
104 
105 namespace {
106  const std::array<std::string,3> hgcal_geom_names = { { "HGCalEESensitive",
107  "HGCalHESiliconSensitive",
108  "HGCalHEScintillatorSensitive" } };
109 }
110 
112  : m_current( -1 )
113 {
114  m_tracker = pset.getUntrackedParameter<bool>( "Tracker", true );
115  m_muon = pset.getUntrackedParameter<bool>( "Muon", true );
116  m_calo = pset.getUntrackedParameter<bool>( "Calo", true );
117  m_timing = pset.getUntrackedParameter<bool>( "Timing", false );
118  setWhatProduced( this );
119 }
120 
122 {}
123 
124 std::unique_ptr<FWRecoGeometry>
126 {
127  using namespace edm;
128 
129  auto fwRecoGeometry = std::make_unique<FWRecoGeometry>();
130 
131  if( m_tracker || m_muon ) {
133  DetId detId( DetId::Tracker, 0 );
135  }
136 
137  if( m_tracker )
138  {
139  addPixelBarrelGeometry(*fwRecoGeometry);
140  addPixelForwardGeometry(*fwRecoGeometry);
141  addTIBGeometry(*fwRecoGeometry);
142  addTIDGeometry(*fwRecoGeometry);
143  addTOBGeometry(*fwRecoGeometry);
144  addTECGeometry(*fwRecoGeometry);
145  writeTrackerParametersXML(*fwRecoGeometry);
146  }
147  if( m_muon )
148  {
149  addDTGeometry(*fwRecoGeometry);
150  addCSCGeometry(*fwRecoGeometry);
151  addRPCGeometry(*fwRecoGeometry);
152  addGEMGeometry(*fwRecoGeometry);
153  addME0Geometry(*fwRecoGeometry);
154  }
155  if( m_calo )
156  {
157  edm::ESHandle<CaloGeometry> caloGeomH;
158  record.getRecord<CaloGeometryRecord>().get(caloGeomH);
159  m_caloGeom = caloGeomH.product();
160  addCaloGeometry(*fwRecoGeometry);
161  }
162 
163  if( m_timing ) {
164  record.getRecord<CaloGeometryRecord>().getRecord<IdealGeometryRecord>().get( "FastTimeBarrel", m_ftlBarrelGeom );
165  record.getRecord<CaloGeometryRecord>().getRecord<IdealGeometryRecord>().get( "SFBX", m_ftlEndcapGeom );
166  addFTLGeometry(*fwRecoGeometry);
167  }
168 
169  fwRecoGeometry->idToName.resize( m_current + 1 );
170  std::vector<FWRecoGeom::Info>( fwRecoGeometry->idToName ).swap( fwRecoGeometry->idToName );
171  std::sort( fwRecoGeometry->idToName.begin(), fwRecoGeometry->idToName.end());
172 
173  return fwRecoGeometry;
174 }
175 
176 void
178 {
179  DetId detId( DetId::Muon, 2 );
180  const CSCGeometry* cscGeometry = (const CSCGeometry*) m_geomRecord->slaveGeometry( detId );
181  for( auto it = cscGeometry->chambers().begin(),
182  end = cscGeometry->chambers().end();
183  it != end; ++it )
184  {
185  const CSCChamber *chamber = *it;
186 
187  if( chamber )
188  {
189  unsigned int rawid = chamber->geographicalId();
190  unsigned int current = insert_id( rawid, fwRecoGeometry );
191  fillShapeAndPlacement( current, chamber, fwRecoGeometry );
192  //
193  // CSC layers geometry
194  //
195  for( std::vector< const CSCLayer* >::const_iterator lit = chamber->layers().begin(),
196  lend = chamber->layers().end();
197  lit != lend; ++lit )
198  {
199  const CSCLayer* layer = *lit;
200 
201  if( layer )
202  {
203  unsigned int rawid = layer->geographicalId();
204  unsigned int current = insert_id( rawid, fwRecoGeometry );
205  fillShapeAndPlacement( current, layer, fwRecoGeometry );
206 
207  const CSCStripTopology* stripTopology = layer->geometry()->topology();
208  fwRecoGeometry.idToName[current].topology[0] = stripTopology->yAxisOrientation();
209  fwRecoGeometry.idToName[current].topology[1] = stripTopology->centreToIntersection();
210  fwRecoGeometry.idToName[current].topology[2] = stripTopology->yCentreOfStripPlane();
211  fwRecoGeometry.idToName[current].topology[3] = stripTopology->phiOfOneEdge();
212  fwRecoGeometry.idToName[current].topology[4] = stripTopology->stripOffset();
213  fwRecoGeometry.idToName[current].topology[5] = stripTopology->angularWidth();
214 
215  const CSCWireTopology* wireTopology = layer->geometry()->wireTopology();
216  fwRecoGeometry.idToName[current].topology[6] = wireTopology->wireSpacing();
217  fwRecoGeometry.idToName[current].topology[7] = wireTopology->wireAngle();
218  }
219  }
220  }
221  }
222 }
223 
224 void
226 {
227  DetId detId( DetId::Muon, 1 );
228  const DTGeometry* dtGeometry = (const DTGeometry*) m_geomRecord->slaveGeometry( detId );
229 
230  //
231  // DT chambers geometry
232  //
233  for( auto it = dtGeometry->chambers().begin(),
234  end = dtGeometry->chambers().end();
235  it != end; ++it )
236  {
237  const DTChamber *chamber = *it;
238 
239  if( chamber )
240  {
241  unsigned int rawid = chamber->geographicalId().rawId();
242  unsigned int current = insert_id( rawid, fwRecoGeometry );
243  fillShapeAndPlacement( current, chamber, fwRecoGeometry );
244  }
245  }
246 
247  // Fill in DT layer parameters
248  for( auto it = dtGeometry->layers().begin(),
249  end = dtGeometry->layers().end();
250  it != end; ++it )
251  {
252  const DTLayer* layer = *it;
253 
254  if( layer )
255  {
256  unsigned int rawid = layer->id().rawId();
257  unsigned int current = insert_id( rawid, fwRecoGeometry );
258  fillShapeAndPlacement( current, layer, fwRecoGeometry );
259 
260  const DTTopology& topo = layer->specificTopology();
261  const BoundPlane& surf = layer->surface();
262  // Topology W/H/L:
263  fwRecoGeometry.idToName[current].topology[0] = topo.cellWidth();
264  fwRecoGeometry.idToName[current].topology[1] = topo.cellHeight();
265  fwRecoGeometry.idToName[current].topology[2] = topo.cellLenght();
266  fwRecoGeometry.idToName[current].topology[3] = topo.firstChannel();
267  fwRecoGeometry.idToName[current].topology[4] = topo.lastChannel();
268  fwRecoGeometry.idToName[current].topology[5] = topo.channels();
269 
270  // Bounds W/H/L:
271  fwRecoGeometry.idToName[current].topology[6] = surf.bounds().width();
272  fwRecoGeometry.idToName[current].topology[7] = surf.bounds().thickness();
273  fwRecoGeometry.idToName[current].topology[8] = surf.bounds().length();
274  }
275  }
276 }
277 
278 void
280 {
281  //
282  // RPC rolls geometry
283  //
284  DetId detId( DetId::Muon, 3 );
285  const RPCGeometry* rpcGeom = (const RPCGeometry*) m_geomRecord->slaveGeometry( detId );
286  for( auto it = rpcGeom->rolls().begin(),
287  end = rpcGeom->rolls().end();
288  it != end; ++it )
289  {
290  const RPCRoll* roll = (*it);
291  if( roll )
292  {
293  unsigned int rawid = roll->geographicalId().rawId();
294  unsigned int current = insert_id( rawid, fwRecoGeometry );
295  fillShapeAndPlacement( current, roll, fwRecoGeometry );
296 
297  const StripTopology& topo = roll->specificTopology();
298  fwRecoGeometry.idToName[current].topology[0] = topo.nstrips();
299  fwRecoGeometry.idToName[current].topology[1] = topo.stripLength();
300  fwRecoGeometry.idToName[current].topology[2] = topo.pitch();
301  }
302  }
303 
304 
305  try {
306  RPCDetId id(1, 1, 4, 1, 1, 1, 1 );
307  m_geomRecord->slaveGeometry( detId );
308  fwRecoGeometry.extraDet.Add(new TNamed("RE4", "RPC endcap station 4"));
309  }
310  catch (std::runtime_error &e) {
311  std::cerr << e.what() << std::endl;
312  }
313 }
314 
315 void
317 {
318  //
319  // GEM geometry
320  //
321  DetId detId( DetId::Muon, 4 );
322 
323  try
324  {
325  const GEMGeometry* gemGeom = (const GEMGeometry*) m_geomRecord->slaveGeometry( detId );
326 
327  // add in superChambers - gem Segments are based on superChambers
328  for(auto sc : gemGeom->superChambers())
329  {
330  if( sc )
331  {
332  unsigned int rawid = sc->geographicalId().rawId();
333  unsigned int current = insert_id( rawid, fwRecoGeometry );
334  fillShapeAndPlacement( current, sc, fwRecoGeometry );
335  }
336  }
337  // add in chambers
338  for(auto ch : gemGeom->chambers())
339  {
340  if( ch )
341  {
342  unsigned int rawid = ch->geographicalId().rawId();
343  unsigned int current = insert_id( rawid, fwRecoGeometry );
344  fillShapeAndPlacement( current, ch, fwRecoGeometry );
345  }
346  }
347  // add in etaPartitions - gem rechits are based on etaPartitions
348  for(auto roll : gemGeom->etaPartitions())
349  {
350  if( roll )
351  {
352  unsigned int rawid = roll->geographicalId().rawId();
353  unsigned int current = insert_id( rawid, fwRecoGeometry );
354  fillShapeAndPlacement( current, roll, fwRecoGeometry );
355 
356  const StripTopology& topo = roll->specificTopology();
357  fwRecoGeometry.idToName[current].topology[0] = topo.nstrips();
358  fwRecoGeometry.idToName[current].topology[1] = topo.stripLength();
359  fwRecoGeometry.idToName[current].topology[2] = topo.pitch();
360 
361  float height = topo.stripLength()/2;
362  LocalPoint lTop( 0., height, 0.);
363  LocalPoint lBottom( 0., -height, 0.);
364  fwRecoGeometry.idToName[current].topology[3] = roll->localPitch(lTop);
365  fwRecoGeometry.idToName[current].topology[4] = roll->localPitch(lBottom);
366  fwRecoGeometry.idToName[current].topology[5] = roll->npads();
367  }
368  }
369 
370  fwRecoGeometry.extraDet.Add(new TNamed("GEM", "GEM muon detector"));
371  try {
372  GEMDetId id(1, 1, 2, 1, 1, 1 );
373  m_geomRecord->slaveGeometry( detId );
374  fwRecoGeometry.extraDet.Add(new TNamed("GE2", "GEM endcap station 2"));
375  }
376  catch (std::runtime_error &e) {
377  std::cerr << e.what() << std::endl;
378  }
379 
380  }
381  catch( cms::Exception &exception )
382  {
383  edm::LogError("FWRecoGeometry") << " GEM geometry not found " << exception.what() << std::endl;
384  }
385 }
386 
387 void
389 {
390  //
391  // ME0 geometry
392  //
393 
394  DetId detId( DetId::Muon, 5 );
395  try
396  {
397  const ME0Geometry* me0Geom = (const ME0Geometry*) m_geomRecord->slaveGeometry( detId );
398  for(auto roll : me0Geom->etaPartitions())
399  {
400  if( roll )
401  {
402  unsigned int rawid = roll->geographicalId().rawId();
403  unsigned int current = insert_id( rawid, fwRecoGeometry );
404  fillShapeAndPlacement( current, roll, fwRecoGeometry );
405 
406  const StripTopology& topo = roll->specificTopology();
407  fwRecoGeometry.idToName[current].topology[0] = topo.nstrips();
408  fwRecoGeometry.idToName[current].topology[1] = topo.stripLength();
409  fwRecoGeometry.idToName[current].topology[2] = topo.pitch();
410 
411  float height = topo.stripLength()/2;
412  LocalPoint lTop( 0., height, 0.);
413  LocalPoint lBottom( 0., -height, 0.);
414  fwRecoGeometry.idToName[current].topology[3] = roll->localPitch(lTop);
415  fwRecoGeometry.idToName[current].topology[4] = roll->localPitch(lBottom);
416  fwRecoGeometry.idToName[current].topology[5] = roll->npads();
417  }
418  }
419  fwRecoGeometry.extraDet.Add(new TNamed("ME0", "ME0 muon detector"));
420  }
421  catch( cms::Exception &exception )
422  {
423  edm::LogError("FWRecoGeometry") << " ME0 geometry not found " << exception.what() << std::endl;
424  }
425 }
426 
427 void
429 {
430  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsPXB().begin(),
431  end = m_trackerGeom->detsPXB().end();
432  it != end; ++it)
433  {
434  const GeomDet *det = *it;
435 
436  if( det )
437  {
438  DetId detid = det->geographicalId();
439  unsigned int rawid = detid.rawId();
440  unsigned int current = insert_id( rawid, fwRecoGeometry );
441  fillShapeAndPlacement( current, det, fwRecoGeometry );
442 
443  ADD_PIXEL_TOPOLOGY( current, m_trackerGeom->idToDetUnit( detid ), fwRecoGeometry);
444  }
445  }
446 }
447 
448 void
450 {
451  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsPXF().begin(),
452  end = m_trackerGeom->detsPXF().end();
453  it != end; ++it )
454  {
455  const GeomDet *det = *it;
456 
457  if( det )
458  {
459  DetId detid = det->geographicalId();
460  unsigned int rawid = detid.rawId();
461  unsigned int current = insert_id( rawid, fwRecoGeometry );
462  fillShapeAndPlacement( current, det, fwRecoGeometry );
463 
464  ADD_PIXEL_TOPOLOGY( current, m_trackerGeom->idToDetUnit( detid ), fwRecoGeometry);
465  }
466  }
467 }
468 
469 void
471 {
472  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTIB().begin(),
473  end = m_trackerGeom->detsTIB().end();
474  it != end; ++it )
475  {
476  const GeomDet *det = *it;
477 
478  if( det )
479  {
480  DetId detid = det->geographicalId();
481  unsigned int rawid = detid.rawId();
482  unsigned int current = insert_id( rawid, fwRecoGeometry );
483  fillShapeAndPlacement( current, det, fwRecoGeometry );
484 
485  ADD_SISTRIP_TOPOLOGY( current, m_trackerGeom->idToDet( detid ));
486  }
487  }
488 }
489 
490 void
492 {
493  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTOB().begin(),
494  end = m_trackerGeom->detsTOB().end();
495  it != end; ++it )
496  {
497  const GeomDet *det = *it;
498 
499  if( det )
500  {
501  DetId detid = det->geographicalId();
502  unsigned int rawid = detid.rawId();
503  unsigned int current = insert_id( rawid, fwRecoGeometry );
504  fillShapeAndPlacement( current, det, fwRecoGeometry );
505 
506  ADD_SISTRIP_TOPOLOGY( current, m_trackerGeom->idToDet( detid ));
507  }
508  }
509 }
510 
511 void
513 {
514  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTID().begin(),
515  end = m_trackerGeom->detsTID().end();
516  it != end; ++it)
517  {
518  const GeomDet *det = *it;
519 
520  if( det )
521  {
522  DetId detid = det->geographicalId();
523  unsigned int rawid = detid.rawId();
524  unsigned int current = insert_id( rawid, fwRecoGeometry );
525  fillShapeAndPlacement( current, det, fwRecoGeometry );
526 
527  ADD_SISTRIP_TOPOLOGY( current, m_trackerGeom->idToDet( detid ));
528  }
529  }
530 }
531 
532 void
534 {
535  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTEC().begin(),
536  end = m_trackerGeom->detsTEC().end();
537  it != end; ++it )
538  {
539  const GeomDet *det = *it;
540 
541  if( det )
542  {
543  DetId detid = det->geographicalId();
544  unsigned int rawid = detid.rawId();
545  unsigned int current = insert_id( rawid, fwRecoGeometry );
546  fillShapeAndPlacement( current, det, fwRecoGeometry );
547 
548  ADD_SISTRIP_TOPOLOGY( current, m_trackerGeom->idToDet( detid ));
549  }
550  }
551 }
552 
553 void
555 {
556  std::vector<DetId> vid = m_caloGeom->getValidDetIds(); // Calo
557  for( std::vector<DetId>::const_iterator it = vid.begin(),
558  end = vid.end();
559  it != end; ++it ) {
560  unsigned int id = insert_id( it->rawId(), fwRecoGeometry);
561  if( !((DetId::Forward == it->det()) || (DetId::HGCalEE == it->det()) ||
562  (DetId::HGCalHSi == it->det()) || (DetId::HGCalHSc == it->det())) ) {
563  const CaloCellGeometry::CornersVec& cor = m_caloGeom->getGeometry( *it )->getCorners();
564  fillPoints( id, cor.begin(), cor.end(), fwRecoGeometry);
565  } else {
566  DetId::Detector det = it->det();
567  int subdet = (((DetId::HGCalEE == det) ||
568  (DetId::HGCalHSi == det) ||
569  (DetId::HGCalHSc == det)) ? ForwardEmpty :
570  it->subdetId());
571  const HGCalGeometry* geom = dynamic_cast<const HGCalGeometry*>(m_caloGeom->getSubdetectorGeometry(det,subdet));
572  const auto cor = geom->getNewCorners( *it );
573 
574  // roll = yaw = pitch = 0
575  fwRecoGeometry.idToName[id].matrix[0] = 1.0;
576  fwRecoGeometry.idToName[id].matrix[4] = 1.0;
577  fwRecoGeometry.idToName[id].matrix[8] = 1.0;
578 
579  // corners of the front face
580  for(uint i = 0; i < (cor.size()-1); ++i){
581  fwRecoGeometry.idToName[id].points[i*3+0] = cor[i].x();
582  fwRecoGeometry.idToName[id].points[i*3+1] = cor[i].y();
583  fwRecoGeometry.idToName[id].points[i*3+2] = cor[i].z();
584  }
585 
586  // center
587  auto center = geom->getPosition(*it);
588  fwRecoGeometry.idToName[id].points[(cor.size()-1)*3 + 0] = center.x();
589  fwRecoGeometry.idToName[id].points[(cor.size()-1)*3 + 1] = center.y();
590  fwRecoGeometry.idToName[id].points[(cor.size()-1)*3 + 2] = center.z();
591 
592  // thickness
593  fwRecoGeometry.idToName[id].shape[3] = cor[cor.size()-1].z();
594 
595  // total points
596  fwRecoGeometry.idToName[id].topology[0] = cor.size() - 1;
597  }
598  }
599 }
600 
601 void
603 {
604  // do the barrel
605  std::vector<DetId> vid = std::move(m_ftlBarrelGeom->getValidDetIds());
606  for( std::vector<DetId>::const_iterator it = vid.begin(),
607  end = vid.end();
608  it != end; ++it ) {
609  unsigned int id = insert_id( it->rawId(), fwRecoGeometry);
610  const auto& cor = m_ftlBarrelGeom->getCorners( *it );
611  fillPoints( id, cor.begin(), cor.end(), fwRecoGeometry);
612  }
613  // do the endcap
615  for( std::vector<DetId>::const_iterator it = vid.begin(),
616  end = vid.end();
617  it != end; ++it ) {
618  unsigned int id = insert_id( it->rawId(), fwRecoGeometry);
619  const auto& cor = m_ftlEndcapGeom->getCorners( *it );
620  fillPoints( id, cor.begin(), cor.end(), fwRecoGeometry);
621  }
622 }
623 
624 unsigned int
626  FWRecoGeometry& fwRecoGeometry )
627 {
628  ++m_current;
629  fwRecoGeometry.idToName.push_back(FWRecoGeom::Info());
630  fwRecoGeometry.idToName.back().id = rawid;
631 
632  return m_current;
633 }
634 
635 void
637  std::vector<GlobalPoint>::const_iterator begin,
638  std::vector<GlobalPoint>::const_iterator end,
639  FWRecoGeometry& fwRecoGeometry )
640 {
641  unsigned int index( 0 );
642  for( std::vector<GlobalPoint>::const_iterator i = begin; i != end; ++i )
643  {
644  assert( index < FWTGeoRecoGeometry::maxPoints_-1 );
645  fwRecoGeometry.idToName[id].points[index] = i->x();
646  fwRecoGeometry.idToName[id].points[++index] = i->y();
647  fwRecoGeometry.idToName[id].points[++index] = i->z();
648  ++index;
649  }
650 }
651 
652 
654 void
656  FWRecoGeometry& fwRecoGeometry )
657 {
658  // Trapezoidal
659  const Bounds *b = &((det->surface ()).bounds ());
660  if( const TrapezoidalPlaneBounds *b2 = dynamic_cast<const TrapezoidalPlaneBounds *> (b))
661  {
662  std::array< const float, 4 > const & par = b2->parameters ();
663 
664  // These parameters are half-lengths, as in CMSIM/GEANT3
665  fwRecoGeometry.idToName[id].shape[0] = 1;
666  fwRecoGeometry.idToName[id].shape[1] = par [0]; // hBottomEdge
667  fwRecoGeometry.idToName[id].shape[2] = par [1]; // hTopEdge
668  fwRecoGeometry.idToName[id].shape[3] = par [2]; // thickness
669  fwRecoGeometry.idToName[id].shape[4] = par [3]; // apothem
670  }
671  if( const RectangularPlaneBounds *b2 = dynamic_cast<const RectangularPlaneBounds *> (b))
672  {
673  // Rectangular
674  fwRecoGeometry.idToName[id].shape[0] = 2;
675  fwRecoGeometry.idToName[id].shape[1] = b2->width() * 0.5; // half width
676  fwRecoGeometry.idToName[id].shape[2] = b2->length() * 0.5; // half length
677  fwRecoGeometry.idToName[id].shape[3] = b2->thickness() * 0.5; // half thickness
678  }
679 
680  // Position of the DetUnit's center
681  GlobalPoint pos = det->surface().position();
682  fwRecoGeometry.idToName[id].translation[0] = pos.x();
683  fwRecoGeometry.idToName[id].translation[1] = pos.y();
684  fwRecoGeometry.idToName[id].translation[2] = pos.z();
685 
686  // Add the coeff of the rotation matrix
687  // with a projection on the basis vectors
688  TkRotation<float> detRot = det->surface().rotation();
689  fwRecoGeometry.idToName[id].matrix[0] = detRot.xx();
690  fwRecoGeometry.idToName[id].matrix[1] = detRot.yx();
691  fwRecoGeometry.idToName[id].matrix[2] = detRot.zx();
692  fwRecoGeometry.idToName[id].matrix[3] = detRot.xy();
693  fwRecoGeometry.idToName[id].matrix[4] = detRot.yy();
694  fwRecoGeometry.idToName[id].matrix[5] = detRot.zy();
695  fwRecoGeometry.idToName[id].matrix[6] = detRot.xz();
696  fwRecoGeometry.idToName[id].matrix[7] = detRot.yz();
697  fwRecoGeometry.idToName[id].matrix[8] = detRot.zz();
698 }
699 
701 {
702  std::string path = "Geometry/TrackerCommonData/data/";
705  path += "PhaseI/";
710  path += "PhaseII/";
711  }
712  path += "trackerParameters.xml";
713  std::string fullPath = edm::FileInPath(path).fullPath();
714  std::ifstream t(fullPath);
715  std::stringstream buffer;
716  buffer << t.rdbuf();
717  fwRecoGeometry.trackerTopologyXML = buffer.str();
718 }
T xx() const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
T getUntrackedParameter(std::string const &, T const &) const
std::string trackerTopologyXML
edm::ESHandle< FastTimeGeometry > m_ftlBarrelGeom
virtual float stripLength() const =0
const std::vector< const CSCLayer * > & layers() const
Return all layers.
Definition: CSCChamber.h:57
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:102
const CSCWireTopology * wireTopology() const
void fillShapeAndPlacement(unsigned int id, const GeomDet *det, FWRecoGeometry &)
void addFTLGeometry(FWRecoGeometry &)
void addTOBGeometry(FWRecoGeometry &)
JetCorrectorParameters::Record record
Definition: classes.h:7
float centreToIntersection() const override
FWRecoGeometryESProducer(const edm::ParameterSet &)
void addTIBGeometry(FWRecoGeometry &)
DTLayerId id() const
Return the DetId of this SL.
Definition: DTLayer.cc:46
const std::vector< const RPCRoll * > & rolls() const
Return a vector of all RPC rolls.
Definition: RPCGeometry.cc:67
static const int maxPoints_
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
T y() const
Definition: PV3DBase.h:63
T yx() const
virtual std::pair< float, float > pitch() const =0
float cellWidth() const
Returns the cell width.
Definition: DTTopology.h:68
const_iterator begin() const
Definition: EZArrayFL.h:63
GlobalPoint getPosition(const DetId &id) const
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
char const * what() const override
Definition: Exception.cc:103
const ChamberContainer & chambers() const
Return a vector of all chambers.
Definition: CSCGeometry.cc:121
double wireSpacing() const
void addRPCGeometry(FWRecoGeometry &)
virtual bool isItBigPixelInX(int ixbin) const =0
const StripTopology & specificTopology() const
Definition: RPCRoll.cc:107
const TrackerGeometry * m_trackerGeom
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const override
Get a list of valid detector ids (for the given subdetector)
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:116
std::unique_ptr< FWRecoGeometry > produce(const FWRecoGeometryRecord &)
int firstChannel() const
Returns the wire number of the first wire.
Definition: DTTopology.h:78
void fillPoints(unsigned int id, std::vector< GlobalPoint >::const_iterator begin, std::vector< GlobalPoint >::const_iterator end, FWRecoGeometry &)
FWRecoGeom::InfoMap idToName
bool isThere(GeomDetEnumerators::SubDetector subdet) const
void addCaloGeometry(FWRecoGeometry &)
T zx() const
T xy() const
int lastChannel() const
Returns the wire number of the last wire.
Definition: DTTopology.h:80
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
const DTTopology & specificTopology() const
Definition: DTLayer.cc:42
T zz() const
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
const DetContainer & detsTEC() const
float yCentreOfStripPlane() const override
edm::ESHandle< FastTimeGeometry > m_ftlEndcapGeom
void addPixelForwardGeometry(FWRecoGeometry &)
T z() const
Definition: PV3DBase.h:64
void writeTrackerParametersXML(FWRecoGeometry &)
const DetContainer & detsPXB() const
T zy() const
const std::vector< const GEMEtaPartition * > & etaPartitions() const
Return a vector of all GEM eta partitions.
Definition: GEMGeometry.cc:63
const TrackingGeometry * slaveGeometry(DetId id) const
Return the pointer to the actual geometry for a given DetId.
virtual float localX(float mpX) const =0
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
float phiOfOneEdge() const override
double f[11][100]
#define end
Definition: vmac.h:39
float cellHeight() const
Returns the cell height.
Definition: DTTopology.h:70
T yy() const
void ADD_PIXEL_TOPOLOGY(unsigned int rawid, const GeomDet *detUnit, FWRecoGeometry &)
const DetContainer & detsTIB() const
void addCSCGeometry(FWRecoGeometry &)
void addTECGeometry(FWRecoGeometry &)
const std::vector< const GEMSuperChamber * > & superChambers() const
Return a vector of all GEM super chambers.
Definition: GEMGeometry.cc:55
const std::vector< ME0EtaPartition const * > & etaPartitions() const
Return a vector of all ME0 eta partitions.
Definition: ME0Geometry.cc:59
Definition: DetId.h:18
const CSCStripTopology * topology() const
virtual float stripOffset(void) const
float yAxisOrientation() const override
int channels() const
Returns the number of wires in the layer.
Definition: DTTopology.h:75
const std::vector< const DTLayer * > & layers() const
Return a vector of all SuperLayer.
Definition: DTGeometry.cc:112
virtual int nstrips() const =0
Detector
Definition: DetId.h:26
CornersVec getNewCorners(const DetId &id) const
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
def uint(string)
#define ADD_SISTRIP_TOPOLOGY(rawid, detUnit)
double b
Definition: hdecay.h:120
const std::vector< const GEMChamber * > & chambers() const
Return a vector of all GEM chambers.
Definition: GEMGeometry.cc:59
float angularWidth() const override
std::vector< DetId > getValidDetIds() const
Get the list of all valid detector ids.
TObjArray extraDet
#define begin
Definition: vmac.h:32
HLT enums.
void addGEMGeometry(FWRecoGeometry &)
T xz() const
const_iterator end() const
Definition: EZArrayFL.h:64
const DetContainer & detsPXF() const
const TrackerGeomDet * idToDet(DetId) const override
const DetContainer & detsTOB() const
std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
Definition: CaloGeometry.cc:85
void addTIDGeometry(FWRecoGeometry &)
const RotationType & rotation() const
std::string fullPath() const
Definition: FileInPath.cc:163
virtual float pitch() const =0
Definition: Bounds.h:22
virtual float localY(float mpY) const =0
void addPixelBarrelGeometry(FWRecoGeometry &)
unsigned int insert_id(unsigned int id, FWRecoGeometry &)
float wireAngle() const override
float cellLenght() const
Definition: DTTopology.h:73
T x() const
Definition: PV3DBase.h:62
const PositionType & position() const
T const * product() const
Definition: ESHandle.h:86
T yz() const
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:47
void addDTGeometry(FWRecoGeometry &)
def move(src, dest)
Definition: eostools.py:511
void addME0Geometry(FWRecoGeometry &)
const DetContainer & detsTID() const
CornersVec getCorners(const DetId &id) const
Returns the corner points of this cell&#39;s volume.