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 656 of file FWTGeoRecoGeometryESProducer.cc.

References end, m_caloGeom, and m_fwGeometry.

Referenced by produce().

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

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

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

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

484 {
485  TGeoVolume *assembly = new TGeoVolumeAssembly( iName.c_str());
486  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsPXB().begin(),
487  end = m_trackerGeom->detsPXB().end();
488  it != end; ++it)
489  {
490  DetId detid = ( *it )->geographicalId();
491  unsigned int rawid = detid.rawId();
492 
493  std::stringstream s;
494  s << rawid;
495  std::string name = s.str();
496 
497  TGeoVolume* child = createVolume( name, *it );
498  assembly->AddNode( child, copy, createPlacement( *it ));
499  child->SetLineColor( kGreen );
500 
501  std::stringstream p;
502  p << path( top, iName, copy ) << "/" << name << "_" << copy;
503  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
504 
505  ADD_PIXEL_TOPOLOGY( rawid, m_trackerGeom->idToDetUnit( detid ));
506  }
507 
508  top->AddNode( assembly, copy );
509 }
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:43
const DetContainer & detsPXB() const
#define end
Definition: vmac.h:37
Definition: DetId.h:18
#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.
string top
Definition: rpc-layouts.py:8
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 512 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().

513 {
514  TGeoVolume *assembly = new TGeoVolumeAssembly( iName.c_str());
515  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsPXF().begin(),
516  end = m_trackerGeom->detsPXF().end();
517  it != end; ++it )
518  {
519  DetId detid = ( *it )->geographicalId();
520  unsigned int rawid = detid.rawId();
521 
522  std::stringstream s;
523  s << rawid;
524  std::string name = s.str();
525 
526  TGeoVolume* child = createVolume( name, *it );
527  assembly->AddNode( child, copy, createPlacement( *it ));
528  child->SetLineColor( kGreen );
529 
530  std::stringstream p;
531  p << path( top, iName, copy ) << "/" << name << "_" << copy;
532  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
533 
534  ADD_PIXEL_TOPOLOGY( rawid, m_trackerGeom->idToDetUnit( detid ));
535  }
536 
537  top->AddNode( assembly, copy );
538 }
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:43
#define end
Definition: vmac.h:37
Definition: DetId.h:18
#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
string top
Definition: rpc-layouts.py:8
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 445 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().

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

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

628 {
629  TGeoVolume *assembly = new TGeoVolumeAssembly( iName.c_str());
630  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTEC().begin(),
631  end = m_trackerGeom->detsTEC().end();
632  it != end; ++it )
633  {
634  DetId detid = ( *it )->geographicalId();
635  unsigned int rawid = detid.rawId();
636 
637  std::stringstream s;
638  s << rawid;
639  std::string name = s.str();
640 
641  TGeoVolume* child = createVolume( name, *it );
642  assembly->AddNode( child, copy, createPlacement( *it ));
643  child->SetLineColor( kGreen );
644 
645  std::stringstream p;
646  p << path( top, iName, copy ) << "/" << name << "_" << copy;
647  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
648 
649  ADD_SISTRIP_TOPOLOGY( rawid, m_trackerGeom->idToDet( detid ));
650  }
651 
652  top->AddNode( assembly, copy );
653 }
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:43
const DetContainer & detsTEC() const
#define end
Definition: vmac.h:37
virtual const GeomDet * idToDet(DetId) const
Definition: DetId.h:18
boost::shared_ptr< FWTGeoRecoGeometry > m_fwGeometry
string top
Definition: rpc-layouts.py:8
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 541 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().

542 {
543  TGeoVolume *assembly = new TGeoVolumeAssembly( iName.c_str());
544  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTIB().begin(),
545  end = m_trackerGeom->detsTIB().end();
546  it != end; ++it )
547  {
548  DetId detid = ( *it )->geographicalId();
549  unsigned int rawid = detid.rawId();
550  std::stringstream s;
551  s << rawid;
552  std::string name = s.str();
553 
554  TGeoVolume* child = createVolume( name, *it );
555  assembly->AddNode( child, copy, createPlacement( *it ));
556  child->SetLineColor( kGreen );
557 
558  std::stringstream p;
559  p << path( top, iName, copy ) << "/" << name << "_" << copy;
560  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
561 
562  ADD_SISTRIP_TOPOLOGY( rawid, m_trackerGeom->idToDet( detid ));
563  }
564 
565  top->AddNode( assembly, copy );
566 }
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:43
#define end
Definition: vmac.h:37
virtual const GeomDet * idToDet(DetId) const
const DetContainer & detsTIB() const
Definition: DetId.h:18
boost::shared_ptr< FWTGeoRecoGeometry > m_fwGeometry
string top
Definition: rpc-layouts.py:8
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 598 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().

599 {
600  TGeoVolume *assembly = new TGeoVolumeAssembly( iName.c_str());
601  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTID().begin(),
602  end = m_trackerGeom->detsTID().end();
603  it != end; ++it)
604  {
605  DetId detid = ( *it )->geographicalId();
606  unsigned int rawid = detid.rawId();
607 
608  std::stringstream s;
609  s << rawid;
610  std::string name = s.str();
611 
612  TGeoVolume* child = createVolume( name, *it );
613  assembly->AddNode( child, copy, createPlacement( *it ));
614  child->SetLineColor( kGreen );
615 
616  std::stringstream p;
617  p << path( top, iName, copy ) << "/" << name << "_" << copy;
618  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
619 
620  ADD_SISTRIP_TOPOLOGY( rawid, m_trackerGeom->idToDet( detid ));
621  }
622 
623  top->AddNode( assembly, copy );
624 }
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:43
#define end
Definition: vmac.h:37
virtual const GeomDet * idToDet(DetId) const
Definition: DetId.h:18
boost::shared_ptr< FWTGeoRecoGeometry > m_fwGeometry
string top
Definition: rpc-layouts.py:8
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 569 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().

570 {
571  TGeoVolume *assembly = new TGeoVolumeAssembly( iName.c_str());
572  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTOB().begin(),
573  end = m_trackerGeom->detsTOB().end();
574  it != end; ++it )
575  {
576  DetId detid = ( *it )->geographicalId();
577  unsigned int rawid = detid.rawId();
578 
579  std::stringstream s;
580  s << rawid;
581  std::string name = s.str();
582 
583  TGeoVolume* child = createVolume( name, *it );
584  assembly->AddNode( child, copy, createPlacement( *it ));
585  child->SetLineColor( kGreen );
586 
587  std::stringstream p;
588  p << path( top, iName, copy ) << "/" << name << "_" << copy;
589  m_fwGeometry->idToName.insert( std::pair<unsigned int, FWTGeoRecoGeometry::Info>( rawid, FWTGeoRecoGeometry::Info( p.str())));
590 
591  ADD_SISTRIP_TOPOLOGY( rawid, m_trackerGeom->idToDet( detid ));
592  }
593 
594  top->AddNode( assembly, copy );
595 }
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:43
#define end
Definition: vmac.h:37
virtual const GeomDet * idToDet(DetId) const
Definition: DetId.h:18
boost::shared_ptr< FWTGeoRecoGeometry > m_fwGeometry
const DetContainer & detsTOB() const
string top
Definition: rpc-layouts.py:8
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 264 of file FWTGeoRecoGeometryESProducer.cc.

References m_nameToMaterial, and mergeVDriftHistosByStation::name.

Referenced by createVolume().

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

Create TGeo shape for GeomDet

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

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

239 {
240  TGeoVolume* volume = m_nameToVolume[name];
241  if( 0 == volume )
242  {
243  TGeoShape* solid = createShape( det );
244  TGeoMedium* medium = m_nameToMedium[material];
245  if( 0 == medium )
246  {
247  medium = new TGeoMedium( material.c_str(), 0, createMaterial( material ));
248  m_nameToMedium[material] = medium;
249  }
250  if( solid )
251  {
252  volume = new TGeoVolume( name.c_str(),
253  solid,
254  medium );
255  m_nameToVolume[name] = volume;
256  }
257  }
258 
259  return volume;
260 }
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 280 of file FWTGeoRecoGeometryESProducer.cc.

References filterCSVwithJSON::copy.

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

281 {
282  std::stringstream outs;
283  outs << volume->GetName() << "_" << volume->GetNumber() << "/"
284  << name << "_" << copy;
285 
286  return outs.str();
287 }
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, rpc-layouts::top, 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 
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 
151  m_nameToShape.clear();
152  m_nameToVolume.clear();
153  m_nameToMaterial.clear();
154  m_nameToMedium.clear();
155 
156  return m_fwGeometry;
157 }
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:18
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
string top
Definition: rpc-layouts.py:8

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