Belle II Software  release-05-01-25
runCDCdEdxValidation.py
1 
2 # Example script to run dEdx validation module for bhabha or radbhabha or hadron skims
3 # configure distination of file and set variable --> var
4 # Commited on : Feb 21, 2019 >> Jitendra Kumar
5 
6 
7 import basf2
8 import os
9 import sys
10 import ROOT
11 from ROOT import Belle2
12 from modularAnalysis import *
13 
14 reset_database()
15 use_database_chain()
16 use_central_database("data_reprocessing_preproc8b")
17 # use_local_database("localDB/database.txt", "localDB")
18 
19 ROOT.gROOT.SetBatch(True)
20 
21 
22 var = 'bhabha' # bhabha or radbhabha or hadron
23 
24 if var == 'bhabha':
25  input_files = [os.path.abspath(
26  '/mnt/data/BelleIICalibration/data/preprod8b/electron/bhabha/cdst/skinny_cdst.preprod8b.*18*.root')]
27 elif var == 'radbhabha':
28  input_files = [os.path.abspath(
29  '/mnt/data/BelleIICalibration/data/preprod8b/electron/radbhabha/cdst/skinny_cdst.preprod8b.*18*.root')]
30 elif var == 'hadron':
31  input_files = [os.path.abspath('/mnt/data/BelleIICalibration/data/preprod8b/hadron/cdst/skinny_cdst.preprod8b.*18*.root')]
32 else:
33  print("Only (rad)bhabha or hadron input files are compatible")
34  exit()
35 
36 mypath = basf2.Path() # create your own path (call it what you like)
37 
38 
39 moduleA = register_module("RootInput")
40 moduleA.param("inputFileNames", input_files)
41 mypath.add_module(moduleA)
42 
43 
44 moduleB = register_module("CDCDedxValidation")
45 moduleB.param("fnRuns", 50)
46 if var == 'bhabha':
47  moduleB.param("SampleType", "bhabha")
48  moduleB.param("outputFileName", "bhabha_outfile.root")
49 elif var == 'radbhabha':
50  moduleB.param("SampleType", "radbhabha")
51  moduleB.param("outputFileName", "radbhabha_outfile.root")
52 elif var == 'hadron':
53  moduleB.param("SampleType", "hadron")
54  moduleB.param("outputFileName", "hadron_outfile.root")
55 else:
56  print("Only (rad)bhabha or hadron input files are compatible")
57  exit()
58 
59 mypath.add_module(moduleB)
60 
61 basf2.process(mypath)
62 
63 print(basf2.statistics)
basf2.process
def process(path, max_event=0)
Definition: __init__.py:25