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

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

65  : m_dummyMedium(nullptr)
66 {
67  m_tracker = pset.getUntrackedParameter<bool>( "Tracker", true );
68  m_muon = pset.getUntrackedParameter<bool>( "Muon", true );
69  m_calo = pset.getUntrackedParameter<bool>( "Calo", true );
70 
71  setWhatProduced( this );
72 }
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 1173 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().

1174 {
1175  CaloVolMap caloShapeMapP;
1176  CaloVolMap caloShapeMapN;
1177 
1178  TGeoVolume* tv = GetTopHolder("CaloTower", kCaloTower);
1179  TGeoVolume *assembly = GetDaughter(tv, "CaloTower", kCaloTower);
1180 
1182  for( std::vector<DetId>::const_iterator it = vid.begin(), end = vid.end(); it != end; ++it)
1183  {
1184  CaloTowerDetId detid = CaloTowerDetId(it->rawId());
1185  const CaloCellGeometry* cellb = (m_caloGeom->getGeometry(*it)).get();
1186  const IdealObliquePrism* cell = dynamic_cast<const IdealObliquePrism*> (cellb);
1187  if (!cell) { printf ("EC not oblique \n"); continue; }
1188  TGeoVolume* volume = nullptr;
1189  CaloVolMap& caloShapeMap = (cell->etaPos() > 0) ? caloShapeMapP : caloShapeMapN;
1190  CaloVolMap::iterator volIt = caloShapeMap.find(cell->param());
1191  if ( volIt == caloShapeMap.end())
1192  {
1195  IdealObliquePrism::localCorners( lc, cell->param(), ref);
1196  HepGeom::Vector3D<float> lCenter;
1197  for( int c = 0; c < 8; ++c)
1198  lCenter += lc[c];
1199  lCenter *= 0.125;
1200 
1201  static const int arrP[] = { 3, 2, 1, 0, 7, 6, 5, 4 };
1202  static const int arrN[] = { 7, 6, 5, 4 ,3, 2, 1, 0};
1203  const int* arr = (detid.ieta() > 0) ? &arrP[0] : &arrN[0];
1204 
1205  double points[16];
1206  for (int c = 0; c < 8; ++c) {
1207  points[ c*2 + 0 ] = lc[arr[c]].x() - lCenter.x();
1208  points[ c*2 + 1 ] = lc[arr[c]].y() - lCenter.y();
1209  }
1210 
1211  float dz = (lc[4].z() -lc[0].z()) * 0.5;
1212  TGeoShape* solid = new TGeoArb8(dz, &points[0]);
1213  volume = new TGeoVolume("ecal oblique prism", solid, GetMedium(kCaloTower));
1214  caloShapeMap[cell->param()] = volume;
1215  }
1216  else {
1217  volume = volIt->second;
1218  }
1219 
1220  HepGeom::Vector3D<float> gCenter;
1221  CaloCellGeometry::CornersVec const & gc = cell->getCorners();
1222  for (int c = 0; c < 8; ++c) {
1223  gCenter += HepGeom::Vector3D<float>(gc[c].x(), gc[c].y(), gc[c].z());
1224  }
1225  gCenter *= 0.125;
1226 
1227  TGeoTranslation gtr(gCenter.x(), gCenter.y(), gCenter.z());
1228  TGeoRotation rot;
1229  rot.SetAngles(cell->phiPos()*TMath::RadToDeg(), 0, 0);
1230 
1231  TGeoVolume* holder = GetDaughter(assembly, "side", kCaloTower, detid.zside());
1232  holder = GetDaughter(holder, "ieta", kCaloTower, detid.ieta());
1233  std::stringstream nname;
1234  nname << detid;
1235  AddLeafNode(holder, volume, nname.str().c_str(), new TGeoCombiTrans(gtr, rot));
1236  }
1237 }
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.
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:85
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 686 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().

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

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

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

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

730 {
731  try {
733  const GEMGeometry* gemGeom = (const GEMGeometry*) m_geomRecord->slaveGeometry( detId );
734 
735  TGeoVolume* tv = GetTopHolder("Muon", kMuonRPC);
736  TGeoVolume *assemblyTop = GetDaughter(tv, "GEM", kMuonGEM);
737 
738  {
739  TGeoVolume *assembly = GetDaughter(assemblyTop, "GEMSuperChambers", kMuonGEM);
740  for( auto it = gemGeom->superChambers().begin(),
741  end = gemGeom->superChambers().end();
742  it != end; ++it )
743  {
744  const GEMSuperChamber* sc = (*it);
745  if( sc )
746  {
747  GEMDetId detid = sc->geographicalId();
748  std::stringstream s;
749  s << detid;
750  std::string name = s.str();
751 
752  TGeoVolume* child = createVolume( name, sc, kMuonGEM );
753 
754  TGeoVolume* holder = GetDaughter(assembly, "SuperChamber Region", kMuonGEM , detid.region());
755  holder = GetDaughter(holder, "Ring", kMuonGEM , detid.ring());
756  holder = GetDaughter(holder, "Station", kMuonGEM , detid.station());
757  holder = GetDaughter(holder, "Chamber", kMuonGEM , detid.chamber());
758 
759  AddLeafNode(holder, child, name.c_str(), createPlacement(*it));
760  }
761  }
762  }
763 
764  {
765  TGeoVolume *assembly = GetDaughter(assemblyTop, "GEMetaPartitions", kMuonGEM);
766  for( auto it = gemGeom->etaPartitions().begin(),
767  end = gemGeom->etaPartitions().end();
768  it != end; ++it )
769  {
770  const GEMEtaPartition* roll = (*it);
771  if( roll )
772  {
773  GEMDetId detid = roll->geographicalId();
774  std::stringstream s;
775  s << detid;
776  std::string name = s.str();
777 
778  TGeoVolume* child = createVolume( name, roll, kMuonGEM );
779 
780  TGeoVolume* holder = GetDaughter(assembly, "ROLL Region", kMuonGEM , detid.region());
781  holder = GetDaughter(holder, "Ring", kMuonGEM , detid.ring());
782  holder = GetDaughter(holder, "Station", kMuonGEM , detid.station());
783  holder = GetDaughter(holder, "Layer", kMuonGEM , detid.layer());
784  holder = GetDaughter(holder, "Chamber", kMuonGEM , detid.chamber());
785 
786  AddLeafNode(holder, child, name.c_str(), createPlacement(*it));
787  }
788  }
789  }
790  }catch (cms::Exception &exception) {
791  edm::LogInfo("FWRecoGeometry") << "failed to produce GEM geometry " << exception.what() << std::endl;
792 
793  }
794 }
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 879 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().

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

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

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

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

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

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

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

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

835 {
836  TGeoVolume* tv = GetTopHolder("Muon", kMuonME0);
837  TGeoVolume *assembly = GetDaughter(tv, "ME0", kMuonME0);
838 
839  DetId detId( DetId::Muon, 5 );
840  try
841  {
842  const ME0Geometry* me0Geom = (const ME0Geometry*) m_geomRecord->slaveGeometry( detId );
843 
844  for(auto roll : me0Geom->etaPartitions())
845  {
846  if( roll )
847  {
848  unsigned int rawid = roll->geographicalId().rawId();
849  //std::cout << "AMT FWTTTTRecoGeometryES\n" << rawid ;
850 
851  ME0DetId detid(rawid);
852  std::stringstream s;
853  s << detid;
854  std::string name = s.str();
855  TGeoVolume* child = createVolume( name, roll, kMuonME0 );
856 
857  TGeoVolume* holder = GetDaughter(assembly, "Region", kMuonME0, detid.region());
858  holder = GetDaughter(holder, "Layer", kMuonME0, detid.layer());
859  holder = GetDaughter(holder, "Chamber", kMuonME0, detid.chamber());
860  AddLeafNode(holder, child, name.c_str(), createPlacement(roll));
861 
862 
863  }
864  }
865  }
866  catch( cms::Exception &exception )
867  {
868  edm::LogInfo("FWRecoGeometry") << "failed to produce ME0 geometry " << exception.what() << std::endl;
869  }
870 }
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 454 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().

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

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

801 {
802  TGeoVolume* tv = GetTopHolder("Muon", kMuonRPC);
803  TGeoVolume *assembly = GetDaughter(tv, "RPC", kMuonRPC);
804 
806  const RPCGeometry* rpcGeom = (const RPCGeometry*) m_geomRecord->slaveGeometry( detId );
807  for( auto it = rpcGeom->rolls().begin(),
808  end = rpcGeom->rolls().end();
809  it != end; ++it )
810  {
811  RPCRoll const* roll = (*it);
812  if( roll )
813  {
814  RPCDetId detid = roll->geographicalId();
815  std::stringstream s;
816  s << detid;
817  std::string name = s.str();
818 
819  TGeoVolume* child = createVolume( name, roll, kMuonRPC );
820 
821  TGeoVolume* holder = GetDaughter(assembly, "ROLL Region", kMuonRPC, detid.region());
822  holder = GetDaughter(holder, "Ring", kMuonRPC, detid.ring());
823  holder = GetDaughter(holder, "Station", kMuonRPC, detid.station());
824  holder = GetDaughter(holder, "Sector", kMuonRPC, detid.sector());
825  holder = GetDaughter(holder, "Layer", kMuonRPC, detid.layer());
826  holder = GetDaughter(holder, "Subsector", kMuonRPC, detid.subsector());
827 
828  AddLeafNode(holder, child, name.c_str(), createPlacement(*it));
829  }
830  };
831 }
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 567 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by produce().

568 {
569  TGeoVolume* tv = GetTopHolder( "SiStrip", kSiStrip );
570  TGeoVolume* assembly = GetDaughter( tv, "TEC", kSiStrip );
571 
572  for( auto it : m_trackerGeom->detsTEC()) {
573  DetId detid = it->geographicalId();
574  unsigned int order = m_trackerTopology->tecOrder( detid );
575  unsigned int ring = m_trackerTopology->tecRing( detid );
576  unsigned int module = m_trackerTopology->tecModule( detid );
577 
579 
580  TGeoVolume* child = createVolume( name, it, kSiStrip );
581 
582  TGeoVolume* holder = GetDaughter( assembly, "Order", kSiStrip, order );
583  holder = GetDaughter( holder, "Ring", kSiStrip, ring );
584  holder = GetDaughter( holder, "Module", kSiStrip, module );
585  AddLeafNode( holder, child, name.c_str(), createPlacement( it ));
586  }
587 }
unsigned int tecRing(const DetId &id) const
ring id
std::string print(DetId detid) const
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 501 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by produce().

502 {
503  TGeoVolume* tv = GetTopHolder( "SiStrip", kSiStrip );
504  TGeoVolume *assembly = GetDaughter( tv, "TIB", kSiStrip );
505 
506  for( auto it : m_trackerGeom->detsTIB()) {
507  DetId detid = it->geographicalId();
508  unsigned int module = m_trackerTopology->tibModule( detid );
509  unsigned int order = m_trackerTopology->tibOrder( detid );
510  unsigned int side = m_trackerTopology->tibSide( detid );
511 
513 
514  TGeoVolume* child = createVolume( name, it, kSiStrip );
515  TGeoVolume* holder = GetDaughter( assembly, "Module", kSiStrip, module );
516  holder = GetDaughter( holder, "Order", kSiStrip, order );
517  holder = GetDaughter( holder, "Side", kSiStrip, side );
518  AddLeafNode( holder, child, name.c_str(), createPlacement( it ));
519  }
520 }
std::string print(DetId detid) const
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 523 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by produce().

524 {
525  TGeoVolume* tv = GetTopHolder( "SiStrip", kSiStrip );
526  TGeoVolume* assembly = GetDaughter( tv, "TID", kSiStrip );
527 
528  for( auto it : m_trackerGeom->detsTID()) {
529  DetId detid = it->geographicalId();
530  unsigned int side = m_trackerTopology->tidSide( detid );
531  unsigned int wheel = m_trackerTopology->tidWheel( detid );
532  unsigned int ring = m_trackerTopology->tidRing( detid );
533 
535 
536  TGeoVolume* child = createVolume( name, it, kSiStrip );
537  TGeoVolume* holder = GetDaughter( assembly, "Side", kSiStrip, side );
538  holder = GetDaughter( holder, "Wheel", kSiStrip, wheel );
539  holder = GetDaughter( holder, "Ring", kSiStrip, ring );
540  AddLeafNode( holder, child, name.c_str(), createPlacement( it ));
541  }
542 }
unsigned int tidRing(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
std::string print(DetId detid) 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 545 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by produce().

546 {
547  TGeoVolume* tv = GetTopHolder( "SiStrip", kSiStrip );
548  TGeoVolume* assembly = GetDaughter( tv, "TOB", kSiStrip );
549 
550  for( auto it : m_trackerGeom->detsTOB()) {
551  DetId detid = it->geographicalId();
552  unsigned int rod = m_trackerTopology->tobRod( detid );
553  unsigned int side = m_trackerTopology->tobSide( detid );
554  unsigned int module = m_trackerTopology->tobModule( detid );
555 
557 
558  TGeoVolume* child = createVolume( name, it, kSiStrip );
559  TGeoVolume* holder = GetDaughter( assembly, "Rod", kSiStrip, rod );
560  holder = GetDaughter( holder, "Side", kSiStrip, side );
561  holder = GetDaughter( holder, "Module", kSiStrip, module );
562  AddLeafNode( holder, child, name.c_str(), createPlacement( it ));
563  }
564 }
std::string print(DetId detid) const
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 350 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().

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

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

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

428 {
429  TGeoShape* solid = createShape( det );
430 
431  std::map<TGeoShape*, TGeoVolume*>::iterator vIt = m_shapeToVolume.find(solid);
432  if (vIt != m_shapeToVolume.end()) return vIt->second;
433 
434 
435  TGeoVolume* volume = new TGeoVolume( name.c_str(),solid, GetMedium(mid));
436 
437  m_shapeToVolume[solid] = volume;
438 
439  return volume;
440 }
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 116 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().

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

Definition at line 133 of file FWTGeoRecoGeometryESProducer.cc.

References GetMedium(), and gen::n.

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

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

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

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

152 {
153  // printf("GetTopHolder res = %s \n", prefix);
154  TGeoVolume* res = GetDaughter(gGeoManager->GetTopVolume(), prefix, cidx);
155  return res;
156 }
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 262 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().

263 {
264  using namespace edm;
265 
266  m_fwGeometry = std::make_shared<FWTGeoRecoGeometry>();
267 
268  if( m_calo ) {
270  record.getRecord<CaloGeometryRecord>().get(caloH);
271  m_caloGeom = caloH.product();
272  }
273 
274  TGeoManager* geom = new TGeoManager( "cmsGeo", "CMS Detector" );
275  if( nullptr == gGeoIdentity )
276  {
277  gGeoIdentity = new TGeoIdentity( "Identity" );
278  }
279 
280  m_fwGeometry->manager( geom );
281 
282  // Default material is Vacuum
283  TGeoMaterial *vacuum = new TGeoMaterial( "Vacuum", 0 ,0 ,0 );
284  m_dummyMedium = new TGeoMedium( "reco", 0, vacuum);
285 
286  TGeoVolume *top = geom->MakeBox( "CMS", m_dummyMedium, 270., 270., 120. );
287 
288  if( nullptr == top )
289  {
290  return std::shared_ptr<FWTGeoRecoGeometry>();
291  }
292  geom->SetTopVolume( top );
293  // ROOT chokes unless colors are assigned
294  top->SetVisibility( kFALSE );
295  top->SetLineColor( kBlue );
296 
297  if( m_tracker || m_muon )
298  {
300  }
301 
302  if( m_tracker )
303  {
304  DetId detId( DetId::Tracker, 0 );
306 
307  edm::ESHandle<TrackerTopology> trackerTopologyHandle;
308  record.getRecord<TrackerTopologyRcd>().get( trackerTopologyHandle );
309  m_trackerTopology = trackerTopologyHandle.product();
310 
313 
314  addTIBGeometry();
315  addTIDGeometry();
316  addTOBGeometry();
317  addTECGeometry();
318  }
319 
320  if( m_muon )
321  {
322  addDTGeometry();
323  addCSCGeometry();
324  addRPCGeometry();
325  addME0Geometry();
326  addGEMGeometry();
327  }
328 
329  if( m_calo )
330  {
337  }
338 
339  geom->CloseGeometry();
340 
341  geom->DefaultColors();
342  // printf("==== geo manager NNodes = %d \n", geom->GetNNodes());
343  geom->CloseGeometry();
344 
345  return m_fwGeometry;
346 }
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