13 Test for checking if a generated bremsstrahlung cluster is assigned correctly
14 to the primary ECL cluster generated by an electron.
15 The test is quite delicate: with the current settings the check fails 10% of the times.
19 from ROOT
import Belle2
20 from ROOT
import TVector3
25 b2.set_random_seed(42)
30 Module which checks if a generated bremsstrahlung cluster is assigned correctly
31 to the primary ECL cluster generated by an electron.
36 Load the one track from the data store and check if the relation to the brem cluster
37 can been set correctly.
42 for cluster
in clusters:
44 if cluster.isTrack()
and cluster.hasHypothesis(Belle2.ECLCluster.EHypothesisBit.c_nPhotons):
46 bremCluster = cluster.getRelated(
"ECLClusters")
49 if (eventMetaData.getEvent()
in bad_events):
52 assert(
not bremCluster)
60 Module used to define the position and direction of the 'virtual' bremsstrahlung photon
61 generated by the particle gun
62 Not used at the moment (only for fit location)
70 for recoTrack
in reco_tracks:
72 print(
"!!!!!!!!!!!!!!!!!!!!!!!!!Position!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
73 hit = recoTrack.getMeasuredStateOnPlaneClosestTo(TVector3(10, 5, -2))
74 hit_pos = hit.getPos()
78 print(hit.getMom().Phi())
79 print(hit.getMom().Theta())
83 main = b2.create_path()
86 main.add_module(
'EventInfoSetter', evtNumList=[4])
89 main.add_module(
'ParticleGun',
92 momentumGeneration=
'fixed',
94 thetaGeneration=
'fixed',
96 phiGeneration=
'fixed',
101 main.add_module(
'ParticleGun',
104 momentumGeneration=
'fixed',
106 thetaGeneration=
'fixed',
107 thetaParams=1.6614126908216453 * 180 / 3.1415,
108 phiGeneration=
'fixed',
109 phiParams=0.6210485691762964 * 180 / 3.1415,
110 xVertexParams=[9.27695426703659],
111 yVertexParams=[5.949838410158973],
112 zVertexParams=[-0.9875516764256207],
A (simplified) python wrapper for StoreArray.
a (simplified) python wrapper for StoreObjPtr.
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)