12 """This steering file is an example of how to use 'ECLBackground' module.
13 There are generally 8 different data sets for each background campaign:
23 Each sample usually consists of 1000 files, each representing 1 micro second
24 of time, for a total sample time of 1000 micro second (1 ms).
26 In this example, we will use a subset of 100 files (representing 100 micro second)
27 from the 12th Campaign's RBB HER sample.
29 Samples are generated by Hiro Nakayama-san. Information on them can be
31 https://confluence.desy.de/display/BI/Background+WebHome
36 from reconstruction
import add_ecl_modules
39 mainPath = b2.create_path()
41 """Use a subset (100 files) of the 12th Campaign RBB HER sample
43 If you want the whole dataset, uncomment the line after.
44 RBB can be replaced with Coulomb and Touschek, and HER with LER.
46 inputs =
'~nakayama/basf2_opt/release_201506_12th/Work_MCgen/output/output_RBB_HER_study_1??.root'
53 sampletime = timePerFile * int(subprocess.check_output(
'ls ' + inputs +
' | wc -l',
55 print(
'The sampletime is ' + str(sampletime) +
'micro second')
57 """You may want to change this to something more descriptive,
58 e.g. 'RBB_HER_100us.root'
60 outputFile =
'EclBackgroundExample.root'
62 print(
'The output will written to ' + outputFile)
64 """The background module can produce some ARICH plots for
65 shielding studies. To do this, set ARICH to 'True'.
70 inputFile = b2.register_module(
'RootInput')
71 inputFile.param(
'inputFileNames', inputs)
72 mainPath.add_module(inputFile)
75 gearbox = b2.register_module(
'Gearbox')
76 mainPath.add_module(gearbox)
81 geometry = b2.register_module(
'Geometry')
82 geometry.logging.log_level = b2.LogLevel.WARNING
83 mainPath.add_module(geometry)
85 """The ECL background module is a HistoModule. Any histogram registered
86 in it will be written to file by the HistoManager module.
88 histoManager = b2.register_module(
'HistoManager')
89 histoManager.param(
'histoFileName', outputFile)
90 mainPath.add_module(histoManager)
92 """Register and add 'ECLBackground' module
95 Processes background campaigns and produces histograms.
96 This module requires HistoManager module.
98 eclBackground = b2.register_module(
'ECLBackground')
99 eclBackground.param(
'sampleTime', sampletime)
100 eclBackground.param(
'doARICH', ARICH)
102 eclBackground.param(
'crystalsOfInterest', [318, 625, 107])
103 mainPath.add_module(eclBackground)
106 eclDigitizer = b2.register_module(
'ECLDigitizer')
107 mainPath.add_module(eclDigitizer)
110 add_ecl_modules(mainPath)
113 mainPath.add_module(
'Progress')