ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tools
PyJobTransforms
python
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
14
def
returnIntegrityOfPOOLFile
(fname, **kwargs):
15
from
PyJobTransforms.trfValidateRootFile
import
checkFile, msg
as
logger
16
import
multiprocessing
17
18
level = kwargs.get(
'level'
)
19
if
level
is
not
None
:
20
if
level < msg.getEffectiveLevel():
21
msg.setLevel(level)
22
msg.debug(f
"Set logging level of {msg.name!r} to {logging.getLevelName(level)!r}"
)
23
if
level < logger.getEffectiveLevel():
24
logger.setLevel(level)
25
msg.debug(f
"Set logging level of {logger.name!r} to {logging.getLevelName(level)!r}"
)
26
27
msg.debug(f
"Current process: {multiprocessing.current_process().name}"
)
28
29
rc =
checkFile
(fileName=fname, the_type=
'event'
, requireTree=
False
)
30
if
rc == 0:
31
return
(
True
,
"integrity of {fileName} good"
.format(fileName = str(fname)))
32
else
:
33
return
(
False
,
"integrity of {fileName} bad: return code: {integrityStatus}"
.format(fileName = str(fname), integrityStatus = rc))
34
35
36
def
returnIntegrityOfNTUPFile
(fname):
37
from
PyJobTransforms.trfValidateRootFile
import
checkFile
38
rc =
checkFile
(fileName = fname, the_type =
'basket'
, requireTree =
False
)
39
if
rc == 0:
40
return
(
True
,
"integrity of {fileName} good"
.format(fileName = str(fname)))
41
else
:
42
return
(
False
,
"integrity of {fileName} bad: return code: {integrityStatus}"
.format(fileName = str(fname), integrityStatus = rc))
43
44
45
def
returnIntegrityOfBSFile
(fname):
46
try
:
47
from
PyJobTransforms.trfUtils
import
call
48
rc = call([
"AtlListBSEvents"
,
"-c"
, fname],
49
logger = msg,
50
message =
"Report by AtlListBSEvents: "
,
51
timeout =
None
52
)
53
except
trfExceptions.TransformTimeoutException
:
54
return
False
55
if
rc == 0:
56
return
(
True
,
"integrity of {fileName} good"
.format(fileName = str(fname)))
57
else
:
58
return
(
False
,
"integrity of {fileName} bad: return code: {integrityStatus}"
.format(fileName = str(fname), integrityStatus = rc))
59
60
61
def
returnIntegrityOfHISTFile
(fname):
62
rc = 0
# (default behaviour)
63
if
rc == 0:
64
return
(
True
,
"integrity of {fileName} good"
.format(fileName = str(fname)))
65
else
:
66
return
(
False
,
"integrity of {fileName} bad: return code: {integrityStatus}"
.format(fileName = str(fname), integrityStatus = rc))
python.trfExceptions.TransformTimeoutException
Exception used by time limited executions.
Definition
trfExceptions.py:79
PyJobTransforms.trfUtils
Transform utility functions.
checkFile
Definition
checkFile.py:1
python.trfFileValidationFunctions.returnIntegrityOfNTUPFile
returnIntegrityOfNTUPFile(fname)
Integrity function for file class argNTUPFile.
Definition
trfFileValidationFunctions.py:36
python.trfFileValidationFunctions.returnIntegrityOfBSFile
returnIntegrityOfBSFile(fname)
Integrity function for file class argBSFile.
Definition
trfFileValidationFunctions.py:45
python.trfFileValidationFunctions.returnIntegrityOfPOOLFile
returnIntegrityOfPOOLFile(fname, **kwargs)
Integrity function for file class argPOOLFile, argHITSFile, argRDOFile and argEVNTFile.
Definition
trfFileValidationFunctions.py:14
python.trfFileValidationFunctions.returnIntegrityOfHISTFile
returnIntegrityOfHISTFile(fname)
Integrity function for file class argHISTFile.
Definition
trfFileValidationFunctions.py:61
Generated on
for ATLAS Offline Software by
1.17.0