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