diff --git a/SimG4CMS/Calo/interface/HGCSD.h b/SimG4CMS/Calo/interface/HGCSD.h index b490891db1d89..609fa316407c8 100644 --- a/SimG4CMS/Calo/interface/HGCSD.h +++ b/SimG4CMS/Calo/interface/HGCSD.h @@ -54,6 +54,7 @@ class HGCSD : public CaloSD, public Observer { int levelT_; bool storeAllG4Hits_, rejectMB_, waferRot_; double mouseBiteCut_; + bool dd4hep_; std::vector angles_; TTree *tree_; diff --git a/SimG4CMS/Calo/interface/HGCalSD.h b/SimG4CMS/Calo/interface/HGCalSD.h index 28389d8e40368..e3fe8ffa9918f 100644 --- a/SimG4CMS/Calo/interface/HGCalSD.h +++ b/SimG4CMS/Calo/interface/HGCalSD.h @@ -54,6 +54,7 @@ class HGCalSD : public CaloSD, public Observer { bool storeAllG4Hits_; bool fiducialCut_, rejectMB_, waferRot_, checkID_; int useSimWt_, verbose_; + bool dd4hep_; const double tan30deg_, cos30deg_; std::vector angles_; std::string missingFile_; diff --git a/SimG4CMS/Calo/src/HGCSD.cc b/SimG4CMS/Calo/src/HGCSD.cc index c3450afb97ce0..561adde390b25 100644 --- a/SimG4CMS/Calo/src/HGCSD.cc +++ b/SimG4CMS/Calo/src/HGCSD.cc @@ -56,6 +56,7 @@ HGCSD::HGCSD(const std::string& name, double waferSize = m_HGC.getUntrackedParameter("WaferSize") * CLHEP::mm; double mouseBite = m_HGC.getUntrackedParameter("MouseBite") * CLHEP::mm; mouseBiteCut_ = waferSize * tan(30.0 * CLHEP::deg) - mouseBite; + dd4hep_ = p.getParameter("g4GeometryDD4hepSource"); if (storeAllG4Hits_) { setUseMap(false); @@ -206,6 +207,8 @@ void HGCSD::update(const BeginOfJob* job) { geom_mode_ = hgcons_->geomMode(); slopeMin_ = hgcons_->minSlope(); levelT_ = hgcons_->levelTop(); + if (dd4hep_) + ++levelT_; numberingScheme_ = std::make_unique(*hgcons_, nameX_); if (rejectMB_) mouseBite_ = std::make_unique(*hgcons_, angles_, mouseBiteCut_, waferRot_); @@ -215,7 +218,7 @@ void HGCSD::update(const BeginOfJob* job) { } #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCSim") << "HGCSD::Initialized with mode " << geom_mode_ << " Slope cut " << slopeMin_ - << " top Level " << levelT_; + << " top Level " << levelT_ << " dd4hep " << dd4hep_; #endif } diff --git a/SimG4CMS/Calo/src/HGCalSD.cc b/SimG4CMS/Calo/src/HGCalSD.cc index cf9bb067f4a86..441b72ba9e261 100644 --- a/SimG4CMS/Calo/src/HGCalSD.cc +++ b/SimG4CMS/Calo/src/HGCalSD.cc @@ -62,6 +62,7 @@ HGCalSD::HGCalSD(const std::string& name, missingFile_ = m_HGC.getUntrackedParameter("MissingWaferFile"); checkID_ = m_HGC.getUntrackedParameter("CheckID"); verbose_ = m_HGC.getUntrackedParameter("Verbosity"); + dd4hep_ = p.getParameter("g4GeometryDD4hepSource"); if (storeAllG4Hits_) { setUseMap(false); @@ -247,6 +248,10 @@ void HGCalSD::update(const BeginOfJob* job) { slopeMin_ = hgcons_->minSlope(); levelT1_ = hgcons_->levelTop(0); levelT2_ = hgcons_->levelTop(1); + if (dd4hep_) { + ++levelT1_; + ++levelT2_; + } useSimWt_ = hgcons_->getParameter()->useSimWt_; int useOffset = hgcons_->getParameter()->useOffset_; double waferSize = hgcons_->waferSize(false); @@ -263,7 +268,8 @@ void HGCalSD::update(const BeginOfJob* job) { edm::LogVerbatim("HGCSim") << "HGCalSD::Initialized with mode " << geom_mode_ << " Slope cut " << slopeMin_ << " top Level " << levelT1_ << ":" << levelT2_ << " useSimWt " << useSimWt_ << " wafer " << waferSize << ":" << mouseBite << ":" << guardRingOffset << ":" << sensorSizeOffset - << ":" << mouseBiteNew << ":" << mouseBiteCut_ << " useOffset " << useOffset; + << ":" << mouseBiteNew << ":" << mouseBiteCut_ << " useOffset " << useOffset + << " dd4hep " << dd4hep_; #endif numberingScheme_ = std::make_unique(*hgcons_, mydet_, nameX_, missingFile_); diff --git a/SimG4CMS/Calo/test/python/Sim2026_cfg.py b/SimG4CMS/Calo/test/python/Sim2026_cfg.py index 7e0a60e0da18f..a4d4b07caa220 100644 --- a/SimG4CMS/Calo/test/python/Sim2026_cfg.py +++ b/SimG4CMS/Calo/test/python/Sim2026_cfg.py @@ -112,6 +112,7 @@ process.analysis_step3 = cms.EndPath(process.hgcalHitCheckHEB) process.g4SimHits.Physics.type = 'SimG4Core/Physics/FTFP_BERT_EMM' +process.g4SimHits.HGCSD.Verbosity = 0 # Schedule definition process.schedule = cms.Schedule(process.simulation_step,