Belle II Software  release-05-02-19
run_ee5x5_algorithm_dPhi_data.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 # -----------------------------------------------------------
5 # BASF2 (Belle Analysis Framework 2)
6 # Copyright(C) 2018 Belle II Collaboration
7 #
8 # Author: The Belle II Collaboration
9 # Contributors: Christopher Hearty
10 #
11 # This software is provided "as is" without any warranty.
12 # -----------------------------------------------------------
13 
14 import os
15 import sys
16 import glob
17 import ROOT
18 from ROOT import Belle2
19 
20 # Usage: basf2 run_ee5x5_algorithm_dPhi_data.py "inputfiles*.root"
21 # or: bsub -q s -o logfile.txt 'basf2 run_ee5x5_algorithm_dPhi_data.py "inputfiles*.root"'
22 
23 # Run just the algorithm part of the eclee5x5 calibration, which calibrates the single crystal
24 # energy response using Bhabha events. Runs on the output produced by the collector stage.
25 
26 # This scripts sets parameters to find payload ECLeedPhiData using data. Other scripts
27 # are available to obtain payloads "ECLCrystalEnergy5x5", "ECLExpee5x5E", or "ECLeedPhiMC", or to
28 # just merge the input histograms and write them to the specified output file.
29 
30 # algo.setStoreConst = True: store the specified payload, if calculation is successful.
31 # algo.setStoreConst = False: do not write to the database
32 
33 # specified output file includes diagnostic histograms.
34 
36 fileNames = ['eclee5x5CollectorOutput.root']
37 narg = len(sys.argv)
38 if(narg == 2):
39  fileNames = glob.glob(sys.argv[1])
40 print("input fileNames = ", fileNames)
41 algo.setInputFileNames(fileNames)
42 algo.setOutputName("algorithmOut/eclee5x5_algorithm_dPhi_data.root")
43 algo.setMinEntries(15)
44 algo.setPayloadName("ECLeedPhiData")
45 algo.setStoreConst(True)
46 
47 
48 # Run algorithm after merging all input files, as opposed to one run at a time
49 alg_result = algo.execute()
50 print("result of eclee5x5Algorithm was", alg_result)
51 
52 # Commits a successful list of dbobjects to localdb/
53 algo.commit()
Belle2::ECL::eclee5x5Algorithm
Calibrate ecl crystals using Bhabha events.
Definition: eclee5x5Algorithm.h:40