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::unique_ptr< FWTGeoRecoGeometryproduce (const FWTGeoRecoGeometryRecord &)
 
 ~FWTGeoRecoGeometryESProducer (void) override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename Record >
void updateFromMayConsumes (unsigned int iIndex, const Record &iRecord)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
 ESProxyFactoryProducer (const ESProxyFactoryProducer &)=delete
 
const ESProxyFactoryProduceroperator= (const ESProxyFactoryProducer &)=delete
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
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
 
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

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProxyFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy >>>
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
ESConsumesCollectorT< TRecord > setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
- 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 EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 

Detailed Description

Definition at line 28 of file FWTGeoRecoGeometryESProducer.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Definition at line 63 of file FWTGeoRecoGeometryESProducer.cc.

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

63  : m_dummyMedium(nullptr) {
64  m_tracker = pset.getUntrackedParameter<bool>("Tracker", true);
65  m_muon = pset.getUntrackedParameter<bool>("Muon", true);
66  m_calo = pset.getUntrackedParameter<bool>("Calo", true);
67 
68  setWhatProduced(this);
69 }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
T getUntrackedParameter(std::string const &, T const &) const
FWTGeoRecoGeometryESProducer::~FWTGeoRecoGeometryESProducer ( void  )
override
FWTGeoRecoGeometryESProducer::FWTGeoRecoGeometryESProducer ( const FWTGeoRecoGeometryESProducer )
private

Member Function Documentation

void FWTGeoRecoGeometryESProducer::addCaloTowerGeometry ( )
private

Definition at line 1062 of file FWTGeoRecoGeometryESProducer.cc.

References HltBtagPostValidation_cff::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(), HLT_2018_cff::points, makeMuonMisalignmentScenario::rot, CaloTowerDetId::SubdetId, and CaloTowerDetId::zside().

Referenced by produce().

1062  {
1063  CaloVolMap caloShapeMapP;
1064  CaloVolMap caloShapeMapN;
1065 
1066  TGeoVolume* tv = GetTopHolder("CaloTower", kCaloTower);
1067  TGeoVolume* assembly = GetDaughter(tv, "CaloTower", kCaloTower);
1068 
1070  for (std::vector<DetId>::const_iterator it = vid.begin(), end = vid.end(); it != end; ++it) {
1071  CaloTowerDetId detid = CaloTowerDetId(it->rawId());
1072  const CaloCellGeometry* cellb = (m_caloGeom->getGeometry(*it)).get();
1073  const IdealObliquePrism* cell = dynamic_cast<const IdealObliquePrism*>(cellb);
1074  if (!cell) {
1075  printf("EC not oblique \n");
1076  continue;
1077  }
1078  TGeoVolume* volume = nullptr;
1079  CaloVolMap& caloShapeMap = (cell->etaPos() > 0) ? caloShapeMapP : caloShapeMapN;
1080  CaloVolMap::iterator volIt = caloShapeMap.find(cell->param());
1081  if (volIt == caloShapeMap.end()) {
1084  IdealObliquePrism::localCorners(lc, cell->param(), ref);
1085  HepGeom::Vector3D<float> lCenter;
1086  for (int c = 0; c < 8; ++c)
1087  lCenter += lc[c];
1088  lCenter *= 0.125;
1089 
1090  static const int arrP[] = {3, 2, 1, 0, 7, 6, 5, 4};
1091  static const int arrN[] = {7, 6, 5, 4, 3, 2, 1, 0};
1092  const int* arr = (detid.ieta() > 0) ? &arrP[0] : &arrN[0];
1093 
1094  double points[16];
1095  for (int c = 0; c < 8; ++c) {
1096  points[c * 2 + 0] = lc[arr[c]].x() - lCenter.x();
1097  points[c * 2 + 1] = lc[arr[c]].y() - lCenter.y();
1098  }
1099 
1100  float dz = (lc[4].z() - lc[0].z()) * 0.5;
1101  TGeoShape* solid = new TGeoArb8(dz, &points[0]);
1102  volume = new TGeoVolume("ecal oblique prism", solid, GetMedium(kCaloTower));
1103  caloShapeMap[cell->param()] = volume;
1104  } else {
1105  volume = volIt->second;
1106  }
1107 
1108  HepGeom::Vector3D<float> gCenter;
1109  CaloCellGeometry::CornersVec const& gc = cell->getCorners();
1110  for (int c = 0; c < 8; ++c) {
1111  gCenter += HepGeom::Vector3D<float>(gc[c].x(), gc[c].y(), gc[c].z());
1112  }
1113  gCenter *= 0.125;
1114 
1115  TGeoTranslation gtr(gCenter.x(), gCenter.y(), gCenter.z());
1116  TGeoRotation rot;
1117  rot.SetAngles(cell->phiPos() * TMath::RadToDeg(), 0, 0);
1118 
1119  TGeoVolume* holder = GetDaughter(assembly, "side", kCaloTower, detid.zside());
1120  holder = GetDaughter(holder, "ieta", kCaloTower, detid.ieta());
1121  std::stringstream nname;
1122  nname << detid;
1123  AddLeafNode(holder, volume, nname.str().c_str(), new TGeoCombiTrans(gtr, rot));
1124  }
1125 }
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:75
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:60
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
int ieta() const
get the tower ieta
CaloCellGeometry::Pt3DVec Pt3DVec
void FWTGeoRecoGeometryESProducer::addCSCGeometry ( )
private

Definition at line 623 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by produce().

623  {
625  throw cms::Exception("FatalError") << "Cannnot find CSCGeometry\n";
626 
627  TGeoVolume* tv = GetTopHolder("Muon", kMuonRPC);
628  TGeoVolume* assembly = GetDaughter(tv, "CSC", kMuonCSC);
629 
630  auto const& cscGeom = m_geomRecord->slaveGeometry(CSCDetId())->dets();
631  for (auto it = cscGeom.begin(), itEnd = cscGeom.end(); it != itEnd; ++it) {
632  unsigned int rawid = (*it)->geographicalId();
633  CSCDetId detId(rawid);
634  std::stringstream s;
635  s << "CSC" << detId;
636  std::string name = s.str();
637 
638  TGeoVolume* child = nullptr;
639 
640  if (auto chamber = dynamic_cast<const CSCChamber*>(*it))
641  child = createVolume(name, chamber, kMuonCSC);
642  else if (auto* layer = dynamic_cast<const CSCLayer*>(*it))
643  child = createVolume(name, layer, kMuonCSC);
644 
645  if (child) {
646  TGeoVolume* holder = GetDaughter(assembly, "Endcap", kMuonCSC, detId.endcap());
647  holder = GetDaughter(holder, "Station", kMuonCSC, detId.station());
648  holder = GetDaughter(holder, "Ring", kMuonCSC, detId.ring());
649  holder = GetDaughter(holder, "Chamber", kMuonCSC, detId.chamber());
650 
651  // holder->AddNode(child, 1, createPlacement( *it ));
652  AddLeafNode(holder, child, name.c_str(), createPlacement(*it));
653  }
654  }
655 }
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
TGeoCombiTrans * createPlacement(const Rotation3D &iRot, const Position &iTrans)
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 ( )
private

Definition at line 549 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by produce().

549  {
550  TGeoVolume* tv = GetTopHolder("Muon", kMuonRPC);
551  TGeoVolume* assemblyTop = GetDaughter(tv, "DT", kMuonDT);
552 
553  //
554  // DT chambers geometry
555  //
556  {
557  TGeoVolume* assembly = GetDaughter(assemblyTop, "DTChamber", kMuonDT);
558  auto const& dtChamberGeom = m_geomRecord->slaveGeometry(DTChamberId())->dets();
559  for (auto it = dtChamberGeom.begin(), end = dtChamberGeom.end(); it != end; ++it) {
560  if (auto chamber = dynamic_cast<const DTChamber*>(*it)) {
561  DTChamberId detid = chamber->geographicalId();
562  std::stringstream s;
563  s << detid;
564  std::string name = s.str();
565 
566  TGeoVolume* child = createVolume(name, chamber, kMuonDT);
567  TGeoVolume* holder = GetDaughter(assembly, "Wheel", kMuonDT, detid.wheel());
568  holder = GetDaughter(holder, "Station", kMuonDT, detid.station());
569  holder = GetDaughter(holder, "Sector", kMuonDT, detid.sector());
570 
571  AddLeafNode(holder, child, name.c_str(), createPlacement(chamber));
572  }
573  }
574  }
575 
576  // Fill in DT super layer parameters
577  {
578  TGeoVolume* assembly = GetDaughter(assemblyTop, "DTSuperLayer", kMuonDT);
579  auto const& dtSuperLayerGeom = m_geomRecord->slaveGeometry(DTSuperLayerId())->dets();
580  for (auto it = dtSuperLayerGeom.begin(), end = dtSuperLayerGeom.end(); it != end; ++it) {
581  if (auto* superlayer = dynamic_cast<const DTSuperLayer*>(*it)) {
582  DTSuperLayerId detid(DetId(superlayer->geographicalId()));
583  std::stringstream s;
584  s << detid;
585  std::string name = s.str();
586 
587  TGeoVolume* child = createVolume(name, superlayer, kMuonDT);
588 
589  TGeoVolume* holder = GetDaughter(assembly, "Wheel", kMuonDT, detid.wheel());
590  holder = GetDaughter(holder, "Station", kMuonDT, detid.station());
591  holder = GetDaughter(holder, "Sector", kMuonDT, detid.sector());
592  holder = GetDaughter(holder, "SuperLayer", kMuonDT, detid.superlayer());
593  AddLeafNode(holder, child, name.c_str(), createPlacement(superlayer));
594  }
595  }
596  }
597  // Fill in DT layer parameters
598  {
599  TGeoVolume* assembly = GetDaughter(assemblyTop, "DTLayer", kMuonDT);
600  auto const& dtLayerGeom = m_geomRecord->slaveGeometry(DTLayerId())->dets();
601  for (auto it = dtLayerGeom.begin(), end = dtLayerGeom.end(); it != end; ++it) {
602  if (auto layer = dynamic_cast<const DTLayer*>(*it)) {
603  DTLayerId detid(DetId(layer->geographicalId()));
604 
605  std::stringstream s;
606  s << detid;
607  std::string name = s.str();
608 
609  TGeoVolume* child = createVolume(name, layer, kMuonDT);
610 
611  TGeoVolume* holder = GetDaughter(assembly, "Wheel", kMuonDT, detid.wheel());
612  holder = GetDaughter(holder, "Station", kMuonDT, detid.station());
613  holder = GetDaughter(holder, "Sector", kMuonDT, detid.sector());
614  holder = GetDaughter(holder, "SuperLayer", kMuonDT, detid.superlayer());
615  holder = GetDaughter(holder, "Layer", kMuonDT, detid.layer());
616  AddLeafNode(holder, child, name.c_str(), createPlacement(layer));
617  }
618  }
619  }
620 }
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
TGeoCombiTrans * createPlacement(const Rotation3D &iRot, const Position &iTrans)
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:17
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 1189 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().

1189  {
1190  TGeoVolume* tv = GetTopHolder("ECal", kECal);
1191  CaloVolMap caloShapeMap;
1192 
1193  {
1194  TGeoVolume* assembly = GetDaughter(tv, "ECalBarrel", kECal);
1195 
1197  for (std::vector<DetId>::const_iterator it = vid.begin(), end = vid.end(); it != end; ++it) {
1198  EBDetId detid(*it);
1199  const CaloCellGeometry* cellb = (m_caloGeom->getGeometry(*it)).get();
1200  const TruncatedPyramid* cell = dynamic_cast<const TruncatedPyramid*>(cellb);
1201  if (!cell) {
1202  printf("ecalBarrel cell not a TruncatedPyramid !!\n");
1203  return;
1204  }
1205 
1206  TGeoVolume* volume = nullptr;
1207  CaloVolMap::iterator volIt = caloShapeMap.find(cell->param());
1208  if (volIt == caloShapeMap.end()) {
1209  volume = new TGeoVolume("EE TruncatedPyramid", makeEcalShape(cell), GetMedium(kECal));
1210  caloShapeMap[cell->param()] = volume;
1211  } else {
1212  volume = volIt->second;
1213  }
1214  TGeoHMatrix* mtx = getEcalTrans(cell->getCorners());
1215  TGeoVolume* holder = GetDaughter(assembly, "side", kECal, detid.zside());
1216  holder = GetDaughter(holder, "ieta", kECal, detid.ieta());
1217  std::stringstream nname;
1218  nname << detid;
1219  AddLeafNode(holder, volume, nname.str().c_str(), mtx);
1220  }
1221  }
1222 
1223  {
1224  TGeoVolume* assembly = GetDaughter(tv, "ECalEndcap", kECal);
1225 
1227  for (std::vector<DetId>::const_iterator it = vid.begin(), end = vid.end(); it != end; ++it) {
1228  EEDetId detid(*it);
1229  const CaloCellGeometry* cellb = (m_caloGeom->getGeometry(*it)).get();
1230  const TruncatedPyramid* cell = dynamic_cast<const TruncatedPyramid*>(cellb);
1231  if (!cell) {
1232  printf("ecalEndcap cell not a TruncatedPyramid !!\n");
1233  continue;
1234  }
1235 
1236  TGeoVolume* volume = nullptr;
1237  CaloVolMap::iterator volIt = caloShapeMap.find(cell->param());
1238  if (volIt == caloShapeMap.end()) {
1239  volume = new TGeoVolume("EE TruncatedPyramid", makeEcalShape(cell), GetMedium(kECal));
1240  caloShapeMap[cell->param()] = volume;
1241  } else {
1242  volume = volIt->second;
1243  }
1244  TGeoHMatrix* mtx = getEcalTrans(cell->getCorners());
1245  TGeoVolume* holder = GetDaughter(assembly, "side", kECal, detid.zside());
1246  holder = GetDaughter(holder, "ix", kECal, detid.ix());
1247  std::stringstream nname;
1248  nname << detid;
1249  AddLeafNode(holder, volume, nname.str().c_str(), mtx);
1250  }
1251  }
1252 }
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:75
std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
Definition: CaloGeometry.cc:60
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
void FWTGeoRecoGeometryESProducer::addGEMGeometry ( )
private

Definition at line 659 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by produce().

659  {
660  try {
662  const GEMGeometry* gemGeom = (const GEMGeometry*)m_geomRecord->slaveGeometry(detId);
663 
664  TGeoVolume* tv = GetTopHolder("Muon", kMuonRPC);
665  TGeoVolume* assemblyTop = GetDaughter(tv, "GEM", kMuonGEM);
666 
667  {
668  TGeoVolume* assembly = GetDaughter(assemblyTop, "GEMSuperChambers", kMuonGEM);
669  for (auto it = gemGeom->superChambers().begin(), end = gemGeom->superChambers().end(); it != end; ++it) {
670  const GEMSuperChamber* sc = (*it);
671  if (sc) {
672  GEMDetId detid = sc->geographicalId();
673  std::stringstream s;
674  s << detid;
675  std::string name = s.str();
676 
677  TGeoVolume* child = createVolume(name, sc, kMuonGEM);
678 
679  TGeoVolume* holder = GetDaughter(assembly, "SuperChamber Region", kMuonGEM, detid.region());
680  holder = GetDaughter(holder, "Ring", kMuonGEM, detid.ring());
681  holder = GetDaughter(holder, "Station", kMuonGEM, detid.station());
682  holder = GetDaughter(holder, "Chamber", kMuonGEM, detid.chamber());
683 
684  AddLeafNode(holder, child, name.c_str(), createPlacement(*it));
685  }
686  }
687  }
688 
689  {
690  TGeoVolume* assembly = GetDaughter(assemblyTop, "GEMetaPartitions", kMuonGEM);
691  for (auto it = gemGeom->etaPartitions().begin(), end = gemGeom->etaPartitions().end(); it != end; ++it) {
692  const GEMEtaPartition* roll = (*it);
693  if (roll) {
694  GEMDetId detid = roll->geographicalId();
695  std::stringstream s;
696  s << detid;
697  std::string name = s.str();
698 
699  TGeoVolume* child = createVolume(name, roll, kMuonGEM);
700 
701  TGeoVolume* holder = GetDaughter(assembly, "ROLL Region", kMuonGEM, detid.region());
702  holder = GetDaughter(holder, "Ring", kMuonGEM, detid.ring());
703  holder = GetDaughter(holder, "Station", kMuonGEM, detid.station());
704  holder = GetDaughter(holder, "Layer", kMuonGEM, detid.layer());
705  holder = GetDaughter(holder, "Chamber", kMuonGEM, detid.chamber());
706 
707  AddLeafNode(holder, child, name.c_str(), createPlacement(*it));
708  }
709  }
710  }
711  } catch (cms::Exception& exception) {
712  edm::LogInfo("FWRecoGeometry") << "failed to produce GEM geometry " << exception.what() << std::endl;
713  }
714 }
static constexpr int GEM
Definition: MuonSubdetId.h:14
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
char const * what() const override
Definition: Exception.cc:103
TGeoCombiTrans * createPlacement(const Rotation3D &iRot, const Position &iTrans)
const std::vector< const GEMEtaPartition * > & etaPartitions() const
Return a vector of all GEM eta partitions.
Definition: GEMGeometry.cc:40
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:64
#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:36
Definition: DetId.h:17
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 780 of file FWTGeoRecoGeometryESProducer.cc.

References HltBtagPostValidation_cff::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(), HLT_2018_cff::points, makeMuonMisalignmentScenario::rot, x, y, z, and HcalDetId::zside().

Referenced by produce().

780  {
781  TGeoVolume* tv = GetTopHolder("HCal", kHCal);
782  TGeoVolume* assembly = GetDaughter(tv, "HCalBarrel", kHCal);
783 
785 
786  CaloVolMap caloShapeMapP;
787  CaloVolMap caloShapeMapN;
788  for (std::vector<DetId>::const_iterator it = vid.begin(), end = vid.end(); it != end; ++it) {
789  //HcalDetId detid = HcalDetId(it->rawId());
790  HcalDetId detid(*it);
791  const CaloCellGeometry* cellb = (m_caloGeom->getGeometry(*it)).get();
792  const IdealObliquePrism* cell = dynamic_cast<const IdealObliquePrism*>(cellb);
793 
794  if (!cell) {
795  printf("HB not oblique !!!\n");
796  continue;
797  }
798 
799  TGeoVolume* volume = nullptr;
800  CaloVolMap& caloShapeMap = (cell->etaPos() > 0) ? caloShapeMapP : caloShapeMapN;
801  CaloVolMap::iterator volIt = caloShapeMap.find(cell->param());
802  if (volIt == caloShapeMap.end()) {
803  // printf("FIREWORKS NEW SHAPE BEGIN eta = %f etaPos = %f, phiPos %f >>>>>> \n", cell->eta(), cell->etaPos(), cell->phiPos());
806  IdealObliquePrism::localCorners(lc, cell->param(), ref);
807  HepGeom::Vector3D<float> lCenter;
808  for (int c = 0; c < 8; ++c)
809  lCenter += lc[c];
810  lCenter *= 0.125;
811 
812  static const int arr[] = {1, 0, 3, 2, 5, 4, 7, 6};
813  double points[16];
814  for (int c = 0; c < 8; ++c) {
815  if (cell->etaPos() > 0)
816  points[c * 2 + 0] = -(lc[arr[c]].z() - lCenter.z());
817  else
818  points[c * 2 + 0] = (lc[arr[c]].z() - lCenter.z());
819  points[c * 2 + 1] = (lc[arr[c]].y() - lCenter.y());
820  // printf("AMT xy[%d] <=>[%d] = (%.4f, %.4f) \n", arr[c], c, points[c*2], points[c*2+1]);
821  }
822 
823  float dz = (lc[4].x() - lc[0].x()) * 0.5;
824  TGeoShape* solid = new TGeoArb8(dz, &points[0]);
825  volume = new TGeoVolume("hcal oblique prism", solid, GetMedium(kHCal));
826  caloShapeMap[cell->param()] = volume;
827  } else {
828  volume = volIt->second;
829  }
830 
831  HepGeom::Vector3D<float> gCenter;
832  CaloCellGeometry::CornersVec const& gc = cell->getCorners();
833  for (int c = 0; c < 8; ++c)
834  gCenter += HepGeom::Vector3D<float>(gc[c].x(), gc[c].y(), gc[c].z());
835  gCenter *= 0.125;
836 
837  TGeoTranslation gtr(gCenter.x(), gCenter.y(), gCenter.z());
838  TGeoRotation rot;
839  rot.RotateY(90);
840 
841  TGeoRotation rotPhi;
842  rotPhi.SetAngles(0, -cell->phiPos() * TMath::RadToDeg(), 0);
843  rot.MultiplyBy(&rotPhi);
844 
845  TGeoVolume* holder = GetDaughter(assembly, "side", kHCal, detid.zside());
846  holder = GetDaughter(holder, "ieta", kHCal, detid.ieta());
847  std::stringstream nname;
848  nname << detid;
849  AddLeafNode(holder, volume, nname.str().c_str(), new TGeoCombiTrans(gtr, rot));
850  }
851 
852  // printf("HB map size P = %lu , N = %lu", caloShapeMapP.size(),caloShapeMapN.size() );
853 }
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:75
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:60
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
CaloCellGeometry::Pt3DVec Pt3DVec
void FWTGeoRecoGeometryESProducer::addHcalCaloGeometryEndcap ( void  )
private

Definition at line 856 of file FWTGeoRecoGeometryESProducer.cc.

References HltBtagPostValidation_cff::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(), HLT_2018_cff::points, makeMuonMisalignmentScenario::rot, and HcalDetId::zside().

Referenced by produce().

856  {
857  CaloVolMap caloShapeMapP;
858  CaloVolMap caloShapeMapN;
859 
860  TGeoVolume* tv = GetTopHolder("HCal", kHCal);
861  TGeoVolume* assembly = GetDaughter(tv, "HCalEndcap", kHCal);
862 
864 
865  for (std::vector<DetId>::const_iterator it = vid.begin(), end = vid.end(); it != end; ++it) {
866  HcalDetId detid = HcalDetId(it->rawId());
867  const CaloCellGeometry* cellb = (m_caloGeom->getGeometry(*it)).get();
868  const IdealObliquePrism* cell = dynamic_cast<const IdealObliquePrism*>(cellb);
869 
870  if (!cell) {
871  printf("EC not oblique \n");
872  continue;
873  }
874 
875  TGeoVolume* volume = nullptr;
876  CaloVolMap& caloShapeMap = (cell->etaPos() > 0) ? caloShapeMapP : caloShapeMapN;
877  CaloVolMap::iterator volIt = caloShapeMap.find(cell->param());
878  if (volIt == caloShapeMap.end()) {
881  IdealObliquePrism::localCorners(lc, cell->param(), ref);
882  HepGeom::Vector3D<float> lCenter;
883  for (int c = 0; c < 8; ++c)
884  lCenter += lc[c];
885  lCenter *= 0.125;
886 
887  //for( int c = 0; c < 8; ++c)
888  // printf("lc.push_back(TEveVector(%.4f, %.4f, %.4f));\n", lc[c].x(), lc[c].y(), lc[c].z() );
889 
890  static const int arrP[] = {3, 2, 1, 0, 7, 6, 5, 4};
891  static const int arrN[] = {7, 6, 5, 4, 3, 2, 1, 0};
892  const int* arr = (detid.ieta() > 0) ? &arrP[0] : &arrN[0];
893 
894  double points[16];
895  for (int c = 0; c < 8; ++c) {
896  points[c * 2 + 0] = lc[arr[c]].x() - lCenter.x();
897  points[c * 2 + 1] = lc[arr[c]].y() - lCenter.y();
898  }
899 
900  float dz = (lc[4].z() - lc[0].z()) * 0.5;
901  TGeoShape* solid = new TGeoArb8(dz, &points[0]);
902  volume = new TGeoVolume("ecal oblique prism", solid, GetMedium(kHCal));
903  caloShapeMap[cell->param()] = volume;
904  } else {
905  volume = volIt->second;
906  }
907 
908  HepGeom::Vector3D<float> gCenter;
909  CaloCellGeometry::CornersVec const& gc = cell->getCorners();
910  for (int c = 0; c < 8; ++c) {
911  gCenter += HepGeom::Vector3D<float>(gc[c].x(), gc[c].y(), gc[c].z());
912  // printf("gc.push_back(TEveVector(%.4f, %.4f, %.4f));\n", gc[c].x(), gc[c].y(),gc[c].z() );
913  }
914  gCenter *= 0.125;
915 
916  TGeoTranslation gtr(gCenter.x(), gCenter.y(), gCenter.z());
917  TGeoRotation rot;
918  rot.SetAngles(cell->phiPos() * TMath::RadToDeg(), 0, 0);
919 
920  TGeoVolume* holder = GetDaughter(assembly, "side", kHCal, detid.zside());
921  holder = GetDaughter(holder, "ieta", kHCal, detid.ieta());
922  std::stringstream nname;
923  nname << detid;
924  AddLeafNode(holder, volume, nname.str().c_str(), new TGeoCombiTrans(gtr, rot));
925  }
926 
927  // printf("HE map size P = %lu , N = %lu", caloShapeMapP.size(),caloShapeMapN.size() );
928 }
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalDetId.h:141
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.
Definition: CaloGeometry.cc:75
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:60
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
CaloCellGeometry::Pt3DVec Pt3DVec
void FWTGeoRecoGeometryESProducer::addHcalCaloGeometryForward ( )
private

Definition at line 996 of file FWTGeoRecoGeometryESProducer.cc.

References HltBtagPostValidation_cff::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(), HLT_2018_cff::points, makeMuonMisalignmentScenario::rot, and HcalDetId::zside().

Referenced by produce().

996  {
997  CaloVolMap caloShapeMapP;
998  CaloVolMap caloShapeMapN;
999 
1000  TGeoVolume* tv = GetTopHolder("HCal", kHCal);
1001  TGeoVolume* assembly = GetDaughter(tv, "HCalForward", kHCal);
1002 
1004 
1005  for (std::vector<DetId>::const_iterator it = vid.begin(), end = vid.end(); it != end; ++it) {
1006  HcalDetId detid = HcalDetId(it->rawId());
1007  const CaloCellGeometry* cellb = (m_caloGeom->getGeometry(*it)).get();
1008  const IdealZPrism* cell = dynamic_cast<const IdealZPrism*>(cellb);
1009 
1010  if (!cell) {
1011  printf("EC not Z prism \n");
1012  continue;
1013  }
1014 
1015  TGeoVolume* volume = nullptr;
1016  CaloVolMap& caloShapeMap = (cell->etaPos() > 0) ? caloShapeMapP : caloShapeMapN;
1017  CaloVolMap::iterator volIt = caloShapeMap.find(cell->param());
1018  if (volIt == caloShapeMap.end()) {
1019  IdealZPrism::Pt3DVec lc(8);
1020  IdealZPrism::Pt3D ref;
1021  IdealZPrism::localCorners(lc, cell->param(), ref);
1022  HepGeom::Vector3D<float> lCenter;
1023  for (int c = 0; c < 8; ++c)
1024  lCenter += lc[c];
1025  lCenter *= 0.125;
1026  static const int arrP[] = {3, 2, 1, 0, 7, 6, 5, 4};
1027  static const int arrN[] = {7, 6, 5, 4, 3, 2, 1, 0};
1028  const int* arr = (detid.ieta() > 0) ? &arrP[0] : &arrN[0];
1029 
1030  double points[16];
1031  for (int c = 0; c < 8; ++c) {
1032  points[c * 2 + 0] = lc[arr[c]].x() - lCenter.x();
1033  points[c * 2 + 1] = lc[arr[c]].y() - lCenter.y();
1034  }
1035 
1036  float dz = (lc[4].z() - lc[0].z()) * 0.5;
1037  TGeoShape* solid = new TGeoArb8(dz, &points[0]);
1038  volume = new TGeoVolume("ecal oblique prism", solid, GetMedium(kHCal));
1039  caloShapeMap[cell->param()] = volume;
1040  } else {
1041  volume = volIt->second;
1042  }
1043  HepGeom::Vector3D<float> gCenter;
1044  CaloCellGeometry::CornersVec const& gc = cell->getCorners();
1045  for (int c = 0; c < 8; ++c) {
1046  gCenter += HepGeom::Vector3D<float>(gc[c].x(), gc[c].y(), gc[c].z());
1047  }
1048  gCenter *= 0.125;
1049 
1050  TGeoTranslation gtr(gCenter.x(), gCenter.y(), gCenter.z());
1051  TGeoRotation rot;
1052  rot.SetAngles(cell->phiPos() * TMath::RadToDeg(), 0, 0);
1053 
1054  TGeoVolume* holder = GetDaughter(assembly, "side", kHCal, detid.zside());
1055  holder = GetDaughter(holder, "ieta", kHCal, detid.ieta());
1056  std::stringstream nname;
1057  nname << detid;
1058  AddLeafNode(holder, volume, nname.str().c_str(), new TGeoCombiTrans(gtr, rot));
1059  }
1060 }
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalDetId.h:141
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:72
CaloCellGeometry::Pt3D Pt3D
Definition: IdealZPrism.h:31
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: IdealZPrism.h:32
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:75
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:60
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
void FWTGeoRecoGeometryESProducer::addHcalCaloGeometryOuter ( )
private

Definition at line 930 of file FWTGeoRecoGeometryESProducer.cc.

References HltBtagPostValidation_cff::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(), HLT_2018_cff::points, makeMuonMisalignmentScenario::rot, and HcalDetId::zside().

Referenced by produce().

930  {
931  CaloVolMap caloShapeMapP;
932  CaloVolMap caloShapeMapN;
933 
934  TGeoVolume* tv = GetTopHolder("HCal", kHCal);
935  TGeoVolume* assembly = GetDaughter(tv, "HCalOuter", kHCal);
936 
938 
939  for (std::vector<DetId>::const_iterator it = vid.begin(), end = vid.end(); it != end; ++it) {
940  HcalDetId detid = HcalDetId(it->rawId());
941  const CaloCellGeometry* cellb = (m_caloGeom->getGeometry(*it)).get();
942  const IdealObliquePrism* cell = dynamic_cast<const IdealObliquePrism*>(cellb);
943 
944  if (!cell) {
945  printf("EC not oblique \n");
946  continue;
947  }
948 
949  TGeoVolume* volume = nullptr;
950  CaloVolMap& caloShapeMap = (cell->etaPos() > 0) ? caloShapeMapP : caloShapeMapN;
951  CaloVolMap::iterator volIt = caloShapeMap.find(cell->param());
952  if (volIt == caloShapeMap.end()) {
955  IdealObliquePrism::localCorners(lc, cell->param(), ref);
956  HepGeom::Vector3D<float> lCenter;
957  for (int c = 0; c < 8; ++c)
958  lCenter += lc[c];
959  lCenter *= 0.125;
960  static const int arrP[] = {3, 2, 1, 0, 7, 6, 5, 4};
961  static const int arrN[] = {7, 6, 5, 4, 3, 2, 1, 0};
962  const int* arr = (detid.ieta() > 0) ? &arrP[0] : &arrN[0];
963 
964  double points[16];
965  for (int c = 0; c < 8; ++c) {
966  points[c * 2 + 0] = lc[arr[c]].x() - lCenter.x();
967  points[c * 2 + 1] = lc[arr[c]].y() - lCenter.y();
968  }
969 
970  float dz = (lc[4].z() - lc[0].z()) * 0.5;
971  TGeoShape* solid = new TGeoArb8(dz, &points[0]);
972  volume = new TGeoVolume("ecal oblique prism", solid, GetMedium(kHCal));
973  caloShapeMap[cell->param()] = volume;
974  } else {
975  volume = volIt->second;
976  }
977  HepGeom::Vector3D<float> gCenter;
978  CaloCellGeometry::CornersVec const& gc = cell->getCorners();
979  for (int c = 0; c < 8; ++c) {
980  gCenter += HepGeom::Vector3D<float>(gc[c].x(), gc[c].y(), gc[c].z());
981  }
982  gCenter *= 0.125;
983 
984  TGeoTranslation gtr(gCenter.x(), gCenter.y(), gCenter.z());
985  TGeoRotation rot;
986  rot.SetAngles(cell->phiPos() * TMath::RadToDeg(), 0, 0);
987 
988  TGeoVolume* holder = GetDaughter(assembly, "side", kHCal, detid.zside());
989  holder = GetDaughter(holder, "ieta", kHCal, detid.ieta());
990  std::stringstream nname;
991  nname << detid;
992  AddLeafNode(holder, volume, nname.str().c_str(), new TGeoCombiTrans(gtr, rot));
993  }
994 }
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalDetId.h:141
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.
Definition: CaloGeometry.cc:75
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:60
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
CaloCellGeometry::Pt3DVec Pt3DVec
void FWTGeoRecoGeometryESProducer::addME0Geometry ( )
private

Definition at line 746 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by produce().

746  {
747  TGeoVolume* tv = GetTopHolder("Muon", kMuonME0);
748  TGeoVolume* assembly = GetDaughter(tv, "ME0", kMuonME0);
749 
750  DetId detId(DetId::Muon, 5);
751  try {
752  const ME0Geometry* me0Geom = (const ME0Geometry*)m_geomRecord->slaveGeometry(detId);
753 
754  for (auto roll : me0Geom->etaPartitions()) {
755  if (roll) {
756  unsigned int rawid = roll->geographicalId().rawId();
757  //std::cout << "AMT FWTTTTRecoGeometryES\n" << rawid ;
758 
759  ME0DetId detid(rawid);
760  std::stringstream s;
761  s << detid;
762  std::string name = s.str();
763  TGeoVolume* child = createVolume(name, roll, kMuonME0);
764 
765  TGeoVolume* holder = GetDaughter(assembly, "Region", kMuonME0, detid.region());
766  holder = GetDaughter(holder, "Layer", kMuonME0, detid.layer());
767  holder = GetDaughter(holder, "Chamber", kMuonME0, detid.chamber());
768  AddLeafNode(holder, child, name.c_str(), createPlacement(roll));
769  }
770  }
771  } catch (cms::Exception& exception) {
772  edm::LogInfo("FWRecoGeometry") << "failed to produce ME0 geometry " << exception.what() << std::endl;
773  }
774 }
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
char const * what() const override
Definition: Exception.cc:103
TGeoCombiTrans * createPlacement(const Rotation3D &iRot, const Position &iTrans)
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:33
Definition: DetId.h:17
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
TGeoVolume * createVolume(const std::string &name, const GeomDet *det, ERecoDet=kDummy)
void FWTGeoRecoGeometryESProducer::addPixelBarrelGeometry ( )
private

Definition at line 420 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by produce().

420  {
421  TGeoVolume* tv = GetTopHolder("SiPixel", kSiPixel);
422  TGeoVolume* assembly = GetDaughter(tv, "PXB", kSiPixel);
423 
424  for (auto it : m_trackerGeom->detsPXB()) {
425  DetId detid = it->geographicalId();
426  unsigned int layer = m_trackerTopology->pxbLayer(detid);
427  unsigned int module = m_trackerTopology->pxbModule(detid);
428  unsigned int ladder = m_trackerTopology->pxbLadder(detid);
429 
430  std::string name = Form("PXB Ly:%d, Md:%d Ld:%d ", layer, module, ladder);
431  TGeoVolume* child = createVolume(name, it, kSiPixel);
432 
433  TGeoVolume* holder = GetDaughter(assembly, "Layer", kSiPixel, layer);
434  holder = GetDaughter(holder, "Module", kSiPixel, module);
435 
436  AddLeafNode(holder, child, name.c_str(), createPlacement(it));
437  }
438 }
unsigned int pxbLadder(const DetId &id) const
unsigned int pxbModule(const DetId &id) const
TGeoCombiTrans * createPlacement(const Rotation3D &iRot, const Position &iTrans)
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:17
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
Definition: vlib.h:198
TGeoVolume * createVolume(const std::string &name, const GeomDet *det, ERecoDet=kDummy)
void FWTGeoRecoGeometryESProducer::addPixelForwardGeometry ( )
private

Definition at line 440 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by produce().

440  {
441  TGeoVolume* tv = GetTopHolder("SiPixel", kSiPixel);
442  TGeoVolume* assembly = GetDaughter(tv, "PXF", kSiPixel);
443 
444  for (auto it : m_trackerGeom->detsPXF()) {
445  DetId detid = it->geographicalId();
446  unsigned int disk = m_trackerTopology->pxfDisk(detid);
447  unsigned int blade = m_trackerTopology->pxfBlade(detid);
448  unsigned int panel = m_trackerTopology->pxfPanel(detid);
449  unsigned int side = m_trackerTopology->side(detid);
450 
451  std::string name = Form("PXF D:%d, B:%d, P:%d, S:%d", disk, blade, panel, side);
452  TGeoVolume* child = createVolume(name, it, kSiPixel);
453 
454  TGeoVolume* holder = GetDaughter(assembly, "Side", kSiPixel, side);
455  holder = GetDaughter(holder, "Disk", kSiPixel, disk);
456  holder = GetDaughter(holder, "Blade", kSiPixel, blade);
457  holder = GetDaughter(holder, "Panel", kSiPixel, panel);
458 
459  AddLeafNode(holder, child, name.c_str(), createPlacement(it));
460  }
461 }
unsigned int pxfDisk(const DetId &id) const
unsigned int side(const DetId &id) const
TGeoCombiTrans * createPlacement(const Rotation3D &iRot, const Position &iTrans)
TGeoVolume * GetDaughter(TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
Definition: DetId.h:17
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 ( )
private

Definition at line 718 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by produce().

718  {
719  TGeoVolume* tv = GetTopHolder("Muon", kMuonRPC);
720  TGeoVolume* assembly = GetDaughter(tv, "RPC", kMuonRPC);
721 
723  const RPCGeometry* rpcGeom = (const RPCGeometry*)m_geomRecord->slaveGeometry(detId);
724  for (auto it = rpcGeom->rolls().begin(), end = rpcGeom->rolls().end(); it != end; ++it) {
725  RPCRoll const* roll = (*it);
726  if (roll) {
727  RPCDetId detid = roll->geographicalId();
728  std::stringstream s;
729  s << detid;
730  std::string name = s.str();
731 
732  TGeoVolume* child = createVolume(name, roll, kMuonRPC);
733 
734  TGeoVolume* holder = GetDaughter(assembly, "ROLL Region", kMuonRPC, detid.region());
735  holder = GetDaughter(holder, "Ring", kMuonRPC, detid.ring());
736  holder = GetDaughter(holder, "Station", kMuonRPC, detid.station());
737  holder = GetDaughter(holder, "Sector", kMuonRPC, detid.sector());
738  holder = GetDaughter(holder, "Layer", kMuonRPC, detid.layer());
739  holder = GetDaughter(holder, "Subsector", kMuonRPC, detid.subsector());
740 
741  AddLeafNode(holder, child, name.c_str(), createPlacement(*it));
742  }
743  };
744 }
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
const std::vector< const RPCRoll * > & rolls() const
Return a vector of all RPC rolls.
Definition: RPCGeometry.cc:44
TGeoCombiTrans * createPlacement(const Rotation3D &iRot, const Position &iTrans)
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:64
#define end
Definition: vmac.h:39
TGeoVolume * GetDaughter(TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
Definition: DetId.h:17
static constexpr int RPC
Definition: MuonSubdetId.h:13
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
TGeoVolume * createVolume(const std::string &name, const GeomDet *det, ERecoDet=kDummy)
void FWTGeoRecoGeometryESProducer::addTECGeometry ( )
private

Definition at line 523 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by produce().

523  {
524  TGeoVolume* tv = GetTopHolder("SiStrip", kSiStrip);
525  TGeoVolume* assembly = GetDaughter(tv, "TEC", kSiStrip);
526 
527  for (auto it : m_trackerGeom->detsTEC()) {
528  DetId detid = it->geographicalId();
529  unsigned int order = m_trackerTopology->tecOrder(detid);
530  unsigned int ring = m_trackerTopology->tecRing(detid);
531  unsigned int module = m_trackerTopology->tecModule(detid);
532 
534 
535  TGeoVolume* child = createVolume(name, it, kSiStrip);
536 
537  TGeoVolume* holder = GetDaughter(assembly, "Order", kSiStrip, order);
538  holder = GetDaughter(holder, "Ring", kSiStrip, ring);
539  holder = GetDaughter(holder, "Module", kSiStrip, module);
540  AddLeafNode(holder, child, name.c_str(), createPlacement(it));
541  }
542 }
unsigned int tecRing(const DetId &id) const
ring id
TGeoCombiTrans * createPlacement(const Rotation3D &iRot, const Position &iTrans)
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:17
unsigned int tecOrder(const DetId &id) const
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
Definition: vlib.h:198
TGeoVolume * createVolume(const std::string &name, const GeomDet *det, ERecoDet=kDummy)
void FWTGeoRecoGeometryESProducer::addTIBGeometry ( )
private

Definition at line 463 of file FWTGeoRecoGeometryESProducer.cc.

References dd4hep::createPlacement(), createVolume(), TrackerGeometry::detsTIB(), GetDaughter(), GetTopHolder(), kSiStrip, m_trackerGeom, m_trackerTopology, Skims_PA_cff::name, eventshapeDQM_cfi::order, TrackerTopology::print(), AlCaHLTBitMon_QueryRunRegistry::string, TrackerTopology::tibModule(), TrackerTopology::tibOrder(), and TrackerTopology::tibSide().

Referenced by produce().

463  {
464  TGeoVolume* tv = GetTopHolder("SiStrip", kSiStrip);
465  TGeoVolume* assembly = GetDaughter(tv, "TIB", kSiStrip);
466 
467  for (auto it : m_trackerGeom->detsTIB()) {
468  DetId detid = it->geographicalId();
469  unsigned int module = m_trackerTopology->tibModule(detid);
470  unsigned int order = m_trackerTopology->tibOrder(detid);
471  unsigned int side = m_trackerTopology->tibSide(detid);
472 
474 
475  TGeoVolume* child = createVolume(name, it, kSiStrip);
476  TGeoVolume* holder = GetDaughter(assembly, "Module", kSiStrip, module);
477  holder = GetDaughter(holder, "Order", kSiStrip, order);
478  holder = GetDaughter(holder, "Side", kSiStrip, side);
479  AddLeafNode(holder, child, name.c_str(), createPlacement(it));
480  }
481 }
TGeoCombiTrans * createPlacement(const Rotation3D &iRot, const Position &iTrans)
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:17
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
Definition: vlib.h:198
TGeoVolume * createVolume(const std::string &name, const GeomDet *det, ERecoDet=kDummy)
unsigned int tibOrder(const DetId &id) const
void FWTGeoRecoGeometryESProducer::addTIDGeometry ( )
private

Definition at line 483 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by produce().

483  {
484  TGeoVolume* tv = GetTopHolder("SiStrip", kSiStrip);
485  TGeoVolume* assembly = GetDaughter(tv, "TID", kSiStrip);
486 
487  for (auto it : m_trackerGeom->detsTID()) {
488  DetId detid = it->geographicalId();
489  unsigned int side = m_trackerTopology->tidSide(detid);
490  unsigned int wheel = m_trackerTopology->tidWheel(detid);
491  unsigned int ring = m_trackerTopology->tidRing(detid);
492 
494 
495  TGeoVolume* child = createVolume(name, it, kSiStrip);
496  TGeoVolume* holder = GetDaughter(assembly, "Side", kSiStrip, side);
497  holder = GetDaughter(holder, "Wheel", kSiStrip, wheel);
498  holder = GetDaughter(holder, "Ring", kSiStrip, ring);
499  AddLeafNode(holder, child, name.c_str(), createPlacement(it));
500  }
501 }
unsigned int tidRing(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
TGeoCombiTrans * createPlacement(const Rotation3D &iRot, const Position &iTrans)
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:17
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 ( )
private

Definition at line 503 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by produce().

503  {
504  TGeoVolume* tv = GetTopHolder("SiStrip", kSiStrip);
505  TGeoVolume* assembly = GetDaughter(tv, "TOB", kSiStrip);
506 
507  for (auto it : m_trackerGeom->detsTOB()) {
508  DetId detid = it->geographicalId();
509  unsigned int rod = m_trackerTopology->tobRod(detid);
510  unsigned int side = m_trackerTopology->tobSide(detid);
511  unsigned int module = m_trackerTopology->tobModule(detid);
512 
514 
515  TGeoVolume* child = createVolume(name, it, kSiStrip);
516  TGeoVolume* holder = GetDaughter(assembly, "Rod", kSiStrip, rod);
517  holder = GetDaughter(holder, "Side", kSiStrip, side);
518  holder = GetDaughter(holder, "Module", kSiStrip, module);
519  AddLeafNode(holder, child, name.c_str(), createPlacement(it));
520  }
521 }
TGeoCombiTrans * createPlacement(const Rotation3D &iRot, const Position &iTrans)
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:17
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:198
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 334 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by createVolume().

334  {
335  TGeoShape* shape = nullptr;
336 
337  // Trapezoidal
338  const Bounds* b = &((det->surface()).bounds());
339  const TrapezoidalPlaneBounds* b2 = dynamic_cast<const TrapezoidalPlaneBounds*>(b);
340  if (b2) {
341  std::array<const float, 4> const& par = b2->parameters();
342 
343  // These parameters are half-lengths, as in CMSIM/GEANT3
344  float hBottomEdge = par[0];
345  float hTopEdge = par[1];
346  float thickness = par[2];
347  float apothem = par[3];
348 
349  std::stringstream s;
350  s << "T_" << hBottomEdge << "_" << hTopEdge << "_" << thickness << "_" << apothem;
351  std::string name = s.str();
352 
353  // Do not create identical shape,
354  // if one already exists
355  shape = m_nameToShape[name];
356  if (nullptr == shape) {
357  shape = new TGeoTrap(name.c_str(),
358  thickness, //dz
359  0, //theta
360  0, //phi
361  apothem, //dy1
362  hBottomEdge, //dx1
363  hTopEdge, //dx2
364  0, //alpha1
365  apothem, //dy2
366  hBottomEdge, //dx3
367  hTopEdge, //dx4
368  0); //alpha2
369 
370  m_nameToShape[name] = shape;
371  }
372  }
373  if (dynamic_cast<const RectangularPlaneBounds*>(b) != nullptr) {
374  // Rectangular
375  float length = det->surface().bounds().length();
376  float width = det->surface().bounds().width();
377  float thickness = det->surface().bounds().thickness();
378 
379  std::stringstream s;
380  s << "R_" << width << "_" << length << "_" << thickness;
381  std::string name = s.str();
382 
383  // Do not create identical shape,
384  // if one already exists
385  shape = m_nameToShape[name];
386  if (nullptr == shape) {
387  shape = new TGeoBBox(name.c_str(), width / 2., length / 2., thickness / 2.); // dx, dy, dz
388 
389  m_nameToShape[name] = shape;
390  }
391  }
392 
393  return shape;
394 }
virtual float length() const =0
virtual const std::array< const float, 4 > parameters() const
const Bounds & bounds() const
Definition: Surface.h:89
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
virtual float width() const =0
std::map< std::string, TGeoShape * > m_nameToShape
virtual float thickness() const =0
double b
Definition: hdecay.h:118
Definition: Bounds.h:20
TGeoVolume * FWTGeoRecoGeometryESProducer::createVolume ( const std::string &  name,
const GeomDet det,
ERecoDet  mid = kDummy 
)
private

Create TGeo volume for GeomDet

Definition at line 397 of file FWTGeoRecoGeometryESProducer.cc.

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

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

397  {
398  TGeoShape* solid = createShape(det);
399 
400  std::map<TGeoShape*, TGeoVolume*>::iterator vIt = m_shapeToVolume.find(solid);
401  if (vIt != m_shapeToVolume.end())
402  return vIt->second;
403 
404  TGeoVolume* volume = new TGeoVolume(name.c_str(), solid, GetMedium(mid));
405 
406  m_shapeToVolume[solid] = volume;
407 
408  return volume;
409 }
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 112 of file FWTGeoRecoGeometryESProducer.cc.

References GetMedium(), and dqmiodumpmetadata::n.

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

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

Definition at line 129 of file FWTGeoRecoGeometryESProducer.cc.

References GetMedium(), and dqmiodumpmetadata::n.

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

Definition at line 172 of file FWTGeoRecoGeometryESProducer.cc.

References kCaloTower, kECal, kHCal, kHGCE, kHGCH, kMuonCSC, kMuonDT, kMuonGEM, kMuonME0, kMuonRPC, kSiPixel, kSiStrip, m_dummyMedium, m_recoMedium, Skims_PA_cff::name, AlCaHLTBitMon_QueryRunRegistry::string, and Phase2TrackerMonitorDigi_cff::switch.

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

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

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

254  {
255  using namespace edm;
256 
257  auto fwTGeoRecoGeometry = std::make_unique<FWTGeoRecoGeometry>();
258 
259  if (m_calo) {
261  record.getRecord<CaloGeometryRecord>().get(caloH);
262  m_caloGeom = caloH.product();
263  }
264 
265  TGeoManager* geom = new TGeoManager("cmsGeo", "CMS Detector");
266  if (nullptr == gGeoIdentity) {
267  gGeoIdentity = new TGeoIdentity("Identity");
268  }
269 
270  fwTGeoRecoGeometry->manager(geom);
271 
272  // Default material is Vacuum
273  TGeoMaterial* vacuum = new TGeoMaterial("Vacuum", 0, 0, 0);
274  m_dummyMedium = new TGeoMedium("reco", 0, vacuum);
275 
276  TGeoVolume* top = geom->MakeBox("CMS", m_dummyMedium, 270., 270., 120.);
277 
278  if (nullptr == top) {
279  return std::unique_ptr<FWTGeoRecoGeometry>();
280  }
281  geom->SetTopVolume(top);
282  // ROOT chokes unless colors are assigned
283  top->SetVisibility(kFALSE);
284  top->SetLineColor(kBlue);
285 
286  if (m_tracker || m_muon) {
288  }
289 
290  if (m_tracker) {
291  DetId detId(DetId::Tracker, 0);
293 
294  edm::ESHandle<TrackerTopology> trackerTopologyHandle;
295  record.getRecord<TrackerTopologyRcd>().get(trackerTopologyHandle);
296  m_trackerTopology = trackerTopologyHandle.product();
297 
300 
301  addTIBGeometry();
302  addTIDGeometry();
303  addTOBGeometry();
304  addTECGeometry();
305  }
306 
307  if (m_muon) {
308  addDTGeometry();
309  addCSCGeometry();
310  addRPCGeometry();
311  addME0Geometry();
312  addGEMGeometry();
313  }
314 
315  if (m_calo) {
322  }
323 
324  geom->CloseGeometry();
325 
326  geom->DefaultColors();
327  // printf("==== geo manager NNodes = %d \n", geom->GetNNodes());
328  geom->CloseGeometry();
329 
330  return fwTGeoRecoGeometry;
331 }
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:17
HLT enums.
T const * product() const
Definition: ESHandle.h:86

Member Data Documentation

bool FWTGeoRecoGeometryESProducer::m_calo
private

Definition at line 97 of file FWTGeoRecoGeometryESProducer.h.

Referenced by FWTGeoRecoGeometryESProducer(), and produce().

const CaloGeometry* FWTGeoRecoGeometryESProducer::m_caloGeom
private
TGeoMedium* FWTGeoRecoGeometryESProducer::m_dummyMedium
private

Definition at line 93 of file FWTGeoRecoGeometryESProducer.h.

Referenced by GetMedium(), and produce().

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

Definition at line 96 of file FWTGeoRecoGeometryESProducer.h.

Referenced by FWTGeoRecoGeometryESProducer(), and produce().

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

Definition at line 84 of file FWTGeoRecoGeometryESProducer.h.

Referenced by createShape().

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

Definition at line 86 of file FWTGeoRecoGeometryESProducer.h.

Referenced by GetMedium().

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

Definition at line 85 of file FWTGeoRecoGeometryESProducer.h.

Referenced by createVolume().

bool FWTGeoRecoGeometryESProducer::m_tracker
private

Definition at line 95 of file FWTGeoRecoGeometryESProducer.h.

Referenced by FWTGeoRecoGeometryESProducer(), and produce().

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