\n"; if($production) { echo "

2008 E04-007 Production Runlist

\n"; echo "
"; echo "
"; } else { echo "

2008 E04-007 Runlist

\n"; echo "(lightblue background = production)"; } mysql_connect(adaqh1,"pion"); @mysql_select_db("e04007") or die("Unable to select database"); echo "

"; echo ""; echo "click for Kinematic Summary page"; echo ""; echo "

"; echo "
"; if($production) { echo ""; echo "All Runs\n"; echo "    "; } else { echo ""; echo "Production Only\n"; echo "    "; } if($trigger) { echo ""; echo "Trigger Data Off\n"; echo "    "; } else { echo ""; echo "Trigger Data On\n"; echo "    "; } if($charge) { echo ""; echo "Charge Off\n"; echo "    "; } else { echo ""; echo "Charge On\n"; echo "    "; } if($colli) { echo ""; echo "No Collimators\n"; echo "    "; } else { echo ""; echo "Show Collimators\n"; echo "    "; } echo "
\n"; if($comment) { echo ""; echo "No Comments\n"; echo "    "; } else { echo ""; echo "Show Shift Worker Comments\n"; echo "    "; } if($spec) { echo ""; echo "No Spect. Info\n"; echo "    "; } else { echo ""; echo "Show Spect. Info\n"; echo "    "; } #echo "
"; #echo "trigger = $trigger
production = $production
charge = $charge"; #echo "
colli = $colli
spec = $spec"; #echo "\n"; if($production) { $query = "SELECT * FROM RunInfo WHERE RunNumber<20000&&TargetName=\"L1 6cm\" ORDER BY RunNumber DESC"; } else { $query = "SELECT * FROM RunInfo WHERE RunNumber<20000 ORDER BY RunNumber DESC"; } $run_info_result=mysql_query($query); $run_info_nrows=mysql_numrows($run_info_result); echo "
"; echo "

\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if($spec) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; } if($trigger) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } if($charge) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } if($colli) { echo "\n"; echo "\n"; } if($comment) { echo "\n"; } $i=0; $bkg_color="white"; while($i<$run_info_nrows) { $runnumber=mysql_result($run_info_result,$i,"RunNumber"); $target=mysql_result($run_info_result,$i,"TargetName"); $scaler_query = " SELECT * FROM scalerinfo WHERE RunInfo_RunNumber=$runnumber "; $scaler_query .= "ORDER BY scalerID DESC LIMIT 1"; $scaler_info_result=mysql_query($scaler_query); $scaler_info_nrows=mysql_numrows($scaler_info_result); if($scaler_info_nrows==0) { $i++; continue; } $ana_query = " SELECT * FROM AnalysisInfo "; $ana_query .= " WHERE RunInfo_RunNumber=$runnumber"; $ana_query .= " ORDER BY anaID DESC LIMIT 1"; $ana_result=mysql_query($ana_query); $ana_nrows=mysql_numrows($ana_result); if($ana_nrows==0) { $kinematic = ""; } else { $kinematic = mysql_result($ana_result,0,"KineName"); $isproduction = mysql_result($ana_result,0,"Production"); } if($production&&!$isproduction) { $i++; continue; } if($isproduction) { $bkg_color="lightblue"; } else { $bkg_color="white"; } $events = mysql_result($scaler_info_result,0,"Events"); $time = mysql_result($scaler_info_result,0,"Time"); echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if($spec) { $runinfo_query = " SELECT * FROM RunInfo WHERE RunNumber=$runnumber "; $runinfo_result=mysql_query($runinfo_query); $lhrs_p0 = mysql_result($runinfo_result,0,"LeftMomentum"); $lhrs_ang = mysql_result($runinfo_result,0,"LeftAngle"); $bb_I = mysql_result($runinfo_result,0,"BBCurrent"); $bb_ang = mysql_result($runinfo_result,0,"BBAngle"); echo "\n"; echo "\n"; echo "\n"; echo "\n"; } if($trigger) { for($j=1; $j<=8; $j++) { $pre = mysql_result($scaler_info_result,0,"T".$j."prescaled"); $real = mysql_result($scaler_info_result,0,"T".$j."real"); echo "\n"; } } if($charge) { $bcmarray = array("u1","u3","u10","d1","d3","d10"); foreach ($bcmarray as $bcm) { echo "\n"; } } if($colli) { $lhrs_colli = mysql_result($scaler_info_result,0,"lhrs_colli"); $bb_colli = mysql_result($scaler_info_result,0,"bb_colli"); echo "\n"; echo "\n"; } if($comment) { $sw_comment = mysql_result($scaler_info_result,0,"sw_comment"); echo "\n"; } echo "\n"; $i++; } echo "
KinematicRunTargetTime (minutes)Events LHRS p0 (GeV/c) LHRS angle (deg) BigBite I (A) BigBite angle (deg) T1 (pre/real) T2 (pre/real) T3 (pre/real) T4 (pre/real) T5 (pre/real) T6 (pre/real) T7 (pre/real) T8 (pre/real) u1 (C) u3 (C) u10 (C) d1 (C) d3 (C) d10 (C) LHRS Colli BB Colli Comment
\n"; echo "$kinematic\n"; echo "\n"; echo "$runnumber\n"; echo "\n"; echo "$target\n"; echo "\n"; echo "$time"; echo "\n"; echo "$events\n"; echo "\n"; echo "$lhrs_p0\n"; echo "\n"; echo "$lhrs_ang\n"; echo "\n"; echo "$bb_I\n"; echo "\n"; echo "$bb_ang\n"; echo "\n"; echo "$pre / $real\n"; echo "\n"; $chg = mysql_result($scaler_info_result,0,$bcm."charge"); echo "$chg\n"; echo "\n"; echo "$lhrs_colli\n"; echo "\n"; echo "$bb_colli\n"; echo "\n"; echo "$sw_comment\n"; echo "
\n"; echo "

\n"; mysql_close(); ?>