15 from ROOT
import gROOT, Belle2
19 gROOT.ProcessLine(
"gErrorIgnoreLevel = 4000;")
22 Run the Track Segment Finder and save a table of true left/right for each hit pattern.
23 This table can be used to create the left/right LUT (see createTSLUT.py),
24 or to evaluate it (see evaluateTSLUT.py).
36 bkgdir =
'/remote/neurobelle/bkg/'
37 particlegun_params = {
38 'pdgCodes': [-13, 13],
40 'momentumGeneration':
'inversePt',
41 'momentumParams': [0.27, 7.2],
42 'thetaGeneration':
'uniformCos',
43 'thetaParams': [35, 123],
44 'phiGeneration':
'uniform',
45 'phiParams': [0, 360],
46 'vertexGeneration':
'fixed',
47 'xVertexParams': [0.],
48 'yVertexParams': [0.],
49 'zVertexParams': [0.]}
52 innerFilename =
'innerTrueLRTable_Bkg%.1f_%d.dat' % (backgroundLevel, seed)
53 outerFilename =
'outerTrueLRTable_Bkg%.1f_%d.dat' % (backgroundLevel, seed)
54 innerrecoFilename =
'innerRecoLRTable_Bkg%.1f_%d.dat' % (backgroundLevel, seed)
55 outerrecoFilename =
'outerRecoLRTable_Bkg%.1f_%d.dat' % (backgroundLevel, seed)
62 basf2.set_random_seed(seed)
64 basf2.set_log_level(basf2.LogLevel.ERROR)
66 main = basf2.create_path()
68 main.add_module(
'EventInfoSetter', evtNumList=evtnum)
69 main.add_module(
'Progress')
70 main.add_module(
'Gearbox')
71 main.add_module(
'Geometry')
73 particlegun = basf2.register_module(
'ParticleGun')
74 particlegun.param(particlegun_params)
75 main.add_module(particlegun)
78 if backgroundLevel > 0:
79 bkgmixer = basf2.register_module(
'BeamBkgMixer')
80 bkgfiles = glob.glob(os.path.join(bkgdir,
'*[!(PXD)(ECL)]??.root'))
81 bkgmixer.param(
'backgroundFiles', bkgfiles)
82 bkgmixer.param(
'components', [
'CDC'])
83 bkgmixer.param(
'overallScaleFactor', backgroundLevel)
84 main.add_module(bkgmixer)
85 cdcdigitizer = basf2.register_module(
'CDCDigitizer')
87 cdcdigitizer.param(
'TrigTimeJitter', 32.)
88 main.add_module(cdcdigitizer)
90 tsf = basf2.register_module(
'CDCTriggerTSF')
94 'ClockSimulation': clock,
95 'makeTrueLRTable':
True,
96 'makeRecoLRTable':
True,
97 'innerTrueLRTableFilename': innerFilename,
98 'outerTrueLRTableFilename': outerFilename,
99 'innerRecoLRTableFilename': innerrecoFilename,
100 'outerRecoLRTableFilename': outerrecoFilename}
101 tsf.param(tsf_params)
103 tsf.param(
'CDCHitCollectionName',
'CDCHits4Trg')
110 print(basf2.statistics)
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...
def add_reconstruction(path, components=None, pruneTracks=True, add_trigger_calculation=True, skipGeometryAdding=False, trackFitHypotheses=None, addClusterExpertModules=True, use_second_cdc_hits=False, add_muid_hits=False, reconstruct_cdst=None, event_abort=default_event_abort, use_random_numbers_for_hlt_prescale=True, pxd_filtering_offline=False, append_full_grid_cdc_eventt0=False, legacy_ecl_charged_pid=False, emulate_HLT=False)
def add_simulation(path, components=None, bkgfiles=None, bkgOverlay=True, forceSetPXDDataReduction=False, usePXDDataReduction=True, cleanupPXDDataReduction=True, generate_2nd_cdc_hits=False, simulateT0jitter=True, isCosmics=False, FilterEvents=False, usePXDGatedMode=False, skipExperimentCheckForBG=False, save_slow_pions_in_mc=False)