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 &)
 
boost::shared_ptr< FWRecoGeometryproduce (const FWRecoGeometryRecord &)
 
virtual ~FWRecoGeometryESProducer (void)
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- 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 ()
 

Private Member Functions

void addCaloGeometry (void)
 
void addCSCGeometry (void)
 
void addDTGeometry (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

edm::ESHandle< CaloGeometrym_caloGeom
 
unsigned int m_current
 
boost::shared_ptr< FWRecoGeometrym_fwGeometry
 
edm::ESHandle
< GlobalTrackingGeometry
m_geomRecord
 
std::vector< edm::ESHandle
< HGCalGeometry > > 
m_hgcalGeoms
 
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::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_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 23 of file FWRecoGeometryESProducer.h.

Constructor & Destructor Documentation

FWRecoGeometryESProducer::FWRecoGeometryESProducer ( const edm::ParameterSet )

Definition at line 74 of file FWRecoGeometryESProducer.cc.

References edm::ESProducer::setWhatProduced().

75  : m_current( -1 )
76 {
77  setWhatProduced( this );
78 }
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
FWRecoGeometryESProducer::~FWRecoGeometryESProducer ( void  )
virtual

Definition at line 80 of file FWRecoGeometryESProducer.cc.

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

Member Function Documentation

void FWRecoGeometryESProducer::addCaloGeometry ( void  )
private

Definition at line 477 of file FWRecoGeometryESProducer.cc.

References end, fillPoints(), insert_id(), m_caloGeom, and m_hgcalGeoms.

Referenced by produce().

478 {
479  std::vector<DetId> vid = m_caloGeom->getValidDetIds(); // Calo
480  for( std::vector<DetId>::const_iterator it = vid.begin(),
481  end = vid.end();
482  it != end; ++it )
483  {
484  const CaloCellGeometry::CornersVec& cor( m_caloGeom->getGeometry( *it )->getCorners());
485  unsigned int id = insert_id( it->rawId());
486  fillPoints( id, cor.begin(), cor.end());
487  }
488  for( const auto& hgc : m_hgcalGeoms ) {
489  const auto& hgcprod = *hgc;
490  const auto& vid = hgcprod.getValidDetIds();
491  for( const auto& id : vid ) {
492  uint32_t intid = insert_id( id.rawId() );
493  const auto& cor = hgcprod.getCorners( id );
494  fillPoints( intid, cor.begin(), cor.end() );
495  }
496  }
497 }
#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)
std::vector< edm::ESHandle< HGCalGeometry > > m_hgcalGeoms
edm::ESHandle< CaloGeometry > m_caloGeom
void FWRecoGeometryESProducer::addCSCGeometry ( void  )
private

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

127 {
128  DetId detId( DetId::Muon, 2 );
129  const CSCGeometry* cscGeometry = (const CSCGeometry*) m_geomRecord->slaveGeometry( detId );
130  for( auto it = cscGeometry->chambers().begin(),
131  end = cscGeometry->chambers().end();
132  it != end; ++it )
133  {
134  const CSCChamber *chamber = *it;
135 
136  if( chamber )
137  {
138  unsigned int rawid = chamber->geographicalId();
139  unsigned int current = insert_id( rawid );
140  fillShapeAndPlacement( current, chamber );
141  //
142  // CSC layers geometry
143  //
144  for( std::vector< const CSCLayer* >::const_iterator lit = chamber->layers().begin(),
145  lend = chamber->layers().end();
146  lit != lend; ++lit )
147  {
148  const CSCLayer* layer = *lit;
149 
150  if( layer )
151  {
152  unsigned int rawid = layer->geographicalId();
153  unsigned int current = insert_id( rawid );
154  fillShapeAndPlacement( current, layer );
155 
156  const CSCStripTopology* stripTopology = layer->geometry()->topology();
157  m_fwGeometry->idToName[current].topology[0] = stripTopology->yAxisOrientation();
158  m_fwGeometry->idToName[current].topology[1] = stripTopology->centreToIntersection();
159  m_fwGeometry->idToName[current].topology[2] = stripTopology->yCentreOfStripPlane();
160  m_fwGeometry->idToName[current].topology[3] = stripTopology->phiOfOneEdge();
161  m_fwGeometry->idToName[current].topology[4] = stripTopology->stripOffset();
162  m_fwGeometry->idToName[current].topology[5] = stripTopology->angularWidth();
163 
164  const CSCWireTopology* wireTopology = layer->geometry()->wireTopology();
165  m_fwGeometry->idToName[current].topology[6] = wireTopology->wireSpacing();
166  m_fwGeometry->idToName[current].topology[7] = wireTopology->wireAngle();
167  }
168  }
169  }
170  }
171 }
const std::vector< const CSCLayer * > & layers() const
Return all layers.
Definition: CSCChamber.h:57
const CSCWireTopology * wireTopology() const
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
const ChamberContainer & chambers() const
Return a vector of all chambers.
Definition: CSCGeometry.cc:106
double wireSpacing() const
boost::shared_ptr< FWRecoGeometry > m_fwGeometry
void fillShapeAndPlacement(unsigned int id, const GeomDet *det)
float wireAngle() const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:77
#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 174 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().

175 {
176  DetId detId( DetId::Muon, 1 );
177  const DTGeometry* dtGeometry = (const DTGeometry*) m_geomRecord->slaveGeometry( detId );
178 
179  //
180  // DT chambers geometry
181  //
182  for( auto it = dtGeometry->chambers().begin(),
183  end = dtGeometry->chambers().end();
184  it != end; ++it )
185  {
186  const DTChamber *chamber = *it;
187 
188  if( chamber )
189  {
190  unsigned int rawid = chamber->geographicalId().rawId();
191  unsigned int current = insert_id( rawid );
192  fillShapeAndPlacement( current, chamber );
193  }
194  }
195 
196  // Fill in DT layer parameters
197  for( auto it = dtGeometry->layers().begin(),
198  end = dtGeometry->layers().end();
199  it != end; ++it )
200  {
201  const DTLayer* layer = *it;
202 
203  if( layer )
204  {
205  unsigned int rawid = layer->id().rawId();
206  unsigned int current = insert_id( rawid );
207  fillShapeAndPlacement( current, layer );
208 
209  const DTTopology& topo = layer->specificTopology();
210  const BoundPlane& surf = layer->surface();
211  // Topology W/H/L:
212  m_fwGeometry->idToName[current].topology[0] = topo.cellWidth();
213  m_fwGeometry->idToName[current].topology[1] = topo.cellHeight();
214  m_fwGeometry->idToName[current].topology[2] = topo.cellLenght();
215  m_fwGeometry->idToName[current].topology[3] = topo.firstChannel();
216  m_fwGeometry->idToName[current].topology[4] = topo.lastChannel();
217  m_fwGeometry->idToName[current].topology[5] = topo.channels();
218 
219  // Bounds W/H/L:
220  m_fwGeometry->idToName[current].topology[6] = surf.bounds().width();
221  m_fwGeometry->idToName[current].topology[7] = surf.bounds().thickness();
222  m_fwGeometry->idToName[current].topology[8] = surf.bounds().length();
223  }
224  }
225 }
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:85
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:40
boost::shared_ptr< FWRecoGeometry > m_fwGeometry
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:77
#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::addGEMGeometry ( void  )
private

Definition at line 263 of file FWRecoGeometryESProducer.cc.

References GEMGeometry::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().

264 {
265  //
266  // GEM geometry
267  //
268  DetId detId( DetId::Muon, 4 );
269 
270  try
271  {
272  const GEMGeometry* gemGeom = (const GEMGeometry*) m_geomRecord->slaveGeometry( detId );
273  for(auto roll : gemGeom->etaPartitions())
274  {
275  if( roll )
276  {
277  unsigned int rawid = roll->geographicalId().rawId();
278  unsigned int current = insert_id( rawid );
279  fillShapeAndPlacement( current, roll );
280 
281  const StripTopology& topo = roll->specificTopology();
282  m_fwGeometry->idToName[current].topology[0] = topo.nstrips();
283  m_fwGeometry->idToName[current].topology[1] = topo.stripLength();
284  m_fwGeometry->idToName[current].topology[2] = topo.pitch();
285 
286  float height = topo.stripLength()/2;
287  LocalPoint lTop( 0., height, 0.);
288  LocalPoint lBottom( 0., -height, 0.);
289  m_fwGeometry->idToName[current].topology[3] = roll->localPitch(lTop);
290  m_fwGeometry->idToName[current].topology[4] = roll->localPitch(lBottom);
291  m_fwGeometry->idToName[current].topology[5] = roll->npads();
292  }
293  }
294 
295  m_fwGeometry->extraDet.Add(new TNamed("GEM", "GEM muon detector"));
296  try {
297  GEMDetId id(1, 1, 2, 1, 1, 1 );
298  m_geomRecord->slaveGeometry( detId );
299  m_fwGeometry->extraDet.Add(new TNamed("GE2", "GEM endcap station 2"));
300  }
301  catch (...) {}
302 
303  }
304  catch( cms::Exception &exception )
305  {
306  edm::LogInfo("FWRecoGeometry") << "failed to produce GEM geometry " << exception.what() << std::endl;
307  }
308 }
virtual char const * what() const
Definition: Exception.cc:141
virtual int nstrips() const =0
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
boost::shared_ptr< FWRecoGeometry > m_fwGeometry
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)
Definition: DetId.h:18
virtual float pitch() const =0
void FWRecoGeometryESProducer::addME0Geometry ( void  )
private

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

312 {
313  //
314  // ME0 geometry
315  //
316 
317  DetId detId( DetId::Muon, 5 );
318  try
319  {
320  const ME0Geometry* me0Geom = (const ME0Geometry*) m_geomRecord->slaveGeometry( detId );
321  for(auto roll : me0Geom->etaPartitions())
322  {
323  if( roll )
324  {
325  unsigned int rawid = roll->geographicalId().rawId();
326  unsigned int current = insert_id( rawid );
327  fillShapeAndPlacement( current, roll );
328 
329  const StripTopology& topo = roll->specificTopology();
330  m_fwGeometry->idToName[current].topology[0] = topo.nstrips();
331  m_fwGeometry->idToName[current].topology[1] = topo.stripLength();
332  m_fwGeometry->idToName[current].topology[2] = topo.pitch();
333 
334  float height = topo.stripLength()/2;
335  LocalPoint lTop( 0., height, 0.);
336  LocalPoint lBottom( 0., -height, 0.);
337  m_fwGeometry->idToName[current].topology[3] = roll->localPitch(lTop);
338  m_fwGeometry->idToName[current].topology[4] = roll->localPitch(lBottom);
339  m_fwGeometry->idToName[current].topology[5] = roll->npads();
340  }
341  }
342  m_fwGeometry->extraDet.Add(new TNamed("ME0", "ME0 muon detector"));
343  }
344  catch( cms::Exception &exception )
345  {
346  edm::LogInfo("FWRecoGeometry") << "failed to produce ME0 geometry " << exception.what() << std::endl;
347  }
348 }
virtual char const * what() const
Definition: Exception.cc:141
virtual int nstrips() const =0
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
boost::shared_ptr< FWRecoGeometry > m_fwGeometry
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:57
Definition: DetId.h:18
virtual float pitch() const =0
void FWRecoGeometryESProducer::addPixelBarrelGeometry ( void  )
private

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

352 {
353  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsPXB().begin(),
354  end = m_trackerGeom->detsPXB().end();
355  it != end; ++it)
356  {
357  const GeomDet *det = *it;
358 
359  if( det )
360  {
361  DetId detid = det->geographicalId();
362  unsigned int rawid = detid.rawId();
363  unsigned int current = insert_id( rawid );
364  fillShapeAndPlacement( current, det );
365 
366  ADD_PIXEL_TOPOLOGY( current, m_trackerGeom->idToDetUnit( detid ));
367  }
368  }
369 }
virtual 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:77
#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 372 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().

373 {
374  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsPXF().begin(),
375  end = m_trackerGeom->detsPXF().end();
376  it != end; ++it )
377  {
378  const GeomDet *det = *it;
379 
380  if( det )
381  {
382  DetId detid = det->geographicalId();
383  unsigned int rawid = detid.rawId();
384  unsigned int current = insert_id( rawid );
385  fillShapeAndPlacement( current, det );
386 
387  ADD_PIXEL_TOPOLOGY( current, m_trackerGeom->idToDetUnit( detid ));
388  }
389  }
390 }
virtual 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:77
#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 228 of file FWRecoGeometryESProducer.cc.

References 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().

229 {
230  //
231  // RPC rolls geometry
232  //
233  DetId detId( DetId::Muon, 3 );
234  const RPCGeometry* rpcGeom = (const RPCGeometry*) m_geomRecord->slaveGeometry( detId );
235  for( auto it = rpcGeom->rolls().begin(),
236  end = rpcGeom->rolls().end();
237  it != end; ++it )
238  {
239  const RPCRoll* roll = (*it);
240  if( roll )
241  {
242  unsigned int rawid = roll->geographicalId().rawId();
243  unsigned int current = insert_id( rawid );
244  fillShapeAndPlacement( current, roll );
245 
246  const StripTopology& topo = roll->specificTopology();
247  m_fwGeometry->idToName[current].topology[0] = topo.nstrips();
248  m_fwGeometry->idToName[current].topology[1] = topo.stripLength();
249  m_fwGeometry->idToName[current].topology[2] = topo.pitch();
250  }
251  }
252 
253 
254  try {
255  RPCDetId id(1, 1, 4, 1, 1, 1, 1 );
256  m_geomRecord->slaveGeometry( detId );
257  m_fwGeometry->extraDet.Add(new TNamed("RE4", "RPC endcap station 4"));
258  }
259  catch (...) {}
260 }
virtual int nstrips() const =0
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
boost::shared_ptr< FWRecoGeometry > m_fwGeometry
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:77
#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 456 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().

457 {
458  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTEC().begin(),
459  end = m_trackerGeom->detsTEC().end();
460  it != end; ++it )
461  {
462  const GeomDet *det = *it;
463 
464  if( det )
465  {
466  DetId detid = det->geographicalId();
467  unsigned int rawid = detid.rawId();
468  unsigned int current = insert_id( rawid );
469  fillShapeAndPlacement( current, det );
470 
471  ADD_SISTRIP_TOPOLOGY( current, m_trackerGeom->idToDet( detid ));
472  }
473  }
474 }
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:77
#define end
Definition: vmac.h:37
unsigned int insert_id(unsigned int id)
Definition: DetId.h:18
#define ADD_SISTRIP_TOPOLOGY(rawid, detUnit)
virtual const TrackerGeomDet * idToDet(DetId) const
void FWRecoGeometryESProducer::addTIBGeometry ( void  )
private

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

394 {
395  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTIB().begin(),
396  end = m_trackerGeom->detsTIB().end();
397  it != end; ++it )
398  {
399  const GeomDet *det = *it;
400 
401  if( det )
402  {
403  DetId detid = det->geographicalId();
404  unsigned int rawid = detid.rawId();
405  unsigned int current = insert_id( rawid );
406  fillShapeAndPlacement( current, det );
407 
408  ADD_SISTRIP_TOPOLOGY( current, m_trackerGeom->idToDet( detid ));
409  }
410  }
411 }
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:77
#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)
virtual const TrackerGeomDet * idToDet(DetId) const
void FWRecoGeometryESProducer::addTIDGeometry ( void  )
private

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

436 {
437  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTID().begin(),
438  end = m_trackerGeom->detsTID().end();
439  it != end; ++it)
440  {
441  const GeomDet *det = *it;
442 
443  if( det )
444  {
445  DetId detid = det->geographicalId();
446  unsigned int rawid = detid.rawId();
447  unsigned int current = insert_id( rawid );
448  fillShapeAndPlacement( current, det );
449 
450  ADD_SISTRIP_TOPOLOGY( current, m_trackerGeom->idToDet( detid ));
451  }
452  }
453 }
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:77
#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
virtual const TrackerGeomDet * idToDet(DetId) const
void FWRecoGeometryESProducer::addTOBGeometry ( void  )
private

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

415 {
416  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTOB().begin(),
417  end = m_trackerGeom->detsTOB().end();
418  it != end; ++it )
419  {
420  const GeomDet *det = *it;
421 
422  if( det )
423  {
424  DetId detid = det->geographicalId();
425  unsigned int rawid = detid.rawId();
426  unsigned int current = insert_id( rawid );
427  fillShapeAndPlacement( current, det );
428 
429  ADD_SISTRIP_TOPOLOGY( current, m_trackerGeom->idToDet( detid ));
430  }
431  }
432 }
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:77
#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
virtual 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 510 of file FWRecoGeometryESProducer.cc.

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

Referenced by addCaloGeometry().

511 {
512  unsigned int index( 0 );
513  for( std::vector<GlobalPoint>::const_iterator i = begin; i != end; ++i )
514  {
515  assert( index < 23 );
516  m_fwGeometry->idToName[id].points[index] = i->x();
517  m_fwGeometry->idToName[id].points[++index] = i->y();
518  m_fwGeometry->idToName[id].points[++index] = i->z();
519  ++index;
520  }
521 }
int i
Definition: DBlmapReader.cc:9
assert(m_qm.get())
boost::shared_ptr< FWRecoGeometry > m_fwGeometry
#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 526 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().

527 {
528  // Trapezoidal
529  const Bounds *b = &((det->surface ()).bounds ());
530  if( const TrapezoidalPlaneBounds *b2 = dynamic_cast<const TrapezoidalPlaneBounds *> (b))
531  {
532  std::array< const float, 4 > const & par = b2->parameters ();
533 
534  // These parameters are half-lengths, as in CMSIM/GEANT3
535  m_fwGeometry->idToName[id].shape[0] = 1;
536  m_fwGeometry->idToName[id].shape[1] = par [0]; // hBottomEdge
537  m_fwGeometry->idToName[id].shape[2] = par [1]; // hTopEdge
538  m_fwGeometry->idToName[id].shape[3] = par [2]; // thickness
539  m_fwGeometry->idToName[id].shape[4] = par [3]; // apothem
540  }
541  if( const RectangularPlaneBounds *b2 = dynamic_cast<const RectangularPlaneBounds *> (b))
542  {
543  // Rectangular
544  m_fwGeometry->idToName[id].shape[0] = 2;
545  m_fwGeometry->idToName[id].shape[1] = b2->width() * 0.5; // half width
546  m_fwGeometry->idToName[id].shape[2] = b2->length() * 0.5; // half length
547  m_fwGeometry->idToName[id].shape[3] = b2->thickness() * 0.5; // half thickness
548  }
549 
550  // Position of the DetUnit's center
551  GlobalPoint pos = det->surface().position();
552  m_fwGeometry->idToName[id].translation[0] = pos.x();
553  m_fwGeometry->idToName[id].translation[1] = pos.y();
554  m_fwGeometry->idToName[id].translation[2] = pos.z();
555 
556  // Add the coeff of the rotation matrix
557  // with a projection on the basis vectors
558  TkRotation<float> detRot = det->surface().rotation();
559  m_fwGeometry->idToName[id].matrix[0] = detRot.xx();
560  m_fwGeometry->idToName[id].matrix[1] = detRot.yx();
561  m_fwGeometry->idToName[id].matrix[2] = detRot.zx();
562  m_fwGeometry->idToName[id].matrix[3] = detRot.xy();
563  m_fwGeometry->idToName[id].matrix[4] = detRot.yy();
564  m_fwGeometry->idToName[id].matrix[5] = detRot.zy();
565  m_fwGeometry->idToName[id].matrix[6] = detRot.xz();
566  m_fwGeometry->idToName[id].matrix[7] = detRot.yz();
567  m_fwGeometry->idToName[id].matrix[8] = detRot.zz();
568 }
T xx() const
T y() const
Definition: PV3DBase.h:63
T yx() const
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
boost::shared_ptr< FWRecoGeometry > m_fwGeometry
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
boost::shared_ptr< FWRecoGeometry > FWRecoGeometryESProducer::produce ( const FWRecoGeometryRecord record)

Definition at line 84 of file FWRecoGeometryESProducer.cc.

References addCaloGeometry(), addCSCGeometry(), addDTGeometry(), addGEMGeometry(), addME0Geometry(), addPixelBarrelGeometry(), addPixelForwardGeometry(), addRPCGeometry(), addTECGeometry(), addTIBGeometry(), addTIDGeometry(), addTOBGeometry(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), m_caloGeom, m_current, m_fwGeometry, m_geomRecord, m_hgcalGeoms, m_trackerGeom, mergeVDriftHistosByStation::name, swap(), FrontierCondition_GT_autoExpress_cfi::test, and DetId::Tracker.

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

85 {
86  using namespace edm;
87 
88  m_fwGeometry = boost::shared_ptr<FWRecoGeometry>( new FWRecoGeometry );
89 
91 
92  DetId detId( DetId::Tracker, 0 );
93  m_trackerGeom = (const TrackerGeometry*) m_geomRecord->slaveGeometry( detId );
94 
95  record.getRecord<CaloGeometryRecord>().get( m_caloGeom );
97  for( const auto& name : hgcal_geom_names ) {
98  const auto& calogr = record.getRecord<CaloGeometryRecord>();
99  calogr.getRecord<IdealGeometryRecord>().get( name , test );
100  if( test.isValid() ) {
101  m_hgcalGeoms.push_back(test);
102  }
103  }
104 
107  addTIBGeometry();
108  addTIDGeometry();
109  addTOBGeometry();
110  addTECGeometry();
111  addDTGeometry();
112  addCSCGeometry();
113  addRPCGeometry();
114  addGEMGeometry();
115  addME0Geometry();
116  addCaloGeometry();
117 
118  m_fwGeometry->idToName.resize( m_current + 1 );
119  std::vector<FWRecoGeom::Info>( m_fwGeometry->idToName ).swap( m_fwGeometry->idToName );
120  std::sort( m_fwGeometry->idToName.begin(), m_fwGeometry->idToName.end());
121 
122  return m_fwGeometry;
123 }
void swap(ora::Record &rh, ora::Record &lh)
Definition: Record.h:70
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
const TrackerGeometry * m_trackerGeom
boost::shared_ptr< FWRecoGeometry > m_fwGeometry
Definition: DetId.h:18
std::vector< edm::ESHandle< HGCalGeometry > > m_hgcalGeoms
edm::ESHandle< CaloGeometry > m_caloGeom

Member Data Documentation

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

Definition at line 53 of file FWRecoGeometryESProducer.h.

Referenced by addCaloGeometry(), and produce().

unsigned int FWRecoGeometryESProducer::m_current
private

Definition at line 58 of file FWRecoGeometryESProducer.h.

Referenced by insert_id(), and produce().

boost::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 54 of file FWRecoGeometryESProducer.h.

Referenced by addCaloGeometry(), and produce().

const TrackerGeometry* FWRecoGeometryESProducer::m_trackerGeom
private