To run MC the 'official' way using scripts, please see 2015 MC Production Using Scripts.

The following steps are quick instructions for running MC from a command line at JLab for your own purposes, without using the batch farm.

This assumes that you have access to /u/group/hps/hps_soft, which should be accessible from both the CUE environment and ifarm, or else somewhere where stdhep, SLIC, and hps-java are built, using the instructions here: Software Installation

SLIC

SLIC takes .stdhep files as input. If you have .lhe files that you want to process (usually tridents or A' signal), it may be better to use an existing script for this step, or else contact Bradley Yale for instructions (btu29@wildcats.unh.edu).

1) First, the events in the .stdhep file must be offset by 30.5 mrad. This is done using a procedure in the stdhep directory:

/u/group/hps/hps_soft/stdhep/bin/beam_coords {in}.stdhep {out}.stdhep -s {seed}


Where {seed} differentiates the files, and usually involves the file number. The exact value is arbitrary, but should be consistently defined to avoid duplication among files.

2) To setup SLIC, first set some environment variables:

bash -c 'source /u/group/hps/hps_soft/slic/HEAD/init_ilcsoft.sh; exec csh'

/bin/csh

source /u/group/hps/hps_soft/slic/HEAD/geant4/build-10.01.p02/geant4make.csh /u/group/hps/hps_soft/slic/HEAD/geant4/build-10.01.p02


If you also want to use a detector with a fieldmap, the following symbolic link should be made:

ln -s /u/group/hps/hps_soft/fieldmaps fieldmap

3) To run SLIC using the rotated events from step 1) output as "{in}.stdhep":

/u/group/hps/hps_soft/slic/HEAD/slic/HEAD/bin/slic -P /u/group/hps/hps_soft/slic/HEAD/slic/HEAD/data/particle.tbl -i {in}.stdhep -g /u/group/hps/hps_soft/detector-data/detectors/${detector}/${detector}.lcdd -o {out}.slcio -d{seed} -r{# of events}


where ${detector} is "HPS-EngRun2015-Nominal-v3-fieldmap", for example.

If the exact number of events in the file is unknown, using any large integer (but not a 'long'!) higher than the expected number of events will successfully process all of them without error.

Readout

The following steps simulate readout, which defines things like trigger response and prescaling taken from a steering file.

Note: If using a detector with a fieldmap, then a symbolic link to the fieldmap directory must be made, if not done already (see previous section).

1) Before the actual readout, the events from SLIC output will first need to be spaced out to simulate pileup:

java -DdisableSvtAlignmentConstants -XX:+UseSerialGC -Xmx100m -cp ${hps-java} org.hps.users.meeg.FilterMCBunches -e250 ${inputfiles} out.slcio -d -E0.05 -w2000000

What the above line will do is take the first 2000000 events that have energy>50MeV (hopefully all the events, just set a large integer for '-w'; the value isn't really important), and inserts 250 blank events between each event in the input files.
The '-d' flag is only included if you want to do pairs readout in the next step, so leave it out if doing singles readout.

2) Next, the actual readout is accomplished with:

java -DdisableSvtAlignmentConstants -XX:+UseSerialGC -Xmx500m -jar ${hps-java} -r /org/hps/steering/readout/${steering} -i input.slcio -DoutputFile=out -Ddetector=${detector} -Drun=5772


where ${hps-java} = /u/group/hps/hps_soft/hps-java/hps-distribution-bin.jar

'hps-distribution-bin.jar' links to whichever jar in the 'hps-java' directory is most recent (this can of course be changed),

and
${steering} = EngineeringRun2015TrigSingles1_Pass2.lcsim
or whichever customized readout steering file you want to use.

If you want to use your own steering file other than the release version for anything in the readout or recon steps, replace
"-r /org/hps/steering/recon/${steering}"
with
"/path/to/your/${steering}" without the '-r' flag.

The run number can also be replaced.

The "-DdisableSvtAlignmentConstants" is there because using SVT alignment constants from the database will technically change the detector geometry from what it is defined to be from the .lcdd file, and may cause a crash.

Reconstruction

1) Finally, recon is run using:

OLD WAY: java -DdisableSvtAlignmentConstants  -XX:+UseSerialGC -Xmx500m -jar ${hps-java} -r /org/hps/steering/recon/${steering} -i {in}.slcio -DoutputFile={out} -Ddetector=${detector} -Drun=5772
New Way:   java -DdisableSvtAlignmentConstants  -XX:+UseSerialGC -Xmx500m -jar ${hps-java} -r /org/hps/steering/recon/${steering} -i {in}.slcio -DoutputFile={out} -d${detector} -R5772


To make a DST using the recon output:

source /u/group/hps/hps_soft/setup_dst.csh

/u/group/hps/hps_soft/hps-dst/build/bin/dst_maker {in}.slcio -o {out}.root

 

'hps-dst' is linked to the latest version of the dst_maker.

 

Note: If using an HPS jar before GBL was integrated into the trunk, then a '-g' switch must be added to the command in order to include GBL tracks in the resulting DST file, and also a flag to set the correct magnetic field for 1.056 GeV running.

i.e. "dst_maker {in}.slcio -o {out}.root -g -b .24"

 

 

  • No labels