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
 
 ESProducer (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
 
ESProduceroperator= (const ESProducer &)=delete
 
ESProduceroperator= (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_MTD_TOPOLOGY (unsigned int rawid, const GeomDet *detUnit, FWRecoGeometry &)
 
void ADD_PIXEL_TOPOLOGY (unsigned int rawid, const GeomDet *detUnit, FWRecoGeometry &)
 
void addCaloGeometry (FWRecoGeometry &)
 
void addCSCGeometry (FWRecoGeometry &)
 
void addDTGeometry (FWRecoGeometry &)
 
void addGEMGeometry (FWRecoGeometry &)
 
void addME0Geometry (FWRecoGeometry &)
 
void addMTDGeometry (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
 
const MTDGeometrym_mtdGeom = nullptr
 
edm::ESGetToken< MTDGeometry, MTDDigiGeometryRecordm_mtdGeomToken
 
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
ESConsumesInfoconsumesInfoPushBackNew ()
 
unsigned int consumesInfoSize () const
 
template<typename CallbackT , typename TList , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
 
template<typename CallbackT , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>>, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
 
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 TDecorator >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TDecorator &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 26 of file FWRecoGeometryESProducer.h.

Constructor & Destructor Documentation

◆ FWRecoGeometryESProducer() [1/2]

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

Definition at line 124 of file FWRecoGeometryESProducer.cc.

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

124  : m_current(-1) {
125  m_tracker = pset.getUntrackedParameter<bool>("Tracker", true);
126  m_muon = pset.getUntrackedParameter<bool>("Muon", true);
127  m_gem = pset.getUntrackedParameter<bool>("GEM", false);
128  m_calo = pset.getUntrackedParameter<bool>("Calo", true);
129  m_timing = pset.getUntrackedParameter<bool>("Timing", false);
130  auto cc = setWhatProduced(this);
131 
132  if (m_muon)
133  m_gem = true;
134  if (m_tracker or m_muon or m_gem) {
135  m_trackingGeomToken = cc.consumes();
136  }
137  if (m_calo) {
138  m_caloGeomToken = cc.consumes();
139  }
140  if (m_timing) {
141  m_mtdGeomToken = cc.consumes();
142  }
143 }
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > m_caloGeomToken
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:165
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
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
edm::ESGetToken< MTDGeometry, MTDDigiGeometryRecord > m_mtdGeomToken

◆ ~FWRecoGeometryESProducer()

FWRecoGeometryESProducer::~FWRecoGeometryESProducer ( void  )
override

Definition at line 145 of file FWRecoGeometryESProducer.cc.

145 {}

◆ FWRecoGeometryESProducer() [2/2]

FWRecoGeometryESProducer::FWRecoGeometryESProducer ( const FWRecoGeometryESProducer )
delete

Member Function Documentation

◆ ADD_MTD_TOPOLOGY()

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

Definition at line 101 of file FWRecoGeometryESProducer.cc.

References FWRecoGeometry::idToName, RectangularMTDTopology::pitch(), ProxyMTDTopology::specificTopology(), GeomDet::topology(), RectangularMTDTopology::xoffset(), and RectangularMTDTopology::yoffset().

Referenced by addMTDGeometry().

103  {
104  const MTDGeomDet* det = dynamic_cast<const MTDGeomDet*>(detUnit);
105 
106  if (det) {
107  const ProxyMTDTopology& topoproxy = static_cast<const ProxyMTDTopology&>(det->topology());
108  const RectangularMTDTopology& topo = static_cast<const RectangularMTDTopology&>(topoproxy.specificTopology());
109 
110  std::pair<float, float> pitch = topo.pitch();
111  fwRecoGeometry.idToName[rawid].topology[0] = pitch.first;
112  fwRecoGeometry.idToName[rawid].topology[1] = pitch.second;
113 
114  fwRecoGeometry.idToName[rawid].topology[2] = topo.xoffset();
115  fwRecoGeometry.idToName[rawid].topology[3] = topo.yoffset();
116  }
117 }
virtual const Topology & topology() const
Definition: GeomDet.cc:67
virtual const PixelTopology & specificTopology() const
FWRecoGeom::InfoMap idToName
std::pair< float, float > pitch() const override

◆ ADD_PIXEL_TOPOLOGY()

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

Definition at line 44 of file FWRecoGeometryESProducer.cc.

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

Referenced by addPixelBarrelGeometry(), and addPixelForwardGeometry().

46  {
47  const PixelGeomDetUnit* det = dynamic_cast<const PixelGeomDetUnit*>(detUnit);
48  if (det) {
49  const PixelTopology* topo = &det->specificTopology();
50 
51  std::pair<float, float> pitch = topo->pitch();
52  fwRecoGeometry.idToName[rawid].topology[0] = pitch.first;
53  fwRecoGeometry.idToName[rawid].topology[1] = pitch.second;
54 
55  fwRecoGeometry.idToName[rawid].topology[2] = topo->localX(0.f); // offsetX
56  fwRecoGeometry.idToName[rawid].topology[3] = topo->localY(0.f); // offsetY
57 
58  // big pixels layout
59  fwRecoGeometry.idToName[rawid].topology[4] = topo->isItBigPixelInX(80) ? 0 : 1;
60  }
61 }
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 506 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().

506  {
507  std::vector<DetId> vid = m_caloGeom->getValidDetIds(); // Calo
508  std::set<DetId> cache;
509  for (std::vector<DetId>::const_iterator it = vid.begin(), end = vid.end(); it != end; ++it) {
510  unsigned int id = insert_id(it->rawId(), fwRecoGeometry);
511  if (!((DetId::Forward == it->det()) || (DetId::HGCalEE == it->det()) || (DetId::HGCalHSi == it->det()) ||
512  (DetId::HGCalHSc == it->det()))) {
513  const CaloCellGeometry::CornersVec& cor = m_caloGeom->getGeometry(*it)->getCorners();
514  fillPoints(id, cor.begin(), cor.end(), fwRecoGeometry);
515  } else {
516  DetId::Detector det = it->det();
517  int subdet = (((DetId::HGCalEE == det) || (DetId::HGCalHSi == det) || (DetId::HGCalHSc == det)) ? ForwardEmpty
518  : it->subdetId());
519  const HGCalGeometry* geom = dynamic_cast<const HGCalGeometry*>(m_caloGeom->getSubdetectorGeometry(det, subdet));
520  hgcal::RecHitTools rhtools;
521  rhtools.setGeometry(*m_caloGeom);
522  const auto cor = geom->getNewCorners(*it);
523 
524  // roll = yaw = pitch = 0
525  fwRecoGeometry.idToName[id].matrix[0] = 1.0;
526  fwRecoGeometry.idToName[id].matrix[4] = 1.0;
527  fwRecoGeometry.idToName[id].matrix[8] = 1.0;
528 
529  // corners of the front face
530  for (uint i = 0; i < (cor.size() - 1); ++i) {
531  fwRecoGeometry.idToName[id].points[i * 3 + 0] = cor[i].x();
532  fwRecoGeometry.idToName[id].points[i * 3 + 1] = cor[i].y();
533  fwRecoGeometry.idToName[id].points[i * 3 + 2] = cor[i].z();
534  }
535 
536  // center
537  auto center = geom->getPosition(*it);
538  fwRecoGeometry.idToName[id].points[(cor.size() - 1) * 3 + 0] = center.x();
539  fwRecoGeometry.idToName[id].points[(cor.size() - 1) * 3 + 1] = center.y();
540  fwRecoGeometry.idToName[id].points[(cor.size() - 1) * 3 + 2] = center.z();
541 
542  // Cells rotation (read few lines below)
543  fwRecoGeometry.idToName[id].shape[2] = 0.;
544 
545  // Thickness
546  fwRecoGeometry.idToName[id].shape[3] = cor[cor.size() - 1].z();
547 
548  // total points
549  fwRecoGeometry.idToName[id].topology[0] = cor.size() - 1;
550 
551  // Layer with Offset
552  fwRecoGeometry.idToName[id].topology[1] = rhtools.getLayerWithOffset(it->rawId());
553 
554  // Zside, +/- 1
555  fwRecoGeometry.idToName[id].topology[2] = rhtools.zside(it->rawId());
556 
557  // Is Silicon
558  fwRecoGeometry.idToName[id].topology[3] = rhtools.isSilicon(it->rawId());
559 
560  // Silicon index
561  fwRecoGeometry.idToName[id].topology[4] =
562  rhtools.isSilicon(it->rawId()) ? rhtools.getSiThickIndex(it->rawId()) : -1.;
563 
564  // Last EE layer
565  fwRecoGeometry.idToName[id].topology[5] = rhtools.lastLayerEE();
566 
567  // Compute the orientation of each cell. The orientation here is simply
568  // addressing the corner or side bottom layout of the cell and should not
569  // be confused with the concept of orientation embedded in the flat-file
570  // description. The default orientation of the cells within a wafer is
571  // with the side at the bottom. The points returned by the HGCal query
572  // will be ordered counter-clockwise, with the first corner in the
573  // uppermost-right position. The corners used to calculate the angle wrt
574  // the Y scale are corner 0 and corner 3, that are opposite in the cells.
575  // The angle should be 30 degrees wrt the Y axis for all cells in the
576  // default position. For the rotated layers in CE-H, the situation is
577  // such that the cells are oriented with a vertex down (assuming those
578  // layers will have a 30 degrees rotation): this will establish an angle
579  // of 60 degrees wrt the Y axis. The default way in which an hexagon is
580  // rendered inside Fireworks is with the vertex down.
581  if (rhtools.isSilicon(it->rawId())) {
582  auto val_x = (cor[0].x() - cor[3].x());
583  auto val_y = (cor[0].y() - cor[3].y());
584  auto val = round(std::acos(val_y / std::sqrt(val_x * val_x + val_y * val_y)) / M_PI * 180.);
585  // Pass down the chain the vaue of the rotation of the cell wrt the Y axis.
586  fwRecoGeometry.idToName[id].shape[2] = val;
587  }
588 
589  // For each and every wafer in HGCal, add a "fake" DetId with cells'
590  // (u,v) bits set to 1 . Those DetIds will be used inside Fireworks to
591  // render the HGCal Geometry. Due to the huge number of cells involved,
592  // the HGCal geometry for the Silicon Sensor is wafer-based, not cells
593  // based. The representation of the single RecHits and of all quantities
594  // derived from those, is instead fully cells based. The geometry
595  // representation of the Scintillator is directly based on tiles,
596  // therefore no fake DetId creations is needed.
597  if ((det == DetId::HGCalEE) || (det == DetId::HGCalHSi)) {
598  // Avoid hard coding masks by using static data members from HGCSiliconDetId
601  DetId wafer_detid = it->rawId() | maskZeroUV;
602  // Just be damn sure that's a fake id.
603  assert(wafer_detid != it->rawId());
604  auto [iter, is_new] = cache.insert(wafer_detid);
605  if (is_new) {
606  unsigned int local_id = insert_id(wafer_detid, fwRecoGeometry);
607  auto const& dddConstants = geom->topology().dddConstants();
608  auto wafer_size = static_cast<float>(dddConstants.waferSize(true));
609  auto R = wafer_size / std::sqrt(3.f);
610  auto r = wafer_size / 2.f;
611  float x[6] = {-r, -r, 0.f, r, r, 0.f};
612  float y[6] = {R / 2.f, -R / 2.f, -R, -R / 2.f, R / 2.f, R};
613  float z[6] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f};
614  for (unsigned int i = 0; i < 6; ++i) {
615  HepGeom::Point3D<float> wafer_corner(x[i], y[i], z[i]);
616  auto point =
617  geom->topology().dddConstants().waferLocal2Global(wafer_corner, wafer_detid, true, true, false);
618  fwRecoGeometry.idToName[local_id].points[i * 3 + 0] = point.x();
619  fwRecoGeometry.idToName[local_id].points[i * 3 + 1] = point.y();
620  fwRecoGeometry.idToName[local_id].points[i * 3 + 2] = point.z();
621  }
622  // Nota Bene: rotations of full layers (and wafers therein) is taken
623  // care of internally by the call to the waferLocal2Global method.
624  // Therefore we set up the unit matrix for the rotation.
625  // roll = yaw = pitch = 0
626  fwRecoGeometry.idToName[local_id].matrix[0] = 1.0;
627  fwRecoGeometry.idToName[local_id].matrix[4] = 1.0;
628  fwRecoGeometry.idToName[local_id].matrix[8] = 1.0;
629 
630  // thickness
631  fwRecoGeometry.idToName[local_id].shape[3] = cor[cor.size() - 1].z();
632 
633  // total points
634  fwRecoGeometry.idToName[local_id].topology[0] = 6;
635 
636  // Layer with Offset
637  fwRecoGeometry.idToName[local_id].topology[1] = rhtools.getLayerWithOffset(it->rawId());
638 
639  // Zside, +/- 1
640  fwRecoGeometry.idToName[local_id].topology[2] = rhtools.zside(it->rawId());
641 
642  // Is Silicon
643  fwRecoGeometry.idToName[local_id].topology[3] = rhtools.isSilicon(it->rawId());
644 
645  // Silicon index
646  fwRecoGeometry.idToName[local_id].topology[4] =
647  rhtools.isSilicon(it->rawId()) ? rhtools.getSiThickIndex(it->rawId()) : -1.;
648 
649  // Last EE layer
650  fwRecoGeometry.idToName[local_id].topology[5] = rhtools.lastLayerEE();
651  }
652  }
653  }
654  }
655 }
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 192 of file FWRecoGeometryESProducer.cc.

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

Referenced by produce().

192  {
193  DetId detId(DetId::Muon, 2);
194  const CSCGeometry* cscGeometry = static_cast<const CSCGeometry*>(m_trackingGeom->slaveGeometry(detId));
195  for (auto it = cscGeometry->chambers().begin(), end = cscGeometry->chambers().end(); it != end; ++it) {
196  const CSCChamber* chamber = *it;
197 
198  if (chamber) {
199  unsigned int rawid = chamber->geographicalId();
200  unsigned int current = insert_id(rawid, fwRecoGeometry);
201  fillShapeAndPlacement(current, chamber, fwRecoGeometry);
202  //
203  // CSC layers geometry
204  //
205  for (std::vector<const CSCLayer*>::const_iterator lit = chamber->layers().begin(), lend = chamber->layers().end();
206  lit != lend;
207  ++lit) {
208  const CSCLayer* layer = *lit;
209 
210  if (layer) {
211  unsigned int rawid = layer->geographicalId();
212  unsigned int current = insert_id(rawid, fwRecoGeometry);
213  fillShapeAndPlacement(current, layer, fwRecoGeometry);
214 
215  const CSCStripTopology* stripTopology = layer->geometry()->topology();
216  fwRecoGeometry.idToName[current].topology[0] = stripTopology->yAxisOrientation();
217  fwRecoGeometry.idToName[current].topology[1] = stripTopology->centreToIntersection();
218  fwRecoGeometry.idToName[current].topology[2] = stripTopology->yCentreOfStripPlane();
219  fwRecoGeometry.idToName[current].topology[3] = stripTopology->phiOfOneEdge();
220  fwRecoGeometry.idToName[current].topology[4] = stripTopology->stripOffset();
221  fwRecoGeometry.idToName[current].topology[5] = stripTopology->angularWidth();
222 
223  const CSCWireTopology* wireTopology = layer->geometry()->wireTopology();
224  fwRecoGeometry.idToName[current].topology[6] = wireTopology->wireSpacing();
225  fwRecoGeometry.idToName[current].topology[7] = wireTopology->wireAngle();
226  }
227  }
228  }
229  }
230 }
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
float yAxisOrientation() const override
FWRecoGeom::InfoMap idToName
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
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 232 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(), pixelTopology::layer, DTGeometry::layers(), m_trackingGeom, DetId::Muon, and GlobalTrackingGeometry::slaveGeometry().

Referenced by produce().

232  {
233  DetId detId(DetId::Muon, 1);
234  const DTGeometry* dtGeometry = static_cast<const DTGeometry*>(m_trackingGeom->slaveGeometry(detId));
235 
236  //
237  // DT chambers geometry
238  //
239  for (auto it = dtGeometry->chambers().begin(), end = dtGeometry->chambers().end(); it != end; ++it) {
240  const DTChamber* chamber = *it;
241 
242  if (chamber) {
243  unsigned int rawid = chamber->geographicalId().rawId();
244  unsigned int current = insert_id(rawid, fwRecoGeometry);
245  fillShapeAndPlacement(current, chamber, fwRecoGeometry);
246  }
247  }
248 
249  // Fill in DT layer parameters
250  for (auto it = dtGeometry->layers().begin(), end = dtGeometry->layers().end(); it != end; ++it) {
251  const DTLayer* layer = *it;
252 
253  if (layer) {
254  unsigned int rawid = layer->id().rawId();
255  unsigned int current = insert_id(rawid, fwRecoGeometry);
256  fillShapeAndPlacement(current, layer, fwRecoGeometry);
257 
258  const DTTopology& topo = layer->specificTopology();
259  const BoundPlane& surf = layer->surface();
260  // Topology W/H/L:
261  fwRecoGeometry.idToName[current].topology[0] = topo.cellWidth();
262  fwRecoGeometry.idToName[current].topology[1] = topo.cellHeight();
263  fwRecoGeometry.idToName[current].topology[2] = topo.cellLenght();
264  fwRecoGeometry.idToName[current].topology[3] = topo.firstChannel();
265  fwRecoGeometry.idToName[current].topology[4] = topo.lastChannel();
266  fwRecoGeometry.idToName[current].topology[5] = topo.channels();
267 
268  // Bounds W/H/L:
269  fwRecoGeometry.idToName[current].topology[6] = surf.bounds().width();
270  fwRecoGeometry.idToName[current].topology[7] = surf.bounds().thickness();
271  fwRecoGeometry.idToName[current].topology[8] = surf.bounds().length();
272  }
273  }
274 }
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
FWRecoGeom::InfoMap idToName
int firstChannel() const
Returns the wire number of the first wire.
Definition: DTTopology.h:79
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
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

◆ addGEMGeometry()

void FWRecoGeometryESProducer::addGEMGeometry ( FWRecoGeometry fwRecoGeometry)
private

Definition at line 305 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().

305  {
306  //
307  // GEM geometry
308  //
309 
310  try {
311  DetId detId(DetId::Muon, 4);
312  const GEMGeometry* gemGeom = static_cast<const GEMGeometry*>(m_trackingGeom->slaveGeometry(detId));
313 
314  // add in superChambers - gem Segments are based on superChambers
315  for (auto sc : gemGeom->superChambers()) {
316  if (sc) {
317  unsigned int rawid = sc->geographicalId().rawId();
318  unsigned int current = insert_id(rawid, fwRecoGeometry);
319  fillShapeAndPlacement(current, sc, fwRecoGeometry);
320  }
321  }
322  // add in chambers
323  for (auto ch : gemGeom->chambers()) {
324  if (ch) {
325  unsigned int rawid = ch->geographicalId().rawId();
326  unsigned int current = insert_id(rawid, fwRecoGeometry);
327  fillShapeAndPlacement(current, ch, fwRecoGeometry);
328  }
329  }
330  // add in etaPartitions - gem rechits are based on etaPartitions
331  for (auto roll : gemGeom->etaPartitions()) {
332  if (roll) {
333  unsigned int rawid = roll->geographicalId().rawId();
334  unsigned int current = insert_id(rawid, fwRecoGeometry);
335  fillShapeAndPlacement(current, roll, fwRecoGeometry);
336 
337  const StripTopology& topo = roll->specificTopology();
338  fwRecoGeometry.idToName[current].topology[0] = topo.nstrips();
339  fwRecoGeometry.idToName[current].topology[1] = topo.stripLength();
340  fwRecoGeometry.idToName[current].topology[2] = topo.pitch();
341 
342  float height = topo.stripLength() / 2;
343  LocalPoint lTop(0., height, 0.);
344  LocalPoint lBottom(0., -height, 0.);
345  fwRecoGeometry.idToName[current].topology[3] = roll->localPitch(lTop);
346  fwRecoGeometry.idToName[current].topology[4] = roll->localPitch(lBottom);
347  fwRecoGeometry.idToName[current].topology[5] = roll->npads();
348  }
349  }
350 
351  fwRecoGeometry.extraDet.Add(new TNamed("GEM", "GEM muon detector"));
352  try {
353  GEMDetId id(1, 1, 2, 1, 1, 1);
355  fwRecoGeometry.extraDet.Add(new TNamed("GE2", "GEM endcap station 2"));
356  } catch (std::runtime_error& e) {
357  std::cerr << e.what() << std::endl;
358  }
359 
360  } catch (cms::Exception& exception) {
361  edm::LogError("FWRecoGeometry") << " GEM geometry not found " << exception.what() << std::endl;
362  }
363 }
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 365 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().

365  {
366  //
367  // ME0 geometry
368  //
369 
370  DetId detId(DetId::Muon, 5);
371  try {
372  const ME0Geometry* me0Geom = static_cast<const ME0Geometry*>(m_trackingGeom->slaveGeometry(detId));
373  for (auto roll : me0Geom->etaPartitions()) {
374  if (roll) {
375  unsigned int rawid = roll->geographicalId().rawId();
376  unsigned int current = insert_id(rawid, fwRecoGeometry);
377  fillShapeAndPlacement(current, roll, fwRecoGeometry);
378 
379  const StripTopology& topo = roll->specificTopology();
380  fwRecoGeometry.idToName[current].topology[0] = topo.nstrips();
381  fwRecoGeometry.idToName[current].topology[1] = topo.stripLength();
382  fwRecoGeometry.idToName[current].topology[2] = topo.pitch();
383 
384  float height = topo.stripLength() / 2;
385  LocalPoint lTop(0., height, 0.);
386  LocalPoint lBottom(0., -height, 0.);
387  fwRecoGeometry.idToName[current].topology[3] = roll->localPitch(lTop);
388  fwRecoGeometry.idToName[current].topology[4] = roll->localPitch(lBottom);
389  fwRecoGeometry.idToName[current].topology[5] = roll->npads();
390  }
391  }
392  fwRecoGeometry.extraDet.Add(new TNamed("ME0", "ME0 muon detector"));
393  } catch (cms::Exception& exception) {
394  edm::LogError("FWRecoGeometry") << " ME0 geometry not found " << exception.what() << std::endl;
395  }
396 }
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

◆ addMTDGeometry()

void FWRecoGeometryESProducer::addMTDGeometry ( FWRecoGeometry fwRecoGeometry)
private

Definition at line 657 of file FWRecoGeometryESProducer.cc.

References ADD_MTD_TOPOLOGY(), MTDGeometry::detUnits(), fillShapeAndPlacement(), MTDGeometry::idToDetUnit(), insert_id(), m_mtdGeom, and DetId::rawId().

Referenced by produce().

657  {
658  for (auto const& det : m_mtdGeom->detUnits()) {
659  if (det) {
660  DetId detid = det->geographicalId();
661  unsigned int rawid = detid.rawId();
662  unsigned int current = insert_id(rawid, fwRecoGeometry);
663  fillShapeAndPlacement(current, det, fwRecoGeometry);
664 
665  ADD_MTD_TOPOLOGY(current, m_mtdGeom->idToDetUnit(detid), fwRecoGeometry);
666  }
667  }
668 }
void fillShapeAndPlacement(unsigned int id, const GeomDet *det, FWRecoGeometry &)
void ADD_MTD_TOPOLOGY(unsigned int rawid, const GeomDet *detUnit, FWRecoGeometry &)
const MTDGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: MTDGeometry.cc:163
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: MTDGeometry.h:27
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 &)

◆ addPixelBarrelGeometry()

void FWRecoGeometryESProducer::addPixelBarrelGeometry ( FWRecoGeometry fwRecoGeometry)
private

Definition at line 398 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().

398  {
399  for (TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsPXB().begin(),
400  end = m_trackerGeom->detsPXB().end();
401  it != end;
402  ++it) {
403  const GeomDet* det = *it;
404 
405  if (det) {
406  DetId detid = det->geographicalId();
407  unsigned int rawid = detid.rawId();
408  unsigned int current = insert_id(rawid, fwRecoGeometry);
409  fillShapeAndPlacement(current, det, fwRecoGeometry);
410 
411  ADD_PIXEL_TOPOLOGY(current, m_trackerGeom->idToDetUnit(detid), fwRecoGeometry);
412  }
413  }
414 }
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 416 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().

416  {
417  for (TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsPXF().begin(),
418  end = m_trackerGeom->detsPXF().end();
419  it != end;
420  ++it) {
421  const GeomDet* det = *it;
422 
423  if (det) {
424  DetId detid = det->geographicalId();
425  unsigned int rawid = detid.rawId();
426  unsigned int current = insert_id(rawid, fwRecoGeometry);
427  fillShapeAndPlacement(current, det, fwRecoGeometry);
428 
429  ADD_PIXEL_TOPOLOGY(current, m_trackerGeom->idToDetUnit(detid), fwRecoGeometry);
430  }
431  }
432 }
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 276 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().

276  {
277  //
278  // RPC rolls geometry
279  //
280  DetId detId(DetId::Muon, 3);
281  const RPCGeometry* rpcGeom = static_cast<const RPCGeometry*>(m_trackingGeom->slaveGeometry(detId));
282  for (auto it = rpcGeom->rolls().begin(), end = rpcGeom->rolls().end(); it != end; ++it) {
283  const RPCRoll* roll = (*it);
284  if (roll) {
285  unsigned int rawid = roll->geographicalId().rawId();
286  unsigned int current = insert_id(rawid, fwRecoGeometry);
287  fillShapeAndPlacement(current, roll, fwRecoGeometry);
288 
289  const StripTopology& topo = roll->specificTopology();
290  fwRecoGeometry.idToName[current].topology[0] = topo.nstrips();
291  fwRecoGeometry.idToName[current].topology[1] = topo.stripLength();
292  fwRecoGeometry.idToName[current].topology[2] = topo.pitch();
293  }
294  }
295 
296  try {
297  RPCDetId id(1, 1, 4, 1, 1, 1, 1);
299  fwRecoGeometry.extraDet.Add(new TNamed("RE4", "RPC endcap station 4"));
300  } catch (std::runtime_error& e) {
301  std::cerr << e.what() << std::endl;
302  }
303 }
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 488 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().

488  {
489  for (TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTEC().begin(),
490  end = m_trackerGeom->detsTEC().end();
491  it != end;
492  ++it) {
493  const GeomDet* det = *it;
494 
495  if (det) {
496  DetId detid = det->geographicalId();
497  unsigned int rawid = detid.rawId();
498  unsigned int current = insert_id(rawid, fwRecoGeometry);
499  fillShapeAndPlacement(current, det, fwRecoGeometry);
500 
501  ADD_SISTRIP_TOPOLOGY(current, m_trackerGeom->idToDet(detid));
502  }
503  }
504 }
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 434 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().

434  {
435  for (TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTIB().begin(),
436  end = m_trackerGeom->detsTIB().end();
437  it != end;
438  ++it) {
439  const GeomDet* det = *it;
440 
441  if (det) {
442  DetId detid = det->geographicalId();
443  unsigned int rawid = detid.rawId();
444  unsigned int current = insert_id(rawid, fwRecoGeometry);
445  fillShapeAndPlacement(current, det, fwRecoGeometry);
446 
447  ADD_SISTRIP_TOPOLOGY(current, m_trackerGeom->idToDet(detid));
448  }
449  }
450 }
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 470 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().

470  {
471  for (TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTID().begin(),
472  end = m_trackerGeom->detsTID().end();
473  it != end;
474  ++it) {
475  const GeomDet* det = *it;
476 
477  if (det) {
478  DetId detid = det->geographicalId();
479  unsigned int rawid = detid.rawId();
480  unsigned int current = insert_id(rawid, fwRecoGeometry);
481  fillShapeAndPlacement(current, det, fwRecoGeometry);
482 
483  ADD_SISTRIP_TOPOLOGY(current, m_trackerGeom->idToDet(detid));
484  }
485  }
486 }
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 452 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().

452  {
453  for (TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTOB().begin(),
454  end = m_trackerGeom->detsTOB().end();
455  it != end;
456  ++it) {
457  const GeomDet* det = *it;
458 
459  if (det) {
460  DetId detid = det->geographicalId();
461  unsigned int rawid = detid.rawId();
462  unsigned int current = insert_id(rawid, fwRecoGeometry);
463  fillShapeAndPlacement(current, det, fwRecoGeometry);
464 
465  ADD_SISTRIP_TOPOLOGY(current, m_trackerGeom->idToDet(detid));
466  }
467  }
468 }
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 678 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().

681  {
682  unsigned int index(0);
683  for (std::vector<GlobalPoint>::const_iterator i = begin; i != end; ++i) {
685  fwRecoGeometry.idToName[id].points[index] = i->x();
686  fwRecoGeometry.idToName[id].points[++index] = i->y();
687  fwRecoGeometry.idToName[id].points[++index] = i->z();
688  ++index;
689  }
690 }
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 693 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(), addMTDGeometry(), addPixelBarrelGeometry(), addPixelForwardGeometry(), addRPCGeometry(), addTECGeometry(), addTIBGeometry(), addTIDGeometry(), and addTOBGeometry().

695  {
696  // Trapezoidal
697  const Bounds* b = &((det->surface()).bounds());
698  if (const TrapezoidalPlaneBounds* b2 = dynamic_cast<const TrapezoidalPlaneBounds*>(b)) {
699  std::array<const float, 4> const& par = b2->parameters();
700 
701  // These parameters are half-lengths, as in CMSIM/GEANT3
702  fwRecoGeometry.idToName[id].shape[0] = 1;
703  fwRecoGeometry.idToName[id].shape[1] = par[0]; // hBottomEdge
704  fwRecoGeometry.idToName[id].shape[2] = par[1]; // hTopEdge
705  fwRecoGeometry.idToName[id].shape[3] = par[2]; // thickness
706  fwRecoGeometry.idToName[id].shape[4] = par[3]; // apothem
707  }
708  if (const RectangularPlaneBounds* b2 = dynamic_cast<const RectangularPlaneBounds*>(b)) {
709  // Rectangular
710  fwRecoGeometry.idToName[id].shape[0] = 2;
711  fwRecoGeometry.idToName[id].shape[1] = b2->width() * 0.5; // half width
712  fwRecoGeometry.idToName[id].shape[2] = b2->length() * 0.5; // half length
713  fwRecoGeometry.idToName[id].shape[3] = b2->thickness() * 0.5; // half thickness
714  }
715 
716  // Position of the DetUnit's center
717  GlobalPoint pos = det->surface().position();
718  fwRecoGeometry.idToName[id].translation[0] = pos.x();
719  fwRecoGeometry.idToName[id].translation[1] = pos.y();
720  fwRecoGeometry.idToName[id].translation[2] = pos.z();
721 
722  // Add the coeff of the rotation matrix
723  // with a projection on the basis vectors
724  TkRotation<float> detRot = det->surface().rotation();
725  fwRecoGeometry.idToName[id].matrix[0] = detRot.xx();
726  fwRecoGeometry.idToName[id].matrix[1] = detRot.yx();
727  fwRecoGeometry.idToName[id].matrix[2] = detRot.zx();
728  fwRecoGeometry.idToName[id].matrix[3] = detRot.xy();
729  fwRecoGeometry.idToName[id].matrix[4] = detRot.yy();
730  fwRecoGeometry.idToName[id].matrix[5] = detRot.zy();
731  fwRecoGeometry.idToName[id].matrix[6] = detRot.xz();
732  fwRecoGeometry.idToName[id].matrix[7] = detRot.yz();
733  fwRecoGeometry.idToName[id].matrix[8] = detRot.zz();
734 }
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 147 of file FWRecoGeometryESProducer.cc.

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

147  {
148  using namespace edm;
149 
150  auto fwRecoGeometry = std::make_unique<FWRecoGeometry>();
151 
152  if (m_tracker || m_muon || m_gem) {
154  }
155 
156  if (m_tracker) {
157  DetId detId(DetId::Tracker, 0);
158  m_trackerGeom = static_cast<const TrackerGeometry*>(m_trackingGeom->slaveGeometry(detId));
159  addPixelBarrelGeometry(*fwRecoGeometry);
160  addPixelForwardGeometry(*fwRecoGeometry);
161  addTIBGeometry(*fwRecoGeometry);
162  addTIDGeometry(*fwRecoGeometry);
163  addTOBGeometry(*fwRecoGeometry);
164  addTECGeometry(*fwRecoGeometry);
165  writeTrackerParametersXML(*fwRecoGeometry);
166  }
167  if (m_muon) {
168  addDTGeometry(*fwRecoGeometry);
169  addCSCGeometry(*fwRecoGeometry);
170  addRPCGeometry(*fwRecoGeometry);
171  addME0Geometry(*fwRecoGeometry);
172  }
173  if (m_gem) {
174  addGEMGeometry(*fwRecoGeometry);
175  }
176  if (m_calo) {
178  addCaloGeometry(*fwRecoGeometry);
179  }
180  if (m_timing) {
182  addMTDGeometry(*fwRecoGeometry);
183  }
184 
185  fwRecoGeometry->idToName.resize(m_current + 1);
186  std::vector<FWRecoGeom::Info>(fwRecoGeometry->idToName).swap(fwRecoGeometry->idToName);
187  std::sort(fwRecoGeometry->idToName.begin(), fwRecoGeometry->idToName.end());
188 
189  return fwRecoGeometry;
190 }
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 addMTDGeometry(FWRecoGeometry &)
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 &)
edm::ESGetToken< MTDGeometry, MTDDigiGeometryRecord > m_mtdGeomToken

◆ writeTrackerParametersXML()

void FWRecoGeometryESProducer::writeTrackerParametersXML ( FWRecoGeometry fwRecoGeometry)
private

Definition at line 736 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().

736  {
737  std::string path = "Geometry/TrackerCommonData/data/";
739  path += "PhaseI/";
742  path += "PhaseII/";
743  }
744  path += "trackerParameters.xml";
746  std::ifstream t(fullPath);
747  std::stringstream buffer;
748  buffer << t.rdbuf();
749  fwRecoGeometry.trackerTopologyXML = buffer.str();
750 }
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 76 of file FWRecoGeometryESProducer.h.

Referenced by FWRecoGeometryESProducer(), and produce().

◆ m_caloGeom

const CaloGeometry* FWRecoGeometryESProducer::m_caloGeom = nullptr
private

Definition at line 69 of file FWRecoGeometryESProducer.h.

Referenced by addCaloGeometry(), and produce().

◆ m_caloGeomToken

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

Definition at line 66 of file FWRecoGeometryESProducer.h.

Referenced by FWRecoGeometryESProducer(), and produce().

◆ m_current

unsigned int FWRecoGeometryESProducer::m_current
private

Definition at line 72 of file FWRecoGeometryESProducer.h.

Referenced by insert_id(), and produce().

◆ m_gem

bool FWRecoGeometryESProducer::m_gem
private

Definition at line 75 of file FWRecoGeometryESProducer.h.

Referenced by FWRecoGeometryESProducer(), and produce().

◆ m_mtdGeom

const MTDGeometry* FWRecoGeometryESProducer::m_mtdGeom = nullptr
private

Definition at line 68 of file FWRecoGeometryESProducer.h.

Referenced by addMTDGeometry(), and produce().

◆ m_mtdGeomToken

edm::ESGetToken<MTDGeometry, MTDDigiGeometryRecord> FWRecoGeometryESProducer::m_mtdGeomToken
private

Definition at line 65 of file FWRecoGeometryESProducer.h.

Referenced by FWRecoGeometryESProducer(), and produce().

◆ m_muon

bool FWRecoGeometryESProducer::m_muon
private

Definition at line 74 of file FWRecoGeometryESProducer.h.

Referenced by FWRecoGeometryESProducer(), and produce().

◆ m_timing

bool FWRecoGeometryESProducer::m_timing
private

Definition at line 77 of file FWRecoGeometryESProducer.h.

Referenced by FWRecoGeometryESProducer(), and produce().

◆ m_tracker

bool FWRecoGeometryESProducer::m_tracker
private

Definition at line 73 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 64 of file FWRecoGeometryESProducer.h.

Referenced by FWRecoGeometryESProducer(), and produce().