Skip to content

Commit b75fc59

Browse files
committed
daqprocessor_single_calibrate.py made more flexible. hardcoded refs to APCs username have been removed
Signed-off-by: acolijn <auke.pieter.colijn@gmail.com>
1 parent fce824c commit b75fc59

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed

daqana.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ int main(int argc, char **argv)
7373
Int_t ich = ev->getChannel();
7474
Double_t rms = ev->calculateBaselineRMS();
7575
//if(graphics && ( (ev->getErrorCode()&0x04) != 0) ) ev->Plot(canv);
76-
if(graphics && (ev->getErrorCode() == 0 && ev->getChannel()%100 == 6 && ev->getArea() > 0.4e-6) ) ev->Plot(canv);
76+
if(graphics && ((ev->getErrorCode()&0x02) != 0 && ev->getChannel()%100 == 3 ) ) ev->Plot(canv);
7777
// free event
7878
myDaq.endEvent();
7979

daqprocessor_single_calibrate.py

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
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
@@ -28,13 +28,12 @@
2828
# run dir: where do you want all the scipts to live?
2929
run_dir = modulation_basedir + "/stoomboot/scripts"
3030

31+
############################################################################################
3132
import sys
3233
sys.path.append('python')
3334
from processorlib import *
34-
3535
############################################################################################
3636

37-
3837
# global initialization of the run processing
3938

4039
print('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
#
180186
def 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')

include/rootdriver.hh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ using namespace std;
1919
#define NUMBER_OF_CHANNELS 8
2020
#define MAX_PARAMETERS 3
2121

22+
//
23+
// CALIBRATION_MODE 0 : one set of calibration constants obtained from the beginning of each run (deprecated)
24+
// CALIBRATION_MODE 1 : calibration constants updated every [SEC]-seconds. [SEC] defined in analysis/calibration/ecal.h
25+
//
2226
#define CALIBRATION_MODE 1
2327

2428
class rootdriver

0 commit comments

Comments
 (0)