Belle II Software development
first_data_analysis_script.py
1#!/usr/bin/env python3
2
3
10
11import os
12
13import basf2
14import rawdata
15
16from tracking import add_track_finding, add_track_fit_and_track_creator
17from tracking.harvesting_validation import recorded_data_module
18from tracking.path_utils import add_hit_preparation_modules
19
20
21def get_output_file_name(file_name):
22 input_file_names = os.environ["FILE_NAMES"].split()
23 assert len(input_file_names) == 1
24 input_file_name = input_file_names[0]
25 input_file_name = os.path.splitext(os.path.basename(input_file_name))[0]
26
27 return input_file_name + "_" + file_name
28
29
30if __name__ == "__main__":
31 basf2.conditions.override_globaltags([os.environ["BASF2_GDT"]])
32
33 path = basf2.create_path()
34
35 input_file_names = os.environ["FILE_NAMES"].split()
36 print(f"Using input files {input_file_names}")
37
38 path.add_module("RootInput", inputFileNames=input_file_names)
39
40 path.add_module("Gearbox")
41 path.add_module("Geometry", useDB=True)
42
44
45 add_hit_preparation_modules(path)
46 path.add_module('SetupGenfitExtrapolation', energyLossBrems=False, noiseBrems=False)
47
48 add_track_finding(path, svd_ckf_mode="VXDTF2_before_with_second_ckf", prune_temporary_tracks=False)
49
50 add_track_fit_and_track_creator(path)
51
52 # Resetting MinClusterTime parameter to turn of cut on cluster time
53 for m in path.modules():
54 if m.name() == "SVDSpacePointCreator":
55 m.param("MinClusterTime", -999)
56
57 path.add_module("RootOutput", outputFileName=get_output_file_name("reconstructed.root"))
58
59 path.add_module(recorded_data_module.TrackInfoHarvester(output_file_name=get_output_file_name('trackLevelInformation.root')))
60 path.add_module(recorded_data_module.HitInfoHarvester(output_file_name=get_output_file_name('hitLevelInformation.root')))
61 path.add_module(recorded_data_module.EventInfoHarvester(output_file_name=get_output_file_name('eventLevelInformation.root')))
62
63 basf2.print_path(path)
64 basf2.process(path)
65 print(basf2.statistics)
def add_unpackers(path, components=None, writeKLMDigitRaws=False, addTOPRelations=False)
Definition: rawdata.py:67