Belle II Software development
ECLChargedPid.py
1#!/usr/bin/env python3
2
3
10
11"""
12<header>
13 <input>PartGunChargedStableGenSim.root</input>
14 <contact>Marcel Hohmann, mhohmann@student.unimelb.edu.au</contact>
15 <description> This steering script fully reconstructs particle gun events for a set of charged stable particles,
16and dumps ECL PID validation info in an ntuple and a set of histograms (one file for each pdgId).</description>
17</header>
18"""
19
20import basf2
21from reconstruction import add_reconstruction
22from ROOT import Belle2
23
24# Pdg code of the charged stable particles & antiparticles.
25chargedStableList = []
26for idx in range(len(Belle2.Const.chargedStableSet)):
27 particle = Belle2.Const.chargedStableSet.at(idx)
28 # Skip deuteron for now...
29 if particle == Belle2.Const.deuteron:
30 continue
31 pdgId = particle.getPDGCode()
32 chargedStableList.extend([pdgId, -pdgId])
33
34
35# Merge particles and antiparticles in the same plots for these hypotheses.
36mergeChargeOfPdgIds = [
37 Belle2.Const.pion.getPDGCode(),
38 Belle2.Const.kaon.getPDGCode(),
39 Belle2.Const.proton.getPDGCode()
40]
41
42basf2.set_random_seed(1337)
43
44# Create path.
45main = basf2.create_path()
46
47# Read input.
48inputFileName = "../PartGunChargedStableGenSim.root"
49main.add_module("RootInput", inputFileName=inputFileName)
50
51# Load parameters.
52main.add_module("Gearbox")
53# Create geometry.
54main.add_module("Geometry")
55
56# Reconstruct events.
57add_reconstruction(main)
58
59# Dump validation plots.
60main.add_module(
61 "ECLChargedPIDDataAnalysisValidation",
62 outputFileName="ECLChargedPid",
63 inputPdgIdList=chargedStableList,
64 mergeChargeOfPdgIds=mergeChargeOfPdgIds)
65
66# Show progress of processing.
67main.add_module("ProgressBar")
68
69basf2.print_path(main)
70
71main.add_module('Progress')
72basf2.process(main)