Skip to content

Commit

Permalink
Merge pull request #42442 from bsunanda/Phase2-hgx343
Browse files Browse the repository at this point in the history
Phase2-hgx343 Try to retrieve missing hits in the partial wafers of HGCal for DD4Hep description
  • Loading branch information
cmsbuild authored Aug 4, 2023
2 parents 2e13ed1 + cc6678d commit 272329f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions SimG4CMS/Calo/interface/HGCSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class HGCSD : public CaloSD, public Observer<const BeginOfJob *> {
int levelT_;
bool storeAllG4Hits_, rejectMB_, waferRot_;
double mouseBiteCut_;
bool dd4hep_;
std::vector<double> angles_;

TTree *tree_;
Expand Down
1 change: 1 addition & 0 deletions SimG4CMS/Calo/interface/HGCalSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class HGCalSD : public CaloSD, public Observer<const BeginOfJob *> {
bool storeAllG4Hits_;
bool fiducialCut_, rejectMB_, waferRot_, checkID_;
int useSimWt_, verbose_;
bool dd4hep_;
const double tan30deg_, cos30deg_;
std::vector<double> angles_;
std::string missingFile_;
Expand Down
5 changes: 4 additions & 1 deletion SimG4CMS/Calo/src/HGCSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ HGCSD::HGCSD(const std::string& name,
double waferSize = m_HGC.getUntrackedParameter<double>("WaferSize") * CLHEP::mm;
double mouseBite = m_HGC.getUntrackedParameter<double>("MouseBite") * CLHEP::mm;
mouseBiteCut_ = waferSize * tan(30.0 * CLHEP::deg) - mouseBite;
dd4hep_ = p.getParameter<bool>("g4GeometryDD4hepSource");

if (storeAllG4Hits_) {
setUseMap(false);
Expand Down Expand Up @@ -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<HGCNumberingScheme>(*hgcons_, nameX_);
if (rejectMB_)
mouseBite_ = std::make_unique<HGCMouseBite>(*hgcons_, angles_, mouseBiteCut_, waferRot_);
Expand All @@ -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
}

Expand Down
8 changes: 7 additions & 1 deletion SimG4CMS/Calo/src/HGCalSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ HGCalSD::HGCalSD(const std::string& name,
missingFile_ = m_HGC.getUntrackedParameter<std::string>("MissingWaferFile");
checkID_ = m_HGC.getUntrackedParameter<bool>("CheckID");
verbose_ = m_HGC.getUntrackedParameter<int>("Verbosity");
dd4hep_ = p.getParameter<bool>("g4GeometryDD4hepSource");

if (storeAllG4Hits_) {
setUseMap(false);
Expand Down Expand Up @@ -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);
Expand All @@ -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<HGCalNumberingScheme>(*hgcons_, mydet_, nameX_, missingFile_);
Expand Down
1 change: 1 addition & 0 deletions SimG4CMS/Calo/test/python/Sim2026_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 272329f

Please sign in to comment.