16 from ROOT
import Belle2
21 now = datetime.datetime.now()
25 """ argument parser """
27 parser = argparse.ArgumentParser(description=__doc__)
28 parser.add_argument(
'-j',
'--json',
30 help=
'input json file',
35 def import_parameters_to_payload(payload, alg, numberOfAcquiredSamples):
36 """ import parameters to payload """
38 jsonVar = param[
"parsFor" + str(alg) +
"In" + str(numberOfAcquiredSamples) +
"Samples"]
40 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples)._COMMENT = jsonVar[
"_COMMENT"]
41 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).tRange[0] = jsonVar[
"tRange"][0]
42 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).tRange[1] = jsonVar[
"tRange"][1]
43 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).rebinningFactor = jsonVar[
"rebinningFactor"]
44 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).fillSigmaN = jsonVar[
"fillSigmaN"]
45 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).limitSigma[0] = jsonVar[
"limitSigma"][0]
46 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).limitSigma[1] = jsonVar[
"limitSigma"][1]
47 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).fitRangeHalfWidth = jsonVar[
"fitRangeHalfWidth"]
48 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).removeSigmaN = jsonVar[
"removeSigmaN"]
49 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).fracThreshold = jsonVar[
"fracThreshold"]
50 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).maxGroups = jsonVar[
"maxGroups"]
51 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).expectedSignalTime[0] = jsonVar[
"expectedSignalTime"][0]
52 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).expectedSignalTime[1] = jsonVar[
"expectedSignalTime"][1]
53 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).expectedSignalTime[2] = jsonVar[
"expectedSignalTime"][2]
54 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).signalLifetime = jsonVar[
"signalLifetime"]
55 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).numberOfSignalGroups = jsonVar[
"numberOfSignalGroups"]
56 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).formSingleSignalGroup = jsonVar[
"formSingleSignalGroup"]
57 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).acceptSigmaN = jsonVar[
"acceptSigmaN"]
58 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).writeGroupInfo = jsonVar[
"writeGroupInfo"]
59 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).includeOutOfRangeClusters = jsonVar[
"includeOutOfRangeClusters"]
60 sigmas = jsonVar[
"clsSigma"]
61 for stype
in range(len(sigmas)):
63 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).clsSigma[stype][side].assign(sigmas[stype][side])
67 ''' importer of the SVDTimeGrouping Configuration'''
73 print(
"--> json INFO:")
74 print(
" "+str(param[
"_COMMENT"]))
79 uniqueID =
"SVDTimeGroupingConfiguration_" + str(now.isoformat())
80 uniqueID +=
"_in" + param[
"uniqueID"][
"INFO"][
"source"]
81 uniqueID +=
"_usedFor" + param[
"uniqueID"][
"INFO"][
"usedFor"]
82 uniqueID +=
"_" + param[
"uniqueID"][
"INFO"][
"tag"]
83 print(
"uniqueID ->", uniqueID)
88 for alg
in [
"CoG3",
"ELS3",
"CoG6"]:
89 for numberOfAcquiredSamples
in [3, 6]:
90 import_parameters_to_payload(payload, alg, numberOfAcquiredSamples)
96 main = b2.create_path()
99 args = arg_parser().parse_args()
107 eventinfosetter = b2.register_module(
'EventInfoSetter')
108 eventinfosetter.param({
'evtNumList': [1],
'expList': 0,
'runList': 0})
109 main.add_module(eventinfosetter)
113 main.add_module(
'Progress')
static IntervalOfValidity always()
Function that returns an interval of validity that is always valid, c.f.
This class store the reconstruction configuration of SVDTimeGrouping module.
static Database & Instance()
Instance of a singleton Database.