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