CMS 3D CMS Logo

HcalTopologyIdealEP.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: HcalTopologyIdealEP
4 // Class: HcalTopologyIdealEP
5 //
13 //
14 // Original Author: Jeremiah Mans
15 // Created: Mon Oct 3 11:35:27 CDT 2005
16 //
17 //
18 
26 
27 //#define EDM_ML_DEBUG
28 
31  m_restrictions(conf.getUntrackedParameter<std::string>("Exclude")),
32  m_mergePosition(conf.getUntrackedParameter<bool>("MergePosition")) {
33 #ifdef EDM_ML_DEBUG
34  edm::LogVerbatim("HCalGeom") << "HcalTopologyIdealEP::HcalTopologyIdealEP with Exclude: " << m_restrictions
35  << " MergePosition: " << m_mergePosition;
36  edm::LogInfo("HCAL") << "HcalTopologyIdealEP::HcalTopologyIdealEP";
37 #endif
38 }
39 
42  desc.addUntracked<std::string>("Exclude", "");
43  desc.addUntracked<bool>("MergePosition", false);
44  descriptions.add("hcalTopologyIdealBase", desc);
45 }
46 
47 // ------------ method called to produce the data ------------
49 #ifdef EDM_ML_DEBUG
50  edm::LogVerbatim("HCalGeom") << "HcalTopologyIdealEP::produce(const IdealGeometryRecord& iRecord)";
51  edm::LogInfo("HCAL") << "HcalTopologyIdealEP::produce(const HcalGeometryRecord& iRecord)";
52 #endif
53  const HcalDDDRecConstants& hdc = iRecord.get(m_hdcToken);
54 
55 #ifdef EDM_ML_DEBUG
56  edm::LogVerbatim("HCalGeom") << "mode = " << hdc.getTopoMode() << ", maxDepthHB = " << hdc.getMaxDepth(0)
57  << ", maxDepthHE = " << hdc.getMaxDepth(1) << ", maxDepthHF = " << hdc.getMaxDepth(2);
58  edm::LogInfo("HCAL") << "mode = " << hdc.getTopoMode() << ", maxDepthHB = " << hdc.getMaxDepth(0)
59  << ", maxDepthHE = " << hdc.getMaxDepth(1) << ", maxDepthHF = " << hdc.getMaxDepth(2);
60 #endif
61  ReturnType myTopo(new HcalTopology(&hdc, m_mergePosition));
62 
64  if (!m_restrictions.empty()) {
66  if (!error.empty()) {
67  throw cms::Exception("Parse Error", "Parse error on Exclude " + error);
68  }
69  }
70  return myTopo;
71 }
Log< level::Info, true > LogVerbatim
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:165
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
HcalTopologyIdealEP(const edm::ParameterSet &)
HcalTopology(const HcalDDDRecConstants *hcons, const bool mergePosition=false)
Definition: HcalTopology.cc:17
ReturnType produce(const HcalRecNumberingRecord &)
int getMaxDepth(const int &type) const
edm::ESGetToken< HcalDDDRecConstants, HcalRecNumberingRecord > m_hdcToken
Log< level::Info, false > LogInfo
void add(std::string const &label, ParameterSetDescription const &psetDescription)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
std::unique_ptr< HcalTopology > ReturnType