Skip to content

Commit 51f283d

Browse files
authored
Add CI to test WAB physics and LHE reading (#1841)
1 parent 45fa7f6 commit 51f283d

File tree

2 files changed

+139
-0
lines changed

2 files changed

+139
-0
lines changed
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
from LDMX.Framework import ldmxcfg
2+
p = ldmxcfg.Process('test')
3+
4+
p.maxTriesPerEvent = 10000
5+
6+
from LDMX.Biasing import ecal
7+
from LDMX.SimCore import generators as gen
8+
from LDMX.SimCore import simulator as sim
9+
# Load LHE file containing WAB events
10+
wab_gen = gen.lhe("WAB Generator", "8GeV_WABFF2_10K.lhe")
11+
# Place them in the middle of the target
12+
wab_gen.vertex = [0.0, 0.0, 0.0]
13+
14+
det = 'ldmx-det-v15-8gev'
15+
mySim = sim.simulator('sim')
16+
mySim.setDetector(det, True)
17+
mySim.generators.append(wab_gen)
18+
19+
p.sequence = [ mySim ]
20+
21+
##################################################################
22+
# Below should be the same for all sim scenarios
23+
24+
import os
25+
import sys
26+
27+
p.maxEvents = int(int(os.environ['LDMX_NUM_EVENTS']) * 0.99)
28+
p.run = int(os.environ['LDMX_RUN_NUMBER'])
29+
30+
p.histogramFile = f'hist.root'
31+
p.outputFiles = [f'events.root']
32+
33+
# Load the full tracking sequance
34+
from LDMX.Tracking import full_tracking_sequence
35+
36+
# Load the ECAL modules
37+
import LDMX.Ecal.EcalGeometry
38+
import LDMX.Ecal.ecal_hardcoded_conditions
39+
import LDMX.Ecal.digi as ecal_digi
40+
import LDMX.Ecal.vetos as ecal_vetos
41+
import LDMX.Ecal.ecalClusters as ecal_cluster
42+
43+
# Load the HCAL modules
44+
import LDMX.Hcal.HcalGeometry
45+
import LDMX.Hcal.hcal_hardcoded_conditions
46+
import LDMX.Hcal.digi as hcal_digi
47+
hcal_digi_reco = hcal_digi.HcalSimpleDigiAndRecProducer()
48+
49+
# Load the TS modules
50+
# Cant run this until we figure out how to have
51+
# an upstream tagger track (LHE info starts at target)
52+
53+
# from LDMX.TrigScint.trigScint import TrigScintDigiProducer
54+
# from LDMX.TrigScint.trigScint import TrigScintClusterProducer
55+
# from LDMX.TrigScint.trigScint import trigScintTrack
56+
# ts_digis = [
57+
# TrigScintDigiProducer.pad1(),
58+
# TrigScintDigiProducer.pad2(),
59+
# TrigScintDigiProducer.pad3(),
60+
# ]
61+
62+
# ts_clusters = [
63+
# TrigScintClusterProducer.pad1(),
64+
# TrigScintClusterProducer.pad2(),
65+
# TrigScintClusterProducer.pad3(),
66+
# ]
67+
68+
# Load electron counting and trigger
69+
from LDMX.Recon.electronCounter import ElectronCounter
70+
from LDMX.Recon.simpleTrigger import TriggerProcessor
71+
from LDMX.Hcal import hcal_trig_digi
72+
from LDMX.Ecal import ecal_trig_digi
73+
from LDMX.Trigger import trigger_energy_sums
74+
75+
count = ElectronCounter(1,'ElectronCounter')
76+
count.input_pass_name = ''
77+
78+
# Load the DQM modules
79+
from LDMX.DQM import dqm
80+
81+
# Load ecal veto and use tracking in it
82+
ecal_veto = ecal_vetos.EcalVetoProcessor()
83+
ecal_mip = ecal_vetos.EcalMipProcessor()
84+
ecal_veto_pnet = ecal_vetos.EcalPnetVetoProcessor()
85+
86+
# Load hcal veto
87+
import LDMX.Hcal.hcal as hcal
88+
hcal_veto = hcal.HcalVetoProcessor()
89+
hcal_clusters = hcal.HcalClusterProducer()
90+
hcal_wab = hcal.HcalWABVetoProcessor()
91+
92+
p.logger.termLevel = 1
93+
# Example to show trace level logging for recoil CKF (only)
94+
#p.logger.custom(full_tracking_sequence.dqm_recoil_cfk, level = -1)
95+
96+
# Add full tracking for both recoil trackers: digi, seeds, CFK, ambiguity resolution, GSF, DQM
97+
recoil_tracking = [
98+
full_tracking_sequence.digi_recoil,
99+
full_tracking_sequence.truth_tracking,
100+
full_tracking_sequence.seeder_recoil,
101+
full_tracking_sequence.tracking_recoil,
102+
full_tracking_sequence.greedy_solver_recoil,
103+
full_tracking_sequence.GSF_recoil
104+
]
105+
106+
recoil_tracker_dqm = [
107+
full_tracking_sequence.dqm_recoil_cfk,
108+
# full_tracking_sequence.dqm_recoil_gas,
109+
# full_tracking_sequence.dqm_recoil_gsf
110+
]
111+
112+
p.sequence.extend([
113+
*recoil_tracking,
114+
ecal_digi.EcalDigiProducer(),
115+
ecal_digi.EcalRecProducer(),
116+
ecal_cluster.EcalClusterProducer(),
117+
ecal_veto,
118+
ecal_mip,
119+
ecal_veto_pnet,
120+
hcal_digi.HcalDigiProducer(),
121+
hcal_digi_reco,
122+
hcal_veto,
123+
TriggerProcessor('trigger', 8000.),
124+
#hcal_clusters,
125+
#hcal_wab,
126+
*recoil_tracker_dqm,
127+
])
128+
129+
# Remove TS DQM
130+
almost_all_dqm = [dqm.sample_validation_dqm + dqm.ecal_dqm + dqm.hcal_dqm + dqm.trigger_dqm]
131+
132+
p.sequence.extend(*almost_all_dqm)
133+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
start_group Download and unzip compressed LHE files as input
4+
wget https://raw.githubusercontent.com/LDMX-Software/ci-data/refs/heads/main/wab_lhe/8GeV_WABFF2_10K.lhe.gz
5+
gzip -d 8GeV_WABFF2_10K.lhe.gz
6+
end_group

0 commit comments

Comments
 (0)