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