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, kECal,
  kHCal, kHGCE, kHGCH
}
 

Private Member Functions

void addCSCGeometry ()
 
void addDTGeometry ()
 
void addEcalCaloGeometry ()
 
void addGEMGeometry ()
 
void addHcalCaloGeometryBarrel ()
 
void addHcalCaloGeometryEndcap ()
 
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 63 of file FWTGeoRecoGeometryESProducer.cc.

References edm::ESProducer::setWhatProduced().

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

Definition at line 69 of file FWTGeoRecoGeometryESProducer.cc.

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

Member Function Documentation

void FWTGeoRecoGeometryESProducer::addCSCGeometry ( void  )
private

Definition at line 663 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by produce().

664 {
665  if(! m_geomRecord->slaveGeometry( CSCDetId()))
666  throw cms::Exception( "FatalError" ) << "Cannnot find CSCGeometry\n";
667 
668 
669  TGeoVolume* tv = GetTopHolder("Muon", kMuonRPC);
670  TGeoVolume *assembly = GetDaughter(tv, "CSC", kMuonCSC);
671 
672  auto const & cscGeom = m_geomRecord->slaveGeometry( CSCDetId())->dets();
673  for( auto it = cscGeom.begin(), itEnd = cscGeom.end(); it != itEnd; ++it )
674  {
675  unsigned int rawid = (*it)->geographicalId();
676  CSCDetId detId(rawid);
677  std::stringstream s;
678  s << "CSC" << detId;
679  std::string name = s.str();
680 
681  TGeoVolume* child = 0;
682 
683  if( auto chamber = dynamic_cast<const CSCChamber*>(*it))
684  child = createVolume( name, chamber, kMuonCSC );
685  else if( auto * layer = dynamic_cast<const CSCLayer*>(*it))
686  child = createVolume( name, layer, kMuonCSC );
687 
688 
689 
690  if (child) {
691  TGeoVolume* holder = GetDaughter(assembly, "Endcap", kMuonCSC, detId.endcap());
692  holder = GetDaughter(holder, "Station", kMuonCSC, detId.station());
693  holder = GetDaughter(holder, "Ring", kMuonCSC, detId.ring());
694  holder = GetDaughter(holder, "Chamber", kMuonCSC , detId.chamber());
695 
696  // holder->AddNode(child, 1, createPlacement( *it ));
697  AddLeafNode(holder, child, name.c_str(), createPlacement(*it));
698  }
699  }
700 
701 }
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 574 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().

575 {
576  TGeoVolume* tv = GetTopHolder("Muon", kMuonRPC);
577  TGeoVolume *assemblyTop = GetDaughter(tv, "DT", kMuonDT);
578 
579  //
580  // DT chambers geometry
581  //
582  {
583  TGeoVolume *assembly = GetDaughter(assemblyTop, "DTChamber", kMuonDT);
584  auto const & dtChamberGeom = m_geomRecord->slaveGeometry( DTChamberId())->dets();
585  for( auto it = dtChamberGeom.begin(),
586  end = dtChamberGeom.end();
587  it != end; ++it )
588  {
589  if( auto chamber = dynamic_cast< const DTChamber *>(*it))
590  {
591  DTChamberId detid = chamber->geographicalId();
592  std::stringstream s;
593  s << detid;
594  std::string name = s.str();
595 
596  TGeoVolume* child = createVolume( name, chamber, kMuonDT );
597  TGeoVolume* holder = GetDaughter(assembly, "Wheel", kMuonDT, detid.wheel());
598  holder = GetDaughter(holder, "Station", kMuonDT, detid.station());
599  holder = GetDaughter(holder, "Sector", kMuonDT, detid.sector());
600 
601  AddLeafNode(holder, child, name.c_str(), createPlacement( chamber));
602  }
603  }
604  }
605 
606  // Fill in DT super layer parameters
607  {
608  TGeoVolume *assembly = GetDaughter(assemblyTop, "DTSuperLayer", kMuonDT);
609  auto const & dtSuperLayerGeom = m_geomRecord->slaveGeometry( DTSuperLayerId())->dets();
610  for( auto it = dtSuperLayerGeom.begin(),
611  end = dtSuperLayerGeom.end();
612  it != end; ++it )
613  {
614  if( auto * superlayer = dynamic_cast<const DTSuperLayer*>(*it))
615  {
616  DTSuperLayerId detid( DetId(superlayer->geographicalId()));
617  std::stringstream s;
618  s << detid;
619  std::string name = s.str();
620 
621  TGeoVolume* child = createVolume( name, superlayer, kMuonDT );
622 
623  TGeoVolume* holder = GetDaughter(assembly, "Wheel", kMuonDT, detid.wheel());
624  holder = GetDaughter(holder, "Station", kMuonDT, detid.station());
625  holder = GetDaughter(holder, "Sector", kMuonDT, detid.sector());
626  holder = GetDaughter(holder, "SuperLayer", kMuonDT, detid.superlayer());
627  AddLeafNode(holder, child, name.c_str(), createPlacement( superlayer));
628  }
629  }
630  }
631  // Fill in DT layer parameters
632  {
633  TGeoVolume *assembly = GetDaughter(assemblyTop, "DTLayer", kMuonDT);
634  auto const & dtLayerGeom = m_geomRecord->slaveGeometry( DTLayerId())->dets();
635  for( auto it = dtLayerGeom.begin(),
636  end = dtLayerGeom.end();
637  it != end; ++it )
638  {
639  if(auto layer = dynamic_cast<const DTLayer*>(*it))
640  {
641 
642  DTLayerId detid( DetId(layer->geographicalId()));
643 
644  std::stringstream s;
645  s << detid;
646  std::string name = s.str();
647 
648  TGeoVolume* child = createVolume( name, layer, kMuonDT );
649 
650  TGeoVolume* holder = GetDaughter(assembly, "Wheel", kMuonDT, detid.wheel());
651  holder = GetDaughter(holder, "Station", kMuonDT, detid.station());
652  holder = GetDaughter(holder, "Sector", kMuonDT, detid.sector());
653  holder = GetDaughter(holder, "SuperLayer", kMuonDT, detid.superlayer());
654  holder = GetDaughter(holder, "Layer", kMuonDT, detid.layer());
655  AddLeafNode(holder, child, name.c_str(), createPlacement( layer));
656  }
657  }
658  }
659 }
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 1031 of file FWTGeoRecoGeometryESProducer.cc.

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

Referenced by produce().

1032 {
1033 
1034  TGeoVolume* tv = GetTopHolder("ECal", kECal);
1035  CaloVolMap caloShapeMap;
1036 
1037  {
1038  TGeoVolume *assembly = GetDaughter(tv, "ECalBarrel", kECal);
1039 
1040  std::vector<DetId> vid = m_caloGeom->getValidDetIds(DetId::Ecal, EcalSubdetector::EcalBarrel);
1041  for( std::vector<DetId>::const_iterator it = vid.begin(), end = vid.end(); it != end; ++it)
1042  {
1043  EBDetId detid(*it);
1044  const TruncatedPyramid* cell = dynamic_cast<const TruncatedPyramid*> ( m_caloGeom->getGeometry( *it ));
1045  if (!cell) { printf("ecalBarrel cell not a TruncatedPyramid !!\n"); return; }
1046 
1047  TGeoVolume* volume = 0;
1048  CaloVolMap::iterator volIt = caloShapeMap.find(cell->param());
1049  if ( volIt == caloShapeMap.end())
1050  {
1051  volume = new TGeoVolume( "EE TruncatedPyramid" , makeEcalShape(cell), GetMedium(kECal));
1052  caloShapeMap[cell->param()] = volume;
1053  }
1054  else {
1055  volume = volIt->second;
1056  }
1057  TGeoHMatrix* mtx= getEcalTrans(cell->getCorners());
1058  TGeoVolume* holder = GetDaughter(assembly, "side", kECal, detid.zside());
1059  holder = GetDaughter(holder, "ieta", kECal, detid.ieta());
1060  std::stringstream nname;
1061  nname << detid;
1062  AddLeafNode(holder, volume, nname.str().c_str(), mtx);
1063  }
1064  }
1065 
1066 
1067  {
1068  TGeoVolume *assembly = GetDaughter(tv, "ECalEndcap", kECal);
1069 
1070  std::vector<DetId> vid = m_caloGeom->getValidDetIds(DetId::Ecal, EcalSubdetector::EcalEndcap);
1071  for( std::vector<DetId>::const_iterator it = vid.begin(), end = vid.end(); it != end; ++it)
1072  {
1073  EEDetId detid(*it);
1074  const TruncatedPyramid* cell = dynamic_cast<const TruncatedPyramid*> (m_caloGeom->getGeometry( *it ));
1075  if (!cell) { printf("ecalEndcap cell not a TruncatedPyramid !!\n"); continue;}
1076 
1077  TGeoVolume* volume = 0;
1078  CaloVolMap::iterator volIt = caloShapeMap.find(cell->param());
1079  if ( volIt == caloShapeMap.end())
1080  {
1081 
1082  volume = new TGeoVolume( "EE TruncatedPyramid" , makeEcalShape(cell), GetMedium(kECal));
1083  caloShapeMap[cell->param()] = volume;
1084  }
1085  else {
1086  volume = volIt->second;
1087  }
1088  TGeoHMatrix* mtx= getEcalTrans(cell->getCorners());
1089  TGeoVolume* holder = GetDaughter(assembly, "side", kECal, detid.zside());
1090  holder = GetDaughter(holder, "ix", kECal, detid.ix());
1091  std::stringstream nname;
1092  nname << detid;
1093  AddLeafNode(holder, volume, nname.str().c_str(), mtx);
1094  }
1095  }
1096 }
edm::ESHandle< CaloGeometry > m_caloGeom
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)
void FWTGeoRecoGeometryESProducer::addGEMGeometry ( void  )
private

Definition at line 706 of file FWTGeoRecoGeometryESProducer.cc.

References createVolume(), cond::rpcobgas::detid, end, GEMGeometry::etaPartitions(), MuonSubdetId::GEM, GeomDet::geographicalId(), GetDaughter(), GetTopHolder(), kMuonGEM, kMuonRPC, m_geomRecord, DetId::Muon, alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produce().

707 {
708 
710  const GEMGeometry* gemGeom = (const GEMGeometry*) m_geomRecord->slaveGeometry( detId );
711 
712  TGeoVolume* tv = GetTopHolder("Muon", kMuonRPC);
713  TGeoVolume *assembly = GetDaughter(tv, "GEM", kMuonGEM);
714 
715  for( auto it = gemGeom->etaPartitions().begin(),
716  end = gemGeom->etaPartitions().end();
717  it != end; ++it )
718  {
719  const GEMEtaPartition* roll = (*it);
720  if( roll )
721  {
722  GEMDetId detid = roll->geographicalId();
723  std::stringstream s;
724  s << detid;
725  std::string name = s.str();
726 
727  TGeoVolume* child = createVolume( name, roll, kMuonGEM );
728 
729  TGeoVolume* holder = GetDaughter(assembly, "ROLL Region", kMuonGEM , detid.region());
730  holder = GetDaughter(holder, "Ring", kMuonGEM , detid.ring());
731  holder = GetDaughter(holder, "Station", kMuonGEM , detid.station());
732  holder = GetDaughter(holder, "Layer", kMuonGEM , detid.layer());
733  holder = GetDaughter(holder, "Chamber", kMuonGEM , detid.chamber());
734 
735  AddLeafNode(holder, child, name.c_str(), createPlacement(*it));
736  }
737  }
738 }
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 chambers.
Definition: GEMGeometry.cc:57
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:72
#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 797 of file FWTGeoRecoGeometryESProducer.cc.

References trackerHits::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().

798 {
799  TGeoVolume* tv = GetTopHolder("HCal", kHCal);
800  TGeoVolume *assembly = GetDaughter(tv, "HCalBarrel", kHCal);
801 
802  std::vector<DetId> vid = m_caloGeom->getValidDetIds(DetId::Hcal, HcalSubdetector::HcalBarrel);
803 
804  CaloVolMap caloShapeMapP;
805  CaloVolMap caloShapeMapN;
806  for( std::vector<DetId>::const_iterator it = vid.begin(), end = vid.end(); it != end; ++it)
807  {
808  HcalDetId detid = HcalDetId(it->rawId());
809 
810  const CaloCellGeometry* cellb= m_caloGeom->getGeometry(*it);
811 
812  const IdealObliquePrism* cell = dynamic_cast<const IdealObliquePrism*> (cellb);
813 
814  if (!cell) { printf ("HB not olique !!!\n"); continue; }
815 
816  TGeoVolume* volume = 0;
817  CaloVolMap& caloShapeMap = (cell->etaPos() > 0) ? caloShapeMapP : caloShapeMapN;
818  CaloVolMap::iterator volIt = caloShapeMap.find(cell->param());
819  if (volIt == caloShapeMap.end())
820  {
821  // printf("FIREWORKS NEW SHAPE BEGIN eta = %f etaPos = %f, phiPos %f >>>>>> \n", cell->eta(), cell->etaPos(), cell->phiPos());
824  IdealObliquePrism::localCorners( lc, cell->param(), ref);
825  HepGeom::Vector3D<float> lCenter;
826  for( int c = 0; c < 8; ++c)
827  lCenter += lc[c];
828  lCenter *= 0.125;
829 
830  static const int arr[] = { 1, 0, 3, 2, 5, 4, 7, 6 };
831  double points[16];
832  for (int c = 0; c < 8; ++c) {
833  if (cell->etaPos() > 0 )
834  points[ c*2 + 0 ] = -(lc[arr[c]].z() - lCenter.z());
835  else
836  points[ c*2 + 0 ] = (lc[arr[c]].z() - lCenter.z());
837 
838  points[ c*2 + 1 ] = (lc[arr[c]].y() - lCenter.y());
839  // printf("AMT xy[%d] <=>[%d] = (%.4f, %.4f) \n", arr[c], c, points[c*2], points[c*2+1]);
840  }
841 
842  float dz = (lc[4].x() -lc[0].x()) * 0.5;
843  TGeoShape* solid = new TGeoArb8(dz, &points[0]);
844  volume = new TGeoVolume("hcal oblique prism", solid, GetMedium(kHCal));
845  caloShapeMap[cell->param()] = volume;
846  }
847  else {
848 
849  volume = volIt->second;
850 
851  }
852 
853  HepGeom::Vector3D<float> gCenter;
854  CaloCellGeometry::CornersVec const & gc = cell->getCorners();
855  for (int c = 0; c < 8; ++c)
856  gCenter += HepGeom::Vector3D<float>(gc[c].x(), gc[c].y(), gc[c].z());
857  gCenter *= 0.125;
858 
859  TGeoTranslation gtr(gCenter.x(), gCenter.y(), gCenter.z());
860  TGeoRotation rot;
861  rot.RotateY(90);
862 
863  TGeoRotation rotPhi;
864  rotPhi.SetAngles(0, -cell->phiPos()*TMath::RadToDeg(), 0);
865  rot.MultiplyBy(&rotPhi);
866 
867  TGeoVolume* holder = GetDaughter(assembly, "side", kHCal, detid.zside());
868  holder = GetDaughter(holder, "ieta", kHCal, detid.ieta());
869  std::stringstream nname;
870  nname << detid;
871  AddLeafNode(holder, volume, nname.str().c_str(), new TGeoCombiTrans(gtr, rot));
872  }
873 
874 
875  // printf("HB map size P = %lu , N = %lu", caloShapeMapP.size(),caloShapeMapN.size() );
876 
877 }
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 881 of file FWTGeoRecoGeometryESProducer.cc.

References trackerHits::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().

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

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

404 {
405  TGeoVolume* tv = GetTopHolder("SiPixel", kSiPixel);
406  TGeoVolume *assembly = GetDaughter(tv, "PXB", kSiPixel);
407 
408  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsPXB().begin(),
409  end = m_trackerGeom->detsPXB().end();
410  it != end; ++it)
411  {
412  DetId detid = ( *it )->geographicalId();
413  unsigned int rawid = detid.rawId();
414 
415  PXBDetId xx(rawid);
416  std::string name = Form("PXB Ly:%d, Md:%d Ld:%d ", xx.layer(), xx.module(), xx.layer());
417  TGeoVolume* child = createVolume( name, *it, kSiPixel );
418 
419  TGeoVolume* holder = GetDaughter(assembly, "Layer", kSiPixel, xx.layer());
420  holder = GetDaughter(holder, "Module", kSiPixel, xx.module());
421 
422  AddLeafNode(holder, child, name.c_str(), createPlacement( *it ));
423  }
424 
425 
426 }
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 431 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().

432 {
433  TGeoVolume* tv = GetTopHolder("SiPixel", kSiPixel);
434  TGeoVolume *assembly = GetDaughter(tv, "PXF", kSiPixel);
435 
436  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsPXF().begin(),
437  end = m_trackerGeom->detsPXF().end();
438  it != end; ++it )
439  {
440  PXFDetId detid = ( *it )->geographicalId();
441  std::stringstream s;
442  s << detid;
443  std::string name = s.str();
444 
445  TGeoVolume* child = createVolume( name, *it, kSiPixel );
446 
447 
448  TGeoVolume* holder = GetDaughter(assembly, "Side", kSiPixel, detid.side());
449  holder = GetDaughter(holder, "Disk", kSiPixel, detid.disk());
450  holder = GetDaughter(holder, "Blade", kSiPixel, detid.blade());
451  holder = GetDaughter(holder, "Panel", kSiPixel, detid.panel());
452 
453  // holder->AddNode( child, 1, createPlacement( *it ));
454  AddLeafNode(holder, child, name.c_str(), createPlacement( *it ));
455 
456  }
457 
458 }
#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 744 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().

745 {
746  TGeoVolume* tv = GetTopHolder("Muon", kMuonRPC);
747  TGeoVolume *assembly = GetDaughter(tv, "RPC", kMuonRPC);
748 
750  const RPCGeometry* rpcGeom = (const RPCGeometry*) m_geomRecord->slaveGeometry( detId );
751  for( auto it = rpcGeom->rolls().begin(),
752  end = rpcGeom->rolls().end();
753  it != end; ++it )
754  {
755  RPCRoll const* roll = (*it);
756  if( roll )
757  {
758  RPCDetId detid = roll->geographicalId();
759  std::stringstream s;
760  s << detid;
761  std::string name = s.str();
762 
763  TGeoVolume* child = createVolume( name, roll, kMuonRPC );
764 
765  TGeoVolume* holder = GetDaughter(assembly, "ROLL Region", kMuonRPC, detid.region());
766  holder = GetDaughter(holder, "Ring", kMuonRPC, detid.ring());
767  holder = GetDaughter(holder, "Station", kMuonRPC, detid.station());
768  holder = GetDaughter(holder, "Sector", kMuonRPC, detid.sector());
769  holder = GetDaughter(holder, "Layer", kMuonRPC, detid.layer());
770  holder = GetDaughter(holder, "Subsector", kMuonRPC, detid.subsector());
771 
772  AddLeafNode(holder, child, name.c_str(), createPlacement(*it));
773  }
774  };
775 }
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:72
#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 542 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().

543 {
544  TGeoVolume* tv = GetTopHolder( "SiStrip", kSiStrip);
545  TGeoVolume *assembly = GetDaughter(tv, "TEC", kSiStrip);
546 
547  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTEC().begin(),
548  end = m_trackerGeom->detsTEC().end();
549  it != end; ++it )
550  {
551  TECDetId detid = ( *it )->geographicalId();
552 
553  std::stringstream s;
554  s << detid;
555  std::string name = s.str();
556 
557  TGeoVolume* child = createVolume( name, *it, kSiStrip );
558 
559  TGeoVolume* holder = GetDaughter(assembly, "Order", kSiStrip, detid.order());
560  holder = GetDaughter(holder, "Ring", kSiStrip, detid.ring());
561  holder = GetDaughter(holder, "Module", kSiStrip, detid.module());
562  AddLeafNode(holder, child, name.c_str(), createPlacement( *it ));
563  }
564 }
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 464 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().

465 {
466  TGeoVolume* tv = GetTopHolder( "SiStrip", kSiStrip);
467  TGeoVolume *assembly = GetDaughter(tv,"TIB", kSiStrip);
468 
469  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTIB().begin(),
470  end = m_trackerGeom->detsTIB().end();
471  it != end; ++it )
472  {
473  TIBDetId detid(( *it )->geographicalId());
474  std::stringstream s;
475  s << detid;
476  std::string name = s.str();
477 
478  TGeoVolume* child = createVolume( name, *it, kSiStrip );
479 
480  TGeoVolume* holder = GetDaughter(assembly, "Module", kSiStrip, detid.module());
481  holder = GetDaughter(holder, "Order", kSiStrip, detid.order());
482  holder = GetDaughter(holder, "Side", kSiStrip, detid.side());
483  AddLeafNode(holder, child, name.c_str(), createPlacement( *it ));
484  }
485 }
#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 491 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().

492 {
493  TGeoVolume* tv = GetTopHolder( "SiStrip", kSiStrip);
494  TGeoVolume *assembly = GetDaughter( tv, "TID", kSiStrip);
495 
496  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTID().begin(),
497  end = m_trackerGeom->detsTID().end();
498  it != end; ++it)
499  {
500  TIDDetId detid = ( *it )->geographicalId();
501  std::stringstream s;
502  s << detid;
503  std::string name = s.str();
504 
505  TGeoVolume* child = createVolume( name, *it, kSiStrip );
506  TGeoVolume* holder = GetDaughter(assembly, "Side", kSiStrip, detid.side());
507  holder = GetDaughter(holder, "Wheel", kSiStrip, detid.wheel());
508  holder = GetDaughter(holder, "Ring", kSiStrip, detid.ring());
509  AddLeafNode(holder, child, name.c_str(), createPlacement( *it ));
510  }
511 }
#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 516 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().

517 {
518  TGeoVolume* tv = GetTopHolder( "SiStrip", kSiStrip);
519  TGeoVolume *assembly = GetDaughter(tv, "TOB", kSiStrip);
520 
521  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTOB().begin(),
522  end = m_trackerGeom->detsTOB().end();
523  it != end; ++it )
524  {
525  TOBDetId detid(( *it )->geographicalId());
526  std::stringstream s;
527  s << detid;
528  std::string name = s.str();
529 
530  TGeoVolume* child = createVolume( name, *it, kSiStrip );
531  TGeoVolume* holder = GetDaughter(assembly, "Rod", kSiStrip, detid.rodNumber());
532  holder = GetDaughter(holder, "Side", kSiStrip, detid.side());
533  holder = GetDaughter(holder, "Module", kSiStrip, detid.moduleNumber());
534  AddLeafNode(holder, child, name.c_str(), createPlacement( *it ));
535  }
536 
537 }
#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 298 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().

299 {
300  TGeoShape* shape = 0;
301 
302  // Trapezoidal
303  const Bounds *b = &((det->surface ()).bounds ());
304  const TrapezoidalPlaneBounds *b2 = dynamic_cast<const TrapezoidalPlaneBounds *> (b);
305  if( b2 )
306  {
307  std::array< const float, 4 > const & par = b2->parameters ();
308 
309  // These parameters are half-lengths, as in CMSIM/GEANT3
310  float hBottomEdge = par [0];
311  float hTopEdge = par [1];
312  float thickness = par [2];
313  float apothem = par [3];
314 
315  std::stringstream s;
316  s << "T_"
317  << hBottomEdge << "_"
318  << hTopEdge << "_"
319  << thickness << "_"
320  << apothem;
321  std::string name = s.str();
322 
323  // Do not create identical shape,
324  // if one already exists
325  shape = m_nameToShape[name];
326  if( 0 == shape )
327  {
328  shape = new TGeoTrap(
329  name.c_str(),
330  thickness, //dz
331  0, //theta
332  0, //phi
333  apothem, //dy1
334  hBottomEdge,//dx1
335  hTopEdge, //dx2
336  0, //alpha1
337  apothem, //dy2
338  hBottomEdge,//dx3
339  hTopEdge, //dx4
340  0); //alpha2
341 
342  m_nameToShape[name] = shape;
343  }
344  }
345  if( dynamic_cast<const RectangularPlaneBounds *> (b) != 0 )
346  {
347  // Rectangular
348  float length = det->surface().bounds().length();
349  float width = det->surface().bounds ().width();
350  float thickness = det->surface().bounds().thickness();
351 
352  std::stringstream s;
353  s << "R_"
354  << width << "_"
355  << length << "_"
356  << thickness;
357  std::string name = s.str();
358 
359  // Do not create identical shape,
360  // if one already exists
361  shape = m_nameToShape[name];
362  if( 0 == shape )
363  {
364  shape = new TGeoBBox( name.c_str(), width / 2., length / 2., thickness / 2. ); // dx, dy, dz
365 
366  m_nameToShape[name] = shape;
367  }
368  }
369 
370  return shape;
371 }
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:35
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 375 of file FWTGeoRecoGeometryESProducer.cc.

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

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

376 {
377  TGeoShape* solid = createShape( det );
378 
379  std::map<TGeoShape*, TGeoVolume*>::iterator vIt = m_shapeToVolume.find(solid);
380  if (vIt != m_shapeToVolume.end()) return vIt->second;
381 
382 
383  TGeoVolume* volume = new TGeoVolume( name.c_str(),solid, GetMedium(mid));
384 
385  m_shapeToVolume[solid] = volume;
386 
387  return volume;
388 }
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 111 of file FWTGeoRecoGeometryESProducer.cc.

References GetMedium().

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

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

Definition at line 128 of file FWTGeoRecoGeometryESProducer.cc.

References GetMedium().

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

Definition at line 155 of file FWTGeoRecoGeometryESProducer.cc.

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

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

156 {
157  std::map<ERecoDet, TGeoMedium*>::iterator it = m_recoMedium.find(det);
158  if (it != m_recoMedium.end())
159  return it->second;
160 
162  int color;
163  // see TGeoManager::DefaultColors()
164  switch (det)
165  {
166  case kSiPixel:
167  name = "SiPixel";
168  color = 4;//kGreen-10
169  break;
170  case kSiStrip:
171  name = "SiStrip";
172  color = 29; // kOrange+9
173  break;
174  case kMuonDT:
175  name = "MuonDT";
176  color = 13; // kBlue -10
177  break;
178  case kMuonGEM:
179  name = "MuonGEM";
180  color = 16; //kYellow+1
181  break;
182  case kMuonRPC:
183  name = "MuonRPC";
184  color = 10; //kRed-10
185  break;
186  case kMuonCSC:
187  name = "MuonCSC"; // kMagenta
188  color = 9;
189  break;
190  case kECal:
191  name = "ECal";
192  color = 6;
193  break;
194  case kHCal:
195  name = "HCal";
196  color = 10; // kRed-10
197  break;
198  case kHGCE:
199  name = "HGCEE";
200  color = 10;
201  break;
202  case kHGCH:
203  name = "HGCEH";
204  color = 6; // kBlue -7
205  break;
206  default:
207  printf("invalid medium id \n");
208  return m_dummyMedium;
209  }
210 
211  TGeoMaterial* mat = new TGeoMaterial(name.c_str(), 0, 0, 0);
212  mat->SetZ(color);
213  m_recoMedium[det] = new TGeoMedium(name.c_str(), 0, mat);
214  mat->SetFillStyle(3000); // tansparency 3000-3100
215  mat->SetDensity(1); // disable override of transparency in TGeoManager::DefaultColors()
216 
217  return m_recoMedium[det];
218 }
std::map< ERecoDet, TGeoMedium * > m_recoMedium
TGeoVolume * FWTGeoRecoGeometryESProducer::GetTopHolder ( const char *  prefix,
ERecoDet  cidx 
)
private

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

147 {
148  // printf("GetTopHolder res = %s \n", prefix);
149  TGeoVolume* res = GetDaughter(gGeoManager->GetTopVolume(), prefix, cidx);
150  return res;
151 }
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 226 of file FWTGeoRecoGeometryESProducer.cc.

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

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

227 {
228  using namespace edm;
229 
230  m_fwGeometry = boost::shared_ptr<FWTGeoRecoGeometry>( new FWTGeoRecoGeometry );
232 
233  DetId detId( DetId::Tracker, 0 );
234  m_trackerGeom = (const TrackerGeometry*) m_geomRecord->slaveGeometry( detId );
235 
236  record.getRecord<CaloGeometryRecord>().get( m_caloGeom );
237 
238  TGeoManager* geom = new TGeoManager( "cmsGeo", "CMS Detector" );
239  if( 0 == gGeoIdentity )
240  {
241  gGeoIdentity = new TGeoIdentity( "Identity" );
242  }
243 
244  m_fwGeometry->manager( geom );
245 
246  // Default material is Vacuum
247  TGeoMaterial *vacuum = new TGeoMaterial( "Vacuum", 0 ,0 ,0 );
248  m_dummyMedium = new TGeoMedium( "reco", 0, vacuum);
249 
250 
251  TGeoVolume *top = geom->MakeBox( "CMS", m_dummyMedium, 270., 270., 120. );
252 
253 
254  if( 0 == top )
255  {
256  return boost::shared_ptr<FWTGeoRecoGeometry>();
257  }
258  geom->SetTopVolume( top );
259  // ROOT chokes unless colors are assigned
260  top->SetVisibility( kFALSE );
261  top->SetLineColor( kBlue );
262 
264 
266  addTIBGeometry();
267  addTIDGeometry();
268  addTOBGeometry();
269  addTECGeometry();
270  addDTGeometry();
271  addCSCGeometry();
272  addRPCGeometry();
273  try {
274  addGEMGeometry();
275  }
276  catch ( cms::Exception& exception ) {
277  edm::LogWarning("FWRecoGeometryProducerException")
278  << "addGEMGeometry() Exception caught while building GEM geometry: " << exception.what()
279  << std::endl;
280  }
281 
282 
284 
287 
288  geom->CloseGeometry();
289 
290  geom->DefaultColors();
291  geom->CloseGeometry();
292 
293  return m_fwGeometry;
294 }
virtual char const * what() const
Definition: Exception.cc:141
edm::ESHandle< CaloGeometry > m_caloGeom
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
Definition: DetId.h:18
string top
Definition: fff_deleter.py:272
boost::shared_ptr< FWTGeoRecoGeometry > m_fwGeometry

Member Data Documentation

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

Definition at line 80 of file FWTGeoRecoGeometryESProducer.h.

Referenced by GetMedium(), and produce().

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

Definition at line 78 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 70 of file FWTGeoRecoGeometryESProducer.h.

Referenced by createShape().

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

Definition at line 72 of file FWTGeoRecoGeometryESProducer.h.

Referenced by GetMedium().

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

Definition at line 71 of file FWTGeoRecoGeometryESProducer.h.

Referenced by createVolume().

const TrackerGeometry* FWTGeoRecoGeometryESProducer::m_trackerGeom
private