Belle II Software development
HoughETF.py
1#!/usr/bin/env python
2
3
10
11# -----------------------------------------------------------------------------------
12#
13# CDCTrg Hough ETF module
14#
15# usage : %> basf2 HoughETF.py -i [input root file name]
16#
17# -----------------------------------------------------------------------------------
18
19import basf2 as b2
20from ROOT import Belle2
21
22
23input_files = Belle2.Environment.Instance().getInputFilesOverride()
24if not input_files.empty() and input_files.front().endswith(".sroot"):
25 root_input = b2.register_module('SeqRootInput')
26else:
27 root_input = b2.register_module('RootInput')
28
29main = b2.create_path()
30main.add_module(root_input)
31
32# Set Database
33b2.conditions.override_globaltags()
34b2.use_database_chain()
35b2.use_central_database("data_reprocessing_prompt")
36b2.use_central_database("online")
37
38# b2.set_log_level(b2.LogLevel.DEBUG)
39b2.set_log_level(b2.LogLevel.INFO)
40
41# cdc unpacker
42cdc_unpacker = b2.register_module('CDCUnpacker')
43cdc_unpacker.param('enableStoreCDCRawHit', True)
44main.add_module(cdc_unpacker)
45main.add_module('Gearbox')
46main.add_module('Geometry', components=['CDC',
47 'MagneticFieldConstant4LimitedRCDC'])
48# cdc digitizer
49cdcdigitizer = b2.register_module('CDCDigitizer')
50param_cdcdigi = {'Fraction': 1,
51 'Resolution1': 0.,
52 'Resolution2': 0.}
53cdcdigitizer.param(param_cdcdigi)
54cdcdigitizer.param('AddInWirePropagationDelay', True)
55cdcdigitizer.param('AddTimeOfFlight', True)
56cdcdigitizer.param('UseSimpleDigitization', True)
57cdcdigitizer.param('UseDB4EDepToADC', False)
58cdcdigitizer.param('UseDB4FEE', False)
59cdcdigitizer.param('AddXTalk', False)
60main.add_module(cdcdigitizer)
61
62# cdc tsf
63main.add_module('CDCTriggerTSF',
64 InnerTSLUTFile=Belle2.FileSystem.findFile("data/trg/cdc/innerLUT_Bkg_p0.70_b0.80.coe"),
65 OuterTSLUTFile=Belle2.FileSystem.findFile("data/trg/cdc/outerLUT_Bkg_p0.70_b0.80.coe"),
66 TSHitCollectionName='CDCTriggerSegmentHits')
67
68useETF = True
69
70if useETF:
71 # cdc trigger etf (exp14 runXXXX-)
72 main.add_module('CDCTriggerHoughETF',
73 t0CalcMethod=2,
74 useHighPassTimingList=False,
75 usePriorityTiming=False,
76 storeTracks=True,
77 hitCollectionName="CDCTriggerSegmentHits",
78 outputCollectionName="CDCTriggerETFTracks")
79else:
80 # cdc trigger fastest priority timing (GRL timing)
81 main.add_module('CDCTriggerHoughETF',
82 hitCollectionName="CDCTriggerSegmentHits")
83
84
85main.add_module('Progress')
86
87# main.add_module(output);
88output_name = 'etfout.root'
89main.add_module('RootOutput', outputFileName=output_name)
90
91# Process all events
92b2.process(main)
static Environment & Instance()
Static method to get a reference to the Environment instance.
Definition: Environment.cc:28
static std::string findFile(const std::string &path, bool silent=false)
Search for given file or directory in local or central release directory, and return absolute path if...
Definition: FileSystem.cc:151