<%@ LANGUAGE="VBScript" %> <% Function GetIon(aa) Select Case aa Case 197 GetIon="Au" Case 63 GetIon="Cu" Case 28 GetIon="Si" Case 1 GetIOn="p" Case 2 GetIon="d" Case -1 GetIon="Undefined" Case Else GetIon="A_" & CStr(aa) End Select End Function Set Connection = Server.CreateObject("ADODB.Connection") Connection.Mode = adModeRead Connection.Open phdb_rd 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 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 genname_req = CStr(Request("genname_form")) runtype = CStr(Request("runtype_form")) a1_req = CStr(Request("a1_form")) a2_req = CStr(Request("a2_form")) e1_req = CStr(Request("energy1_form")) e2_req = CStr(Request("energy2_form")) bmin_req = CStr(Request("bmin_form")) bmax_req = CStr(Request("bmax_form")) geov_req = CStr(Request("geov_form")) rzmn_req = CStr(Request("vtxzmin_form")) rzmx_req = CStr(Request("vtxzmax_form")) magt_req = CStr(Abs(Request("mags_form"))) mags_tmp = Sgn(Request("mags_form")) If mags_tmp=0 Then mags_tmp=1 End If mags_req = CStr(mags_tmp) aprocess = 0 a1f = Request("a1_form") a2f = Request("a2_form") If a1f>0 And a2f>0 Then aprocess = 1 End If eprocess = 0 e1f = Request("energy1_form") e2f = Request("energy2_form") If e1_req>0 And e2_req>0 Then eprocess = 1 End If bprocess = 0 b1f = Request("bmin_form") b2f = Request("bmax_form") If b1f>0 Or b2f>0 Then bprocess = 1 End If gprocess = 0 gf = Request("geov_form") If gf>0 Then gprocess = 1 End If vprocess = 0 v1f = Request("vtxzmin_form") v2f = Request("vtxzmax_form") If v1f>0 Or v2f>0 Then vprocess = 1 End If SQLStmt = " select sr.run,sr.mcrun,mcr.program_name, " SQLStmt = SQLStmt & " nvl(sr.valid,0) simrun_valid, " 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,1) sclb, " SQLStmt = SQLStmt & " to_char(sr.run_date,'MM/DD/YYYY') rdate " SQLStmt = SQLStmt & " from phoffline.simruns sr,phoffline.mcruns mcr, " 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 & " where " If CInt(Request("genrunnum_form")) <> 0 Then SQLStmt = SQLStmt & " sr.mcrun=" & CStr(Request("genrunnum_form")) SQLStmt = SQLStmt & " and sr.mcrun=mcr.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 " Else SQLStmt = SQLStmt & " sr.mcrun=mcr.run " SQLStmt = SQLStmt & " and mcr.program_name='" & genname_req & "' " If bprocess > 0 Then SQLStmt = SQLStmt & " and t1.keyname(+)='BMIN' and abs(t1.numvalue-" & bmin_req & ")<0.1" & " and t1.run(+)=mcr.run " SQLStmt = SQLStmt & " and t2.keyname(+)='BMAX' and abs(t2.numvalue-" & bmax_req & ")<0.1" & " and t2.run(+)=mcr.run " Else SQLStmt = SQLStmt & " and t1.keyname(+)='BMIN'" & " and t1.run(+)=mcr.run " SQLStmt = SQLStmt & " and t2.keyname(+)='BMAX'" & " and t2.run(+)=mcr.run " End If If eprocess > 0 Then SQLStmt = SQLStmt & " and t3.keyname(+)='E1' and abs(t3.numvalue-" & e1_req & ")<1.0" & " and t3.run(+)=mcr.run " SQLStmt = SQLStmt & " and t4.keyname(+)='E2' and abs(t4.numvalue-" & e2_req & ")<1.0" & " and t4.run(+)=mcr.run " Else SQLStmt = SQLStmt & " and t3.keyname(+)='E1'" & " and t3.run(+)=mcr.run " SQLStmt = SQLStmt & " and t4.keyname(+)='E2'" & " and t4.run(+)=mcr.run " End If If aprocess > 0 Then SQLStmt = SQLStmt & " and t5.keyname(+)='A1' and abs(t5.numvalue-" & a1_req & ")<1.0" & " and t5.run(+)=mcr.run " SQLStmt = SQLStmt & " and t6.keyname(+)='A2' and abs(t6.numvalue-" & a2_req & ")<1.0" & " and t6.run(+)=mcr.run " Else SQLStmt = SQLStmt & " and t5.keyname(+)='A1'" & " and t5.run(+)=mcr.run " SQLStmt = SQLStmt & " and t6.keyname(+)='A2'" & " and t6.run(+)=mcr.run " End If SQLStmt = SQLStmt & " and t7.keyname(+)='RTYPE' and t7.textvalue like '%" & runtype & "%'" & " and t7.run(+)=mcr.run " If gprocess > 0 Then SQLStmt = SQLStmt & " and s7.keyname(+)='GEOV' and abs(s7.numvalue-" & geov_req & ")<0.0009" & " and s7.run(+)=sr.run " Else SQLStmt = SQLStmt & " and s7.keyname(+)='GEOV'" & " and s7.run(+)=sr.run " End If If vprocess > 0 Then SQLStmt = SQLStmt & " and s8.keyname(+)='RZMN' and (s8.numvalue-(" & rzmn_req & "))<=0" & " and s8.run(+)=sr.run " SQLStmt = SQLStmt & " and s9.keyname(+)='RZMX' and (s9.numvalue-(" & rzmx_req & "))>=0" & " and s9.run(+)=sr.run " Else SQLStmt = SQLStmt & " and s8.keyname(+)='RZMN'" & " and s8.run(+)=sr.run " SQLStmt = SQLStmt & " and s9.keyname(+)='RZMX'" & " and s9.run(+)=sr.run " End If SQLStmt = SQLStmt & " and s10.keyname(+)='MAGT' and s10.numvalue=" & magt_req & " and s10.run(+)=sr.run " SQLStmt = SQLStmt & " and s11.keyname(+)='SCLB' and s11.numvalue=" & mags_req & " 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 " End If ' response.write(SQLStmt & "
" ) Set RS = Connection.Execute(SQLStmt) %> Simulation Run Finder

Simulation Runs

Status on  <%=RSx("ddate")%> at <%=RSx("ttime")%> in <%=dbname%>

Runs of type <%=Run_val_str%>

<% Do While Not RS.EoF e1=Round(RS("e1"),1) e2=Round(RS("e2"),1) ion1=GetIon(CInt(RS("a1"))) ion2=GetIon(CInt(RS("a2"))) rzmn=Round(RS("rzmn"),0) rzmx=Round(RS("rzmx"),0) bmin=CDbl(RS("bmin")) bmax=CDbl(RS("bmax")) If bmin=bmax Then bran="=" & CStr(bmin) Else bran=CStr(bmin) & "-" & CStr(bmax) End If rzmn=Round(RS("rzmn"),0) rzmx=Round(RS("rzmx"),0) If rzmn=rzmx Then zran="=" & CStr(rzmn) Else zran=CStr(rzmn) & " to " & CStr(rzmx) End If magt=CInt(RS("magt")) sclb=CInt(RS("sclb")) If sclb<>0 Then magt=magt*Sgn(sclb) End If magtc=CStr(magt) %> <% RS.MoveNext Loop %>
Run Run Date MC Run MC Type Run Type GEO Vers 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")) %> <%=e1%>

x<%=e2%>

<%=Ion1%>

x <%=Ion2%>

<%=bran%> <%=zran%> <%=magtc%> ">Details
<% Connection.Close %>