ATLAS Offline Software
Loading...
Searching...
No Matches
trfFileValidationFunctions.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
7
8import logging
9msg = logging.getLogger(__name__)
10
11import PyJobTransforms.trfExceptions as trfExceptions
12
13
15 from PyJobTransforms.trfValidateRootFile import checkFile
16 rc = checkFile(fileName = fname, the_type = 'event', requireTree = True)
17 if rc == 0:
18 return (True, "integrity of {fileName} good".format(fileName = str(fname)))
19 else:
20 return (False, "integrity of {fileName} bad: return code: {integrityStatus}".format(fileName = str(fname), integrityStatus = rc))
21
22
24 from PyJobTransforms.trfValidateRootFile import checkFile
25 rc = checkFile(fileName = fname, the_type = 'basket', requireTree = False)
26 if rc == 0:
27 return (True, "integrity of {fileName} good".format(fileName = str(fname)))
28 else:
29 return (False, "integrity of {fileName} bad: return code: {integrityStatus}".format(fileName = str(fname), integrityStatus = rc))
30
31
33 try:
34 from PyJobTransforms.trfUtils import call
35 rc = call(["AtlListBSEvents", "-c", fname],
36 logger = msg,
37 message = "Report by AtlListBSEvents: ",
38 timeout = None
39 )
41 return False
42 if rc == 0:
43 return (True, "integrity of {fileName} good".format(fileName = str(fname)))
44 else:
45 return (False, "integrity of {fileName} bad: return code: {integrityStatus}".format(fileName = str(fname), integrityStatus = rc))
46
47
49 rc = 0 # (default behaviour)
50 if rc == 0:
51 return (True, "integrity of {fileName} good".format(fileName = str(fname)))
52 else:
53 return (False, "integrity of {fileName} bad: return code: {integrityStatus}".format(fileName = str(fname), integrityStatus = rc))
Exception used by time limited executions.
Transform utility functions.
returnIntegrityOfBSFile(fname)
Integrity function for file class argBSFile.
returnIntegrityOfHISTFile(fname)
Integrity function for file class argHISTFile.
returnIntegrityOfNTUPFile(fname)
Integrity function for file class argNTUPFile.
returnIntegrityOfPOOLFile(fname)
Integrity function for file class argPOOLFile, argHITSFile, argRDOFile and argEVNTFile.