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