14from ROOT
import gROOT, Belle2
18gROOT.ProcessLine(
"gErrorIgnoreLevel = 4000;")
21Run the Track Segment Finder and save a table of true left/right for each hit pattern.
22This table can be used to create the left/right LUT (see createTSLUT.py),
23or to evaluate it (see evaluateTSLUT.py).
35bkgdir =
'/remote/neurobelle/bkg/'
37 'pdgCodes': [-13, 13],
39 'momentumGeneration':
'inversePt',
40 'momentumParams': [0.27, 7.2],
41 'thetaGeneration':
'uniformCos',
42 'thetaParams': [35, 123],
43 'phiGeneration':
'uniform',
44 'phiParams': [0, 360],
45 'vertexGeneration':
'fixed',
46 'xVertexParams': [0.],
47 'yVertexParams': [0.],
48 'zVertexParams': [0.]}
51innerFilename = f
'innerTrueLRTable_Bkg{backgroundLevel:.1f}_{int(seed)}.dat'
52outerFilename = f
'outerTrueLRTable_Bkg{backgroundLevel:.1f}_{int(seed)}.dat'
53innerrecoFilename = f
'innerRecoLRTable_Bkg{backgroundLevel:.1f}_{int(seed)}.dat'
54outerrecoFilename = f
'outerRecoLRTable_Bkg{backgroundLevel:.1f}_{int(seed)}.dat'
61basf2.set_random_seed(seed)
63basf2.set_log_level(basf2.LogLevel.ERROR)
65main = basf2.create_path()
67main.add_module(
'EventInfoSetter', evtNumList=evtnum)
68main.add_module(
'Progress')
69main.add_module(
'Gearbox')
70main.add_module(
'Geometry')
72particlegun = basf2.register_module(
'ParticleGun')
73particlegun.param(particlegun_params)
74main.add_module(particlegun)
77if backgroundLevel > 0:
78 bkgmixer = basf2.register_module(
'BeamBkgMixer')
79 bkgfiles = glob.glob(os.path.join(bkgdir,
'*[!(PXD)(ECL)]??.root'))
80 bkgmixer.param(
'backgroundFiles', bkgfiles)
81 bkgmixer.param(
'components', [
'CDC'])
82 bkgmixer.param(
'overallScaleFactor', backgroundLevel)
83 main.add_module(bkgmixer)
84cdcdigitizer = basf2.register_module(
'CDCDigitizer')
86 cdcdigitizer.param(
'TrigTimeJitter', 32.)
87main.add_module(cdcdigitizer)
89tsf = basf2.register_module(
'CDCTriggerTSF')
93 'ClockSimulation': clock,
94 'makeTrueLRTable':
True,
95 'makeRecoLRTable':
True,
96 'innerTrueLRTableFilename': innerFilename,
97 'outerTrueLRTableFilename': outerFilename,
98 'innerRecoLRTableFilename': innerrecoFilename,
99 'outerRecoLRTableFilename': outerrecoFilename}
102 tsf.param(
'CDCHitCollectionName',
'CDCHits4Trg')
109print(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, create_intercepts_for_pxd_ckf=False, append_full_grid_cdc_eventt0=True, legacy_ecl_charged_pid=False, emulate_HLT=False, skip_full_grid_cdc_eventt0_if_svd_time_present=True)
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)