diff --git a/RecoMuon/MuonIdentification/interface/MuonShowerDigiFiller.h b/RecoMuon/MuonIdentification/interface/MuonShowerDigiFiller.h index 99491ab78b6e8..91457ff495330 100644 --- a/RecoMuon/MuonIdentification/interface/MuonShowerDigiFiller.h +++ b/RecoMuon/MuonIdentification/interface/MuonShowerDigiFiller.h @@ -46,6 +46,7 @@ class MuonShowerDigiFiller { public: + MuonShowerDigiFiller() {} MuonShowerDigiFiller(const edm::ParameterSet&, edm::ConsumesCollector&& iC); void getES(const edm::EventSetup& iSetup); diff --git a/RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc b/RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc index 7901e86d6c6aa..39f87e9fe1f7f 100644 --- a/RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc +++ b/RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc @@ -89,6 +89,8 @@ MuonIdProducer::MuonIdProducer(const edm::ParameterSet& iConfig) if (fillShowerDigis_ && fillMatching_) { edm::ParameterSet showerDigiParameters = iConfig.getParameter("ShowerDigiFillerParameters"); theShowerDigiFiller_ = std::make_unique(showerDigiParameters, consumesCollector()); + } else { + theShowerDigiFiller_ = std::make_unique(); // to be used to call fillDefault only } if (fillCaloCompatibility_) { @@ -888,7 +890,7 @@ void MuonIdProducer::fillMuonId(edm::Event& iEvent, matchedChamber.id = chamber.id; - if (fillShowerDigis_) { + if (fillShowerDigis_ && fillMatching_) { theShowerDigiFiller_->fill(matchedChamber); } else { theShowerDigiFiller_->fillDefault(matchedChamber);