ATLAS Offline Software
Functions
python.AtlRunQueryTier0 Namespace Reference

Functions

def GetTier0_allDatasets (cursor, runlist, dsnamepattern=[])
 
def GetTier0_datasetsAndTypes (cursor, runlist)
 

Function Documentation

◆ GetTier0_allDatasets()

def python.AtlRunQueryTier0.GetTier0_allDatasets (   cursor,
  runlist,
  dsnamepattern = [] 
)

Definition at line 19 of file AtlRunQueryTier0.py.

19 def GetTier0_allDatasets( cursor, runlist, dsnamepattern = [] ):
20  res = {}
21  pos = 0
22  blocksize = 200
23  # build dataset selection string
24  dsselstring = ''
25  for p in dsnamepattern:
26  p = p.replace('*','%')
27  dsselstring += "LOWER(DATASETNAME) like LOWER('%s') OR " % p
28  if dsselstring:
29  dsselstring = 'and (' + dsselstring[:len(dsselstring)-4] + ')'
30 
31  # do selection
32  while pos<len(runlist):
33  cursor.execute("SELECT DISTINCT RUNNR,DATASETNAME,TYPE,PSTATES,DDM,NFILES,TOTSIZE,TOTEVENTS,CREATIONTIME FROM dataset WHERE RUNNR in (%s) and TYPE!='LOG' %s and not DATASETNAME like '%%.LOG%%'"% (','.join([str(i) for i in runlist[pos:pos+blocksize]]), dsselstring))
34  r = cursor.fetchall()
35  for e in r:
36  res.setdefault(e[0],[]).append((e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]))
37  pos += blocksize
38 
39  return res
40 

◆ GetTier0_datasetsAndTypes()

def python.AtlRunQueryTier0.GetTier0_datasetsAndTypes (   cursor,
  runlist 
)

Definition at line 41 of file AtlRunQueryTier0.py.

41 def GetTier0_datasetsAndTypes( cursor, runlist ):
42  res = {}
43  pos = 0
44  blocksize = 200
45  while pos<len(runlist):
46  cursor.execute("SELECT DISTINCT RUNNR,DATASETNAME,TYPE,PSTATES FROM dataset WHERE RUNNR in (%s) and TYPE!='LOG' and not DATASETNAME like '%%.LOG%%'"% ','.join([str(i) for i in runlist[pos:pos+blocksize]]))
47  r = cursor.fetchall()
48  for e in r:
49  res.setdefault(e[0],[]).append((e[1],e[2],e[3]))
50  pos += blocksize
51 
52  return res
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
python.AtlRunQueryTier0.GetTier0_allDatasets
def GetTier0_allDatasets(cursor, runlist, dsnamepattern=[])
Definition: AtlRunQueryTier0.py:19
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
str
Definition: BTagTrackIpAccessor.cxx:11
python.AtlRunQueryTier0.GetTier0_datasetsAndTypes
def GetTier0_datasetsAndTypes(cursor, runlist)
Definition: AtlRunQueryTier0.py:41