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