diff --git a/SimG4CMS/Calo/interface/HCalSD.h b/SimG4CMS/Calo/interface/HCalSD.h index 4ff2a8bf86fc2..a31c78158bd11 100644 --- a/SimG4CMS/Calo/interface/HCalSD.h +++ b/SimG4CMS/Calo/interface/HCalSD.h @@ -38,11 +38,11 @@ class TH1F; class HCalSD : public CaloSD, public Observer { public: HCalSD(const std::string&, - const HcalDDDSimConstants*, - const HcalDDDRecConstants*, - const HcalSimulationConstants*, - const HBHEDarkening*, - const HBHEDarkening*, + const HcalDDDSimConstants*, + const HcalDDDRecConstants*, + const HcalSimulationConstants*, + const HBHEDarkening*, + const HBHEDarkening*, const SensitiveDetectorCatalog&, edm::ParameterSet const&, const SimTrackManager*); diff --git a/SimG4CMS/Calo/plugins/HcalSensitiveDetectorBuilder.cc b/SimG4CMS/Calo/plugins/HcalSensitiveDetectorBuilder.cc index 3b277bf1eed0e..87ab350b27025 100644 --- a/SimG4CMS/Calo/plugins/HcalSensitiveDetectorBuilder.cc +++ b/SimG4CMS/Calo/plugins/HcalSensitiveDetectorBuilder.cc @@ -27,15 +27,26 @@ class HcalSensitiveDetectorBuilder : public SensitiveDetectorMakerBase { public: explicit HcalSensitiveDetectorBuilder(edm::ParameterSet const& p, edm::ConsumesCollector cc) - : hdscToken_{cc.esConsumes()}, hdrcToken_{cc.esConsumes()}, hscsToken_{cc.esConsumes()}, hbdkToken_{cc.esConsumes(edm::ESInputTag{"","HB"})}, hedkToken_{cc.esConsumes(edm::ESInputTag{"","HE"})}, hcalDDSim_{nullptr}, hcalDDRec_{nullptr}, hcalSimConstants_{nullptr}, hbDarkening_{nullptr}, heDarkening_{nullptr} { - edm::ParameterSet m_HC = p.getParameter("HCalSD"); - agingFlagHB_ = m_HC.getParameter("HBDarkening"); - agingFlagHE_ = m_HC.getParameter("HEDarkening"); - forTBHC_ = m_HC.getUntrackedParameter("ForTBHCAL", false); - forTBH2_ = m_HC.getUntrackedParameter("ForTBH2", false); -} + : hdscToken_{cc.esConsumes()}, + hdrcToken_{cc.esConsumes()}, + hscsToken_{cc.esConsumes()}, + hbdkToken_{ + cc.esConsumes(edm::ESInputTag{"", "HB"})}, + hedkToken_{ + cc.esConsumes(edm::ESInputTag{"", "HE"})}, + hcalDDSim_{nullptr}, + hcalDDRec_{nullptr}, + hcalSimConstants_{nullptr}, + hbDarkening_{nullptr}, + heDarkening_{nullptr} { + edm::ParameterSet m_HC = p.getParameter("HCalSD"); + agingFlagHB_ = m_HC.getParameter("HBDarkening"); + agingFlagHE_ = m_HC.getParameter("HEDarkening"); + forTBHC_ = m_HC.getUntrackedParameter("ForTBHCAL", false); + forTBH2_ = m_HC.getUntrackedParameter("ForTBH2", false); + } - void beginRun(const edm::EventSetup& es) final { + void beginRun(const edm::EventSetup& es) final { hcalDDSim_ = &es.getData(hdscToken_); if ((!forTBHC_) && (!forTBH2_)) hcalDDRec_ = &es.getData(hdrcToken_); @@ -47,16 +58,16 @@ class HcalSensitiveDetectorBuilder : public SensitiveDetectorMakerBase { if (agingFlagHB_) { edm::ESHandle hbdark = es.getHandle(hbdkToken_); if (hbdark.isValid()) - hbDarkening_ = hbdark.product(); + hbDarkening_ = hbdark.product(); else - edm::LogVerbatim("HcalSim") << "HcalSensitiveDetectorBuilder does not find record for HBDarkening"; + edm::LogVerbatim("HcalSim") << "HcalSensitiveDetectorBuilder does not find record for HBDarkening"; } if (agingFlagHE_) { edm::ESHandle hedark = es.getHandle(hedkToken_); if (hedark.isValid()) - heDarkening_ = hedark.product(); + heDarkening_ = hedark.product(); else - edm::LogVerbatim("HcalSim") << "HcalSensitiveDetectorBuilder does not find record for HEDarkening"; + edm::LogVerbatim("HcalSim") << "HcalSensitiveDetectorBuilder does not find record for HEDarkening"; } } @@ -65,7 +76,8 @@ class HcalSensitiveDetectorBuilder : public SensitiveDetectorMakerBase { const edm::ParameterSet& p, const SimTrackManager* man, SimActivityRegistry& reg) const final { - auto sd = std::make_unique(iname, hcalDDSim_, hcalDDRec_, hcalSimConstants_, hbDarkening_, heDarkening_, clg, p, man); + auto sd = std::make_unique( + iname, hcalDDSim_, hcalDDRec_, hcalSimConstants_, hbDarkening_, heDarkening_, clg, p, man); SimActivityRegistryEnroller::enroll(reg, sd.get()); return sd; } diff --git a/SimG4CMS/Calo/src/HCalSD.cc b/SimG4CMS/Calo/src/HCalSD.cc index e55d31e95e3d6..b28982af25300 100644 --- a/SimG4CMS/Calo/src/HCalSD.cc +++ b/SimG4CMS/Calo/src/HCalSD.cc @@ -40,11 +40,11 @@ #endif HCalSD::HCalSD(const std::string& name, - const HcalDDDSimConstants* hcns, - const HcalDDDRecConstants* hcnr, - const HcalSimulationConstants* hscs, - const HBHEDarkening* hbd, - const HBHEDarkening* hed, + const HcalDDDSimConstants* hcns, + const HcalDDDRecConstants* hcnr, + const HcalSimulationConstants* hscs, + const HBHEDarkening* hbd, + const HBHEDarkening* hed, const SensitiveDetectorCatalog& clg, edm::ParameterSet const& p, const SimTrackManager* manager) diff --git a/SimG4CMS/Calo/src/HcalTestNS.cc b/SimG4CMS/Calo/src/HcalTestNS.cc index ec78ecb55e26a..5c521a89c5c98 100644 --- a/SimG4CMS/Calo/src/HcalTestNS.cc +++ b/SimG4CMS/Calo/src/HcalTestNS.cc @@ -6,7 +6,7 @@ //#define EDM_ML_DEBUG -HcalTestNS::HcalTestNS(const HcalDDDRecConstants* hcons) : hcons_(hcons) { } +HcalTestNS::HcalTestNS(const HcalDDDRecConstants* hcons) : hcons_(hcons) {} HcalTestNS::~HcalTestNS() {}