Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
// -*- C++ -*-
//
// Package:    ZdcTopologyEP
// Class:      ZdcTopologyEP
//
/**\class ZdcTopologyEP ZdcTopologyEP.h tmp/ZdcTopologyEP/interface/ZdcTopologyEP.h

 Description: <one line class summary>

 Implementation:
     <Notes on implementation>
*/

#include "Geometry/ForwardGeometry/plugins/ZdcTopologyEP.h"
#include "Geometry/HcalCommonData/interface/HcalDDDRecConstants.h"
#include "FWCore/Utilities/interface/Exception.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"

//#define EDM_ML_DEBUG

ZdcTopologyEP::ZdcTopologyEP(const edm::ParameterSet& conf)
    : m_hdcToken{setWhatProduced(this, &ZdcTopologyEP::produce).consumes<HcalDDDRecConstants>(edm::ESInputTag{})} {
#ifdef EDM_ML_DEBUG
  edm::LogVerbatim("HCalGeom") << "ZdcTopologyEP::ZdcTopologyEP";
#endif
}

void ZdcTopologyEP::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
  edm::ParameterSetDescription desc;
  descriptions.add("zdcTopologyEP", desc);
}

// ------------ method called to produce the data  ------------
ZdcTopologyEP::ReturnType ZdcTopologyEP::produce(const HcalRecNumberingRecord& iRecord) {
#ifdef EDM_ML_DEBUG
  edm::LogVerbatim("HCalGeom") << "ZdcTopologyEP::produce(const HcalRecNumberingRecord& iRecord)";
#endif
  const HcalDDDRecConstants& hdc = iRecord.get(m_hdcToken);

#ifdef EDM_ML_DEBUG
  edm::LogVerbatim("HCalGeom") << "mode = " << hdc.getTopoMode();
#endif
  ReturnType myTopo(new ZdcTopology(&hdc));
  return myTopo;
}