Belle II Software development
produceSample_releaseValidation.py
1#!/usr/bin/env python3
2
3from ROOT import Belle2
4
5import basf2
6import logging
7
8import reconstruction as re
9
10basf2.set_random_seed(1234)
11
12path = basf2.create_path()
13
14environment = Belle2.Environment.Instance()
15environment.setNumberEventsOverride(10000)
16
17# Simulate events first (e.g. sample produced by validation/validation/EvtGenSim.py)
18path.add_module('RootInput', inputFileName='./EvtGenSim.root')
19
20# Some default modules
21path.add_module('Progress')
22
23path.add_module("Gearbox")
24path.add_module("Geometry")
25
26# Do not prune the tracks (usually all but first and last hit are removed)
27re.add_reconstruction(path, pruneTracks=False, reconstruct_cdst="rawFormat")
28
29# Set a few options of modules that we need for the studies
30for module in path.modules():
31 if 'TrackFinderMCTruthRecoTracks' in module.name():
32 module.param({"UseReassignedHits": True, 'UseNLoops': 1})
33 if 'V0Finder' in module.name():
34 module.param("Validation", True)
35
36# Add MC information for V0s
37path.add_module('MCV0Matcher', V0ColName='V0ValidationVertexs')
38
39# Add a bunch of branches that we need (on top of cdst)
40re.add_cdst_output(
41 path,
42 mc=True,
43 filename='./validationSample.root',
44 additionalBranches=[
45 'SVDClusters',
46 'PXDClusters',
47 'CDCSimHits',
48 'CDCSimHitsToCDCHits',
49 'MCRecoTracks',
50 'RecoHitInformations',
51 'RecoTracksToRecoHitInformations',
52 'MCRecoTracksToRecoHitInformations',
53 'MCRecoTracksToMCParticles',
54 'MCRecoTracksToRecoTracks',
55 'RecoTracksToMCParticles',
56 'RecoTracksToMCRecoTracks',
57 'V0ValidationVertexs',
58 'V0ValidationVertexsToMCParticles',
59 'V0sToV0ValidationVertexs',
60 'TracksToRecoTracks',
61 'TracksToMCParticles'])
62
63basf2.print_path(path)
64basf2.process(path)
65
66logging.basicConfig(level=logging.INFO)
67
68print(basf2.statistics)
static Environment & Instance()
Static method to get a reference to the Environment instance.
Definition: Environment.cc:28