#include <tmp/CaloGeometryBuilder/interface/CaloGeometryBuilder.h>
Public Types | |
typedef boost::shared_ptr < CaloGeometry > | ReturnType |
typedef edm::ESHandle < CaloSubdetectorGeometry > | SubdType |
Public Member Functions | |
CaloGeometryBuilder (const edm::ParameterSet &iConfig) | |
ReturnType | produceAligned (const CaloGeometryRecord &iRecord) |
virtual | ~CaloGeometryBuilder () |
Private Attributes | |
std::vector< std::string > | theCaloList |
Description: <one line="" class="" summary>="">
Implementation: <Notes on="" implementation>="">
Definition at line 38 of file CaloGeometryBuilder.h.
typedef boost::shared_ptr<CaloGeometry> CaloGeometryBuilder::ReturnType |
Definition at line 42 of file CaloGeometryBuilder.h.
Definition at line 44 of file CaloGeometryBuilder.h.
CaloGeometryBuilder::CaloGeometryBuilder | ( | const edm::ParameterSet & | iConfig | ) |
Definition at line 38 of file CaloGeometryBuilder.cc.
References edm::ParameterSet::getParameter(), produceAligned(), edm::ESProducer::setWhatProduced(), and theCaloList.
{ //the following line is needed to tell the framework what // data is being produced setWhatProduced( this, &CaloGeometryBuilder::produceAligned ); //now do what ever other initialization is needed theCaloList = iConfig.getParameter< std::vector<std::string> >("SelectedCalos"); if ( theCaloList.size() == 0 ) throw cms::Exception("Configuration") << "No calorimeter specified for geometry, aborting"; }
virtual CaloGeometryBuilder::~CaloGeometryBuilder | ( | ) | [inline, virtual] |
Definition at line 48 of file CaloGeometryBuilder.h.
{} ;
CaloGeometryBuilder::ReturnType CaloGeometryBuilder::produceAligned | ( | const CaloGeometryRecord & | iRecord | ) |
Definition at line 55 of file CaloGeometryBuilder.cc.
References DetId::Calo, DetId::Ecal, EcalBarrel, EcalEndcap, EcalPreshower, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), DetId::Hcal, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, EcalPreshowerGeometry::producerTag(), ZdcGeometry::producerTag(), CastorGeometry::producerTag(), CaloTowerGeometry::producerTag(), HcalGeometry::producerTag(), edm::ESHandle< T >::product(), HcalCastorDetId::SubdetectorId, HcalZDCDetId::SubdetectorId, and theCaloList.
Referenced by CaloGeometryBuilder().
{ edm::ESHandle< CaloSubdetectorGeometry > pG; ReturnType pCalo ( new CaloGeometry() ) ; // loop on selected calorimeters for ( std::vector<std::string>::const_iterator ite ( theCaloList.begin() ) ; ite != theCaloList.end(); ++ite ) { // look for HCAL parts // assume 'HCAL' for all of HCAL. if ( (*ite) == HcalGeometry::producerTag() ) { edm::LogInfo("CaloGeometryBuilder") << "Building HCAL reconstruction geometry"; iRecord.getRecord< HcalGeometryRecord >().get( HcalGeometry::producerTag(), pG ); pCalo->setSubdetGeometry( DetId::Hcal, HcalBarrel , pG.product() ); pCalo->setSubdetGeometry( DetId::Hcal, HcalEndcap , pG.product() ); pCalo->setSubdetGeometry( DetId::Hcal, HcalOuter , pG.product() ); pCalo->setSubdetGeometry( DetId::Hcal, HcalForward, pG.product() ); } else if ( (*ite) == ZdcGeometry::producerTag() ) { edm::LogInfo("CaloGeometryBuilder") << "Building ZDC reconstruction geometry"; iRecord.getRecord< ZDCGeometryRecord >().get( ZdcGeometry::producerTag(), pG ); pCalo->setSubdetGeometry( DetId::Calo, HcalZDCDetId::SubdetectorId,pG.product()); } else if ( (*ite) == CastorGeometry::producerTag() ) { edm::LogInfo("CaloGeometryBuilder") << "Building CASTOR reconstruction geometry"; iRecord.getRecord< CastorGeometryRecord >().get( CastorGeometry::producerTag(), pG ); pCalo->setSubdetGeometry( DetId::Calo, HcalCastorDetId::SubdetectorId,pG.product()); } // look for Ecal Barrel else if ( (*ite) == EcalBarrelGeometry::producerTag() ) { edm::LogInfo("CaloGeometryBuilder") << "Building EcalBarrel reconstruction geometry"; iRecord.getRecord<EcalBarrelGeometryRecord>().get( EcalBarrelGeometry::producerTag(), pG ); pCalo->setSubdetGeometry(DetId::Ecal,EcalBarrel,pG.product()); } // look for Ecal Endcap else if ( (*ite) == EcalEndcapGeometry::producerTag() ) { edm::LogInfo("CaloGeometryBuilder") << "Building EcalEndcap reconstruction geometry"; iRecord.getRecord<EcalEndcapGeometryRecord>().get( EcalEndcapGeometry::producerTag(), pG ); pCalo->setSubdetGeometry(DetId::Ecal,EcalEndcap,pG.product()); } // look for Ecal Preshower else if ( (*ite) == EcalPreshowerGeometry::producerTag() ) { edm::LogInfo("CaloGeometryBuilder") << "Building EcalPreshower reconstruction geometry"; iRecord.getRecord<EcalPreshowerGeometryRecord>().get(EcalPreshowerGeometry::producerTag(), pG); pCalo->setSubdetGeometry(DetId::Ecal,EcalPreshower,pG.product()); } // look for TOWER parts else if ( (*ite) == CaloTowerGeometry::producerTag() ) { edm::LogInfo("CaloGeometryBuilder") << "Building TOWER reconstruction geometry"; iRecord.getRecord<CaloTowerGeometryRecord>().get(CaloTowerGeometry::producerTag(),pG); pCalo->setSubdetGeometry(DetId::Calo,1,pG.product()); } else { edm::LogWarning("CaloGeometryBuilder") << "Reconstrcution geometry requested for a not implemented sub-detector: " << (*ite); } } return pCalo ; }
std::vector<std::string> CaloGeometryBuilder::theCaloList [private] |
Definition at line 55 of file CaloGeometryBuilder.h.
Referenced by CaloGeometryBuilder(), and produceAligned().