22 b2.logging.log_level = b2.LogLevel.WARNING
25 print(
'Use the script as: basf2 ARICHBkg.py arguments')
26 print(
'Arguments are in the following order: type (RBB,Touschek_HER,...), path to files , '
27 'job number , number of input files')
29 print(
'example: basf2 ARICHBkg.py RBB /gpfs/home/belle/nakayama/basf2_opt/release_201502_development/Work_MCgen/output/ 2 100 0')
30 print(
'will analyse files in output dir with index numbers from 200-299.')
31 print(
'Background tag is int appended to all hits (to identify contributions from different sources at later analysis')
32 print(
'0 for RBB, 1 for BHWide, 2 Touschek_HER, 3 Touschek_LER, 4 Coulomb_HER, 5 Coulomb_LER, 6 twoPhoton, 7 brems,' +
33 ' 8 BHWideLargeAngle')
36 typs = [
"RBB",
"BHWide",
"Touschek_HER",
"Touschek_LER",
"Coulomb_HER",
"Coulomb_LER",
"twoPhoton",
"brems",
"BHWideLargeAngle"]
42 input = b2.register_module(
'RootInput')
43 paramloader = b2.register_module(
'Gearbox')
44 geobuilder = b2.register_module(
'Geometry')
45 back = b2.register_module(
'ARICHBackground')
54 nfiles = int(sys.argv[4])
59 patha = path + typee +
'_study-phase32-'
61 for i
in range(n * nfiles, (n + 1) * nfiles):
62 filenn = patha + str(i) +
'.root'
66 out =
'arich_' + typee +
'_' + sys.argv[3] +
'_phase32.root'
68 print(
'Output file: ' + out)
70 input.param(
'inputFileNames', fnames)
71 geobuilder.param(
'components', [
'ARICH'])
72 back.param(
'FileName', out)
73 back.param(
'BkgTag', typs.index(typee))
75 main = b2.create_path()
78 main.add_module(input)
79 main.add_module(paramloader)
80 main.add_module(geobuilder)