55# daqprocessor_single_calibrate.py -i <input_dir> -l -s -p <process_level>
66#
77# Arguments
8- # -i <input_dir> : directory with Modulation data (should have same num as run)
8+ # -i <input_dir> : directory with Modulation data (should have same name as run)
99# -l : produce long root files
1010# -s : process slow control data
1111# -p <process_level> : 0 = full reprocess of run
2828# run dir: where do you want all the scipts to live?
2929run_dir = modulation_basedir + "/stoomboot/scripts"
3030
31+ ############################################################################################
3132import sys
3233sys .path .append ('python' )
3334from processorlib import *
34-
3535############################################################################################
3636
37-
3837# global initialization of the run processing
3938
4039print ('MAIN:: Welcome to the modulation daq-processor...' )
@@ -107,7 +106,7 @@ def make_calibration(calib):
107106 #
108107 # compose the calibration execution script
109108 #
110- fout .write ('#include "/user/z37/Modulation /analysis/calibration/ecal.C" \n ' );
109+ fout .write ('#include "' + modulation_basedir + ' /analysis/calibration/ecal.C" \n ' );
111110 fout .write ('void do_calibrate_' + run + '(){ \n ' )
112111 fout .write (' ecal e("' + outdir + '/calibration/","' + calib + '"); \n ' )
113112 fout .write (' e.Loop(); \n ' )
@@ -173,13 +172,25 @@ def process_fast_data(calib):
173172 os .system (cmd_string )
174173
175174############################################################################################
175+ def makelink (mc_path , mc_link ):
176+ # make a symbolic link to the MC template root file
177+ if not os .path .exists (mc_link ):
178+ cmd_string = 'ln -s ' + mc_path + '/' + mc_link + ' .'
179+ os .system (cmd_string )
180+ print ('makelink:: ' + cmd_string )
181+ ############################################################################################
176182
177183#
178184# After run analysis
179185#
180186def do_analysis ():
181-
182- print ('MAIN:: Make analyzer script and run it ....' )
187+ print ('do_analyzer:: Check if symlinks to MC root files exist' )
188+ # simulation templates from MC
189+ makelink (modulation_basedir + '/analysis/calibration' ,'MC_ti44_modulation.root' )
190+ makelink (modulation_basedir + '/analysis/calibration' ,'MC_co60_modulation.root' )
191+ makelink (modulation_basedir + '/analysis/calibration' ,'MC_cs137_modulation.root' )
192+
193+ print ('do_analyzer:: Make analyzer script and run it ....' )
183194
184195 analyzerscript = run_dir + '/do_analyzer_' + run + '.C'
185196 analyzer_file = ana_output + '/ANA_' + run + '.root'
@@ -188,7 +199,7 @@ def do_analysis():
188199 #
189200 # compose the analyzer execution script
190201 #
191- fout .write ('#include "/user/z37/Modulation /analysis/calibration/analyzer.C" \n ' );
202+ fout .write ('#include "' + modulation_basedir + ' /analysis/calibration/analyzer.C" \n ' );
192203 fout .write ('void do_analyzer_' + run + '(){ \n ' )
193204 fout .write (' analyzer ana("' + outdir + '/","' + analyzer_file + '"); \n ' )
194205 fout .write (' ana.Loop(); \n ' )
0 commit comments