CMS 3D CMS Logo

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