ATLAS Offline Software
trfFileValidationFunctions.py
Go to the documentation of this file.
1 
2 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 
4 
8 
9 import logging
10 msg = logging.getLogger(__name__)
11 
12 import PyJobTransforms.trfExceptions as trfExceptions
13 
14 
16  from PyJobTransforms.trfValidateRootFile import checkFile
17  rc = checkFile(fileName = fname, type = 'event', requireTree = True)
18  if rc == 0:
19  return (True, "integrity of {fileName} good".format(fileName = str(fname)))
20  else:
21  return (False, "integrity of {fileName} bad: return code: {integrityStatus}".format(fileName = str(fname), integrityStatus = rc))
22 
23 
25  from PyJobTransforms.trfValidateRootFile import checkFile
26  rc = checkFile(fileName = fname, type = 'basket', requireTree = False)
27  if rc == 0:
28  return (True, "integrity of {fileName} good".format(fileName = str(fname)))
29  else:
30  return (False, "integrity of {fileName} bad: return code: {integrityStatus}".format(fileName = str(fname), integrityStatus = rc))
31 
32 
34  try:
35  from PyJobTransforms.trfUtils import call
36  rc = call(["AtlListBSEvents", "-c", fname],
37  logger = msg,
38  message = "Report by AtlListBSEvents: ",
39  timeout = None
40  )
42  return False
43  if rc == 0:
44  return (True, "integrity of {fileName} good".format(fileName = str(fname)))
45  else:
46  return (False, "integrity of {fileName} bad: return code: {integrityStatus}".format(fileName = str(fname), integrityStatus = rc))
47 
48 
50  rc = 0 # (default behaviour)
51  if rc == 0:
52  return (True, "integrity of {fileName} good".format(fileName = str(fname)))
53  else:
54  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:24
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:15
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:49
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:33
PyJobTransforms.trfUtils
Transform utility functions.
str
Definition: BTagTrackIpAccessor.cxx:11