Go to the documentation of this file.00001
00002
00003
00004
00005
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "Geometry/CaloEventSetup/plugins/CaloGeometryBuilder.h"
00023 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
00024 #include "DataFormats/HcalDetId/interface/HcalZDCDetId.h"
00025 #include "DataFormats/HcalDetId/interface/HcalCastorDetId.h"
00026 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
00027 #include "Geometry/EcalAlgo/interface/EcalBarrelGeometry.h"
00028 #include "Geometry/EcalAlgo/interface/EcalEndcapGeometry.h"
00029 #include "Geometry/EcalAlgo/interface/EcalPreshowerGeometry.h"
00030 #include "Geometry/HcalTowerAlgo/interface/HcalGeometry.h"
00031 #include "Geometry/HcalTowerAlgo/interface/CaloTowerGeometry.h"
00032 #include "Geometry/ForwardGeometry/interface/CastorGeometry.h"
00033 #include "Geometry/ForwardGeometry/interface/ZdcGeometry.h"
00034 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00035
00036
00037
00038 CaloGeometryBuilder::CaloGeometryBuilder( const edm::ParameterSet& iConfig )
00039 {
00040
00041
00042 setWhatProduced( this,
00043 &CaloGeometryBuilder::produceAligned );
00044
00045
00046
00047 theCaloList = iConfig.getParameter< std::vector<std::string> >("SelectedCalos");
00048 if ( theCaloList.size() == 0 ) throw cms::Exception("Configuration")
00049 << "No calorimeter specified for geometry, aborting";
00050 }
00051
00052
00053
00054 CaloGeometryBuilder::ReturnType
00055 CaloGeometryBuilder::produceAligned( const CaloGeometryRecord& iRecord )
00056 {
00057
00058
00059 edm::ESHandle< CaloSubdetectorGeometry > pG;
00060
00061 ReturnType pCalo ( new CaloGeometry() ) ;
00062
00063
00064
00065 for ( std::vector<std::string>::const_iterator ite ( theCaloList.begin() ) ;
00066 ite != theCaloList.end(); ++ite )
00067 {
00068
00069
00070 if ( (*ite) == HcalGeometry::producerTag() )
00071 {
00072 edm::LogInfo("CaloGeometryBuilder") << "Building HCAL reconstruction geometry";
00073
00074 iRecord.getRecord< HcalGeometryRecord >().get( HcalGeometry::producerTag(), pG );
00075 pCalo->setSubdetGeometry( DetId::Hcal, HcalBarrel , pG.product() );
00076 pCalo->setSubdetGeometry( DetId::Hcal, HcalEndcap , pG.product() );
00077 pCalo->setSubdetGeometry( DetId::Hcal, HcalOuter , pG.product() );
00078 pCalo->setSubdetGeometry( DetId::Hcal, HcalForward, pG.product() );
00079 }
00080 else if ( (*ite) == ZdcGeometry::producerTag() )
00081 {
00082 edm::LogInfo("CaloGeometryBuilder") << "Building ZDC reconstruction geometry";
00083 iRecord.getRecord< ZDCGeometryRecord >().get( ZdcGeometry::producerTag(), pG );
00084 pCalo->setSubdetGeometry( DetId::Calo, HcalZDCDetId::SubdetectorId,pG.product());
00085 }
00086 else if ( (*ite) == CastorGeometry::producerTag() )
00087 {
00088 edm::LogInfo("CaloGeometryBuilder") << "Building CASTOR reconstruction geometry";
00089 iRecord.getRecord< CastorGeometryRecord >().get( CastorGeometry::producerTag(), pG );
00090 pCalo->setSubdetGeometry( DetId::Calo, HcalCastorDetId::SubdetectorId,pG.product());
00091 }
00092
00093 else if ( (*ite) == EcalBarrelGeometry::producerTag() )
00094 {
00095
00096 edm::LogInfo("CaloGeometryBuilder") << "Building EcalBarrel reconstruction geometry";
00097 iRecord.getRecord<EcalBarrelGeometryRecord>().get( EcalBarrelGeometry::producerTag(), pG );
00098 pCalo->setSubdetGeometry(DetId::Ecal,EcalBarrel,pG.product());
00099 }
00100
00101 else if ( (*ite) == EcalEndcapGeometry::producerTag() )
00102 {
00103 edm::LogInfo("CaloGeometryBuilder") << "Building EcalEndcap reconstruction geometry";
00104 iRecord.getRecord<EcalEndcapGeometryRecord>().get( EcalEndcapGeometry::producerTag(), pG );
00105 pCalo->setSubdetGeometry(DetId::Ecal,EcalEndcap,pG.product());
00106 }
00107
00108 else if ( (*ite) == EcalPreshowerGeometry::producerTag() )
00109 {
00110 edm::LogInfo("CaloGeometryBuilder") << "Building EcalPreshower reconstruction geometry";
00111 iRecord.getRecord<EcalPreshowerGeometryRecord>().get(EcalPreshowerGeometry::producerTag(), pG);
00112 pCalo->setSubdetGeometry(DetId::Ecal,EcalPreshower,pG.product());
00113 }
00114
00115 else if ( (*ite) == CaloTowerGeometry::producerTag() )
00116 {
00117 edm::LogInfo("CaloGeometryBuilder") << "Building TOWER reconstruction geometry";
00118 iRecord.getRecord<CaloTowerGeometryRecord>().get(CaloTowerGeometry::producerTag(),pG);
00119 pCalo->setSubdetGeometry(DetId::Calo,1,pG.product());
00120 }
00121 else
00122 {
00123 edm::LogWarning("CaloGeometryBuilder")
00124 << "Reconstrcution geometry requested for a not implemented sub-detector: "
00125 << (*ite);
00126 }
00127 }
00128 return pCalo ;
00129 }