13from ROOT
import Belle2
18now = datetime.datetime.now()
22 """ argument parser """
24 parser = argparse.ArgumentParser(description=__doc__)
25 parser.add_argument(
'-j',
'--json',
27 help=
'input json file',
32def import_parameters_to_payload(payload, alg, numberOfAcquiredSamples):
33 """ import parameters to payload """
35 jsonVar = param[
"parsFor" + str(alg) +
"In" + str(numberOfAcquiredSamples) +
"Samples"]
37 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples)._COMMENT = jsonVar[
"_COMMENT"]
38 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).tRange[0] = jsonVar[
"tRange"][0]
39 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).tRange[1] = jsonVar[
"tRange"][1]
40 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).rebinningFactor = jsonVar[
"rebinningFactor"]
41 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).fillSigmaN = jsonVar[
"fillSigmaN"]
42 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).limitSigma[0] = jsonVar[
"limitSigma"][0]
43 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).limitSigma[1] = jsonVar[
"limitSigma"][1]
44 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).fitRangeHalfWidth = jsonVar[
"fitRangeHalfWidth"]
45 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).removeSigmaN = jsonVar[
"removeSigmaN"]
46 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).fracThreshold = jsonVar[
"fracThreshold"]
47 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).maxGroups = jsonVar[
"maxGroups"]
48 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).expectedSignalTime[0] = jsonVar[
"expectedSignalTime"][0]
49 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).expectedSignalTime[1] = jsonVar[
"expectedSignalTime"][1]
50 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).expectedSignalTime[2] = jsonVar[
"expectedSignalTime"][2]
51 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).signalLifetime = jsonVar[
"signalLifetime"]
52 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).numberOfSignalGroups = jsonVar[
"numberOfSignalGroups"]
53 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).formSingleSignalGroup = jsonVar[
"formSingleSignalGroup"]
54 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).acceptSigmaN = jsonVar[
"acceptSigmaN"]
55 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).writeGroupInfo = jsonVar[
"writeGroupInfo"]
56 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).includeOutOfRangeClusters = jsonVar[
"includeOutOfRangeClusters"]
57 sigmas = jsonVar[
"clsSigma"]
58 for stype
in range(len(sigmas)):
60 payload.setTimeGroupingParameters(alg, numberOfAcquiredSamples).clsSigma[stype][side].assign(sigmas[stype][side])
64 ''' importer of the SVDTimeGrouping Configuration'''
70 print(
"--> json INFO:")
71 print(
" "+str(param[
"_COMMENT"]))
76 uniqueID =
"SVDTimeGroupingConfiguration_" + str(now.isoformat())
77 uniqueID +=
"_in" + param[
"uniqueID"][
"INFO"][
"source"]
78 uniqueID +=
"_usedFor" + param[
"uniqueID"][
"INFO"][
"usedFor"]
79 uniqueID +=
"_" + param[
"uniqueID"][
"INFO"][
"tag"]
80 print(
"uniqueID ->", uniqueID)
85 for alg
in [
"CoG3",
"ELS3",
"CoG6"]:
86 for numberOfAcquiredSamples
in [3, 6]:
87 import_parameters_to_payload(payload, alg, numberOfAcquiredSamples)
93main = b2.create_path()
96args = arg_parser().parse_args()
104eventinfosetter = b2.register_module(
'EventInfoSetter')
105eventinfosetter.param({
'evtNumList': [1],
'expList': 0,
'runList': 0})
106main.add_module(eventinfosetter)
110main.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.