# Base name of intermediate beam files beam_name = 'beam' # Base name of merged files tritrig_beam_name = 'tritrig-beam' # Convert LHE output to stdhep cnv = StdHepConverter(inputs=[tritrig_file_name], outputs=['%s.stdhep' % tritrig_name]) # Add mother particle to tag trident particles mom = AddMother(inputs=cnv.output_files(), outputs=['%s_mom.stdhep' % tritrig_name]) # Rotate events into beam coords rot = BeamCoords(inputs=mom.output_files(), outputs=['%s_rot.stdhep' % tritrig_name]) # Simulate signal events slic = SLIC(inputs=rot.output_files(), outputs=['%s.slcio' % tritrig_name]) # Space signal events before merging filter_bunches = FilterBunches(inputs=slic.output_files(), outputs=['%s_filt.slcio' % tritrig_name]) # Count filtered events count_filter = LCIOCount(inputs=filter_bunches.output_files()) # Transform beam events rot_beam = BeamCoords(inputs=[beam_file_name], outputs=['%s_rot.stdhep' % beam_name])
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"]) # Simulate signal events slic = SLIC(nevents=nevents + 1, inputs=rot.output_files(), outputs=["rad.slcio"]) # run the job job.add([mg, cnv, unzip, mom, rot, slic])
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])
""" Job script to generate A-prime events, convert to StdHep, and apply transformations. """ from hpsmc.generators import MG4 from hpsmc.tools import Unzip, StdHepTool, DisplaceTime, BeamCoords job.description = 'A-prime generation using MadGraph' # Generate A-prime events using MadGraph4 ap = MG4(name="ap", event_types=['unweighted']) # Unzip the LHE events to a local file unzip = Unzip() # Create a stdhep file, displacing the time of decay using the ctau param displace = DisplaceTime() # Rotate events into beam coordinates and move the vertices rotate = BeamCoords() # Add components to the job job.add([ap, unzip, displace, rotate])