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