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
42# Create path.
43main = basf2.create_path()
44
45# Read input.
46inputFileName = "../PartGunChargedStableGenSim.root"
47main.add_module("RootInput", inputFileName=inputFileName)
48
49# Load parameters.
50main.add_module("Gearbox")
51# Create geometry.
52main.add_module("Geometry")
53
54# Reconstruct events.
55add_reconstruction(main)
56
57# Dump validation plots.
58main.add_module(
59 "ECLChargedPIDDataAnalysisValidation",
60 outputFileName="ECLChargedPid",
61 inputPdgIdList=chargedStableList,
62 mergeChargeOfPdgIds=mergeChargeOfPdgIds)
63
64# Show progress of processing.
65main.add_module("ProgressBar")
66
67basf2.print_path(main)
68
69main.add_module('Progress')
70basf2.process(main)
71print(basf2.statistics)