diff options
author | tlatorre <tlatorre@uchicago.edu> | 2018-10-03 09:45:33 -0500 |
---|---|---|
committer | tlatorre <tlatorre@uchicago.edu> | 2018-10-03 09:45:33 -0500 |
commit | 3650f72cc3570b51dc225886fd947f86d999e7a3 (patch) | |
tree | bbb2c0538a4c869edf4edcf5d788bd317c41ba86 /macros | |
parent | 21015c7a428ab3bbc4d58dac930ee44c8cd262c5 (diff) | |
download | sddm-3650f72cc3570b51dc225886fd947f86d999e7a3.tar.gz sddm-3650f72cc3570b51dc225886fd947f86d999e7a3.tar.bz2 sddm-3650f72cc3570b51dc225886fd947f86d999e7a3.zip |
add a python script to generate SNOMAN command files
Diffstat (limited to 'macros')
-rw-r--r-- | macros/MC_Atm_Nu_No_Osc_Snoman_Genie10000_X_1_run_mc_atm_nu_genie.cmd | 23 | ||||
-rw-r--r-- | macros/activate_atmospherics.cmd | 43 | ||||
-rw-r--r-- | macros/mc_run_10000_macro.cmd | 45 | ||||
-rwxr-xr-x | macros/snogen | 45 |
4 files changed, 156 insertions, 0 deletions
diff --git a/macros/MC_Atm_Nu_No_Osc_Snoman_Genie10000_X_1_run_mc_atm_nu_genie.cmd b/macros/MC_Atm_Nu_No_Osc_Snoman_Genie10000_X_1_run_mc_atm_nu_genie.cmd new file mode 100644 index 0000000..944a7ed --- /dev/null +++ b/macros/MC_Atm_Nu_No_Osc_Snoman_Genie10000_X_1_run_mc_atm_nu_genie.cmd @@ -0,0 +1,23 @@ +$hbook_file 'mc_atm_nu_no_osc_genie_010000_1.ntp' +file QIO 1 mc_atm_nu_no_osc_genie_010000_1.root +file out 1 mc_atm_nu_no_osc_genie_010000_1.mcds +file MCO 1 ./MC_Atm_Nu_No_Osc_Snoman_Genie10000_X_1_rseed.dat checkpoint=10 +file mco 2 mc_atm_genie_010000_1.dat +$mcrun 10000 +$num_events 442 +$mc_event_rate -0.015874 $per_sec +titles DQXX_0000010000.dat +titles /nfs/disk1/sno/mcprod/anxx/titles/pca/anxx_pca_0000010623_p2.dat +titles /nfs/disk1/sno/output/anxx/titles/neutrino/10000-10999/anxx_nu_0000010000_p12.dat +set bank TRSP 1 word 2 to 2.051309 +@activate_atmospherics +@load_d2o_settings.cmd +$flt_set_prescale 1.0 +$define_test 3 $line_1 'nhits float_equals EV+$KEV_NPM:0.5 9999;' +$define_test 6 $line_1 'one equals 0.0;' +$define_test 4 $line_1 'one equals 0.0;' +$starting_seed 10725 14449 0 +$starting_seed_2 3643 13435 0 +$disable_ntuple 666 +set bank TQIO 3 word 5 to 3 +@run_mc_atmospherics diff --git a/macros/activate_atmospherics.cmd b/macros/activate_atmospherics.cmd new file mode 100644 index 0000000..f92de61 --- /dev/null +++ b/macros/activate_atmospherics.cmd @@ -0,0 +1,43 @@ +* +* This file enables muon and atmosphreric neutrino propagation in SNOMAN +* +* J. A. Formaggio 02/27/2004 +* +* udpates: 10/01/2004 D. Waller Reduce $store_full_limit from +* 1000 -> 10. +* Add titles sno_hadron_list.dat. +* $killvx 9->7 and $killvx_neutron 2->5 + + +* Simplify storage of information + +$killvx 7 +$killvx_neutron 5 +$egs4_ds $off +$store_full_limit 10 +$max_cer_ge_errors 2000 + +* Enable hadron propagation + +titles sno_hadron_list.dat +titles chetc_sno.dat +titles flukaaf_sno.dat +$enable_hadrons $on + +* Load information for muons + +titles music_sno_info.dat +titles music_double_diff_rock.dat +titles muon.dat +titles muon_param.dat +titles photo_dis.dat +$enable_music_calc $off + +* Simplify geometry + +** $disable_geom $bly_plate +** $disable_geom $bly_groove +** $disable_geom $bly_rope +* $disable_geom $acrv_tile + +* Done diff --git a/macros/mc_run_10000_macro.cmd b/macros/mc_run_10000_macro.cmd new file mode 100644 index 0000000..aba0653 --- /dev/null +++ b/macros/mc_run_10000_macro.cmd @@ -0,0 +1,45 @@ +$processor_list 'MCO UCL PRU PCK OUT END' + +* set up output file +$output_format $full_ds +$zdab_option $zdab_max_mc +$default_output_file '@output' + +$prune_mc $keep +$prune_mcpm $keep +$prune_mcvx_source $keep +$prune_mcvx_boundary $drop +$prune_mcvx_interaction $drop +$prune_mcvx_sink $drop +$prune_mcvx_pre_source $drop + +$mcrun 10000 + +* simulate run conditions for run 10000 +$mc_gen_run_cond $on + +$num_events @num_events + +* number of vertices +$mc_num_seed_vx 1 + +$mc_interaction_type $start$$@particle_id +$mc_position $pos_region 2. $D2O$0000. 1. $ACRC_IVL$0000. 1. +$mc_direction $dir_isotropic +$mc_energy $en_mono @mc_energy +$mc_time $tim_fixed 100. +$mc_misc_find_region $unknown +$mc_event_rate 1. $per_sec + +* titles files for run 10000 +titles DQXX_0000010000.dat +titles /nfs/disk1/sno/mcprod/anxx/titles/pca/anxx_pca_0000010623_p2.dat +titles /nfs/disk1/sno/output/anxx/titles/neutrino/10000-10999/anxx_nu_0000010000_p12.dat + +* set the average number of noise hits per event +* this comes from the autosno generated MC_Atm_Nu_No_Osc_Snoman_Genie10000_X_1_run_mc_atm_nu_genie.cmd file +set bank TRSP 1 word 2 to 2.051309 + +@activate_atmospherics +@load_d2o_settings.cmd +@run_snodb diff --git a/macros/snogen b/macros/snogen new file mode 100755 index 0000000..089f34d --- /dev/null +++ b/macros/snogen @@ -0,0 +1,45 @@ +#!/usr/bin/env python +""" +snogen is a script to generate SNOMAN command files. + +Example: + + # simulate 100 1 GeV muons + $ snogen -n 100 -e 1000 -p mu_minus | /path/to/snoman.exe + +The output filename can be specified on the command line: + + $ snogen -o [output filename] + +By default it will be [particle name]_[energy]_[number of events].zdab. +""" +from __future__ import print_function, division +import string + +class MyTemplate(string.Template): + delimiter = '@' + +if __name__ == '__main__': + import argparse + + parser = argparse.ArgumentParser("generate a SNOMAN command file") + parser.add_argument("-p", "--particle-id", default="e_minus", + help="particle id") + parser.add_argument("-e", "--mc-energy", default=500.0, type=float, + help="total energy") + parser.add_argument("-n", "--num-events", default=100, type=int, + help="number of events") + parser.add_argument("-o", "--output", default=None, + help="output file name") + args = parser.parse_args() + + if args.output is None: + output = "%s_%.0f_%i.zdab" % (args.particle_id,args.mc_energy,1000) + else: + output = args.output + + with open("mc_run_10000_macro.cmd") as f: + s = f.read() + + template = MyTemplate(s) + print(template.safe_substitute(particle_id=args.particle_id,mc_energy=args.mc_energy,num_events=args.num_events,output=output)) |