CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 boost::shared_ptr
< CaloGeometry
ReturnType
 
typedef edm::ESHandle
< CaloSubdetectorGeometry
SubdType
 
- 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
 

Public Member Functions

 CaloGeometryBuilder (const edm::ParameterSet &iConfig)
 
ReturnType produceAligned (const CaloGeometryRecord &iRecord)
 
virtual ~CaloGeometryBuilder ()
 
- 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 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::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

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

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

Definition at line 37 of file CaloGeometryBuilder.h.

Member Typedef Documentation

typedef boost::shared_ptr<CaloGeometry> CaloGeometryBuilder::ReturnType

Definition at line 41 of file CaloGeometryBuilder.h.

Definition at line 43 of file CaloGeometryBuilder.h.

Constructor & Destructor Documentation

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

Definition at line 37 of file CaloGeometryBuilder.cc.

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

38 {
39  //the following line is needed to tell the framework what
40  // data is being produced
41  setWhatProduced( this,
43 
44  //now do what ever other initialization is needed
45 
46  theCaloList = iConfig.getParameter< std::vector<std::string> >("SelectedCalos");
47  if ( theCaloList.size() == 0 ) throw cms::Exception("Configuration")
48  << "No calorimeter specified for geometry, aborting";
49 }
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)
virtual CaloGeometryBuilder::~CaloGeometryBuilder ( )
inlinevirtual

Definition at line 47 of file CaloGeometryBuilder.h.

47 {} ;

Member Function Documentation

CaloGeometryBuilder::ReturnType CaloGeometryBuilder::produceAligned ( const CaloGeometryRecord iRecord)

Definition at line 54 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(), edm::ESHandle< class >::product(), HcalZDCDetId::SubdetectorId, HcalCastorDetId::SubdetectorId, and theCaloList.

Referenced by CaloGeometryBuilder().

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

Member Data Documentation

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

Definition at line 54 of file CaloGeometryBuilder.h.

Referenced by CaloGeometryBuilder(), and produceAligned().