Belle II Software development
DetailedParticleMatching.py
1#!/usr/bin/env python3
2# -*- coding: utf-8 -*-
3
4
11
12"""
13This script demonstrates how to filter secondary particles in the simulation
14using the specialized ECL and kinetic energy parameters.
15"""
16
17import basf2 as b2
18
19# Create the main path
20main = b2.create_path()
21
22# Generate 100 events
23main.add_module("EventInfoSetter", evtNumList=[10])
24
25# Use particle gun
26main.add_module("ParticleGun", pdgCodes=[130], nTracks=1, momentumGeneration="fixed", momentumParams=[2.0])
27
28# Load parameters and geometry
29main.add_module("Gearbox")
30main.add_module("Geometry")
31
32# Run full simulation with ParticleMatching enabled
33main.add_module("FullSim",
34 StoreAllSecondaries=False,
35 DetailedParticleMatching=True,
36 RegionRho=114.0,
37 RegionZForward=184.0,
38 RegionZBackward=-92.0,
39 KineticEnergyThreshold=0.02,
40 DistanceThreshold=40.0,
41 DoNotStoreEMParticles=True,
42 DoNotStoreNuclei=True,
43 UseSeenInECL=True
44 )
45
46# Save output
47main.add_module("RootOutput", outputFileName="FilteredSecondaries.root")
48
49# Process the path
50b2.process(main)
51
52# Print statistics
53print(b2.statistics)