CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private 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 &)
 
boost::shared_ptr
< FWTGeoRecoGeometry
produce (const FWTGeoRecoGeometryRecord &)
 
virtual ~FWTGeoRecoGeometryESProducer (void)
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider ()
 

Private Types

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

Private Member Functions

void addCSCGeometry ()
 
void addDTGeometry ()
 
void addEcalCaloGeometry ()
 
void addGEMGeometry ()
 
void addHcalCaloGeometryBarrel ()
 
void addHcalCaloGeometryEndcap ()
 
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
FWTGeoRecoGeometryESProducer
operator= (const FWTGeoRecoGeometryESProducer &)
 

Private Attributes

edm::ESHandle< CaloGeometrym_caloGeom
 
TGeoMedium * m_dummyMedium
 
boost::shared_ptr
< FWTGeoRecoGeometry
m_fwGeometry
 
edm::ESHandle
< GlobalTrackingGeometry
m_geomRecord
 
std::map< std::string,
TGeoShape * > 
m_nameToShape
 
std::map< ERecoDet, TGeoMedium * > m_recoMedium
 
std::map< TGeoShape
*, TGeoVolume * > 
m_shapeToVolume
 
const TrackerGeometrym_trackerGeom
 

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

Detailed Description

Definition at line 28 of file FWTGeoRecoGeometryESProducer.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

FWTGeoRecoGeometryESProducer::FWTGeoRecoGeometryESProducer ( const edm::ParameterSet )

Definition at line 66 of file FWTGeoRecoGeometryESProducer.cc.

References edm::ESProducer::setWhatProduced().

66  :
68 {
69  setWhatProduced( this );
70 }
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
FWTGeoRecoGeometryESProducer::~FWTGeoRecoGeometryESProducer ( void  )
virtual

Definition at line 72 of file FWTGeoRecoGeometryESProducer.cc.

73 {}
FWTGeoRecoGeometryESProducer::FWTGeoRecoGeometryESProducer ( const FWTGeoRecoGeometryESProducer )
private

Member Function Documentation

void FWTGeoRecoGeometryESProducer::addCSCGeometry ( void  )
private

Definition at line 687 of file FWTGeoRecoGeometryESProducer.cc.

References createVolume(), CSCDetId, GetDaughter(), GetTopHolder(), kMuonCSC, kMuonRPC, m_geomRecord, alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produce().

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

References createVolume(), DTChamberId, DTLayerId, DTSuperLayerId, end, GetDaughter(), GetTopHolder(), kMuonDT, kMuonRPC, m_geomRecord, alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produce().

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

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

Referenced by produce().

1086 {
1087 
1088  TGeoVolume* tv = GetTopHolder("ECal", kECal);
1089  CaloVolMap caloShapeMap;
1090 
1091  {
1092  TGeoVolume *assembly = GetDaughter(tv, "ECalBarrel", kECal);
1093 
1094  std::vector<DetId> vid = m_caloGeom->getValidDetIds(DetId::Ecal, EcalSubdetector::EcalBarrel);
1095  for( std::vector<DetId>::const_iterator it = vid.begin(), end = vid.end(); it != end; ++it)
1096  {
1097  EBDetId detid(*it);
1098  const TruncatedPyramid* cell = dynamic_cast<const TruncatedPyramid*> ( m_caloGeom->getGeometry( *it ));
1099  if (!cell) { printf("ecalBarrel cell not a TruncatedPyramid !!\n"); return; }
1100 
1101  TGeoVolume* volume = 0;
1102  CaloVolMap::iterator volIt = caloShapeMap.find(cell->param());
1103  if ( volIt == caloShapeMap.end())
1104  {
1105  volume = new TGeoVolume( "EE TruncatedPyramid" , makeEcalShape(cell), GetMedium(kECal));
1106  caloShapeMap[cell->param()] = volume;
1107  }
1108  else {
1109  volume = volIt->second;
1110  }
1111  TGeoHMatrix* mtx= getEcalTrans(cell->getCorners());
1112  TGeoVolume* holder = GetDaughter(assembly, "side", kECal, detid.zside());
1113  holder = GetDaughter(holder, "ieta", kECal, detid.ieta());
1114  std::stringstream nname;
1115  nname << detid;
1116  AddLeafNode(holder, volume, nname.str().c_str(), mtx);
1117  }
1118  }
1119 
1120 
1121  {
1122  TGeoVolume *assembly = GetDaughter(tv, "ECalEndcap", kECal);
1123 
1124  std::vector<DetId> vid = m_caloGeom->getValidDetIds(DetId::Ecal, EcalSubdetector::EcalEndcap);
1125  for( std::vector<DetId>::const_iterator it = vid.begin(), end = vid.end(); it != end; ++it)
1126  {
1127  EEDetId detid(*it);
1128  const TruncatedPyramid* cell = dynamic_cast<const TruncatedPyramid*> (m_caloGeom->getGeometry( *it ));
1129  if (!cell) { printf("ecalEndcap cell not a TruncatedPyramid !!\n"); continue;}
1130 
1131  TGeoVolume* volume = 0;
1132  CaloVolMap::iterator volIt = caloShapeMap.find(cell->param());
1133  if ( volIt == caloShapeMap.end())
1134  {
1135 
1136  volume = new TGeoVolume( "EE TruncatedPyramid" , makeEcalShape(cell), GetMedium(kECal));
1137  caloShapeMap[cell->param()] = volume;
1138  }
1139  else {
1140  volume = volIt->second;
1141  }
1142  TGeoHMatrix* mtx= getEcalTrans(cell->getCorners());
1143  TGeoVolume* holder = GetDaughter(assembly, "side", kECal, detid.zside());
1144  holder = GetDaughter(holder, "ix", kECal, detid.ix());
1145  std::stringstream nname;
1146  nname << detid;
1147  AddLeafNode(holder, volume, nname.str().c_str(), mtx);
1148  }
1149  }
1150 }
edm::ESHandle< CaloGeometry > m_caloGeom
const CCGFloat * param() const
TGeoHMatrix * getEcalTrans(CaloCellGeometry::CornersVec const &gc)
#define end
Definition: vmac.h:37
TGeoShape * makeEcalShape(const TruncatedPyramid *cell)
TGeoVolume * GetDaughter(TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
CornersVec const & getCorners() const
Returns the corner points of this cell&#39;s volume.
A base class to handle the particular shape of Ecal Xtals. Taken from ORCA Calorimetry Code...
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
void FWTGeoRecoGeometryESProducer::addGEMGeometry ( void  )
private

Definition at line 730 of file FWTGeoRecoGeometryESProducer.cc.

References createVolume(), end, GEMGeometry::etaPartitions(), cppFunctionSkipper::exception, MuonSubdetId::GEM, GeomDet::geographicalId(), GetDaughter(), GetTopHolder(), kMuonGEM, kMuonRPC, m_geomRecord, DetId::Muon, alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, and cms::Exception::what().

Referenced by produce().

731 {
732  try {
734  const GEMGeometry* gemGeom = (const GEMGeometry*) m_geomRecord->slaveGeometry( detId );
735 
736  TGeoVolume* tv = GetTopHolder("Muon", kMuonRPC);
737  TGeoVolume *assembly = GetDaughter(tv, "GEM", kMuonGEM);
738 
739  for( auto it = gemGeom->etaPartitions().begin(),
740  end = gemGeom->etaPartitions().end();
741  it != end; ++it )
742  {
743  const GEMEtaPartition* roll = (*it);
744  if( roll )
745  {
746  GEMDetId detid = roll->geographicalId();
747  std::stringstream s;
748  s << detid;
749  std::string name = s.str();
750 
751  TGeoVolume* child = createVolume( name, roll, kMuonGEM );
752 
753  TGeoVolume* holder = GetDaughter(assembly, "ROLL Region", kMuonGEM , detid.region());
754  holder = GetDaughter(holder, "Ring", kMuonGEM , detid.ring());
755  holder = GetDaughter(holder, "Station", kMuonGEM , detid.station());
756  holder = GetDaughter(holder, "Layer", kMuonGEM , detid.layer());
757  holder = GetDaughter(holder, "Chamber", kMuonGEM , detid.chamber());
758 
759  AddLeafNode(holder, child, name.c_str(), createPlacement(*it));
760  }
761  }
762  }catch (cms::Exception &exception) {
763  edm::LogInfo("FWRecoGeometry") << "failed to produce GEM geometry " << exception.what() << std::endl;
764 
765  }
766 }
virtual char const * what() const
Definition: Exception.cc:141
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
static const int GEM
Definition: MuonSubdetId.h:15
const std::vector< const GEMEtaPartition * > & etaPartitions() const
Return a vector of all GEM eta partitions.
Definition: GEMGeometry.cc:63
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
#define end
Definition: vmac.h:37
TGeoVolume * GetDaughter(TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
Definition: DetId.h:18
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 851 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by produce().

852 {
853  TGeoVolume* tv = GetTopHolder("HCal", kHCal);
854  TGeoVolume *assembly = GetDaughter(tv, "HCalBarrel", kHCal);
855 
856  std::vector<DetId> vid = m_caloGeom->getValidDetIds(DetId::Hcal, HcalSubdetector::HcalBarrel);
857 
858  CaloVolMap caloShapeMapP;
859  CaloVolMap caloShapeMapN;
860  for( std::vector<DetId>::const_iterator it = vid.begin(), end = vid.end(); it != end; ++it)
861  {
862  HcalDetId detid = HcalDetId(it->rawId());
863 
864  const CaloCellGeometry* cellb= m_caloGeom->getGeometry(*it);
865 
866  const IdealObliquePrism* cell = dynamic_cast<const IdealObliquePrism*> (cellb);
867 
868  if (!cell) { printf ("HB not olique !!!\n"); continue; }
869 
870  TGeoVolume* volume = 0;
871  CaloVolMap& caloShapeMap = (cell->etaPos() > 0) ? caloShapeMapP : caloShapeMapN;
872  CaloVolMap::iterator volIt = caloShapeMap.find(cell->param());
873  if (volIt == caloShapeMap.end())
874  {
875  // printf("FIREWORKS NEW SHAPE BEGIN eta = %f etaPos = %f, phiPos %f >>>>>> \n", cell->eta(), cell->etaPos(), cell->phiPos());
878  IdealObliquePrism::localCorners( lc, cell->param(), ref);
879  HepGeom::Vector3D<float> lCenter;
880  for( int c = 0; c < 8; ++c)
881  lCenter += lc[c];
882  lCenter *= 0.125;
883 
884  static const int arr[] = { 1, 0, 3, 2, 5, 4, 7, 6 };
885  double points[16];
886  for (int c = 0; c < 8; ++c) {
887  if (cell->etaPos() > 0 )
888  points[ c*2 + 0 ] = -(lc[arr[c]].z() - lCenter.z());
889  else
890  points[ c*2 + 0 ] = (lc[arr[c]].z() - lCenter.z());
891 
892  points[ c*2 + 1 ] = (lc[arr[c]].y() - lCenter.y());
893  // printf("AMT xy[%d] <=>[%d] = (%.4f, %.4f) \n", arr[c], c, points[c*2], points[c*2+1]);
894  }
895 
896  float dz = (lc[4].x() -lc[0].x()) * 0.5;
897  TGeoShape* solid = new TGeoArb8(dz, &points[0]);
898  volume = new TGeoVolume("hcal oblique prism", solid, GetMedium(kHCal));
899  caloShapeMap[cell->param()] = volume;
900  }
901  else {
902 
903  volume = volIt->second;
904 
905  }
906 
907  HepGeom::Vector3D<float> gCenter;
908  CaloCellGeometry::CornersVec const & gc = cell->getCorners();
909  for (int c = 0; c < 8; ++c)
910  gCenter += HepGeom::Vector3D<float>(gc[c].x(), gc[c].y(), gc[c].z());
911  gCenter *= 0.125;
912 
913  TGeoTranslation gtr(gCenter.x(), gCenter.y(), gCenter.z());
914  TGeoRotation rot;
915  rot.RotateY(90);
916 
917  TGeoRotation rotPhi;
918  rotPhi.SetAngles(0, -cell->phiPos()*TMath::RadToDeg(), 0);
919  rot.MultiplyBy(&rotPhi);
920 
921  TGeoVolume* holder = GetDaughter(assembly, "side", kHCal, detid.zside());
922  holder = GetDaughter(holder, "ieta", kHCal, detid.ieta());
923  std::stringstream nname;
924  nname << detid;
925  AddLeafNode(holder, volume, nname.str().c_str(), new TGeoCombiTrans(gtr, rot));
926  }
927 
928 
929  // printf("HB map size P = %lu , N = %lu", caloShapeMapP.size(),caloShapeMapN.size() );
930 
931 }
edm::ESHandle< CaloGeometry > m_caloGeom
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalDetId.cc:114
float phiPos() const
const CCGFloat * param() const
CaloCellGeometry::Pt3D Pt3D
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
int ieta() const
get the cell ieta
Definition: HcalDetId.h:56
#define end
Definition: vmac.h:37
TGeoVolume * GetDaughter(TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
CornersVec const & getCorners() const
Returns the corner points of this cell&#39;s volume.
float etaPos() const
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
CaloCellGeometry::Pt3DVec Pt3DVec
void FWTGeoRecoGeometryESProducer::addHcalCaloGeometryEndcap ( void  )
private

Definition at line 935 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by produce().

936 {
937 
938  CaloVolMap caloShapeMapP;
939  CaloVolMap caloShapeMapN;
940 
941  TGeoVolume* tv = GetTopHolder("HCal", kHCal);
942  TGeoVolume *assembly = GetDaughter(tv, "HCalEndcap", kHCal);
943 
944  std::vector<DetId> vid = m_caloGeom->getValidDetIds(DetId::Hcal, HcalSubdetector::HcalEndcap);
945 
946  for( std::vector<DetId>::const_iterator it = vid.begin(), end = vid.end(); it != end; ++it)
947  {
948  HcalDetId detid = HcalDetId(it->rawId());
949  const IdealObliquePrism* cell = dynamic_cast<const IdealObliquePrism*> ( m_caloGeom->getGeometry(*it));
950 
951  if (!cell) { printf ("EC not olique \n"); continue; }
952 
953  TGeoVolume* volume = 0;
954  CaloVolMap& caloShapeMap = (cell->etaPos() > 0) ? caloShapeMapP : caloShapeMapN;
955  CaloVolMap::iterator volIt = caloShapeMap.find(cell->param());
956  if ( volIt == caloShapeMap.end())
957  {
960  IdealObliquePrism::localCorners( lc, cell->param(), ref);
961  HepGeom::Vector3D<float> lCenter;
962  for( int c = 0; c < 8; ++c)
963  lCenter += lc[c];
964  lCenter *= 0.125;
965 
966  //for( int c = 0; c < 8; ++c)
967  // printf("lc.push_back(TEveVector(%.4f, %.4f, %.4f));\n", lc[c].x(), lc[c].y(), lc[c].z() );
968 
969 
970  static const int arrP[] = { 3, 2, 1, 0, 7, 6, 5, 4 };
971  static const int arrN[] = { 7, 6, 5, 4 ,3, 2, 1, 0};
972  const int* arr = (detid.ieta() > 0) ? &arrP[0] : &arrN[0];
973 
974  double points[16];
975  for (int c = 0; c < 8; ++c) {
976  points[ c*2 + 0 ] = lc[arr[c]].x() - lCenter.x();
977  points[ c*2 + 1 ] = lc[arr[c]].y() - lCenter.y();
978  }
979 
980  float dz = (lc[4].z() -lc[0].z()) * 0.5;
981  TGeoShape* solid = new TGeoArb8(dz, &points[0]);
982  volume = new TGeoVolume("ecal oblique prism", solid, GetMedium(kHCal));
983  caloShapeMap[cell->param()] = volume;
984  }
985  else {
986 
987  volume = volIt->second;
988 
989  }
990 
991  HepGeom::Vector3D<float> gCenter;
992  CaloCellGeometry::CornersVec const & gc = cell->getCorners();
993  for (int c = 0; c < 8; ++c) {
994  gCenter += HepGeom::Vector3D<float>(gc[c].x(), gc[c].y(), gc[c].z());
995  // printf("gc.push_back(TEveVector(%.4f, %.4f, %.4f));\n", gc[c].x(), gc[c].y(),gc[c].z() );
996  }
997  gCenter *= 0.125;
998 
999  TGeoTranslation gtr(gCenter.x(), gCenter.y(), gCenter.z());
1000  TGeoRotation rot;
1001  rot.SetAngles(cell->phiPos()*TMath::RadToDeg(), 0, 0);
1002 
1003  TGeoVolume* holder = GetDaughter(assembly, "side", kHCal, detid.zside());
1004  holder = GetDaughter(holder, "ieta", kHCal, detid.ieta());
1005  std::stringstream nname;
1006  nname << detid;
1007  AddLeafNode(holder, volume, nname.str().c_str(), new TGeoCombiTrans(gtr, rot));
1008  }
1009 
1010  // printf("HE map size P = %lu , N = %lu", caloShapeMapP.size(),caloShapeMapN.size() );
1011 }
edm::ESHandle< CaloGeometry > m_caloGeom
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalDetId.cc:114
CaloCellGeometry::Pt3D Pt3D
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
int ieta() const
get the cell ieta
Definition: HcalDetId.h:56
#define end
Definition: vmac.h:37
TGeoVolume * GetDaughter(TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
CaloCellGeometry::Pt3DVec Pt3DVec
void FWTGeoRecoGeometryESProducer::addME0Geometry ( void  )
private

Definition at line 806 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by produce().

807 {
808  TGeoVolume* tv = GetTopHolder("Muon", kMuonME0);
809  TGeoVolume *assembly = GetDaughter(tv, "ME0", kMuonME0);
810 
811  DetId detId( DetId::Muon, 5 );
812  try
813  {
814  const ME0Geometry* me0Geom = (const ME0Geometry*) m_geomRecord->slaveGeometry( detId );
815 
816  for(auto roll : me0Geom->etaPartitions())
817  {
818  if( roll )
819  {
820  unsigned int rawid = roll->geographicalId().rawId();
821  //std::cout << "AMT FWTTTTRecoGeometryES\n" << rawid ;
822 
823  ME0DetId detid(rawid);
824  std::stringstream s;
825  s << detid;
826  std::string name = s.str();
827  TGeoVolume* child = createVolume( name, roll, kMuonME0 );
828 
829  TGeoVolume* holder = GetDaughter(assembly, "Region", kMuonME0, detid.region());
830  holder = GetDaughter(holder, "Layer", kMuonME0, detid.layer());
831  holder = GetDaughter(holder, "Chamber", kMuonME0, detid.chamber());
832  AddLeafNode(holder, child, name.c_str(), createPlacement(roll));
833 
834 
835  }
836  }
837  }
838  catch( cms::Exception &exception )
839  {
840  edm::LogInfo("FWRecoGeometry") << "failed to produce ME0 geometry " << exception.what() << std::endl;
841  }
842 }
virtual char const * what() const
Definition: Exception.cc:141
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
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:57
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 427 of file FWTGeoRecoGeometryESProducer.cc.

References createVolume(), TrackerGeometry::detsPXB(), end, GetDaughter(), GetTopHolder(), kSiPixel, PXBDetId::layer(), m_trackerGeom, PXBDetId::module(), DetId::rawId(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produce().

428 {
429  TGeoVolume* tv = GetTopHolder("SiPixel", kSiPixel);
430  TGeoVolume *assembly = GetDaughter(tv, "PXB", kSiPixel);
431 
432  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsPXB().begin(),
433  end = m_trackerGeom->detsPXB().end();
434  it != end; ++it)
435  {
436  DetId detid = ( *it )->geographicalId();
437  unsigned int rawid = detid.rawId();
438 
439  PXBDetId xx(rawid);
440  std::string name = Form("PXB Ly:%d, Md:%d Ld:%d ", xx.layer(), xx.module(), xx.layer());
441  TGeoVolume* child = createVolume( name, *it, kSiPixel );
442 
443  TGeoVolume* holder = GetDaughter(assembly, "Layer", kSiPixel, xx.layer());
444  holder = GetDaughter(holder, "Module", kSiPixel, xx.module());
445 
446  AddLeafNode(holder, child, name.c_str(), createPlacement( *it ));
447  }
448 
449 
450 }
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
const DetContainer & detsPXB() const
#define end
Definition: vmac.h:37
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::addPixelForwardGeometry ( void  )
private

Definition at line 455 of file FWTGeoRecoGeometryESProducer.cc.

References createVolume(), TrackerGeometry::detsPXF(), end, GetDaughter(), GetTopHolder(), kSiPixel, m_trackerGeom, alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produce().

456 {
457  TGeoVolume* tv = GetTopHolder("SiPixel", kSiPixel);
458  TGeoVolume *assembly = GetDaughter(tv, "PXF", kSiPixel);
459 
460  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsPXF().begin(),
461  end = m_trackerGeom->detsPXF().end();
462  it != end; ++it )
463  {
464  PXFDetId detid = ( *it )->geographicalId();
465  std::stringstream s;
466  s << detid;
467  std::string name = s.str();
468 
469  TGeoVolume* child = createVolume( name, *it, kSiPixel );
470 
471 
472  TGeoVolume* holder = GetDaughter(assembly, "Side", kSiPixel, detid.side());
473  holder = GetDaughter(holder, "Disk", kSiPixel, detid.disk());
474  holder = GetDaughter(holder, "Blade", kSiPixel, detid.blade());
475  holder = GetDaughter(holder, "Panel", kSiPixel, detid.panel());
476 
477  // holder->AddNode( child, 1, createPlacement( *it ));
478  AddLeafNode(holder, child, name.c_str(), createPlacement( *it ));
479 
480  }
481 
482 }
#define end
Definition: vmac.h:37
TGeoVolume * GetDaughter(TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
const DetContainer & detsPXF() const
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
TGeoVolume * createVolume(const std::string &name, const GeomDet *det, ERecoDet=kDummy)
void FWTGeoRecoGeometryESProducer::addRPCGeometry ( void  )
private

Definition at line 772 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by produce().

773 {
774  TGeoVolume* tv = GetTopHolder("Muon", kMuonRPC);
775  TGeoVolume *assembly = GetDaughter(tv, "RPC", kMuonRPC);
776 
778  const RPCGeometry* rpcGeom = (const RPCGeometry*) m_geomRecord->slaveGeometry( detId );
779  for( auto it = rpcGeom->rolls().begin(),
780  end = rpcGeom->rolls().end();
781  it != end; ++it )
782  {
783  RPCRoll const* roll = (*it);
784  if( roll )
785  {
786  RPCDetId detid = roll->geographicalId();
787  std::stringstream s;
788  s << detid;
789  std::string name = s.str();
790 
791  TGeoVolume* child = createVolume( name, roll, kMuonRPC );
792 
793  TGeoVolume* holder = GetDaughter(assembly, "ROLL Region", kMuonRPC, detid.region());
794  holder = GetDaughter(holder, "Ring", kMuonRPC, detid.ring());
795  holder = GetDaughter(holder, "Station", kMuonRPC, detid.station());
796  holder = GetDaughter(holder, "Sector", kMuonRPC, detid.sector());
797  holder = GetDaughter(holder, "Layer", kMuonRPC, detid.layer());
798  holder = GetDaughter(holder, "Subsector", kMuonRPC, detid.subsector());
799 
800  AddLeafNode(holder, child, name.c_str(), createPlacement(*it));
801  }
802  };
803 }
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
const std::vector< const RPCRoll * > & rolls() const
Return a vector of all RPC rolls.
Definition: RPCGeometry.cc:67
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
#define end
Definition: vmac.h:37
TGeoVolume * GetDaughter(TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
Definition: DetId.h:18
static const int RPC
Definition: MuonSubdetId.h:14
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
TGeoVolume * createVolume(const std::string &name, const GeomDet *det, ERecoDet=kDummy)
void FWTGeoRecoGeometryESProducer::addTECGeometry ( void  )
private

Definition at line 566 of file FWTGeoRecoGeometryESProducer.cc.

References createVolume(), TrackerGeometry::detsTEC(), end, GetDaughter(), GetTopHolder(), kSiStrip, m_trackerGeom, alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produce().

567 {
568  TGeoVolume* tv = GetTopHolder( "SiStrip", kSiStrip);
569  TGeoVolume *assembly = GetDaughter(tv, "TEC", kSiStrip);
570 
571  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTEC().begin(),
572  end = m_trackerGeom->detsTEC().end();
573  it != end; ++it )
574  {
575  TECDetId detid = ( *it )->geographicalId();
576 
577  std::stringstream s;
578  s << detid;
579  std::string name = s.str();
580 
581  TGeoVolume* child = createVolume( name, *it, kSiStrip );
582 
583  TGeoVolume* holder = GetDaughter(assembly, "Order", kSiStrip, detid.order());
584  holder = GetDaughter(holder, "Ring", kSiStrip, detid.ring());
585  holder = GetDaughter(holder, "Module", kSiStrip, detid.module());
586  AddLeafNode(holder, child, name.c_str(), createPlacement( *it ));
587  }
588 }
const DetContainer & detsTEC() const
#define end
Definition: vmac.h:37
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::addTIBGeometry ( void  )
private

Definition at line 488 of file FWTGeoRecoGeometryESProducer.cc.

References createVolume(), TrackerGeometry::detsTIB(), end, GetDaughter(), GetTopHolder(), kSiStrip, m_trackerGeom, alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produce().

489 {
490  TGeoVolume* tv = GetTopHolder( "SiStrip", kSiStrip);
491  TGeoVolume *assembly = GetDaughter(tv,"TIB", kSiStrip);
492 
493  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTIB().begin(),
494  end = m_trackerGeom->detsTIB().end();
495  it != end; ++it )
496  {
497  TIBDetId detid(( *it )->geographicalId());
498  std::stringstream s;
499  s << detid;
500  std::string name = s.str();
501 
502  TGeoVolume* child = createVolume( name, *it, kSiStrip );
503 
504  TGeoVolume* holder = GetDaughter(assembly, "Module", kSiStrip, detid.module());
505  holder = GetDaughter(holder, "Order", kSiStrip, detid.order());
506  holder = GetDaughter(holder, "Side", kSiStrip, detid.side());
507  AddLeafNode(holder, child, name.c_str(), createPlacement( *it ));
508  }
509 }
#define end
Definition: vmac.h:37
const DetContainer & detsTIB() const
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::addTIDGeometry ( void  )
private

Definition at line 515 of file FWTGeoRecoGeometryESProducer.cc.

References createVolume(), TrackerGeometry::detsTID(), end, GetDaughter(), GetTopHolder(), kSiStrip, m_trackerGeom, alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produce().

516 {
517  TGeoVolume* tv = GetTopHolder( "SiStrip", kSiStrip);
518  TGeoVolume *assembly = GetDaughter( tv, "TID", kSiStrip);
519 
520  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTID().begin(),
521  end = m_trackerGeom->detsTID().end();
522  it != end; ++it)
523  {
524  TIDDetId detid = ( *it )->geographicalId();
525  std::stringstream s;
526  s << detid;
527  std::string name = s.str();
528 
529  TGeoVolume* child = createVolume( name, *it, kSiStrip );
530  TGeoVolume* holder = GetDaughter(assembly, "Side", kSiStrip, detid.side());
531  holder = GetDaughter(holder, "Wheel", kSiStrip, detid.wheel());
532  holder = GetDaughter(holder, "Ring", kSiStrip, detid.ring());
533  AddLeafNode(holder, child, name.c_str(), createPlacement( *it ));
534  }
535 }
#define end
Definition: vmac.h:37
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)
const DetContainer & detsTID() const
void FWTGeoRecoGeometryESProducer::addTOBGeometry ( void  )
private

Definition at line 540 of file FWTGeoRecoGeometryESProducer.cc.

References createVolume(), TrackerGeometry::detsTOB(), end, GetDaughter(), GetTopHolder(), kSiStrip, m_trackerGeom, alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produce().

541 {
542  TGeoVolume* tv = GetTopHolder( "SiStrip", kSiStrip);
543  TGeoVolume *assembly = GetDaughter(tv, "TOB", kSiStrip);
544 
545  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTOB().begin(),
546  end = m_trackerGeom->detsTOB().end();
547  it != end; ++it )
548  {
549  TOBDetId detid(( *it )->geographicalId());
550  std::stringstream s;
551  s << detid;
552  std::string name = s.str();
553 
554  TGeoVolume* child = createVolume( name, *it, kSiStrip );
555  TGeoVolume* holder = GetDaughter(assembly, "Rod", kSiStrip, detid.rodNumber());
556  holder = GetDaughter(holder, "Side", kSiStrip, detid.side());
557  holder = GetDaughter(holder, "Module", kSiStrip, detid.moduleNumber());
558  AddLeafNode(holder, child, name.c_str(), createPlacement( *it ));
559  }
560 
561 }
#define end
Definition: vmac.h:37
TGeoVolume * GetDaughter(TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
const DetContainer & detsTOB() const
TGeoVolume * GetTopHolder(const char *prefix, ERecoDet cidx)
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 322 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by createVolume().

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

Create TGeo volume for GeomDet

Definition at line 399 of file FWTGeoRecoGeometryESProducer.cc.

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

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

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

References GetMedium().

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

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

Definition at line 131 of file FWTGeoRecoGeometryESProducer.cc.

References GetMedium().

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

Definition at line 171 of file FWTGeoRecoGeometryESProducer.cc.

References create_public_lumi_plots::color, kECal, kHCal, kHGCE, kHGCH, kMuonCSC, kMuonDT, kMuonGEM, kMuonME0, kMuonRPC, kSiPixel, kSiStrip, m_dummyMedium, m_recoMedium, AlCaHLTBitMon_QueryRunRegistry::string, and fireworks::switch().

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

Definition at line 149 of file FWTGeoRecoGeometryESProducer.cc.

References GetDaughter().

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

150 {
151  // printf("GetTopHolder res = %s \n", prefix);
152  TGeoVolume* res = GetDaughter(gGeoManager->GetTopVolume(), prefix, cidx);
153  return res;
154 }
TGeoVolume * GetDaughter(TGeoVolume *mother, const char *prefix, ERecoDet cidx, int id)
const FWTGeoRecoGeometryESProducer& FWTGeoRecoGeometryESProducer::operator= ( const FWTGeoRecoGeometryESProducer )
private
boost::shared_ptr< FWTGeoRecoGeometry > FWTGeoRecoGeometryESProducer::produce ( const FWTGeoRecoGeometryRecord record)

Definition at line 256 of file FWTGeoRecoGeometryESProducer.cc.

References addCSCGeometry(), addDTGeometry(), addEcalCaloGeometry(), addGEMGeometry(), addHcalCaloGeometryBarrel(), addHcalCaloGeometryEndcap(), addME0Geometry(), addPixelBarrelGeometry(), addPixelForwardGeometry(), addRPCGeometry(), addTECGeometry(), addTIBGeometry(), addTIDGeometry(), addTOBGeometry(), relativeConstraints::geom, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), m_caloGeom, m_dummyMedium, m_fwGeometry, m_geomRecord, m_trackerGeom, and DetId::Tracker.

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

257 {
258  using namespace edm;
259 
260  m_fwGeometry = boost::shared_ptr<FWTGeoRecoGeometry>( new FWTGeoRecoGeometry );
262 
263  DetId detId( DetId::Tracker, 0 );
264  m_trackerGeom = (const TrackerGeometry*) m_geomRecord->slaveGeometry( detId );
265 
266  record.getRecord<CaloGeometryRecord>().get( m_caloGeom );
267 
268  TGeoManager* geom = new TGeoManager( "cmsGeo", "CMS Detector" );
269  if( 0 == gGeoIdentity )
270  {
271  gGeoIdentity = new TGeoIdentity( "Identity" );
272  }
273 
274  m_fwGeometry->manager( geom );
275 
276  // Default material is Vacuum
277  TGeoMaterial *vacuum = new TGeoMaterial( "Vacuum", 0 ,0 ,0 );
278  m_dummyMedium = new TGeoMedium( "reco", 0, vacuum);
279 
280 
281  TGeoVolume *top = geom->MakeBox( "CMS", m_dummyMedium, 270., 270., 120. );
282 
283 
284  if( 0 == top )
285  {
286  return boost::shared_ptr<FWTGeoRecoGeometry>();
287  }
288  geom->SetTopVolume( top );
289  // ROOT chokes unless colors are assigned
290  top->SetVisibility( kFALSE );
291  top->SetLineColor( kBlue );
292 
295 
296  addTIBGeometry();
297  addTIDGeometry();
298  addTOBGeometry();
299  addTECGeometry();
300  addDTGeometry();
301 
302  addCSCGeometry();
303  addRPCGeometry();
304  addME0Geometry();
305  addGEMGeometry();
306 
310 
311  geom->CloseGeometry();
312 
313  geom->DefaultColors();
314  // printf("==== geo manager NNodes = %d \n", geom->GetNNodes());
315  geom->CloseGeometry();
316 
317  return m_fwGeometry;
318 }
edm::ESHandle< CaloGeometry > m_caloGeom
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
Definition: DetId.h:18
boost::shared_ptr< FWTGeoRecoGeometry > m_fwGeometry

Member Data Documentation

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

Definition at line 81 of file FWTGeoRecoGeometryESProducer.h.

Referenced by GetMedium(), and produce().

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

Definition at line 79 of file FWTGeoRecoGeometryESProducer.h.

Referenced by produce().

edm::ESHandle<GlobalTrackingGeometry> FWTGeoRecoGeometryESProducer::m_geomRecord
private
std::map<std::string, TGeoShape*> FWTGeoRecoGeometryESProducer::m_nameToShape
private

Definition at line 71 of file FWTGeoRecoGeometryESProducer.h.

Referenced by createShape().

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

Definition at line 73 of file FWTGeoRecoGeometryESProducer.h.

Referenced by GetMedium().

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

Definition at line 72 of file FWTGeoRecoGeometryESProducer.h.

Referenced by createVolume().

const TrackerGeometry* FWTGeoRecoGeometryESProducer::m_trackerGeom
private