CMS 3D CMS Logo

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