ATLAS Offline Software
Functions | Variables
sim_reg_test_fastchain Namespace Reference

Functions

def checkStatus (path, days=1)
 
def get_recent (path, pathsplit)
 get the recent tag### More...
 
def eoscp (package, filename, jobname, nightly, tag, store_tag, release)
 Add EOS prefix###. More...
 

Variables

string __author__ = 'FFF'
 
string __doc__ = 'FFF'
 
bool dryrun = False
 
string pwdmon = ''
 main More...
 
string prepath = '/afs/cern.ch/atlas/project/RTT/prod/Results/rtt/rel_0/'
 
string postpath = '/build/x86_64-slc6-gcc62-opt/Athena/'
 
string currel = 'NOREL'
 
 curdir = os.getcwd()
 
 folders = curdir.split('/')
 
 relmon = sys.argv[6]
 
string pwdref = ''
 
 relref = sys.argv[2]
 
string argvref = pwdref.split('/')
 
string corr_path_ref = '/'.join(argvref)
 
def good_rel_ref = get_recent(corr_path_ref,argvref)
 Find a release to use as a reference. More...
 
string argvmon = pwdmon.split('/')
 
string corr_path_mon = '/'.join(argvmon)
 
def good_rel_mon = get_recent(corr_path_mon,argvmon)
 
int posref = 9
 
int posmon = 9
 
string monPath = '/'.join(argvmon)
 
string refPath = '/'.join(argvref)
 
string file_name = '.root'
 
string store_tag = ''
 
list compfilesref = ['ISFBroker.root']
 
list compfilesmon = ['ISFBroker.root']
 
list file_list_ref = compfilesref[:]
 got extended argument list create file list for f in sys.argv[3:]: if f.endswith(file_name): print "Add file %s in searching list."%(f) compfiles.append(f) else: print "Find tag set, use common tag: %s."%(f) store_tag=f More...
 
list file_list_val = compfilesmon[:]
 
 file_status_val
 
 days
 
bool file_root = False
 
 name
 
 suffix = f
 
string cmd = 'cp'+' '+monPath+'/'+f+' '+'today.'+store_tag+".root"
 
bool file_status_ref = False
 
list file_list_ref_orig = file_list_ref
 
 days_ref
 
def previous_rel = good_rel_ref
 

Function Documentation

◆ checkStatus()

def sim_reg_test_fastchain.checkStatus (   path,
  days = 1 
)

Definition at line 15 of file sim_reg_test_fastchain.py.

15 def checkStatus(path,days=1):
16  if not os.path.exists(path+"/jobExitCode.txt"):
17  print path+"/jobExitCode.txt","missing - skipping this nightly"
18  return False,999
19  f = open(path+"/jobExitCode.txt")
20  print "Checking job status..."
21  print "Found "+path+"/jobExitCode.txt"
22  file_status=False
23  for line in f:
24  if line.strip()=='0':
25  file_status=True
26  #print line,
27  if "<jobSuccess>True</jobSuccess>" in line:
28  file_status=True
29  #print line,
30  elif "<jobSuccess>False</jobSuccess>" in line:
31  file_status=False
32  #print line,
33  if file_status: print "Job succeeded in this nightly."
34  else:
35  print "Job failed in this nightly."
36  return False,999
37  #check date
38  #<timeStamp>1352062929</timeStamp>
39  if os.path.exists(path+"/rttjobinfo.xml"):
40  import re
41  f = open(path+"/rttjobinfo.xml")
42  for l in f:
43  #<timeStamp>1352062929</timeStamp>#
44  m=re.search('<timeStamp>([0-9]*)</timeStamp>',l)
45  if m is not None:
46  #print m.groups()
47  ts=int(m.groups()[0])
48  import datetime as dt
49  yes=dt.date.fromtimestamp(ts)
50  now=dt.date.today()
51  days=(now-yes).days
52  if days>6:
53  # to old, ignore
54  print 'WARNING results found in '+path+' are more than a week old'
55 # file_status=False
56  return file_status,days
57 

◆ eoscp()

def sim_reg_test_fastchain.eoscp (   package,
  filename,
  jobname,
  nightly,
  tag,
  store_tag,
  release 
)

Add EOS prefix###.

Definition at line 95 of file sim_reg_test_fastchain.py.

95 def eoscp(package,filename,jobname,nightly,tag,store_tag,release):
96 
97  current=os.getcwd()
98  if os.environ.has_key('LS_SUBCWD'):
99  current=os.environ['LS_SUBCWD']
100  #current='/afs/cern.ch/atlas/project/RTT/prod/Results/rtt/rel_2/19.2.X.Y-VAL/build/x86_64-slc6-gcc47-opt/offline/ISF_Validation/ttbar_ISF_G4_sim_Reg'
101  argv=current.split('/')
102  argv.pop()
103 
114 
115  postfix="x86_64-slc6-gcc62-opt/Athena/"+package
116  #middle='/'.join(argv[-6:-5])
117  #middle=argv[-5]
118  middle=nightly
119  pathlist=["prod","batch"]#This 2nd option should make the script work on the RTT test instance.
120 # status=0
121  for path in pathlist:
122  prefix="root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/rtt/"+path+"/rtt"
123  #print "postfix: "+postfix
124  #print "middle: "+middle
125  #print "prefix: "+prefix
126  #print "jobname: "+jobname
127  #print "filename: "+filename
128  path=prefix+'/'+release+'/'+middle+'/'+postfix+'/'+jobname+'/'+filename
129  print "Path to check on eos: "+path
130  if store_tag!='':
131  command_cp="xrdcp %s %s.%s.root"%(path,tag,store_tag)
132  else:
133  command_cp="xrdcp %s %s.%s"%(path,tag,filename)
134  print command_cp
135  status=os.system(command_cp)
136  if status==0: return status
137  return status
138 

◆ get_recent()

def sim_reg_test_fastchain.get_recent (   path,
  pathsplit 
)

get the recent tag###

Definition at line 59 of file sim_reg_test_fastchain.py.

59 def get_recent(path,pathsplit):
60  print "---------------------------------------------------------------------------------------"
61  pathlist=path.split('/')
62  pos_index=0
63  release_list=[]
64  for i,a in enumerate(pathsplit):
65  if a.find("rel_")>=0:
66  pos_index=i
67  release_list=a.split('_')
68  todays_release=pathlist[pos_index]
69  recent_days=999;
70  recent_index=0;
71  for i in xrange(7):
72  release_tag=release_list[0]+"_"+str(i)
73 # print release_tag
74  pathlist[pos_index]=release_tag
75  path_refill="/".join(pathlist)
76 # print path_refill
77  print "Checking for results for "+release_tag+"..."
78  status_tmp,days_tmp=checkStatus(path_refill)
79  if status_tmp:
80  print "==> Nightly: "+release_tag+" Age: "+str(days_tmp)+" days"
81  if days_tmp>=0 and days_tmp<recent_days:
82  recent_days=days_tmp
83  recent_index=i
84  else:
85  print "==> Nightly: "+release_tag+" Age: N/A"
86  print "---------------------------------------------------------------------------------------"
87  if recent_days>998:
88  print "=====> Could not find another release to compare to. Returning today's nightly ("+todays_release+") as the reference."
89  return todays_release
90  good_rel_refease="rel_"+str(recent_index)
91  print "=====> "+good_rel_refease+" is the most recent nightly to use as reference."
92  return good_rel_refease
93 

Variable Documentation

◆ __author__

string sim_reg_test_fastchain.__author__ = 'FFF'
private

Definition at line 8 of file sim_reg_test_fastchain.py.

◆ __doc__

string sim_reg_test_fastchain.__doc__ = 'FFF'
private

Definition at line 9 of file sim_reg_test_fastchain.py.

◆ argvmon

string sim_reg_test_fastchain.argvmon = pwdmon.split('/')

Definition at line 216 of file sim_reg_test_fastchain.py.

◆ argvref

string sim_reg_test_fastchain.argvref = pwdref.split('/')

Definition at line 200 of file sim_reg_test_fastchain.py.

◆ cmd

string sim_reg_test_fastchain.cmd = 'cp'+' '+monPath+'/'+f+' '+'today.'+store_tag+".root"

Definition at line 287 of file sim_reg_test_fastchain.py.

◆ compfilesmon

list sim_reg_test_fastchain.compfilesmon = ['ISFBroker.root']

Definition at line 252 of file sim_reg_test_fastchain.py.

◆ compfilesref

list sim_reg_test_fastchain.compfilesref = ['ISFBroker.root']

Definition at line 251 of file sim_reg_test_fastchain.py.

◆ corr_path_mon

string sim_reg_test_fastchain.corr_path_mon = '/'.join(argvmon)

Definition at line 221 of file sim_reg_test_fastchain.py.

◆ corr_path_ref

string sim_reg_test_fastchain.corr_path_ref = '/'.join(argvref)

Definition at line 205 of file sim_reg_test_fastchain.py.

◆ curdir

sim_reg_test_fastchain.curdir = os.getcwd()

Definition at line 170 of file sim_reg_test_fastchain.py.

◆ currel

sim_reg_test_fastchain.currel = 'NOREL'

Definition at line 168 of file sim_reg_test_fastchain.py.

◆ days

sim_reg_test_fastchain.days

Definition at line 272 of file sim_reg_test_fastchain.py.

◆ days_ref

sim_reg_test_fastchain.days_ref

Definition at line 312 of file sim_reg_test_fastchain.py.

◆ dryrun

bool sim_reg_test_fastchain.dryrun = False

Definition at line 12 of file sim_reg_test_fastchain.py.

◆ file_list_ref

list sim_reg_test_fastchain.file_list_ref = compfilesref[:]

got extended argument list create file list for f in sys.argv[3:]: if f.endswith(file_name): print "Add file %s in searching list."%(f) compfiles.append(f) else: print "Find tag set, use common tag: %s."%(f) store_tag=f

clean up files

Definition at line 267 of file sim_reg_test_fastchain.py.

◆ file_list_ref_orig

list sim_reg_test_fastchain.file_list_ref_orig = file_list_ref

Definition at line 309 of file sim_reg_test_fastchain.py.

◆ file_list_val

list sim_reg_test_fastchain.file_list_val = compfilesmon[:]

Definition at line 269 of file sim_reg_test_fastchain.py.

◆ file_name

string sim_reg_test_fastchain.file_name = '.root'

Definition at line 247 of file sim_reg_test_fastchain.py.

◆ file_root

bool sim_reg_test_fastchain.file_root = False

Definition at line 276 of file sim_reg_test_fastchain.py.

◆ file_status_ref

bool sim_reg_test_fastchain.file_status_ref = False

Definition at line 308 of file sim_reg_test_fastchain.py.

◆ file_status_val

sim_reg_test_fastchain.file_status_val

Definition at line 272 of file sim_reg_test_fastchain.py.

◆ folders

sim_reg_test_fastchain.folders = curdir.split('/')

Definition at line 176 of file sim_reg_test_fastchain.py.

◆ good_rel_mon

def sim_reg_test_fastchain.good_rel_mon = get_recent(corr_path_mon,argvmon)

Definition at line 224 of file sim_reg_test_fastchain.py.

◆ good_rel_ref

string sim_reg_test_fastchain.good_rel_ref = get_recent(corr_path_ref,argvref)

Find a release to use as a reference.

Definition at line 209 of file sim_reg_test_fastchain.py.

◆ monPath

string sim_reg_test_fastchain.monPath = '/'.join(argvmon)

Definition at line 237 of file sim_reg_test_fastchain.py.

◆ name

sim_reg_test_fastchain.name

Definition at line 280 of file sim_reg_test_fastchain.py.

◆ posmon

sim_reg_test_fastchain.posmon = 9

Definition at line 231 of file sim_reg_test_fastchain.py.

◆ posref

sim_reg_test_fastchain.posref = 9

Definition at line 226 of file sim_reg_test_fastchain.py.

◆ postpath

string sim_reg_test_fastchain.postpath = '/build/x86_64-slc6-gcc62-opt/Athena/'

Definition at line 167 of file sim_reg_test_fastchain.py.

◆ prepath

string sim_reg_test_fastchain.prepath = '/afs/cern.ch/atlas/project/RTT/prod/Results/rtt/rel_0/'

Definition at line 165 of file sim_reg_test_fastchain.py.

◆ previous_rel

def sim_reg_test_fastchain.previous_rel = good_rel_ref

Definition at line 356 of file sim_reg_test_fastchain.py.

◆ pwdmon

string sim_reg_test_fastchain.pwdmon = ''

main

Definition at line 164 of file sim_reg_test_fastchain.py.

◆ pwdref

string sim_reg_test_fastchain.pwdref = ''

Definition at line 192 of file sim_reg_test_fastchain.py.

◆ refPath

string sim_reg_test_fastchain.refPath = '/'.join(argvref)

Definition at line 240 of file sim_reg_test_fastchain.py.

◆ relmon

string sim_reg_test_fastchain.relmon = sys.argv[6]

Definition at line 187 of file sim_reg_test_fastchain.py.

◆ relref

string sim_reg_test_fastchain.relref = sys.argv[2]

Definition at line 195 of file sim_reg_test_fastchain.py.

◆ store_tag

string sim_reg_test_fastchain.store_tag = ''

Definition at line 248 of file sim_reg_test_fastchain.py.

◆ suffix

sim_reg_test_fastchain.suffix = f

Definition at line 280 of file sim_reg_test_fastchain.py.

xrange
void xrange(TH1 *h, bool symmetric)
Definition: computils.cxx:515
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
sim_reg_test_fastchain.checkStatus
def checkStatus(path, days=1)
Definition: sim_reg_test_fastchain.py:15
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
sim_reg_test_fastchain.eoscp
def eoscp(package, filename, jobname, nightly, tag, store_tag, release)
Add EOS prefix###.
Definition: sim_reg_test_fastchain.py:95
Trk::open
@ open
Definition: BinningType.h:40
str
Definition: BTagTrackIpAccessor.cxx:11
sim_reg_test_fastchain.get_recent
def get_recent(path, pathsplit)
get the recent tag###
Definition: sim_reg_test_fastchain.py:59