<%@ LANGUAGE="VBScript" %> <% Const maxc=100 If Request("run_type")="" Then Run_type="ALLBEAM" Else Run_type=CStr(Request("run_type")) End If If Request("run_min")="" Then Run_min=7267 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 ' response.write(Run_type) time_start=Now() ' ' Check if people registered for shift/logbook writing ' registered=0 ' ' you can only registered if you are at BNL ' If cloc="CH" Then Response.Cookies("CTEST")="cookieset" If Request.Cookies("PHOBOSPORTAL").HasKeys Then strCookie1=Request.Cookies("PHOBOSPORTAL")("OPERATOR1") If Not (IsNull(strCookie1) OR ( Len(strCookie1) = 0)) Then registered=1 End If End if End If Set Connection = Server.CreateObject("ADODB.Connection") Connection.Mode = adModeRead Connection.Open phdb_rd_repl Dim fso, DataFile Set fso = CreateObject("Scripting.FileSystemObject") Set DataFile = fso.CreateTextFile(ph_image_directory+"RunList.txt", True) runentry = "# Run " & " " & " BFIELD " & " " & " Trigger Configuration " & " " & "Totals : Written/Analysed/IsColGoodVtx " DataFile.WriteLine(runentry) SQLStmtx = "select to_char(sysdate,'MM/DD/YYYY HH24:MI:SS') rddate,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 select case CStr(RSx("global_name")) case "PHDB.WORLD" dbname="" case "ORACLE.WORLD" dbname="" case "KRPHOBOS.WORLD" dbname="(KR)" case "ROCHESTER.WORLD" dbname="(ROC)" end select Else dbname="Undefined Database" End If SQLStmty = "select trigger_config tc from phoffline.runs where run = (select max(run) from phoffline.runs where trigger_config <> ' ')" Set RSy = Connection.Execute(SQLStmty) If Request("nruns")<>"" Then SQLStmt0 = "select max(RUN) maxrun from phoffline.runs " Set RS0 = Connection.Execute(SQLStmt0) run_min=CLng(RS0("maxrun"))-CLng(Request("nruns"))+1 run_max=9999999 If run_min<0 Then run_min=0 End If Else ' Official Start of PR01 run_min = Run_Min End If SQLStmt = " select lol.trigger_config, lol.run, lol.nevents, " SQLStmt = SQLStmt & " lss.nevents_s,lss.nseq_s,lss.nback_s,lss.ncoll_s, lss.niscol, lss.niscolvtx, " SQLStmt = SQLStmt & "mg.imag_min,mg.imag_max,mg.hneg_min,mg.hneg_max,mg.imag_c " SQLStmt = SQLStmt & " from " SQLStmt = SQLStmt & " (select max(rs.RUN) run,max(rs.RUN_DATE) run_date,max(rs.RUN_TYPE) run_type, " SQLStmt = SQLStmt & " max(rs.NEVENTS) nevents,max(rs.NSEQ) nseq, max(TRIGGER_CONFIG) trigger_config " SQLStmt = SQLStmt & " from phoffline.runs rs,phoffline.run_numbers rn,phoffline.runseqs vr " SQLStmt = SQLStmt & " where rs.run=rn.run and rn.run=vr.run " SQLStmt = SQLStmt & " and rs.RUN>=" & run_min & " and rs.RUN<=" & run_max & " and vr.status = 0 " SQLStmt = SQLStmt & " group by rs.run) lol, " SQLStmt = SQLStmt & " (select max(rs.RUN) run,sum(ss.NEVENTS) nevents_s,count(sequence) nseq_s,sum(PPPN_W) nback_s,sum(PPPN_N_3) ncoll_s, " SQLStmt = SQLStmt & " sum(ss.ISCOL) niscol, sum(ss.ISCOLVTX) niscolvtx " SQLStmt = SQLStmt & " from phoffline.runs rs,phoffline.scaler_summary ss " SQLStmt = SQLStmt & " where ss.run=rs.run " SQLStmt = SQLStmt & " and rs.RUN>=" & run_min & " and rs.RUN<=" & run_max & " " SQLStmt = SQLStmt & " group by rs.run) lss, " SQLStmt = SQLStmt & " (select max(run) run,max(imag) imag_max,min(imag) imag_min,max(hall_neg) hneg_max,min(hall_neg) hneg_min,count(imag) imag_c " SQLStmt = SQLStmt & " from (select se.run,mm.logdate,mm.imag,mm.hall_neg from phoffline.magnet_monitoring mm, " SQLStmt = SQLStmt & " (select rn.run,min(log_date)-0/(24*60) start_run,max(log_date)+0/(24*60) end_run from phoffline.log_entries le,phoffline.run_numbers rn " SQLStmt = SQLStmt & " where le.logid=rn.logid and (le.action='START_RUN' OR le.action='END_RUN' ) " SQLStmt = SQLStmt & " and rn.RUN>=" & run_min & " and rn.RUN<=" & run_max SQLStmt = SQLStmt & " group by rn.run) se " SQLStmt = SQLStmt & " where mm.logdate between se.start_run and se.end_run) " SQLStmt = SQLStmt & " group by run) mg " SQLStmt = SQLStmt & " where lol.run=lss.run(+) " SQLStmt = SQLStmt & " and lol.run=mg.run(+) " If Run_type<>"" Then SQLStmt = SQLStmt & " and lol.run_type='" & Run_type & "' " End If SQLStmt = SQLStmt & " order by lol.trigger_config, lol.run desc " 'response.write(SQLStmt & "
" ) Set RS = Connection.Execute(SQLStmt) SQLStmtz = "select max(run) last_run from phoffline.runs where run_type = '" & Run_type & "' and trigger_config <> ' ' " Set RSz = Connection.Execute(SQLStmtz) time_ora=CStr(round(24*60*60*(Now()-time_start),1)) If run_type="" Then title="Analyzed Totals" Else title="Analysed Totals, runs of type " & Run_type End If %> Analyzed Event totals

<%=Title%> as of <%=RSx("rddate")%> <%=dbname%>


Last Run (<%=RSz("last_run")%>) was with Trigger Configuration : <%=RSy("tc")%>

<% DV_disp="" Dim trig_config, old_trig_config old_trig_config = "" last_run = CInt(RSz("last_run")) Do While Not RS.EoF bpolarity = -999 If Not IsNull(RS("trigger_config")) Then trig_config = CStr(RS("trigger_config")) If trig_config <> old_trig_config Then If old_trig_config <> "" Then %> <% End If BPLUS_total_events = 0 BPLUS_total_analysed = 0 BPLUS_total_pnppnarrow = 0 BPLUS_total_pn2pp2narrow = 0 BPLUS_total_iscol = 0 BPLUS_total_iscolvtx = 0 BMINUS_total_events = 0 BMINUS_total_analysed = 0 BMINUS_total_pnppnarrow = 0 BMINUS_total_pn2pp2narrow = 0 BMINUS_total_iscol = 0 BMINUS_total_iscolvtx = 0 BZERO_total_events = 0 BZERO_total_analysed = 0 BZERO_total_pnppnarrow = 0 BZERO_total_pn2pp2narrow = 0 BZERO_total_iscol = 0 BZERO_total_iscolvtx = 0 old_trig_config = trig_config End If ' ' Check what is known about magnetic field ' If Not IsNull(RS("imag_c")) Then imag_min=Abs(CDbl(RS("imag_min"))) imag_max=Abs(CDbl(RS("imag_max"))) hneg_min=CDbl(RS("hneg_min")) hneg_max=CDbl(RS("hneg_max")) If abs(hneg_min)>abs(hneg_max) Then hneg_sign=Round(hneg_min,1) Else hneg_sign=Round(hneg_max,1) End If imag_diff=imag_max-imag_min If imag_diff>10 Then bfield="CHG " Else If imag_max>3580 Then If hneg_sign<0 Then bfield="B : BPLUS " bpolarity = +1 Else bfield="A : BMINUS" bpolarity = -1 End If Elseif imag_max>50 Then bfield="???? " Else bfield=" BZERO " bpolarity = 0 End If End If If CInt(RS("run")) = last_run Then this_is_last_run = 1 Else this_is_last_run = 0 End If If Not IsNull(RS("nevents")) Then te =CDbl(RS("nevents")) Else te = 0 End If If Not IsNull(RS("nevents_s")) Then ta =CDbl(RS("nevents_s")) Else ta =0 End If If Not IsNull(RS("nback_s")) Then tpnpp = CDbl(RS("nback_s")) Else tnpp = 0 End If If Not IsNull(RS("ncoll_s")) Then tpn2pp2 = CDbl(RS("ncoll_s")) Else tpn2pp2 = 0 End If If Not IsNull(RS("niscol")) Then tiscol = CDbl(RS("niscol")) Else tiscol = 0 End If If Not IsNull(RS("niscolvtx")) Then tiscolvtx = CDbl(RS("niscolvtx")) Else tiscolvtx = 0 End If If bpolarity = 0 Then BZERO_total_events = BZERO_total_events + te BZERO_total_analysed = BZERO_total_analysed + ta BZERO_total_pnppnarrow = BZERO_total_pnppnarrow + tpnpp BZERO_total_pn2pp2narrow = BZERO_total_pn2pp2narrow + tpn2pp2 BZERO_total_iscol = BZERO_total_iscol + tiscol BZERO_total_iscolvtx = BZERO_total_iscolvtx + tiscolvtx End If If bpolarity = 1 Then BPLUS_total_events = BPLUS_total_events + te BPLUS_total_analysed = BPLUS_total_analysed + ta BPLUS_total_pnppnarrow = BPLUS_total_pnppnarrow + tpnpp BPLUS_total_pn2pp2narrow = BPLUS_total_pn2pp2narrow + tpn2pp2 BPLUS_total_iscol = BPLUS_total_iscol + tiscol BPLUS_total_iscolvtx = BPLUS_total_iscolvtx + tiscolvtx End If If bpolarity = -1 Then BMINUS_total_events = BMINUS_total_events + te BMINUS_total_analysed = BMINUS_total_analysed + ta BMINUS_total_pnppnarrow = BMINUS_total_pnppnarrow + tpnpp BMINUS_total_pn2pp2narrow = BMINUS_total_pn2pp2narrow + tpn2pp2 BMINUS_total_iscol = BMINUS_total_iscol + tiscol BMINUS_total_iscolvtx = BMINUS_total_iscolvtx + tiscolvtx End If Else bfield="???? " End If runentry = CStr(RS("run")) & " " & bfield & " " & trig_config & " " & CStr(te) & "/" & CStr(ta) & "/" & CStr(tiscolvtx) DataFile.WriteLine(runentry) End If RS.MoveNext Loop DataFile.Close %> <% ' Must display the last trig_config %>
Trigger Cfg Magnet Polarity Total Events Written Analysed PN.PP narrow PN(2).PP(2) narrow IsCollision IsCollision && GoodVertex
<%= old_trig_config %>
BZERO
<%= BZERO_total_events %>
<%= BZERO_total_analysed %>
(<%If BZERO_total_events>0 Then response.Write(Round(BZERO_total_analysed/BZERO_total_events*100,1)) End If %> %)
<%= BZERO_total_pnppnarrow %>
(<%If BZERO_total_events>0 Then response.Write(Round(BZERO_total_pnppnarrow/BZERO_total_events*100,1)) End If %> %)
<%= BZERO_total_pn2pp2narrow %>
(<%If BZERO_total_events>0 Then response.Write(Round(BZERO_total_pn2pp2narrow/BZERO_total_events*100,1)) End If %> %)
<%= BZERO_total_iscol %>
(<%If BZERO_total_events>0 Then response.Write(Round(BZERO_total_iscol/BZERO_total_events*100,1)) End If %> %)
<%= BZERO_total_iscolvtx %>
(<%If BZERO_total_events>0 Then response.Write(Round(BZERO_total_iscolvtx/BZERO_total_events*100,1)) End If %> %)
<%= old_trig_config %>
BPLUS : B
<%= BPLUS_total_events %>
<%= BPLUS_total_analysed %>
(<%If BPLUS_total_events>0 Then response.Write(Round(BPLUS_total_analysed/BPLUS_total_events*100,1)) End If %> %)
<%= BPLUS_total_pnppnarrow %>
(<%If BPLUS_total_events>0 Then response.Write(Round(BPLUS_total_pnppnarrow/BPLUS_total_events*100,1)) End If %> %)
<%= BPLUS_total_pn2pp2narrow %>
(<%If BPLUS_total_events>0 Then response.Write(Round(BPLUS_total_pn2pp2narrow/BPLUS_total_events*100,1)) End If %> %)
<%= BPLUS_total_iscol %>
(<%If BPLUS_total_events>0 Then response.Write(Round(BPLUS_total_iscol/BPLUS_total_events*100,1)) End If %> %)
<%= BPLUS_total_iscolvtx %>
(<%If BPLUS_total_events>0 Then response.Write(Round(BPLUS_total_iscolvtx/BPLUS_total_events*100,1)) End If %> %)
<%= old_trig_config %>
BMINUS : A
<%= BMINUS_total_events %>
<%= BMINUS_total_analysed %>
(<%If BMINUS_total_events>0 Then response.Write(Round(BMINUS_total_analysed/BMINUS_total_events*100,1)) End If %> %)
<%= BMINUS_total_pnppnarrow %>
(<%If BMINUS_total_events>0 Then response.Write(Round(BMINUS_total_pnppnarrow/BMINUS_total_events*100,1)) End If %> %)
<%= BMINUS_total_pn2pp2narrow %>
(<%If BMINUS_total_events>0 Then response.Write(Round(BMINUS_total_pn2pp2narrow/BMINUS_total_events*100,1)) End If %> %)
<%= BMINUS_total_iscol %>
(<%If BMINUS_total_events>0 Then response.Write(Round(BMINUS_total_iscol/BMINUS_total_events*100,1)) End If %> %)
<%= BMINUS_total_iscolvtx %>
(<%If BMINUS_total_events>0 Then response.Write(Round(BMINUS_total_iscolvtx/BMINUS_total_events*100,1)) End If %> %)
<%= trig_config %>
BZERO
<%= BZERO_total_events %>
<%= BZERO_total_analysed %>
(<%If BZERO_total_events>0 Then response.Write(Round(BZERO_total_analysed/BZERO_total_events*100,1)) End If %> %)
<%= BZERO_total_pnppnarrow %>
(<%If BZERO_total_events>0 Then response.Write(Round(BZERO_total_pnppnarrow/BZERO_total_events*100,1)) End If %> %)
<%= BZERO_total_pn2pp2narrow %>
(<%If BZERO_total_events>0 Then response.Write(Round(BZERO_total_pn2pp2narrow/BZERO_total_events*100,1)) End If %> %)
<%= BZERO_total_iscol %>
(<%If BZERO_total_events>0 Then response.Write(Round(BZERO_total_iscol/BZERO_total_events*100,1)) End If %> %)
<%= BZERO_total_iscolvtx %>
(<%If BZERO_total_events>0 Then response.Write(Round(BZERO_total_iscolvtx/BZERO_total_events*100,1)) End If %> %)
<%= trig_config %>
BPLUS : B
<%= BPLUS_total_events %>
<%= BPLUS_total_analysed %>
(<%If BPLUS_total_events>0 Then response.Write(Round(BPLUS_total_analysed/BPLUS_total_events*100,1)) End If %> %)
<%= BPLUS_total_pnppnarrow %>
(<%If BPLUS_total_events>0 Then response.Write(Round(BPLUS_total_pnppnarrow/BPLUS_total_events*100,1)) End If %> %)
<%= BPLUS_total_pn2pp2narrow %>
(<%If BPLUS_total_events>0 Then response.Write(Round(BPLUS_total_pn2pp2narrow/BPLUS_total_events*100,1)) End If %> %)
<%= BPLUS_total_iscol %>
(<%If BPLUS_total_events>0 Then response.Write(Round(BPLUS_total_iscol/BPLUS_total_events*100,1)) End If %> %)
<%= BPLUS_total_iscolvtx %>
(<%If BPLUS_total_events>0 Then response.Write(Round(BPLUS_total_iscolvtx/BPLUS_total_events*100,1)) End If %> %)
<%= trig_config %>
BMINUS : A
<%= BMINUS_total_events %>
<%= BMINUS_total_analysed %>
(<%If BMINUS_total_events>0 Then response.Write(Round(BMINUS_total_analysed/BMINUS_total_events*100,1)) End If %> %)
<%= BMINUS_total_pnppnarrow %>
(<%If BMINUS_total_events>0 Then response.Write(Round(BMINUS_total_pnppnarrow/BMINUS_total_events*100,1)) End If %> %)
<%= BMINUS_total_pn2pp2narrow %>
(<%If BMINUS_total_events>0 Then response.Write(Round(BMINUS_total_pn2pp2narrow/BMINUS_total_events*100,1)) End If %> %)
<%= BMINUS_total_iscol %>
(<%If BMINUS_total_events>0 Then response.Write(Round(BMINUS_total_iscol/BMINUS_total_events*100,1)) End If %> %)
<%= BMINUS_total_iscolvtx %>
(<%If BMINUS_total_events>0 Then response.Write(Round(BMINUS_total_iscolvtx/BMINUS_total_events*100,1)) End If %> %)
<% Connection.Close time_tot=CStr(round(24*60*60*(Now()-time_start),1)) response.write("
" & Time_ora & "," & Time_tot) %>

Notes :

  1. Official Start of PR01 is at Run Number 7267, only Runs of type ALLBEAM go into the above counts
  2. Numbers in the above table are from the output of Data Validation running on RCF and reflect the actual number of triggers recorded on tape for PHOBOS. You may have to wait for Data Validation to complete digesting latest data for an up-to-the-hour account.
  3. Above counts are approximate (IsCol && Good Vtx is accurate to within +/- ~100). Some runs may be so short that magnetic field information was not logged in the database for them and they would therefore not be included in the above count.
  4. Auto-generated list of runs going into above counts can be found here : RunList.txt
    These are runs that have survived Data Validation (Status=0), have a valid magnetic field log and a valid trigger configuration log.
    Note that due to (3) above, some runs are tagged as having (?) magnetic field, and are therefore not included in the above counts : you may need to look at their runlogs individually

 

Development Notes :

  1. 08/15/01 For now, trigger configuration logs are being put in by hand, pending implementation of automatic system of setting and logging TriggerConfigs from DAQ.