\n"; echo "

2008 E04-007 Production Kinematics Summary

\n"; #echo "(runs only on L1 6cm)\n"; #echo "
"; #echo "

Under Construction

"; echo "
"; echo "

"; echo ""; echo "click for Runlist page"; echo ""; echo "

"; echo "
"; // Get a list of unique kinematic names $ana_query = "SELECT KineName, count(KineName) FROM AnalysisInfo "; $ana_query .= " WHERE Production=1 "; $ana_query .= " GROUP BY KineName HAVING COUNT(KineName)>1"; $ana_result=mysql_query($ana_query); $ana_nrows=mysql_numrows($ana_result); for($i=0; $i<$ana_nrows; $i++) { $kine=mysql_result($ana_result,$i,"KineName"); $kineArray[$i]= $kine; } // Gather the list of runs in the RunInfo table // we use the "Production" tag // in the AnalysisInfo table below.. $runinfo_query = "SELECT RunNumber FROM RunInfo "; #$runinfo_query .= " WHERE TargetName=\"L1 6cm\""; $runinfo_query .= " ORDER BY RunNumber DESC"; $runinfo_result = mysql_query($runinfo_query); $runinfo_nrows = mysql_numrows($runinfo_result); for($i=0; $i<$runinfo_nrows; $i++) { $run=mysql_result($runinfo_result,$i,"RunNumber"); $runList[$i]=$run; } // Establish the Array sums (arrays of kinematics) foreach ($kineArray as $kine) { $events[$kine]=0; $time[$kine]=0.; $u1charge[$kine]=0.; $u3charge[$kine]=0.; $u10charge[$kine]=0.; $d1charge[$kine]=0.; $d3charge[$kine]=0.; $d10charge[$kine]=0.; $t1pre[$kine]=0; $t1real[$kine]=0; $t2pre[$kine]=0; $t2real[$kine]=0; $t3pre[$kine]=0; $t3real[$kine]=0; $t4pre[$kine]=0; $t4real[$kine]=0; $t5pre[$kine]=0; $t5real[$kine]=0; $t6pre[$kine]=0; $t6real[$kine]=0; $t7pre[$kine]=0; $t7real[$kine]=0; $t8pre[$kine]=0; $t8real[$kine]=0; } // Loop through the runlist, and fill the appropriate kinematic sums // if they're "Production" runs foreach ($runList as $irun) { $ana_query = " SELECT KineName,Production FROM AnalysisInfo "; $ana_query .= " WHERE RunInfo_RunNumber=$irun"; $ana_query .= " ORDER BY anaID DESC LIMIT 1"; $ana_result=mysql_query($ana_query); $ana_nrows=mysql_numrows($ana_result); if($ana_nrows!=0) { $isproduction=mysql_result($ana_result,0,"Production"); if(!$isproduction) { continue; } $current_kine=mysql_result($ana_result,0,"KineName"); if($ana_nrows!=0) { $scaler_query = " SELECT * FROM scalerinfo "; $scaler_query .= " WHERE RunInfo_RunNumber=$irun "; $scaler_query .= " ORDER BY scalerID DESC LIMIT 1"; $scaler_result=mysql_query($scaler_query); $scaler_nrows=mysql_numrows($scaler_result); if($scaler_nrows!=0) { $events[$current_kine] += mysql_result($scaler_result,0,"Events")/1000000.; $time[$current_kine] += mysql_result($scaler_result,0,"Time"); $u1charge[$current_kine] += mysql_result($scaler_result,0,"u1charge"); $u3charge[$current_kine] += mysql_result($scaler_result,0,"u3charge"); $u10charge[$current_kine] += mysql_result($scaler_result,0,"u10charge"); $d1charge[$current_kine] += mysql_result($scaler_result,0,"d1charge"); $d3charge[$current_kine] += mysql_result($scaler_result,0,"d3charge"); $d10charge[$current_kine] += mysql_result($scaler_result,0,"d10charge"); $t1pre[$current_kine] += mysql_result($scaler_result,0,"T1prescaled")/1000000.; $t1real[$current_kine] += mysql_result($scaler_result,0,"T1real")/1000000.; $t2pre[$current_kine] += mysql_result($scaler_result,0,"T2prescaled")/1000000.; $t2real[$current_kine] += mysql_result($scaler_result,0,"T2real")/1000000.; $t3pre[$current_kine] += mysql_result($scaler_result,0,"T3prescaled")/1000000.; $t3real[$current_kine] += mysql_result($scaler_result,0,"T3real")/1000000.; $t4pre[$current_kine] += mysql_result($scaler_result,0,"T4prescaled")/1000000.; $t4real[$current_kine] += mysql_result($scaler_result,0,"T4real")/1000000.; $t5pre[$current_kine] += mysql_result($scaler_result,0,"T5prescaled")/1000000.; $t5real[$current_kine] += mysql_result($scaler_result,0,"T5real")/1000000.; $t6pre[$current_kine] += mysql_result($scaler_result,0,"T6prescaled")/1000000.; $t6real[$current_kine] += mysql_result($scaler_result,0,"T6real")/1000000.; $t7pre[$current_kine] += mysql_result($scaler_result,0,"T7prescaled")/1000000.; $t7real[$current_kine] += mysql_result($scaler_result,0,"T7real")/1000000.; $t8pre[$current_kine] += mysql_result($scaler_result,0,"T8prescaled")/1000000.; $t8real[$current_kine] += mysql_result($scaler_result,0,"T8real")/1000000.; # echo "$current_kine $irun
"; } # else { # Should probably make a list of those that were skipped # echo "$current_kine $irun skipped
"; # } $previous_kine=$current_kine; } } } echo "

\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo ""; foreach ($kineArray as $kine) { if($events[$kine]==0) continue; echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo ""; echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } echo "
KinematicCODA Events (106)Time (m)/(h) Charge (C) Trigger Counts (pre/real) (106)
u1u3u10d1d3d10T1T2T3T4T5T6T7T8
"; echo "$kine"; echo ""; $evt = round($events[$kine],3); echo "$evt"; echo ""; $minutes = round($time[$kine],1); echo "$minutes"; echo ""; $charge = round($u1charge[$kine],3); echo "$charge"; echo ""; $charge = round($u3charge[$kine],3); echo "$charge"; echo ""; $charge = round($u10charge[$kine],3); echo "$charge"; echo ""; $charge = round($d1charge[$kine],3); echo "$charge"; echo ""; $charge = round($d3charge[$kine],3); echo "$charge"; echo ""; $charge = round($d10charge[$kine],3); echo "$charge"; echo ""; $pre=round($t1pre[$kine],3); echo "$pre"; echo ""; $pre=round($t2pre[$kine],3); echo "$pre"; echo ""; $pre=round($t3pre[$kine],3); echo "$pre"; echo ""; $pre=round($t4pre[$kine],3); echo "$pre"; echo ""; $pre=round($t5pre[$kine],3); echo "$pre"; echo ""; $pre=round($t6pre[$kine],3); echo "$pre"; echo ""; $pre=round($t7pre[$kine],3); echo "$pre"; echo ""; $pre=round($t8pre[$kine],3); echo "$pre"; echo "
"; $hours = round($time[$kine]/60.,1); echo "$hours"; echo ""; $real=round($t1real[$kine],1); echo "$real"; echo ""; $real=round($t2real[$kine],1); echo "$real"; echo ""; $real=round($t3real[$kine],1); echo "$real"; echo ""; $real=round($t4real[$kine],1); echo "$real"; echo ""; $real=round($t5real[$kine],1); echo "$real"; echo ""; $real=round($t6real[$kine],1); echo "$real"; echo ""; $real=round($t7real[$kine],1); echo "$real"; echo ""; $real=round($t8real[$kine],1); echo "$real"; echo "
\n"; echo "\n"; mysql_close(); ?>