9 """Find expected energies for ECL e+e- --> gamma gamma single crystal
10 energy calibration. Requires e+e- --> gamma gamma mc in mdst format."""
12 from prompt
import CalibrationSettings
16 settings = CalibrationSettings(
17 name=
"ecl_gg_expected",
18 expert_username=
"hearty",
20 input_data_formats=[
"mdst"],
21 input_data_names=[
"gamma_gamma_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
38 file_to_iov_gamma_gamma = input_data[
"gamma_gamma_mc"]
39 input_files_gamma_gamma = list(file_to_iov_gamma_gamma.keys())
43 algo_gamma_gamma.setOutputName(
"eclGammaGammaE_algorithm.root")
44 algo_gamma_gamma.setCellIDLo(1)
45 algo_gamma_gamma.setCellIDHi(8736)
46 algo_gamma_gamma.setMinEntries(150)
47 algo_gamma_gamma.setMaxIterations(10)
48 algo_gamma_gamma.setTRatioMin(0.45)
49 algo_gamma_gamma.setTRatioMax(0.70)
50 algo_gamma_gamma.setTRatioMinHiStat(0.70)
51 algo_gamma_gamma.setTRatioMaxHiStat(0.95)
52 algo_gamma_gamma.setUpperEdgeThresh(0.02)
53 algo_gamma_gamma.setPerformFits(
True)
54 algo_gamma_gamma.setFindExpValues(
True)
55 algo_gamma_gamma.setStoreConst(0)
58 eclGammaGamma_collector = basf2.register_module(
"eclGammaGammaECollector")
59 eclGammaGamma_collector.param(
"granularity",
"all")
60 eclGammaGamma_collector.param(
"thetaLabMinDeg", 0.)
61 eclGammaGamma_collector.param(
"thetaLabMaxDeg", 180.)
62 eclGammaGamma_collector.param(
"minPairMass", 9.)
63 eclGammaGamma_collector.param(
"mindPhi", 179.)
64 eclGammaGamma_collector.param(
"maxTime", 999.)
65 eclGammaGamma_collector.param(
"measureTrueEnergy",
True)
66 eclGammaGamma_collector.param(
"requireL1",
False)
67 cal_ecl_gamma_gamma =
Calibration(
"ecl_gg_expected",
68 collector=eclGammaGamma_collector,
69 algorithms=[algo_gamma_gamma],
70 input_files=input_files_gamma_gamma
74 gamma_gamma_pre_path = basf2.create_path()
75 cal_ecl_gamma_gamma.pre_collector_path = gamma_gamma_pre_path
79 requested_iov = kwargs.get(
"requested_iov",
None)
80 output_iov = IoV(requested_iov.exp_low, requested_iov.run_low, -1, -1)
81 for algorithm
in cal_ecl_gamma_gamma.algorithms:
82 algorithm.params = {
"apply_iov": output_iov}
86 return [cal_ecl_gamma_gamma]
Calibrate ecl crystals using gamma pair events.