ATLAS Offline Software
Functions
getReferenceRun Namespace Reference

Functions

def setenv ()
 
def execute (cmd, args=[])
 
def extractFilename (dirLine)
 
def ls (fpath)
 
def composeSctPath (rootDir, runStr)
 
def availableFiles ()
 
def lastAvailableFile ()
 
def main ()
 

Function Documentation

◆ availableFiles()

def getReferenceRun.availableFiles ( )

Definition at line 38 of file getReferenceRun.py.

38 def availableFiles():
39  setenv()
40  lastInList=-1
41  rootDir="/afs/cern.ch/user/s/sctcalib/scratch0/test_results/data"
42  listing,errs=ls(rootDir)
43  runNames=listing
44  try:
45  #take the last run
46 # runNumberStr=runNames[lastInList]
47 # sctNoiseDir=composeSctPath(rootDir,runNumberStr)
48  listing,errs=ls(rootDir)
49  return rootDir, listing
50  except IndexError:
51  print "Files not found in %s"%rootDir
52  print "listing gave %s"%listing
53  return rootDir,""
54 

◆ composeSctPath()

def getReferenceRun.composeSctPath (   rootDir,
  runStr 
)

Definition at line 34 of file getReferenceRun.py.

34 def composeSctPath(rootDir,runStr):
35  d="/"
36  return rootDir+d+runStr+d+"calibration_SCTNoise"
37 

◆ execute()

def getReferenceRun.execute (   cmd,
  args = [] 
)

Definition at line 12 of file getReferenceRun.py.

12 def execute(cmd,args=[]):
13  argList=[cmd]
14  argList.extend(args)
15  myobj=None
16  try:
17  myobj=subprocess.Popen(argList,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
18  s,e=myobj.communicate()
19  return s,e
20  except:
21  print e
22  return s,e
23 

◆ extractFilename()

def getReferenceRun.extractFilename (   dirLine)

Definition at line 24 of file getReferenceRun.py.

24 def extractFilename(dirLine):
25  #matchString="[drwx-]10\s+\d+\s+\d+\s+zp\s+\d+\s+[A-Za-z]3\s+\d+(.+)"
26  items=dirLine.split(' ')
27  return items[-1]
28 

◆ lastAvailableFile()

def getReferenceRun.lastAvailableFile ( )

Definition at line 55 of file getReferenceRun.py.

55 def lastAvailableFile():
56  lastInList=-1
57  dirPath,fileList= availableFiles()
58  try:
59  return dirPath+"/"+fileList[lastInList]
60  except IndexError:
61  print "No files in %s"%dirPath
62 

◆ ls()

def getReferenceRun.ls (   fpath)

Definition at line 29 of file getReferenceRun.py.

29 def ls(fpath):
30  errs=None
31  fileList=os.listdir(fpath)
32  return fileList,errs
33 

◆ main()

def getReferenceRun.main ( )

Definition at line 63 of file getReferenceRun.py.

63 def main():
64  print lastAvailableFile()
65  return 0
66 

◆ setenv()

def getReferenceRun.setenv ( )

Definition at line 9 of file getReferenceRun.py.

9 def setenv():
10  os.environ["STAGE_SVCCLASS"]="atlcal"
11 
getReferenceRun.main
def main()
Definition: getReferenceRun.py:63
getReferenceRun.availableFiles
def availableFiles()
Definition: getReferenceRun.py:38
getReferenceRun.composeSctPath
def composeSctPath(rootDir, runStr)
Definition: getReferenceRun.py:34
getReferenceRun.extractFilename
def extractFilename(dirLine)
Definition: getReferenceRun.py:24
getReferenceRun.setenv
def setenv()
Definition: getReferenceRun.py:9
getReferenceRun.lastAvailableFile
def lastAvailableFile()
Definition: getReferenceRun.py:55
getReferenceRun.ls
def ls(fpath)
Definition: getReferenceRun.py:29
getReferenceRun.execute
def execute(cmd, args=[])
Definition: getReferenceRun.py:12