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.
27Samples are generated by Hiro Nakayama-san. Information on them can be
29 https://xwiki.desy.de/xwiki/rest/p/078bc
34from reconstruction import add_ecl_modules
36# Create path. Register necessary modules to this path.
37mainPath = b2.create_path()
39"""Use a subset (100 files) of the 12th Campaign RBB HER sample
41If you want the whole dataset, uncomment the line after.
42RBB can be replaced
with Coulomb
and Touschek,
and HER
with LER.
44inputs = '~nakayama/basf2_opt/release_201506_12th/Work_MCgen/output/output_RBB_HER_study_1??.root'
45# inputs = '~nakayama/basf2_opt/release_201506_12th/Work_MCgen/output/output_RBB_HER_study_*.root'
47# Length of time in us (micro second) each sample file corresponds to
50# Set the sample time based on the number of files that will be opened
51sampletime = timePerFile * int(subprocess.check_output('ls ' + inputs + ' | wc -l',
53print(
'The sampletime is ' + str(sampletime) +
'micro second')
55"""You may want to change this to something more descriptive,
56 e.g. 'RBB_HER_100us.root'
58outputFile = 'EclBackgroundExample.root'
60print('The output will written to ' + outputFile)
62"""The background module can produce some ARICH plots
for
63 shielding studies. To do this, set ARICH to
'True'.
67# Register and add 'RootInput' module
68inputFile = b2.register_module('RootInput')
69inputFile.param('inputFileNames', inputs)
70mainPath.add_module(inputFile)
72# Register and add 'Gearbox' module
73gearbox = b2.register_module('Gearbox')
74mainPath.add_module(gearbox)
76# If you want the ARICH plots, you need to load 'Geometry' module.
79 geometry = b2.register_module(
'Geometry')
80 geometry.logging.log_level = b2.LogLevel.WARNING
81 mainPath.add_module(geometry)
83"""The ECL background module is a HistoModule. Any histogram registered
84 in it will be written to file by the HistoManager module.
86histoManager = b2.register_module('HistoManager')
87histoManager.param('histoFileName', outputFile)
88mainPath.add_module(histoManager)
90"""Register
and add
'ECLBackground' module
93 Processes background campaigns
and produces histograms.
94 This module requires HistoManager module.
96eclBackground = b2.register_module('ECLBackground')
97eclBackground.param('sampleTime', sampletime)
98eclBackground.param('doARICH', ARICH)
99# If you want the dose for specific crystals, put the cell ID here.
100eclBackground.param('crystalsOfInterest', [318, 625, 107])
101mainPath.add_module(eclBackground)
103# Register and add 'ECLDigitizer' module
104eclDigitizer = b2.register_module('ECLDigitizer')
105mainPath.add_module(eclDigitizer)
107# Add the ECL reconstruction modules to the path
108add_ecl_modules(mainPath)
110# Process the events and print call statistics
111mainPath.add_module('Progress')