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.4 2010/03/26 19:56:09 sunanda 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 if (m_h2mode) edm::LogInfo("HCAL") << "Using H2 Topology"; 00059 00060 ReturnType myTopo(new HcalTopology(m_h2mode)); 00061 00062 HcalTopologyRestrictionParser parser(*myTopo); 00063 if (!m_restrictions.empty()) { 00064 std::string error=parser.parse(m_restrictions); 00065 if (!error.empty()) { 00066 throw cms::Exception("Parse Error","Parse error on Exclude "+error); 00067 } 00068 } 00069 00070 return myTopo ; 00071 } 00072 00073