Belle II Software development
run_collector.py
1#!/usr/bin/env python3
2
3
10
11import sys
12import basf2 as b2
13from cdc import cr
14
15# The backend creates a file with the input data file paths inside it and places it in the job's working directory.
16# This function reads the file automatically to get a list of input file paths
17from caf.backends import get_input_data
18
19probcut = float(sys.argv[1]) if len(sys.argv) == 2 else 0.001
20data_period = 'phase2'
21
22b2.reset_database()
23b2.use_database_chain()
24b2.use_central_database("332_COPY-OF_GT_gen_prod_004.11_Master-20171213-230000", b2.LogLevel.INFO)
25b2.use_central_database("MagneticFieldPhase2QCSoff")
26b2.use_local_database("/home/belle/muchida/basf2/release/cdc/examples/caf/localDB/database.txt")
27# use_local_database("/home/belle/muchida/basf2/work/caf/gcr2/test7/localDB/database.txt")
28
29input_data = get_input_data()
30output_file_name = 'CollectorOutput.root'
31
32# Compose basf2 module path #
33
34main_path = b2.create_path()
35main_path.add_module('RootInput',
36 # entrySequences=['0:10'],
37 entrySequences=['0:2000'],
38 inputFileNames=input_data)
39
40main_path.add_module('HistoManager', histoFileName=output_file_name)
41
42main_path.add_module('Gearbox')
43main_path.add_module('Geometry', useDB=True)
44main_path.add_module('CDCUnpacker')
45
46cr.set_cdc_cr_parameters(data_period)
48 pval2ndTrial=probcut)
49
50main_path.add_module('CDCCalibrationCollector',
51 granularity="all",
52 EventT0Extraction=True,
53 BField=True,
54 calExpectedDriftTime=True
55 )
56b2.print_path(main_path)
57b2.process(main_path)
58print(b2.statistics)
def set_cdc_cr_parameters(period)
Definition: __init__.py:95
def add_cdc_cr_reconstruction(path, eventTimingExtraction=True, topInCounter=False, pval2ndTrial=0.001)
Definition: __init__.py:180