ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
MuonRecRTT_dynamic_pagemaker.MuonRecRTT_dynamic_pagemaker Class Reference
Collaboration diagram for MuonRecRTT_dynamic_pagemaker.MuonRecRTT_dynamic_pagemaker:

Public Member Functions

def __init__ (self, argDict={})
 
def run (self)
 

Public Attributes

 release
 
 build
 
 jobGroup
 
 platform
 
 branch
 
 runPath
 

Detailed Description

Definition at line 10 of file MuonRecRTT_dynamic_pagemaker.py.

Constructor & Destructor Documentation

◆ __init__()

def MuonRecRTT_dynamic_pagemaker.MuonRecRTT_dynamic_pagemaker.__init__ (   self,
  argDict = {} 
)

Definition at line 11 of file MuonRecRTT_dynamic_pagemaker.py.

11  def __init__(self,argDict={}):
12 
13  # access my args from the dictionary passed in, and convert any basic types
14  # self.myArg = argDict.get('MyArg') # = the Python string type '3'
15  # self.myArg = int(self.myArg) # = the Python integer type 3
16 
17  # access the RTT descriptor instance
18  rttDescriptor = argDict.get('JobDescriptor')
19 
20  # grab some stuff from it
21  self.release = str(rttDescriptor.paths.release)
22  self.build = str(rttDescriptor.paths.build)
23  self.jobGroup = str(rttDescriptor.jobGroup)
24  self.platform = str(rttDescriptor.paths.targetCMTCONFIG)
25  self.branch = str(rttDescriptor.paths.branch)
26  self.runPath = str(rttDescriptor.runPath)
27 

Member Function Documentation

◆ run()

def MuonRecRTT_dynamic_pagemaker.MuonRecRTT_dynamic_pagemaker.run (   self)

Definition at line 28 of file MuonRecRTT_dynamic_pagemaker.py.

28  def run(self):
29  # do the stuff I wanted to do...
30  logfile = open(self.runPath + "/MuonRecRTT_dynamic_pagemaker.log",'a')
31  logfile.write("Starting MuonRecRTT_dynamic_pagemaker.py run method\n")
32 
33  inputfile = self.runPath + "/ALL_MuonRecRTT_Plots.html"
34  outputfile = inputfile.replace(".html","_Dynamic.html")
35 
36  datasetlist = { "AthenaMuonSimRec" : " " ,
37  "AthenaMuonDataRec" : " " ,
38  "MuonDataRecTrf" : " "
39  }
40 
41  # helper function
42  def szsplit(stringlist,splitchar=" "):
43  if str(splitchar) == splitchar:
44  try:
45  return stringlist.split(splitchar)
46  except:
47  newlist = []
48  for item in stringlist:
49  newlist += item.split(splitchar)
50  return newlist
51  else:
52  for onechar in splitchar:
53  stringlist = szsplit(stringlist,onechar)
54  return stringlist
55 
56  logfile.write("Input file: " + inputfile + "\n")
57  logfile.write("Output file: " + outputfile + "\n")
58  logfile.write("datasetlist: \n")
59  for key in datasetlist.keys():
60  logfile.write(" " + key + ": " + datasetlist[key] +"\n")
61 
62  logfile.write("Getting dataset... ")
63  try:
64  dataset = datasetlist[self.jobGroup]
65  logfile.write("OK!\n")
66  except:
67  dataset = "Unknown (jobGroup = " + self.jobGroup + ")"
68  logfile.write("Unknown!\n")
69 
70  logfile.write(" Dataset name is " + dataset + "\n")
71 
72  jobinfolist = { "Release" : self.release , "Branch" : self.branch , "Build" : self.build , "Platform" : self.platform , "Dataset" : dataset }
73 
74  # For testing purposes
75  if self.runPath == ".":
76  self.runPath = "/afs/cern.ch/atlas/project/RTT/Results/rel_3/devval/build/i686-slc4-gcc34-opt/offline/MuonRecRTT/AthenaMuonRec/MuonRecRTT/263"
77 
78  logfile.write("jobinfolist: \n")
79  for key in jobinfolist.keys():
80  logfile.write(" " + key + ": " + jobinfolist[key] +"\n")
81 
82  logfile.write("Opening input file: " + inputfile + "\n")
83  input = open(inputfile,'r')
84 
85  logfile.write("Opening output file: " + outputfile + "\n")
86  output = open(outputfile,'w')
87 
88  logfile.write("Starting copy...\n")
89 
90  for line in input:
91  logfile.write("Line: " + line)
92  if line.count("<h2>Contents</h2>"):
93  logfile.write(" Contains <h2>Contents</h2>\n")
94  output.write("<TABLE BORDER=6 CELLSPACING=4 CELLPADDING=4>\n")
95  for key in jobinfolist.keys():
96  logfile.write(" Going through jobinfo list and writing value of " + key + "... ")
97  output.write(" <TR><TD><b>" + key + "</b></TD><TD>" + jobinfolist[key] + "</TD></TR>\n")
98  logfile.write("Done.\n")
99  logfile.write("Writing date and finishing table... ")
100  output.write(" <TR><TD><b>" + "Date" + "</b></TD><TD>" + os.popen("date").readline().strip() + "</TD></TR>\n")
101  output.write("</TABLE>\n\n")
102  logfile.write("Done.\n")
103  if line.count("RTT default page"):
104  logfile.write(" Contains RTT default page")
105  htmlline = "<li><a href=\"http://atlas-project-rtt-results.web.cern.ch/atlas-project-rtt-results/page2.php?xml="
106  htmlline += szsplit(self.runPath,["Results/","/MuonRecRTT"])[1]
107  htmlline += "/RTTSummary.xml&package=MuonRecRTT&job=MuonRecRTT&id=" + self.runPath.split("/")[-1]
108  htmlline += "\">RTT default page</a></li>\n"
109  output.write(htmlline)
110  logfile.write(" Writing: " + htmlline)
111  else:
112  if line.count("Log files"):
113  logfile.write(" Contains log files")
114  htmlline = "<li>Log files: "
115  for filename in os.listdir(self.runPath):
116  if filename.count("log"):
117  htmlline += "<a href=\"" + filename + "\">" + filename + "</a> "
118  htmlline += "</li>\n"
119  output.write(htmlline)
120  logfile.write(" Writing: " + htmlline)
121  else:
122  output.write(line)
123  logfile.write(" Output original line.\n")
124 
125  logfile.write("Now closing files.\n")
126  output.close()
127  input.close()
128  logfile.close()
129 

Member Data Documentation

◆ branch

MuonRecRTT_dynamic_pagemaker.MuonRecRTT_dynamic_pagemaker.branch

Definition at line 25 of file MuonRecRTT_dynamic_pagemaker.py.

◆ build

MuonRecRTT_dynamic_pagemaker.MuonRecRTT_dynamic_pagemaker.build

Definition at line 22 of file MuonRecRTT_dynamic_pagemaker.py.

◆ jobGroup

MuonRecRTT_dynamic_pagemaker.MuonRecRTT_dynamic_pagemaker.jobGroup

Definition at line 23 of file MuonRecRTT_dynamic_pagemaker.py.

◆ platform

MuonRecRTT_dynamic_pagemaker.MuonRecRTT_dynamic_pagemaker.platform

Definition at line 24 of file MuonRecRTT_dynamic_pagemaker.py.

◆ release

MuonRecRTT_dynamic_pagemaker.MuonRecRTT_dynamic_pagemaker.release

Definition at line 21 of file MuonRecRTT_dynamic_pagemaker.py.

◆ runPath

MuonRecRTT_dynamic_pagemaker.MuonRecRTT_dynamic_pagemaker.runPath

Definition at line 26 of file MuonRecRTT_dynamic_pagemaker.py.


The documentation for this class was generated from the following file:
run
int run(int argc, char *argv[])
Definition: ttree2hdf5.cxx:28
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
Trk::open
@ open
Definition: BinningType.h:40
str
Definition: BTagTrackIpAccessor.cxx:11
Trk::split
@ split
Definition: LayerMaterialProperties.h:38