<%@ LANGUAGE="VBScript" %> <% timedate=Request("timedate") Set Connection = Server.CreateObject("ADODB.Connection") Connection.Mode = adModeRead Connection.Open phdb_rd If Not IsEmpty(request.form("Latest")) Then timedate="" End If If timedate="" Then SQLStmtX = " select to_char(sysdate,'MM/DD/YYYY HH24:MI:SS') timedate from dual " Set RSX = Connection.Execute(SQLStmtX) timedate = CStr(RSX("timedate")) End If If Not IsDate(timedate) Then message="Wrong Time/Date format " & timedate %> <% End If timedate_par=replace(timedate," ","%20") SQLStmt = "select to_char(logdate,'MM/DD/YYYY HH24:MI:SS') curtime from phoffline.daq_scalers " SQLStmt = SQLStmt & "where logdate between to_date('" & timedate & "','MM/DD/YYYY HH24:MI:SS')-5/24/60 and to_date('" & timedate & "','MM/DD/YYYY HH24:MI:SS')" Set RSD = Connection.Execute(SQLStmt) timedate = CStr(RSD("curtime")) curtime = RSD("curtime") 'response.write(curtime) 'response.write(timedate) SQLStmt = "select to_char(logdate,'MM/DD/YYYY HH24:MI:SS') prevtime from phoffline.daq_scalers " SQLStmt = SQLStmt & "where logdate between to_date('" & timedate & "','MM/DD/YYYY HH24:MI:SS')-10/24/60 and to_date('" & timedate & "','MM/DD/YYYY HH24:MI:SS')" Set RSP = Connection.Execute(SQLStmt) prevtime = RSP("prevtime") 'response.write(prevtime) 'SQLStmt = "select logdate from phoffline.daq_scalers " 'SQLStmt = SQLStmt & "where logdate between to_date('" & timedate & "','MM/DD/YYYY HH24:MI:SS')-5/24/60 and to_date('" & timedate & "','MM/DD/YYYY HH24:MI:SS')" 'Set RSL = Connection.Execute(SQLStmt) 'prevtime = RSL("logdate") 'response.write(prevtime) ' one can print it using following: 'response.write(FormatDateTime(prevtime,2)) 'response.write(" ") 'response.write(FormatDateTime(prevtime,3)) difftime = DateDiff("s",prevtime,curtime) 'response.write(difftime) %> Phobos Trigger Scalers

               

<% SQLStmt = "select to_char(logdate,'MM/DD/YYYY HH24:MI:SS')," SQLStmt = SQLStmt & "ch_00,ch_01,ch_02,ch_03,ch_04,ch_05,ch_06,ch_07,ch_08,ch_09,ch_10,ch_11,ch_12,ch_13,ch_14,ch_15 " SQLStmt = SQLStmt & "from phoffline.daq_scalers " SQLStmt = SQLStmt & "where logdate = to_date('" & timedate & "','MM/DD/YYYY HH24:MI:SS')" 'response.write(SQLStmt) Set RS = Connection.Execute(SQLStmt) SQLStmt = "select to_char(logdate,'MM/DD/YYYY HH24:MI:SS')," SQLStmt = SQLStmt & "ch_00,ch_01,ch_02,ch_03,ch_04,ch_05,ch_06,ch_07,ch_08,ch_09,ch_10,ch_11,ch_12,ch_13,ch_14,ch_15 " SQLStmt = SQLStmt & "from phoffline.daq_scalers " SQLStmt = SQLStmt & "where logdate = to_date('" & prevtime & "','MM/DD/YYYY HH24:MI:SS')" 'response.write(SQLStmt) Set RSPrev = Connection.Execute(SQLStmt) dch9 = (CLng(RS("ch_09")) - CLng(RSPrev("ch_09")))/difftime %>

Phobos Trigger Scalers

Scaler name Source Content Frequency
[Hz]
Collision triggers A8B <%response.write RS("ch_09")%> <%response.write (CLng(RS("ch_09"))-CLng(RSPrev("ch_09")))/difftime%>
Recorded Collisions L1.CO11 <%response.write RS("ch_01")%> <%response.write (CLng(RS("ch_01"))-CLng(RSPrev("ch_01")))/difftime%>
Recorded triggers L1.CO0 <%response.write RS("ch_13")%> <%response.write (CLng(RS("ch_13"))-CLng(RSPrev("ch_13")))/difftime%>
Pn&Pp Narrow A2B <%response.write RS("ch_00")%> <%response.write (CLng(RS("ch_00"))-CLng(RSPrev("ch_00")))/difftime%>
RHIC scaler D8A <%response.write RS("ch_02")%> <%response.write (CLng(RS("ch_02"))-CLng(RSPrev("ch_02")))/difftime%>
Pn A1A <%response.write RS("ch_03")%> <%response.write (CLng(RS("ch_03"))-CLng(RSPrev("ch_03")))/difftime%>
Pp A1B <%response.write RS("ch_04")%> <%response.write (CLng(RS("ch_04"))-CLng(RSPrev("ch_04")))/difftime%>
Pn&Pp Wide A2C <%response.write RS("ch_08")%> <%response.write (CLng(RS("ch_08"))-CLng(RSPrev("ch_08")))/difftime%>
Zn D6A <%response.write RS("ch_05")%> <%response.write (CLng(RS("ch_05"))-CLng(RSPrev("ch_05")))/difftime%>
Zp D6B <%response.write RS("ch_06")%> <%response.write (CLng(RS("ch_06"))-CLng(RSPrev("ch_06")))/difftime%>
Zn&Zp Narrow D3B <%response.write RS("ch_07")%> <%response.write (CLng(RS("ch_07"))-CLng(RSPrev("ch_07")))/difftime%>
Central Trigger A12B <%response.write RS("ch_12")%> <%response.write (CLng(RS("ch_12"))-CLng(RSPrev("ch_12")))/difftime%>
Crossing clock C12.2 <%response.write RS("ch_15")%>