5 DAOD_FILE =
"data18_13TeV:DAOD_MUON0.14316152._000001.pool.root.1"
6 RAW_FILE =
"data15_13TeV:data15_13TeV.00284285.physics_Main.daq.RAW"
7 RDO_FILE =
"mc16_13TeV:mc16_13TeV.361108.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Ztautau.recon.RDO.e3601_s3126_r9546"
8 HAMMERCLOUD_FILE =
"mc15_13TeV.423202.Pythia8B_A14_CTEQ6L1_Jpsie3e13.merge.AOD.e3869_s2608_s2183_r6630_r6264"
9 PROJECTS = [
"AthAnalysis",
"AthDerivation",
"AthSimulation",
"Athena",
"AnalysisBase"]
12 "ROOT" :
"root://lcg-lrz-rootd.grid.lrz.de:1094/pnfs/lrz-muenchen.de/data/atlas/dq2/atlaslocalgroupdisk/rucio/data18_13TeV/e6/c2/DAOD_MUON0.14316152._000001.pool.root.1",
13 "DAVS" :
"davs://lcg-lrz-http.grid.lrz.de:443/pnfs/lrz-muenchen.de/data/atlas/dq2/atlaslocalgroupdisk/rucio/data18_13TeV/e6/c2/DAOD_MUON0.14316152._000001.pool.root.1",
14 "HTTPS" :
"https://lcg-lrz-http.grid.lrz.de:443/pnfs/lrz-muenchen.de/data/atlas/dq2/atlaslocalgroupdisk/rucio/data18_13TeV/e6/c2/DAOD_MUON0.14316152._000001.pool.root.1",
19 {
"ROOT" :
"root://lcg-lrz-rootd.grid.lrz.de:1094/pnfs/lrz-muenchen.de/data/atlas/dq2/atlasdatadisk/rucio/mc16_13TeV/90/96/RDO.11373415._000001.pool.root.1"},
20 {
"DAVS" :
"davs://lcg-lrz-http.grid.lrz.de:443/pnfs/lrz-muenchen.de/data/atlas/dq2/atlasdatadisk/rucio/mc16_13TeV/90/96/RDO.11373415._000001.pool.root.1" },
21 {
"HTTPS" :
"https://lcg-lrz-http.grid.lrz.de:443/pnfs/lrz-muenchen.de/data/atlas/dq2/atlasdatadisk/rucio/mc16_13TeV/90/96/RDO.11373415._000001.pool.root.1" },
24 {
"ROOT" :
"root://lcg-lrz-rootd.grid.lrz.de:1094/pnfs/lrz-muenchen.de/data/atlas/dq2/atlasdatadisk/rucio/data15_13TeV/71/42/data15_13TeV.00284285.physics_Main.daq.RAW._lb0856._SFO-1._0003.data" },
25 {
"DAVS" :
"davs://lcg-lrz-http.grid.lrz.de:443/pnfs/lrz-muenchen.de/data/atlas/dq2/atlasdatadisk/rucio/data15_13TeV/71/42/data15_13TeV.00284285.physics_Main.daq.RAW._lb0856._SFO-1._0003.data" },
26 {
"HTTPS" :
"https://lcg-lrz-http.grid.lrz.de:443/pnfs/lrz-muenchen.de/data/atlas/dq2/atlasdatadisk/rucio/data15_13TeV/71/42/data15_13TeV.00284285.physics_Main.daq.RAW._lb0856._SFO-1._0003.data" },
33 "root://lcg-lrz-rootd.grid.lrz.de:1094/pnfs/lrz-muenchen.de/data/atlas/dq2/atlasdatadisk/rucio/mc15_13TeV/ed/68/AOD.05536542._000001.pool.root.1",
34 "root://grid-dc.rzg.mpg.de:1094//pnfs/rzg.mpg.de/data/atlas/dq2/atlasdatadisk/rucio/mc15_13TeV/ed/68/AOD.05536542._000001.pool.root.1",
35 "root://dcache-atlas-xrootd.desy.de:1094//pnfs/desy.de/atlas/dq2/atlasdatadisk/rucio/mc15_13TeV/ed/68/AOD.05536542._000001.pool.root.1",
36 "root://lcg-se0.ifh.de:1094//pnfs/ifh.de/data/atlas/atlasdatadisk/rucio/mc15_13TeV/ed/68/AOD.05536542._000001.pool.root.1",
37 "root://atlasxrootd-kit.gridka.de:1094//pnfs/gridka.de/atlas/disk-only/atlasdatadisk/rucio/mc15_13TeV/ed/68/AOD.05536542._000001.pool.root.1",
38 "root://sedoor1.bfg.uni-freiburg.de:1094//pnfs/bfg.uni-freiburg.de/data/atlasdatadisk/rucio/mc15_13TeV/ed/68/AOD.05536542._000001.pool.root.1",
39 "root://se-goegrid.gwdg.de:1094//pnfs/gwdg.de/data/atlas/atlasdatadisk/rucio/mc15_13TeV/ed/68/AOD.05536542._000001.pool.root.1",
40 "root://grid-se.physik.uni-wuppertal.de:1094//pnfs/physik.uni-wuppertal.de/data/atlas/atlasdatadisk/rucio/mc15_13TeV/ed/68/AOD.05536542._000001.pool.root.1",
45 "davs://lcg-lrz-http.grid.lrz.de:443/pnfs/lrz-muenchen.de/data/atlas/dq2/atlasdatadisk/rucio/mc15_13TeV/ed/68/AOD.05536542._000001.pool.root.1",
46 "davs://grid-dav.rzg.mpg.de:2880/atlas/dq2/atlasdatadisk/rucio/mc15_13TeV/ed/68/AOD.05536542._000001.pool.root.1",
47 "davs://dcache-atlas-webdav.desy.de:2880/dq2/atlasdatadisk/rucio/mc15_13TeV/ed/68/AOD.05536542._000001.pool.root.1",
48 "davs://lcg-se0.ifh.de:2880/pnfs/ifh.de/data/atlas/atlasdatadisk/rucio/mc15_13TeV/ed/68/AOD.05536542._000001.pool.root.1",
49 "davs://atlaswebdav-kit.gridka.de:2880/pnfs/gridka.de/atlas/disk-only/atlasdatadisk/rucio/mc15_13TeV/ed/68/AOD.05536542._000001.pool.root.1",
50 "davs://webdav.bfg.uni-freiburg.de:2880/pnfs/bfg.uni-freiburg.de/data/atlasdatadisk/rucio/mc15_13TeV/ed/68/AOD.05536542._000001.pool.root.1",
51 "davs://se-goegrid.gwdg.de:2880/pnfs/gwdg.de/data/atlas/atlasdatadisk/rucio/mc15_13TeV/ed/68/AOD.05536542._000001.pool.root.1",
52 "davs://grid-se.physik.uni-wuppertal.de:2881/pnfs/physik.uni-wuppertal.de/data/atlas/atlasdatadisk/rucio/mc15_13TeV/ed/68/AOD.05536542._000001.pool.root.1",
57 "https://lcg-lrz-http.grid.lrz.de:443/pnfs/lrz-muenchen.de/data/atlas/dq2/atlasdatadisk/rucio/mc15_13TeV/ed/68/AOD.05536542._000001.pool.root.1",
58 "https://grid-dav.rzg.mpg.de:2880/atlas/dq2/atlasdatadisk/rucio/mc15_13TeV/ed/68/AOD.05536542._000001.pool.root.1",
59 "https://dcache-atlas-webdav.desy.de:2880/dq2/atlasdatadisk/rucio/mc15_13TeV/ed/68/AOD.05536542._000001.pool.root.1",
60 "https://lcg-se0.ifh.de:2880/pnfs/ifh.de/data/atlas/atlasdatadisk/rucio/mc15_13TeV/ed/68/AOD.05536542._000001.pool.root.1",
61 "https://atlaswebdav-kit.gridka.de:2880/pnfs/gridka.de/atlas/disk-only/atlasdatadisk/rucio/mc15_13TeV/ed/68/AOD.05536542._000001.pool.root.1",
62 "https://webdav.bfg.uni-freiburg.de:2880/pnfs/bfg.uni-freiburg.de/data/atlasdatadisk/rucio/mc15_13TeV/ed/68/AOD.05536542._000001.pool.root.1",
63 "https://se-goegrid.gwdg.de:2880/pnfs/gwdg.de/data/atlas/atlasdatadisk/rucio/mc15_13TeV/ed/68/AOD.05536542._000001.pool.root.1",
64 "https://grid-se.physik.uni-wuppertal.de:2881/pnfs/physik.uni-wuppertal.de/data/atlas/atlasdatadisk/rucio/mc15_13TeV/ed/68/AOD.05536542._000001.pool.root.1",
71 if "Athena" in opts.athena_project:
73 for item
in RECO_TF_TURLS[
"RDO"]:
74 name = os.path.join(
"test",
"test_directioart_athena_recotf_with_rdo_{}.sh".
format(item.keys()[0].lower()))
76 outfile =
open(name,
'w')
78 outstring =
"""#!/bin/bash\n
79 # art-description: DirectIOART Athena Reco_tf.py inputFile:RDO protocol={protocol}
81 # art-output: *.pool.root
82 # art-include: 21.0/Athena
83 # art-include: main/Athena\n
85 Reco_tf.py --AMI q221 --inputRDOFile {turl} --outputRDO_TRIGFile art.pool.root\n
86 echo \"art-result: $? DirectIOART_Athena_RecoTF_inputRDO_protocol_{protocol}\"""".
format(turl=item.values()[0], protocol=item.keys()[0])
87 outfile.write(outstring)
89 os.system(
"chmod +x " + name)
92 name = os.path.join(
"test",
"test_directioart_athenamp_recotf_with_rdo_{}.sh".
format(item.keys()[0].lower()))
94 outfile =
open(name,
'w')
96 outstring =
"""#!/bin/bash\n
97 # art-description: DirectIOART AthenaMP Reco_tf.py inputFile:RDO protocol={protocol}
99 # art-output: *.pool.root
100 # art-include: 21.0/Athena
101 # art-include: main/Athena\n
103 export ATHENA_CORE_NUMBER=2
104 Reco_tf.py --AMI q221 --multiprocess --inputRDOFile {turl} --outputRDO_TRIGFile art.pool.root\n
105 echo \"art-result: $? DirectIOART_AthenaMP_RecoTF_inputRDO_protocol_{protocol}\"""".
format(turl=item.values()[0], protocol=item.keys()[0])
106 outfile.write(outstring)
108 os.system(
"chmod +x " + name)
111 for item
in RECO_TF_TURLS[
"RAW"]:
112 name = os.path.join(
"test",
"test_directioart_athena_recotf_with_raw_{}.sh".
format(item.keys()[0].lower()))
114 outfile =
open(name,
'w')
116 outstring =
"""#!/bin/bash\n
117 # art-description: DirectIOART Athena Reco_tf.py inputFile:RAW protocol={protocol}
119 # art-output: *.pool.root
120 # art-include: 21.0/Athena
121 # art-include: main/Athena\n
123 Reco_tf.py --AMI q431 --inputBSFile {turl} --outputESDFile art.pool.root\n
124 echo \"art-result: $? DirectIOART_Athena_RecoTF_inputBS_protocol_{protocol}\"""".
format(turl=item.values()[0], protocol=item.keys()[0])
125 outfile.write(outstring)
127 os.system(
"chmod +x " + name)
130 name = os.path.join(
"test",
"test_directioart_athenamp_recotf_with_raw_{}.sh".
format(item.keys()[0].lower()))
132 outfile =
open(name,
'w')
134 outstring =
"""#!/bin/bash\n
135 # art-description: DirectIOART AthenaMP Reco_tf.py inputFile:RAW protocol={protocol}
137 # art-output: *.pool.root
138 # art-include: 21.0/Athena
139 # art-include: main/Athena\n
141 export ATHENA_CORE_NUMBER=2
142 Reco_tf.py --AMI q431 --multiprocess --inputBSFile {turl} --outputESDFile art.pool.root\n
143 echo \"art-result: $? DirectIOART_AthenaMP_RecoTF_inputBS_protocol_{protocol}\"""".
format(turl=item.values()[0], protocol=item.keys()[0])
144 outfile.write(outstring)
146 os.system(
"chmod +x " + name)
149 if "AthDerivation" in opts.athena_project:
151 for i
in xrange(len(TFILE_OPEN_TURLs)):
153 for key, value
in TFILE_OPEN_TURLs[i].
items():
154 name = os.path.join(
"test",
"test_directioart_athderivation_recotf_with_aod_{}.sh".
format(key.lower()))
156 outfile =
open(name,
'w')
158 outstring =
"""#!/bin/bash\n
159 # art-description: DirectIOART AthDerivation Reco_tf.py inputFile:RDO protocol={protocol} reductionConf:TEST1
161 # art-output: *.pool.root
162 # art-include: 21.2/AthDerivation\n
164 Reco_tf.py --inputAODFile {turl} --outputDAODFile art.pool.root --reductionConf TEST1 --maxEvents 100\n
165 echo \"art-result: $? DirectIOART_AthDerivation_RecoTF_inputAOD_protocol_{protocol}_TEST1\"""".
format(turl=value[0], protocol=key)
166 outfile.write(outstring)
168 os.system(
"chmod +x " + name)
172 for i
in xrange(len(TFILE_OPEN_TURLs)):
174 for key, value
in TFILE_OPEN_TURLs[i].
items():
175 name = os.path.join(
"test",
"test_directioart_athanalysis_alg_{}.sh".
format(key.lower()))
177 outfile =
open(name,
'w')
179 outstring =
"""#!/bin/bash\n
180 # art-description: DirectIOART AthAnalysis ParticleSelectionAlg protocol={protocol}
182 # art-output: *.pool.root
183 # art-include: 21.2/AthAnalysis\n
185 athena --filesInput=\"{turl}\" DirectIOART/DirectIOARTAthAnalysisJobOptions.py\n
186 echo \"art-result: $? DirectIOART_AthAnalysis_ParticleSelectionAlg_protocol_{protocol}\"""".
format(turl=value[0], protocol=key)
187 outfile.write(outstring)
189 os.system(
"chmod +x " + name)
193 for key, value
in XAODCHECKER_TURLS.items():
194 name = os.path.join(
"test",
"test_directioart_analysisbase_xaodchecker_{}.sh".
format(key.lower()))
196 outfile =
open(name,
'w')
198 outstring =
"""#!/bin/bash\n
199 # art-description: DirectIOART AnalysisBase xAODChecker protocol={protocol}
201 # art-include: 21.2/AnalysisBase\n
204 echo \"art-result: $? DirectIOART_AnalysisBase_xAODChecker_protocol_{protocol}\"\n
205 PFC_FILE=PoolFileCatalog.xml
207 echo \"<?xml version=\\"1.0\\" encoding=\\"UTF-8\\" standalone=\\"no\\" ?>\" >> $PFC_FILE
208 echo \"<!-- Edited By POOL -->\" >> $PFC_FILE
209 echo \"<!DOCTYPE POOLFILECATALOG SYSTEM \\"InMemory\\">\" >> $PFC_FILE
210 echo \"<POOLFILECATALOG>\" >> $PFC_FILE
211 echo \"\" >> $PFC_FILE
212 echo \"</POOLFILECATALOG>\" >> $PFC_FILE""".
format(turl=value, protocol=key)
213 outfile.write(outstring)
215 os.system(
"chmod +x " + name)
218 name = os.path.join(
"test",
"test_directioart_tfileopen.py")
220 outfile =
open(name,
'w')
223 outstring =
"""#!/usr/bin/env python\n
224 # art-description: DirectIOART TFile::Open
226 # art-include: main/Athena
227 # art-include: main/AthSimulation
228 # art-include: 21.0/Athena
229 # art-include: 21.0/AthSimulation
230 # art-include: 21.2/AthAnalysis
231 # art-include: 21.2/AthDerivation
232 # art-include: 21.2/AnalysisBase
233 # art-include: 21.2/AnalysisTop
234 # art-include: 21.3/Athena
235 # art-include: 21.9/Athena\n
239 for i
in xrange(len(TFILE_OPEN_TURLs)):
241 for key, value
in TFILE_OPEN_TURLs[i].
items():
244 for j
in xrange(len(value)):
245 filenames += value[j]
246 if j < len(value)-1: filenames +=
" | "
248 f = ROOT.TFile.Open(\"{turl}\")
249 if f: print(\"art-result: 0 DirectIOART_TFileOpen_protocol_{protocol}\")
250 else: print(\"art-result: 1 DirectIOART_TFileOpen_protocol_{protocol}\")
251 del f\n""".
format(turl=filenames, protocol=key)
256 outstr = \"\"\"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>
257 <!-- Edited By POOL -->
258 <!DOCTYPE POOLFILECATALOG SYSTEM \"InMemory\">
261 </POOLFILECATALOG>\"\"\"
262 with open(\"PoolFileCatalog.xml\", \"w\") as outfile:
263 outfile.write(outstr)"""
265 outfile.write(outstring)
267 os.system(
"chmod +x " + name)
271 parser = argparse.ArgumentParser()
273 parser.add_argument(
"athena_project", help=
"Specify the Athena release flavour", type=str, nargs=
"*" )
274 parser.add_argument(
"-o",
"--tfile-open", help=
"Generate ART scripts for TFile::Open tests", action=
"store_true", dest=
"open_tests")
275 parser.add_argument(
"-m",
"--mp", help=
"Generate ART tests for AthenaMP", action=
"store_true")
277 options = parser.parse_args()
285 if not os.path.exists(
"./test/"):
286 os.makedirs(
"./test/")
288 for i
in xrange(len(opts.athena_project)):
289 if not opts.athena_project[i]
in PROJECTS:
290 print "\tAthena project \"",opts.athena_project[i],
"\" not intended for DirectIOART!"
293 if opts.mp
and not "Athena" in opts.athena_project:
299 if "AthAnalysis" in opts.athena_project:
302 if "Athena" in opts.athena_project
or "AthDerivation" in opts.athena_project:
305 if "AnalysisBase" in opts.athena_project:
308 if __name__ ==
"__main__":
311 except KeyboardInterrupt: