Belle II Software  release-08-01-10
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 
19 import basf2 as b2
20 from ROOT import Belle2
21 
22 
23 input_files = Belle2.Environment.Instance().getInputFilesOverride()
24 if not input_files.empty() and input_files.front().endswith(".sroot"):
25  root_input = b2.register_module('SeqRootInput')
26 else:
27  root_input = b2.register_module('RootInput')
28 
29 main = b2.create_path()
30 main.add_module(root_input)
31 
32 # Set Database
33 b2.conditions.override_globaltags()
34 b2.use_database_chain()
35 b2.use_central_database("data_reprocessing_prompt")
36 b2.use_central_database("online")
37 
38 # b2.set_log_level(b2.LogLevel.DEBUG)
39 b2.set_log_level(b2.LogLevel.INFO)
40 
41 # cdc unpacker
42 cdc_unpacker = b2.register_module('CDCUnpacker')
43 cdc_unpacker.param('enableStoreCDCRawHit', True)
44 main.add_module(cdc_unpacker)
45 main.add_module('Gearbox')
46 main.add_module('Geometry', components=['CDC',
47  'MagneticFieldConstant4LimitedRCDC'])
48 # cdc digitizer
49 cdcdigitizer = b2.register_module('CDCDigitizer')
50 param_cdcdigi = {'Fraction': 1,
51  'Resolution1': 0.,
52  'Resolution2': 0.}
53 cdcdigitizer.param(param_cdcdigi)
54 cdcdigitizer.param('AddInWirePropagationDelay', True)
55 cdcdigitizer.param('AddTimeOfFlight', True)
56 cdcdigitizer.param('UseSimpleDigitization', True)
57 cdcdigitizer.param('UseDB4EDepToADC', False)
58 cdcdigitizer.param('UseDB4FEE', False)
59 cdcdigitizer.param('AddXTalk', False)
60 main.add_module(cdcdigitizer)
61 
62 # cdc tsf
63 main.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 
68 useETF = True
69 
70 if 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")
79 else:
80  # cdc trigger fastest priority timing (GRL timing)
81  main.add_module('CDCTriggerHoughETF',
82  hitCollectionName="CDCTriggerSegmentHits")
83 
84 
85 main.add_module('Progress')
86 
87 # main.add_module(output);
88 output_name = 'etfout.root'
89 main.add_module('RootOutput', outputFileName=output_name)
90 
91 # Process all events
92 b2.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:148