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