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, boost::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 65 of file FWTGeoRecoGeometryESProducer.cc.

References edm::ESProducer::setWhatProduced().

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

Definition at line 71 of file FWTGeoRecoGeometryESProducer.cc.

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

Member Function Documentation

void FWTGeoRecoGeometryESProducer::addCSCGeometry ( void  )
private

Definition at line 686 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by produce().

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

Definition at line 597 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by produce().

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

References cond::rpcobgas::detid, 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().

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

Definition at line 729 of file FWTGeoRecoGeometryESProducer.cc.

References createVolume(), cond::rpcobgas::detid, 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().

730 {
731  try {
733  const GEMGeometry* gemGeom = (const GEMGeometry*) m_geomRecord->slaveGeometry( detId );
734 
735  TGeoVolume* tv = GetTopHolder("Muon", kMuonRPC);
736  TGeoVolume *assembly = GetDaughter(tv, "GEM", kMuonGEM);
737 
738  for( auto it = gemGeom->etaPartitions().begin(),
739  end = gemGeom->etaPartitions().end();
740  it != end; ++it )
741  {
742  const GEMEtaPartition* roll = (*it);
743  if( roll )
744  {
745  GEMDetId detid = roll->geographicalId();
746  std::stringstream s;
747  s << detid;
748  std::string name = s.str();
749 
750  TGeoVolume* child = createVolume( name, roll, kMuonGEM );
751 
752  TGeoVolume* holder = GetDaughter(assembly, "ROLL Region", kMuonGEM , detid.region());
753  holder = GetDaughter(holder, "Ring", kMuonGEM , detid.ring());
754  holder = GetDaughter(holder, "Station", kMuonGEM , detid.station());
755  holder = GetDaughter(holder, "Layer", kMuonGEM , detid.layer());
756  holder = GetDaughter(holder, "Chamber", kMuonGEM , detid.chamber());
757 
758  AddLeafNode(holder, child, name.c_str(), createPlacement(*it));
759  }
760  }
761  }catch (cms::Exception &exception) {
762  edm::LogInfo("FWRecoGeometry") << "failed to produce GEM geometry " << exception.what() << std::endl;
763 
764  }
765 }
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:77
#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 852 of file FWTGeoRecoGeometryESProducer.cc.

References EnergyCorrector::c, cond::rpcobgas::detid, 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, detailsBasic3DVector::y, detailsBasic3DVector::z, and HcalDetId::zside().

Referenced by produce().

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

Definition at line 936 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by produce().

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

Definition at line 805 of file FWTGeoRecoGeometryESProducer.cc.

Referenced by produce().

806 {
807  /*
808  TGeoVolume* tv = GetTopHolder("Muon", kMuonCSC);
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  */
843 }
void FWTGeoRecoGeometryESProducer::addPixelBarrelGeometry ( void  )
private

Definition at line 426 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by produce().

427 {
428  TGeoVolume* tv = GetTopHolder("SiPixel", kSiPixel);
429  TGeoVolume *assembly = GetDaughter(tv, "PXB", kSiPixel);
430 
431  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsPXB().begin(),
432  end = m_trackerGeom->detsPXB().end();
433  it != end; ++it)
434  {
435  DetId detid = ( *it )->geographicalId();
436  unsigned int rawid = detid.rawId();
437 
438  PXBDetId xx(rawid);
439  std::string name = Form("PXB Ly:%d, Md:%d Ld:%d ", xx.layer(), xx.module(), xx.layer());
440  TGeoVolume* child = createVolume( name, *it, kSiPixel );
441 
442  TGeoVolume* holder = GetDaughter(assembly, "Layer", kSiPixel, xx.layer());
443  holder = GetDaughter(holder, "Module", kSiPixel, xx.module());
444 
445  AddLeafNode(holder, child, name.c_str(), createPlacement( *it ));
446  }
447 
448 
449 }
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 454 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by produce().

455 {
456  TGeoVolume* tv = GetTopHolder("SiPixel", kSiPixel);
457  TGeoVolume *assembly = GetDaughter(tv, "PXF", kSiPixel);
458 
459  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsPXF().begin(),
460  end = m_trackerGeom->detsPXF().end();
461  it != end; ++it )
462  {
463  PXFDetId detid = ( *it )->geographicalId();
464  std::stringstream s;
465  s << detid;
466  std::string name = s.str();
467 
468  TGeoVolume* child = createVolume( name, *it, kSiPixel );
469 
470 
471  TGeoVolume* holder = GetDaughter(assembly, "Side", kSiPixel, detid.side());
472  holder = GetDaughter(holder, "Disk", kSiPixel, detid.disk());
473  holder = GetDaughter(holder, "Blade", kSiPixel, detid.blade());
474  holder = GetDaughter(holder, "Panel", kSiPixel, detid.panel());
475 
476  // holder->AddNode( child, 1, createPlacement( *it ));
477  AddLeafNode(holder, child, name.c_str(), createPlacement( *it ));
478 
479  }
480 
481 }
#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 771 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by produce().

772 {
773  TGeoVolume* tv = GetTopHolder("Muon", kMuonRPC);
774  TGeoVolume *assembly = GetDaughter(tv, "RPC", kMuonRPC);
775 
777  const RPCGeometry* rpcGeom = (const RPCGeometry*) m_geomRecord->slaveGeometry( detId );
778  for( auto it = rpcGeom->rolls().begin(),
779  end = rpcGeom->rolls().end();
780  it != end; ++it )
781  {
782  RPCRoll const* roll = (*it);
783  if( roll )
784  {
785  RPCDetId detid = roll->geographicalId();
786  std::stringstream s;
787  s << detid;
788  std::string name = s.str();
789 
790  TGeoVolume* child = createVolume( name, roll, kMuonRPC );
791 
792  TGeoVolume* holder = GetDaughter(assembly, "ROLL Region", kMuonRPC, detid.region());
793  holder = GetDaughter(holder, "Ring", kMuonRPC, detid.ring());
794  holder = GetDaughter(holder, "Station", kMuonRPC, detid.station());
795  holder = GetDaughter(holder, "Sector", kMuonRPC, detid.sector());
796  holder = GetDaughter(holder, "Layer", kMuonRPC, detid.layer());
797  holder = GetDaughter(holder, "Subsector", kMuonRPC, detid.subsector());
798 
799  AddLeafNode(holder, child, name.c_str(), createPlacement(*it));
800  }
801  };
802 }
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:77
#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 565 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by produce().

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

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

Referenced by produce().

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

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

Referenced by produce().

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

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

Referenced by produce().

540 {
541  TGeoVolume* tv = GetTopHolder( "SiStrip", kSiStrip);
542  TGeoVolume *assembly = GetDaughter(tv, "TOB", kSiStrip);
543 
544  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTOB().begin(),
545  end = m_trackerGeom->detsTOB().end();
546  it != end; ++it )
547  {
548  TOBDetId detid(( *it )->geographicalId());
549  std::stringstream s;
550  s << detid;
551  std::string name = s.str();
552 
553  TGeoVolume* child = createVolume( name, *it, kSiStrip );
554  TGeoVolume* holder = GetDaughter(assembly, "Rod", kSiStrip, detid.rodNumber());
555  holder = GetDaughter(holder, "Side", kSiStrip, detid.side());
556  holder = GetDaughter(holder, "Module", kSiStrip, detid.moduleNumber());
557  AddLeafNode(holder, child, name.c_str(), createPlacement( *it ));
558  }
559 
560 }
#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 321 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().

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

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

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

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

References GetMedium().

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

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

Definition at line 130 of file FWTGeoRecoGeometryESProducer.cc.

References GetMedium().

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

Definition at line 170 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, and AlCaHLTBitMon_QueryRunRegistry::string.

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

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

Definition at line 148 of file FWTGeoRecoGeometryESProducer.cc.

References GetDaughter(), and prof2calltree::prefix.

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

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

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