Exemplo n.º 1
0
from hpsmc.generators import MG5, StdHepConverter
from hpsmc.job import Job
from hpsmc.run_params import RunParameters

mg5 = MG5(description="Generate tritrig events using MG5",
          name="tritrig",
          run_card="run_card_1pt05.dat",
          outputs=["tritrig"],
          nevents=1000)

stdhep_cnv = StdHepConverter(
    description="Convert LHE events to StdHep using EGS5",
    run_params=RunParameters(key="1pt05"),
    inputs=["tritrig_events.lhe.gz"],
    outputs=["tritrig.stdhep"])

job = Job(name="MG5 test", components=[mg5, stdhep_cnv])
job.params = {}

job.run()
Exemplo n.º 2
0
from hpsmc.generators import MG5, StdHepConverter
from hpsmc.tools import BeamCoords, AddMother, SLIC

job.description = 'tritrig from generation to slic'

# Get job input file targets
inputs = list(job.input_files.values())

if 'nevents' in job.params:
    nevents = job.params['nevents']
else:
    nevents = 10000

# Generate tritrig in MG5
mg = MG5(name='tritrig', event_types=['unweighted'])

# Convert LHE output to stdhep
cnv = StdHepConverter()

# Add mother particle to tag trident particles
mom = AddMother()

# Rotate events into beam coords
rot = BeamCoords()

# Simulate signal events
slic = SLIC(nevents=nevents+1)

# run the job
job.add([mg, cnv, mom, rot, slic])
Exemplo n.º 3
0
job = Job(name="simp job")
job.initialize()

params = job.params

# used for intermediate file names
procname = "simp"

# generate tritrig in MG5
mg = MG5(
    name=procname,
    #run_card="run_card_"+params.run_params+".dat",
    run_card="run_card.dat",
    param_card="param_card.dat",
    params={
        "map": params.map,
        "mpid": params.mpid,
        "mrhod": params.mrhod
    },
    outputs=[procname],
    nevents=params.nevents)

# convert LHE output to stdhep
stdhep_cnv = StdHepConverter(run_params=RunParameters(key=params.run_params),
                             inputs=[procname + "_unweighted_events.lhe.gz"],
                             outputs=[procname + ".stdhep"])

# rotate events into beam coords
rot = StdHepTool(name="beam_coords",
                 inputs=[procname + ".stdhep"],
                 outputs=[procname + "_rot.stdhep"])
Exemplo n.º 4
0
from hpsmc.generators import MG5, StdHepConverter
from hpsmc.tools import Unzip, BeamCoords, AddMotherFullTruth, SLIC

job.description = 'rad from generation to slic'

# Get job input file targets
inputs = list(job.input_files.values())

if 'nevents' in job.params:
    nevents = job.params['nevents']
else:
    nevents = 10000

# Generate rad in MG5
mg = MG5(name='RAD', event_types=['unweighted'])

# Convert LHE output to stdhep
cnv = StdHepConverter(name="lhe_rad", inputs=mg.output_files())

# Unzip the LHE events to a local file
unzip = Unzip(inputs=mg.output_files(), outputs=["rad.lhe"])

# Add mother particle to tag trident particles
mom = AddMotherFullTruth(
    inputs=[cnv.output_files()[0],
            unzip.output_files()[0]],
    outputs=["rad_mom.stdhep"])

# Rotate events into beam coords
rot = BeamCoords(inputs=mom.output_files(), outputs=["rad_rot.stdhep"])
Exemplo n.º 5
0
from hpsmc.generators import MG5, StdHepConverter
from hpsmc.tools import SLIC, JobManager, FilterBunches, StdHepTool, MoveFiles, BeamCoords, Unzip, AddMotherFullTruth, DisplaceUni, DisplaceTime

job.description = 'SIMP generation to recon'

# Generate tritrig in MG5
mg = MG5(name='simp',
         run_card='run_card.dat',
         param_card='param_card.dat',
         event_types=['unweighted'])

# Move LHE file
mv = MoveFiles(inputs=['simp_unweighted_events.lhe.gz'],
               outputs=['simp.lhe.gz'])

# Unzip LHE file
unzip = Unzip(inputs=['simp.lhe.gz'], outputs=['simp.lhe'])

# Convert LHE output to stdhep
cnv = DisplaceUni(inputs=['simp.lhe'], outputs=['simp.stdhep'])

# Rotate into beam coords
rot = BeamCoords()

# Run events in slic
slic = SLIC()

# Insert empty bunches expected by pile-up simulation
filter_bunches = FilterBunches()

# Run simulated events in readout to generate triggers
Exemplo n.º 6
0
from hpsmc.job import Job
from hpsmc.run_params import RunParameters
from hpsmc.generators import MG5, StdHepConverter
from hpsmc.tools import SLIC, JobManager, FilterMCBunches, StdHepTool

job = Job(name="tritrig job")
job.initialize()

params = job.params

# used for intermediate file names
procname = "tritrig"

# generate tritrig in MG5
mg = MG5(name=procname,
         run_card="run_card_" + params.run_params + ".dat",
         outputs=[procname],
         nevents=params.nevents)

# convert LHE output to stdhep
stdhep_cnv = StdHepConverter(run_params=RunParameters(key=params.run_params),
                             inputs=[procname + "_events.lhe.gz"],
                             outputs=[procname + ".stdhep"])

# add mother particle to tag trident particles
mom = StdHepTool(name="add_mother",
                 inputs=[procname + ".stdhep"],
                 outputs=[procname + "_mom.stdhep"])

# rotate events into beam coords
rot = StdHepTool(name="beam_coords",
                 inputs=[procname + "_mom.stdhep"],
Exemplo n.º 7
0
from hpsmc.generators import MG5, StdHepConverter
from hpsmc.tools import SLIC, JobManager, FilterBunches, BeamCoords, AddMother

job.description = 'tritrig generation to recon'

# Generate tritrig in MG5
mg = MG5(name='tritrig')

# Convert LHE output to stdhep
cnv = StdHepConverter()

# Add mother particle to tag trident particles
mom = AddMother()

# Rotate events into beam coords
rot = BeamCoords()

# Print results
#p = StdHepTool(name="print_stdhep")

# generate events in slic
slic = SLIC()

# insert empty bunches expected by pile-up simulation
filter_bunches = FilterBunches()

# Run simulated events in readout to generate triggers
readout = JobManager(steering='readout')
#, append_tok='readout'

# Run physics reconstruction