ATLAS Offline Software
Functions
python.FilePeeker Namespace Reference

Functions

def PeekFiles (inputfiles)
 

Function Documentation

◆ PeekFiles()

def python.FilePeeker.PeekFiles (   inputfiles)

Definition at line 10 of file FilePeeker.py.

10 def PeekFiles(inputfiles):
11 
12  bsfiles=[]
13  poolfiles=[]
14  for inputfile in inputfiles:
15  if not os.access(inputfile,os.R_OK):
16  print ("ERROR: Failed input file",inputfile,"not accessible")
17  return None
18  if "pool.root" in inputfile:
19  poolfiles.append(inputfile)
20  else:
21  bsfiles.append(inputfile)
22 
23 
24  retval=""
25  if len(bsfiles)>0:
26  retval=check_output(["BSFilePeeker","-k"]+bsfiles).decode('utf-8')
27 
28  if len(poolfiles)>0:
29  retval+=check_output(["PoolFilePeeker","-k"]+poolfiles).decode('utf-8')
30 
31 
32  fullResult=dict()
33  for line in retval.split(os.linesep):
34  linesplit=line.split(":")
35  if len(linesplit)!=2: continue
36  k=linesplit[0].strip()
37  v=linesplit[1].strip()
38  if len(v)==0: continue
39  if (k=="File"):
40  result=dict()
41  fullResult[v]=result
42 
43 
44  elif (k=="RunNumber" or k=="LBNumber"):
45  result[k]=set(int(rn) for rn in v.split())
46  elif (k=="BeamEnergy"):
47  result[k]=int(v)
48 
49  elif (k=="SGkeys"):
50  result[k]=set(sgk for sgk in v.split())
51 
52  elif (k=="isMC"):
53  result[k]=bool(int(v))
54  else:
55  result[k]=v
56 
57  return fullResult
58 
59 
60 
AtlasMcWeight::decode
double decode(number_type binnedWeight)
Convert weight from unsigned to double.
Definition: AtlasMcWeight.cxx:32
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
python.FilePeeker.PeekFiles
def PeekFiles(inputfiles)
Definition: FilePeeker.py:10
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60