ATLAS Offline Software
Functions | Variables
python.MetaReaderPeeker Namespace Reference

Functions

def _setup ()
 

Variables

 __all__
 
 metadata
 

Function Documentation

◆ _setup()

def python.MetaReaderPeeker._setup ( )
private

Definition at line 9 of file MetaReaderPeeker.py.

9 def _setup():
10  from PyUtils.MetaReader import read_metadata
11 
12  from AthenaCommon.Logging import logging
13  msg = logging.getLogger('MetaReaderPeeker')
14 
15  global metadata
16 
17  from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
18  inFiles = athenaCommonFlags.FilesInput()
19 
20  from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
21  if athenaCommonFlags.isOnline() and (not inFiles or all([f.strip() == '' for f in inFiles])):
22  # set minimal items of inputFileSummary
23  metadata = {
24  'file_type':'BS',
25  'eventTypes':['IS_DATA','IS_ATLAS','IS_PHYSICS'],
26  'TagStreamsRef':''
27  }
28  else:
29  if len(inFiles) < 1:
30  msg.warning("No input files specified yet! Cannot do anything.")
31  return
32 
33 
34  for inFile in inFiles:
35 
36  metadatas = read_metadata(inFile, mode='peeker', promote=True, ignoreNonExistingLocalFiles=True)
37 
38  for foundFile, metadata in metadatas.items():
39 
40  metadata['file_name'] = inFile
41  if metadata.get("nentries"):
42  break
43  else:
44  continue # This make the previous break to exit from both for loops
45  break
46 
47  # if no nentries > 0 metadata is found, it will keep the last
48 
49 _setup()

Variable Documentation

◆ __all__

python.MetaReaderPeeker.__all__
private

Definition at line 4 of file MetaReaderPeeker.py.

◆ metadata

python.MetaReaderPeeker.metadata

Definition at line 6 of file MetaReaderPeeker.py.

python.MetaReader.read_metadata
def read_metadata(filenames, file_type=None, mode='lite', promote=None, meta_key_filter=None, unique_tag_info_values=True, ignoreNonExistingLocalFiles=False)
Definition: MetaReader.py:52
python.MetaReaderPeeker._setup
def _setup()
Definition: MetaReaderPeeker.py:9
Cut::all
@ all
Definition: SUSYToolsAlg.cxx:64