11"""This steering file is an example of how to use 'ECLBackground' module.
12There are generally 8 different data sets for each background campaign:
22Each sample usually consists of 1000 files, each representing 1 micro second
23of time, for a total sample time of 1000 micro second (1 ms).
25In this example, we will use a subset of 100 files (representing 100 micro second)
26from the 12th Campaign's RBB HER sample.
28Samples are generated by Hiro Nakayama-san. Information on them can be
30 https://xwiki.desy.de/xwiki/rest/p/078bc
35from reconstruction
import add_ecl_modules
38mainPath = b2.create_path()
40"""Use a subset (100 files) of the 12th Campaign RBB HER sample
42If you want the whole dataset, uncomment the line after.
43RBB can be replaced with Coulomb and Touschek, and HER with LER.
45inputs =
'~nakayama/basf2_opt/release_201506_12th/Work_MCgen/output/output_RBB_HER_study_1??.root'
52sampletime = timePerFile * int(subprocess.check_output(
'ls ' + inputs +
' | wc -l',
54print(
'The sampletime is ' + str(sampletime) +
'micro second')
56"""You may want to change this to something more descriptive,
57 e.g. 'RBB_HER_100us.root'
59outputFile =
'EclBackgroundExample.root'
61print(
'The output will written to ' + outputFile)
63"""The background module can produce some ARICH plots for
64 shielding studies. To do this, set ARICH to 'True'.
69inputFile = b2.register_module(
'RootInput')
70inputFile.param(
'inputFileNames', inputs)
71mainPath.add_module(inputFile)
74gearbox = b2.register_module(
'Gearbox')
75mainPath.add_module(gearbox)
80 geometry = b2.register_module(
'Geometry')
81 geometry.logging.log_level = b2.LogLevel.WARNING
82 mainPath.add_module(geometry)
84"""The ECL background module is a HistoModule. Any histogram registered
85 in it will be written to file by the HistoManager module.
87histoManager = b2.register_module(
'HistoManager')
88histoManager.param(
'histoFileName', outputFile)
89mainPath.add_module(histoManager)
91"""Register and add 'ECLBackground' module
94 Processes background campaigns and produces histograms.
95 This module requires HistoManager module.
97eclBackground = b2.register_module(
'ECLBackground')
98eclBackground.param(
'sampleTime', sampletime)
99eclBackground.param(
'doARICH', ARICH)
101eclBackground.param(
'crystalsOfInterest', [318, 625, 107])
102mainPath.add_module(eclBackground)
105eclDigitizer = b2.register_module(
'ECLDigitizer')
106mainPath.add_module(eclDigitizer)
109add_ecl_modules(mainPath)
112mainPath.add_module(
'Progress')
113b2.process(mainPath, calculateStatistics=
True)