ATLAS Offline Software
trfFileValidationFunctions.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2 
3 
7 
8 import logging
9 msg = logging.getLogger(__name__)
10 
11 import 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))
python.trfFileValidationFunctions.returnIntegrityOfNTUPFile
def returnIntegrityOfNTUPFile(fname)
Integrity function for file class argNTUPFile.
Definition: trfFileValidationFunctions.py:23
vtune_athena.format
format
Definition: vtune_athena.py:14
python.trfFileValidationFunctions.returnIntegrityOfPOOLFile
def returnIntegrityOfPOOLFile(fname)
Integrity function for file class argPOOLFile, argHITSFile, argRDOFile and argEVNTFile.
Definition: trfFileValidationFunctions.py:14
python.trfUtils.call
def call(args, bufsize=0, executable=None, stdin=None, preexec_fn=None, close_fds=False, shell=False, cwd=None, env=None, universal_newlines=False, startupinfo=None, creationflags=0, message="", logger=msg, loglevel=None, timeout=None, retry=2, timefactor=1.5, sleeptime=10)
Definition: trfUtils.py:155
checkFile
Definition: checkFile.py:1
python.trfFileValidationFunctions.returnIntegrityOfHISTFile
def returnIntegrityOfHISTFile(fname)
Integrity function for file class argHISTFile.
Definition: trfFileValidationFunctions.py:48
python.trfExceptions.TransformTimeoutException
Exception used by time limited executions.
Definition: trfExceptions.py:78
python.trfFileValidationFunctions.returnIntegrityOfBSFile
def returnIntegrityOfBSFile(fname)
Integrity function for file class argBSFile.
Definition: trfFileValidationFunctions.py:32
PyJobTransforms.trfUtils
Transform utility functions.
str
Definition: BTagTrackIpAccessor.cxx:11