diff --git a/packages/kkmcee/KKMCee b/packages/kkmcee/KKMCee index 2ee37c13..899f709a 100755 --- a/packages/kkmcee/KKMCee +++ b/packages/kkmcee/KKMCee @@ -1,36 +1,51 @@ #!/bin/bash -# Wrapper around the KKMCee/ProdMC.exe executable +# Wrapper around the KKMCee executable # This script relies on the presence of CVMFS in the system and uses the KKMCee # provided by the LCG Releases help(){ echo "" - echo "+++ Wrapper around the KKMCee/ProdMC.exe executable +++" + echo "+++ Wrapper around the KKMCee executable +++" echo "" - echo "Usage: \tKKMCee -f Mu|Tau|UDS|C|B|Hadrons -e Ecms -n Nevts -o output_file [-s seed_file] [OPTIONS]" - echo " \tKKMCee -c config_file [-s seed_file]" + echo "Usage: \tKKMCee -f Mu|Tau|UDS|C|B|Hadrons -e Ecms -n Nevts -o output_file [-s initial_seed] [OPTIONS]" + echo " \tKKMCee -c config_file [-s initial_seed]" echo "" echo "Options:" echo -e " -c, --config file \t\tPath to configuration file" echo -e " -f, --flavour flavour \tFlavour to be generated (Mu|Tau|UDS|C|B|Hadrons)" echo -e " -e, --ecms energy \t\tCenter of Mass energy in GeV" - echo -e " -n, --nevts energy \t\tNumber of events to be generated" - echo -e " -o, --outfile file \t\tFile with the generated events in LHE format" - echo -e " -s, --seedfile file \t\tFile to be used for seeding (randomly generated, if missing)" + echo -e " -n, --nevts events \t\tNumber of events to be generated" + echo -e " -o, --outfile file \t\tFile with the generated events in HEPMCv3 format [kkmcee.hepmc]" + echo -e " -s, --initialseed \t\tLong number to be used for initial seeding (randomly generated, if missing)" echo -e " -b, --bessig bessig \t\tBeam-Energy-Spread of both beams (or of the first beam, if bessig2<0.) " echo -e " \t\t[fraction of Ecms/2, default -1. (no spread)]" echo -e " -g, --bessig2 bessig2 \tBeam-Energy-Spread of the second beam if different from the first beam; fraction of Ecms/2." echo -e " \t\t[fraction of Ecms/2, default -1. (no spread or equal to first beam)]" echo -e " -r, --besrho rho \t\tBeam-Energy-Spread correlation [default 0.]" + echo -e " -d, --debug lvl \t\t PrintOut Level 0,1,2 [default 1]" + echo "" + echo "Special options for taus only:" + echo -e " -t, --taudec t1*1000+t2 \tdecay channel for the first (t1) and second tau (t2)" + echo -e " \t\t 0 Inclusive" + echo -e " \t\t 1,2,3 electron,mu,pi" + echo -e " \t\t 4,5,6,7 rho,a1,K,K*" + echo -e " \t\t 8,9,10,11,12,13 3pip0,pi3pi0,3pi2pi0,5pi,5pip0,3pi3p0" + echo -e " \t\t 14, ... (other rare decays see tauola++)" + echo -e " --tauopt file \t\tFile with tau options (see Tauola section in KKMCee_defaults)" + echo -e " \t\t the file is included as it is and overwrites other settings" echo "" echo "Examples:" - echo -e "KKMCee -f Mu -e 91.2 -n 10000 -o kkmu_10000.LHE -b 0.001" + echo -e "KKMCee -f Mu -e 91.2 -n 10000 -o kkmu_10000.hepmc -b 0.001" echo -e "KKMCee -c kkmc_ditau.input" - echo -e "KKMCee -f B -e 91.2 -n 1000 -o kkbb_1000.LHE" + echo -e "KKMCee -f B -e 91.2 -n 1000 -o kkbb_1000.hepmc" + echo "" + echo " NB: (1) This wrapper works only for KKMCee versions 5 or newer" + echo " (2) Output is HEPMC v3" echo "" } +_DBGLVL=1 _FLAVOUR="Mu" _ECMS="91.2" _NEVTS="100" @@ -39,7 +54,11 @@ _HAVEBESTWO="no" _BESONE=-1. _BESTWO=-1. _BESRHO=0. -_OUTFILE="KKMCee_OUT.LHE" +_OUTFILE="kkmcee.hepmc" +_TAUDEC=0 +_JAK1=0 +_JAK2=0 +_TAUOPT="" # Read arguments while [[ $# -gt 0 ]] do @@ -82,8 +101,8 @@ do shift shift ;; - -s | --seedfile) - _SEEDFILE="$2" + -s | --initialseed) + _INITSEED="$2" shift shift ;; @@ -92,6 +111,21 @@ do shift shift ;; + -t | --taudec) + _TAUDEC="$2" + shift + shift + ;; + --tauopt) + _TAUOPT="$2" + shift + shift + ;; + -d | --debug) + _DBGLVL="$2" + shift + shift + ;; * | -h | --help) help exit 1 @@ -108,47 +142,72 @@ echo -e "*********************************************************************** KKMCEE_DIR=$(dirname $(dirname $0)) KKMCEE_EXE=${KKMCEE_DIR}/bin/KKMCee.exe -KKMCEE_SHARE=${KKMCEE_DIR}/share/KKMCee +TABMAIN_EXE=${KKMCEE_DIR}/bin/TabMainC +TABMAIN_OUTPUT=./TabMainC.output KKMCEE_ETC=${KKMCEE_DIR}/etc/KKMCee # Run existing config file if test "x$_CONFFILE" = "x"; then # We create a config file based on the input switches: this is the initial common part cat > ./pro.input <> ./pro.input <> ./pro.input <> ./pro.input <> ./pro.input <> ./pro.input + else + if test ! "x${_TAUDEC}" = "x0" ; then + _JAK2=$((${_TAUDEC}/1000)) + _JAK1=$(((${_TAUDEC}-${_JAK2})/1000)) + fi + fi cat >> ./pro.input <> ./pro.input <> ./pro.input <> ./pro.input < ./iniseed < ${TABMAIN_OUTPUT} # Run -cat > ./semaphore < ./pro.input <> ./pro.input <> ./pro.input <> ./pro.input <> ./pro.input <> ./pro.input -+ else -+ if test ! "x${_TAUDEC}" = "x0" ; then -+ _JAK2=$((${_TAUDEC}/1000)) -+ _JAK1=$(((${_TAUDEC}-${_JAK2})/1000)) -+ fi -+ fi -+cat >> ./pro.input <> ./pro.input <> ./pro.input <> ./pro.input <> ./pro.input <> ./pro.input <> ./pro.input < ${TABMAIN_OUTPUT} -+ -+# Run -+time ${KKMCEE_EXE} ${_SSEED} -o ${_OUTFILE} -n ${_NEVTS} -+if test ! "x$?" = "x0" ; then -+ exit 1; -+else -+ echo "event generation ok" ; -+ # Cleanup -+ rm -f KKMCee_defaults -+ # Run files under KKMCee-datetime -+ _rundir="KKMCee-`date +%d%b%Y-%H%m%S`" -+ mkdir ${_rundir} -+ _runfiles="DIZET-table1 TabMain77.output TabMainC.output mcgen.root -+ pro.input pro.output pro77.output" -+ for f in ${_runfiles}; do -+ mv $f ${_rundir} -+ done -+fi --- ProdRun/kkmchepmc/kkmc-tauola.input.orig 1970-01-01 01:00:00.000000000 +0100 +++ ProdRun/kkmchepmc/kkmc-tauola.input 2022-07-27 15:54:19.743550514 +0200 @@ -0,0 +1,87 @@ diff --git a/packages/kkmcee/package.py b/packages/kkmcee/package.py index 987cbc01..a864df11 100644 --- a/packages/kkmcee/package.py +++ b/packages/kkmcee/package.py @@ -117,7 +117,7 @@ def install(self, spec, prefix): install("ProdRun/kkmchepmc/kkmc-tauola.input", prefix.share.KKMCee) mv = which("mv") mv(prefix + "/bin/KKMCee", prefix + "/bin/KKMCee.exe") - install("ProdRun/kkmchepmc/KKMCee-5", prefix + "/bin/KKMCee") + install(join_path(os.path.dirname(__file__), "KKMCee"), prefix + "/bin/KKMCee") chmod = which("chmod") chmod("a+x", prefix + "/bin/KKMCee") pcm_files = glob.glob("*/*_rdict.pcm")