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 &)
 
 ~FWTGeoRecoGeometryESProducer (void) override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ~ESProducer ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval) override
 overrides DataProxyProvider method More...
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- 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
 
const 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())
 
void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList) override
 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(nullptr)
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  )
override
FWTGeoRecoGeometryESProducer::FWTGeoRecoGeometryESProducer ( const FWTGeoRecoGeometryESProducer )
private

Member Function Documentation

void FWTGeoRecoGeometryESProducer::addCaloTowerGeometry ( )
private

Definition at line 1185 of file FWTGeoRecoGeometryESProducer.cc.

References EnergyCorrector::c, DetId::Calo, PVValHelper::dz, end, CaloCellGeometry::etaPos(), CaloCellGeometry::getCorners(), GetDaughter(), CaloGeometry::getGeometry(), GetMedium(), GetTopHolder(), CaloGeometry::getValidDetIds(), CaloTowerDetId::ieta(), kCaloTower, IdealObliquePrism::localCorners(), m_caloGeom, CaloCellGeometry::param(), CaloCellGeometry::phiPos(), hiPixelPairStep_cff::points, makeMuonMisalignmentScenario::rot, CaloTowerDetId::SubdetId, and CaloTowerDetId::zside().

Referenced by produce().

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

699 {
701  throw cms::Exception( "FatalError" ) << "Cannnot find CSCGeometry\n";
702 
703 
704  TGeoVolume* tv = GetTopHolder("Muon", kMuonRPC);
705  TGeoVolume *assembly = GetDaughter(tv, "CSC", kMuonCSC);
706 
707  auto const & cscGeom = m_geomRecord->slaveGeometry( CSCDetId())->dets();
708  for( auto it = cscGeom.begin(), itEnd = cscGeom.end(); it != itEnd; ++it )
709  {
710  unsigned int rawid = (*it)->geographicalId();
711  CSCDetId detId(rawid);
712  std::stringstream s;
713  s << "CSC" << detId;
714  std::string name = s.str();
715 
716  TGeoVolume* child = nullptr;
717 
718  if( auto chamber = dynamic_cast<const CSCChamber*>(*it))
719  child = createVolume( name, chamber, kMuonCSC );
720  else if( auto * layer = dynamic_cast<const CSCLayer*>(*it))
721  child = createVolume( name, layer, kMuonCSC );
722 
723 
724 
725  if (child) {
726  TGeoVolume* holder = GetDaughter(assembly, "Endcap", kMuonCSC, detId.endcap());
727  holder = GetDaughter(holder, "Station", kMuonCSC, detId.station());
728  holder = GetDaughter(holder, "Ring", kMuonCSC, detId.ring());
729  holder = GetDaughter(holder, "Chamber", kMuonCSC , detId.chamber());
730 
731  // holder->AddNode(child, 1, createPlacement( *it ));
732  AddLeafNode(holder, child, name.c_str(), createPlacement(*it));
733  }
734  }
735 
736 }
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 609 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().

610 {
611  TGeoVolume* tv = GetTopHolder("Muon", kMuonRPC);
612  TGeoVolume *assemblyTop = GetDaughter(tv, "DT", kMuonDT);
613 
614  //
615  // DT chambers geometry
616  //
617  {
618  TGeoVolume *assembly = GetDaughter(assemblyTop, "DTChamber", kMuonDT);
619  auto const & dtChamberGeom = m_geomRecord->slaveGeometry( DTChamberId())->dets();
620  for( auto it = dtChamberGeom.begin(),
621  end = dtChamberGeom.end();
622  it != end; ++it )
623  {
624  if( auto chamber = dynamic_cast< const DTChamber *>(*it))
625  {
626  DTChamberId detid = chamber->geographicalId();
627  std::stringstream s;
628  s << detid;
629  std::string name = s.str();
630 
631  TGeoVolume* child = createVolume( name, chamber, kMuonDT );
632  TGeoVolume* holder = GetDaughter(assembly, "Wheel", kMuonDT, detid.wheel());
633  holder = GetDaughter(holder, "Station", kMuonDT, detid.station());
634  holder = GetDaughter(holder, "Sector", kMuonDT, detid.sector());
635 
636  AddLeafNode(holder, child, name.c_str(), createPlacement( chamber));
637  }
638  }
639  }
640 
641  // Fill in DT super layer parameters
642  {
643  TGeoVolume *assembly = GetDaughter(assemblyTop, "DTSuperLayer", kMuonDT);
644  auto const & dtSuperLayerGeom = m_geomRecord->slaveGeometry( DTSuperLayerId())->dets();
645  for( auto it = dtSuperLayerGeom.begin(),
646  end = dtSuperLayerGeom.end();
647  it != end; ++it )
648  {
649  if( auto * superlayer = dynamic_cast<const DTSuperLayer*>(*it))
650  {
651  DTSuperLayerId detid( DetId(superlayer->geographicalId()));
652  std::stringstream s;
653  s << detid;
654  std::string name = s.str();
655 
656  TGeoVolume* child = createVolume( name, superlayer, kMuonDT );
657 
658  TGeoVolume* holder = GetDaughter(assembly, "Wheel", kMuonDT, detid.wheel());
659  holder = GetDaughter(holder, "Station", kMuonDT, detid.station());
660  holder = GetDaughter(holder, "Sector", kMuonDT, detid.sector());
661  holder = GetDaughter(holder, "SuperLayer", kMuonDT, detid.superlayer());
662  AddLeafNode(holder, child, name.c_str(), createPlacement( superlayer));
663  }
664  }
665  }
666  // Fill in DT layer parameters
667  {
668  TGeoVolume *assembly = GetDaughter(assemblyTop, "DTLayer", kMuonDT);
669  auto const & dtLayerGeom = m_geomRecord->slaveGeometry( DTLayerId())->dets();
670  for( auto it = dtLayerGeom.begin(),
671  end = dtLayerGeom.end();
672  it != end; ++it )
673  {
674  if(auto layer = dynamic_cast<const DTLayer*>(*it))
675  {
676 
677  DTLayerId detid( DetId(layer->geographicalId()));
678 
679  std::stringstream s;
680  s << detid;
681  std::string name = s.str();
682 
683  TGeoVolume* child = createVolume( name, layer, kMuonDT );
684 
685  TGeoVolume* holder = GetDaughter(assembly, "Wheel", kMuonDT, detid.wheel());
686  holder = GetDaughter(holder, "Station", kMuonDT, detid.station());
687  holder = GetDaughter(holder, "Sector", kMuonDT, detid.sector());
688  holder = GetDaughter(holder, "SuperLayer", kMuonDT, detid.superlayer());
689  holder = GetDaughter(holder, "Layer", kMuonDT, detid.layer());
690  AddLeafNode(holder, child, name.c_str(), createPlacement( layer));
691  }
692  }
693  }
694 }
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:39
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 1322 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().

1323 {
1324 
1325  TGeoVolume* tv = GetTopHolder("ECal", kECal);
1326  CaloVolMap caloShapeMap;
1327 
1328  {
1329  TGeoVolume *assembly = GetDaughter(tv, "ECalBarrel", kECal);
1330 
1332  for( std::vector<DetId>::const_iterator it = vid.begin(), end = vid.end(); it != end; ++it)
1333  {
1334  EBDetId detid(*it);
1335  const CaloCellGeometry* cellb = (m_caloGeom->getGeometry(*it)).get();
1336  const TruncatedPyramid* cell = dynamic_cast<const TruncatedPyramid*>(cellb);
1337  if (!cell) { printf("ecalBarrel cell not a TruncatedPyramid !!\n"); return; }
1338 
1339  TGeoVolume* volume = nullptr;
1340  CaloVolMap::iterator volIt = caloShapeMap.find(cell->param());
1341  if ( volIt == caloShapeMap.end())
1342  {
1343  volume = new TGeoVolume( "EE TruncatedPyramid" , makeEcalShape(cell), GetMedium(kECal));
1344  caloShapeMap[cell->param()] = volume;
1345  }
1346  else {
1347  volume = volIt->second;
1348  }
1349  TGeoHMatrix* mtx= getEcalTrans(cell->getCorners());
1350  TGeoVolume* holder = GetDaughter(assembly, "side", kECal, detid.zside());
1351  holder = GetDaughter(holder, "ieta", kECal, detid.ieta());
1352  std::stringstream nname;
1353  nname << detid;
1354  AddLeafNode(holder, volume, nname.str().c_str(), mtx);
1355  }
1356  }
1357 
1358 
1359  {
1360  TGeoVolume *assembly = GetDaughter(tv, "ECalEndcap", kECal);
1361 
1363  for( std::vector<DetId>::const_iterator it = vid.begin(), end = vid.end(); it != end; ++it)
1364  {
1365  EEDetId detid(*it);
1366  const CaloCellGeometry* cellb = (m_caloGeom->getGeometry(*it)).get();
1367  const TruncatedPyramid* cell = dynamic_cast<const TruncatedPyramid*>(cellb);
1368  if (!cell) { printf("ecalEndcap cell not a TruncatedPyramid !!\n"); continue;}
1369 
1370  TGeoVolume* volume = nullptr;
1371  CaloVolMap::iterator volIt = caloShapeMap.find(cell->param());
1372  if ( volIt == caloShapeMap.end())
1373  {
1374 
1375  volume = new TGeoVolume( "EE TruncatedPyramid" , makeEcalShape(cell), GetMedium(kECal));
1376  caloShapeMap[cell->param()] = volume;
1377  }
1378  else {
1379  volume = volIt->second;
1380  }
1381  TGeoHMatrix* mtx= getEcalTrans(cell->getCorners());
1382  TGeoVolume* holder = GetDaughter(assembly, "side", kECal, detid.zside());
1383  holder = GetDaughter(holder, "ix", kECal, detid.ix());
1384  std::stringstream nname;
1385  nname << detid;
1386  AddLeafNode(holder, volume, nname.str().c_str(), mtx);
1387  }
1388  }
1389 }
const CCGFloat * param() const
TGeoHMatrix * getEcalTrans(CaloCellGeometry::CornersVec const &gc)
#define end
Definition: vmac.h:39
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:97
std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
Definition: CaloGeometry.cc:80
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
void FWTGeoRecoGeometryESProducer::addGEMGeometry ( void  )
private

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

742 {
743  try {
745  const GEMGeometry* gemGeom = (const GEMGeometry*) m_geomRecord->slaveGeometry( detId );
746 
747  TGeoVolume* tv = GetTopHolder("Muon", kMuonRPC);
748  TGeoVolume *assemblyTop = GetDaughter(tv, "GEM", kMuonGEM);
749 
750  {
751  TGeoVolume *assembly = GetDaughter(assemblyTop, "GEMSuperChambers", kMuonGEM);
752  for( auto it = gemGeom->superChambers().begin(),
753  end = gemGeom->superChambers().end();
754  it != end; ++it )
755  {
756  const GEMSuperChamber* sc = (*it);
757  if( sc )
758  {
759  GEMDetId detid = sc->geographicalId();
760  std::stringstream s;
761  s << detid;
762  std::string name = s.str();
763 
764  TGeoVolume* child = createVolume( name, sc, kMuonGEM );
765 
766  TGeoVolume* holder = GetDaughter(assembly, "SuperChamber Region", kMuonGEM , detid.region());
767  holder = GetDaughter(holder, "Ring", kMuonGEM , detid.ring());
768  holder = GetDaughter(holder, "Station", kMuonGEM , detid.station());
769  holder = GetDaughter(holder, "Chamber", kMuonGEM , detid.chamber());
770 
771  AddLeafNode(holder, child, name.c_str(), createPlacement(*it));
772  }
773  }
774  }
775 
776  {
777  TGeoVolume *assembly = GetDaughter(assemblyTop, "GEMetaPartitions", kMuonGEM);
778  for( auto it = gemGeom->etaPartitions().begin(),
779  end = gemGeom->etaPartitions().end();
780  it != end; ++it )
781  {
782  const GEMEtaPartition* roll = (*it);
783  if( roll )
784  {
785  GEMDetId detid = roll->geographicalId();
786  std::stringstream s;
787  s << detid;
788  std::string name = s.str();
789 
790  TGeoVolume* child = createVolume( name, roll, kMuonGEM );
791 
792  TGeoVolume* holder = GetDaughter(assembly, "ROLL Region", kMuonGEM , detid.region());
793  holder = GetDaughter(holder, "Ring", kMuonGEM , detid.ring());
794  holder = GetDaughter(holder, "Station", kMuonGEM , detid.station());
795  holder = GetDaughter(holder, "Layer", kMuonGEM , detid.layer());
796  holder = GetDaughter(holder, "Chamber", kMuonGEM , detid.chamber());
797 
798  AddLeafNode(holder, child, name.c_str(), createPlacement(*it));
799  }
800  }
801  }
802  }catch (cms::Exception &exception) {
803  edm::LogInfo("FWRecoGeometry") << "failed to produce GEM geometry " << exception.what() << std::endl;
804 
805  }
806 }
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
static const int GEM
Definition: MuonSubdetId.h:15
char const * what() const override
Definition: Exception.cc:141
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:39
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 891 of file FWTGeoRecoGeometryESProducer.cc.

References EnergyCorrector::c, PVValHelper::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(), hiPixelPairStep_cff::points, makeMuonMisalignmentScenario::rot, x, y, z, and HcalDetId::zside().

Referenced by produce().

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

Definition at line 969 of file FWTGeoRecoGeometryESProducer.cc.

References EnergyCorrector::c, PVValHelper::dz, end, CaloCellGeometry::etaPos(), CaloCellGeometry::getCorners(), GetDaughter(), CaloGeometry::getGeometry(), GetMedium(), GetTopHolder(), CaloGeometry::getValidDetIds(), DetId::Hcal, HcalEndcap, HcalDetId::ieta(), kHCal, IdealObliquePrism::localCorners(), m_caloGeom, CaloCellGeometry::param(), CaloCellGeometry::phiPos(), hiPixelPairStep_cff::points, makeMuonMisalignmentScenario::rot, and HcalDetId::zside().

Referenced by produce().

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

Definition at line 1117 of file FWTGeoRecoGeometryESProducer.cc.

References EnergyCorrector::c, PVValHelper::dz, end, CaloCellGeometry::etaPos(), CaloCellGeometry::getCorners(), GetDaughter(), CaloGeometry::getGeometry(), GetMedium(), GetTopHolder(), CaloGeometry::getValidDetIds(), DetId::Hcal, HcalForward, HcalDetId::ieta(), kHCal, IdealZPrism::localCorners(), m_caloGeom, CaloCellGeometry::param(), CaloCellGeometry::phiPos(), hiPixelPairStep_cff::points, makeMuonMisalignmentScenario::rot, and HcalDetId::zside().

Referenced by produce().

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

Definition at line 1049 of file FWTGeoRecoGeometryESProducer.cc.

References EnergyCorrector::c, PVValHelper::dz, end, CaloCellGeometry::etaPos(), CaloCellGeometry::getCorners(), GetDaughter(), CaloGeometry::getGeometry(), GetMedium(), GetTopHolder(), CaloGeometry::getValidDetIds(), DetId::Hcal, HcalOuter, HcalDetId::ieta(), kHCal, IdealObliquePrism::localCorners(), m_caloGeom, CaloCellGeometry::param(), CaloCellGeometry::phiPos(), hiPixelPairStep_cff::points, makeMuonMisalignmentScenario::rot, and HcalDetId::zside().

Referenced by produce().

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

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

847 {
848  TGeoVolume* tv = GetTopHolder("Muon", kMuonME0);
849  TGeoVolume *assembly = GetDaughter(tv, "ME0", kMuonME0);
850 
851  DetId detId( DetId::Muon, 5 );
852  try
853  {
854  const ME0Geometry* me0Geom = (const ME0Geometry*) m_geomRecord->slaveGeometry( detId );
855 
856  for(auto roll : me0Geom->etaPartitions())
857  {
858  if( roll )
859  {
860  unsigned int rawid = roll->geographicalId().rawId();
861  //std::cout << "AMT FWTTTTRecoGeometryES\n" << rawid ;
862 
863  ME0DetId detid(rawid);
864  std::stringstream s;
865  s << detid;
866  std::string name = s.str();
867  TGeoVolume* child = createVolume( name, roll, kMuonME0 );
868 
869  TGeoVolume* holder = GetDaughter(assembly, "Region", kMuonME0, detid.region());
870  holder = GetDaughter(holder, "Layer", kMuonME0, detid.layer());
871  holder = GetDaughter(holder, "Chamber", kMuonME0, detid.chamber());
872  AddLeafNode(holder, child, name.c_str(), createPlacement(roll));
873 
874 
875  }
876  }
877  }
878  catch( cms::Exception &exception )
879  {
880  edm::LogInfo("FWRecoGeometry") << "failed to produce ME0 geometry " << exception.what() << std::endl;
881  }
882 }
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
char const * what() const override
Definition: Exception.cc:141
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 458 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by produce().

459 {
460  TGeoVolume* tv = GetTopHolder( "SiPixel", kSiPixel );
461  TGeoVolume *assembly = GetDaughter( tv, "PXB", kSiPixel );
462 
463  for( auto it : m_trackerGeom->detsPXB()) {
464  DetId detid = it->geographicalId();
465  unsigned int layer = m_trackerTopology->pxbLayer( detid );
466  unsigned int module = m_trackerTopology->pxbModule( detid );
467  unsigned int ladder = m_trackerTopology->pxbLadder( detid );
468 
469  std::string name = Form( "PXB Ly:%d, Md:%d Ld:%d ", layer, module, ladder );
470  TGeoVolume* child = createVolume( name, it, kSiPixel );
471 
472  TGeoVolume* holder = GetDaughter( assembly, "Layer", kSiPixel, layer );
473  holder = GetDaughter( holder, "Module", kSiPixel, module );
474 
475  AddLeafNode( holder, child, name.c_str(), createPlacement( it ));
476  }
477 }
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 480 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().

481 {
482  TGeoVolume* tv = GetTopHolder( "SiPixel", kSiPixel );
483  TGeoVolume* assembly = GetDaughter( tv, "PXF", kSiPixel );
484 
485  for( auto it : m_trackerGeom->detsPXF()) {
486  DetId detid = it->geographicalId();
487  unsigned int disk = m_trackerTopology->pxfDisk( detid );
488  unsigned int blade = m_trackerTopology->pxfBlade( detid );
489  unsigned int panel = m_trackerTopology->pxfPanel( detid );
490  unsigned int side = m_trackerTopology->side( detid );
491 
492  std::string name = Form( "PXF D:%d, B:%d, P:%d, S:%d", disk, blade, panel, side );
493  TGeoVolume* child = createVolume( name, it, kSiPixel );
494 
495  TGeoVolume* holder = GetDaughter( assembly, "Side", kSiPixel, side );
496  holder = GetDaughter( holder, "Disk", kSiPixel, disk );
497  holder = GetDaughter( holder, "Blade", kSiPixel, blade );
498  holder = GetDaughter( holder, "Panel", kSiPixel, panel );
499 
500  AddLeafNode( holder, child, name.c_str(), createPlacement( it ));
501  }
502 }
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 812 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().

813 {
814  TGeoVolume* tv = GetTopHolder("Muon", kMuonRPC);
815  TGeoVolume *assembly = GetDaughter(tv, "RPC", kMuonRPC);
816 
818  const RPCGeometry* rpcGeom = (const RPCGeometry*) m_geomRecord->slaveGeometry( detId );
819  for( auto it = rpcGeom->rolls().begin(),
820  end = rpcGeom->rolls().end();
821  it != end; ++it )
822  {
823  RPCRoll const* roll = (*it);
824  if( roll )
825  {
826  RPCDetId detid = roll->geographicalId();
827  std::stringstream s;
828  s << detid;
829  std::string name = s.str();
830 
831  TGeoVolume* child = createVolume( name, roll, kMuonRPC );
832 
833  TGeoVolume* holder = GetDaughter(assembly, "ROLL Region", kMuonRPC, detid.region());
834  holder = GetDaughter(holder, "Ring", kMuonRPC, detid.ring());
835  holder = GetDaughter(holder, "Station", kMuonRPC, detid.station());
836  holder = GetDaughter(holder, "Sector", kMuonRPC, detid.sector());
837  holder = GetDaughter(holder, "Layer", kMuonRPC, detid.layer());
838  holder = GetDaughter(holder, "Subsector", kMuonRPC, detid.subsector());
839 
840  AddLeafNode(holder, child, name.c_str(), createPlacement(*it));
841  }
842  };
843 }
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:39
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 577 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().

578 {
579  TGeoVolume* tv = GetTopHolder( "SiStrip", kSiStrip );
580  TGeoVolume* assembly = GetDaughter( tv, "TEC", kSiStrip );
581 
582  for( auto it : m_trackerGeom->detsTEC()) {
583  DetId detid = it->geographicalId();
584  unsigned int order = m_trackerTopology->tecOrder( detid );
585  unsigned int ring = m_trackerTopology->tecRing( detid );
586  unsigned int module = m_trackerTopology->tecModule( detid );
587 
588  std::stringstream s;
589  s << TECDetId( detid );
590  std::string name = s.str();
591 
592  TGeoVolume* child = createVolume( name, it, kSiStrip );
593 
594  TGeoVolume* holder = GetDaughter( assembly, "Order", kSiStrip, order );
595  holder = GetDaughter( holder, "Ring", kSiStrip, ring );
596  holder = GetDaughter( holder, "Module", kSiStrip, module );
597  AddLeafNode( holder, child, name.c_str(), createPlacement( it ));
598  }
599 }
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 505 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().

506 {
507  TGeoVolume* tv = GetTopHolder( "SiStrip", kSiStrip );
508  TGeoVolume *assembly = GetDaughter( tv, "TIB", kSiStrip );
509 
510  for( auto it : m_trackerGeom->detsTIB()) {
511  DetId detid = it->geographicalId();
512  unsigned int module = m_trackerTopology->tibModule( detid );
513  unsigned int order = m_trackerTopology->tibOrder( detid );
514  unsigned int side = m_trackerTopology->tibSide( detid );
515 
516  std::stringstream s;
517  s << TIBDetId( detid );
518  std::string name = s.str();
519 
520  TGeoVolume* child = createVolume( name, it, kSiStrip );
521  TGeoVolume* holder = GetDaughter( assembly, "Module", kSiStrip, module );
522  holder = GetDaughter( holder, "Order", kSiStrip, order );
523  holder = GetDaughter( holder, "Side", kSiStrip, side );
524  AddLeafNode( holder, child, name.c_str(), createPlacement( it ));
525  }
526 }
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 529 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().

530 {
531  TGeoVolume* tv = GetTopHolder( "SiStrip", kSiStrip );
532  TGeoVolume* assembly = GetDaughter( tv, "TID", kSiStrip );
533 
534  for( auto it : m_trackerGeom->detsTID()) {
535  DetId detid = it->geographicalId();
536  unsigned int side = m_trackerTopology->tidSide( detid );
537  unsigned int wheel = m_trackerTopology->tidWheel( detid );
538  unsigned int ring = m_trackerTopology->tidRing( detid );
539 
540  std::stringstream s;
541  s << TIDDetId( detid );
542  std::string name = s.str();
543 
544  TGeoVolume* child = createVolume( name, it, kSiStrip );
545  TGeoVolume* holder = GetDaughter( assembly, "Side", kSiStrip, side );
546  holder = GetDaughter( holder, "Wheel", kSiStrip, wheel );
547  holder = GetDaughter( holder, "Ring", kSiStrip, ring );
548  AddLeafNode( holder, child, name.c_str(), createPlacement( it ));
549  }
550 }
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 553 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().

554 {
555  TGeoVolume* tv = GetTopHolder( "SiStrip", kSiStrip );
556  TGeoVolume* assembly = GetDaughter( tv, "TOB", kSiStrip );
557 
558  for( auto it : m_trackerGeom->detsTOB()) {
559  DetId detid = it->geographicalId();
560  unsigned int rod = m_trackerTopology->tobRod( detid );
561  unsigned int side = m_trackerTopology->tobSide( detid );
562  unsigned int module = m_trackerTopology->tobModule( detid );
563 
564  std::stringstream s;
565  s << TOBDetId( detid );
566  std::string name = s.str();
567 
568  TGeoVolume* child = createVolume( name, it, kSiStrip );
569  TGeoVolume* holder = GetDaughter( assembly, "Rod", kSiStrip, rod );
570  holder = GetDaughter( holder, "Side", kSiStrip, side );
571  holder = GetDaughter( holder, "Module", kSiStrip, module );
572  AddLeafNode( holder, child, name.c_str(), createPlacement( it ));
573  }
574 }
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 354 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by createVolume().

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

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

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

432 {
433  TGeoShape* solid = createShape( det );
434 
435  std::map<TGeoShape*, TGeoVolume*>::iterator vIt = m_shapeToVolume.find(solid);
436  if (vIt != m_shapeToVolume.end()) return vIt->second;
437 
438 
439  TGeoVolume* volume = new TGeoVolume( name.c_str(),solid, GetMedium(mid));
440 
441  m_shapeToVolume[solid] = volume;
442 
443  return volume;
444 }
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 = nullptr;
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:6
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 = nullptr;
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:6
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:6
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 ) {
274  record.getRecord<CaloGeometryRecord>().get(caloH);
275  m_caloGeom = caloH.product();
276  }
277 
278  TGeoManager* geom = new TGeoManager( "cmsGeo", "CMS Detector" );
279  if( nullptr == gGeoIdentity )
280  {
281  gGeoIdentity = new TGeoIdentity( "Identity" );
282  }
283 
284  m_fwGeometry->manager( geom );
285 
286  // Default material is Vacuum
287  TGeoMaterial *vacuum = new TGeoMaterial( "Vacuum", 0 ,0 ,0 );
288  m_dummyMedium = new TGeoMedium( "reco", 0, vacuum);
289 
290  TGeoVolume *top = geom->MakeBox( "CMS", m_dummyMedium, 270., 270., 120. );
291 
292  if( nullptr == top )
293  {
294  return std::shared_ptr<FWTGeoRecoGeometry>();
295  }
296  geom->SetTopVolume( top );
297  // ROOT chokes unless colors are assigned
298  top->SetVisibility( kFALSE );
299  top->SetLineColor( kBlue );
300 
301  if( m_tracker || m_muon )
302  {
304  }
305 
306  if( m_tracker )
307  {
308  DetId detId( DetId::Tracker, 0 );
310 
311  edm::ESHandle<TrackerTopology> trackerTopologyHandle;
312  record.getRecord<TrackerTopologyRcd>().get( trackerTopologyHandle );
313  m_trackerTopology = trackerTopologyHandle.product();
314 
317 
318  addTIBGeometry();
319  addTIDGeometry();
320  addTOBGeometry();
321  addTECGeometry();
322  }
323 
324  if( m_muon )
325  {
326  addDTGeometry();
327  addCSCGeometry();
328  addRPCGeometry();
329  addME0Geometry();
330  addGEMGeometry();
331  }
332 
333  if( m_calo )
334  {
341  }
342 
343  geom->CloseGeometry();
344 
345  geom->DefaultColors();
346  // printf("==== geo manager NNodes = %d \n", geom->GetNNodes());
347  geom->CloseGeometry();
348 
349  return m_fwGeometry;
350 }
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().

const 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