<%@ LANGUAGE="VBScript" %> <% start_time = Time %> <%' ' Check if people registered for shift/logbook writing ' operator1="" operator2="" firstname1="" firstname2="" registered=0 If Request.Cookies("PHOBOSPORTAL").HasKeys Then strCookie1=Request.Cookies("PHOBOSPORTAL")("OPERATOR1") If Not (IsNull(strCookie1) OR ( Len(strCookie1) = 0)) Then registered=1 operator1=CStr(strCookie1) firstname1=CStr(Request.Cookies("PHOBOSPORTAL")("FIRSTNAME1")) strCookie2=Request.Cookies("PHOBOSPORTAL")("OPERATOR2") If Not (IsNull(strCookie2) OR ( Len(strCookie2) = 0)) Then operator2=CStr(strCookie2) firstname2=CStr(Request.Cookies("PHOBOSPORTAL")("FIRSTNAME2")) End If End If End if If Firstname1<>"" Then Fullname1=Ucase(Left(Firstname1,1)) & ". " & operator1 Else Fullname1=operator1 End If If Firstname2<>"" Then Fullname2=Ucase(Left(Firstname2,1)) & ". " & operator2 Else Fullname2=operator2 End If operator=Fullname1 If Fullname2<>"" Then operator = operator & " and " & Fullname2 End If %> <% Set Connection = Server.CreateObject("ADODB.Connection") Connection.Mode = adModeRead Connection.Open phdb_rd Set RS = Connection.Execute("select max(run) maxrun from phoffline.runs") If Not RS.EoF Then maxrun=CLng(RS("maxrun")) Else run=0 End If Set RS=nothing If Request("run")="" Then run=maxrun Else Run=CLng(Request("run")) End If run_prev=run-1 If run") Set RS_seq = Connection.Execute(SQLStmt) SQLStmt = " select rsn.sequence,le.action,to_char(le.log_date,'MM/DD HH24:MI:SS') ldate,to_char(le.log_date,'MM/DD/YYYY HH24:MI:SS') ldatef " SQLStmt = SQLStmt & " from phoffline.runseq_numbers rsn,phoffline.log_entries le " SQLStmt = SQLStmt & " where rsn.run=" & CStr(run) SQLStmt = SQLStmt & " and rsn.logid=le.logid " SQLStmt = SQLStmt & " order by rsn.sequence,le.log_date " ' response.write(SQLStmt & ";
") Set RS_seq_action = Connection.Execute(SQLStmt) ' ' Get Run Comments ' SQLStmt = " select to_char(max(le.log_date),'MM/DD HH24:MI') ldate,min(substr(lo.firstname,1,1) || '.' || ' ' || lo.operator) operator1, " SQLStmt = SQLStmt & " max(substr(lo.firstname,1,1) || '.' || ' ' || lo.operator) operator2,max(lc.text) user_comments" SQLStmt = SQLStmt & " from phoffline.run_numbers rn,phoffline.log_entries le,phoffline.log_comments lc,phoffline.log_operators lo " SQLStmt = SQLStmt & " where rn.run=" & CStr(run) SQLStmt = SQLStmt & " and rn.logid=le.logid and lc.logid=le.logid and lo.logid=le.logid " SQLStmt = SQLStmt & " group by le.logid " SQLStmt = SQLStmt & " order by max(le.log_date) " ' response.write(SQLStmt) Set RS3 = Connection.Execute(SQLStmt) ' ' Check valid calibrations created using data from this run ' SQLStmt = " select sequence,caltype,calmethod,calversion,dbms_lob.getlength(caldata)/1024/1024 Calsize from phoffline.calibrations,phoffline.runseqs " SQLStmt = SQLStmt & " where run=" & CStr(run) SQLStmt = SQLStmt & " and seq_date=validity_date and valid>0 order by sequence,caltype,calversion" ' response.write(SQLStmt) Set RS_cals = Connection.Execute(SQLStmt) %> Run Details

Run <%=run%>

<% If Not RS1.EoF Then rdate=CStr(RS1("rdate")) sdate=CStr(RS1("sdate")) run_type=CStr(RS1("run_type")) If Not IsNull(RS1("trigger_config")) Then trigger_config=CStr(RS1("trigger_config")) Else trigger_config="NULL" End If If Not IsNull(RS1("nevents")) Then nevents=CLng(RS1("nevents")) nseq=CLng(RS1("nseq")) If nseq=1 Then s="" Else s="s" End If %> Run of type <%=run_type%> started at <%=rdate%>. The run ended after writing <%=nevents%> events stored in <%=nseq%> sequence<%=s%>.
The Trigger configuration used for this run was <%=trigger_config%>. <% Else ' ' We can be here only if this is the most recent run. Otherwise the crashed. Check the ' latest run number and compare to this one Set RS_maxrun=Connection.Execute("select max(run) maxrun from phoffline.runs") If run=CLng(RS_maxrun("maxrun")) Then inprogress=true ' %> Run of type <%=run_type%> started at <%=rdate%>. The run is still in progress. <% Else %> Run of type <%=run_type%> started at <%=rdate%>. The DAQ crashed during this run, the database information is incomplete.
The Trigger configuration used for this run was <%=trigger_config%>. <% inprogress=false End If End If Else %> No information about this run number in the database. <% End If If Not RS3.EoF Then Response.Write("

Operator Comments

") Do While Not RS3.EoF ldate=CStr(RS3("ldate")) operator1=CStr(RS3("operator1")) operator2=CStr(RS3("operator2")) If operator1<>operator2 Then operator=operator1 & " and " & operator2 Else operator=operator1 End If comment=CStr(RS3("user_comments")) Response.Write("(" & ldate & ", ") Response.Write(operator & ") ") Response.Write(comment & "
") RS3.MoveNext Loop End If Set RS3=nothing %>

Click for more details: Raw Log or RHIC Parameters

Sequences

<% ' ' Get information about sequences, move through two recordsets, this is to simplify sql ' nseq_s=0 nseq_e=0 nseq_n=0 total=0 Do While ((Not RS_seq_action.EoF) And (Not RS_seq.EoF)) sequence=CInt(RS_seq_action("sequence")) action=CStr(RS_seq_action("action")) ldate=CStr(RS_seq_action("ldate")) ldatef=CStr(RS_seq_action("ldatef")) If Not RS_Seq.EoF Then if not isnull(RS_seq("stat")) then stat=cint(RS_seq("stat")) else stat="N/A" end if If CInt(RS_seq_action("sequence"))<>CInt(RS_Seq("sequence")) Then Response.write("

Inconsistent sequence numbers

") End If Else Response.write("

Error: End Of file on sequence tables !

") End If If (action="START_SEQ") Then If Not IsNull(RS_Seq("name")) Then fname=CStr(RS_Seq("dir")) & "/" & CStr(RS_Seq("name")) Else fname="N/A" End If nseq_s=nseq_s+1 Response.Write("" & VbCrLf) ' Response.Write("" & VbCrLf) Response.Write("" & VbCrLf) Response.Write("" & VbCrLf) sdate=ldate sdatef=ldatef Elseif (action="END_SEQ") Then nseq_e=nseq_e+1 If Not IsNull(RS_seq("nevents")) Then nevents=CLng(RS_seq("nevents")) If Not IsNull(RS_seq("fsize")) Then fsize=CStr(Round(CDbl(RS_seq("fsize")),2)) Else fsize="N/A" End If If Not IsNull(RS_seq("checksum")) Then checksum=CStr(RS_seq("checksum")) Else checksum="N/A" End If Else nevents=0 End If duration=DateDiff("s",sdatef,ldatef) If duration<>0 Then rate=nevents/duration Else rate=0 End If total=total+nevents Response.Write("" & VbCrLf) Response.Write("" & VbCrLf) Response.Write("" & VbCrLf) Response.Write("" & VbCrLf) Response.Write("" & VbCrLf) Response.Write("" & VbCrLf) If registered=1 then response.write("") else response.write("") end if Response.Write("" & VbCrLf) Elseif (action="NEW_RUN_SEQUENCE") Then ' This is purely for last year's runs If nseq_n=0 Then Response.Write("" & VbCrLf) Response.Write("" & VbCrLf) Response.Write("" & VbCrLf) Response.Write("" & VbCrLf) Response.Write("" & VbCrLf) Response.Write("" & VbCrLf) Response.Write("" & VbCrLf) Response.Write("" & VbCrLf) Response.Write("" & VbCrLf) End If nseq_n=nseq_n+1 Response.Write("" & VbCrLf) Response.Write("" & VbCrLf) Response.Write("" & VbCrLf) Response.Write("" & VbCrLf) Response.Write("" & VbCrLf) Response.Write("" & VbCrLf) Response.Write("" & VbCrLf) Response.Write("" & VbCrLf) If registered=1 then response.write("") else response.write("") end if Response.Write("" & VbCrLf) End If RS_seq_action.MoveNext If Not RS_seq_action.EoF Then If CInt(RS_seq_action("sequence"))<>sequence Then RS_seq.MoveNext End If End If Loop If (nseq_s>nseq_e) Then ' run still in progress ? If inprogress Then Response.Write("" & VbCrLf) Else Response.Write("" & VbCrLf) End If Response.Write("" & VbCrLf) Response.Write("" & VbCrLf) Response.Write("" & VbCrLf) End If %>
Seq Start Duration Avg. Rate Events File Size Checksum Status
    [Min] [Hz]     [GB]   <% If registered=1 then response.write("Change Run") else response.write(" ") end if %>  
" & CStr(sequence) & "") Response.Write(" ") Response.Write(CStr(sequence) & "") Response.Write("" & ldate & "" & CStr(Round(duration/60,1)) & "" & CStr(Round(rate,1)) & "" & CStr(nevents) & "" & fname & "" & fsize & "" & checksum & ""&stat&""&stat&"
0" & sdate & "N/AN/AN/AN/AN/A
" & CStr(sequence) & "" & ldate & "N/AN/AN/AN/AN/A"&stat&""&stat&"
In ProgressDAQ crashed" & fname & " 
<% Set RS_seq_action=nothing Set RS_seq=nothing %> <% If Not RS_cals.EoF Then Response.Write("

Calibrations using this run

") Response.Write("
") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Do While Not RS_cals.EoF sequence=CStr(RS_cals("sequence")) caltype=CStr(RS_cals("caltype")) calmethod=CStr(RS_cals("calmethod")) calversion=CStr(RS_cals("calversion")) calsize=CStr(Round(RS_cals("calsize"),1)) Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") RS_cals.MoveNext Loop Response.Write("
SequenceTypeMethodVersionSize[MB]
" & sequence & " " & caltype & " " & calmethod & " " & calversion & " " & calsize & "
") End If Set RS_cals=nothing Response.Write("
") %> <% Connection.Close Set Connection=nothing %>