Belle II Software development
run_eclMuMuE_algorithm.py
1#!/usr/bin/env python3
2
3
10
11import sys
12import glob
13from ROOT import Belle2
14
15# Usage: basf2 run_eclMuMuE_algorithm.py
16# or bsub -q s -o logfile.txt 'basf2 run_eclMuMuE_algorithm.py "inputfiles*.root"'
17
18# Run just the algorithm part of the eclMuMuE calibration, which calibrates the single crystal
19# energy response using muon pairs. Runs on the output produced by run_eclMuMuE_collector.py.
20# Standard usage: algo.performFits = True; performs a Novosibirsk fit on specified crystals to
21# extract the calibration constant.
22# algo.performFits = False just copies the input histograms into the output file for debugging.
23
24# algo.storeConst = 0 fills database payloads ECLCrystalEnergyMuMu or ECLExpMuMuE (if findExpValues=True)
25# for all crystals with successful fits and writes to localdb
26# algo.storeConst = 1 fills writes the payloads only if every crystal in specified range is successful
27# algo.storeConst = -1 do not write to the database
28
29# Specified output file contains many diagnostic histograms.
30
32fileNames = ['eclMuMuECollectorOutput.root']
33narg = len(sys.argv)
34if(narg == 2):
35 fileNames = glob.glob(sys.argv[1])
36print("input fileNames = ", fileNames)
37algo.setInputFileNames(fileNames)
38# barrel is [1153,7776]
39algo.cellIDLo = 1
40algo.cellIDHi = 8736
41algo.minEntries = 150
42algo.maxIterations = 10
43algo.tRatioMin = 0.2
44algo.tRatioMax = 0.25
45algo.performFits = True
46algo.findExpValues = False
47algo.storeConst = 0
48
49# Run algorithm after merging all input files, as opposed to one run at a time
50alg_result = algo.execute()
51print("result of eclMuMuEAlgorithm was", alg_result)
52
53# Commits a successful list of dbobjects to localdb/
54algo.commit()
Calibrate ecl crystals using muon pair events.