Skip to content
Snippets Groups Projects
Commit 3fbc21ab authored by Ulrich Schwickerath's avatar Ulrich Schwickerath
Browse files

add source code example for external generator

parent 4fa4a78f
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@
This repository shows basic examples of how to run the software stack and perform various tasks.
## [Creating Monte Carlo samples interactively](scripts/create_mc.sh)
### Internal generators
For creating a few events with a build-in generator run
```
......@@ -27,14 +28,15 @@ Created files:
Analysis can be run as well on the full DST output in which case a bunch of packages will be rerun.
### External generators
In this case the generator is run externally and the output is written to a file in lund format. This can then
In this case the generator is run externally and the output is written to a file in a specific format. This can then
be passed through the detector simulation with
```
runsim -VERSION va0u -LABO CERN -NRUN 1000 -EBEAM 45.625 -gext generated.lund -NEVMAX 10
```
Old executables for generators can be found in /cvmfs/delphi.cern.ch/mc-production/generators/pgf77_glibc2.2
A source code example of DELPHI tuned Pythia can be found in the [Pythia folder](pythia/README.md).
## [Creating Monte Carlo samples on the HTCondor batch farm at CERN](htcondor/create_mc.sub)
To run the same job on the HTCondor batch farm, you need to follow these steps
......@@ -56,7 +58,7 @@ chmod +x create_mc.sh
```
### create the submission file for HTCondor
For HTCondor, unlike LSF, you need to create a submission script which describes the your job.
For HTCondor, unlike LSF, you need to create a submission script which describes the your job.
```
executable = create_mc.sh
arguments = $(ClusterID) $(ProcId)
......@@ -71,12 +73,22 @@ Save this in a file called create_mc.sub, for example.
See [the batch documentation at CERN](https://batchdocs.web.cern.ch/batchdocs/local/index.html) for more details.
The above script will queue your job and ask for resources on CentOS7.
Ensure, that the configured directories exist. In the above example, do
```
cd htcondor
mkdir output
mkdir error
mkdir log
cp ../scripts/create_mc.sh .
```
### Submit the job to the system
Now you can submit your job with
Now you can submit your job. In the above example, run
```
kinit
condor_submit create_mc.sub
```
from the htcondor sub-directory.
The command
```
condor_q
......@@ -96,17 +108,17 @@ echo "+OPTION VERbose" > $pgm.cra1
echo "+USE, ${PLINAM}." >> $pgm.cra1
cat $DELPHI_PAM/skelana.cra >> $pgm.cra1
# modify
# modify
ycmd=`which nypatchy`
command="$ycmd - $pgm.f $pgm.cra1 $pgm.ylog $pgm.c - - ${pgm}R.f .go"
echo "Running $command"
eval $command
# compile
for ending in .f .F ; do
ls *$ending >/dev/null 2>&1
if [[ $? == 0 ]]; then
for file in *$ending ; do
for ending in .f .F ; do
ls *$ending >/dev/null 2>&1
if [[ $? == 0 ]]; then
for file in *$ending ; do
$FCOMP $FFLAGS -c $file
done
fi
......@@ -115,7 +127,7 @@ done
for ending in *.c *.C *.cc ; do
ls *$ending >/dev/null 2>&1
if [[ $? == 0 ]]; then
for file in *ending ; do
for file in *ending ; do
$CCOMP $CFLAGS -c $file
done
fi
......@@ -124,14 +136,14 @@ done
# link
$FCOMP $LDFLAGS *.o -o $pgm.exe $ADDLIB $DELLIBS $CERNLIBS
# cleanup
rm -f *.f *.c *.o
# cleanup
rm -f *.f *.c *.o
# create input file
echo "FILE = simana.xsdst" > ./PDLINPUT
# execute
./$pgm.exe 1>$pgm.log 2>$pgm.err
./$pgm.exe 1>$pgm.log 2>$pgm.err
```
It
* gets the sources
......
# makefile fuer zftest
TESTOBJ = delpyt.for pythia5722.for jetset7409_dtau.for taupolep2.for
CERNLIB=`cernlib packlib kernlib phtools`
LFLAGS = -v
LIBCERN = $(LIBDIR)
all: pythia
.for.o:
$(F77) $(ADDCOMP) $*.for
pythia: $(TESTOBJ)
$(F77) $(LDFLAGS) -o pythia $(TESTOBJ) $(CERNLIB)
clean:
rm -f *.o *~ pythia core
# DELPHI tuned Pythia generator from about 1998
The script pythia.sh will create the pythia executable with DELPHI tuning,
process 10 events and pass them through the detector simulation and
reconstruction.
The code may serve as a template to interface possible new generators with
DELPHI simulation and reconstruction code.
The following [script](pythia.sh)
```
#! /bin/bash -f
rm pythia.tit
cat >> pythia.tit <<EOF
C-- This is an example Title file for running the PYTHIA generator
C--
C-- turn on FFKEY steering file debug- this can be commented out for production
LIST
C-- Lab ID (used to generate random number seed)
LABO 'CERN'
C-- Run number (used to generate random number seed)
NRUN 1001
C-- Centre of mass energy
ECMS 91.25
C-- Number of events to generate
NEVT 10
C-- Process to generate
C-- See the PYTHIA manual for details, but common ones are:
C-- 1 = Z/gamma
C-- 22 = ZZ
C-- 25 = WW
C-- 35 = Zee (use with caution, double counts with gamma-gamma generators)
C-- 36 = Wev (use with caution, probably unreliable)
ACHAN 22
C-- Allowed Z decays
C-- order is d u s c b e v_e mu v_mu tau v_tau
C-- code is as per MDME(IDC,1) - see PYTHIA manual
C-- 0 = off
C-- 1 = on
C-- 2 = on for particle but off for antiparticle
C-- 3 = on for antiparticle but off for particle
C-- 4 = for pairs eg W+W-, one but not both is allowed
C-- 5 = as =4 but an independent group of channels
C-- eg for taus only ZDK 0 0 0 0 0 0 0 0 0 1 0
ZDK 1 1 1 1 1 1 1 1 1 1 1
C-- Allowed W decays
C-- order is ud us ub cd cs cb ev_e muv_mu tauv_tau
C-- code is as per ZDK above
C-- eg for semileptonic evqq, choose WDK 4 4 4 4 4 4 5 0 0
WDK 1 1 1 1 1 1 1 1 1
C-- Tau polarisation
C-- 0 = Standard JETSET
C-- 1 = use TAUOLA library
TAUP 1
C-- Maximum mass cut on heavy bosons (CKIN 41 and CKIN 43)
C-- default is 12.0 GeV/c**2
C-- minimum is 2.0 GeV/c**2 (hard coded in PYTHIA)
MCUT 2.0
C-- ISR
ISR 1
C-- FSR
FSR 1
C-- Fragmentation
FRAG 1
C-- Coulomb correction
ACOUL 1
C-- Mw
MW 80.41
C-- W width; negative value : calculate internally
GAMW -1.0
C-- Mz
MZ 91.187
C-- Z width
GAMZ 2.490
C-- Mtop
MTOP 173.8
C-- M Charged Higgs
MCHIG 1000.0
C-- M Neutral Higgs
MNHIG 125.36
C-- Normalisation Scheme
C-- MSTP(8) - see manual
C-- 0 = running alpha_em(Q**2) and a fixed sin**2 theta_weak
C-- 1 = calculate from Gf, Mz, sin**2 theta_weak, Mw
C-- 2 = calculate from Gf, Mz, Mw only
NORM 1
C-- Scale for showering of ISR
C-- MSTP(68) switch
C-- 0 = Limit to s-hat
C-- 1 = scale limited as s for ISR
C-- 2 = scale limited to s for ISR and cross-section calulcation
SSCAL 2
C-- Running alpha_em
C-- 0 = fixed at Q**2 = 0
C-- 1 = running alpha_em
C-- 2 = fixed to Q**2 = 0 value below 1 GeV**2;
C-- and to Q**2 = 2Mw value above 1 GeV**2
C-- 1 is recommended
RUNA 1
C-- Alpha_em(0)
AEM0 137.0359895
C-- Alpha_em(2Mw) (only used if RUNA = 2)
AEMW 128.07
C-- Sin**2 theta_weak
C-- will be ignored if using scheme NORM = 2
S2WE 0.2319
C-- Output flag
C-- 0 = write nothing else use this LUN
LOUT 26
C-- Output format
C-- 0 = DELSIM unformatted
C-- 1 = EXCALIBUR formatted
C-- 2 = FASTSIM formatted
OFORM 0
C-- Number of debug events to print out
NDBG 10
C-- Safety factor on cross sections
C-- increase if "Maxiumum violated" error messages occur
C-- but it slows down the program
SAFE 5.0
END
EOF
make pythia
ln -s pythia.tit fort.11
rm fort.26
pythia | tee pythia$$.log
mv fort.26 pythia.fadgen
# run detector simulation and reconstruction
runsim -VERSION v94c -LABO CERN -NRUN 1000 -EBEAM 45.625 -gext pythia.fadgen
```
will generate 10 ZZ events (all with debug output of the generated particles) with the approproate settings at a beam energy of 45.625 GeV, and let them decay in all allowed channels. The output will be written to pythia.fadgen in delsim
format.
Detector simulation and reconstruction is done using this file as input, with detector settings as in 1994, processing version C.
The files **simana.fadana* and **simana.sdst** can be viewed with DELGRA.
This diff is collapsed.
This diff is collapsed.
#! /bin/bash -f
rm pythia.tit
cat >> pythia.tit <<EOF
C-- This is an example Title file for running the PYTHIA generator
C--
C-- turn on FFKEY steering file debug- this can be commented out for production
LIST
C-- Lab ID (used to generate random number seed)
LABO 'CERN'
C-- Run number (used to generate random number seed)
NRUN 1001
C-- Centre of mass energy
ECMS 91.25
C-- Number of events to generate
NEVT 10
C-- Process to generate
C-- See the PYTHIA manual for details, but common ones are:
C-- 1 = Z/gamma
C-- 22 = ZZ
C-- 25 = WW
C-- 35 = Zee (use with caution, double counts with gamma-gamma generators)
C-- 36 = Wev (use with caution, probably unreliable)
ACHAN 22
C-- Allowed Z decays
C-- order is d u s c b e v_e mu v_mu tau v_tau
C-- code is as per MDME(IDC,1) - see PYTHIA manual
C-- 0 = off
C-- 1 = on
C-- 2 = on for particle but off for antiparticle
C-- 3 = on for antiparticle but off for particle
C-- 4 = for pairs eg W+W-, one but not both is allowed
C-- 5 = as =4 but an independent group of channels
C-- eg for taus only ZDK 0 0 0 0 0 0 0 0 0 1 0
ZDK 1 1 1 1 1 1 1 1 1 1 1
C-- Allowed W decays
C-- order is ud us ub cd cs cb ev_e muv_mu tauv_tau
C-- code is as per ZDK above
C-- eg for semileptonic evqq, choose WDK 4 4 4 4 4 4 5 0 0
WDK 1 1 1 1 1 1 1 1 1
C-- Tau polarisation
C-- 0 = Standard JETSET
C-- 1 = use TAUOLA library
TAUP 1
C-- Maximum mass cut on heavy bosons (CKIN 41 and CKIN 43)
C-- default is 12.0 GeV/c**2
C-- minimum is 2.0 GeV/c**2 (hard coded in PYTHIA)
MCUT 2.0
C-- ISR
ISR 1
C-- FSR
FSR 1
C-- Fragmentation
FRAG 1
C-- Coulomb correction
ACOUL 1
C-- Mw
MW 80.41
C-- W width; negative value : calculate internally
GAMW -1.0
C-- Mz
MZ 91.187
C-- Z width
GAMZ 2.490
C-- Mtop
MTOP 173.8
C-- M Charged Higgs
MCHIG 1000.0
C-- M Neutral Higgs
MNHIG 125.36
C-- Normalisation Scheme
C-- MSTP(8) - see manual
C-- 0 = running alpha_em(Q**2) and a fixed sin**2 theta_weak
C-- 1 = calculate from Gf, Mz, sin**2 theta_weak, Mw
C-- 2 = calculate from Gf, Mz, Mw only
NORM 1
C-- Scale for showering of ISR
C-- MSTP(68) switch
C-- 0 = Limit to s-hat
C-- 1 = scale limited as s for ISR
C-- 2 = scale limited to s for ISR and cross-section calulcation
SSCAL 2
C-- Running alpha_em
C-- 0 = fixed at Q**2 = 0
C-- 1 = running alpha_em
C-- 2 = fixed to Q**2 = 0 value below 1 GeV**2;
C-- and to Q**2 = 2Mw value above 1 GeV**2
C-- 1 is recommended
RUNA 1
C-- Alpha_em(0)
AEM0 137.0359895
C-- Alpha_em(2Mw) (only used if RUNA = 2)
AEMW 128.07
C-- Sin**2 theta_weak
C-- will be ignored if using scheme NORM = 2
S2WE 0.2319
C-- Output flag
C-- 0 = write nothing else use this LUN
LOUT 26
C-- Output format
C-- 0 = DELSIM unformatted
C-- 1 = EXCALIBUR formatted
C-- 2 = FASTSIM formatted
OFORM 0
C-- Number of debug events to print out
NDBG 10
C-- Safety factor on cross sections
C-- increase if "Maxiumum violated" error messages occur
C-- but it slows down the program
SAFE 5.0
END
EOF
make pythia
ln -s pythia.tit fort.11
rm fort.26
pythia | tee pythia$$.log
mv fort.26 pythia.fadgen
# run detector simulation and reconstruction
runsim -VERSION v94c -LABO CERN -NRUN 1000 -EBEAM 45.625 -gext pythia.fadgen
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment