Skip to content
Snippets Groups Projects
Commit abcb3652 authored by Nils Erik Krumnack's avatar Nils Erik Krumnack Committed by Atlas Nightlybuild
Browse files

Merge branch '21.2-checkPRW-fix' into '21.2'

Fix checkPRW.py with double e-tag containers

See merge request !49161

(cherry picked from commit 85e9bc8d)

d4745372 fix for double e-tag in checkPRW.py
parent 209c28bd
No related branches found
No related tags found
5 merge requests!69091Fix correlated smearing bug in JER in JetUncertainties in 22.0,!58791DataQualityConfigurations: Modify L1Calo config for web display,!51674Fixing hotSpotInHIST for Run3 HIST,!50012RecExConfig: Adjust log message levels from GetRunNumber and GetLBNumber,!49643Sweeping !49161 from 21.2 to master. Fix checkPRW.py with double e-tag containers
Pipeline #3443309 passed
...@@ -8,8 +8,9 @@ You can also use it to output a single PRW config file containing just your data ...@@ -8,8 +8,9 @@ You can also use it to output a single PRW config file containing just your data
Example: checkPRW.py --outPRWFile=my.prw.root --inDsTxt=my.datasets.txt path/to/prwConfigs/*.root Example: checkPRW.py --outPRWFile=my.prw.root --inDsTxt=my.datasets.txt path/to/prwConfigs/*.root
""" """
import os
import argparse import argparse
import os
import re
def main(): def main():
from argparse import RawTextHelpFormatter from argparse import RawTextHelpFormatter
...@@ -48,22 +49,47 @@ def main(): ...@@ -48,22 +49,47 @@ def main():
if dataset.startswith("#"): continue if dataset.startswith("#"): continue
dataset = dataset.rsplit(":")[-1].strip() dataset = dataset.rsplit(":")[-1].strip()
if len(dataset)==0: continue if len(dataset)==0: continue
print "Doing %s" % dataset print "Doing %s" % dataset
prov = atlasAPI.get_dataset_prov(client, dataset ) prov = atlasAPI.get_dataset_prov(client, dataset )
if 'node' not in prov: if 'node' not in prov:
print "ERROR: Could not determine provenance of %s, skipping!" % dataset print "ERROR: Could not determine provenance of %s, skipping!" % dataset
continue continue
theParent="" theParent=""
singleTagName=""
for ds in prov['node']: for ds in prov['node']:
if ds[u'dataType']!=u'AOD': continue if ds[u'dataType']!=u'AOD': continue
dsName = ds[u'logicalDatasetName']
if 'recon.AOD' not in ds[u'logicalDatasetName']: continue if 'recon.AOD' not in ds[u'logicalDatasetName']: continue
theParent = str(ds[u'logicalDatasetName']) etags = re.findall('e[0-9]+_', dsName)
if len(etags) == 2:
print "INFO: Found a double e-tag container %s!" % dsName
singleTagName = dsName.replace(etags[1], "")
continue
theParent = str(dsName)
theParentSize = int(ds[u'events']) theParentSize = int(ds[u'events'])
break break
if theParent=="":
if theParent == "":
if singleTagName == "":
print "ERROR: Could not determine provenance of %s, skipping!" % dataset print "ERROR: Could not determine provenance of %s, skipping!" % dataset
continue continue
else:
print "INFO: Trying with single-tag containers manually %s!" % singleTagName
prov = atlasAPI.get_dataset_prov(client, singleTagName)
if 'node' in prov:
for ds in prov['node']:
if ds[u'logicalDatasetName'] == singleTagName:
theParent = singleTagName
theParentSize = int(ds[u'events'])
if theParent == "":
print "ERROR: Could not determine provenance of %s, skipping!" % dataset
continue
else:
print "ERROR: Could not determine provenance of %s, skipping!" % dataset
continue
#extract the dsid ... #extract the dsid ...
theParent = theParent.split(".")[1] theParent = theParent.split(".")[1]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment