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
FWTGeoRecoGeometryESProducer Class Reference

#include <FWTGeoRecoGeometryESProducer.h>

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

Public Member Functions

 FWTGeoRecoGeometryESProducer (const edm::ParameterSet &)
 
boost::shared_ptr
< FWTGeoRecoGeometry
produce (const FWTGeoRecoGeometryRecord &)
 
virtual ~FWTGeoRecoGeometryESProducer (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 (TGeoVolume *top, const std::string &name="CSC", int copy=1)
 
void addDTGeometry (TGeoVolume *top, const std::string &name="DT", int copy=1)
 
void addPixelBarrelGeometry (TGeoVolume *top, const std::string &name="PixelBarrel", int copy=1)
 
void addPixelForwardGeometry (TGeoVolume *top, const std::string &name="PixelForward", int copy=1)
 
void addRPCGeometry (TGeoVolume *top, const std::string &name="RPC", int copy=1)
 
void addTECGeometry (TGeoVolume *top, const std::string &name="TEC", int copy=1)
 
void addTIBGeometry (TGeoVolume *top, const std::string &name="TIB", int copy=1)
 
void addTIDGeometry (TGeoVolume *top, const std::string &name="TID", int copy=1)
 
void addTOBGeometry (TGeoVolume *top, const std::string &name="TOB", int copy=1)
 
TGeoManager * createManager (int level)
 
TGeoMaterial * createMaterial (const std::string &name)
 
TGeoShape * createShape (const GeomDet *det)
 
TGeoVolume * createVolume (const std::string &name, const GeomDet *det, const std::string &matname="Air")
 
 FWTGeoRecoGeometryESProducer (const FWTGeoRecoGeometryESProducer &)
 
const
FWTGeoRecoGeometryESProducer
operator= (const FWTGeoRecoGeometryESProducer &)
 
const std::string path (TGeoVolume *top, const std::string &name, int copy)
 

Private Attributes

edm::ESHandle< CaloGeometrym_caloGeom
 
boost::shared_ptr
< FWTGeoRecoGeometry
m_fwGeometry
 
edm::ESHandle
< GlobalTrackingGeometry
m_geomRecord
 
std::map< std::string,
TGeoMaterial * > 
m_nameToMaterial
 
std::map< std::string,
TGeoMedium * > 
m_nameToMedium
 
std::map< std::string,
TGeoShape * > 
m_nameToShape
 
std::map< std::string,
TGeoVolume * > 
m_nameToVolume
 
const TrackerGeometrym_trackerGeom
 

Additional Inherited Members

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair
< DataKey, boost::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 28 of file FWTGeoRecoGeometryESProducer.h.

Constructor & Destructor Documentation

FWTGeoRecoGeometryESProducer::FWTGeoRecoGeometryESProducer ( const edm::ParameterSet )

Definition at line 64 of file FWTGeoRecoGeometryESProducer.cc.

References edm::ESProducer::setWhatProduced().

65 {
66  setWhatProduced( this );
67 }
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
FWTGeoRecoGeometryESProducer::~FWTGeoRecoGeometryESProducer ( void  )
virtual

Definition at line 69 of file FWTGeoRecoGeometryESProducer.cc.

70 {}
FWTGeoRecoGeometryESProducer::FWTGeoRecoGeometryESProducer ( const FWTGeoRecoGeometryESProducer )
private

Member Function Documentation

void FWTGeoRecoGeometryESProducer::addCaloGeometry ( void  )
private

Definition at line 657 of file FWTGeoRecoGeometryESProducer.cc.

References end, m_caloGeom, and m_fwGeometry.

Referenced by produce().

658 {
659  std::vector<DetId> vid = m_caloGeom->getValidDetIds(); // Calo
660  for( std::vector<DetId>::const_iterator it = vid.begin(),
661  end = vid.end();
662  it != end; ++it )
663  {
664  const CaloCellGeometry::CornersVec& cor( m_caloGeom->getGeometry( *it )->getCorners());
665  m_fwGeometry->idToName[ it->rawId()].fillPoints( cor.begin(), cor.end());
666  }
667 }
edm::ESHandle< CaloGeometry > m_caloGeom
#define end
Definition: vmac.h:38
boost::shared_ptr< FWTGeoRecoGeometry > m_fwGeometry
void FWTGeoRecoGeometryESProducer::addCSCGeometry ( TGeoVolume *  top,
const std::string &  name = "CSC",
int  copy = 1 
)
private

Definition at line 291 of file FWTGeoRecoGeometryESProducer.cc.

References CSCRadialStripTopology::angularWidth(), CSCRadialStripTopology::centreToIntersection(), filterCSVwithJSON::copy, createVolume(), CSCDetId, m_fwGeometry, m_geomRecord, mergeVDriftHistosByStation::name, AlCaHLTBitMon_ParallelJobs::p, path(), CSCRadialStripTopology::phiOfOneEdge(), alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, OffsetRadialStripTopology::stripOffset(), CSCWireTopology::wireAngle(), CSCWireTopology::wireSpacing(), CSCRadialStripTopology::yAxisOrientation(), and CSCRadialStripTopology::yCentreOfStripPlane().

Referenced by produce().

292 {
293  TGeoVolume *assembly = new TGeoVolumeAssembly( iName.c_str());
294  if(! m_geomRecord->slaveGeometry( CSCDetId()))
295  throw cms::Exception( "FatalError" ) << "Cannnot find CSCGeometry\n";
296 
297  const std::vector<GeomDet*>& cscGeom = m_geomRecord->slaveGeometry( CSCDetId())->dets();
298  for( std::vector<GeomDet*>::const_iterator it = cscGeom.begin(), itEnd = cscGeom.end(); it != itEnd; ++it )
299  {
300  if( CSCChamber* chamber = dynamic_cast<CSCChamber*>(*it))
301  {
302  unsigned int rawid = chamber->geographicalId();
303  std::stringstream s;
304  s << rawid;
305  std::string name = s.str();
306 
307  TGeoVolume* child = createVolume( name, chamber );
308  assembly->AddNode( child, copy, createPlacement( chamber ));
309  child->SetLineColor( kBlue );
310 
311  std::stringstream p;
312  p << path( top, iName, copy ) << "/" << name << "_" << copy;
313  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
314  }
315  else if( CSCLayer* layer = dynamic_cast<CSCLayer*>(*it))
316  {
317  unsigned int rawid = layer->geographicalId();
318  std::stringstream s;
319  s << rawid;
320  std::string name = s.str();
321 
322  TGeoVolume* child = createVolume( name, layer );
323  assembly->AddNode( child, copy, createPlacement( layer ));
324  child->SetLineColor( kBlue );
325 
326  std::stringstream p;
327  p << path( top, iName, copy ) << "/" << name << "_" << copy;
328  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
329 
330  const CSCStripTopology* stripTopology = layer->geometry()->topology();
331  m_fwGeometry->idToName[rawid].topology[0] = stripTopology->yAxisOrientation();
332  m_fwGeometry->idToName[rawid].topology[1] = stripTopology->centreToIntersection();
333  m_fwGeometry->idToName[rawid].topology[2] = stripTopology->yCentreOfStripPlane();
334  m_fwGeometry->idToName[rawid].topology[3] = stripTopology->phiOfOneEdge();
335  m_fwGeometry->idToName[rawid].topology[4] = stripTopology->stripOffset();
336  m_fwGeometry->idToName[rawid].topology[5] = stripTopology->angularWidth();
337 
338  const CSCWireTopology* wireTopology = layer->geometry()->wireTopology();
339  m_fwGeometry->idToName[rawid].topology[6] = wireTopology->wireSpacing();
340  m_fwGeometry->idToName[rawid].topology[7] = wireTopology->wireAngle();
341  }
342  }
343 
344  top->AddNode( assembly, copy );
345 }
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
TGeoVolume * createVolume(const std::string &name, const GeomDet *det, const std::string &matname="Air")
double wireSpacing() const
float wireAngle() const
virtual float stripOffset(void) const
boost::shared_ptr< FWTGeoRecoGeometry > m_fwGeometry
const std::string path(TGeoVolume *top, const std::string &name, int copy)
void FWTGeoRecoGeometryESProducer::addDTGeometry ( TGeoVolume *  top,
const std::string &  name = "DT",
int  copy = 1 
)
private

Definition at line 348 of file FWTGeoRecoGeometryESProducer.cc.

References DTTopology::cellHeight(), DTTopology::cellLenght(), DTTopology::cellWidth(), DTTopology::channels(), filterCSVwithJSON::copy, createVolume(), DTChamberId, DTLayerId, DTSuperLayerId, end, DTTopology::firstChannel(), DTTopology::lastChannel(), m_fwGeometry, m_geomRecord, mergeVDriftHistosByStation::name, AlCaHLTBitMon_ParallelJobs::p, path(), alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produce().

349 {
350  //
351  // DT chambers geometry
352  //
353  TGeoVolume *assembly = new TGeoVolumeAssembly( iName.c_str());
354  const std::vector<GeomDet*>& dtChamberGeom = m_geomRecord->slaveGeometry( DTChamberId())->dets();
355  for( std::vector<GeomDet*>::const_iterator it = dtChamberGeom.begin(),
356  end = dtChamberGeom.end();
357  it != end; ++it )
358  {
359  if( DTChamber* chamber = dynamic_cast< DTChamber *>(*it))
360  {
361  unsigned int rawid = chamber->geographicalId().rawId();
362  std::stringstream s;
363  s << rawid;
364  std::string name = s.str();
365 
366  TGeoVolume* child = createVolume( name, chamber );
367  assembly->AddNode( child, copy, createPlacement( chamber ));
368  child->SetLineColor( kRed );
369 
370  std::stringstream p;
371  p << path( top, iName, copy ) << "/" << name << "_" << copy;
372  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
373  }
374  }
375  top->AddNode( assembly, copy );
376 
377  // Fill in DT super layer parameters
378  const std::vector<GeomDet*>& dtSuperLayerGeom = m_geomRecord->slaveGeometry( DTLayerId())->dets();
379  for( std::vector<GeomDet*>::const_iterator it = dtSuperLayerGeom.begin(),
380  end = dtSuperLayerGeom.end();
381  it != end; ++it )
382  {
383  if( DTSuperLayer* superlayer = dynamic_cast<DTSuperLayer*>(*it))
384  {
385  unsigned int rawid = superlayer->id().rawId();
386  std::stringstream s;
387  s << rawid;
388  std::string name = s.str();
389 
390  TGeoVolume* child = createVolume( name, superlayer );
391  assembly->AddNode( child, copy, createPlacement( superlayer ));
392  child->SetLineColor( kBlue );
393 
394  std::stringstream p;
395  p << path( top, iName, copy ) << "/" << name << "_" << copy;
396  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
397 
398  const BoundPlane& surf = superlayer->surface();
399  // Bounds W/H/L:
400  m_fwGeometry->idToName[rawid].topology[0] = surf.bounds().width();
401  m_fwGeometry->idToName[rawid].topology[1] = surf.bounds().thickness();
402  m_fwGeometry->idToName[rawid].topology[2] = surf.bounds().length();
403  }
404  }
405 
406  // Fill in DT layer parameters
407  const std::vector<GeomDet*>& dtLayerGeom = m_geomRecord->slaveGeometry( DTSuperLayerId())->dets();
408  for( std::vector<GeomDet*>::const_iterator it = dtLayerGeom.begin(),
409  end = dtLayerGeom.end();
410  it != end; ++it )
411  {
412  if( DTLayer* layer = dynamic_cast<DTLayer*>(*it))
413  {
414  unsigned int rawid = layer->id().rawId();
415  std::stringstream s;
416  s << rawid;
417  std::string name = s.str();
418 
419  TGeoVolume* child = createVolume( name, layer );
420  assembly->AddNode( child, copy, createPlacement( layer ));
421  child->SetLineColor( kBlue );
422 
423  std::stringstream p;
424  p << path( top, iName, copy ) << "/" << name << "_" << copy;
425  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
426 
427  const DTTopology& topo = layer->specificTopology();
428  const BoundPlane& surf = layer->surface();
429  // Topology W/H/L:
430  m_fwGeometry->idToName[rawid].topology[0] = topo.cellWidth();
431  m_fwGeometry->idToName[rawid].topology[1] = topo.cellHeight();
432  m_fwGeometry->idToName[rawid].topology[2] = topo.cellLenght();
433  m_fwGeometry->idToName[rawid].topology[3] = topo.firstChannel();
434  m_fwGeometry->idToName[rawid].topology[4] = topo.lastChannel();
435  m_fwGeometry->idToName[rawid].topology[5] = topo.channels();
436 
437  // Bounds W/H/L:
438  m_fwGeometry->idToName[rawid].topology[6] = surf.bounds().width();
439  m_fwGeometry->idToName[rawid].topology[7] = surf.bounds().thickness();
440  m_fwGeometry->idToName[rawid].topology[8] = surf.bounds().length();
441  }
442  }
443 }
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
DTSuperLayerId
float cellWidth() const
Returns the cell width.
Definition: DTTopology.h:70
TGeoVolume * createVolume(const std::string &name, const GeomDet *det, const std::string &matname="Air")
int firstChannel() const
Returns the wire number of the first wire.
Definition: DTTopology.h:80
int lastChannel() const
Returns the wire number of the last wire.
Definition: DTTopology.h:82
#define end
Definition: vmac.h:38
float cellHeight() const
Returns the cell height.
Definition: DTTopology.h:72
int channels() const
Returns the number of wires in the layer.
Definition: DTTopology.h:77
boost::shared_ptr< FWTGeoRecoGeometry > m_fwGeometry
float cellLenght() const
Definition: DTTopology.h:75
const std::string path(TGeoVolume *top, const std::string &name, int copy)
void FWTGeoRecoGeometryESProducer::addPixelBarrelGeometry ( TGeoVolume *  top,
const std::string &  name = "PixelBarrel",
int  copy = 1 
)
private

Definition at line 484 of file FWTGeoRecoGeometryESProducer.cc.

References ADD_PIXEL_TOPOLOGY, filterCSVwithJSON::copy, createVolume(), cond::rpcobgas::detid, TrackerGeometry::detsPXB(), end, TrackerGeometry::idToDetUnit(), m_fwGeometry, m_trackerGeom, mergeVDriftHistosByStation::name, AlCaHLTBitMon_ParallelJobs::p, path(), DetId::rawId(), alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produce().

485 {
486  TGeoVolume *assembly = new TGeoVolumeAssembly( iName.c_str());
487  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsPXB().begin(),
488  end = m_trackerGeom->detsPXB().end();
489  it != end; ++it)
490  {
491  DetId detid = ( *it )->geographicalId();
492  unsigned int rawid = detid.rawId();
493 
494  std::stringstream s;
495  s << rawid;
496  std::string name = s.str();
497 
498  TGeoVolume* child = createVolume( name, *it );
499  assembly->AddNode( child, copy, createPlacement( *it ));
500  child->SetLineColor( kGreen );
501 
502  std::stringstream p;
503  p << path( top, iName, copy ) << "/" << name << "_" << copy;
504  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
505 
506  ADD_PIXEL_TOPOLOGY( rawid, m_trackerGeom->idToDetUnit( detid ));
507  }
508 
509  top->AddNode( assembly, copy );
510 }
TGeoVolume * createVolume(const std::string &name, const GeomDet *det, const std::string &matname="Air")
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
const DetContainer & detsPXB() const
#define end
Definition: vmac.h:38
Definition: DetId.h:20
#define ADD_PIXEL_TOPOLOGY(rawid, detUnit)
boost::shared_ptr< FWTGeoRecoGeometry > m_fwGeometry
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
const std::string path(TGeoVolume *top, const std::string &name, int copy)
void FWTGeoRecoGeometryESProducer::addPixelForwardGeometry ( TGeoVolume *  top,
const std::string &  name = "PixelForward",
int  copy = 1 
)
private

Definition at line 513 of file FWTGeoRecoGeometryESProducer.cc.

References ADD_PIXEL_TOPOLOGY, filterCSVwithJSON::copy, createVolume(), cond::rpcobgas::detid, TrackerGeometry::detsPXF(), end, TrackerGeometry::idToDetUnit(), m_fwGeometry, m_trackerGeom, mergeVDriftHistosByStation::name, AlCaHLTBitMon_ParallelJobs::p, path(), DetId::rawId(), alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produce().

514 {
515  TGeoVolume *assembly = new TGeoVolumeAssembly( iName.c_str());
516  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsPXF().begin(),
517  end = m_trackerGeom->detsPXF().end();
518  it != end; ++it )
519  {
520  DetId detid = ( *it )->geographicalId();
521  unsigned int rawid = detid.rawId();
522 
523  std::stringstream s;
524  s << rawid;
525  std::string name = s.str();
526 
527  TGeoVolume* child = createVolume( name, *it );
528  assembly->AddNode( child, copy, createPlacement( *it ));
529  child->SetLineColor( kGreen );
530 
531  std::stringstream p;
532  p << path( top, iName, copy ) << "/" << name << "_" << copy;
533  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
534 
535  ADD_PIXEL_TOPOLOGY( rawid, m_trackerGeom->idToDetUnit( detid ));
536  }
537 
538  top->AddNode( assembly, copy );
539 }
TGeoVolume * createVolume(const std::string &name, const GeomDet *det, const std::string &matname="Air")
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
#define end
Definition: vmac.h:38
Definition: DetId.h:20
#define ADD_PIXEL_TOPOLOGY(rawid, detUnit)
boost::shared_ptr< FWTGeoRecoGeometry > m_fwGeometry
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
const DetContainer & detsPXF() const
const std::string path(TGeoVolume *top, const std::string &name, int copy)
void FWTGeoRecoGeometryESProducer::addRPCGeometry ( TGeoVolume *  top,
const std::string &  name = "RPC",
int  copy = 1 
)
private

Definition at line 446 of file FWTGeoRecoGeometryESProducer.cc.

References filterCSVwithJSON::copy, createVolume(), end, GeomDet::geographicalId(), m_fwGeometry, m_geomRecord, DetId::Muon, mergeVDriftHistosByStation::name, RPCRoll::nstrips(), AlCaHLTBitMon_ParallelJobs::p, path(), StripTopology::pitch(), DetId::rawId(), RPCGeometry::rolls(), alignCSCRings::s, RPCRoll::specificTopology(), AlCaHLTBitMon_QueryRunRegistry::string, and StripTopology::stripLength().

Referenced by produce().

447 {
448  //
449  // RPC chambers geometry
450  //
451  TGeoVolume *assembly = new TGeoVolumeAssembly( iName.c_str());
452  DetId detId( DetId::Muon, 3 );
453  const RPCGeometry* rpcGeom = (const RPCGeometry*) m_geomRecord->slaveGeometry( detId );
454  for( std::vector<RPCRoll *>::const_iterator it = rpcGeom->rolls().begin(),
455  end = rpcGeom->rolls().end();
456  it != end; ++it )
457  {
458  RPCRoll* roll = (*it);
459  if( roll )
460  {
461  unsigned int rawid = roll->geographicalId().rawId();
462  std::stringstream s;
463  s << rawid;
464  std::string name = s.str();
465 
466  TGeoVolume* child = createVolume( name, roll );
467  assembly->AddNode( child, copy, createPlacement( roll ));
468  child->SetLineColor( kYellow );
469 
470  std::stringstream p;
471  p << path( top, iName, copy ) << "/" << name << "_" << copy;
472  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
473 
474  const StripTopology& topo = roll->specificTopology();
475  m_fwGeometry->idToName[rawid].topology[0] = roll->nstrips();
476  m_fwGeometry->idToName[rawid].topology[1] = topo.stripLength();
477  m_fwGeometry->idToName[rawid].topology[2] = topo.pitch();
478  }
479  }
480  top->AddNode( assembly, copy );
481 }
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
int nstrips() const
Definition: RPCRoll.cc:46
TGeoVolume * createVolume(const std::string &name, const GeomDet *det, const std::string &matname="Air")
const StripTopology & specificTopology() const
Definition: RPCRoll.cc:107
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
virtual float stripLength() const =0
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:72
#define end
Definition: vmac.h:38
Definition: DetId.h:20
boost::shared_ptr< FWTGeoRecoGeometry > m_fwGeometry
virtual float pitch() const =0
const std::string path(TGeoVolume *top, const std::string &name, int copy)
const std::vector< RPCRoll * > & rolls() const
Return a vector of all RPC rolls.
Definition: RPCGeometry.cc:67
void FWTGeoRecoGeometryESProducer::addTECGeometry ( TGeoVolume *  top,
const std::string &  name = "TEC",
int  copy = 1 
)
private

Definition at line 628 of file FWTGeoRecoGeometryESProducer.cc.

References ADD_SISTRIP_TOPOLOGY, filterCSVwithJSON::copy, createVolume(), cond::rpcobgas::detid, TrackerGeometry::detsTEC(), end, TrackerGeometry::idToDet(), m_fwGeometry, m_trackerGeom, mergeVDriftHistosByStation::name, AlCaHLTBitMon_ParallelJobs::p, path(), DetId::rawId(), alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produce().

629 {
630  TGeoVolume *assembly = new TGeoVolumeAssembly( iName.c_str());
631  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTEC().begin(),
632  end = m_trackerGeom->detsTEC().end();
633  it != end; ++it )
634  {
635  DetId detid = ( *it )->geographicalId();
636  unsigned int rawid = detid.rawId();
637 
638  std::stringstream s;
639  s << rawid;
640  std::string name = s.str();
641 
642  TGeoVolume* child = createVolume( name, *it );
643  assembly->AddNode( child, copy, createPlacement( *it ));
644  child->SetLineColor( kGreen );
645 
646  std::stringstream p;
647  p << path( top, iName, copy ) << "/" << name << "_" << copy;
648  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
649 
650  ADD_SISTRIP_TOPOLOGY( rawid, m_trackerGeom->idToDet( detid ));
651  }
652 
653  top->AddNode( assembly, copy );
654 }
TGeoVolume * createVolume(const std::string &name, const GeomDet *det, const std::string &matname="Air")
#define ADD_SISTRIP_TOPOLOGY(rawid, detUnit)
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
const DetContainer & detsTEC() const
#define end
Definition: vmac.h:38
virtual const GeomDet * idToDet(DetId) const
Definition: DetId.h:20
boost::shared_ptr< FWTGeoRecoGeometry > m_fwGeometry
const std::string path(TGeoVolume *top, const std::string &name, int copy)
void FWTGeoRecoGeometryESProducer::addTIBGeometry ( TGeoVolume *  top,
const std::string &  name = "TIB",
int  copy = 1 
)
private

Definition at line 542 of file FWTGeoRecoGeometryESProducer.cc.

References ADD_SISTRIP_TOPOLOGY, filterCSVwithJSON::copy, createVolume(), cond::rpcobgas::detid, TrackerGeometry::detsTIB(), end, TrackerGeometry::idToDet(), m_fwGeometry, m_trackerGeom, mergeVDriftHistosByStation::name, AlCaHLTBitMon_ParallelJobs::p, path(), DetId::rawId(), alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produce().

543 {
544  TGeoVolume *assembly = new TGeoVolumeAssembly( iName.c_str());
545  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTIB().begin(),
546  end = m_trackerGeom->detsTIB().end();
547  it != end; ++it )
548  {
549  DetId detid = ( *it )->geographicalId();
550  unsigned int rawid = detid.rawId();
551  std::stringstream s;
552  s << rawid;
553  std::string name = s.str();
554 
555  TGeoVolume* child = createVolume( name, *it );
556  assembly->AddNode( child, copy, createPlacement( *it ));
557  child->SetLineColor( kGreen );
558 
559  std::stringstream p;
560  p << path( top, iName, copy ) << "/" << name << "_" << copy;
561  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
562 
563  ADD_SISTRIP_TOPOLOGY( rawid, m_trackerGeom->idToDet( detid ));
564  }
565 
566  top->AddNode( assembly, copy );
567 }
TGeoVolume * createVolume(const std::string &name, const GeomDet *det, const std::string &matname="Air")
#define ADD_SISTRIP_TOPOLOGY(rawid, detUnit)
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
#define end
Definition: vmac.h:38
virtual const GeomDet * idToDet(DetId) const
const DetContainer & detsTIB() const
Definition: DetId.h:20
boost::shared_ptr< FWTGeoRecoGeometry > m_fwGeometry
const std::string path(TGeoVolume *top, const std::string &name, int copy)
void FWTGeoRecoGeometryESProducer::addTIDGeometry ( TGeoVolume *  top,
const std::string &  name = "TID",
int  copy = 1 
)
private

Definition at line 599 of file FWTGeoRecoGeometryESProducer.cc.

References ADD_SISTRIP_TOPOLOGY, filterCSVwithJSON::copy, createVolume(), cond::rpcobgas::detid, TrackerGeometry::detsTID(), end, TrackerGeometry::idToDet(), m_fwGeometry, m_trackerGeom, mergeVDriftHistosByStation::name, AlCaHLTBitMon_ParallelJobs::p, path(), DetId::rawId(), alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produce().

600 {
601  TGeoVolume *assembly = new TGeoVolumeAssembly( iName.c_str());
602  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTID().begin(),
603  end = m_trackerGeom->detsTID().end();
604  it != end; ++it)
605  {
606  DetId detid = ( *it )->geographicalId();
607  unsigned int rawid = detid.rawId();
608 
609  std::stringstream s;
610  s << rawid;
611  std::string name = s.str();
612 
613  TGeoVolume* child = createVolume( name, *it );
614  assembly->AddNode( child, copy, createPlacement( *it ));
615  child->SetLineColor( kGreen );
616 
617  std::stringstream p;
618  p << path( top, iName, copy ) << "/" << name << "_" << copy;
619  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
620 
621  ADD_SISTRIP_TOPOLOGY( rawid, m_trackerGeom->idToDet( detid ));
622  }
623 
624  top->AddNode( assembly, copy );
625 }
TGeoVolume * createVolume(const std::string &name, const GeomDet *det, const std::string &matname="Air")
#define ADD_SISTRIP_TOPOLOGY(rawid, detUnit)
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
#define end
Definition: vmac.h:38
virtual const GeomDet * idToDet(DetId) const
Definition: DetId.h:20
boost::shared_ptr< FWTGeoRecoGeometry > m_fwGeometry
const std::string path(TGeoVolume *top, const std::string &name, int copy)
const DetContainer & detsTID() const
void FWTGeoRecoGeometryESProducer::addTOBGeometry ( TGeoVolume *  top,
const std::string &  name = "TOB",
int  copy = 1 
)
private

Definition at line 570 of file FWTGeoRecoGeometryESProducer.cc.

References ADD_SISTRIP_TOPOLOGY, filterCSVwithJSON::copy, createVolume(), cond::rpcobgas::detid, TrackerGeometry::detsTOB(), end, TrackerGeometry::idToDet(), m_fwGeometry, m_trackerGeom, mergeVDriftHistosByStation::name, AlCaHLTBitMon_ParallelJobs::p, path(), DetId::rawId(), alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produce().

571 {
572  TGeoVolume *assembly = new TGeoVolumeAssembly( iName.c_str());
573  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTOB().begin(),
574  end = m_trackerGeom->detsTOB().end();
575  it != end; ++it )
576  {
577  DetId detid = ( *it )->geographicalId();
578  unsigned int rawid = detid.rawId();
579 
580  std::stringstream s;
581  s << rawid;
582  std::string name = s.str();
583 
584  TGeoVolume* child = createVolume( name, *it );
585  assembly->AddNode( child, copy, createPlacement( *it ));
586  child->SetLineColor( kGreen );
587 
588  std::stringstream p;
589  p << path( top, iName, copy ) << "/" << name << "_" << copy;
590  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
591 
592  ADD_SISTRIP_TOPOLOGY( rawid, m_trackerGeom->idToDet( detid ));
593  }
594 
595  top->AddNode( assembly, copy );
596 }
TGeoVolume * createVolume(const std::string &name, const GeomDet *det, const std::string &matname="Air")
#define ADD_SISTRIP_TOPOLOGY(rawid, detUnit)
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
#define end
Definition: vmac.h:38
virtual const GeomDet * idToDet(DetId) const
Definition: DetId.h:20
boost::shared_ptr< FWTGeoRecoGeometry > m_fwGeometry
const DetContainer & detsTOB() const
const std::string path(TGeoVolume *top, const std::string &name, int copy)
TGeoManager* FWTGeoRecoGeometryESProducer::createManager ( int  level)
private
TGeoMaterial * FWTGeoRecoGeometryESProducer::createMaterial ( const std::string &  name)
private

Create TGeo material based on its name

Definition at line 265 of file FWTGeoRecoGeometryESProducer.cc.

References m_nameToMaterial, and mergeVDriftHistosByStation::name.

Referenced by createVolume().

266 {
267  TGeoMaterial *material = m_nameToMaterial[name];
268 
269  if( material == 0 )
270  {
271  // FIXME: Do we need to set real parameters of the material?
272  material = new TGeoMaterial( name.c_str(),
273  0, 0, 0 );
274  m_nameToMaterial[name] = material;
275  }
276 
277  return material;
278 }
std::map< std::string, TGeoMaterial * > m_nameToMaterial
TGeoShape * FWTGeoRecoGeometryESProducer::createShape ( const GeomDet det)
private

Create TGeo shape for GeomDet

Definition at line 162 of file FWTGeoRecoGeometryESProducer.cc.

References b, Surface::bounds(), Bounds::length(), m_nameToShape, mergeVDriftHistosByStation::name, TrapezoidalPlaneBounds::parameters(), alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, GeomDet::surface(), Bounds::thickness(), Bounds::width(), and create_public_lumi_plots::width.

Referenced by createVolume().

163 {
164  TGeoShape* shape = 0;
165 
166  // Trapezoidal
167  const Bounds *b = &((det->surface ()).bounds ());
168  const TrapezoidalPlaneBounds *b2 = dynamic_cast<const TrapezoidalPlaneBounds *> (b);
169  if( b2 )
170  {
171  std::array< const float, 4 > const & par = b2->parameters ();
172 
173  // These parameters are half-lengths, as in CMSIM/GEANT3
174  float hBottomEdge = par [0];
175  float hTopEdge = par [1];
176  float thickness = par [2];
177  float apothem = par [3];
178 
179  std::stringstream s;
180  s << "T_"
181  << hBottomEdge << "_"
182  << hTopEdge << "_"
183  << thickness << "_"
184  << apothem;
185  std::string name = s.str();
186 
187  // Do not create identical shape,
188  // if one already exists
189  shape = m_nameToShape[name];
190  if( 0 == shape )
191  {
192  shape = new TGeoTrap(
193  name.c_str(),
194  thickness, //dz
195  0, //theta
196  0, //phi
197  apothem, //dy1
198  hBottomEdge,//dx1
199  hTopEdge, //dx2
200  0, //alpha1
201  apothem, //dy2
202  hBottomEdge,//dx3
203  hTopEdge, //dx4
204  0); //alpha2
205 
206  m_nameToShape[name] = shape;
207  }
208  }
209  if( dynamic_cast<const RectangularPlaneBounds *> (b) != 0 )
210  {
211  // Rectangular
212  float length = det->surface().bounds().length();
213  float width = det->surface().bounds ().width();
214  float thickness = det->surface().bounds().thickness();
215 
216  std::stringstream s;
217  s << "R_"
218  << width << "_"
219  << length << "_"
220  << thickness;
221  std::string name = s.str();
222 
223  // Do not create identical shape,
224  // if one already exists
225  shape = m_nameToShape[name];
226  if( 0 == shape )
227  {
228  shape = new TGeoBBox( name.c_str(), width / 2., length / 2., thickness / 2. ); // dx, dy, dz
229 
230  m_nameToShape[name] = shape;
231  }
232  }
233 
234  return shape;
235 }
virtual float length() const =0
virtual const std::array< const float, 4 > parameters() const
const Bounds & bounds() const
Definition: Surface.h:128
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
virtual float thickness() const =0
std::map< std::string, TGeoShape * > m_nameToShape
double b
Definition: hdecay.h:120
Definition: Bounds.h:22
virtual float width() const =0
TGeoVolume * FWTGeoRecoGeometryESProducer::createVolume ( const std::string &  name,
const GeomDet det,
const std::string &  material = "Air" 
)
private

Create TGeo volume for GeomDet

Definition at line 239 of file FWTGeoRecoGeometryESProducer.cc.

References createMaterial(), createShape(), m_nameToMedium, m_nameToVolume, and mergeVDriftHistosByStation::name.

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

240 {
241  TGeoVolume* volume = m_nameToVolume[name];
242  if( 0 == volume )
243  {
244  TGeoShape* solid = createShape( det );
245  TGeoMedium* medium = m_nameToMedium[material];
246  if( 0 == medium )
247  {
248  medium = new TGeoMedium( material.c_str(), 0, createMaterial( material ));
249  m_nameToMedium[material] = medium;
250  }
251  if( solid )
252  {
253  volume = new TGeoVolume( name.c_str(),
254  solid,
255  medium );
256  m_nameToVolume[name] = volume;
257  }
258  }
259 
260  return volume;
261 }
TGeoShape * createShape(const GeomDet *det)
std::map< std::string, TGeoMedium * > m_nameToMedium
std::map< std::string, TGeoVolume * > m_nameToVolume
TGeoMaterial * createMaterial(const std::string &name)
const FWTGeoRecoGeometryESProducer& FWTGeoRecoGeometryESProducer::operator= ( const FWTGeoRecoGeometryESProducer )
private
const std::string FWTGeoRecoGeometryESProducer::path ( TGeoVolume *  top,
const std::string &  name,
int  copy 
)
private

Definition at line 281 of file FWTGeoRecoGeometryESProducer.cc.

References filterCSVwithJSON::copy.

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

282 {
283  std::stringstream outs;
284  outs << volume->GetName() << "_" << volume->GetNumber() << "/"
285  << name << "_" << copy;
286 
287  return outs.str();
288 }
boost::shared_ptr< FWTGeoRecoGeometry > FWTGeoRecoGeometryESProducer::produce ( const FWTGeoRecoGeometryRecord record)

Definition at line 100 of file FWTGeoRecoGeometryESProducer.cc.

References addCaloGeometry(), addCSCGeometry(), addDTGeometry(), addPixelBarrelGeometry(), addPixelForwardGeometry(), addRPCGeometry(), addTECGeometry(), addTIBGeometry(), addTIDGeometry(), addTOBGeometry(), relativeConstraints::geom, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), m_caloGeom, m_fwGeometry, m_geomRecord, m_nameToMaterial, m_nameToMedium, m_nameToShape, m_nameToVolume, m_trackerGeom, and DetId::Tracker.

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

101 {
102  using namespace edm;
103 
104  m_fwGeometry = boost::shared_ptr<FWTGeoRecoGeometry>( new FWTGeoRecoGeometry );
105 
107 
108  DetId detId( DetId::Tracker, 0 );
109  m_trackerGeom = (const TrackerGeometry*) m_geomRecord->slaveGeometry( detId );
110 
111  record.getRecord<CaloGeometryRecord>().get( m_caloGeom );
112 
113  TGeoManager *geom = new TGeoManager( "cmsGeo", "CMS Detector" );
114  // NOTE: The default constructor does not create an identity matrix
115  if( 0 == gGeoIdentity )
116  {
117  gGeoIdentity = new TGeoIdentity( "Identity" );
118  }
119 
120  m_fwGeometry->manager( geom );
121 
122  // Default material is Vacuum
123  TGeoMaterial *matVacuum = new TGeoMaterial( "Vacuum", 0 ,0 ,0 );
124  // so is default medium
125  TGeoMedium *vacuum = new TGeoMedium( "Vacuum", 1, matVacuum );
126  TGeoVolume *top = geom->MakeBox( "CMS", vacuum, 270., 270., 120. );
127 
128  if( 0 == top )
129  {
130  return boost::shared_ptr<FWTGeoRecoGeometry>();
131  }
132  geom->SetTopVolume( top );
133  // ROOT chokes unless colors are assigned
134  top->SetVisibility( kFALSE );
135  top->SetLineColor( kBlue );
136 
137  addPixelBarrelGeometry( top );
139  addTIBGeometry( top );
140  addTIDGeometry( top );
141  addTOBGeometry( top );
142  addTECGeometry( top );
143  addDTGeometry( top );
144  addCSCGeometry( top );
145  addRPCGeometry( top );
146 
147  addCaloGeometry();
148 
149  geom->CloseGeometry();
150  geom->DefaultColors();
151 
152  m_nameToShape.clear();
153  m_nameToVolume.clear();
154  m_nameToMaterial.clear();
155  m_nameToMedium.clear();
156 
157  return m_fwGeometry;
158 }
edm::ESHandle< CaloGeometry > m_caloGeom
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
std::map< std::string, TGeoMedium * > m_nameToMedium
void addTOBGeometry(TGeoVolume *top, const std::string &name="TOB", int copy=1)
void addDTGeometry(TGeoVolume *top, const std::string &name="DT", int copy=1)
void addTIDGeometry(TGeoVolume *top, const std::string &name="TID", int copy=1)
void addRPCGeometry(TGeoVolume *top, const std::string &name="RPC", int copy=1)
void addCSCGeometry(TGeoVolume *top, const std::string &name="CSC", int copy=1)
std::map< std::string, TGeoShape * > m_nameToShape
void addPixelBarrelGeometry(TGeoVolume *top, const std::string &name="PixelBarrel", int copy=1)
void addTIBGeometry(TGeoVolume *top, const std::string &name="TIB", int copy=1)
std::map< std::string, TGeoVolume * > m_nameToVolume
Definition: DetId.h:20
boost::shared_ptr< FWTGeoRecoGeometry > m_fwGeometry
void addPixelForwardGeometry(TGeoVolume *top, const std::string &name="PixelForward", int copy=1)
void addTECGeometry(TGeoVolume *top, const std::string &name="TEC", int copy=1)
std::map< std::string, TGeoMaterial * > m_nameToMaterial

Member Data Documentation

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

Definition at line 63 of file FWTGeoRecoGeometryESProducer.h.

Referenced by addCaloGeometry(), and produce().

boost::shared_ptr<FWTGeoRecoGeometry> FWTGeoRecoGeometryESProducer::m_fwGeometry
private
edm::ESHandle<GlobalTrackingGeometry> FWTGeoRecoGeometryESProducer::m_geomRecord
private
std::map<std::string, TGeoMaterial*> FWTGeoRecoGeometryESProducer::m_nameToMaterial
private

Definition at line 59 of file FWTGeoRecoGeometryESProducer.h.

Referenced by createMaterial(), and produce().

std::map<std::string, TGeoMedium*> FWTGeoRecoGeometryESProducer::m_nameToMedium
private

Definition at line 60 of file FWTGeoRecoGeometryESProducer.h.

Referenced by createVolume(), and produce().

std::map<std::string, TGeoShape*> FWTGeoRecoGeometryESProducer::m_nameToShape
private

Definition at line 57 of file FWTGeoRecoGeometryESProducer.h.

Referenced by createShape(), and produce().

std::map<std::string, TGeoVolume*> FWTGeoRecoGeometryESProducer::m_nameToVolume
private

Definition at line 58 of file FWTGeoRecoGeometryESProducer.h.

Referenced by createVolume(), and produce().

const TrackerGeometry* FWTGeoRecoGeometryESProducer::m_trackerGeom
private