Skip to content
51 changes: 51 additions & 0 deletions Configuration/Generator/python/DisplacedParticleGun_cfi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import FWCore.ParameterSet.Config as cms

generator = cms.EDProducer(
"DisplacedParticleGunProducer",
PGunParameters = cms.PSet(
# particle direction
MinPt = cms.double(5.),
MaxPt = cms.double(100.),
MinPhi = cms.double(-3.141592653589793),
MaxPhi = cms.double(+3.141592653589793),
MinTheta = cms.double(-3.141592653589793 / 4),
MaxTheta = cms.double(3.141592653589793 / 4),

# displaced vertex in the transverse plane (cm)
# located in front of HGCAL's CE-E surface (also avoiding the moderator)
RMin = cms.double(60.),
RMax = cms.double(90.),
MinVtxPhi = cms.double(0.0),
MaxVtxPhi = cms.double(2.0 * 3.141592653589793),
ZVtx = cms.double(321.),

NParticles = cms.int32(1),
PartID = cms.int32(22), # photon

# how to sample the vertex radius
UniformDensityInR = cms.bool(False),

MaxTries = cms.uint32(10000),

# if True: derive theta to hit a region of the HGCAL CE-E back surface
# the phi of the particle's direction is matched to the phi of the vertex
# which avoid particles crossing the beamline and restricts particles to a tighter region of the detector
# if False: use MinTheta/MaxTheta
PointingToHGCAL = cms.bool(True),

# only used if PointingToHGCAL == True,
# corresponds to the central third of HGCAL's CE-E back surface
# note that these values might not be optimal if the default vertex coordinates' configuration is modified
RMinBackSurfaceHGCAL = cms.double(75.80),
RMaxBackSurfaceHGCAL = cms.double(120.23),

# if True: the particle's direction is projected back to the z=0 plane,
# ensuring compatibility with the specified range
RestrictRInZPlaneAtZero = cms.bool(True),
RMinAtZero = cms.double(0.),
RMaxAtZero = cms.double(100.),

),
Verbosity = cms.untracked.int32(1),
firstRun = cms.untracked.uint32(1),
)
11 changes: 7 additions & 4 deletions Configuration/PyReleaseValidation/python/relval_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4786,10 +4786,13 @@ def gen2024HiMix(fragment,howMuch):
}

if beamspot is not None: upgradeStepDict['GenSim'][k]['--beamspot']=beamspot

upgradeStepDict['GenSimCloseBy'][k] = deepcopy(upgradeStepDict['GenSim'][k])
upgradeStepDict['GenSimCloseBy'][k]['--beamspot'] = 'CloseBy'


upgradeStepDict['GenSimDisplaced'][k] = deepcopy(upgradeStepDict['GenSim'][k])
upgradeStepDict['GenSimDisplaced'][k]['--beamspot'] = 'CloseBy' # still using DBrealisticHLLHC

upgradeStepDict['GenSimHLBeamSpot'][k] = {'-s' : 'GEN,SIM',
'-n' : 10,
'--conditions' : gt+'_13TeV',
Expand All @@ -4802,7 +4805,7 @@ def gen2024HiMix(fragment,howMuch):
upgradeStepDict['GenSimHLBeamSpot14'][k] = deepcopy(upgradeStepDict['GenSimHLBeamSpot'][k])
upgradeStepDict['GenSimHLBeamSpot14'][k]['--conditions'] = gt

upgradeStepDict['GenSimHLBeamSpotCloseBy'][k] = upgradeStepDict['GenSimCloseBy'][k]
upgradeStepDict['GenSimHLBeamSpotCloseBy'][k] = deepcopy(upgradeStepDict['GenSimCloseBy'][k])

upgradeStepDict['Sim'][k] = {'-s' : 'SIM',
'-n' : 10,
Expand Down Expand Up @@ -5040,7 +5043,7 @@ def gen2024HiMix(fragment,howMuch):

# in case special WF has PU-specific changes: apply *after* basic PU step is created
specialWF.setupPU(upgradeStepDict, k, upgradeProperties[year][k])

for step in upgradeStepDict.keys():
# we need to do this for each fragment
if ('Sim' in step and ('Fast' not in step and step != 'Sim')) or ('Premix' in step) or ('Sim' not in step and 'Gen' in step):
Expand Down
4 changes: 3 additions & 1 deletion Configuration/PyReleaseValidation/python/relval_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ def notForGenOnly(key,specialType):
step = 'GenSimHLBeamSpotCloseBy'
elif 'CloseBy' in frag or 'CE_E' in frag or 'CE_H' in frag:
step = 'GenSimCloseBy'
elif 'DisplacedParticleGun' in frag:
step = 'GenSimDisplaced'
stepMaker = makeStepNameSim
elif 'Gen' in step:
if 'HLBeamSpot' in step:
if '14TeV' in frag:
step = 'GenHLBeamSpot14'
stepMaker = makeStepNameSim

if 'HARVEST' in step: hasHarvest = True
for specialType,specialWF in upgradeWFs.items():
if notForGenOnly(key,specialType): ## we don't need all the flavors for the GEN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ def condition(self, fragment, stepList, key, hasHarvest):
'Sim',
'GenSim',
'GenSimCloseBy',
'GenSimDisplaced',
'GenSimHLBeamSpot',
'GenSimHLBeamSpot14',
'GenSimHLBeamSpotCloseBy',
Expand Down Expand Up @@ -921,7 +922,7 @@ def setup_(self, step, stepName, stepDict, k, properties):
if 'HARVESTGlobal' in step:
stepDict[stepName][k] = merge([self.step4, stepDict[step][k]])
def condition(self, fragment, stepList, key, hasHarvest):
return ('CloseByPGun_Barrel') in fragment and ('Run4' in key)
return 'CloseByPGun_Barrel' in fragment and 'Run4' in key

upgradeWFs['ticl_barrel'] = UpgradeWorkflow_ticl_barrel(
steps = [
Expand Down Expand Up @@ -952,7 +953,7 @@ def setup_(self, step, stepName, stepDict, k, properties):
if 'HARVESTGlobal' in step:
stepDict[stepName][k] = merge([self.step4, stepDict[step][k]])
def condition(self, fragment, stepList, key, hasHarvest):
return ('CloseByPGun_Barrel') in fragment and ('Run4' in key) and ('PU' in key)
return 'CloseByPGun_Barrel' in fragment and 'Run4' in key and 'PU' in key

upgradeWFs['ticl_barrel_CPfromPU'] = UpgradeWorkflow_ticl_barrel_CPfromPU(
steps = [
Expand Down Expand Up @@ -2165,7 +2166,7 @@ def condition(self, fragment, stepList, key, hasHarvest):
class UpgradeWorkflow_NGTScouting(UpgradeWorkflow):
def setup_(self, step, stepName, stepDict, k, properties):
# skip RECO, ALCA and HARVEST
if ('ALCA' in step) or ('Reco' in step) or ('HLT' in step):
if any(x in step for x in ('ALCA', 'Reco', 'HLT')):
stepDict[stepName][k] = None
elif 'DigiTrigger' in step:
# Add the aging customization
Expand All @@ -2179,8 +2180,10 @@ def setup_(self, step, stepName, stepDict, k, properties):
stepDict[stepName][k] = merge([self.step3, stepDict[step][k]])
else:
stepDict[stepName][k] = merge([stepDict[step][k]])

def condition(self, fragment, stepList, key, hasHarvest):
return (fragment=="TTbar_14TeV" or fragment=="SingleMuPt15Eta0p_0p4") and 'Run4' in key
return (fragment=='TTbar_14TeV' or fragment=='SingleMuPt15Eta0p_0p4' or 'Displaced' in fragment) and 'Run4' in key

upgradeWFs['NGTScouting'] = UpgradeWorkflow_NGTScouting(
steps = [
'Reco',
Expand Down Expand Up @@ -3978,4 +3981,5 @@ def __init__(self, howMuch, dataset):
('Hydjet_Quenched_MinBias_5519GeV_cfi', UpgradeFragment(U2000by1,'HydjetQMinBias_5519GeV')),
('SingleMuPt15Eta0_0p4_cfi', UpgradeFragment(Kby(9,100),'SingleMuPt15Eta0p_0p4')),
('CloseByPGun_Barrel_Front_cfi', UpgradeFragment(Kby(9,100),'CloseByPGun_Barrel_Front')),
('DisplacedParticleGun_cfi', UpgradeFragment(Kby(9,100),'DisplacedPGun')),
])
Loading