CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | 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 &)
 
std::shared_ptr< FWTGeoRecoGeometryproduce (const FWTGeoRecoGeometryRecord &)
 
virtual ~FWTGeoRecoGeometryESProducer (void)
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()(false)
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer () noexcept(false)
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Private Types

enum  ERecoDet {
  kDummy, kSiPixel, kSiStrip, kMuonDT,
  kMuonRPC, kMuonCSC, kMuonGEM, kMuonME0,
  kECal, kHCal, kCaloTower, kHGCE,
  kHGCH
}
 

Private Member Functions

void addCaloTowerGeometry ()
 
void addCSCGeometry ()
 
void addDTGeometry ()
 
void addEcalCaloGeometry ()
 
void addGEMGeometry ()
 
void addHcalCaloGeometryBarrel ()
 
void addHcalCaloGeometryEndcap ()
 
void addHcalCaloGeometryForward ()
 
void addHcalCaloGeometryOuter ()
 
void addME0Geometry ()
 
void addPixelBarrelGeometry ()
 
void addPixelForwardGeometry ()
 
void addRPCGeometry ()
 
void addTECGeometry ()
 
void addTIBGeometry ()
 
void addTIDGeometry ()
 
void addTOBGeometry ()
 
TGeoManager * createManager (int level)
 
TGeoShape * createShape (const GeomDet *det)
 
TGeoVolume * createVolume (const std::string &name, const GeomDet *det, ERecoDet=kDummy)
 
 FWTGeoRecoGeometryESProducer (const FWTGeoRecoGeometryESProducer &)
 
TGeoVolume * GetDaughter (TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
 
TGeoVolume * GetDaughter (TGeoVolume *mother, const char *prefix, ERecoDet cidx)
 
TGeoMedium * GetMedium (ERecoDet)
 
TGeoVolume * GetTopHolder (const char *prefix, ERecoDet cidx)
 
const FWTGeoRecoGeometryESProduceroperator= (const FWTGeoRecoGeometryESProducer &)
 

Private Attributes

bool m_calo
 
edm::ESHandle< CaloGeometrym_caloGeom
 
TGeoMedium * m_dummyMedium
 
std::shared_ptr< FWTGeoRecoGeometrym_fwGeometry
 
edm::ESHandle< GlobalTrackingGeometrym_geomRecord
 
bool m_muon
 
std::map< std::string, TGeoShape * > m_nameToShape
 
std::map< ERecoDet, TGeoMedium * > m_recoMedium
 
std::map< TGeoShape *, TGeoVolume * > m_shapeToVolume
 
bool m_tracker
 
const TrackerGeometrym_trackerGeom
 
const TrackerTopologym_trackerTopology
 

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

Detailed Description

Definition at line 29 of file FWTGeoRecoGeometryESProducer.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

FWTGeoRecoGeometryESProducer::FWTGeoRecoGeometryESProducer ( const edm::ParameterSet pset)

Definition at line 68 of file FWTGeoRecoGeometryESProducer.cc.

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

69  : m_dummyMedium(0)
70 {
71  m_tracker = pset.getUntrackedParameter<bool>( "Tracker", true );
72  m_muon = pset.getUntrackedParameter<bool>( "Muon", true );
73  m_calo = pset.getUntrackedParameter<bool>( "Calo", true );
74 
75  setWhatProduced( this );
76 }
T getUntrackedParameter(std::string const &, T const &) const
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
FWTGeoRecoGeometryESProducer::~FWTGeoRecoGeometryESProducer ( void  )
virtual
FWTGeoRecoGeometryESProducer::FWTGeoRecoGeometryESProducer ( const FWTGeoRecoGeometryESProducer )
private

Member Function Documentation

void FWTGeoRecoGeometryESProducer::addCaloTowerGeometry ( )
private

Definition at line 1179 of file FWTGeoRecoGeometryESProducer.cc.

References EnergyCorrector::c, DetId::Calo, allConversions_cfi::dz, end, GetDaughter(), CaloGeometry::getGeometry(), GetMedium(), GetTopHolder(), CaloGeometry::getValidDetIds(), CaloTowerDetId::ieta(), kCaloTower, IdealObliquePrism::localCorners(), m_caloGeom, makeMuonMisalignmentScenario::rot, CaloTowerDetId::SubdetId, and CaloTowerDetId::zside().

Referenced by produce().

1180 {
1181  CaloVolMap caloShapeMapP;
1182  CaloVolMap caloShapeMapN;
1183 
1184  TGeoVolume* tv = GetTopHolder("CaloTower", kCaloTower);
1185  TGeoVolume *assembly = GetDaughter(tv, "CaloTower", kCaloTower);
1186 
1188  for( std::vector<DetId>::const_iterator it = vid.begin(), end = vid.end(); it != end; ++it)
1189  {
1190  CaloTowerDetId detid = CaloTowerDetId(it->rawId());
1191  const IdealObliquePrism* cell = dynamic_cast<const IdealObliquePrism*> ( m_caloGeom->getGeometry(*it));
1192  if (!cell) { printf ("EC not oblique \n"); continue; }
1193  TGeoVolume* volume = 0;
1194  CaloVolMap& caloShapeMap = (cell->etaPos() > 0) ? caloShapeMapP : caloShapeMapN;
1195  CaloVolMap::iterator volIt = caloShapeMap.find(cell->param());
1196  if ( volIt == caloShapeMap.end())
1197  {
1200  IdealObliquePrism::localCorners( lc, cell->param(), ref);
1201  HepGeom::Vector3D<float> lCenter;
1202  for( int c = 0; c < 8; ++c)
1203  lCenter += lc[c];
1204  lCenter *= 0.125;
1205 
1206  static const int arrP[] = { 3, 2, 1, 0, 7, 6, 5, 4 };
1207  static const int arrN[] = { 7, 6, 5, 4 ,3, 2, 1, 0};
1208  const int* arr = (detid.ieta() > 0) ? &arrP[0] : &arrN[0];
1209 
1210  double points[16];
1211  for (int c = 0; c < 8; ++c) {
1212  points[ c*2 + 0 ] = lc[arr[c]].x() - lCenter.x();
1213  points[ c*2 + 1 ] = lc[arr[c]].y() - lCenter.y();
1214  }
1215 
1216  float dz = (lc[4].z() -lc[0].z()) * 0.5;
1217  TGeoShape* solid = new TGeoArb8(dz, &points[0]);
1218  volume = new TGeoVolume("ecal oblique prism", solid, GetMedium(kCaloTower));
1219  caloShapeMap[cell->param()] = volume;
1220  }
1221  else {
1222  volume = volIt->second;
1223  }
1224 
1225  HepGeom::Vector3D<float> gCenter;
1226  CaloCellGeometry::CornersVec const & gc = cell->getCorners();
1227  for (int c = 0; c < 8; ++c) {
1228  gCenter += HepGeom::Vector3D<float>(gc[c].x(), gc[c].y(), gc[c].z());
1229  }
1230  gCenter *= 0.125;
1231 
1232  TGeoTranslation gtr(gCenter.x(), gCenter.y(), gCenter.z());
1233  TGeoRotation rot;
1234  rot.SetAngles(cell->phiPos()*TMath::RadToDeg(), 0, 0);
1235 
1236  TGeoVolume* holder = GetDaughter(assembly, "side", kCaloTower, detid.zside());
1237  holder = GetDaughter(holder, "ieta", kCaloTower, detid.ieta());
1238  std::stringstream nname;
1239  nname << detid;
1240  AddLeafNode(holder, volume, nname.str().c_str(), new TGeoCombiTrans(gtr, rot));
1241  }
1242 }
edm::ESHandle< CaloGeometry > m_caloGeom
CaloCellGeometry::Pt3D Pt3D
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
static const int SubdetId
#define end
Definition: vmac.h:37
TGeoVolume * GetDaughter(TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
int zside() const
get the z-side of the tower (1/-1)
std::vector< DetId > getValidDetIds() const
Get the list of all valid detector ids.
Definition: CaloGeometry.cc:92
const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
Definition: CaloGeometry.cc:78
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
int ieta() const
get the tower ieta
CaloCellGeometry::Pt3DVec Pt3DVec
void FWTGeoRecoGeometryESProducer::addCSCGeometry ( void  )
private

Definition at line 695 of file FWTGeoRecoGeometryESProducer.cc.

References relativeConstraints::chamber, createVolume(), TrackingGeometry::dets(), GetDaughter(), GetTopHolder(), kMuonCSC, kMuonRPC, m_geomRecord, dataset::name, alignCSCRings::s, GlobalTrackingGeometry::slaveGeometry(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produce().

696 {
698  throw cms::Exception( "FatalError" ) << "Cannnot find CSCGeometry\n";
699 
700 
701  TGeoVolume* tv = GetTopHolder("Muon", kMuonRPC);
702  TGeoVolume *assembly = GetDaughter(tv, "CSC", kMuonCSC);
703 
704  auto const & cscGeom = m_geomRecord->slaveGeometry( CSCDetId())->dets();
705  for( auto it = cscGeom.begin(), itEnd = cscGeom.end(); it != itEnd; ++it )
706  {
707  unsigned int rawid = (*it)->geographicalId();
708  CSCDetId detId(rawid);
709  std::stringstream s;
710  s << "CSC" << detId;
711  std::string name = s.str();
712 
713  TGeoVolume* child = 0;
714 
715  if( auto chamber = dynamic_cast<const CSCChamber*>(*it))
716  child = createVolume( name, chamber, kMuonCSC );
717  else if( auto * layer = dynamic_cast<const CSCLayer*>(*it))
718  child = createVolume( name, layer, kMuonCSC );
719 
720 
721 
722  if (child) {
723  TGeoVolume* holder = GetDaughter(assembly, "Endcap", kMuonCSC, detId.endcap());
724  holder = GetDaughter(holder, "Station", kMuonCSC, detId.station());
725  holder = GetDaughter(holder, "Ring", kMuonCSC, detId.ring());
726  holder = GetDaughter(holder, "Chamber", kMuonCSC , detId.chamber());
727 
728  // holder->AddNode(child, 1, createPlacement( *it ));
729  AddLeafNode(holder, child, name.c_str(), createPlacement(*it));
730  }
731  }
732 
733 }
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
const TrackingGeometry * slaveGeometry(DetId id) const
Return the pointer to the actual geometry for a given DetId.
virtual const DetContainer & dets() const =0
Returm a vector of all GeomDet (including all GeomDetUnits)
TGeoVolume * GetDaughter(TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
TGeoVolume * createVolume(const std::string &name, const GeomDet *det, ERecoDet=kDummy)
void FWTGeoRecoGeometryESProducer::addDTGeometry ( void  )
private

Definition at line 606 of file FWTGeoRecoGeometryESProducer.cc.

References relativeConstraints::chamber, createVolume(), TrackingGeometry::dets(), end, GetDaughter(), GetTopHolder(), kMuonDT, kMuonRPC, m_geomRecord, dataset::name, alignCSCRings::s, GlobalTrackingGeometry::slaveGeometry(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produce().

607 {
608  TGeoVolume* tv = GetTopHolder("Muon", kMuonRPC);
609  TGeoVolume *assemblyTop = GetDaughter(tv, "DT", kMuonDT);
610 
611  //
612  // DT chambers geometry
613  //
614  {
615  TGeoVolume *assembly = GetDaughter(assemblyTop, "DTChamber", kMuonDT);
616  auto const & dtChamberGeom = m_geomRecord->slaveGeometry( DTChamberId())->dets();
617  for( auto it = dtChamberGeom.begin(),
618  end = dtChamberGeom.end();
619  it != end; ++it )
620  {
621  if( auto chamber = dynamic_cast< const DTChamber *>(*it))
622  {
623  DTChamberId detid = chamber->geographicalId();
624  std::stringstream s;
625  s << detid;
626  std::string name = s.str();
627 
628  TGeoVolume* child = createVolume( name, chamber, kMuonDT );
629  TGeoVolume* holder = GetDaughter(assembly, "Wheel", kMuonDT, detid.wheel());
630  holder = GetDaughter(holder, "Station", kMuonDT, detid.station());
631  holder = GetDaughter(holder, "Sector", kMuonDT, detid.sector());
632 
633  AddLeafNode(holder, child, name.c_str(), createPlacement( chamber));
634  }
635  }
636  }
637 
638  // Fill in DT super layer parameters
639  {
640  TGeoVolume *assembly = GetDaughter(assemblyTop, "DTSuperLayer", kMuonDT);
641  auto const & dtSuperLayerGeom = m_geomRecord->slaveGeometry( DTSuperLayerId())->dets();
642  for( auto it = dtSuperLayerGeom.begin(),
643  end = dtSuperLayerGeom.end();
644  it != end; ++it )
645  {
646  if( auto * superlayer = dynamic_cast<const DTSuperLayer*>(*it))
647  {
648  DTSuperLayerId detid( DetId(superlayer->geographicalId()));
649  std::stringstream s;
650  s << detid;
651  std::string name = s.str();
652 
653  TGeoVolume* child = createVolume( name, superlayer, kMuonDT );
654 
655  TGeoVolume* holder = GetDaughter(assembly, "Wheel", kMuonDT, detid.wheel());
656  holder = GetDaughter(holder, "Station", kMuonDT, detid.station());
657  holder = GetDaughter(holder, "Sector", kMuonDT, detid.sector());
658  holder = GetDaughter(holder, "SuperLayer", kMuonDT, detid.superlayer());
659  AddLeafNode(holder, child, name.c_str(), createPlacement( superlayer));
660  }
661  }
662  }
663  // Fill in DT layer parameters
664  {
665  TGeoVolume *assembly = GetDaughter(assemblyTop, "DTLayer", kMuonDT);
666  auto const & dtLayerGeom = m_geomRecord->slaveGeometry( DTLayerId())->dets();
667  for( auto it = dtLayerGeom.begin(),
668  end = dtLayerGeom.end();
669  it != end; ++it )
670  {
671  if(auto layer = dynamic_cast<const DTLayer*>(*it))
672  {
673 
674  DTLayerId detid( DetId(layer->geographicalId()));
675 
676  std::stringstream s;
677  s << detid;
678  std::string name = s.str();
679 
680  TGeoVolume* child = createVolume( name, layer, kMuonDT );
681 
682  TGeoVolume* holder = GetDaughter(assembly, "Wheel", kMuonDT, detid.wheel());
683  holder = GetDaughter(holder, "Station", kMuonDT, detid.station());
684  holder = GetDaughter(holder, "Sector", kMuonDT, detid.sector());
685  holder = GetDaughter(holder, "SuperLayer", kMuonDT, detid.superlayer());
686  holder = GetDaughter(holder, "Layer", kMuonDT, detid.layer());
687  AddLeafNode(holder, child, name.c_str(), createPlacement( layer));
688  }
689  }
690  }
691 }
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
const TrackingGeometry * slaveGeometry(DetId id) const
Return the pointer to the actual geometry for a given DetId.
#define end
Definition: vmac.h:37
virtual const DetContainer & dets() const =0
Returm a vector of all GeomDet (including all GeomDetUnits)
TGeoVolume * GetDaughter(TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
Definition: DetId.h:18
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
TGeoVolume * createVolume(const std::string &name, const GeomDet *det, ERecoDet=kDummy)
void FWTGeoRecoGeometryESProducer::addEcalCaloGeometry ( void  )
private

Definition at line 1315 of file FWTGeoRecoGeometryESProducer.cc.

References DetId::Ecal, EcalBarrel, EcalEndcap, end, CaloCellGeometry::getCorners(), GetDaughter(), getEcalTrans(), CaloGeometry::getGeometry(), GetMedium(), GetTopHolder(), CaloGeometry::getValidDetIds(), EBDetId::ieta(), EEDetId::ix(), kECal, m_caloGeom, makeEcalShape(), CaloCellGeometry::param(), EBDetId::zside(), and EEDetId::zside().

Referenced by produce().

1316 {
1317 
1318  TGeoVolume* tv = GetTopHolder("ECal", kECal);
1319  CaloVolMap caloShapeMap;
1320 
1321  {
1322  TGeoVolume *assembly = GetDaughter(tv, "ECalBarrel", kECal);
1323 
1325  for( std::vector<DetId>::const_iterator it = vid.begin(), end = vid.end(); it != end; ++it)
1326  {
1327  EBDetId detid(*it);
1328  const TruncatedPyramid* cell = dynamic_cast<const TruncatedPyramid*> ( m_caloGeom->getGeometry( *it ));
1329  if (!cell) { printf("ecalBarrel cell not a TruncatedPyramid !!\n"); return; }
1330 
1331  TGeoVolume* volume = 0;
1332  CaloVolMap::iterator volIt = caloShapeMap.find(cell->param());
1333  if ( volIt == caloShapeMap.end())
1334  {
1335  volume = new TGeoVolume( "EE TruncatedPyramid" , makeEcalShape(cell), GetMedium(kECal));
1336  caloShapeMap[cell->param()] = volume;
1337  }
1338  else {
1339  volume = volIt->second;
1340  }
1341  TGeoHMatrix* mtx= getEcalTrans(cell->getCorners());
1342  TGeoVolume* holder = GetDaughter(assembly, "side", kECal, detid.zside());
1343  holder = GetDaughter(holder, "ieta", kECal, detid.ieta());
1344  std::stringstream nname;
1345  nname << detid;
1346  AddLeafNode(holder, volume, nname.str().c_str(), mtx);
1347  }
1348  }
1349 
1350 
1351  {
1352  TGeoVolume *assembly = GetDaughter(tv, "ECalEndcap", kECal);
1353 
1355  for( std::vector<DetId>::const_iterator it = vid.begin(), end = vid.end(); it != end; ++it)
1356  {
1357  EEDetId detid(*it);
1358  const TruncatedPyramid* cell = dynamic_cast<const TruncatedPyramid*> (m_caloGeom->getGeometry( *it ));
1359  if (!cell) { printf("ecalEndcap cell not a TruncatedPyramid !!\n"); continue;}
1360 
1361  TGeoVolume* volume = 0;
1362  CaloVolMap::iterator volIt = caloShapeMap.find(cell->param());
1363  if ( volIt == caloShapeMap.end())
1364  {
1365 
1366  volume = new TGeoVolume( "EE TruncatedPyramid" , makeEcalShape(cell), GetMedium(kECal));
1367  caloShapeMap[cell->param()] = volume;
1368  }
1369  else {
1370  volume = volIt->second;
1371  }
1372  TGeoHMatrix* mtx= getEcalTrans(cell->getCorners());
1373  TGeoVolume* holder = GetDaughter(assembly, "side", kECal, detid.zside());
1374  holder = GetDaughter(holder, "ix", kECal, detid.ix());
1375  std::stringstream nname;
1376  nname << detid;
1377  AddLeafNode(holder, volume, nname.str().c_str(), mtx);
1378  }
1379  }
1380 }
edm::ESHandle< CaloGeometry > m_caloGeom
const CCGFloat * param() const
TGeoHMatrix * getEcalTrans(CaloCellGeometry::CornersVec const &gc)
#define end
Definition: vmac.h:37
TGeoShape * makeEcalShape(const TruncatedPyramid *cell)
TGeoVolume * GetDaughter(TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
CornersVec const & getCorners() const
Returns the corner points of this cell&#39;s volume.
A base class to handle the particular shape of Ecal Xtals. Taken from ORCA Calorimetry Code...
std::vector< DetId > getValidDetIds() const
Get the list of all valid detector ids.
Definition: CaloGeometry.cc:92
const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
Definition: CaloGeometry.cc:78
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
void FWTGeoRecoGeometryESProducer::addGEMGeometry ( void  )
private

Definition at line 738 of file FWTGeoRecoGeometryESProducer.cc.

References createVolume(), end, GEMGeometry::etaPartitions(), cppFunctionSkipper::exception, MuonSubdetId::GEM, GeomDet::geographicalId(), GetDaughter(), GetTopHolder(), kMuonGEM, kMuonRPC, m_geomRecord, DetId::Muon, dataset::name, alignCSCRings::s, SimDataFormats::CaloAnalysis::sc, GlobalTrackingGeometry::slaveGeometry(), AlCaHLTBitMon_QueryRunRegistry::string, GEMGeometry::superChambers(), and cms::Exception::what().

Referenced by produce().

739 {
740  try {
742  const GEMGeometry* gemGeom = (const GEMGeometry*) m_geomRecord->slaveGeometry( detId );
743 
744  TGeoVolume* tv = GetTopHolder("Muon", kMuonRPC);
745  TGeoVolume *assemblyTop = GetDaughter(tv, "GEM", kMuonGEM);
746 
747  {
748  TGeoVolume *assembly = GetDaughter(assemblyTop, "GEMSuperChambers", kMuonGEM);
749  for( auto it = gemGeom->superChambers().begin(),
750  end = gemGeom->superChambers().end();
751  it != end; ++it )
752  {
753  const GEMSuperChamber* sc = (*it);
754  if( sc )
755  {
756  GEMDetId detid = sc->geographicalId();
757  std::stringstream s;
758  s << detid;
759  std::string name = s.str();
760 
761  TGeoVolume* child = createVolume( name, sc, kMuonGEM );
762 
763  TGeoVolume* holder = GetDaughter(assembly, "SuperChamber Region", kMuonGEM , detid.region());
764  holder = GetDaughter(holder, "Ring", kMuonGEM , detid.ring());
765  holder = GetDaughter(holder, "Station", kMuonGEM , detid.station());
766  holder = GetDaughter(holder, "Chamber", kMuonGEM , detid.chamber());
767 
768  AddLeafNode(holder, child, name.c_str(), createPlacement(*it));
769  }
770  }
771  }
772 
773  {
774  TGeoVolume *assembly = GetDaughter(assemblyTop, "GEMetaPartitions", kMuonGEM);
775  for( auto it = gemGeom->etaPartitions().begin(),
776  end = gemGeom->etaPartitions().end();
777  it != end; ++it )
778  {
779  const GEMEtaPartition* roll = (*it);
780  if( roll )
781  {
782  GEMDetId detid = roll->geographicalId();
783  std::stringstream s;
784  s << detid;
785  std::string name = s.str();
786 
787  TGeoVolume* child = createVolume( name, roll, kMuonGEM );
788 
789  TGeoVolume* holder = GetDaughter(assembly, "ROLL Region", kMuonGEM , detid.region());
790  holder = GetDaughter(holder, "Ring", kMuonGEM , detid.ring());
791  holder = GetDaughter(holder, "Station", kMuonGEM , detid.station());
792  holder = GetDaughter(holder, "Layer", kMuonGEM , detid.layer());
793  holder = GetDaughter(holder, "Chamber", kMuonGEM , detid.chamber());
794 
795  AddLeafNode(holder, child, name.c_str(), createPlacement(*it));
796  }
797  }
798  }
799  }catch (cms::Exception &exception) {
800  edm::LogInfo("FWRecoGeometry") << "failed to produce GEM geometry " << exception.what() << std::endl;
801 
802  }
803 }
virtual char const * what() const
Definition: Exception.cc:141
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
static const int GEM
Definition: MuonSubdetId.h:15
const std::vector< const GEMEtaPartition * > & etaPartitions() const
Return a vector of all GEM eta partitions.
Definition: GEMGeometry.cc:63
const TrackingGeometry * slaveGeometry(DetId id) const
Return the pointer to the actual geometry for a given DetId.
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
#define end
Definition: vmac.h:37
TGeoVolume * GetDaughter(TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
const std::vector< const GEMSuperChamber * > & superChambers() const
Return a vector of all GEM super chambers.
Definition: GEMGeometry.cc:55
Definition: DetId.h:18
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
TGeoVolume * createVolume(const std::string &name, const GeomDet *det, ERecoDet=kDummy)
void FWTGeoRecoGeometryESProducer::addHcalCaloGeometryBarrel ( void  )
private

Definition at line 888 of file FWTGeoRecoGeometryESProducer.cc.

References EnergyCorrector::c, allConversions_cfi::dz, end, CaloCellGeometry::etaPos(), CaloCellGeometry::getCorners(), GetDaughter(), CaloGeometry::getGeometry(), GetMedium(), GetTopHolder(), CaloGeometry::getValidDetIds(), DetId::Hcal, HcalBarrel, HcalDetId::ieta(), kHCal, IdealObliquePrism::localCorners(), m_caloGeom, CaloCellGeometry::param(), CaloCellGeometry::phiPos(), makeMuonMisalignmentScenario::rot, x, y, z, and HcalDetId::zside().

Referenced by produce().

889 {
890  TGeoVolume* tv = GetTopHolder("HCal", kHCal);
891  TGeoVolume *assembly = GetDaughter(tv, "HCalBarrel", kHCal);
892 
894 
895  CaloVolMap caloShapeMapP;
896  CaloVolMap caloShapeMapN;
897  for( std::vector<DetId>::const_iterator it = vid.begin(), end = vid.end(); it != end; ++it)
898  {
899  //HcalDetId detid = HcalDetId(it->rawId());
900  HcalDetId detid(*it);
901  const CaloCellGeometry* cellb= m_caloGeom->getGeometry(*it);
902  const IdealObliquePrism* cell = dynamic_cast<const IdealObliquePrism*> (cellb);
903 
904  if (!cell) { printf ("HB not oblique !!!\n"); continue; }
905 
906  TGeoVolume* volume = 0;
907  CaloVolMap& caloShapeMap = (cell->etaPos() > 0) ? caloShapeMapP : caloShapeMapN;
908  CaloVolMap::iterator volIt = caloShapeMap.find(cell->param());
909  if (volIt == caloShapeMap.end())
910  {
911  // printf("FIREWORKS NEW SHAPE BEGIN eta = %f etaPos = %f, phiPos %f >>>>>> \n", cell->eta(), cell->etaPos(), cell->phiPos());
914  IdealObliquePrism::localCorners( lc, cell->param(), ref );
915  HepGeom::Vector3D<float> lCenter;
916  for( int c = 0; c < 8; ++c)
917  lCenter += lc[c];
918  lCenter *= 0.125;
919 
920  static const int arr[] = { 1, 0, 3, 2, 5, 4, 7, 6 };
921  double points[16];
922  for (int c = 0; c < 8; ++c) {
923  if (cell->etaPos() > 0 )
924  points[ c*2 + 0 ] = -(lc[arr[c]].z() - lCenter.z());
925  else
926  points[ c*2 + 0 ] = (lc[arr[c]].z() - lCenter.z());
927  points[ c*2 + 1 ] = (lc[arr[c]].y() - lCenter.y());
928  // printf("AMT xy[%d] <=>[%d] = (%.4f, %.4f) \n", arr[c], c, points[c*2], points[c*2+1]);
929  }
930 
931  float dz = (lc[4].x() -lc[0].x()) * 0.5;
932  TGeoShape* solid = new TGeoArb8(dz, &points[0]);
933  volume = new TGeoVolume("hcal oblique prism", solid, GetMedium(kHCal));
934  caloShapeMap[cell->param()] = volume;
935  }
936  else {
937  volume = volIt->second;
938  }
939 
940  HepGeom::Vector3D<float> gCenter;
941  CaloCellGeometry::CornersVec const & gc = cell->getCorners();
942  for (int c = 0; c < 8; ++c)
943  gCenter += HepGeom::Vector3D<float>(gc[c].x(), gc[c].y(), gc[c].z());
944  gCenter *= 0.125;
945 
946  TGeoTranslation gtr(gCenter.x(), gCenter.y(), gCenter.z());
947  TGeoRotation rot;
948  rot.RotateY(90);
949 
950  TGeoRotation rotPhi;
951  rotPhi.SetAngles(0, -cell->phiPos()*TMath::RadToDeg(), 0);
952  rot.MultiplyBy(&rotPhi);
953 
954  TGeoVolume* holder = GetDaughter(assembly, "side", kHCal, detid.zside());
955  holder = GetDaughter(holder, "ieta", kHCal, detid.ieta());
956  std::stringstream nname;
957  nname << detid;
958  AddLeafNode(holder, volume, nname.str().c_str(), new TGeoCombiTrans(gtr, rot));
959  }
960 
961  // printf("HB map size P = %lu , N = %lu", caloShapeMapP.size(),caloShapeMapN.size() );
962 }
edm::ESHandle< CaloGeometry > m_caloGeom
float phiPos() const
const CCGFloat * param() const
CaloCellGeometry::Pt3D Pt3D
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
#define end
Definition: vmac.h:37
TGeoVolume * GetDaughter(TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
CornersVec const & getCorners() const
Returns the corner points of this cell&#39;s volume.
std::vector< DetId > getValidDetIds() const
Get the list of all valid detector ids.
Definition: CaloGeometry.cc:92
const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
Definition: CaloGeometry.cc:78
float etaPos() const
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
CaloCellGeometry::Pt3DVec Pt3DVec
void FWTGeoRecoGeometryESProducer::addHcalCaloGeometryEndcap ( void  )
private

Definition at line 966 of file FWTGeoRecoGeometryESProducer.cc.

References EnergyCorrector::c, allConversions_cfi::dz, end, GetDaughter(), CaloGeometry::getGeometry(), GetMedium(), GetTopHolder(), CaloGeometry::getValidDetIds(), DetId::Hcal, HcalEndcap, HcalDetId::ieta(), kHCal, IdealObliquePrism::localCorners(), m_caloGeom, makeMuonMisalignmentScenario::rot, and HcalDetId::zside().

Referenced by produce().

967 {
968 
969  CaloVolMap caloShapeMapP;
970  CaloVolMap caloShapeMapN;
971 
972  TGeoVolume* tv = GetTopHolder("HCal", kHCal);
973  TGeoVolume *assembly = GetDaughter(tv, "HCalEndcap", kHCal);
974 
976 
977  for( std::vector<DetId>::const_iterator it = vid.begin(), end = vid.end(); it != end; ++it)
978  {
979  HcalDetId detid = HcalDetId(it->rawId());
980  const IdealObliquePrism* cell = dynamic_cast<const IdealObliquePrism*> ( m_caloGeom->getGeometry(*it));
981 
982  if (!cell) { printf ("EC not oblique \n"); continue; }
983 
984  TGeoVolume* volume = 0;
985  CaloVolMap& caloShapeMap = (cell->etaPos() > 0) ? caloShapeMapP : caloShapeMapN;
986  CaloVolMap::iterator volIt = caloShapeMap.find(cell->param());
987  if ( volIt == caloShapeMap.end())
988  {
991  IdealObliquePrism::localCorners( lc, cell->param(), ref);
992  HepGeom::Vector3D<float> lCenter;
993  for( int c = 0; c < 8; ++c)
994  lCenter += lc[c];
995  lCenter *= 0.125;
996 
997  //for( int c = 0; c < 8; ++c)
998  // printf("lc.push_back(TEveVector(%.4f, %.4f, %.4f));\n", lc[c].x(), lc[c].y(), lc[c].z() );
999 
1000 
1001  static const int arrP[] = { 3, 2, 1, 0, 7, 6, 5, 4 };
1002  static const int arrN[] = { 7, 6, 5, 4 ,3, 2, 1, 0};
1003  const int* arr = (detid.ieta() > 0) ? &arrP[0] : &arrN[0];
1004 
1005  double points[16];
1006  for (int c = 0; c < 8; ++c) {
1007  points[ c*2 + 0 ] = lc[arr[c]].x() - lCenter.x();
1008  points[ c*2 + 1 ] = lc[arr[c]].y() - lCenter.y();
1009  }
1010 
1011  float dz = (lc[4].z() -lc[0].z()) * 0.5;
1012  TGeoShape* solid = new TGeoArb8(dz, &points[0]);
1013  volume = new TGeoVolume("ecal oblique prism", solid, GetMedium(kHCal));
1014  caloShapeMap[cell->param()] = volume;
1015  }
1016  else {
1017 
1018  volume = volIt->second;
1019 
1020  }
1021 
1022  HepGeom::Vector3D<float> gCenter;
1023  CaloCellGeometry::CornersVec const & gc = cell->getCorners();
1024  for (int c = 0; c < 8; ++c) {
1025  gCenter += HepGeom::Vector3D<float>(gc[c].x(), gc[c].y(), gc[c].z());
1026  // printf("gc.push_back(TEveVector(%.4f, %.4f, %.4f));\n", gc[c].x(), gc[c].y(),gc[c].z() );
1027  }
1028  gCenter *= 0.125;
1029 
1030  TGeoTranslation gtr(gCenter.x(), gCenter.y(), gCenter.z());
1031  TGeoRotation rot;
1032  rot.SetAngles(cell->phiPos()*TMath::RadToDeg(), 0, 0);
1033 
1034  TGeoVolume* holder = GetDaughter(assembly, "side", kHCal, detid.zside());
1035  holder = GetDaughter(holder, "ieta", kHCal, detid.ieta());
1036  std::stringstream nname;
1037  nname << detid;
1038  AddLeafNode(holder, volume, nname.str().c_str(), new TGeoCombiTrans(gtr, rot));
1039  }
1040 
1041  // printf("HE map size P = %lu , N = %lu", caloShapeMapP.size(),caloShapeMapN.size() );
1042 }
edm::ESHandle< CaloGeometry > m_caloGeom
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalDetId.cc:93
CaloCellGeometry::Pt3D Pt3D
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
int ieta() const
get the cell ieta
Definition: HcalDetId.h:56
#define end
Definition: vmac.h:37
TGeoVolume * GetDaughter(TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
std::vector< DetId > getValidDetIds() const
Get the list of all valid detector ids.
Definition: CaloGeometry.cc:92
const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
Definition: CaloGeometry.cc:78
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
CaloCellGeometry::Pt3DVec Pt3DVec
void FWTGeoRecoGeometryESProducer::addHcalCaloGeometryForward ( )
private

Definition at line 1112 of file FWTGeoRecoGeometryESProducer.cc.

References EnergyCorrector::c, allConversions_cfi::dz, end, GetDaughter(), CaloGeometry::getGeometry(), GetMedium(), GetTopHolder(), CaloGeometry::getValidDetIds(), DetId::Hcal, HcalForward, HcalDetId::ieta(), kHCal, IdealZPrism::localCorners(), m_caloGeom, makeMuonMisalignmentScenario::rot, and HcalDetId::zside().

Referenced by produce().

1113 {
1114  CaloVolMap caloShapeMapP;
1115  CaloVolMap caloShapeMapN;
1116 
1117  TGeoVolume* tv = GetTopHolder("HCal", kHCal);
1118  TGeoVolume *assembly = GetDaughter(tv, "HCalForward", kHCal);
1119 
1121 
1122  for( std::vector<DetId>::const_iterator it = vid.begin(), end = vid.end(); it != end; ++it)
1123  {
1124  HcalDetId detid = HcalDetId(it->rawId());
1125  const IdealZPrism* cell = dynamic_cast<const IdealZPrism*> ( m_caloGeom->getGeometry(*it));
1126 
1127  if (!cell) { printf ("EC not Z prism \n"); continue; }
1128 
1129  TGeoVolume* volume = 0;
1130  CaloVolMap& caloShapeMap = (cell->etaPos() > 0) ? caloShapeMapP : caloShapeMapN;
1131  CaloVolMap::iterator volIt = caloShapeMap.find(cell->param());
1132  if ( volIt == caloShapeMap.end())
1133  {
1134  IdealZPrism::Pt3DVec lc(8);
1135  IdealZPrism::Pt3D ref;
1136  IdealZPrism::localCorners( lc, cell->param(), ref);
1137  HepGeom::Vector3D<float> lCenter;
1138  for( int c = 0; c < 8; ++c)
1139  lCenter += lc[c];
1140  lCenter *= 0.125;
1141  static const int arrP[] = { 3, 2, 1, 0, 7, 6, 5, 4 };
1142  static const int arrN[] = { 7, 6, 5, 4 ,3, 2, 1, 0};
1143  const int* arr = (detid.ieta() > 0) ? &arrP[0] : &arrN[0];
1144 
1145  double points[16];
1146  for (int c = 0; c < 8; ++c) {
1147  points[ c*2 + 0 ] = lc[arr[c]].x() - lCenter.x();
1148  points[ c*2 + 1 ] = lc[arr[c]].y() - lCenter.y();
1149  }
1150 
1151  float dz = (lc[4].z() -lc[0].z()) * 0.5;
1152  TGeoShape* solid = new TGeoArb8(dz, &points[0]);
1153  volume = new TGeoVolume("ecal oblique prism", solid, GetMedium(kHCal));
1154  caloShapeMap[cell->param()] = volume;
1155  }
1156  else {
1157  volume = volIt->second;
1158  }
1159  HepGeom::Vector3D<float> gCenter;
1160  CaloCellGeometry::CornersVec const & gc = cell->getCorners();
1161  for (int c = 0; c < 8; ++c) {
1162  gCenter += HepGeom::Vector3D<float>(gc[c].x(), gc[c].y(), gc[c].z());
1163  }
1164  gCenter *= 0.125;
1165 
1166  TGeoTranslation gtr(gCenter.x(), gCenter.y(), gCenter.z());
1167  TGeoRotation rot;
1168  rot.SetAngles(cell->phiPos()*TMath::RadToDeg(), 0, 0);
1169 
1170  TGeoVolume* holder = GetDaughter(assembly, "side", kHCal, detid.zside());
1171  holder = GetDaughter(holder, "ieta", kHCal, detid.ieta());
1172  std::stringstream nname;
1173  nname << detid;
1174  AddLeafNode(holder, volume, nname.str().c_str(), new TGeoCombiTrans(gtr, rot));
1175  }
1176 }
edm::ESHandle< CaloGeometry > m_caloGeom
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalDetId.cc:93
int ieta() const
get the cell ieta
Definition: HcalDetId.h:56
#define end
Definition: vmac.h:37
TGeoVolume * GetDaughter(TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
Definition: IdealZPrism.cc:122
CaloCellGeometry::Pt3D Pt3D
Definition: IdealZPrism.h:33
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: IdealZPrism.h:34
std::vector< DetId > getValidDetIds() const
Get the list of all valid detector ids.
Definition: CaloGeometry.cc:92
const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
Definition: CaloGeometry.cc:78
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
void FWTGeoRecoGeometryESProducer::addHcalCaloGeometryOuter ( )
private

Definition at line 1045 of file FWTGeoRecoGeometryESProducer.cc.

References EnergyCorrector::c, allConversions_cfi::dz, end, GetDaughter(), CaloGeometry::getGeometry(), GetMedium(), GetTopHolder(), CaloGeometry::getValidDetIds(), DetId::Hcal, HcalOuter, HcalDetId::ieta(), kHCal, IdealObliquePrism::localCorners(), m_caloGeom, makeMuonMisalignmentScenario::rot, and HcalDetId::zside().

Referenced by produce().

1046 {
1047  CaloVolMap caloShapeMapP;
1048  CaloVolMap caloShapeMapN;
1049 
1050  TGeoVolume* tv = GetTopHolder("HCal", kHCal);
1051  TGeoVolume *assembly = GetDaughter(tv, "HCalOuter", kHCal);
1052 
1054 
1055  for( std::vector<DetId>::const_iterator it = vid.begin(), end = vid.end(); it != end; ++it)
1056  {
1057  HcalDetId detid = HcalDetId(it->rawId());
1058  const IdealObliquePrism* cell = dynamic_cast<const IdealObliquePrism*> ( m_caloGeom->getGeometry(*it));
1059 
1060  if (!cell) { printf ("EC not oblique \n"); continue; }
1061 
1062  TGeoVolume* volume = 0;
1063  CaloVolMap& caloShapeMap = (cell->etaPos() > 0) ? caloShapeMapP : caloShapeMapN;
1064  CaloVolMap::iterator volIt = caloShapeMap.find(cell->param());
1065  if ( volIt == caloShapeMap.end())
1066  {
1069  IdealObliquePrism::localCorners( lc, cell->param(), ref);
1070  HepGeom::Vector3D<float> lCenter;
1071  for( int c = 0; c < 8; ++c)
1072  lCenter += lc[c];
1073  lCenter *= 0.125;
1074  static const int arrP[] = { 3, 2, 1, 0, 7, 6, 5, 4 };
1075  static const int arrN[] = { 7, 6, 5, 4 ,3, 2, 1, 0};
1076  const int* arr = (detid.ieta() > 0) ? &arrP[0] : &arrN[0];
1077 
1078  double points[16];
1079  for (int c = 0; c < 8; ++c) {
1080  points[ c*2 + 0 ] = lc[arr[c]].x() - lCenter.x();
1081  points[ c*2 + 1 ] = lc[arr[c]].y() - lCenter.y();
1082  }
1083 
1084  float dz = (lc[4].z() -lc[0].z()) * 0.5;
1085  TGeoShape* solid = new TGeoArb8(dz, &points[0]);
1086  volume = new TGeoVolume("ecal oblique prism", solid, GetMedium(kHCal));
1087  caloShapeMap[cell->param()] = volume;
1088  }
1089  else {
1090  volume = volIt->second;
1091  }
1092  HepGeom::Vector3D<float> gCenter;
1093  CaloCellGeometry::CornersVec const & gc = cell->getCorners();
1094  for (int c = 0; c < 8; ++c) {
1095  gCenter += HepGeom::Vector3D<float>(gc[c].x(), gc[c].y(), gc[c].z());
1096  }
1097  gCenter *= 0.125;
1098 
1099  TGeoTranslation gtr(gCenter.x(), gCenter.y(), gCenter.z());
1100  TGeoRotation rot;
1101  rot.SetAngles(cell->phiPos()*TMath::RadToDeg(), 0, 0);
1102 
1103  TGeoVolume* holder = GetDaughter(assembly, "side", kHCal, detid.zside());
1104  holder = GetDaughter(holder, "ieta", kHCal, detid.ieta());
1105  std::stringstream nname;
1106  nname << detid;
1107  AddLeafNode(holder, volume, nname.str().c_str(), new TGeoCombiTrans(gtr, rot));
1108  }
1109 }
edm::ESHandle< CaloGeometry > m_caloGeom
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalDetId.cc:93
CaloCellGeometry::Pt3D Pt3D
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
int ieta() const
get the cell ieta
Definition: HcalDetId.h:56
#define end
Definition: vmac.h:37
TGeoVolume * GetDaughter(TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
std::vector< DetId > getValidDetIds() const
Get the list of all valid detector ids.
Definition: CaloGeometry.cc:92
const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
Definition: CaloGeometry.cc:78
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
CaloCellGeometry::Pt3DVec Pt3DVec
void FWTGeoRecoGeometryESProducer::addME0Geometry ( void  )
private

Definition at line 843 of file FWTGeoRecoGeometryESProducer.cc.

References createVolume(), ME0Geometry::etaPartitions(), cppFunctionSkipper::exception, GetDaughter(), GetTopHolder(), kMuonME0, m_geomRecord, DetId::Muon, dataset::name, alignCSCRings::s, GlobalTrackingGeometry::slaveGeometry(), AlCaHLTBitMon_QueryRunRegistry::string, and cms::Exception::what().

Referenced by produce().

844 {
845  TGeoVolume* tv = GetTopHolder("Muon", kMuonME0);
846  TGeoVolume *assembly = GetDaughter(tv, "ME0", kMuonME0);
847 
848  DetId detId( DetId::Muon, 5 );
849  try
850  {
851  const ME0Geometry* me0Geom = (const ME0Geometry*) m_geomRecord->slaveGeometry( detId );
852 
853  for(auto roll : me0Geom->etaPartitions())
854  {
855  if( roll )
856  {
857  unsigned int rawid = roll->geographicalId().rawId();
858  //std::cout << "AMT FWTTTTRecoGeometryES\n" << rawid ;
859 
860  ME0DetId detid(rawid);
861  std::stringstream s;
862  s << detid;
863  std::string name = s.str();
864  TGeoVolume* child = createVolume( name, roll, kMuonME0 );
865 
866  TGeoVolume* holder = GetDaughter(assembly, "Region", kMuonME0, detid.region());
867  holder = GetDaughter(holder, "Layer", kMuonME0, detid.layer());
868  holder = GetDaughter(holder, "Chamber", kMuonME0, detid.chamber());
869  AddLeafNode(holder, child, name.c_str(), createPlacement(roll));
870 
871 
872  }
873  }
874  }
875  catch( cms::Exception &exception )
876  {
877  edm::LogInfo("FWRecoGeometry") << "failed to produce ME0 geometry " << exception.what() << std::endl;
878  }
879 }
virtual char const * what() const
Definition: Exception.cc:141
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
const TrackingGeometry * slaveGeometry(DetId id) const
Return the pointer to the actual geometry for a given DetId.
TGeoVolume * GetDaughter(TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
const std::vector< ME0EtaPartition const * > & etaPartitions() const
Return a vector of all ME0 eta partitions.
Definition: ME0Geometry.cc:59
Definition: DetId.h:18
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
TGeoVolume * createVolume(const std::string &name, const GeomDet *det, ERecoDet=kDummy)
void FWTGeoRecoGeometryESProducer::addPixelBarrelGeometry ( void  )
private

Definition at line 455 of file FWTGeoRecoGeometryESProducer.cc.

References createVolume(), TrackerGeometry::detsPXB(), GetDaughter(), GetTopHolder(), kSiPixel, m_trackerGeom, m_trackerTopology, dataset::name, TrackerTopology::pxbLadder(), TrackerTopology::pxbLayer(), TrackerTopology::pxbModule(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produce().

456 {
457  TGeoVolume* tv = GetTopHolder( "SiPixel", kSiPixel );
458  TGeoVolume *assembly = GetDaughter( tv, "PXB", kSiPixel );
459 
460  for( auto it : m_trackerGeom->detsPXB()) {
461  DetId detid = it->geographicalId();
462  unsigned int layer = m_trackerTopology->pxbLayer( detid );
463  unsigned int module = m_trackerTopology->pxbModule( detid );
464  unsigned int ladder = m_trackerTopology->pxbLadder( detid );
465 
466  std::string name = Form( "PXB Ly:%d, Md:%d Ld:%d ", layer, module, ladder );
467  TGeoVolume* child = createVolume( name, it, kSiPixel );
468 
469  TGeoVolume* holder = GetDaughter( assembly, "Layer", kSiPixel, layer );
470  holder = GetDaughter( holder, "Module", kSiPixel, module );
471 
472  AddLeafNode( holder, child, name.c_str(), createPlacement( it ));
473  }
474 }
unsigned int pxbLadder(const DetId &id) const
unsigned int pxbModule(const DetId &id) const
const DetContainer & detsPXB() const
TGeoVolume * GetDaughter(TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
unsigned int pxbLayer(const DetId &id) const
Definition: DetId.h:18
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
Definition: vlib.h:208
TGeoVolume * createVolume(const std::string &name, const GeomDet *det, ERecoDet=kDummy)
void FWTGeoRecoGeometryESProducer::addPixelForwardGeometry ( void  )
private

Definition at line 477 of file FWTGeoRecoGeometryESProducer.cc.

References createVolume(), TrackerGeometry::detsPXF(), GetDaughter(), GetTopHolder(), kSiPixel, m_trackerGeom, m_trackerTopology, dataset::name, TrackerTopology::pxfBlade(), TrackerTopology::pxfDisk(), TrackerTopology::pxfPanel(), TrackerTopology::side(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produce().

478 {
479  TGeoVolume* tv = GetTopHolder( "SiPixel", kSiPixel );
480  TGeoVolume* assembly = GetDaughter( tv, "PXF", kSiPixel );
481 
482  for( auto it : m_trackerGeom->detsPXF()) {
483  DetId detid = it->geographicalId();
484  unsigned int disk = m_trackerTopology->pxfDisk( detid );
485  unsigned int blade = m_trackerTopology->pxfBlade( detid );
486  unsigned int panel = m_trackerTopology->pxfPanel( detid );
487  unsigned int side = m_trackerTopology->side( detid );
488 
489  std::string name = Form( "PXF D:%d, B:%d, P:%d, S:%d", disk, blade, panel, side );
490  TGeoVolume* child = createVolume( name, it, kSiPixel );
491 
492  TGeoVolume* holder = GetDaughter( assembly, "Side", kSiPixel, side );
493  holder = GetDaughter( holder, "Disk", kSiPixel, disk );
494  holder = GetDaughter( holder, "Blade", kSiPixel, blade );
495  holder = GetDaughter( holder, "Panel", kSiPixel, panel );
496 
497  AddLeafNode( holder, child, name.c_str(), createPlacement( it ));
498  }
499 }
unsigned int pxfDisk(const DetId &id) const
unsigned int side(const DetId &id) const
TGeoVolume * GetDaughter(TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
Definition: DetId.h:18
const DetContainer & detsPXF() const
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
unsigned int pxfPanel(const DetId &id) const
unsigned int pxfBlade(const DetId &id) const
TGeoVolume * createVolume(const std::string &name, const GeomDet *det, ERecoDet=kDummy)
void FWTGeoRecoGeometryESProducer::addRPCGeometry ( void  )
private

Definition at line 809 of file FWTGeoRecoGeometryESProducer.cc.

References createVolume(), end, GeomDet::geographicalId(), GetDaughter(), GetTopHolder(), kMuonRPC, m_geomRecord, DetId::Muon, dataset::name, RPCGeometry::rolls(), MuonSubdetId::RPC, alignCSCRings::s, GlobalTrackingGeometry::slaveGeometry(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produce().

810 {
811  TGeoVolume* tv = GetTopHolder("Muon", kMuonRPC);
812  TGeoVolume *assembly = GetDaughter(tv, "RPC", kMuonRPC);
813 
815  const RPCGeometry* rpcGeom = (const RPCGeometry*) m_geomRecord->slaveGeometry( detId );
816  for( auto it = rpcGeom->rolls().begin(),
817  end = rpcGeom->rolls().end();
818  it != end; ++it )
819  {
820  RPCRoll const* roll = (*it);
821  if( roll )
822  {
823  RPCDetId detid = roll->geographicalId();
824  std::stringstream s;
825  s << detid;
826  std::string name = s.str();
827 
828  TGeoVolume* child = createVolume( name, roll, kMuonRPC );
829 
830  TGeoVolume* holder = GetDaughter(assembly, "ROLL Region", kMuonRPC, detid.region());
831  holder = GetDaughter(holder, "Ring", kMuonRPC, detid.ring());
832  holder = GetDaughter(holder, "Station", kMuonRPC, detid.station());
833  holder = GetDaughter(holder, "Sector", kMuonRPC, detid.sector());
834  holder = GetDaughter(holder, "Layer", kMuonRPC, detid.layer());
835  holder = GetDaughter(holder, "Subsector", kMuonRPC, detid.subsector());
836 
837  AddLeafNode(holder, child, name.c_str(), createPlacement(*it));
838  }
839  };
840 }
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
const std::vector< const RPCRoll * > & rolls() const
Return a vector of all RPC rolls.
Definition: RPCGeometry.cc:67
const TrackingGeometry * slaveGeometry(DetId id) const
Return the pointer to the actual geometry for a given DetId.
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
#define end
Definition: vmac.h:37
TGeoVolume * GetDaughter(TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
Definition: DetId.h:18
static const int RPC
Definition: MuonSubdetId.h:14
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
TGeoVolume * createVolume(const std::string &name, const GeomDet *det, ERecoDet=kDummy)
void FWTGeoRecoGeometryESProducer::addTECGeometry ( void  )
private

Definition at line 574 of file FWTGeoRecoGeometryESProducer.cc.

References createVolume(), TrackerGeometry::detsTEC(), GetDaughter(), GetTopHolder(), kSiStrip, m_trackerGeom, m_trackerTopology, dataset::name, relativeConstraints::ring, alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, TrackerTopology::tecModule(), TrackerTopology::tecOrder(), and TrackerTopology::tecRing().

Referenced by produce().

575 {
576  TGeoVolume* tv = GetTopHolder( "SiStrip", kSiStrip );
577  TGeoVolume* assembly = GetDaughter( tv, "TEC", kSiStrip );
578 
579  for( auto it : m_trackerGeom->detsTEC()) {
580  DetId detid = it->geographicalId();
581  unsigned int order = m_trackerTopology->tecOrder( detid );
582  unsigned int ring = m_trackerTopology->tecRing( detid );
583  unsigned int module = m_trackerTopology->tecModule( detid );
584 
585  std::stringstream s;
586  s << TECDetId( detid );
587  std::string name = s.str();
588 
589  TGeoVolume* child = createVolume( name, it, kSiStrip );
590 
591  TGeoVolume* holder = GetDaughter( assembly, "Order", kSiStrip, order );
592  holder = GetDaughter( holder, "Ring", kSiStrip, ring );
593  holder = GetDaughter( holder, "Module", kSiStrip, module );
594  AddLeafNode( holder, child, name.c_str(), createPlacement( it ));
595  }
596 }
unsigned int tecRing(const DetId &id) const
ring id
const DetContainer & detsTEC() const
TGeoVolume * GetDaughter(TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
unsigned int tecModule(const DetId &id) const
Definition: DetId.h:18
unsigned int tecOrder(const DetId &id) const
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
Definition: vlib.h:208
TGeoVolume * createVolume(const std::string &name, const GeomDet *det, ERecoDet=kDummy)
void FWTGeoRecoGeometryESProducer::addTIBGeometry ( void  )
private

Definition at line 502 of file FWTGeoRecoGeometryESProducer.cc.

References createVolume(), TrackerGeometry::detsTIB(), GetDaughter(), GetTopHolder(), kSiStrip, m_trackerGeom, m_trackerTopology, dataset::name, alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, TrackerTopology::tibModule(), TrackerTopology::tibOrder(), and TrackerTopology::tibSide().

Referenced by produce().

503 {
504  TGeoVolume* tv = GetTopHolder( "SiStrip", kSiStrip );
505  TGeoVolume *assembly = GetDaughter( tv, "TIB", kSiStrip );
506 
507  for( auto it : m_trackerGeom->detsTIB()) {
508  DetId detid = it->geographicalId();
509  unsigned int module = m_trackerTopology->tibModule( detid );
510  unsigned int order = m_trackerTopology->tibOrder( detid );
511  unsigned int side = m_trackerTopology->tibSide( detid );
512 
513  std::stringstream s;
514  s << TIBDetId( detid );
515  std::string name = s.str();
516 
517  TGeoVolume* child = createVolume( name, it, kSiStrip );
518  TGeoVolume* holder = GetDaughter( assembly, "Module", kSiStrip, module );
519  holder = GetDaughter( holder, "Order", kSiStrip, order );
520  holder = GetDaughter( holder, "Side", kSiStrip, side );
521  AddLeafNode( holder, child, name.c_str(), createPlacement( it ));
522  }
523 }
unsigned int tibSide(const DetId &id) const
unsigned int tibModule(const DetId &id) const
const DetContainer & detsTIB() const
TGeoVolume * GetDaughter(TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
Definition: DetId.h:18
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
Definition: vlib.h:208
TGeoVolume * createVolume(const std::string &name, const GeomDet *det, ERecoDet=kDummy)
unsigned int tibOrder(const DetId &id) const
void FWTGeoRecoGeometryESProducer::addTIDGeometry ( void  )
private

Definition at line 526 of file FWTGeoRecoGeometryESProducer.cc.

References createVolume(), TrackerGeometry::detsTID(), GetDaughter(), GetTopHolder(), kSiStrip, m_trackerGeom, m_trackerTopology, dataset::name, relativeConstraints::ring, alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, TrackerTopology::tidRing(), TrackerTopology::tidSide(), TrackerTopology::tidWheel(), and makeMuonMisalignmentScenario::wheel.

Referenced by produce().

527 {
528  TGeoVolume* tv = GetTopHolder( "SiStrip", kSiStrip );
529  TGeoVolume* assembly = GetDaughter( tv, "TID", kSiStrip );
530 
531  for( auto it : m_trackerGeom->detsTID()) {
532  DetId detid = it->geographicalId();
533  unsigned int side = m_trackerTopology->tidSide( detid );
534  unsigned int wheel = m_trackerTopology->tidWheel( detid );
535  unsigned int ring = m_trackerTopology->tidRing( detid );
536 
537  std::stringstream s;
538  s << TIDDetId( detid );
539  std::string name = s.str();
540 
541  TGeoVolume* child = createVolume( name, it, kSiStrip );
542  TGeoVolume* holder = GetDaughter( assembly, "Side", kSiStrip, side );
543  holder = GetDaughter( holder, "Wheel", kSiStrip, wheel );
544  holder = GetDaughter( holder, "Ring", kSiStrip, ring );
545  AddLeafNode( holder, child, name.c_str(), createPlacement( it ));
546  }
547 }
unsigned int tidRing(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
unsigned int tidSide(const DetId &id) const
TGeoVolume * GetDaughter(TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
Definition: DetId.h:18
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
TGeoVolume * createVolume(const std::string &name, const GeomDet *det, ERecoDet=kDummy)
const DetContainer & detsTID() const
void FWTGeoRecoGeometryESProducer::addTOBGeometry ( void  )
private

Definition at line 550 of file FWTGeoRecoGeometryESProducer.cc.

References createVolume(), TrackerGeometry::detsTOB(), GetDaughter(), GetTopHolder(), kSiStrip, m_trackerGeom, m_trackerTopology, dataset::name, alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, TrackerTopology::tobModule(), TrackerTopology::tobRod(), and TrackerTopology::tobSide().

Referenced by produce().

551 {
552  TGeoVolume* tv = GetTopHolder( "SiStrip", kSiStrip );
553  TGeoVolume* assembly = GetDaughter( tv, "TOB", kSiStrip );
554 
555  for( auto it : m_trackerGeom->detsTOB()) {
556  DetId detid = it->geographicalId();
557  unsigned int rod = m_trackerTopology->tobRod( detid );
558  unsigned int side = m_trackerTopology->tobSide( detid );
559  unsigned int module = m_trackerTopology->tobModule( detid );
560 
561  std::stringstream s;
562  s << TOBDetId( detid );
563  std::string name = s.str();
564 
565  TGeoVolume* child = createVolume( name, it, kSiStrip );
566  TGeoVolume* holder = GetDaughter( assembly, "Rod", kSiStrip, rod );
567  holder = GetDaughter( holder, "Side", kSiStrip, side );
568  holder = GetDaughter( holder, "Module", kSiStrip, module );
569  AddLeafNode( holder, child, name.c_str(), createPlacement( it ));
570  }
571 }
unsigned int tobSide(const DetId &id) const
TGeoVolume * GetDaughter(TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
Definition: DetId.h:18
unsigned int tobModule(const DetId &id) const
const DetContainer & detsTOB() const
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
unsigned int tobRod(const DetId &id) const
Definition: vlib.h:208
TGeoVolume * createVolume(const std::string &name, const GeomDet *det, ERecoDet=kDummy)
TGeoManager* FWTGeoRecoGeometryESProducer::createManager ( int  level)
private
TGeoShape * FWTGeoRecoGeometryESProducer::createShape ( const GeomDet det)
private

Create TGeo shape for GeomDet

Definition at line 351 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by createVolume().

352 {
353  TGeoShape* shape = 0;
354 
355  // Trapezoidal
356  const Bounds *b = &((det->surface ()).bounds ());
357  const TrapezoidalPlaneBounds *b2 = dynamic_cast<const TrapezoidalPlaneBounds *> (b);
358  if( b2 )
359  {
360  std::array< const float, 4 > const & par = b2->parameters ();
361 
362  // These parameters are half-lengths, as in CMSIM/GEANT3
363  float hBottomEdge = par [0];
364  float hTopEdge = par [1];
365  float thickness = par [2];
366  float apothem = par [3];
367 
368  std::stringstream s;
369  s << "T_"
370  << hBottomEdge << "_"
371  << hTopEdge << "_"
372  << thickness << "_"
373  << apothem;
374  std::string name = s.str();
375 
376  // Do not create identical shape,
377  // if one already exists
378  shape = m_nameToShape[name];
379  if( 0 == shape )
380  {
381  shape = new TGeoTrap(
382  name.c_str(),
383  thickness, //dz
384  0, //theta
385  0, //phi
386  apothem, //dy1
387  hBottomEdge,//dx1
388  hTopEdge, //dx2
389  0, //alpha1
390  apothem, //dy2
391  hBottomEdge,//dx3
392  hTopEdge, //dx4
393  0); //alpha2
394 
395  m_nameToShape[name] = shape;
396  }
397  }
398  if( dynamic_cast<const RectangularPlaneBounds *> (b) != 0 )
399  {
400  // Rectangular
401  float length = det->surface().bounds().length();
402  float width = det->surface().bounds ().width();
403  float thickness = det->surface().bounds().thickness();
404 
405  std::stringstream s;
406  s << "R_"
407  << width << "_"
408  << length << "_"
409  << thickness;
410  std::string name = s.str();
411 
412  // Do not create identical shape,
413  // if one already exists
414  shape = m_nameToShape[name];
415  if( 0 == shape )
416  {
417  shape = new TGeoBBox( name.c_str(), width / 2., length / 2., thickness / 2. ); // dx, dy, dz
418 
419  m_nameToShape[name] = shape;
420  }
421  }
422 
423  return shape;
424 }
virtual float length() const =0
virtual const std::array< const float, 4 > parameters() const
const Bounds & bounds() const
Definition: Surface.h:120
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
virtual float width() const =0
std::map< std::string, TGeoShape * > m_nameToShape
virtual float thickness() const =0
double b
Definition: hdecay.h:120
Definition: Bounds.h:22
TGeoVolume * FWTGeoRecoGeometryESProducer::createVolume ( const std::string &  name,
const GeomDet det,
ERecoDet  mid = kDummy 
)
private

Create TGeo volume for GeomDet

Definition at line 428 of file FWTGeoRecoGeometryESProducer.cc.

References createShape(), GetMedium(), and m_shapeToVolume.

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

429 {
430  TGeoShape* solid = createShape( det );
431 
432  std::map<TGeoShape*, TGeoVolume*>::iterator vIt = m_shapeToVolume.find(solid);
433  if (vIt != m_shapeToVolume.end()) return vIt->second;
434 
435 
436  TGeoVolume* volume = new TGeoVolume( name.c_str(),solid, GetMedium(mid));
437 
438  m_shapeToVolume[solid] = volume;
439 
440  return volume;
441 }
TGeoShape * createShape(const GeomDet *det)
std::map< TGeoShape *, TGeoVolume * > m_shapeToVolume
TGeoVolume * FWTGeoRecoGeometryESProducer::GetDaughter ( TGeoVolume *  mother,
const char *  prefix,
ERecoDet  cidx,
int  id 
)
private

Definition at line 120 of file FWTGeoRecoGeometryESProducer.cc.

References GetMedium(), and gen::n.

Referenced by addCaloTowerGeometry(), addCSCGeometry(), addDTGeometry(), addEcalCaloGeometry(), addGEMGeometry(), addHcalCaloGeometryBarrel(), addHcalCaloGeometryEndcap(), addHcalCaloGeometryForward(), addHcalCaloGeometryOuter(), addME0Geometry(), addPixelBarrelGeometry(), addPixelForwardGeometry(), addRPCGeometry(), addTECGeometry(), addTIBGeometry(), addTIDGeometry(), addTOBGeometry(), and GetTopHolder().

121 {
122  TGeoVolume* res = 0;
123  if (mother->GetNdaughters()) {
124  TGeoNode* n = mother->FindNode(Form("%s_%d_1", prefix, id));
125  if ( n ) res = n->GetVolume();
126  }
127 
128  if (!res) {
129  res = new TGeoVolumeAssembly( Form("%s_%d", prefix, id ));
130  res->SetMedium(GetMedium(cidx));
131  mother->AddNode(res, 1);
132  }
133 
134  return res;
135 }
Definition: Electron.h:4
TGeoVolume * FWTGeoRecoGeometryESProducer::GetDaughter ( TGeoVolume *  mother,
const char *  prefix,
ERecoDet  cidx 
)
private

Definition at line 137 of file FWTGeoRecoGeometryESProducer.cc.

References GetMedium(), and gen::n.

138 {
139  TGeoVolume* res = 0;
140  if (mother->GetNdaughters()) {
141  TGeoNode* n = mother->FindNode(Form("%s_1",prefix));
142  if ( n ) res = n->GetVolume();
143  }
144 
145  if (!res) {
146  // printf("GetDau... new holder %s for mother %s \n", mother->GetName(), prefix);
147  res = new TGeoVolumeAssembly(prefix);
148  res->SetMedium(GetMedium(cidx));
149  mother->AddNode(res, 1);
150  }
151 
152  return res;
153 }
Definition: Electron.h:4
TGeoMedium * FWTGeoRecoGeometryESProducer::GetMedium ( ERecoDet  det)
private

Definition at line 177 of file FWTGeoRecoGeometryESProducer.cc.

References create_public_lumi_plots::color, kCaloTower, kECal, kHCal, kHGCE, kHGCH, kMuonCSC, kMuonDT, kMuonGEM, kMuonME0, kMuonRPC, kSiPixel, kSiStrip, m_dummyMedium, m_recoMedium, dataset::name, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by addCaloTowerGeometry(), addEcalCaloGeometry(), addHcalCaloGeometryBarrel(), addHcalCaloGeometryEndcap(), addHcalCaloGeometryForward(), addHcalCaloGeometryOuter(), createVolume(), and GetDaughter().

178 {
179  std::map<ERecoDet, TGeoMedium*>::iterator it = m_recoMedium.find(det);
180  if (it != m_recoMedium.end())
181  return it->second;
182 
184  int color;
185 
186 
187  switch (det)
188  {
189  // TRACKER
190  case kSiPixel:
191  name = "SiPixel";
192  color = GMCol::Green;
193  break;
194 
195  case kSiStrip:
196  name = "SiStrip";
197  color = GMCol::Gray;
198  break;
199  // MUON
200  case kMuonDT:
201  name = "MuonDT";
202  color = GMCol::Blue2;
203  break;
204 
205  case kMuonRPC:
206  name = "MuonRPC";
207  color = GMCol::Red;
208  break;
209 
210  case kMuonGEM:
211  name = "MuonGEM";
212  color = GMCol::Yellow1;
213  break;
214 
215  case kMuonCSC:
216  name = "MuonCSC";
217  color = GMCol::Gray;
218  break;
219 
220  case kMuonME0:
221  name = "MuonME0";
222  color = GMCol::Yellow0;
223  break;
224 
225  // CALO
226  case kECal:
227  name = "ECal";
228  color = GMCol::Blue2;
229  break;
230  case kHCal:
231  name = "HCal";
232  color = GMCol::Orange1;
233  break;
234  case kCaloTower:
235  name = "CaloTower";
236  color = GMCol::Green;
237  break;
238  case kHGCE:
239  name = "HGCEE";
240  color = GMCol::Blue2;
241  break;
242  case kHGCH:
243  name = "HGCEH";
244  color = GMCol::Blue1;
245  break;
246  default:
247  printf("invalid medium id \n");
248  return m_dummyMedium;
249  }
250 
251  TGeoMaterial* mat = new TGeoMaterial(name.c_str(), 0, 0, 0);
252  mat->SetZ(color);
253  m_recoMedium[det] = new TGeoMedium(name.c_str(), 0, mat);
254  mat->SetFillStyle(3000); // tansparency 3000-3100
255  mat->SetDensity(1); // disable override of transparency in TGeoManager::DefaultColors()
256 
257  return m_recoMedium[det];
258 }
std::map< ERecoDet, TGeoMedium * > m_recoMedium
TGeoVolume * FWTGeoRecoGeometryESProducer::GetTopHolder ( const char *  prefix,
ERecoDet  cidx 
)
private

Definition at line 155 of file FWTGeoRecoGeometryESProducer.cc.

References GetDaughter(), and tablePrinter::prefix.

Referenced by addCaloTowerGeometry(), addCSCGeometry(), addDTGeometry(), addEcalCaloGeometry(), addGEMGeometry(), addHcalCaloGeometryBarrel(), addHcalCaloGeometryEndcap(), addHcalCaloGeometryForward(), addHcalCaloGeometryOuter(), addME0Geometry(), addPixelBarrelGeometry(), addPixelForwardGeometry(), addRPCGeometry(), addTECGeometry(), addTIBGeometry(), addTIDGeometry(), and addTOBGeometry().

156 {
157  // printf("GetTopHolder res = %s \n", prefix);
158  TGeoVolume* res = GetDaughter(gGeoManager->GetTopVolume(), prefix, cidx);
159  return res;
160 }
Definition: Electron.h:4
TGeoVolume * GetDaughter(TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
const FWTGeoRecoGeometryESProducer& FWTGeoRecoGeometryESProducer::operator= ( const FWTGeoRecoGeometryESProducer )
private
std::shared_ptr< FWTGeoRecoGeometry > FWTGeoRecoGeometryESProducer::produce ( const FWTGeoRecoGeometryRecord record)

Definition at line 266 of file FWTGeoRecoGeometryESProducer.cc.

References addCaloTowerGeometry(), addCSCGeometry(), addDTGeometry(), addEcalCaloGeometry(), addGEMGeometry(), addHcalCaloGeometryBarrel(), addHcalCaloGeometryEndcap(), addHcalCaloGeometryForward(), addHcalCaloGeometryOuter(), addME0Geometry(), addPixelBarrelGeometry(), addPixelForwardGeometry(), addRPCGeometry(), addTECGeometry(), addTIBGeometry(), addTIDGeometry(), addTOBGeometry(), relativeConstraints::geom, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), m_calo, m_caloGeom, m_dummyMedium, m_fwGeometry, m_geomRecord, m_muon, m_tracker, m_trackerGeom, m_trackerTopology, edm::ESHandle< T >::product(), GlobalTrackingGeometry::slaveGeometry(), and DetId::Tracker.

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

267 {
268  using namespace edm;
269 
270  m_fwGeometry = std::make_shared<FWTGeoRecoGeometry>();
271 
272  if( m_calo )
273  record.getRecord<CaloGeometryRecord>().get( m_caloGeom );
274 
275  TGeoManager* geom = new TGeoManager( "cmsGeo", "CMS Detector" );
276  if( 0 == gGeoIdentity )
277  {
278  gGeoIdentity = new TGeoIdentity( "Identity" );
279  }
280 
281  m_fwGeometry->manager( geom );
282 
283  // Default material is Vacuum
284  TGeoMaterial *vacuum = new TGeoMaterial( "Vacuum", 0 ,0 ,0 );
285  m_dummyMedium = new TGeoMedium( "reco", 0, vacuum);
286 
287  TGeoVolume *top = geom->MakeBox( "CMS", m_dummyMedium, 270., 270., 120. );
288 
289  if( 0 == top )
290  {
291  return std::shared_ptr<FWTGeoRecoGeometry>();
292  }
293  geom->SetTopVolume( top );
294  // ROOT chokes unless colors are assigned
295  top->SetVisibility( kFALSE );
296  top->SetLineColor( kBlue );
297 
298  if( m_tracker || m_muon )
299  {
301  }
302 
303  if( m_tracker )
304  {
305  DetId detId( DetId::Tracker, 0 );
307 
308  edm::ESHandle<TrackerTopology> trackerTopologyHandle;
309  record.getRecord<TrackerTopologyRcd>().get( trackerTopologyHandle );
310  m_trackerTopology = trackerTopologyHandle.product();
311 
314 
315  addTIBGeometry();
316  addTIDGeometry();
317  addTOBGeometry();
318  addTECGeometry();
319  }
320 
321  if( m_muon )
322  {
323  addDTGeometry();
324  addCSCGeometry();
325  addRPCGeometry();
326  addME0Geometry();
327  addGEMGeometry();
328  }
329 
330  if( m_calo )
331  {
338  }
339 
340  geom->CloseGeometry();
341 
342  geom->DefaultColors();
343  // printf("==== geo manager NNodes = %d \n", geom->GetNNodes());
344  geom->CloseGeometry();
345 
346  return m_fwGeometry;
347 }
edm::ESHandle< CaloGeometry > m_caloGeom
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
const TrackingGeometry * slaveGeometry(DetId id) const
Return the pointer to the actual geometry for a given DetId.
Definition: DetId.h:18
HLT enums.
std::shared_ptr< FWTGeoRecoGeometry > m_fwGeometry
T const * product() const
Definition: ESHandle.h:86

Member Data Documentation

bool FWTGeoRecoGeometryESProducer::m_calo
private

Definition at line 90 of file FWTGeoRecoGeometryESProducer.h.

Referenced by FWTGeoRecoGeometryESProducer(), and produce().

edm::ESHandle<CaloGeometry> FWTGeoRecoGeometryESProducer::m_caloGeom
private
TGeoMedium* FWTGeoRecoGeometryESProducer::m_dummyMedium
private

Definition at line 86 of file FWTGeoRecoGeometryESProducer.h.

Referenced by GetMedium(), and produce().

std::shared_ptr<FWTGeoRecoGeometry> FWTGeoRecoGeometryESProducer::m_fwGeometry
private

Definition at line 84 of file FWTGeoRecoGeometryESProducer.h.

Referenced by produce().

edm::ESHandle<GlobalTrackingGeometry> FWTGeoRecoGeometryESProducer::m_geomRecord
private
bool FWTGeoRecoGeometryESProducer::m_muon
private

Definition at line 89 of file FWTGeoRecoGeometryESProducer.h.

Referenced by FWTGeoRecoGeometryESProducer(), and produce().

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

Definition at line 75 of file FWTGeoRecoGeometryESProducer.h.

Referenced by createShape().

std::map<ERecoDet, TGeoMedium*> FWTGeoRecoGeometryESProducer::m_recoMedium
private

Definition at line 77 of file FWTGeoRecoGeometryESProducer.h.

Referenced by GetMedium().

std::map<TGeoShape*, TGeoVolume*> FWTGeoRecoGeometryESProducer::m_shapeToVolume
private

Definition at line 76 of file FWTGeoRecoGeometryESProducer.h.

Referenced by createVolume().

bool FWTGeoRecoGeometryESProducer::m_tracker
private

Definition at line 88 of file FWTGeoRecoGeometryESProducer.h.

Referenced by FWTGeoRecoGeometryESProducer(), and produce().

const TrackerGeometry* FWTGeoRecoGeometryESProducer::m_trackerGeom
private
const TrackerTopology* FWTGeoRecoGeometryESProducer::m_trackerTopology
private