%@ LANGUAGE="VBScript" %>
<%
Function GetIon(aa)
Select Case aa
Case 197
GetIon="Au"
Case 63
GetIon="Cu"
Case 28
GetIon="Si"
Case 2
GetIOn="d"
Case 1
GetIOn="p"
Case -1
GetIOn="Undefined"
Case Else
GetIOn="A_" & CStr(aa)
End Select
End Function
ShowNullValid=0
If Request("run_val")="" Then
Run_val=2
Else
Run_val= CLng(Request("run_val"))
End If
' To display all runs
Run_val1 = Run_val
If Run_val=-99 Then
Run_val1=99
ShowNullValid=1
End If
' To display both running (0 or null) and tested (1) runs
If Run_val=0 Then
Run_val1=1
ShowNullValid=1
End If
Select Case Run_val
Case -99
Run_val_str="All"
Case -1
Run_val_str="Invalid"
Case 0
Run_val_str="Running"
Case 1
Run_val_str="Running Tested"
Case 2
Run_val_str="Regular"
Case 3
Run_val_str="Spectrometer geometry"
Case 4
Run_val_str="Obsolete geometry"
Case 10
Run_val_str="Flow"
Case 11
Run_val_str="Fluctuations"
Case 12
Run_val_str="Modified generator input"
Case 20
Run_val_str="Special Geant parameters"
End Select
If Request("run_min")="" Then
Run_min=0
Else
Run_min= CLng(Request("run_min"))
End If
If Request("run_max")="" Then
Run_max=9999999
Else
Run_max= CLng(Request("run_max"))
End If
If Run_max=0 Then
Run_max=9999999
End If
' response.write(Run_type)
Set Connection = Server.CreateObject("ADODB.Connection")
Connection.Mode = adModeRead
Connection.Open phdb_rd
' Connection.Open phdb_rd_repl
SQLStmtx = "select to_char(sysdate,'DD Mon YYYY') ddate,to_char(sysdate,'HH24:MI:SS') ttime,global_name from global_name "
' response.write(SQLStmtx & "
" )
Set RSx = Connection.Execute(SQLStmtx)
If Not RSx.EOF Then
dbname = CStr(RSx("global_name"))
select case CStr(RSx("global_name"))
case "PHDB.PHOBOS.BNL.GOV"
dbname="Main Phobos Database"
case "PHDB.WORLD"
dbname="Main Phobos Database"
case "ORACLE.WORLD"
dbname="Phobos Server (old) Database"
case "KRPHOBOS.WORLD"
dbname="Krakow Database"
case "ROCHESTER.WORLD"
dbname="Rochester Database"
end select
Else
dbname="Undefined Database"
End If
If Request("nruns")<>"" Then
SQLStmt0 = "select max(RUN) maxrun from phoffline.simruns "
' response.write(SQLStmt0 & "
" )
Set RS0 = Connection.Execute(SQLStmt0)
run_min=CLng(RS0("maxrun"))-CLng(Request("nruns"))+1
run_max=CLng(RS0("maxrun"))
If run_min<0 Then
run_min=0
End If
End If
runmins = Cstr(run_min)
runmaxs = CStr(run_max)
SQLStmt = " select sr.run,sr.mcrun,mcr.program_name, "
SQLStmt = SQLStmt & " nvl(sr.valid,0) simrun_valid, "
SQLStmt = SQLStmt & " nvl(smseqs,0) smseqs0,"
SQLStmt = SQLStmt & " nvl(t1.numvalue,-1) bmin, "
SQLStmt = SQLStmt & " nvl(t2.numvalue,-1) bmax, "
SQLStmt = SQLStmt & " nvl(t3.numvalue,-1) e1, "
SQLStmt = SQLStmt & " nvl(t4.numvalue,-1) e2, "
SQLStmt = SQLStmt & " nvl(t5.numvalue,-1) a1, "
SQLStmt = SQLStmt & " nvl(t6.numvalue,-1) a2, "
SQLStmt = SQLStmt & " nvl(t7.textvalue,-1) run_type, "
SQLStmt = SQLStmt & " nvl(s7.textvalue,-1) geov, "
SQLStmt = SQLStmt & " nvl(s8.numvalue,-1) rzmn, "
SQLStmt = SQLStmt & " nvl(s9.numvalue,-1) rzmx, "
SQLStmt = SQLStmt & " nvl(s10.numvalue,0) magt, "
SQLStmt = SQLStmt & " nvl(s11.numvalue,0) sclb, "
SQLStmt = SQLStmt & " to_char(sr.run_date,'MM/DD/YYYY') rdate,nvl(mcr.num_events,0) n_eve,nvl(se.sim_events,0) s_eve "
SQLStmt = SQLStmt & " from phoffline.simruns sr, phoffline.mcruns mcr, "
SQLStmt = SQLStmt & " (select run, count(sequence) smseqs from phoffline.smearing_files "
SQLStmt = SQLStmt & " group by run) smf, "
SQLStmt = SQLStmt & " phoffline.mc_pars t1, "
SQLStmt = SQLStmt & " phoffline.mc_pars t2, "
SQLStmt = SQLStmt & " phoffline.mc_pars t3, "
SQLStmt = SQLStmt & " phoffline.mc_pars t4, "
SQLStmt = SQLStmt & " phoffline.mc_pars t5, "
SQLStmt = SQLStmt & " phoffline.mc_pars t6, "
SQLStmt = SQLStmt & " phoffline.mc_pars t7, "
SQLStmt = SQLStmt & " phoffline.simulation_pars s7, "
SQLStmt = SQLStmt & " phoffline.simulation_pars s8, "
SQLStmt = SQLStmt & " phoffline.simulation_pars s9, "
SQLStmt = SQLStmt & " phoffline.simulation_pars s10, "
SQLStmt = SQLStmt & " phoffline.simulation_pars s11, "
SQLStmt = SQLStmt & " (select max(sr.run) run,sum(sr.num_events) sim_events "
SQLStmt = SQLStmt & " from phoffline.simrunseqs sr, "
SQLStmt = SQLStmt & " (select max(runseq) runseq,run from phoffline.simrunseqs "
SQLStmt = SQLStmt & " where RUN>" & run_min & "-1 and RUN<" & run_max & "+1 "
SQLStmt = SQLStmt & " and num_events>0 "
SQLStmt = SQLStmt & " group by run,first_event,last_event) srs "
SQLStmt = SQLStmt & " where sr.RUN>" & run_min & "-1 and sr.RUN<" & run_max & "+1 "
SQLStmt = SQLStmt & " and sr.run=srs.run and sr.runseq=srs.runseq "
SQLStmt = SQLStmt & " group by sr.run) se "
SQLStmt = SQLStmt & " where sr.RUN>" & run_min & "-1 and sr.RUN<" & run_max & "+1 "
SQLStmt = SQLStmt & " and sr.mcrun=mcr.run and smf.run(+)=sr.run and se.run(+)=sr.run "
' SQLStmt = SQLStmt & " and sr.mcrun=mcr.run and se.run(+)=sr.run "
SQLStmt = SQLStmt & " and t1.keyname(+)='BMIN' and t1.run(+)=mcr.run "
SQLStmt = SQLStmt & " and t2.keyname(+)='BMAX' and t2.run(+)=mcr.run "
SQLStmt = SQLStmt & " and t3.keyname(+)='E1' and t3.run(+)=mcr.run "
SQLStmt = SQLStmt & " and t4.keyname(+)='E2' and t4.run(+)=mcr.run "
SQLStmt = SQLStmt & " and t5.keyname(+)='A1' and t5.run(+)=mcr.run "
SQLStmt = SQLStmt & " and t6.keyname(+)='A2' and t6.run(+)=mcr.run "
SQLStmt = SQLStmt & " and t7.keyname(+)='RTYPE' and t7.run(+)=mcr.run "
SQLStmt = SQLStmt & " and s7.keyname(+)='GEOV' and s7.run(+)=sr.run "
SQLStmt = SQLStmt & " and s8.keyname(+)='RZMN' and s8.run(+)=sr.run "
SQLStmt = SQLStmt & " and s9.keyname(+)='RZMX' and s9.run(+)=sr.run "
SQLStmt = SQLStmt & " and s10.keyname(+)='MAGT' and s10.run(+)=sr.run "
SQLStmt = SQLStmt & " and s11.keyname(+)='SCLB' and s11.run(+)=sr.run "
SQLStmt = SQLStmt & " and ( (sr.valid>=" & Run_val & " and sr.valid<=" & Run_val1 & ")"
SQLStmt = SQLStmt & " or (sr.valid is null and " & ShowNullValid & "=1) )"
SQLStmt = SQLStmt & " order by sr.run desc "
' response.write(SQLStmt & "
" )
Set RS = Connection.Execute(SQLStmt)
%>
Status on <%=RSx("ddate")%> at <%=RSx("ttime")%> in <%=dbname%>
Runs of type <%=Run_val_str%> in the range: [<%=runmins%> - <%=runmaxs%>]
| Run | Run Date | MC Run | MC Type | Run Type | GEO Vers | Events | Energy | Ions | b Range | Z VTX | Field | Details | ||
| [GeV] | [fm] | [cm] | ||||||||||||
| <%= RS("RUN") %> | <%= RS("rdate") %> | "><%= RS("mcrun") %> | <%= RS("program_name") %> | <%= RS("run_type") %> | <%= Trim(RS("geov")) %> | <% If sr_v<1 Then %><%=CStr(s_eve)%> (<%=CStr(n_eve)%>) | <% Else %><%=CStr(s_eve)%> | <% End If %><%=e1%>
x<%=e2%> |
<%=Ion1%>
x<%=Ion2%> |
<%=bran%> | <%=zran%> | <%=magtc%> | <% If smseqs0<1 Then %>"> |
<% Else %>
"> |
<% End If %>
<%
RS.MoveNext
Loop
%>