00001 // -*- C++ -*- 00002 // 00003 // Package: HcalTopologyIdealEP 00004 // Class: HcalTopologyIdealEP 00005 // 00013 // 00014 // Original Author: Jeremiah Mans 00015 // Created: Mon Oct 3 11:35:27 CDT 2005 00016 // $Id: HcalTopologyIdealEP.cc,v 1.3 2008/04/21 22:18:19 heltsley Exp $ 00017 // 00018 // 00019 00020 #include "Geometry/HcalEventSetup/interface/HcalTopologyIdealEP.h" 00021 #include "Geometry/CaloTopology/interface/HcalTopologyRestrictionParser.h" 00022 #include "FWCore/Utilities/interface/Exception.h" 00023 #include "FWCore/MessageLogger/interface/MessageLogger.h" 00024 // 00025 // constants, enums and typedefs 00026 // 00027 00028 // 00029 // static data member definitions 00030 // 00031 00032 // 00033 // constructors and destructor 00034 // 00035 HcalTopologyIdealEP::HcalTopologyIdealEP(const edm::ParameterSet& conf) : 00036 m_restrictions(conf.getUntrackedParameter<std::string>("Exclude","")), 00037 m_h2mode(conf.getUntrackedParameter<bool>("H2Mode",false)) 00038 { 00039 //the following line is needed to tell the framework what 00040 // data is being produced 00041 setWhatProduced(this); 00042 } 00043 00044 00045 HcalTopologyIdealEP::~HcalTopologyIdealEP() 00046 { 00047 } 00048 00049 00050 // 00051 // member functions 00052 // 00053 00054 // ------------ method called to produce the data ------------ 00055 HcalTopologyIdealEP::ReturnType 00056 HcalTopologyIdealEP::produce(const IdealGeometryRecord& iRecord) 00057 { 00058 using namespace edm::es; 00059 if (m_h2mode) edm::LogInfo("HCAL") << "Using H2 Topology"; 00060 00061 ReturnType myTopo(new HcalTopology(m_h2mode)); 00062 00063 HcalTopologyRestrictionParser parser(*myTopo); 00064 if (!m_restrictions.empty()) { 00065 std::string error=parser.parse(m_restrictions); 00066 if (!error.empty()) { 00067 throw cms::Exception("Parse Error","Parse error on Exclude "+error); 00068 } 00069 } 00070 00071 return myTopo ; 00072 } 00073 00074