Skip to content

Fix missing CaloParticles from pileup #47682

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

Merged
merged 4 commits into from
Apr 1, 2025
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
4 changes: 4 additions & 0 deletions Configuration/ProcessModifiers/python/enableCPfromPU_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import FWCore.ParameterSet.Config as cms

# This modifier enables the CaloParticles from pileup in the HGCAL associators and simulated objects.
enableCPfromPU = cms.Modifier()
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,38 @@ def condition(self, fragment, stepList, key, hasHarvest):
'--customise': 'RecoHGCal/TICL/customiseTICLFromReco.customiseTICLForDumper'}
upgradeWFs['ticl_v5_withDumper'].step4 = {'--procModifiers': 'ticl_v5'}

class UpgradeWorkflow_CPfromPU(UpgradeWorkflow):
def setup_(self, step, stepName, stepDict, k, properties):
if ('Digi' in step and 'NoHLT' not in step) or ('HLTOnly' in step):
stepDict[stepName][k] = merge([self.step2, stepDict[step][k]])
if 'RecoGlobal' in step:
stepDict[stepName][k] = merge([self.step3, stepDict[step][k]])
if 'HARVESTGlobal' in step:
stepDict[stepName][k] = merge([self.step4, stepDict[step][k]])
def condition(self, fragment, stepList, key, hasHarvest):
return (fragment=="TTbar_14TeV" or 'CloseByP' in fragment or 'Eta1p7_2p7' in fragment) and 'Run4' in key

upgradeWFs['CPfromPU'] = UpgradeWorkflow_CPfromPU(
steps = [
'HLTOnly',
'DigiTrigger',
'RecoGlobal',
'HARVESTGlobal'
],
PU = [
'HLTOnly',
'DigiTrigger',
'RecoGlobal',
'HARVESTGlobal'
],
suffix = '_withCPfromPU',
offset = 0.208,
)

upgradeWFs['CPfromPU'].step2 = {'--procModifiers': 'enableCPfromPU'}
upgradeWFs['CPfromPU'].step3 = {'--procModifiers': 'enableCPfromPU'}
upgradeWFs['CPfromPU'].step4 = {'--procModifiers': 'enableCPfromPU'}

# Improved L2 seeding from L1Tk Muons and L3 Tracker Muon Inside-Out reconstruction first (Phase-2 Muon default)
class UpgradeWorkflow_phase2L2AndL3Muons(UpgradeWorkflow):
def setup_(self, step, stepName, stepDict, k, properties):
Expand Down
12 changes: 10 additions & 2 deletions SimCalorimetry/HGCalSimProducers/python/hgcHitAssociation_cfi.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
from SimCalorimetry.HGCalAssociatorProducers.hgCalLCToCPAssociatorByEnergyScoreProducer_cfi import hgCalLCToCPAssociatorByEnergyScoreProducer as lcAssocByEnergyScoreProducer
import FWCore.ParameterSet.Config as cms
from SimCalorimetry.HGCalAssociatorProducers.hgCalLCToCPAssociatorByEnergyScoreProducer_cfi import hgCalLCToCPAssociatorByEnergyScoreProducer as _lcAssocByEnergyScoreProducer
from SimCalorimetry.HGCalAssociatorProducers.hgCalLCToSCAssociatorByEnergyScoreProducer_cfi import hgCalLCToSCAssociatorByEnergyScoreProducer as _scAssocByEnergyScoreProducer

from SimCalorimetry.HGCalAssociatorProducers.hgCalLCToSCAssociatorByEnergyScoreProducer_cfi import hgCalLCToSCAssociatorByEnergyScoreProducer as scAssocByEnergyScoreProducer
lcAssocByEnergyScoreProducer = _lcAssocByEnergyScoreProducer.clone(hardScatterOnly = cms.bool(True))
scAssocByEnergyScoreProducer = _scAssocByEnergyScoreProducer.clone(hardScatterOnly = cms.bool(True))

from Configuration.ProcessModifiers.enableCPfromPU_cff import enableCPfromPU

enableCPfromPU.toModify(lcAssocByEnergyScoreProducer, hardScatterOnly = cms.bool(False))
enableCPfromPU.toModify(scAssocByEnergyScoreProducer, hardScatterOnly = cms.bool(False))
20 changes: 7 additions & 13 deletions SimDataFormats/Track/src/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,14 @@
<version ClassVersion="12" checksum="3470347245"/>
<version ClassVersion="11" checksum="1785575744"/>
<version ClassVersion="10" checksum="1430205451"/>
<ioread sourceClass = "SimTrack" version="[-12]" targetClass="SimTrack" source="" target="">
<ioread sourceClass = "SimTrack" version="[-12]" targetClass="SimTrack" source="bool crossedBoundary_; int idAtBoundary_; math::XYZTLorentzVectorF positionAtBoundary_; math::XYZTLorentzVectorF momentumAtBoundary_; int igenpart" target="trackInfo_, idAtBoundary_, positionAtBoundary_, momentumAtBoundary_">
<![CDATA[
SimTrack tmp(newObj->type(), newObj->momentum(), newObj->vertIndex(), newObj->genpartIndex(), newObj->trackerSurfacePosition(), newObj->trackerSurfaceMomentum());
tmp.setTrackId(newObj->trackId());
tmp.setEventId(newObj->eventId());
tmp.setCrossedBoundaryVars(
newObj->crossedBoundary(), newObj->getIDAtBoundary(), newObj->getPositionAtBoundary(), newObj->getMomentumAtBoundary());
if (newObj->isFromBackScattering()) {
tmp.setFromBackScattering();
}
if (newObj->genpartIndex() != -1) {
tmp.setIsPrimary();
}
*newObj=tmp;
// set crossedBoundary infos
newObj->setCrossedBoundaryVars(onfile.crossedBoundary_, onfile.idAtBoundary_, onfile.positionAtBoundary_, onfile.momentumAtBoundary_);
// set isPrimary info of trackInfo_
if (onfile.igenpart != -1)
newObj->setIsPrimary();
// it's not possible to set the isFromBackScattering info for old simTracks
]]>
</ioread>
</class>
Expand Down