From a43b8557141bdb54b2726aef75dadbd5d7fd226b Mon Sep 17 00:00:00 2001 From: tomeichlersmith Date: Mon, 16 Oct 2023 14:52:40 -0500 Subject: [PATCH] add example of creating simulation for midshower dimuon --- Biasing/python/eat.py | 63 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/Biasing/python/eat.py b/Biasing/python/eat.py index d16695e74..2e7f6bee1 100644 --- a/Biasing/python/eat.py +++ b/Biasing/python/eat.py @@ -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.