CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 &)
 
std::shared_ptr< FWRecoGeometryproduce (const FWRecoGeometryRecord &)
 
virtual ~FWRecoGeometryESProducer (void)
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()(false)
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer () noexcept(false)
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Private Member Functions

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

Private Attributes

bool m_calo
 
edm::ESHandle< CaloGeometrym_caloGeom
 
unsigned int m_current
 
edm::ESHandle< FastTimeGeometrym_ftlBarrelGeom
 
edm::ESHandle< FastTimeGeometrym_ftlEndcapGeom
 
std::shared_ptr< FWRecoGeometrym_fwGeometry
 
edm::ESHandle
< GlobalTrackingGeometry
m_geomRecord
 
std::vector< edm::ESHandle
< HGCalGeometry > > 
m_hgcalGeoms
 
bool m_muon
 
bool m_timing
 
bool m_tracker
 
const TrackerGeometrym_trackerGeom
 

Additional Inherited Members

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair
< DataKey,
edm::propagate_const
< std::shared_ptr< DataProxy > > > > 
KeyedProxies
 
typedef std::vector
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- 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 eventsetup::EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 

Detailed Description

Definition at line 24 of file FWRecoGeometryESProducer.h.

Constructor & Destructor Documentation

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

Definition at line 76 of file FWRecoGeometryESProducer.cc.

References edm::false, edm::ParameterSet::getUntrackedParameter(), m_calo, m_muon, m_timing, m_tracker, edm::ESProducer::setWhatProduced(), and funct::true.

77  : m_current( -1 )
78 {
79  m_tracker = pset.getUntrackedParameter<bool>( "Tracker", true );
80  m_muon = pset.getUntrackedParameter<bool>( "Muon", true );
81  m_calo = pset.getUntrackedParameter<bool>( "Calo", true );
82  m_timing = pset.getUntrackedParameter<bool>( "Timing", false );
83  setWhatProduced( this );
84 }
T getUntrackedParameter(std::string const &, T const &) const
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
volatile std::atomic< bool > shutdown_flag false
FWRecoGeometryESProducer::~FWRecoGeometryESProducer ( void  )
virtual

Definition at line 86 of file FWRecoGeometryESProducer.cc.

87 {}
FWRecoGeometryESProducer::FWRecoGeometryESProducer ( const FWRecoGeometryESProducer )
private

Member Function Documentation

void FWRecoGeometryESProducer::addCaloGeometry ( void  )
private

Definition at line 516 of file FWRecoGeometryESProducer.cc.

References EZArrayFL< T >::begin(), end, EZArrayFL< T >::end(), fillPoints(), DetId::Forward, relativeConstraints::geom, HGCalGeometry::getCorners(), insert_id(), m_caloGeom, and eostools::move().

Referenced by produce().

517 {
518  std::vector<DetId> vid = std::move(m_caloGeom->getValidDetIds()); // Calo
519  for( std::vector<DetId>::const_iterator it = vid.begin(),
520  end = vid.end();
521  it != end; ++it ) {
522  unsigned int id = insert_id( it->rawId());
523  if( DetId::Forward != it->det() ) {
524  const CaloCellGeometry::CornersVec& cor = m_caloGeom->getGeometry( *it )->getCorners();
525  fillPoints( id, cor.begin(), cor.end());
526  } else {
527  const HGCalGeometry* geom = static_cast<const HGCalGeometry*>( m_caloGeom->getSubdetectorGeometry( *it ) );
528  const auto& cor = geom->getCorners( *it );
529  fillPoints( id, cor.begin(), cor.end() );
530  }
531  }
532 }
const_iterator begin() const
Definition: EZArrayFL.h:63
CornersVec getCorners(const DetId &id) const
Returns the corner points of this cell&#39;s volume.
def move
Definition: eostools.py:510
#define end
Definition: vmac.h:37
unsigned int insert_id(unsigned int id)
void fillPoints(unsigned int id, std::vector< GlobalPoint >::const_iterator begin, std::vector< GlobalPoint >::const_iterator end)
edm::ESHandle< CaloGeometry > m_caloGeom
const_iterator end() const
Definition: EZArrayFL.h:64
void FWRecoGeometryESProducer::addCSCGeometry ( void  )
private

Definition at line 139 of file FWRecoGeometryESProducer.cc.

References CSCRadialStripTopology::angularWidth(), CSCRadialStripTopology::centreToIntersection(), CSCGeometry::chambers(), end, fillShapeAndPlacement(), GeomDet::geographicalId(), CSCLayer::geometry(), insert_id(), CSCChamber::layers(), m_fwGeometry, m_geomRecord, DetId::Muon, CSCRadialStripTopology::phiOfOneEdge(), OffsetRadialStripTopology::stripOffset(), CSCLayerGeometry::topology(), CSCWireTopology::wireAngle(), CSCWireTopology::wireSpacing(), CSCLayerGeometry::wireTopology(), CSCRadialStripTopology::yAxisOrientation(), and CSCRadialStripTopology::yCentreOfStripPlane().

Referenced by produce().

140 {
141  DetId detId( DetId::Muon, 2 );
142  const CSCGeometry* cscGeometry = (const CSCGeometry*) m_geomRecord->slaveGeometry( detId );
143  for( auto it = cscGeometry->chambers().begin(),
144  end = cscGeometry->chambers().end();
145  it != end; ++it )
146  {
147  const CSCChamber *chamber = *it;
148 
149  if( chamber )
150  {
151  unsigned int rawid = chamber->geographicalId();
152  unsigned int current = insert_id( rawid );
153  fillShapeAndPlacement( current, chamber );
154  //
155  // CSC layers geometry
156  //
157  for( std::vector< const CSCLayer* >::const_iterator lit = chamber->layers().begin(),
158  lend = chamber->layers().end();
159  lit != lend; ++lit )
160  {
161  const CSCLayer* layer = *lit;
162 
163  if( layer )
164  {
165  unsigned int rawid = layer->geographicalId();
166  unsigned int current = insert_id( rawid );
167  fillShapeAndPlacement( current, layer );
168 
169  const CSCStripTopology* stripTopology = layer->geometry()->topology();
170  m_fwGeometry->idToName[current].topology[0] = stripTopology->yAxisOrientation();
171  m_fwGeometry->idToName[current].topology[1] = stripTopology->centreToIntersection();
172  m_fwGeometry->idToName[current].topology[2] = stripTopology->yCentreOfStripPlane();
173  m_fwGeometry->idToName[current].topology[3] = stripTopology->phiOfOneEdge();
174  m_fwGeometry->idToName[current].topology[4] = stripTopology->stripOffset();
175  m_fwGeometry->idToName[current].topology[5] = stripTopology->angularWidth();
176 
177  const CSCWireTopology* wireTopology = layer->geometry()->wireTopology();
178  m_fwGeometry->idToName[current].topology[6] = wireTopology->wireSpacing();
179  m_fwGeometry->idToName[current].topology[7] = wireTopology->wireAngle();
180  }
181  }
182  }
183  }
184 }
const std::vector< const CSCLayer * > & layers() const
Return all layers.
Definition: CSCChamber.h:57
const CSCWireTopology * wireTopology() const
std::shared_ptr< FWRecoGeometry > m_fwGeometry
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
const ChamberContainer & chambers() const
Return a vector of all chambers.
Definition: CSCGeometry.cc:106
double wireSpacing() const
void fillShapeAndPlacement(unsigned int id, const GeomDet *det)
float wireAngle() const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
#define end
Definition: vmac.h:37
unsigned int insert_id(unsigned int id)
Definition: DetId.h:18
const CSCStripTopology * topology() const
virtual float stripOffset(void) const
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:47
void FWRecoGeometryESProducer::addDTGeometry ( void  )
private

Definition at line 187 of file FWRecoGeometryESProducer.cc.

References DTTopology::cellHeight(), DTTopology::cellLenght(), DTTopology::cellWidth(), DTGeometry::chambers(), DTTopology::channels(), end, fillShapeAndPlacement(), DTTopology::firstChannel(), GeomDet::geographicalId(), DTLayer::id(), insert_id(), DTTopology::lastChannel(), DTGeometry::layers(), m_fwGeometry, m_geomRecord, DetId::Muon, DetId::rawId(), DTLayer::specificTopology(), and GeomDet::surface().

Referenced by produce().

188 {
189  DetId detId( DetId::Muon, 1 );
190  const DTGeometry* dtGeometry = (const DTGeometry*) m_geomRecord->slaveGeometry( detId );
191 
192  //
193  // DT chambers geometry
194  //
195  for( auto it = dtGeometry->chambers().begin(),
196  end = dtGeometry->chambers().end();
197  it != end; ++it )
198  {
199  const DTChamber *chamber = *it;
200 
201  if( chamber )
202  {
203  unsigned int rawid = chamber->geographicalId().rawId();
204  unsigned int current = insert_id( rawid );
205  fillShapeAndPlacement( current, chamber );
206  }
207  }
208 
209  // Fill in DT layer parameters
210  for( auto it = dtGeometry->layers().begin(),
211  end = dtGeometry->layers().end();
212  it != end; ++it )
213  {
214  const DTLayer* layer = *it;
215 
216  if( layer )
217  {
218  unsigned int rawid = layer->id().rawId();
219  unsigned int current = insert_id( rawid );
220  fillShapeAndPlacement( current, layer );
221 
222  const DTTopology& topo = layer->specificTopology();
223  const BoundPlane& surf = layer->surface();
224  // Topology W/H/L:
225  m_fwGeometry->idToName[current].topology[0] = topo.cellWidth();
226  m_fwGeometry->idToName[current].topology[1] = topo.cellHeight();
227  m_fwGeometry->idToName[current].topology[2] = topo.cellLenght();
228  m_fwGeometry->idToName[current].topology[3] = topo.firstChannel();
229  m_fwGeometry->idToName[current].topology[4] = topo.lastChannel();
230  m_fwGeometry->idToName[current].topology[5] = topo.channels();
231 
232  // Bounds W/H/L:
233  m_fwGeometry->idToName[current].topology[6] = surf.bounds().width();
234  m_fwGeometry->idToName[current].topology[7] = surf.bounds().thickness();
235  m_fwGeometry->idToName[current].topology[8] = surf.bounds().length();
236  }
237  }
238 }
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:85
std::shared_ptr< FWRecoGeometry > m_fwGeometry
DTLayerId id() const
Return the DetId of this SL.
Definition: DTLayer.cc:46
float cellWidth() const
Returns the cell width.
Definition: DTTopology.h:68
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
int firstChannel() const
Returns the wire number of the first wire.
Definition: DTTopology.h:78
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
void fillShapeAndPlacement(unsigned int id, const GeomDet *det)
int lastChannel() const
Returns the wire number of the last wire.
Definition: DTTopology.h:80
const DTTopology & specificTopology() const
Definition: DTLayer.cc:42
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
#define end
Definition: vmac.h:37
float cellHeight() const
Returns the cell height.
Definition: DTTopology.h:70
unsigned int insert_id(unsigned int id)
Definition: DetId.h:18
int channels() const
Returns the number of wires in the layer.
Definition: DTTopology.h:75
const std::vector< const DTLayer * > & layers() const
Return a vector of all SuperLayer.
Definition: DTGeometry.cc:95
float cellLenght() const
Definition: DTTopology.h:73
void FWRecoGeometryESProducer::addFTLGeometry ( void  )
private

Definition at line 535 of file FWRecoGeometryESProducer.cc.

References end, fillPoints(), insert_id(), m_ftlBarrelGeom, m_ftlEndcapGeom, and eostools::move().

Referenced by produce().

536 {
537  // do the barrel
538  std::vector<DetId> vid = std::move(m_ftlBarrelGeom->getValidDetIds());
539  for( std::vector<DetId>::const_iterator it = vid.begin(),
540  end = vid.end();
541  it != end; ++it ) {
542  unsigned int id = insert_id( it->rawId());
543  const auto& cor = m_ftlBarrelGeom->getCorners( *it );
544  fillPoints( id, cor.begin(), cor.end());
545  }
546  // do the endcap
547  vid = std::move(m_ftlEndcapGeom->getValidDetIds());
548  for( std::vector<DetId>::const_iterator it = vid.begin(),
549  end = vid.end();
550  it != end; ++it ) {
551  unsigned int id = insert_id( it->rawId());
552  const auto& cor = m_ftlEndcapGeom->getCorners( *it );
553  fillPoints( id, cor.begin(), cor.end());
554  }
555 }
edm::ESHandle< FastTimeGeometry > m_ftlBarrelGeom
edm::ESHandle< FastTimeGeometry > m_ftlEndcapGeom
def move
Definition: eostools.py:510
#define end
Definition: vmac.h:37
unsigned int insert_id(unsigned int id)
void fillPoints(unsigned int id, std::vector< GlobalPoint >::const_iterator begin, std::vector< GlobalPoint >::const_iterator end)
void FWRecoGeometryESProducer::addGEMGeometry ( void  )
private

Definition at line 278 of file FWRecoGeometryESProducer.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, GEMGeometry::chambers(), alignCSCRings::e, GEMGeometry::etaPartitions(), cppFunctionSkipper::exception, fillShapeAndPlacement(), insert_id(), m_fwGeometry, m_geomRecord, DetId::Muon, StripTopology::nstrips(), StripTopology::pitch(), SimDataFormats::CaloAnalysis::sc, StripTopology::stripLength(), GEMGeometry::superChambers(), and cms::Exception::what().

Referenced by produce().

279 {
280  //
281  // GEM geometry
282  //
283  DetId detId( DetId::Muon, 4 );
284 
285  try
286  {
287  const GEMGeometry* gemGeom = (const GEMGeometry*) m_geomRecord->slaveGeometry( detId );
288 
289  // add in superChambers - gem Segments are based on superChambers
290  for(auto sc : gemGeom->superChambers())
291  {
292  if( sc )
293  {
294  unsigned int rawid = sc->geographicalId().rawId();
295  unsigned int current = insert_id( rawid );
296  fillShapeAndPlacement( current, sc );
297  }
298  }
299  // add in chambers
300  for(auto ch : gemGeom->chambers())
301  {
302  if( ch )
303  {
304  unsigned int rawid = ch->geographicalId().rawId();
305  unsigned int current = insert_id( rawid );
306  fillShapeAndPlacement( current, ch );
307  }
308  }
309  // add in etaPartitions - gem rechits are based on etaPartitions
310  for(auto roll : gemGeom->etaPartitions())
311  {
312  if( roll )
313  {
314  unsigned int rawid = roll->geographicalId().rawId();
315  unsigned int current = insert_id( rawid );
316  fillShapeAndPlacement( current, roll );
317 
318  const StripTopology& topo = roll->specificTopology();
319  m_fwGeometry->idToName[current].topology[0] = topo.nstrips();
320  m_fwGeometry->idToName[current].topology[1] = topo.stripLength();
321  m_fwGeometry->idToName[current].topology[2] = topo.pitch();
322 
323  float height = topo.stripLength()/2;
324  LocalPoint lTop( 0., height, 0.);
325  LocalPoint lBottom( 0., -height, 0.);
326  m_fwGeometry->idToName[current].topology[3] = roll->localPitch(lTop);
327  m_fwGeometry->idToName[current].topology[4] = roll->localPitch(lBottom);
328  m_fwGeometry->idToName[current].topology[5] = roll->npads();
329  }
330  }
331 
332  m_fwGeometry->extraDet.Add(new TNamed("GEM", "GEM muon detector"));
333  try {
334  GEMDetId id(1, 1, 2, 1, 1, 1 );
335  m_geomRecord->slaveGeometry( detId );
336  m_fwGeometry->extraDet.Add(new TNamed("GE2", "GEM endcap station 2"));
337  }
338  catch (std::runtime_error &e) {
339  std::cerr << e.what() << std::endl;
340  }
341 
342  }
343  catch( cms::Exception &exception )
344  {
345  edm::LogError("FWRecoGeometry") << " GEM geometry not found " << exception.what() << std::endl;
346  }
347 }
virtual char const * what() const
Definition: Exception.cc:141
virtual int nstrips() const =0
std::shared_ptr< FWRecoGeometry > m_fwGeometry
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
void fillShapeAndPlacement(unsigned int id, const GeomDet *det)
virtual float stripLength() const =0
const std::vector< const GEMEtaPartition * > & etaPartitions() const
Return a vector of all GEM eta partitions.
Definition: GEMGeometry.cc:63
unsigned int insert_id(unsigned int id)
const std::vector< const GEMSuperChamber * > & superChambers() const
Return a vector of all GEM super chambers.
Definition: GEMGeometry.cc:55
Definition: DetId.h:18
const std::vector< const GEMChamber * > & chambers() const
Return a vector of all GEM chambers.
Definition: GEMGeometry.cc:59
virtual float pitch() const =0
void FWRecoGeometryESProducer::addME0Geometry ( void  )
private

Definition at line 350 of file FWRecoGeometryESProducer.cc.

References ME0Geometry::etaPartitions(), cppFunctionSkipper::exception, fillShapeAndPlacement(), insert_id(), m_fwGeometry, m_geomRecord, DetId::Muon, StripTopology::nstrips(), StripTopology::pitch(), StripTopology::stripLength(), and cms::Exception::what().

Referenced by produce().

351 {
352  //
353  // ME0 geometry
354  //
355 
356  DetId detId( DetId::Muon, 5 );
357  try
358  {
359  const ME0Geometry* me0Geom = (const ME0Geometry*) m_geomRecord->slaveGeometry( detId );
360  for(auto roll : me0Geom->etaPartitions())
361  {
362  if( roll )
363  {
364  unsigned int rawid = roll->geographicalId().rawId();
365  unsigned int current = insert_id( rawid );
366  fillShapeAndPlacement( current, roll );
367 
368  const StripTopology& topo = roll->specificTopology();
369  m_fwGeometry->idToName[current].topology[0] = topo.nstrips();
370  m_fwGeometry->idToName[current].topology[1] = topo.stripLength();
371  m_fwGeometry->idToName[current].topology[2] = topo.pitch();
372 
373  float height = topo.stripLength()/2;
374  LocalPoint lTop( 0., height, 0.);
375  LocalPoint lBottom( 0., -height, 0.);
376  m_fwGeometry->idToName[current].topology[3] = roll->localPitch(lTop);
377  m_fwGeometry->idToName[current].topology[4] = roll->localPitch(lBottom);
378  m_fwGeometry->idToName[current].topology[5] = roll->npads();
379  }
380  }
381  m_fwGeometry->extraDet.Add(new TNamed("ME0", "ME0 muon detector"));
382  }
383  catch( cms::Exception &exception )
384  {
385  edm::LogError("FWRecoGeometry") << " ME0 geometry not found " << exception.what() << std::endl;
386  }
387 }
virtual char const * what() const
Definition: Exception.cc:141
virtual int nstrips() const =0
std::shared_ptr< FWRecoGeometry > m_fwGeometry
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
void fillShapeAndPlacement(unsigned int id, const GeomDet *det)
virtual float stripLength() const =0
unsigned int insert_id(unsigned int id)
const std::vector< ME0EtaPartition const * > & etaPartitions() const
Return a vector of all ME0 eta partitions.
Definition: ME0Geometry.cc:59
Definition: DetId.h:18
virtual float pitch() const =0
void FWRecoGeometryESProducer::addPixelBarrelGeometry ( void  )
private

Definition at line 390 of file FWRecoGeometryESProducer.cc.

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

Referenced by produce().

391 {
392  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsPXB().begin(),
393  end = m_trackerGeom->detsPXB().end();
394  it != end; ++it)
395  {
396  const GeomDet *det = *it;
397 
398  if( det )
399  {
400  DetId detid = det->geographicalId();
401  unsigned int rawid = detid.rawId();
402  unsigned int current = insert_id( rawid );
403  fillShapeAndPlacement( current, det );
404 
405  ADD_PIXEL_TOPOLOGY( current, m_trackerGeom->idToDetUnit( detid ));
406  }
407  }
408 }
const TrackerGeomDet * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
const TrackerGeometry * m_trackerGeom
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
void fillShapeAndPlacement(unsigned int id, const GeomDet *det)
const DetContainer & detsPXB() const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
#define end
Definition: vmac.h:37
#define ADD_PIXEL_TOPOLOGY(rawid, detUnit)
unsigned int insert_id(unsigned int id)
Definition: DetId.h:18
void FWRecoGeometryESProducer::addPixelForwardGeometry ( void  )
private

Definition at line 411 of file FWRecoGeometryESProducer.cc.

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

Referenced by produce().

412 {
413  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsPXF().begin(),
414  end = m_trackerGeom->detsPXF().end();
415  it != end; ++it )
416  {
417  const GeomDet *det = *it;
418 
419  if( det )
420  {
421  DetId detid = det->geographicalId();
422  unsigned int rawid = detid.rawId();
423  unsigned int current = insert_id( rawid );
424  fillShapeAndPlacement( current, det );
425 
426  ADD_PIXEL_TOPOLOGY( current, m_trackerGeom->idToDetUnit( detid ));
427  }
428  }
429 }
const TrackerGeomDet * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
const TrackerGeometry * m_trackerGeom
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
void fillShapeAndPlacement(unsigned int id, const GeomDet *det)
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
#define end
Definition: vmac.h:37
#define ADD_PIXEL_TOPOLOGY(rawid, detUnit)
unsigned int insert_id(unsigned int id)
Definition: DetId.h:18
const DetContainer & detsPXF() const
void FWRecoGeometryESProducer::addRPCGeometry ( void  )
private

Definition at line 241 of file FWRecoGeometryESProducer.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, alignCSCRings::e, end, fillShapeAndPlacement(), GeomDet::geographicalId(), insert_id(), m_fwGeometry, m_geomRecord, DetId::Muon, StripTopology::nstrips(), StripTopology::pitch(), DetId::rawId(), RPCGeometry::rolls(), RPCRoll::specificTopology(), and StripTopology::stripLength().

Referenced by produce().

242 {
243  //
244  // RPC rolls geometry
245  //
246  DetId detId( DetId::Muon, 3 );
247  const RPCGeometry* rpcGeom = (const RPCGeometry*) m_geomRecord->slaveGeometry( detId );
248  for( auto it = rpcGeom->rolls().begin(),
249  end = rpcGeom->rolls().end();
250  it != end; ++it )
251  {
252  const RPCRoll* roll = (*it);
253  if( roll )
254  {
255  unsigned int rawid = roll->geographicalId().rawId();
256  unsigned int current = insert_id( rawid );
257  fillShapeAndPlacement( current, roll );
258 
259  const StripTopology& topo = roll->specificTopology();
260  m_fwGeometry->idToName[current].topology[0] = topo.nstrips();
261  m_fwGeometry->idToName[current].topology[1] = topo.stripLength();
262  m_fwGeometry->idToName[current].topology[2] = topo.pitch();
263  }
264  }
265 
266 
267  try {
268  RPCDetId id(1, 1, 4, 1, 1, 1, 1 );
269  m_geomRecord->slaveGeometry( detId );
270  m_fwGeometry->extraDet.Add(new TNamed("RE4", "RPC endcap station 4"));
271  }
272  catch (std::runtime_error &e) {
273  std::cerr << e.what() << std::endl;
274  }
275 }
virtual int nstrips() const =0
std::shared_ptr< FWRecoGeometry > m_fwGeometry
const std::vector< const RPCRoll * > & rolls() const
Return a vector of all RPC rolls.
Definition: RPCGeometry.cc:67
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
const StripTopology & specificTopology() const
Definition: RPCRoll.cc:107
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
void fillShapeAndPlacement(unsigned int id, const GeomDet *det)
virtual float stripLength() const =0
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
#define end
Definition: vmac.h:37
unsigned int insert_id(unsigned int id)
Definition: DetId.h:18
virtual float pitch() const =0
void FWRecoGeometryESProducer::addTECGeometry ( void  )
private

Definition at line 495 of file FWRecoGeometryESProducer.cc.

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

Referenced by produce().

496 {
497  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTEC().begin(),
498  end = m_trackerGeom->detsTEC().end();
499  it != end; ++it )
500  {
501  const GeomDet *det = *it;
502 
503  if( det )
504  {
505  DetId detid = det->geographicalId();
506  unsigned int rawid = detid.rawId();
507  unsigned int current = insert_id( rawid );
508  fillShapeAndPlacement( current, det );
509 
510  ADD_SISTRIP_TOPOLOGY( current, m_trackerGeom->idToDet( detid ));
511  }
512  }
513 }
const TrackerGeometry * m_trackerGeom
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
void fillShapeAndPlacement(unsigned int id, const GeomDet *det)
const DetContainer & detsTEC() const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
#define end
Definition: vmac.h:37
unsigned int insert_id(unsigned int id)
Definition: DetId.h:18
#define ADD_SISTRIP_TOPOLOGY(rawid, detUnit)
const TrackerGeomDet * idToDet(DetId) const
void FWRecoGeometryESProducer::addTIBGeometry ( void  )
private

Definition at line 432 of file FWRecoGeometryESProducer.cc.

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

Referenced by produce().

433 {
434  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTIB().begin(),
435  end = m_trackerGeom->detsTIB().end();
436  it != end; ++it )
437  {
438  const GeomDet *det = *it;
439 
440  if( det )
441  {
442  DetId detid = det->geographicalId();
443  unsigned int rawid = detid.rawId();
444  unsigned int current = insert_id( rawid );
445  fillShapeAndPlacement( current, det );
446 
447  ADD_SISTRIP_TOPOLOGY( current, m_trackerGeom->idToDet( detid ));
448  }
449  }
450 }
const TrackerGeometry * m_trackerGeom
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
void fillShapeAndPlacement(unsigned int id, const GeomDet *det)
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
#define end
Definition: vmac.h:37
unsigned int insert_id(unsigned int id)
const DetContainer & detsTIB() const
Definition: DetId.h:18
#define ADD_SISTRIP_TOPOLOGY(rawid, detUnit)
const TrackerGeomDet * idToDet(DetId) const
void FWRecoGeometryESProducer::addTIDGeometry ( void  )
private

Definition at line 474 of file FWRecoGeometryESProducer.cc.

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

Referenced by produce().

475 {
476  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTID().begin(),
477  end = m_trackerGeom->detsTID().end();
478  it != end; ++it)
479  {
480  const GeomDet *det = *it;
481 
482  if( det )
483  {
484  DetId detid = det->geographicalId();
485  unsigned int rawid = detid.rawId();
486  unsigned int current = insert_id( rawid );
487  fillShapeAndPlacement( current, det );
488 
489  ADD_SISTRIP_TOPOLOGY( current, m_trackerGeom->idToDet( detid ));
490  }
491  }
492 }
const TrackerGeometry * m_trackerGeom
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
void fillShapeAndPlacement(unsigned int id, const GeomDet *det)
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
#define end
Definition: vmac.h:37
unsigned int insert_id(unsigned int id)
Definition: DetId.h:18
#define ADD_SISTRIP_TOPOLOGY(rawid, detUnit)
const DetContainer & detsTID() const
const TrackerGeomDet * idToDet(DetId) const
void FWRecoGeometryESProducer::addTOBGeometry ( void  )
private

Definition at line 453 of file FWRecoGeometryESProducer.cc.

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

Referenced by produce().

454 {
455  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTOB().begin(),
456  end = m_trackerGeom->detsTOB().end();
457  it != end; ++it )
458  {
459  const GeomDet *det = *it;
460 
461  if( det )
462  {
463  DetId detid = det->geographicalId();
464  unsigned int rawid = detid.rawId();
465  unsigned int current = insert_id( rawid );
466  fillShapeAndPlacement( current, det );
467 
468  ADD_SISTRIP_TOPOLOGY( current, m_trackerGeom->idToDet( detid ));
469  }
470  }
471 }
const TrackerGeometry * m_trackerGeom
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
void fillShapeAndPlacement(unsigned int id, const GeomDet *det)
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
#define end
Definition: vmac.h:37
unsigned int insert_id(unsigned int id)
Definition: DetId.h:18
#define ADD_SISTRIP_TOPOLOGY(rawid, detUnit)
const DetContainer & detsTOB() const
const TrackerGeomDet * idToDet(DetId) const
void FWRecoGeometryESProducer::fillPoints ( unsigned int  id,
std::vector< GlobalPoint >::const_iterator  begin,
std::vector< GlobalPoint >::const_iterator  end 
)
private

Definition at line 568 of file FWRecoGeometryESProducer.cc.

References assert(), end, i, cmsHarvester::index, and m_fwGeometry.

Referenced by addCaloGeometry(), and addFTLGeometry().

569 {
570  unsigned int index( 0 );
571  for( std::vector<GlobalPoint>::const_iterator i = begin; i != end; ++i )
572  {
573  assert( index < 23 );
574  m_fwGeometry->idToName[id].points[index] = i->x();
575  m_fwGeometry->idToName[id].points[++index] = i->y();
576  m_fwGeometry->idToName[id].points[++index] = i->z();
577  ++index;
578  }
579 }
int i
Definition: DBlmapReader.cc:9
std::shared_ptr< FWRecoGeometry > m_fwGeometry
assert(m_qm.get())
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30
void FWRecoGeometryESProducer::fillShapeAndPlacement ( unsigned int  id,
const GeomDet det 
)
private

Shape of GeomDet

Definition at line 584 of file FWRecoGeometryESProducer.cc.

References b, m_fwGeometry, GloballyPositioned< T >::position(), GloballyPositioned< T >::rotation(), GeomDet::surface(), PV3DBase< T, PVType, FrameType >::x(), TkRotation< T >::xx(), TkRotation< T >::xy(), TkRotation< T >::xz(), PV3DBase< T, PVType, FrameType >::y(), TkRotation< T >::yx(), TkRotation< T >::yy(), TkRotation< T >::yz(), PV3DBase< T, PVType, FrameType >::z(), TkRotation< T >::zx(), TkRotation< T >::zy(), and TkRotation< T >::zz().

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

585 {
586  // Trapezoidal
587  const Bounds *b = &((det->surface ()).bounds ());
588  if( const TrapezoidalPlaneBounds *b2 = dynamic_cast<const TrapezoidalPlaneBounds *> (b))
589  {
590  std::array< const float, 4 > const & par = b2->parameters ();
591 
592  // These parameters are half-lengths, as in CMSIM/GEANT3
593  m_fwGeometry->idToName[id].shape[0] = 1;
594  m_fwGeometry->idToName[id].shape[1] = par [0]; // hBottomEdge
595  m_fwGeometry->idToName[id].shape[2] = par [1]; // hTopEdge
596  m_fwGeometry->idToName[id].shape[3] = par [2]; // thickness
597  m_fwGeometry->idToName[id].shape[4] = par [3]; // apothem
598  }
599  if( const RectangularPlaneBounds *b2 = dynamic_cast<const RectangularPlaneBounds *> (b))
600  {
601  // Rectangular
602  m_fwGeometry->idToName[id].shape[0] = 2;
603  m_fwGeometry->idToName[id].shape[1] = b2->width() * 0.5; // half width
604  m_fwGeometry->idToName[id].shape[2] = b2->length() * 0.5; // half length
605  m_fwGeometry->idToName[id].shape[3] = b2->thickness() * 0.5; // half thickness
606  }
607 
608  // Position of the DetUnit's center
609  GlobalPoint pos = det->surface().position();
610  m_fwGeometry->idToName[id].translation[0] = pos.x();
611  m_fwGeometry->idToName[id].translation[1] = pos.y();
612  m_fwGeometry->idToName[id].translation[2] = pos.z();
613 
614  // Add the coeff of the rotation matrix
615  // with a projection on the basis vectors
616  TkRotation<float> detRot = det->surface().rotation();
617  m_fwGeometry->idToName[id].matrix[0] = detRot.xx();
618  m_fwGeometry->idToName[id].matrix[1] = detRot.yx();
619  m_fwGeometry->idToName[id].matrix[2] = detRot.zx();
620  m_fwGeometry->idToName[id].matrix[3] = detRot.xy();
621  m_fwGeometry->idToName[id].matrix[4] = detRot.yy();
622  m_fwGeometry->idToName[id].matrix[5] = detRot.zy();
623  m_fwGeometry->idToName[id].matrix[6] = detRot.xz();
624  m_fwGeometry->idToName[id].matrix[7] = detRot.yz();
625  m_fwGeometry->idToName[id].matrix[8] = detRot.zz();
626 }
T xx() const
std::shared_ptr< FWRecoGeometry > m_fwGeometry
T y() const
Definition: PV3DBase.h:63
T yx() const
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
T zx() const
T xy() const
T zz() const
T z() const
Definition: PV3DBase.h:64
T zy() const
T yy() const
double b
Definition: hdecay.h:120
T xz() const
const RotationType & rotation() const
Definition: Bounds.h:22
T x() const
Definition: PV3DBase.h:62
const PositionType & position() const
T yz() const
unsigned int FWRecoGeometryESProducer::insert_id ( unsigned int  id)
private
const FWRecoGeometryESProducer& FWRecoGeometryESProducer::operator= ( const FWRecoGeometryESProducer )
private
std::shared_ptr< FWRecoGeometry > FWRecoGeometryESProducer::produce ( const FWRecoGeometryRecord record)

Definition at line 90 of file FWRecoGeometryESProducer.cc.

References addCaloGeometry(), addCSCGeometry(), addDTGeometry(), addFTLGeometry(), addGEMGeometry(), addME0Geometry(), addPixelBarrelGeometry(), addPixelForwardGeometry(), addRPCGeometry(), addTECGeometry(), addTIBGeometry(), addTIDGeometry(), addTOBGeometry(), edm::eventsetup::EventSetupRecord::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), m_calo, m_caloGeom, m_current, m_ftlBarrelGeom, m_ftlEndcapGeom, m_fwGeometry, m_geomRecord, m_muon, m_timing, m_tracker, m_trackerGeom, edm::swap(), and DetId::Tracker.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

91 {
92  using namespace edm;
93 
94  m_fwGeometry = std::make_shared<FWRecoGeometry>();
95 
96  if( m_tracker || m_muon ) {
98  DetId detId( DetId::Tracker, 0 );
99  m_trackerGeom = (const TrackerGeometry*) m_geomRecord->slaveGeometry( detId );
100  }
101 
102  if( m_tracker )
103  {
106  addTIBGeometry();
107  addTIDGeometry();
108  addTOBGeometry();
109  addTECGeometry();
110  }
111  if( m_muon )
112  {
113  addDTGeometry();
114  addCSCGeometry();
115  addRPCGeometry();
116  addGEMGeometry();
117  addME0Geometry();
118  }
119  if( m_calo )
120  {
121  record.getRecord<CaloGeometryRecord>().get( m_caloGeom );
122  addCaloGeometry();
123  }
124 
125  if( m_timing ) {
126  record.getRecord<CaloGeometryRecord>().getRecord<IdealGeometryRecord>().get( "FastTimeBarrel", m_ftlBarrelGeom );
127  record.getRecord<CaloGeometryRecord>().getRecord<IdealGeometryRecord>().get( "SFBX", m_ftlEndcapGeom );
128  addFTLGeometry();
129  }
130 
131  m_fwGeometry->idToName.resize( m_current + 1 );
132  std::vector<FWRecoGeom::Info>( m_fwGeometry->idToName ).swap( m_fwGeometry->idToName );
133  std::sort( m_fwGeometry->idToName.begin(), m_fwGeometry->idToName.end());
134 
135  return m_fwGeometry;
136 }
edm::ESHandle< FastTimeGeometry > m_ftlBarrelGeom
std::shared_ptr< FWRecoGeometry > m_fwGeometry
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
const TrackerGeometry * m_trackerGeom
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:116
edm::ESHandle< FastTimeGeometry > m_ftlEndcapGeom
void get(HolderT &iHolder) const
Definition: DetId.h:18
edm::ESHandle< CaloGeometry > m_caloGeom

Member Data Documentation

bool FWRecoGeometryESProducer::m_calo
private

Definition at line 64 of file FWRecoGeometryESProducer.h.

Referenced by FWRecoGeometryESProducer(), and produce().

edm::ESHandle<CaloGeometry> FWRecoGeometryESProducer::m_caloGeom
private

Definition at line 55 of file FWRecoGeometryESProducer.h.

Referenced by addCaloGeometry(), and produce().

unsigned int FWRecoGeometryESProducer::m_current
private

Definition at line 61 of file FWRecoGeometryESProducer.h.

Referenced by insert_id(), and produce().

edm::ESHandle<FastTimeGeometry> FWRecoGeometryESProducer::m_ftlBarrelGeom
private

Definition at line 56 of file FWRecoGeometryESProducer.h.

Referenced by addFTLGeometry(), and produce().

edm::ESHandle<FastTimeGeometry> FWRecoGeometryESProducer::m_ftlEndcapGeom
private

Definition at line 56 of file FWRecoGeometryESProducer.h.

Referenced by addFTLGeometry(), and produce().

std::shared_ptr<FWRecoGeometry> FWRecoGeometryESProducer::m_fwGeometry
private
edm::ESHandle<GlobalTrackingGeometry> FWRecoGeometryESProducer::m_geomRecord
private
std::vector<edm::ESHandle<HGCalGeometry> > FWRecoGeometryESProducer::m_hgcalGeoms
private

Definition at line 57 of file FWRecoGeometryESProducer.h.

bool FWRecoGeometryESProducer::m_muon
private

Definition at line 63 of file FWRecoGeometryESProducer.h.

Referenced by FWRecoGeometryESProducer(), and produce().

bool FWRecoGeometryESProducer::m_timing
private

Definition at line 65 of file FWRecoGeometryESProducer.h.

Referenced by FWRecoGeometryESProducer(), and produce().

bool FWRecoGeometryESProducer::m_tracker
private

Definition at line 62 of file FWRecoGeometryESProducer.h.

Referenced by FWRecoGeometryESProducer(), and produce().

const TrackerGeometry* FWRecoGeometryESProducer::m_trackerGeom
private