15 d = datetime.datetime.today()
16 print((d.strftime(
'job start: %Y-%m-%d %H:%M:%S\n')))
22 if len(sys.argv) == 6:
24 inputs =
'/home/belle/igal/beast/data/NTP/TPC/' + \
25 str(sys.argv[1]) +
"-" + str(sys.argv[2]) +
"-" + str(sys.argv[3]) +
"/tpc" + str(sys.argv[4]) +
"*.root"
27 outfile = str(sys.argv[5]) +
"/DailyReportOfTPC" + str(sys.argv[4]) +
"_" + \
28 str(sys.argv[1]) + str(sys.argv[2]) + str(sys.argv[3]) +
".root"
30 date = str(sys.argv[1]) + str(sys.argv[2]) + str(sys.argv[3])
32 TPCnb = str(sys.argv[4])
36 print(
" 1/ Create an output directory ")
37 print(
" mkdir output_directory")
38 print(
" 2/ basf2 ./RunTPC_daily_report.py yyyy mm dd TPCposition output_directory")
39 print(
"For example: ")
40 print(
" basf2 ./RunTPC_daily_report.py 2016 05 30 3 output_directory")
50 main = b2.create_path()
53 simpleinput = b2.register_module(
'RootInput')
54 simpleinput.param(
'inputFileNames', inputs)
55 main.add_module(simpleinput)
58 histo = b2.register_module(
"HistoManager")
59 histo.param(
'histoFileName', outfile)
60 main.add_module(histo)
63 gearbox = b2.register_module(
'Gearbox')
64 gearbox.param(
'fileName',
'/geometry/Beast2_phase1.xml')
65 main.add_module(gearbox)
68 daily = b2.register_module(
'MicrotpcDailyReport')
69 daily.param(
'inputTPCNumber', int(TPCnb))
70 daily.param(
'inputReportDate', int(date))
71 main.add_module(daily)
76 print(
'Event Statistics:')
79 d = datetime.datetime.today()
80 print(d.strftime(
'job finish: %Y-%m-%d %H:%M:%S\n'))