9 """Find expected energies for ECL e+e- --> gamma gamma single crystal
10 energy calibration. Requires e+e- --> mu mu mc in mdst format with
11 ECLDigits as additional branch."""
13 from prompt
import CalibrationSettings
17 settings = CalibrationSettings(name=
"ecl_mu_mu_expected",
18 expert_username=
"hearty",
20 input_data_formats=[
"mdst"],
21 input_data_names=[
"mu_mu_mc"],
28 def get_calibrations(input_data, **kwargs):
30 from ROOT
import Belle2
31 from caf.utils
import IoV
32 from caf.framework
import Calibration
36 file_to_iov_mu_mu = input_data[
"mu_mu_mc"]
37 input_files_mu_mu = list(file_to_iov_mu_mu.keys())
41 algo_mu_mu.cellIDLo = 1
42 algo_mu_mu.cellIDHi = 8736
43 algo_mu_mu.minEntries = 150
44 algo_mu_mu.nToRebin = 1000
45 algo_mu_mu.tRatioMin = 0.05
46 algo_mu_mu.tRatioMax = 0.4
47 algo_mu_mu.lowerEdgeThresh = 0.10
48 algo_mu_mu.performFits =
True
49 algo_mu_mu.findExpValues =
True
50 algo_mu_mu.storeConst = 0
53 eclmumu_collector = basf2.register_module(
"eclMuMuECollector")
54 eclmumu_collector.param(
"granularity",
"all")
55 eclmumu_collector.param(
"minPairMass", 9.0)
56 eclmumu_collector.param(
"minTrackLength", 30.)
57 eclmumu_collector.param(
"MaxNeighbourE", 0.010)
58 eclmumu_collector.param(
"thetaLabMinDeg", 17.)
59 eclmumu_collector.param(
"thetaLabMaxDeg", 150.)
60 eclmumu_collector.param(
"measureTrueEnergy",
True)
61 eclmumu_collector.param(
"requireL1",
False)
63 name=
"ecl_mu_mu_expected",
64 collector=eclmumu_collector,
65 algorithms=algo_mu_mu,
66 input_files=input_files_mu_mu)
69 ext_path = basf2.create_path()
70 ext_path.add_module(
"Gearbox")
71 ext_path.add_module(
"Geometry")
72 ext_path.add_module(
"Ext", pdgCodes=[13])
73 cal_ecl_mu_mu.pre_collector_path = ext_path
77 requested_iov = kwargs.get(
"requested_iov",
None)
78 output_iov = IoV(requested_iov.exp_low, requested_iov.run_low, -1, -1)
79 for algorithm
in cal_ecl_mu_mu.algorithms:
80 algorithm.params = {
"apply_iov": output_iov}
84 return [cal_ecl_mu_mu]
Calibrate ecl crystals using muon pair events.