Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run3hcx378A Provide a way to avoid Digitization for the ZDC detector #46570

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Configuration/Eras/python/Modifier_zdcNoDigi_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import FWCore.ParameterSet.Config as cms

zdcNoDigi = cms.Modifier()
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# whether cells with MC signal get noise added
doNoise = cms.bool(True),
killHE = cms.bool(False),
doZDCDigi = cms.bool(True),
HcalPreMixStage1 = cms.bool(False),
HcalPreMixStage2 = cms.bool(False),
# whether cells with no MC signal get an empty signal created
Expand Down Expand Up @@ -64,3 +65,7 @@
# remove HE processing for phase 2, completely put in HGCal land
from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal
phase2_hgcal.toModify(hcalSimBlock, killHE = cms.bool(True) )

# remove HE processing for phase 2, completely put in HGCal land
from Configuration.Eras.Modifier_zdcNoDigi_cff import zdcNoDigi
zdcNoDigi.toModify(hcalSimBlock, doZDCDigi = cms.bool(False) )
38 changes: 24 additions & 14 deletions SimCalorimetry/HcalSimProducers/src/HcalDigitizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <boost/foreach.hpp>
#include <memory>

//#define EDM_ML_DEBUG
#define EDM_ML_DEBUG

HcalDigitizer::HcalDigitizer(const edm::ParameterSet &ps, edm::ConsumesCollector &iC)
: conditionsToken_(iC.esConsumes()),
Expand Down Expand Up @@ -84,7 +84,7 @@ HcalDigitizer::HcalDigitizer(const edm::ParameterSet &ps, edm::ConsumesCollector
theHFQIE10Digitizer(nullptr),
theHBHEQIE11Digitizer(nullptr),
theRelabeller(nullptr),
isZDC(true),
isZDC(ps.getParameter<bool>("doZDCDigi")),
isHCAL(true),
zdcgeo(true),
hbhegeo(true),
Expand Down Expand Up @@ -207,10 +207,18 @@ HcalDigitizer::HcalDigitizer(const edm::ParameterSet &ps, edm::ConsumesCollector
theHFDigitizer = std::make_unique<HFDigitizer>(theHFResponse.get(), theHFElectronicsSim.get(), doEmpty);

// temporary move until Run3 ZDC will be added
theZDCDigitizer = std::make_unique<ZDCDigitizer>(theZDCResponse.get(), theZDCElectronicsSim.get(), doEmpty);
if (isZDC) {
theZDCDigitizer = std::make_unique<ZDCDigitizer>(theZDCResponse.get(), theZDCElectronicsSim.get(), doEmpty);
} else {
theZDCDigitizer = nullptr;
edm::LogVerbatim("HcalDigitizer") << "Inhibit ZDC Digitization";
}
edm::LogVerbatim("HcalDigitizer") << "iszDC: " << isZDC << " theZDCDigitizer: " << theZDCDigitizer;

testNumbering_ = ps.getParameter<bool>("TestNumbering");
// edm::LogVerbatim("HcalSim") << "Flag to see if Hit Relabeller to be initiated " << testNumbering_;
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HcalSim") << "Flag to see if Hit Relabeller to be initiated " << testNumbering_;
#endif
if (testNumbering_)
theRelabeller = std::make_unique<HcalHitRelabeller>(ps.getParameter<bool>("doNeutralDensityFilter"));

Expand Down Expand Up @@ -366,7 +374,7 @@ void HcalDigitizer::accumulateCaloHits(edm::Handle<std::vector<PCaloHit>> const
darkening(hcalHitsOrig);
}
// Relabel PCaloHits if necessary
edm::LogInfo("HcalDigitizer") << "Calling Relabeller";
edm::LogVerbatim("HcalDigitizer") << "Calling Relabeller";
theRelabeller->process(hcalHitsOrig);
}

Expand Down Expand Up @@ -418,7 +426,7 @@ void HcalDigitizer::accumulateCaloHits(edm::Handle<std::vector<PCaloHit>> const
theHFQIE10Digitizer->add(hcalHits, bunchCrossing, engine);
}
} else {
edm::LogInfo("HcalDigitizer") << "We don't have HCAL hit collection available ";
edm::LogVerbatim("HcalDigitizer") << "We don't have HCAL hit collection available ";
}

if (isZDC) {
Expand All @@ -444,7 +452,7 @@ void HcalDigitizer::accumulateCaloHits(edm::Handle<std::vector<PCaloHit>> const
theZDCDigitizer->add(zdcHits, bunchCrossing, engine);
}
} else {
edm::LogInfo("HcalDigitizer") << "We don't have ZDC hit collection available ";
edm::LogVerbatim("HcalDigitizer") << "We don't have ZDC hit collection available ";
}
}

Expand Down Expand Up @@ -520,12 +528,12 @@ void HcalDigitizer::finalizeEvent(edm::Event &e, const edm::EventSetup &eventSet
theZDCDigitizer->run(*zdcResult, engine);
}

edm::LogInfo("HcalDigitizer") << "HCAL HBHE digis : " << hbheResult->size();
edm::LogInfo("HcalDigitizer") << "HCAL HO digis : " << hoResult->size();
edm::LogInfo("HcalDigitizer") << "HCAL HF digis : " << hfResult->size();
edm::LogInfo("HcalDigitizer") << "HCAL ZDC digis : " << zdcResult->size();
edm::LogInfo("HcalDigitizer") << "HCAL HF QIE10 digis : " << hfQIE10Result->size();
edm::LogInfo("HcalDigitizer") << "HCAL HBHE QIE11 digis : " << hbheQIE11Result->size();
edm::LogVerbatim("HcalDigitizer") << "HCAL HBHE digis : " << hbheResult->size();
edm::LogVerbatim("HcalDigitizer") << "HCAL HO digis : " << hoResult->size();
edm::LogVerbatim("HcalDigitizer") << "HCAL HF digis : " << hfResult->size();
edm::LogVerbatim("HcalDigitizer") << "HCAL ZDC digis : " << zdcResult->size();
edm::LogVerbatim("HcalDigitizer") << "HCAL HF QIE10 digis : " << hfQIE10Result->size();
edm::LogVerbatim("HcalDigitizer") << "HCAL HBHE QIE11 digis : " << hbheQIE11Result->size();

#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HcalSim") << "\nHCAL HBHE digis : " << hbheResult->size();
Expand Down Expand Up @@ -637,7 +645,9 @@ void HcalDigitizer::updateGeometry(const edm::EventSetup &eventSetup) {
// geometry->getValidDetIds(DetId::Hcal, HcalTriggerTower); const
// std::vector<DetId>& hcalCalib = geometry->getValidDetIds(DetId::Calo,
// HcalCastorDetId::SubdetectorId);
// edm::LogVerbatim("HcalSim") <<"HcalDigitizer::CheckGeometry number of cells: << zdcCells.size();
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HcalSim") << "HcalDigitizer::CheckGeometry number of cells: " << zdcCells.size();
#endif
if (zdcCells.empty())
zdcgeo = false;
if (hbCells.empty() && heCells.empty())
Expand Down