ATLAS Offline Software
Loading...
Searching...
No Matches
POOLtoEI_tf Namespace Reference

Functions

 main ()
 getTransform ()
 getOutputNames (args)

Detailed Description

Run EventIndex on POOL file, produce EI file and send Events to brokers

Function Documentation

◆ getOutputNames()

POOLtoEI_tf.getOutputNames ( args)

Definition at line 118 of file POOLtoEI_tf.py.

118def getOutputNames(args):
119
120 if "eifmt" in args:
121 eifmt = args['eifmt'].value
122 else:
123 eifmt = 0 # noqa: F841
124 if "outputEIFile" in args:
125 outputEIFile = args['outputEIFile'].value[0]
126 else:
127 outputEIFile = None
128
129 # ignore eifmt
130 # keep eifmt format flag for compatibility and future usage
131 if outputEIFile is not None:
132 oname_spb = outputEIFile
133 else:
134 oname_spb = "output.ei.spb"
135
136 return oname_spb
137
138

◆ getTransform()

POOLtoEI_tf.getTransform ( )

Definition at line 103 of file POOLtoEI_tf.py.

103def getTransform():
104 executorSet = set()
105 from EventIndexProducer.EITransformUtils import addEI_Substep
106 from EventIndexProducer.EITransformUtils import addEI_arguments
107 addEI_Substep(executorSet)
108
109 trf = transform(executor=executorSet,
110 description='EventIndex transform. '
111 'Input must be a POOL file.')
112 addAthenaArguments(trf.parser)
113 addEI_arguments(trf.parser)
114 return trf
115
116
117# Build output file names
STL class.

◆ main()

POOLtoEI_tf.main ( )

Definition at line 29 of file POOLtoEI_tf.py.

29def main():
30
31 msg.info('This is {}'.format(sys.argv[0]))
32
33 trf = getTransform()
34 trf.parseCmdLineArgs(sys.argv[1:])
35
36 # update datasetname if inputfile has the form "datasetname#filename"
37 # and it has not been specified within the options.
38 args = trf.argdict
39 if "eidsname" not in args:
40 dsname = None
41 for filetype in ('POOL', 'AOD', 'ESD', 'EVNT', 'HITS', 'RDO'):
42 if 'input'+filetype+'File' in args:
43 inputFile = args['input'+filetype+'File']
44 dsname = inputFile.dataset
45 if dsname is not None:
46 obj = trfArgClasses.argString(dsname)
47 args['eidsname'] = obj
48
49 # execute transformation
50 trf.execute()
51
52 # process EI output file
53 oname_spb = getOutputNames(args)
54 msg.info('Output file: {}'.format(oname_spb))
55
56 if (oname_spb is not None and "sendtobroker" in args
57 and args["sendtobroker"].value):
58 # SPB
59 from EventIndexProducer.sendEI_SPB_Lib import eimrun
60 from EventIndexProducer.sendEI_SPB_Lib import options as eioptions
61
62 # set default options
63 import base64
64 argv2 = []
65 argv2.append("-v") # verbose
66 # add the connect string
67 if "testbrk" in args and args["testbrk"]:
68 # test
69 earg = "fWIqIhAfKiAxAEoxOyMtB0IxLCwASz0tYS8RHStnPBxcZn5/" \
70 "fUdDaGQqBwMiYy44GAozPTYQHiQ8O2BZQjUoLAcFPysqYDMJ" \
71 "cT09QRISABg1MwcXPQlYS308fCkaCzUmNhoSfDx8YhcKNydx" \
72 "Fw5qe3t/WEJoKCgHBzMsKj8HQ3MAGT8+Hx0YFiRecRBsIFAC" \
73 "ewAFWEJoKCgHFTUsPSkAQxQ/LkIiNB86DT08dXAUAh8DBA4g" \
74 "PBl9ERQ8HhoALBwbXBF9CkY+HSRjYVkKKjo5FQo8LS4vH0Mx" \
75 "OyoR"
76 else:
77 # prod
78 earg = "fWIqIhAfKiAxAEoxOyMtB0IoK3EXAyIhYS8cVXN4b0VVfGJi" \
79 "OQcKN2U+AAo1OTslEBcxOitYS30/Lj8HDCotOlghNns7LkEb" \
80 "BwYIDSE4HTsaWEJoOmwRCDQ/ICUaG2k6bFoFNT0hYhcHf31r" \
81 "R0p9Yi47Bw4mKjoHFXx5Bgo/NwobCC42YXsWfyBZF30QPUp9" \
82 "Yi47BxwgKi0REnweOT1CKyEZKjUvA392BwIWFgIeGC4mdxcH" \
83 "PBcPBjwkCWMbexlGNwgic1lLNSA8KhUDKSs+Fw18Oz05EQ=="
84 eargs = ''.join(chr(c ^ ord(k)) for c, k in
85 zip(base64.b64decode(earg),
86 cycle(trf.name))).split(",")
87 argv2.extend(eargs)
88 argv2.append(oname_spb)
89 eiopts = eioptions(argv2)
90
91 # transfer file
92 eimrun(msg, eiopts)
93
94 trf.generateReport()
95
96 msg.info("{} stopped at {}, trf exit code {:d}".format(sys.argv[0],
97 time.asctime(),
98 trf.exitCode))
99 sys.exit(trf.exitCode)
100
101
102# Get the base transform with all arguments added
double cycle(double a, double b)
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:177
int main()
Definition hello.cxx:18