CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
FWRecoGeometryESProducer Class Reference

#include <FWRecoGeometryESProducer.h>

Inheritance diagram for FWRecoGeometryESProducer:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 FWRecoGeometryESProducer (const edm::ParameterSet &)
 
 FWRecoGeometryESProducer (const FWRecoGeometryESProducer &)=delete
 
const FWRecoGeometryESProduceroperator= (const FWRecoGeometryESProducer &)=delete
 
std::unique_ptr< FWRecoGeometryproduce (const FWRecoGeometryRecord &)
 
 ~FWRecoGeometryESProducer (void) override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESProxyIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
 ESProxyFactoryProducer (const ESProxyFactoryProducer &)=delete
 
const ESProxyFactoryProduceroperator= (const ESProxyFactoryProducer &)=delete
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Private Member Functions

void ADD_PIXEL_TOPOLOGY (unsigned int rawid, const GeomDet *detUnit, FWRecoGeometry &)
 
void addCaloGeometry (FWRecoGeometry &)
 
void addCSCGeometry (FWRecoGeometry &)
 
void addDTGeometry (FWRecoGeometry &)
 
void addFTLGeometry (FWRecoGeometry &)
 
void addGEMGeometry (FWRecoGeometry &)
 
void addME0Geometry (FWRecoGeometry &)
 
void addPixelBarrelGeometry (FWRecoGeometry &)
 
void addPixelForwardGeometry (FWRecoGeometry &)
 
void addRPCGeometry (FWRecoGeometry &)
 
void addTECGeometry (FWRecoGeometry &)
 
void addTIBGeometry (FWRecoGeometry &)
 
void addTIDGeometry (FWRecoGeometry &)
 
void addTOBGeometry (FWRecoGeometry &)
 
void fillPoints (unsigned int id, std::vector< GlobalPoint >::const_iterator begin, std::vector< GlobalPoint >::const_iterator end, FWRecoGeometry &)
 
void fillShapeAndPlacement (unsigned int id, const GeomDet *det, FWRecoGeometry &)
 
unsigned int insert_id (unsigned int id, FWRecoGeometry &)
 
void writeTrackerParametersXML (FWRecoGeometry &)
 

Private Attributes

bool m_calo
 
const CaloGeometrym_caloGeom = nullptr
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordm_caloGeomToken
 
unsigned int m_current
 
bool m_gem
 
bool m_muon
 
bool m_timing
 
bool m_tracker
 
const TrackerGeometrym_trackerGeom = nullptr
 
const GlobalTrackingGeometrym_trackingGeom = nullptr
 
edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecordm_trackingGeomToken
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProxyFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >>
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 

Detailed Description

Definition at line 24 of file FWRecoGeometryESProducer.h.

Constructor & Destructor Documentation

◆ FWRecoGeometryESProducer() [1/2]

FWRecoGeometryESProducer::FWRecoGeometryESProducer ( const edm::ParameterSet pset)

Definition at line 103 of file FWRecoGeometryESProducer.cc.

References m_calo, m_caloGeomToken, m_gem, m_muon, m_timing, m_tracker, m_trackingGeomToken, or, muonDTDigis_cfi::pset, and edm::ESProducer::setWhatProduced().

103  : m_current(-1) {
104  m_tracker = pset.getUntrackedParameter<bool>("Tracker", true);
105  m_muon = pset.getUntrackedParameter<bool>("Muon", true);
106  m_gem = pset.getUntrackedParameter<bool>("GEM", false);
107  m_calo = pset.getUntrackedParameter<bool>("Calo", true);
108  m_timing = pset.getUntrackedParameter<bool>("Timing", false);
109  auto cc = setWhatProduced(this);
110 
111  if (m_muon)
112  m_gem = true;
113  if (m_tracker or m_muon or m_gem) {
114  m_trackingGeomToken = cc.consumes();
115  }
116  if (m_calo) {
117  m_caloGeomToken = cc.consumes();
118  }
119 }
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > m_caloGeomToken
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
T getUntrackedParameter(std::string const &, T const &) const
edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > m_trackingGeomToken
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()

FWRecoGeometryESProducer::~FWRecoGeometryESProducer ( void  )
override

Definition at line 121 of file FWRecoGeometryESProducer.cc.

121 {}

◆ FWRecoGeometryESProducer() [2/2]

FWRecoGeometryESProducer::FWRecoGeometryESProducer ( const FWRecoGeometryESProducer )
delete

Member Function Documentation

◆ ADD_PIXEL_TOPOLOGY()

void FWRecoGeometryESProducer::ADD_PIXEL_TOPOLOGY ( unsigned int  rawid,
const GeomDet detUnit,
FWRecoGeometry fwRecoGeometry 
)
private

Definition at line 41 of file FWRecoGeometryESProducer.cc.

References f, FWRecoGeometry::idToName, PixelTopology::isItBigPixelInX(), PixelTopology::localX(), PixelTopology::localY(), PixelTopology::pitch(), and PixelGeomDetUnit::specificTopology().

Referenced by addPixelBarrelGeometry(), and addPixelForwardGeometry().

43  {
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 }
FWRecoGeom::InfoMap idToName
virtual float localX(float mpX) const =0
virtual bool isItBigPixelInX(int ixbin) const =0
double f[11][100]
virtual float localY(float mpY) const =0
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
virtual std::pair< float, float > pitch() const =0

◆ addCaloGeometry()

void FWRecoGeometryESProducer::addCaloGeometry ( FWRecoGeometry fwRecoGeometry)
private

Definition at line 478 of file FWRecoGeometryESProducer.cc.

References cms::cuda::assert(), EZArrayFL< T >::begin(), utilities::cache(), EZArrayFL< T >::end(), mps_fire::end, f, fillPoints(), DetId::Forward, ForwardEmpty, relativeConstraints::geom, CaloGeometry::getGeometry(), hgcal::RecHitTools::getLayerWithOffset(), hgcal::RecHitTools::getSiThickIndex(), CaloGeometry::getSubdetectorGeometry(), CaloGeometry::getValidDetIds(), DetId::HGCalEE, DetId::HGCalHSc, DetId::HGCalHSi, mps_fire::i, l1ctLayer2EG_cff::id, FWRecoGeometry::idToName, insert_id(), hgcal::RecHitTools::isSilicon(), HGCSiliconDetId::kHGCalCellUMask, HGCSiliconDetId::kHGCalCellUOffset, HGCSiliconDetId::kHGCalCellVMask, HGCSiliconDetId::kHGCalCellVOffset, hgcal::RecHitTools::lastLayerEE(), m_caloGeom, M_PI, point, dttmaxenums::R, alignCSCRings::r, DetId::rawId(), hgcal::RecHitTools::setGeometry(), mathSSE::sqrt(), parallelization::uint, heppy_batch::val, x, y, z, and hgcal::RecHitTools::zside().

Referenced by produce().

478  {
479  std::vector<DetId> vid = m_caloGeom->getValidDetIds(); // Calo
480  std::set<DetId> cache;
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  hgcal::RecHitTools rhtools;
493  rhtools.setGeometry(*m_caloGeom);
494  const auto cor = geom->getNewCorners(*it);
495 
496  // roll = yaw = pitch = 0
497  fwRecoGeometry.idToName[id].matrix[0] = 1.0;
498  fwRecoGeometry.idToName[id].matrix[4] = 1.0;
499  fwRecoGeometry.idToName[id].matrix[8] = 1.0;
500 
501  // corners of the front face
502  for (uint i = 0; i < (cor.size() - 1); ++i) {
503  fwRecoGeometry.idToName[id].points[i * 3 + 0] = cor[i].x();
504  fwRecoGeometry.idToName[id].points[i * 3 + 1] = cor[i].y();
505  fwRecoGeometry.idToName[id].points[i * 3 + 2] = cor[i].z();
506  }
507 
508  // center
509  auto center = geom->getPosition(*it);
510  fwRecoGeometry.idToName[id].points[(cor.size() - 1) * 3 + 0] = center.x();
511  fwRecoGeometry.idToName[id].points[(cor.size() - 1) * 3 + 1] = center.y();
512  fwRecoGeometry.idToName[id].points[(cor.size() - 1) * 3 + 2] = center.z();
513 
514  // Cells rotation (read few lines below)
515  fwRecoGeometry.idToName[id].shape[2] = 0.;
516 
517  // Thickness
518  fwRecoGeometry.idToName[id].shape[3] = cor[cor.size() - 1].z();
519 
520  // total points
521  fwRecoGeometry.idToName[id].topology[0] = cor.size() - 1;
522 
523  // Layer with Offset
524  fwRecoGeometry.idToName[id].topology[1] = rhtools.getLayerWithOffset(it->rawId());
525 
526  // Zside, +/- 1
527  fwRecoGeometry.idToName[id].topology[2] = rhtools.zside(it->rawId());
528 
529  // Is Silicon
530  fwRecoGeometry.idToName[id].topology[3] = rhtools.isSilicon(it->rawId());
531 
532  // Silicon index
533  fwRecoGeometry.idToName[id].topology[4] =
534  rhtools.isSilicon(it->rawId()) ? rhtools.getSiThickIndex(it->rawId()) : -1.;
535 
536  // Last EE layer
537  fwRecoGeometry.idToName[id].topology[5] = rhtools.lastLayerEE();
538 
539  // Compute the orientation of each cell. The orientation here is simply
540  // addressing the corner or side bottom layout of the cell and should not
541  // be confused with the concept of orientation embedded in the flat-file
542  // description. The default orientation of the cells within a wafer is
543  // with the side at the bottom. The points returned by the HGCal query
544  // will be ordered counter-clockwise, with the first corner in the
545  // uppermost-right position. The corners used to calculate the angle wrt
546  // the Y scale are corner 0 and corner 3, that are opposite in the cells.
547  // The angle should be 30 degrees wrt the Y axis for all cells in the
548  // default position. For the rotated layers in CE-H, the situation is
549  // such that the cells are oriented with a vertex down (assuming those
550  // layers will have a 30 degrees rotation): this will establish an angle
551  // of 60 degrees wrt the Y axis. The default way in which an hexagon is
552  // rendered inside Fireworks is with the vertex down.
553  if (rhtools.isSilicon(it->rawId())) {
554  auto val_x = (cor[0].x() - cor[3].x());
555  auto val_y = (cor[0].y() - cor[3].y());
556  auto val = round(std::acos(val_y / std::sqrt(val_x * val_x + val_y * val_y)) / M_PI * 180.);
557  // Pass down the chain the vaue of the rotation of the cell wrt the Y axis.
558  fwRecoGeometry.idToName[id].shape[2] = val;
559  }
560 
561  // For each and every wafer in HGCal, add a "fake" DetId with cells'
562  // (u,v) bits set to 1 . Those DetIds will be used inside Fireworks to
563  // render the HGCal Geometry. Due to the huge number of cells involved,
564  // the HGCal geometry for the Silicon Sensor is wafer-based, not cells
565  // based. The representation of the single RecHits and of all quantities
566  // derived from those, is instead fully cells based. The geometry
567  // representation of the Scintillator is directly based on tiles,
568  // therefore no fake DetId creations is needed.
569  if ((det == DetId::HGCalEE) || (det == DetId::HGCalHSi)) {
570  // Avoid hard coding masks by using static data members from HGCSiliconDetId
573  DetId wafer_detid = it->rawId() | maskZeroUV;
574  // Just be damn sure that's a fake id.
575  assert(wafer_detid != it->rawId());
576  auto [iter, is_new] = cache.insert(wafer_detid);
577  if (is_new) {
578  unsigned int local_id = insert_id(wafer_detid, fwRecoGeometry);
579  auto const& dddConstants = geom->topology().dddConstants();
580  auto wafer_size = static_cast<float>(dddConstants.waferSize(true));
581  auto R = wafer_size / std::sqrt(3.f);
582  auto r = wafer_size / 2.f;
583  float x[6] = {-r, -r, 0.f, r, r, 0.f};
584  float y[6] = {R / 2.f, -R / 2.f, -R, -R / 2.f, R / 2.f, R};
585  float z[6] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f};
586  for (unsigned int i = 0; i < 6; ++i) {
587  HepGeom::Point3D<float> wafer_corner(x[i], y[i], z[i]);
588  auto point =
589  geom->topology().dddConstants().waferLocal2Global(wafer_corner, wafer_detid, true, true, false);
590  fwRecoGeometry.idToName[local_id].points[i * 3 + 0] = point.x();
591  fwRecoGeometry.idToName[local_id].points[i * 3 + 1] = point.y();
592  fwRecoGeometry.idToName[local_id].points[i * 3 + 2] = point.z();
593  }
594  // Nota Bene: rotations of full layers (and wafers therein) is taken
595  // care of internally by the call to the waferLocal2Global method.
596  // Therefore we set up the unit matrix for the rotation.
597  // roll = yaw = pitch = 0
598  fwRecoGeometry.idToName[local_id].matrix[0] = 1.0;
599  fwRecoGeometry.idToName[local_id].matrix[4] = 1.0;
600  fwRecoGeometry.idToName[local_id].matrix[8] = 1.0;
601 
602  // thickness
603  fwRecoGeometry.idToName[local_id].shape[3] = cor[cor.size() - 1].z();
604 
605  // total points
606  fwRecoGeometry.idToName[local_id].topology[0] = 6;
607 
608  // Layer with Offset
609  fwRecoGeometry.idToName[local_id].topology[1] = rhtools.getLayerWithOffset(it->rawId());
610 
611  // Zside, +/- 1
612  fwRecoGeometry.idToName[local_id].topology[2] = rhtools.zside(it->rawId());
613 
614  // Is Silicon
615  fwRecoGeometry.idToName[local_id].topology[3] = rhtools.isSilicon(it->rawId());
616 
617  // Silicon index
618  fwRecoGeometry.idToName[local_id].topology[4] =
619  rhtools.isSilicon(it->rawId()) ? rhtools.getSiThickIndex(it->rawId()) : -1.;
620 
621  // Last EE layer
622  fwRecoGeometry.idToName[local_id].topology[5] = rhtools.lastLayerEE();
623  }
624  }
625  }
626  }
627 }
size_type size() const
Definition: EZArrayFL.h:67
static const int kHGCalCellUMask
static const int kHGCalCellVOffset
assert(be >=bs)
int zside(const DetId &id) const
Definition: RecHitTools.cc:163
void fillPoints(unsigned int id, std::vector< GlobalPoint >::const_iterator begin, std::vector< GlobalPoint >::const_iterator end, FWRecoGeometry &)
FWRecoGeom::InfoMap idToName
const_iterator end() const
Definition: EZArrayFL.h:53
static const int kHGCalCellVMask
T sqrt(T t)
Definition: SSEVec.h:19
const_iterator begin() const
Definition: EZArrayFL.h:52
bool isSilicon(const DetId &) const
Definition: RecHitTools.cc:428
std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
Definition: CaloGeometry.cc:60
double f[11][100]
#define M_PI
Definition: DetId.h:17
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
std::vector< DetId > getValidDetIds() const
Get the list of all valid detector ids.
Definition: CaloGeometry.cc:75
Detector
Definition: DetId.h:24
static const int kHGCalCellUOffset
void setGeometry(CaloGeometry const &)
Definition: RecHitTools.cc:68
def cache(function)
Definition: utilities.py:3
unsigned int insert_id(unsigned int id, FWRecoGeometry &)
int getSiThickIndex(const DetId &) const
Definition: RecHitTools.cc:205
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
unsigned int lastLayerEE(bool nose=false) const
Definition: RecHitTools.h:75
unsigned int getLayerWithOffset(const DetId &) const
Definition: RecHitTools.cc:365

◆ addCSCGeometry()

void FWRecoGeometryESProducer::addCSCGeometry ( FWRecoGeometry fwRecoGeometry)
private

Definition at line 164 of file FWRecoGeometryESProducer.cc.

References CSCRadialStripTopology::angularWidth(), CSCRadialStripTopology::centreToIntersection(), relativeConstraints::chamber, CSCGeometry::chambers(), mps_fire::end, fillShapeAndPlacement(), FWRecoGeometry::idToName, insert_id(), phase1PixelTopology::layer, m_trackingGeom, DetId::Muon, CSCRadialStripTopology::phiOfOneEdge(), GlobalTrackingGeometry::slaveGeometry(), OffsetRadialStripTopology::stripOffset(), CSCWireTopology::wireAngle(), CSCWireTopology::wireSpacing(), CSCRadialStripTopology::yAxisOrientation(), and CSCRadialStripTopology::yCentreOfStripPlane().

Referenced by produce().

164  {
165  DetId detId(DetId::Muon, 2);
166  const CSCGeometry* cscGeometry = static_cast<const CSCGeometry*>(m_trackingGeom->slaveGeometry(detId));
167  for (auto it = cscGeometry->chambers().begin(), end = cscGeometry->chambers().end(); it != end; ++it) {
168  const CSCChamber* chamber = *it;
169 
170  if (chamber) {
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(), lend = chamber->layers().end();
178  lit != lend;
179  ++lit) {
180  const CSCLayer* layer = *lit;
181 
182  if (layer) {
183  unsigned int rawid = layer->geographicalId();
184  unsigned int current = insert_id(rawid, fwRecoGeometry);
185  fillShapeAndPlacement(current, layer, fwRecoGeometry);
186 
187  const CSCStripTopology* stripTopology = layer->geometry()->topology();
188  fwRecoGeometry.idToName[current].topology[0] = stripTopology->yAxisOrientation();
189  fwRecoGeometry.idToName[current].topology[1] = stripTopology->centreToIntersection();
190  fwRecoGeometry.idToName[current].topology[2] = stripTopology->yCentreOfStripPlane();
191  fwRecoGeometry.idToName[current].topology[3] = stripTopology->phiOfOneEdge();
192  fwRecoGeometry.idToName[current].topology[4] = stripTopology->stripOffset();
193  fwRecoGeometry.idToName[current].topology[5] = stripTopology->angularWidth();
194 
195  const CSCWireTopology* wireTopology = layer->geometry()->wireTopology();
196  fwRecoGeometry.idToName[current].topology[6] = wireTopology->wireSpacing();
197  fwRecoGeometry.idToName[current].topology[7] = wireTopology->wireAngle();
198  }
199  }
200  }
201  }
202 }
float centreToIntersection() const override
void fillShapeAndPlacement(unsigned int id, const GeomDet *det, FWRecoGeometry &)
const TrackingGeometry * slaveGeometry(DetId id) const
Return the pointer to the actual geometry for a given DetId.
float phiOfOneEdge() const override
const GlobalTrackingGeometry * m_trackingGeom
constexpr std::array< uint8_t, layerIndexSize > layer
float yAxisOrientation() const override
FWRecoGeom::InfoMap idToName
float wireAngle() const override
virtual float stripOffset(void) const
float angularWidth() const override
double wireSpacing() const
Definition: DetId.h:17
float yCentreOfStripPlane() const override
unsigned int insert_id(unsigned int id, FWRecoGeometry &)
const ChamberContainer & chambers() const
Return a vector of all chambers.
Definition: CSCGeometry.cc:96

◆ addDTGeometry()

void FWRecoGeometryESProducer::addDTGeometry ( FWRecoGeometry fwRecoGeometry)
private

Definition at line 204 of file FWRecoGeometryESProducer.cc.

References DTTopology::cellHeight(), DTTopology::cellLenght(), DTTopology::cellWidth(), relativeConstraints::chamber, DTGeometry::chambers(), DTTopology::channels(), mps_fire::end, fillShapeAndPlacement(), DTTopology::firstChannel(), FWRecoGeometry::idToName, insert_id(), DTTopology::lastChannel(), phase1PixelTopology::layer, DTGeometry::layers(), m_trackingGeom, DetId::Muon, and GlobalTrackingGeometry::slaveGeometry().

Referenced by produce().

204  {
205  DetId detId(DetId::Muon, 1);
206  const DTGeometry* dtGeometry = static_cast<const DTGeometry*>(m_trackingGeom->slaveGeometry(detId));
207 
208  //
209  // DT chambers geometry
210  //
211  for (auto it = dtGeometry->chambers().begin(), end = dtGeometry->chambers().end(); it != end; ++it) {
212  const DTChamber* chamber = *it;
213 
214  if (chamber) {
215  unsigned int rawid = chamber->geographicalId().rawId();
216  unsigned int current = insert_id(rawid, fwRecoGeometry);
217  fillShapeAndPlacement(current, chamber, fwRecoGeometry);
218  }
219  }
220 
221  // Fill in DT layer parameters
222  for (auto it = dtGeometry->layers().begin(), end = dtGeometry->layers().end(); it != end; ++it) {
223  const DTLayer* layer = *it;
224 
225  if (layer) {
226  unsigned int rawid = layer->id().rawId();
227  unsigned int current = insert_id(rawid, fwRecoGeometry);
228  fillShapeAndPlacement(current, layer, fwRecoGeometry);
229 
230  const DTTopology& topo = layer->specificTopology();
231  const BoundPlane& surf = layer->surface();
232  // Topology W/H/L:
233  fwRecoGeometry.idToName[current].topology[0] = topo.cellWidth();
234  fwRecoGeometry.idToName[current].topology[1] = topo.cellHeight();
235  fwRecoGeometry.idToName[current].topology[2] = topo.cellLenght();
236  fwRecoGeometry.idToName[current].topology[3] = topo.firstChannel();
237  fwRecoGeometry.idToName[current].topology[4] = topo.lastChannel();
238  fwRecoGeometry.idToName[current].topology[5] = topo.channels();
239 
240  // Bounds W/H/L:
241  fwRecoGeometry.idToName[current].topology[6] = surf.bounds().width();
242  fwRecoGeometry.idToName[current].topology[7] = surf.bounds().thickness();
243  fwRecoGeometry.idToName[current].topology[8] = surf.bounds().length();
244  }
245  }
246 }
void fillShapeAndPlacement(unsigned int id, const GeomDet *det, FWRecoGeometry &)
const TrackingGeometry * slaveGeometry(DetId id) const
Return the pointer to the actual geometry for a given DetId.
float cellLenght() const
Definition: DTTopology.h:74
const GlobalTrackingGeometry * m_trackingGeom
constexpr std::array< uint8_t, layerIndexSize > layer
FWRecoGeom::InfoMap idToName
int firstChannel() const
Returns the wire number of the first wire.
Definition: DTTopology.h:79
float cellWidth() const
Returns the cell width.
Definition: DTTopology.h:69
Definition: DetId.h:17
int lastChannel() const
Returns the wire number of the last wire.
Definition: DTTopology.h:81
const std::vector< const DTLayer * > & layers() const
Return a vector of all SuperLayer.
Definition: DTGeometry.cc:88
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:84
unsigned int insert_id(unsigned int id, FWRecoGeometry &)
int channels() const
Returns the number of wires in the layer.
Definition: DTTopology.h:76
float cellHeight() const
Returns the cell height.
Definition: DTTopology.h:71

◆ addFTLGeometry()

void FWRecoGeometryESProducer::addFTLGeometry ( FWRecoGeometry fwRecoGeometry)
private

Definition at line 629 of file FWRecoGeometryESProducer.cc.

629  {
630  // do the barrel (do for BTL)
631  // do the endcap (do for ETL)
632 }

◆ addGEMGeometry()

void FWRecoGeometryESProducer::addGEMGeometry ( FWRecoGeometry fwRecoGeometry)
private

Definition at line 277 of file FWRecoGeometryESProducer.cc.

References DMR_cfg::cerr, GEMGeometry::chambers(), MillePedeFileConverter_cfg::e, GEMGeometry::etaPartitions(), cppFunctionSkipper::exception, FWRecoGeometry::extraDet, fillShapeAndPlacement(), l1ctLayer2EG_cff::id, FWRecoGeometry::idToName, insert_id(), m_trackingGeom, DetId::Muon, StripTopology::nstrips(), StripTopology::pitch(), GlobalTrackingGeometry::slaveGeometry(), StripTopology::stripLength(), and GEMGeometry::superChambers().

Referenced by produce().

277  {
278  //
279  // GEM geometry
280  //
281 
282  try {
283  DetId detId(DetId::Muon, 4);
284  const GEMGeometry* gemGeom = static_cast<const GEMGeometry*>(m_trackingGeom->slaveGeometry(detId));
285 
286  // add in superChambers - gem Segments are based on superChambers
287  for (auto sc : gemGeom->superChambers()) {
288  if (sc) {
289  unsigned int rawid = sc->geographicalId().rawId();
290  unsigned int current = insert_id(rawid, fwRecoGeometry);
291  fillShapeAndPlacement(current, sc, fwRecoGeometry);
292  }
293  }
294  // add in chambers
295  for (auto ch : gemGeom->chambers()) {
296  if (ch) {
297  unsigned int rawid = ch->geographicalId().rawId();
298  unsigned int current = insert_id(rawid, fwRecoGeometry);
299  fillShapeAndPlacement(current, ch, fwRecoGeometry);
300  }
301  }
302  // add in etaPartitions - gem rechits are based on etaPartitions
303  for (auto roll : gemGeom->etaPartitions()) {
304  if (roll) {
305  unsigned int rawid = roll->geographicalId().rawId();
306  unsigned int current = insert_id(rawid, fwRecoGeometry);
307  fillShapeAndPlacement(current, roll, fwRecoGeometry);
308 
309  const StripTopology& topo = roll->specificTopology();
310  fwRecoGeometry.idToName[current].topology[0] = topo.nstrips();
311  fwRecoGeometry.idToName[current].topology[1] = topo.stripLength();
312  fwRecoGeometry.idToName[current].topology[2] = topo.pitch();
313 
314  float height = topo.stripLength() / 2;
315  LocalPoint lTop(0., height, 0.);
316  LocalPoint lBottom(0., -height, 0.);
317  fwRecoGeometry.idToName[current].topology[3] = roll->localPitch(lTop);
318  fwRecoGeometry.idToName[current].topology[4] = roll->localPitch(lBottom);
319  fwRecoGeometry.idToName[current].topology[5] = roll->npads();
320  }
321  }
322 
323  fwRecoGeometry.extraDet.Add(new TNamed("GEM", "GEM muon detector"));
324  try {
325  GEMDetId id(1, 1, 2, 1, 1, 1);
327  fwRecoGeometry.extraDet.Add(new TNamed("GE2", "GEM endcap station 2"));
328  } catch (std::runtime_error& e) {
329  std::cerr << e.what() << std::endl;
330  }
331 
332  } catch (cms::Exception& exception) {
333  edm::LogError("FWRecoGeometry") << " GEM geometry not found " << exception.what() << std::endl;
334  }
335 }
virtual int nstrips() const =0
void fillShapeAndPlacement(unsigned int id, const GeomDet *det, FWRecoGeometry &)
const TrackingGeometry * slaveGeometry(DetId id) const
Return the pointer to the actual geometry for a given DetId.
const GlobalTrackingGeometry * m_trackingGeom
Log< level::Error, false > LogError
FWRecoGeom::InfoMap idToName
const std::vector< const GEMChamber * > & chambers() const
Return a vector of all GEM chambers.
Definition: GEMGeometry.cc:38
virtual float stripLength() const =0
Definition: DetId.h:17
TObjArray extraDet
virtual float pitch() const =0
unsigned int insert_id(unsigned int id, FWRecoGeometry &)
const std::vector< const GEMSuperChamber * > & superChambers() const
Return a vector of all GEM super chambers.
Definition: GEMGeometry.cc:36
const std::vector< const GEMEtaPartition * > & etaPartitions() const
Return a vector of all GEM eta partitions.
Definition: GEMGeometry.cc:40

◆ addME0Geometry()

void FWRecoGeometryESProducer::addME0Geometry ( FWRecoGeometry fwRecoGeometry)
private

Definition at line 337 of file FWRecoGeometryESProducer.cc.

References ME0Geometry::etaPartitions(), cppFunctionSkipper::exception, FWRecoGeometry::extraDet, fillShapeAndPlacement(), FWRecoGeometry::idToName, insert_id(), m_trackingGeom, DetId::Muon, StripTopology::nstrips(), StripTopology::pitch(), GlobalTrackingGeometry::slaveGeometry(), and StripTopology::stripLength().

Referenced by produce().

337  {
338  //
339  // ME0 geometry
340  //
341 
342  DetId detId(DetId::Muon, 5);
343  try {
344  const ME0Geometry* me0Geom = static_cast<const ME0Geometry*>(m_trackingGeom->slaveGeometry(detId));
345  for (auto roll : me0Geom->etaPartitions()) {
346  if (roll) {
347  unsigned int rawid = roll->geographicalId().rawId();
348  unsigned int current = insert_id(rawid, fwRecoGeometry);
349  fillShapeAndPlacement(current, roll, fwRecoGeometry);
350 
351  const StripTopology& topo = roll->specificTopology();
352  fwRecoGeometry.idToName[current].topology[0] = topo.nstrips();
353  fwRecoGeometry.idToName[current].topology[1] = topo.stripLength();
354  fwRecoGeometry.idToName[current].topology[2] = topo.pitch();
355 
356  float height = topo.stripLength() / 2;
357  LocalPoint lTop(0., height, 0.);
358  LocalPoint lBottom(0., -height, 0.);
359  fwRecoGeometry.idToName[current].topology[3] = roll->localPitch(lTop);
360  fwRecoGeometry.idToName[current].topology[4] = roll->localPitch(lBottom);
361  fwRecoGeometry.idToName[current].topology[5] = roll->npads();
362  }
363  }
364  fwRecoGeometry.extraDet.Add(new TNamed("ME0", "ME0 muon detector"));
365  } catch (cms::Exception& exception) {
366  edm::LogError("FWRecoGeometry") << " ME0 geometry not found " << exception.what() << std::endl;
367  }
368 }
virtual int nstrips() const =0
void fillShapeAndPlacement(unsigned int id, const GeomDet *det, FWRecoGeometry &)
const TrackingGeometry * slaveGeometry(DetId id) const
Return the pointer to the actual geometry for a given DetId.
const GlobalTrackingGeometry * m_trackingGeom
Log< level::Error, false > LogError
FWRecoGeom::InfoMap idToName
virtual float stripLength() const =0
Definition: DetId.h:17
TObjArray extraDet
virtual float pitch() const =0
unsigned int insert_id(unsigned int id, FWRecoGeometry &)
const std::vector< ME0EtaPartition const * > & etaPartitions() const
Return a vector of all ME0 eta partitions.
Definition: ME0Geometry.cc:33

◆ addPixelBarrelGeometry()

void FWRecoGeometryESProducer::addPixelBarrelGeometry ( FWRecoGeometry fwRecoGeometry)
private

Definition at line 370 of file FWRecoGeometryESProducer.cc.

References ADD_PIXEL_TOPOLOGY(), TrackerGeometry::detsPXB(), mps_fire::end, fillShapeAndPlacement(), GeomDet::geographicalId(), TrackerGeometry::idToDetUnit(), insert_id(), m_trackerGeom, and DetId::rawId().

Referenced by produce().

370  {
371  for (TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsPXB().begin(),
372  end = m_trackerGeom->detsPXB().end();
373  it != end;
374  ++it) {
375  const GeomDet* det = *it;
376 
377  if (det) {
378  DetId detid = det->geographicalId();
379  unsigned int rawid = detid.rawId();
380  unsigned int current = insert_id(rawid, fwRecoGeometry);
381  fillShapeAndPlacement(current, det, fwRecoGeometry);
382 
383  ADD_PIXEL_TOPOLOGY(current, m_trackerGeom->idToDetUnit(detid), fwRecoGeometry);
384  }
385  }
386 }
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
void fillShapeAndPlacement(unsigned int id, const GeomDet *det, FWRecoGeometry &)
const DetContainer & detsPXB() const
const TrackerGeometry * m_trackerGeom
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
void ADD_PIXEL_TOPOLOGY(unsigned int rawid, const GeomDet *detUnit, FWRecoGeometry &)
Definition: DetId.h:17
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
unsigned int insert_id(unsigned int id, FWRecoGeometry &)

◆ addPixelForwardGeometry()

void FWRecoGeometryESProducer::addPixelForwardGeometry ( FWRecoGeometry fwRecoGeometry)
private

Definition at line 388 of file FWRecoGeometryESProducer.cc.

References ADD_PIXEL_TOPOLOGY(), TrackerGeometry::detsPXF(), mps_fire::end, fillShapeAndPlacement(), GeomDet::geographicalId(), TrackerGeometry::idToDetUnit(), insert_id(), m_trackerGeom, and DetId::rawId().

Referenced by produce().

388  {
389  for (TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsPXF().begin(),
390  end = m_trackerGeom->detsPXF().end();
391  it != end;
392  ++it) {
393  const GeomDet* det = *it;
394 
395  if (det) {
396  DetId detid = det->geographicalId();
397  unsigned int rawid = detid.rawId();
398  unsigned int current = insert_id(rawid, fwRecoGeometry);
399  fillShapeAndPlacement(current, det, fwRecoGeometry);
400 
401  ADD_PIXEL_TOPOLOGY(current, m_trackerGeom->idToDetUnit(detid), fwRecoGeometry);
402  }
403  }
404 }
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
void fillShapeAndPlacement(unsigned int id, const GeomDet *det, FWRecoGeometry &)
const DetContainer & detsPXF() const
const TrackerGeometry * m_trackerGeom
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
void ADD_PIXEL_TOPOLOGY(unsigned int rawid, const GeomDet *detUnit, FWRecoGeometry &)
Definition: DetId.h:17
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
unsigned int insert_id(unsigned int id, FWRecoGeometry &)

◆ addRPCGeometry()

void FWRecoGeometryESProducer::addRPCGeometry ( FWRecoGeometry fwRecoGeometry)
private

Definition at line 248 of file FWRecoGeometryESProducer.cc.

References DMR_cfg::cerr, MillePedeFileConverter_cfg::e, mps_fire::end, FWRecoGeometry::extraDet, fillShapeAndPlacement(), GeomDet::geographicalId(), l1ctLayer2EG_cff::id, FWRecoGeometry::idToName, insert_id(), m_trackingGeom, DetId::Muon, StripTopology::nstrips(), StripTopology::pitch(), DetId::rawId(), RPCGeometry::rolls(), GlobalTrackingGeometry::slaveGeometry(), RPCRoll::specificTopology(), and StripTopology::stripLength().

Referenced by produce().

248  {
249  //
250  // RPC rolls geometry
251  //
252  DetId detId(DetId::Muon, 3);
253  const RPCGeometry* rpcGeom = static_cast<const RPCGeometry*>(m_trackingGeom->slaveGeometry(detId));
254  for (auto it = rpcGeom->rolls().begin(), end = rpcGeom->rolls().end(); it != end; ++it) {
255  const RPCRoll* roll = (*it);
256  if (roll) {
257  unsigned int rawid = roll->geographicalId().rawId();
258  unsigned int current = insert_id(rawid, fwRecoGeometry);
259  fillShapeAndPlacement(current, roll, fwRecoGeometry);
260 
261  const StripTopology& topo = roll->specificTopology();
262  fwRecoGeometry.idToName[current].topology[0] = topo.nstrips();
263  fwRecoGeometry.idToName[current].topology[1] = topo.stripLength();
264  fwRecoGeometry.idToName[current].topology[2] = topo.pitch();
265  }
266  }
267 
268  try {
269  RPCDetId id(1, 1, 4, 1, 1, 1, 1);
271  fwRecoGeometry.extraDet.Add(new TNamed("RE4", "RPC endcap station 4"));
272  } catch (std::runtime_error& e) {
273  std::cerr << e.what() << std::endl;
274  }
275 }
virtual int nstrips() const =0
void fillShapeAndPlacement(unsigned int id, const GeomDet *det, FWRecoGeometry &)
const TrackingGeometry * slaveGeometry(DetId id) const
Return the pointer to the actual geometry for a given DetId.
const GlobalTrackingGeometry * m_trackingGeom
FWRecoGeom::InfoMap idToName
virtual float stripLength() const =0
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
const StripTopology & specificTopology() const
Definition: RPCRoll.cc:49
Definition: DetId.h:17
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
TObjArray extraDet
virtual float pitch() const =0
const std::vector< const RPCRoll * > & rolls() const
Return a vector of all RPC rolls.
Definition: RPCGeometry.cc:44
unsigned int insert_id(unsigned int id, FWRecoGeometry &)

◆ addTECGeometry()

void FWRecoGeometryESProducer::addTECGeometry ( FWRecoGeometry fwRecoGeometry)
private

Definition at line 460 of file FWRecoGeometryESProducer.cc.

References ADD_SISTRIP_TOPOLOGY, TrackerGeometry::detsTEC(), mps_fire::end, fillShapeAndPlacement(), GeomDet::geographicalId(), TrackerGeometry::idToDet(), insert_id(), m_trackerGeom, and DetId::rawId().

Referenced by produce().

460  {
461  for (TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTEC().begin(),
462  end = m_trackerGeom->detsTEC().end();
463  it != end;
464  ++it) {
465  const GeomDet* det = *it;
466 
467  if (det) {
468  DetId detid = det->geographicalId();
469  unsigned int rawid = detid.rawId();
470  unsigned int current = insert_id(rawid, fwRecoGeometry);
471  fillShapeAndPlacement(current, det, fwRecoGeometry);
472 
473  ADD_SISTRIP_TOPOLOGY(current, m_trackerGeom->idToDet(detid));
474  }
475  }
476 }
void fillShapeAndPlacement(unsigned int id, const GeomDet *det, FWRecoGeometry &)
const TrackerGeometry * m_trackerGeom
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
const TrackerGeomDet * idToDet(DetId) const override
Definition: DetId.h:17
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
#define ADD_SISTRIP_TOPOLOGY(rawid, detUnit)
const DetContainer & detsTEC() const
unsigned int insert_id(unsigned int id, FWRecoGeometry &)

◆ addTIBGeometry()

void FWRecoGeometryESProducer::addTIBGeometry ( FWRecoGeometry fwRecoGeometry)
private

Definition at line 406 of file FWRecoGeometryESProducer.cc.

References ADD_SISTRIP_TOPOLOGY, TrackerGeometry::detsTIB(), mps_fire::end, fillShapeAndPlacement(), GeomDet::geographicalId(), TrackerGeometry::idToDet(), insert_id(), m_trackerGeom, and DetId::rawId().

Referenced by produce().

406  {
407  for (TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTIB().begin(),
408  end = m_trackerGeom->detsTIB().end();
409  it != end;
410  ++it) {
411  const GeomDet* det = *it;
412 
413  if (det) {
414  DetId detid = det->geographicalId();
415  unsigned int rawid = detid.rawId();
416  unsigned int current = insert_id(rawid, fwRecoGeometry);
417  fillShapeAndPlacement(current, det, fwRecoGeometry);
418 
419  ADD_SISTRIP_TOPOLOGY(current, m_trackerGeom->idToDet(detid));
420  }
421  }
422 }
const DetContainer & detsTIB() const
void fillShapeAndPlacement(unsigned int id, const GeomDet *det, FWRecoGeometry &)
const TrackerGeometry * m_trackerGeom
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
const TrackerGeomDet * idToDet(DetId) const override
Definition: DetId.h:17
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
#define ADD_SISTRIP_TOPOLOGY(rawid, detUnit)
unsigned int insert_id(unsigned int id, FWRecoGeometry &)

◆ addTIDGeometry()

void FWRecoGeometryESProducer::addTIDGeometry ( FWRecoGeometry fwRecoGeometry)
private

Definition at line 442 of file FWRecoGeometryESProducer.cc.

References ADD_SISTRIP_TOPOLOGY, TrackerGeometry::detsTID(), mps_fire::end, fillShapeAndPlacement(), GeomDet::geographicalId(), TrackerGeometry::idToDet(), insert_id(), m_trackerGeom, and DetId::rawId().

Referenced by produce().

442  {
443  for (TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTID().begin(),
444  end = m_trackerGeom->detsTID().end();
445  it != end;
446  ++it) {
447  const GeomDet* det = *it;
448 
449  if (det) {
450  DetId detid = det->geographicalId();
451  unsigned int rawid = detid.rawId();
452  unsigned int current = insert_id(rawid, fwRecoGeometry);
453  fillShapeAndPlacement(current, det, fwRecoGeometry);
454 
455  ADD_SISTRIP_TOPOLOGY(current, m_trackerGeom->idToDet(detid));
456  }
457  }
458 }
void fillShapeAndPlacement(unsigned int id, const GeomDet *det, FWRecoGeometry &)
const TrackerGeometry * m_trackerGeom
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
const TrackerGeomDet * idToDet(DetId) const override
Definition: DetId.h:17
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
#define ADD_SISTRIP_TOPOLOGY(rawid, detUnit)
unsigned int insert_id(unsigned int id, FWRecoGeometry &)
const DetContainer & detsTID() const

◆ addTOBGeometry()

void FWRecoGeometryESProducer::addTOBGeometry ( FWRecoGeometry fwRecoGeometry)
private

Definition at line 424 of file FWRecoGeometryESProducer.cc.

References ADD_SISTRIP_TOPOLOGY, TrackerGeometry::detsTOB(), mps_fire::end, fillShapeAndPlacement(), GeomDet::geographicalId(), TrackerGeometry::idToDet(), insert_id(), m_trackerGeom, and DetId::rawId().

Referenced by produce().

424  {
425  for (TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTOB().begin(),
426  end = m_trackerGeom->detsTOB().end();
427  it != end;
428  ++it) {
429  const GeomDet* det = *it;
430 
431  if (det) {
432  DetId detid = det->geographicalId();
433  unsigned int rawid = detid.rawId();
434  unsigned int current = insert_id(rawid, fwRecoGeometry);
435  fillShapeAndPlacement(current, det, fwRecoGeometry);
436 
437  ADD_SISTRIP_TOPOLOGY(current, m_trackerGeom->idToDet(detid));
438  }
439  }
440 }
void fillShapeAndPlacement(unsigned int id, const GeomDet *det, FWRecoGeometry &)
const TrackerGeometry * m_trackerGeom
const DetContainer & detsTOB() const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
const TrackerGeomDet * idToDet(DetId) const override
Definition: DetId.h:17
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
#define ADD_SISTRIP_TOPOLOGY(rawid, detUnit)
unsigned int insert_id(unsigned int id, FWRecoGeometry &)

◆ fillPoints()

void FWRecoGeometryESProducer::fillPoints ( unsigned int  id,
std::vector< GlobalPoint >::const_iterator  begin,
std::vector< GlobalPoint >::const_iterator  end,
FWRecoGeometry fwRecoGeometry 
)
private

Definition at line 642 of file FWRecoGeometryESProducer.cc.

References cms::cuda::assert(), mps_fire::end, mps_fire::i, l1ctLayer2EG_cff::id, FWRecoGeometry::idToName, and FWTGeoRecoGeometry::maxPoints_.

Referenced by addCaloGeometry().

645  {
646  unsigned int index(0);
647  for (std::vector<GlobalPoint>::const_iterator i = begin; i != end; ++i) {
649  fwRecoGeometry.idToName[id].points[index] = i->x();
650  fwRecoGeometry.idToName[id].points[++index] = i->y();
651  fwRecoGeometry.idToName[id].points[++index] = i->z();
652  ++index;
653  }
654 }
static const int maxPoints_
assert(be >=bs)
FWRecoGeom::InfoMap idToName

◆ fillShapeAndPlacement()

void FWRecoGeometryESProducer::fillShapeAndPlacement ( unsigned int  id,
const GeomDet det,
FWRecoGeometry fwRecoGeometry 
)
private

Shape of GeomDet

Definition at line 657 of file FWRecoGeometryESProducer.cc.

References b, b2, l1ctLayer2EG_cff::id, FWRecoGeometry::idToName, GloballyPositioned< T >::position(), GloballyPositioned< T >::rotation(), GeomDet::surface(), TkRotation< T >::xx(), TkRotation< T >::xy(), TkRotation< T >::xz(), TkRotation< T >::yx(), TkRotation< T >::yy(), TkRotation< T >::yz(), TkRotation< T >::zx(), TkRotation< T >::zy(), and TkRotation< T >::zz().

Referenced by addCSCGeometry(), addDTGeometry(), addGEMGeometry(), addME0Geometry(), addPixelBarrelGeometry(), addPixelForwardGeometry(), addRPCGeometry(), addTECGeometry(), addTIBGeometry(), addTIDGeometry(), and addTOBGeometry().

659  {
660  // Trapezoidal
661  const Bounds* b = &((det->surface()).bounds());
662  if (const TrapezoidalPlaneBounds* b2 = dynamic_cast<const TrapezoidalPlaneBounds*>(b)) {
663  std::array<const float, 4> const& par = b2->parameters();
664 
665  // These parameters are half-lengths, as in CMSIM/GEANT3
666  fwRecoGeometry.idToName[id].shape[0] = 1;
667  fwRecoGeometry.idToName[id].shape[1] = par[0]; // hBottomEdge
668  fwRecoGeometry.idToName[id].shape[2] = par[1]; // hTopEdge
669  fwRecoGeometry.idToName[id].shape[3] = par[2]; // thickness
670  fwRecoGeometry.idToName[id].shape[4] = par[3]; // apothem
671  }
672  if (const RectangularPlaneBounds* b2 = dynamic_cast<const RectangularPlaneBounds*>(b)) {
673  // Rectangular
674  fwRecoGeometry.idToName[id].shape[0] = 2;
675  fwRecoGeometry.idToName[id].shape[1] = b2->width() * 0.5; // half width
676  fwRecoGeometry.idToName[id].shape[2] = b2->length() * 0.5; // half length
677  fwRecoGeometry.idToName[id].shape[3] = b2->thickness() * 0.5; // half thickness
678  }
679 
680  // Position of the DetUnit's center
681  GlobalPoint pos = det->surface().position();
682  fwRecoGeometry.idToName[id].translation[0] = pos.x();
683  fwRecoGeometry.idToName[id].translation[1] = pos.y();
684  fwRecoGeometry.idToName[id].translation[2] = pos.z();
685 
686  // Add the coeff of the rotation matrix
687  // with a projection on the basis vectors
688  TkRotation<float> detRot = det->surface().rotation();
689  fwRecoGeometry.idToName[id].matrix[0] = detRot.xx();
690  fwRecoGeometry.idToName[id].matrix[1] = detRot.yx();
691  fwRecoGeometry.idToName[id].matrix[2] = detRot.zx();
692  fwRecoGeometry.idToName[id].matrix[3] = detRot.xy();
693  fwRecoGeometry.idToName[id].matrix[4] = detRot.yy();
694  fwRecoGeometry.idToName[id].matrix[5] = detRot.zy();
695  fwRecoGeometry.idToName[id].matrix[6] = detRot.xz();
696  fwRecoGeometry.idToName[id].matrix[7] = detRot.yz();
697  fwRecoGeometry.idToName[id].matrix[8] = detRot.zz();
698 }
T xx() const
T xy() const
T zz() const
T yy() const
T yz() const
FWRecoGeom::InfoMap idToName
T zx() const
T zy() const
weight_default_t b2[10]
Definition: b2.h:9
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
const PositionType & position() const
double b
Definition: hdecay.h:118
const RotationType & rotation() const
Definition: Bounds.h:18
T xz() const
T yx() const

◆ insert_id()

unsigned int FWRecoGeometryESProducer::insert_id ( unsigned int  id,
FWRecoGeometry fwRecoGeometry 
)
private

◆ operator=()

const FWRecoGeometryESProducer& FWRecoGeometryESProducer::operator= ( const FWRecoGeometryESProducer )
delete

◆ produce()

std::unique_ptr< FWRecoGeometry > FWRecoGeometryESProducer::produce ( const FWRecoGeometryRecord record)

Definition at line 123 of file FWRecoGeometryESProducer.cc.

References addCaloGeometry(), addCSCGeometry(), addDTGeometry(), addGEMGeometry(), addME0Geometry(), addPixelBarrelGeometry(), addPixelForwardGeometry(), addRPCGeometry(), addTECGeometry(), addTIBGeometry(), addTIDGeometry(), addTOBGeometry(), m_calo, m_caloGeom, m_caloGeomToken, m_current, m_gem, m_muon, m_tracker, m_trackerGeom, m_trackingGeom, m_trackingGeomToken, AlCaHarvesting_cff::record, GlobalTrackingGeometry::slaveGeometry(), jetsAK4_CHS_cff::sort, edm::swap(), DetId::Tracker, and writeTrackerParametersXML().

123  {
124  using namespace edm;
125 
126  auto fwRecoGeometry = std::make_unique<FWRecoGeometry>();
127 
128  if (m_tracker || m_muon || m_gem) {
130  }
131 
132  if (m_tracker) {
133  DetId detId(DetId::Tracker, 0);
134  m_trackerGeom = static_cast<const TrackerGeometry*>(m_trackingGeom->slaveGeometry(detId));
135  addPixelBarrelGeometry(*fwRecoGeometry);
136  addPixelForwardGeometry(*fwRecoGeometry);
137  addTIBGeometry(*fwRecoGeometry);
138  addTIDGeometry(*fwRecoGeometry);
139  addTOBGeometry(*fwRecoGeometry);
140  addTECGeometry(*fwRecoGeometry);
141  writeTrackerParametersXML(*fwRecoGeometry);
142  }
143  if (m_muon) {
144  addDTGeometry(*fwRecoGeometry);
145  addCSCGeometry(*fwRecoGeometry);
146  addRPCGeometry(*fwRecoGeometry);
147  addME0Geometry(*fwRecoGeometry);
148  }
149  if (m_gem) {
150  addGEMGeometry(*fwRecoGeometry);
151  }
152  if (m_calo) {
154  addCaloGeometry(*fwRecoGeometry);
155  }
156 
157  fwRecoGeometry->idToName.resize(m_current + 1);
158  std::vector<FWRecoGeom::Info>(fwRecoGeometry->idToName).swap(fwRecoGeometry->idToName);
159  std::sort(fwRecoGeometry->idToName.begin(), fwRecoGeometry->idToName.end());
160 
161  return fwRecoGeometry;
162 }
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > m_caloGeomToken
const TrackingGeometry * slaveGeometry(DetId id) const
Return the pointer to the actual geometry for a given DetId.
void addTOBGeometry(FWRecoGeometry &)
void addTIBGeometry(FWRecoGeometry &)
const GlobalTrackingGeometry * m_trackingGeom
void addRPCGeometry(FWRecoGeometry &)
const TrackerGeometry * m_trackerGeom
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:117
void addCaloGeometry(FWRecoGeometry &)
edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > m_trackingGeomToken
void addPixelForwardGeometry(FWRecoGeometry &)
void writeTrackerParametersXML(FWRecoGeometry &)
void addCSCGeometry(FWRecoGeometry &)
void addTECGeometry(FWRecoGeometry &)
Definition: DetId.h:17
HLT enums.
void addGEMGeometry(FWRecoGeometry &)
void addTIDGeometry(FWRecoGeometry &)
void addPixelBarrelGeometry(FWRecoGeometry &)
void addDTGeometry(FWRecoGeometry &)
void addME0Geometry(FWRecoGeometry &)

◆ writeTrackerParametersXML()

void FWRecoGeometryESProducer::writeTrackerParametersXML ( FWRecoGeometry fwRecoGeometry)
private

Definition at line 700 of file FWRecoGeometryESProducer.cc.

References edmScanValgrind::buffer, contentValuesFiles::fullPath, edm::FileInPath::fullPath(), TrackerGeometry::isThere(), m_trackerGeom, GeomDetEnumerators::P1PXB, GeomDetEnumerators::P1PXEC, GeomDetEnumerators::P2OTB, GeomDetEnumerators::P2OTEC, GeomDetEnumerators::P2PXB, GeomDetEnumerators::P2PXEC, castor_dqm_sourceclient_file_cfg::path, AlCaHLTBitMon_QueryRunRegistry::string, submitPVValidationJobs::t, and FWRecoGeometry::trackerTopologyXML.

Referenced by produce().

700  {
701  std::string path = "Geometry/TrackerCommonData/data/";
703  path += "PhaseI/";
706  path += "PhaseII/";
707  }
708  path += "trackerParameters.xml";
710  std::ifstream t(fullPath);
711  std::stringstream buffer;
712  buffer << t.rdbuf();
713  fwRecoGeometry.trackerTopologyXML = buffer.str();
714 }
std::string trackerTopologyXML
std::string fullPath() const
Definition: FileInPath.cc:161
const TrackerGeometry * m_trackerGeom
bool isThere(GeomDetEnumerators::SubDetector subdet) const

Member Data Documentation

◆ m_calo

bool FWRecoGeometryESProducer::m_calo
private

Definition at line 70 of file FWRecoGeometryESProducer.h.

Referenced by FWRecoGeometryESProducer(), and produce().

◆ m_caloGeom

const CaloGeometry* FWRecoGeometryESProducer::m_caloGeom = nullptr
private

Definition at line 63 of file FWRecoGeometryESProducer.h.

Referenced by addCaloGeometry(), and produce().

◆ m_caloGeomToken

edm::ESGetToken<CaloGeometry, CaloGeometryRecord> FWRecoGeometryESProducer::m_caloGeomToken
private

Definition at line 61 of file FWRecoGeometryESProducer.h.

Referenced by FWRecoGeometryESProducer(), and produce().

◆ m_current

unsigned int FWRecoGeometryESProducer::m_current
private

Definition at line 66 of file FWRecoGeometryESProducer.h.

Referenced by insert_id(), and produce().

◆ m_gem

bool FWRecoGeometryESProducer::m_gem
private

Definition at line 69 of file FWRecoGeometryESProducer.h.

Referenced by FWRecoGeometryESProducer(), and produce().

◆ m_muon

bool FWRecoGeometryESProducer::m_muon
private

Definition at line 68 of file FWRecoGeometryESProducer.h.

Referenced by FWRecoGeometryESProducer(), and produce().

◆ m_timing

bool FWRecoGeometryESProducer::m_timing
private

Definition at line 71 of file FWRecoGeometryESProducer.h.

Referenced by FWRecoGeometryESProducer().

◆ m_tracker

bool FWRecoGeometryESProducer::m_tracker
private

Definition at line 67 of file FWRecoGeometryESProducer.h.

Referenced by FWRecoGeometryESProducer(), and produce().

◆ m_trackerGeom

const TrackerGeometry* FWRecoGeometryESProducer::m_trackerGeom = nullptr
private

◆ m_trackingGeom

const GlobalTrackingGeometry* FWRecoGeometryESProducer::m_trackingGeom = nullptr
private

◆ m_trackingGeomToken

edm::ESGetToken<GlobalTrackingGeometry, GlobalTrackingGeometryRecord> FWRecoGeometryESProducer::m_trackingGeomToken
private

Definition at line 60 of file FWRecoGeometryESProducer.h.

Referenced by FWRecoGeometryESProducer(), and produce().