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

Run3-hcx306 Bug fix to get back the same hit energy distribution for HCAL #34738

Merged
merged 1 commit into from
Aug 3, 2021
Merged
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
8 changes: 6 additions & 2 deletions SimG4CMS/Calo/src/HCalSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ HCalSD::HCalSD(const std::string& name,
if (forTBHC) {
useHF = false;
matNames.emplace_back("Scintillator");
} else {
matNames = hcalSimConstants_->hcalsimpar()->hcalMaterialNames_;
}

HcalNumberingScheme* scheme;
Expand Down Expand Up @@ -508,11 +510,13 @@ double HCalSD::getEnergyDeposit(const G4Step* aStep) {
}
}
}
double wt0(1.0);
if (useBirk) {
const G4Material* mat = aStep->GetPreStepPoint()->GetMaterial();
if (isItScintillator(mat))
weight_ *= getAttenuation(aStep, birk1, birk2, birk3);
wt0 = getAttenuation(aStep, birk1, birk2, birk3);
}
weight_ *= wt0;
double wt1 = getResponseWt(theTrack);
double wt2 = theTrack->GetWeight();
double edep = weight_ * wt1 * destep;
Expand All @@ -521,7 +525,7 @@ double HCalSD::getEnergyDeposit(const G4Step* aStep) {
}
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HcalSim") << "HCalSD: edep= " << edep << " Det: " << det + 2 << " depth= " << depth_
<< " weight= " << weight_ << " wt1= " << wt1 << " wt2= " << wt2;
<< " weight= " << weight_ << " wt0= " << wt0 << " wt1= " << wt1 << " wt2= " << wt2;
#endif
return edep;
}
Expand Down
5 changes: 4 additions & 1 deletion SimG4CMS/Calo/test/python/minbias_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
process.load('Configuration.StandardSequences.Generator_cff')
process.load('Configuration.StandardSequences.SimIdeal_cff')
process.load("SimG4CMS.Calo.CaloSimHitStudy_cfi")
process.load("SimG4CMS.Calo.hcalSimHitDump_cfi")

process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
from Configuration.AlCa.autoCond import autoCond
Expand All @@ -21,6 +22,7 @@
if 'MessageLogger' in process.__dict__:
process.MessageLogger.G4cerr=dict()
process.MessageLogger.HitStudy=dict()
process.MessageLogger.HcalSim=dict()

process.source = cms.Source("EmptySource")

Expand Down Expand Up @@ -55,13 +57,14 @@

process.generation_step = cms.Path(process.pgen)
process.simulation_step = cms.Path(process.psim)
process.analysis_step = cms.Path(process.CaloSimHitStudy)
process.analysis_step = cms.Path(process.CaloSimHitStudy+process.hcalSimHitDump)
process.out_step = cms.EndPath(process.output)

process.generator.pythiaHepMCVerbosity = False
process.generator.pythiaPylistVerbosity = 0
process.g4SimHits.Physics.type = 'SimG4Core/Physics/FTFP_BERT_EMM'
process.CaloSimHitStudy.TestNumbering = True
process.hcalSimHitDump.MaxEvent = 5

# process.g4SimHits.ECalSD.IgnoreTrackID = True
# process.g4SimHits.HCalSD.IgnoreTrackID = True
Expand Down