CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
CaloGeometryBuilder Class Reference

#include <tmp/CaloGeometryBuilder/interface/CaloGeometryBuilder.h>

Inheritance diagram for CaloGeometryBuilder:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Types

typedef std::shared_ptr< CaloGeometryReturnType
 
typedef edm::ESHandle< CaloSubdetectorGeometrySubdType
 
- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
 
typedef std::vector< EventSetupRecordKeyKeys
 
typedef std::map< EventSetupRecordKey, KeyedProxiesRecordProxies
 

Public Member Functions

 CaloGeometryBuilder (const edm::ParameterSet &iConfig)
 
ReturnType produceAligned (const CaloGeometryRecord &iRecord)
 
 ~CaloGeometryBuilder () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ~ESProducer ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval) override
 overrides DataProxyProvider method More...
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- 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 () noexcept(false)
 

Private Attributes

std::vector< std::string > theCaloList
 

Additional Inherited Members

- 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::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList) override
 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

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 36 of file CaloGeometryBuilder.h.

Member Typedef Documentation

Definition at line 40 of file CaloGeometryBuilder.h.

Definition at line 42 of file CaloGeometryBuilder.h.

Constructor & Destructor Documentation

CaloGeometryBuilder::CaloGeometryBuilder ( const edm::ParameterSet iConfig)

Definition at line 38 of file CaloGeometryBuilder.cc.

References edm::ParameterSet::getParameter(), produceAligned(), edm::ESProducer::setWhatProduced(), and theCaloList.

39 {
40  //the following line is needed to tell the framework what
41  // data is being produced
42  setWhatProduced( this,
44 
45  //now do what ever other initialization is needed
46 
47  theCaloList = iConfig.getParameter< std::vector<std::string> >("SelectedCalos");
48  if ( theCaloList.empty() ) throw cms::Exception("Configuration")
49  << "No calorimeter specified for geometry, aborting";
50 }
T getParameter(std::string const &) const
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
std::vector< std::string > theCaloList
ReturnType produceAligned(const CaloGeometryRecord &iRecord)
CaloGeometryBuilder::~CaloGeometryBuilder ( )
inlineoverride

Definition at line 46 of file CaloGeometryBuilder.h.

References produceAligned().

46 {} ;

Member Function Documentation

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, CaloTowerGeometry::producerTag(), ZdcGeometry::producerTag(), CastorGeometry::producerTag(), HcalGeometry::producerTag(), EcalPreshowerGeometry::producerTag(), EcalEndcapGeometry::producerTag(), EcalBarrelGeometry::producerTag(), HGCalGeometry::producerTag(), edm::ESHandle< T >::product(), HcalZDCDetId::SubdetectorId, HcalCastorDetId::SubdetectorId, theCaloList, and HGCalGeometry::topology().

Referenced by CaloGeometryBuilder(), and ~CaloGeometryBuilder().

56 {
58 
59  ReturnType pCalo ( new CaloGeometry() ) ;
60 
61  // loop on selected calorimeters
62 
63  for ( std::vector<std::string>::const_iterator ite ( theCaloList.begin() ) ;
64  ite != theCaloList.end(); ++ite )
65  {
66  // look for HCAL parts
67  // assume 'HCAL' for all of HCAL.
68  if ( (*ite) == HcalGeometry::producerTag() )
69  {
70  edm::LogInfo("CaloGeometryBuilder") << "Building HCAL reconstruction geometry";
71 
72  iRecord.getRecord< HcalGeometryRecord >().get( HcalGeometry::producerTag(), pG );
73  pCalo->setSubdetGeometry( DetId::Hcal, HcalBarrel , pG.product() );
74  pCalo->setSubdetGeometry( DetId::Hcal, HcalEndcap , pG.product() );
75  pCalo->setSubdetGeometry( DetId::Hcal, HcalOuter , pG.product() );
76  pCalo->setSubdetGeometry( DetId::Hcal, HcalForward, pG.product() );
77  }
78  else if ( (*ite) == ZdcGeometry::producerTag() )
79  {
80  edm::LogInfo("CaloGeometryBuilder") << "Building ZDC reconstruction geometry";
81  iRecord.getRecord< ZDCGeometryRecord >().get( ZdcGeometry::producerTag(), pG );
82  pCalo->setSubdetGeometry( DetId::Calo, HcalZDCDetId::SubdetectorId,pG.product());
83  }
84  else if ( (*ite) == CastorGeometry::producerTag() )
85  {
86  edm::LogInfo("CaloGeometryBuilder") << "Building CASTOR reconstruction geometry";
88  pCalo->setSubdetGeometry( DetId::Calo, HcalCastorDetId::SubdetectorId,pG.product());
89  }
90  // look for Ecal Barrel
91  else if ( (*ite) == EcalBarrelGeometry::producerTag() )
92  {
93  edm::LogInfo("CaloGeometryBuilder") << "Building EcalBarrel reconstruction geometry";
95  pCalo->setSubdetGeometry(DetId::Ecal,EcalBarrel,pG.product());
96  }
97  // look for Ecal Endcap
98  else if ( (*ite) == EcalEndcapGeometry::producerTag() )
99  {
100  edm::LogInfo("CaloGeometryBuilder") << "Building EcalEndcap reconstruction geometry";
102  pCalo->setSubdetGeometry(DetId::Ecal,EcalEndcap,pG.product());
103  }
104  // look for Ecal Preshower
105  else if ( (*ite) == EcalPreshowerGeometry::producerTag() )
106  {
107  edm::LogInfo("CaloGeometryBuilder") << "Building EcalPreshower reconstruction geometry";
109  pCalo->setSubdetGeometry(DetId::Ecal,EcalPreshower,pG.product());
110  }
111  // look for TOWER parts
112  else if ( (*ite) == CaloTowerGeometry::producerTag() )
113  {
114  edm::LogInfo("CaloGeometryBuilder") << "Building TOWER reconstruction geometry";
116  pCalo->setSubdetGeometry(DetId::Calo,1,pG.product());
117  }
118  else if ( ite->find(HGCalGeometry::producerTag()) != std::string::npos ) {
119  edm::LogInfo("CaloGeometryBuilder") << "Building " << *ite << " reconstruction geometry";
121  iRecord.getRecord<IdealGeometryRecord>().get(*ite,pHG);
122  const auto& topo = pHG->topology();
123  pCalo->setSubdetGeometry(topo.detector(),topo.subDetector(),pHG.product());
124  }
125  else
126  {
127  edm::LogWarning("CaloGeometryBuilder")
128  << "Reconstruction geometry requested for a not implemented sub-detector: "
129  << (*ite);
130  }
131  }
132  return pCalo ;
133 }
static std::string producerTag()
Definition: ZdcGeometry.h:46
static std::string producerTag()
Definition: HGCalGeometry.h:99
static std::string producerTag()
Definition: HcalGeometry.h:67
static std::string producerTag()
std::shared_ptr< CaloGeometry > ReturnType
static std::string producerTag()
static std::string producerTag()
const HGCalTopology & topology() const
std::vector< std::string > theCaloList
static const int SubdetectorId
static std::string producerTag()
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
static std::string producerTag()
T const * product() const
Definition: ESHandle.h:86

Member Data Documentation

std::vector<std::string> CaloGeometryBuilder::theCaloList
private

Definition at line 53 of file CaloGeometryBuilder.h.

Referenced by CaloGeometryBuilder(), and produceAligned().