7 from subprocess
import call
9 d = datetime.datetime.today()
10 print((d.strftime(
'job start: %Y-%m-%d %H:%M:%S\n')))
16 if len(sys.argv) == 6:
18 inputs =
'/home/belle/igal/beast/data/NTP/TPC/' + \
19 str(sys.argv[1]) +
"-" + str(sys.argv[2]) +
"-" + str(sys.argv[3]) +
"/tpc" + str(sys.argv[4]) +
"*.root"
21 outfile = str(sys.argv[5]) +
"/DailyReportOfTPC" + str(sys.argv[4]) +
"_" + \
22 str(sys.argv[1]) + str(sys.argv[2]) + str(sys.argv[3]) +
".root"
24 date = str(sys.argv[1]) + str(sys.argv[2]) + str(sys.argv[3])
26 TPCnb = str(sys.argv[4])
30 print(
" 1/ Create an output directory ")
31 print(
" mkdir output_directory")
32 print(
" 2/ basf2 ./RunTPC_daily_report.py yyyy mm dd TPCposition output_directory")
33 print(
"For example: ")
34 print(
" basf2 ./RunTPC_daily_report.py 2016 05 30 3 output_directory")
47 simpleinput = register_module(
'RootInput')
48 simpleinput.param(
'inputFileNames', inputs)
49 main.add_module(simpleinput)
52 histo = register_module(
"HistoManager")
53 histo.param(
'histoFileName', outfile)
54 main.add_module(histo)
57 gearbox = register_module(
'Gearbox')
58 gearbox.param(
'fileName',
'/geometry/Beast2_phase1.xml')
59 main.add_module(gearbox)
62 daily = register_module(
'MicrotpcDailyReport')
63 daily.param(
'inputTPCNumber', int(TPCnb))
64 daily.param(
'inputReportDate', int(date))
65 main.add_module(daily)
70 print(
'Event Statistics:')
73 d = datetime.datetime.today()
74 print(d.strftime(
'job finish: %Y-%m-%d %H:%M:%S\n'))