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