Jump to content

ROOT Programs

From Luter 345 Experiments
Revision as of 16:00, 17 November 2014 by en>Mcelhenny
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

ROOT

Installing ROOT

Download ROOT here:

  • root.cern.ch/drupal/

Set up ROOT on your computer following the documentation given.

ROOT Analysis

We wrote a root program that takes in the text files of data saved by hpcbench. It stores the time data for each run and length in a three dimensional array. We used the root function hist to create histograms of each run, including the different paths from computer A to computer B and vice versa. After visually inspecting the data to make sure it was close to a Gaussian curve, we noticed that the data was consistantly longer times in the B-A run. We then used a function getRMS() and getMean() to find the mean and RMS of each histogram and divided the RMS by n to find the error in the time measurements.

mean = hist[][][] -> getMean();
err = hist[][][] -> getRMS();

Since the time it took was not just the length of the cable, but rather the time it took to go and come back, the lengths were twice as large as we measured. Both errors were taken into account, the error from measuring the cable and the errors found in the histograms. The error we used for the length measurements were based on the number of times we had to flip the measuring tape around. The errors, and the length measurements, are as follows.

double length[5] = {.964*2, 20.764*2, 40.606*2, 60.036*2, 80.474*2};
double lenErr[5] = {.01, .03, .05, .07, .07};

We plotted both the mean time and the error in the time and the measurements for each cord length plus the error in the cord measurement using the function TGraphErrors() to create a scatterplot of the data.

TGraphErrors *graph = new TGraphErrors(4,lenth,averageTime,lenErr,timeErr);

After plotting the data in the scatter plot, we now had to find the speed of light. Since

distance=velocity*time so velocity=distance/time

We fit the data with a first order polynomial since the equation was linear.

graph -> Fit(poly1)

We could then find the slope of the line and find the speed of light. Since there was a constant factor of approximately 2/3 that slowed the light down in the cable, we took that into account when calculating our answer.