Skip to content

Commit

Permalink
add example of creating simulation for midshower dimuon
Browse files Browse the repository at this point in the history
  • Loading branch information
tomeichlersmith committed Oct 16, 2023
1 parent a267c72 commit a43b855
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions Biasing/python/eat.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,69 @@ def midshower_nuclear( detector , bias_factor , bias_threshold , min_nuclear_ene

return sim


def midshower_dimuon( detector , bias_factor , bias_threshold , min_nuclear_energy ) :
"""Example configuration for producing mid-shower dimuon interactions in
the ECal that fake a missing energy (ME) signal.
In this particular example, 4 GeV electrons are fired upstream of the
tagger tracker. Then simulation events are then put through a series of
filters.
Parameters
----------
detector : str
Name of the detector
bias_factor : float
Factor to multiply GammaToMuPair xsec by within the ECal
bias_threshold : float
Minium energy [MeV] to bias a photon
min_nuclear_energy : float
Minium total energy [MeV] that went to muons to keep event
Returns
-------
simulator :
configured for mid-shower dimuon interactions and far-upstream generator
Example
-------
from LDMX.Biasing import eat
eat_pn_sim = eat.midshower_nuclear('ldmx-det-v12',1000.,1700.)
"""

#Instantiate the simulator.
sim = simulator.simulator("eat-midshower-dimuon")
from LDMX.Ecal import EcalGeometry

#Set the path to the detector to use.
#the second parameter says we want to include scoring planes
sim.setDetector( detector , True )

#Set run parameters
sim.description = "Biased Mid-Shower DiMuon Interactions ME Background"
sim.beamSpotSmear = [20., 80., 0.] #mm

from LDMX.SimCore import generators
sim.generators = [ generators.single_4gev_e_upstream_tagger() ]

#Enable and configure the biasing
from LDMX.SimCore import bias_operators
sim.biasing_operators = [ bias_operators.GammaToMuPair('ecal', bias_factor, bias_threshold) ]

#Configure the sequence in which user actions should be called.
sim.actions = [
filters.PrimaryToEcalFilter(3500.),
util.PartialEnergySorter(bias_threshold),
filters.MidShowerDiMuonBkgdFilter(min_nuclear_energy),
]

return sim


def dark_brem( ap_mass , lhe, detector ) :
"""Example configuration for producing dark brem interactions in the ECal.
Expand Down

0 comments on commit a43b855

Please sign in to comment.