Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

rootAngleHist Class Reference

This class stores the the flux vs. incident angle information for creating a graph. More...

#include <rootAngleHist.h>

List of all members.

Public Methods

 rootAngleHist (int bins)
 Constructor takes number of bins for histogram. More...

 ~rootAngleHist (void)
 rootAngleHist (const rootAngleHist &oldHist)
void setTitle (std::string title)
 Sets the title for the graphs. More...

void setPhiXLabel (std::string label)
 Sets the x-axis label on the flux vs. azimuth angle graph. More...

void setPhiYLabel (std::string label)
 Sets the y-axis label on the flux vs. azimuth angle graph. More...

void setThetaXLabel (std::string label)
 Sets the x-axis label on the flux vs. zenith angle graph. More...

void setThetaYLabel (std::string label)
 Sets the y-axis label on the flux vs. zenith angle graph. More...

void setGraphType (const char *graph_type)
 Sets the y-axis scaling for the graphs Valid values are "linear" and "log". More...

void storeTheta (double theta_value)
 Increments the temporary bin corresponding to parameter theta. More...

void storePhi (double phi_value)
 Increments the temporary bin corresponding to parameter phi. More...

double retrievePhiCount (int binNumber)
 Retrieves the phi angle raw count from the specified bin. More...

double retrievePhiFlux (int binNumber)
 Retrieves the phi angle flux from the specified bin. More...

double retrievePhiFluxUncertainty (int binNumber)
 Retrieves the phi angle flux uncertainty from the specified bin. More...

double retrieveThetaCount (int binNumber)
 Retrieves the theta angle raw count from the specified bin. More...

double retrieveThetaFlux (int binNumber)
 Retrieves the theta angle flux from the specified bin. More...

double retrieveThetaFluxUncertainty (int binNumber)
 Retrieves the theta angle flux uncertainty from the specified bin. More...

double retrievePhiAngle (int binNumber)
 Retrieves the angle in degrees associated with the bin number. More...

double retrieveThetaAngle (int binNumber)
 Retrives the value of cos(theta) associated with the bin number. More...

void apply (double scale_factor)
 Applies the scaling factor to the raw counts to obtain the fluxes. More...

void reset (void)
 This function clears everything in the object except for the number of bins. More...

void draw (double scale_factor, std::string mode, int current_plot, int total_plots)
 Writes the contents of the flux and flux uncertainty histograms to a script file. More...

void writeFile (double scale_factor, std::ostream &out_file)
 Not yet implemented. More...


Private Types

enum  graphType { linear, log }

Private Attributes

rootHisttheta_hist
 histogram for zenith angle fluxes. More...

rootHisttheta_sigma_hist
 histogram to store zenith angle uncertainties. More...

rootHisttheta_raw_hist
 histogram to store zenith agnle raw counts. More...

rootHistphi_hist
 histogram for azimuthal angle fluxes. More...

rootHistphi_sigma_hist
 histogram to store azimuthal angle uncertainties. More...

rootHistphi_raw_hist
 histogram to store azimuthal angle raw counts. More...

const int num_bins
 number of bins for the histogram. More...

std::string graphTitle
 title of graph. More...

std::string PhiXLabel
 phi graph x axis title. More...

std::string PhiYLabel
 phi graph y axis title. More...

std::string ThetaXLabel
 theta graph x axis title. More...

std::string ThetaYLabel
 theta graph y axis title. More...

enum rootAngleHist::graphType currentType
 Determines whether the y-axis will be linear or logarithmic. More...


Detailed Description

This class stores the the flux vs. incident angle information for creating a graph.

Normal usage typically entails 1. calling the constructor 2. calling setTitle, setXLabel, setYLabel, etc. 3. storing energies in the object using store 4. calling apply to normalize the histogram 5. calling draw or writeFile to output the results

Author:
Theodore Hierath

Definition at line 25 of file rootAngleHist.h.


Member Enumeration Documentation

enum rootAngleHist::graphType [private]
 

Enumeration values:
linear 
log 

Definition at line 125 of file rootAngleHist.h.


Constructor & Destructor Documentation

rootAngleHist::rootAngleHist int    bins
 

Constructor takes number of bins for histogram.

Definition at line 16 of file rootAngleHist.cxx.

References currentType, graphTitle, linear, phi_hist, phi_raw_hist, phi_sigma_hist, PhiXLabel, PhiYLabel, theta_hist, theta_raw_hist, theta_sigma_hist, ThetaXLabel, and ThetaYLabel.

00016                                      : num_bins(bins)
00017 {
00018     theta_hist = new rootHist(bins);
00019     theta_sigma_hist = new rootHist(bins);
00020     theta_raw_hist = new rootHist(bins);
00021     phi_hist = new rootHist(bins);
00022     phi_sigma_hist = new rootHist(bins);
00023     phi_raw_hist = new rootHist(bins);
00024     currentType = linear;
00025     graphTitle = "No Title";
00026     PhiXLabel = "";
00027     PhiYLabel = "";
00028     ThetaXLabel = "";
00029     ThetaYLabel = "";
00030 }

rootAngleHist::~rootAngleHist void   
 

Definition at line 32 of file rootAngleHist.cxx.

References phi_hist, phi_raw_hist, phi_sigma_hist, theta_hist, theta_raw_hist, and theta_sigma_hist.

00033 {
00034     delete theta_hist;
00035     delete theta_sigma_hist;
00036     delete theta_raw_hist;
00037     delete phi_hist;
00038     delete phi_sigma_hist;
00039     delete phi_raw_hist;
00040 }

rootAngleHist::rootAngleHist const rootAngleHist &    oldHist
 

Definition at line 42 of file rootAngleHist.cxx.

References currentType, graphTitle, num_bins, phi_hist, phi_raw_hist, phi_sigma_hist, PhiXLabel, PhiYLabel, theta_hist, theta_raw_hist, theta_sigma_hist, ThetaXLabel, ThetaYLabel, and rootHist::updateBin().

00042                                                          : num_bins(oldHist.num_bins)
00043 {
00044     theta_hist = new rootHist(num_bins);
00045     theta_sigma_hist = new rootHist(num_bins);
00046     theta_raw_hist = new rootHist(num_bins);
00047     phi_hist = new rootHist(num_bins);
00048     phi_sigma_hist = new rootHist(num_bins);
00049     phi_raw_hist = new rootHist(num_bins);
00050     
00051     for(int i = 0; i < num_bins; i++)
00052     {
00053         double oldCount = (oldHist.theta_hist)->retrieveBin(i);
00054         theta_hist->updateBin(i, oldCount);
00055         
00056         oldCount = (oldHist.theta_sigma_hist)->retrieveBin(i);
00057         theta_sigma_hist->updateBin(i, oldCount);
00058         
00059         oldCount = (oldHist.theta_raw_hist)->retrieveBin(i);
00060         theta_raw_hist->updateBin(i, oldCount);
00061         
00062         oldCount = (oldHist.phi_hist)->retrieveBin(i);
00063         phi_hist->updateBin(i, oldCount);
00064         
00065         oldCount = (oldHist.phi_sigma_hist)->retrieveBin(i);
00066         phi_sigma_hist->updateBin(i, oldCount);
00067         
00068         oldCount = (oldHist.phi_raw_hist)->retrieveBin(i);
00069         phi_raw_hist->updateBin(i, oldCount);
00070     }
00071     currentType = oldHist.currentType;
00072     graphTitle = oldHist.graphTitle;
00073     ThetaXLabel = oldHist.ThetaXLabel;
00074     ThetaYLabel = oldHist.ThetaYLabel;
00075     PhiXLabel = oldHist.PhiXLabel;
00076     PhiYLabel = oldHist.PhiYLabel;
00077 }


Member Function Documentation

void rootAngleHist::apply double    scale_factor
 

Applies the scaling factor to the raw counts to obtain the fluxes.

This function clears the raw count histograms, stores the flux values in the flux histograms, and calculates the uncertainties. If there was a previous value in the flux and flux uncertainty histograms, this function does not overwrite the values, but adds them together. This function must be used before the draw member function.

Definition at line 172 of file rootAngleHist.cxx.

References num_bins, phi_hist, phi_raw_hist, phi_sigma_hist, rootHist::retrieveBin(), theta_hist, theta_raw_hist, theta_sigma_hist, and rootHist::updateBin().

Referenced by rootplot::rootplot().

00173 {
00174     for(int i = 0; i < num_bins; ++i)
00175     {
00176         double current_flux = theta_hist->retrieveBin(i);
00177         double current_count = theta_raw_hist->retrieveBin(i);
00178         current_flux += (current_count * scale_factor);
00179         theta_hist->updateBin(i,current_flux);
00180         
00181         // calculate uncertainty by addition under quadrature
00182         current_flux = sqrt(pow(theta_sigma_hist->retrieveBin(i),2)+current_count) * scale_factor;
00183         theta_sigma_hist->updateBin(i,current_flux);
00184         
00185         // clear temporary array
00186         theta_raw_hist->updateBin(i,0);
00187         
00188         current_flux = phi_hist->retrieveBin(i);
00189         current_count = phi_raw_hist->retrieveBin(i);
00190         current_flux += (current_count * scale_factor);
00191         phi_hist->updateBin(i,current_flux);
00192         
00193         // calculate uncertainty
00194         current_flux = sqrt(pow(phi_sigma_hist->retrieveBin(i),2)+current_count) * scale_factor;
00195         phi_sigma_hist->updateBin(i,current_flux);
00196         
00197         // clear temporary array
00198         phi_raw_hist->updateBin(i,0);
00199     }
00200 }

void rootAngleHist::draw double    scale_factor,
std::string    mode,
int    current_plot,
int    total_plots
 

Writes the contents of the flux and flux uncertainty histograms to a script file.

This file is then interpreted by root.

Parameters:
scale_factor  This is a final scale factor applied to the graphs.
mode  This can be "normal", "begin", or "end". Normal means that the draw function for this object will be used alone. Begin means that this draw function is first called before the corresponding one for rootEnergyHist. End means that this draw function is first called after the draw function for rootEnergyHist.
current_plot  This is the number of times this function has been called. If it is the first time it is called, this number should be '0'. This is used by the function so that it knows if it is at the beginning, middle, or end of the script file.
total_plots  This is the total number of plots that will be graphed. This is used in conjunction with current_plot so that the function knows when the script file should end.

Definition at line 221 of file rootAngleHist.cxx.

References graphTitle, num_bins, PhiXLabel, PhiYLabel, retrievePhiFlux(), retrievePhiFluxUncertainty(), retrieveThetaFlux(), retrieveThetaFluxUncertainty(), ThetaXLabel, and ThetaYLabel.

Referenced by rootplot::rootplot().

00222 {
00223     char *window_title = "Graph Window";
00224     
00225     if(current_plot >= total_plots)
00226     {
00227         std::cerr << "Error:  Invalid plot number" << std::endl;
00228         exit(0);
00229     }
00230     
00231     if(current_plot == 0)
00232     {
00233         std::ofstream out_file;
00234         
00235         if(mode != "end")
00236         {
00237             out_file.open("graph.cxx");
00238             
00239             if(false == out_file.is_open())
00240             {
00241                 std::cerr << "Unable to open temporary file for writing." << std::endl;
00242                 exit(0);
00243             }
00244             
00245             out_file << 
00246                 "{\n"
00247                 "   gROOT->Reset();\n";
00248         }
00249         else
00250         {
00251             out_file.open("graph.cxx", std::ios::app);   
00252         }
00253         
00254         out_file <<         
00255             "   char *angle_window_title = \"" << window_title << "\";\n"
00256             "   char *theta_graph_title = \"" << "Particle Flux vs. Zenith Angle" << "\";\n"
00257             "   char *phi_graph_title = \"" << "Particle Flux vs. Azimuth Angle" << "\";\n"
00258             "   char *theta_y_label = \"" << ThetaYLabel << "\";\n"
00259             "   char *theta_x_label = \"" << ThetaXLabel << "\";\n"
00260             "   char *phi_y_label = \"" << PhiYLabel << "\";\n"
00261             "   char *phi_x_label = \"" << PhiXLabel << "\";\n"
00262             "   int num_bins = "<< num_bins << ";\n"
00263             "   double theta_angle[num_bins];\n"
00264             "   double e_theta_angle[num_bins];\n"
00265             "   double phi_angle[num_bins];\n"
00266             "   double e_phi_angle[num_bins];\n"
00267             
00268             "   for(int i = 0; i < num_bins; i++) {\n"
00269             "      theta_angle[i] = (i+0.5) / num_bins * 2 - 1;\n"
00270             "      e_theta_angle[i] = 0;\n"
00271             "      phi_angle[i] = (double(i)+0.5)/double(num_bins)*360;\n"
00272             "      e_phi_angle[i] = 0;\n"
00273             "   }\n"
00274             
00275             "   //                 name, title, wtopx, wtopy, ww, wh\n"
00276             "   c2 = new TCanvas(\"c2\",angle_window_title, 200, 200, 700, 500);\n"
00277             "   c2->SetGrid();\n"
00278             "   c2->GetFrame()->SetFillColor(21);\n"
00279             "   c2->GetFrame()->SetBorderSize(12);\n"
00280             "   c3 = new TCanvas(\"c3\",angle_window_title, 200, 200, 700, 500);\n"
00281             "   c3->SetGrid();\n"
00282             "   c3->GetFrame()->SetFillColor(21);\n"
00283             "   c3->GetFrame()->SetBorderSize(12);\n";
00284         
00285         out_file << 
00286             "   theta_leg = new TLegend(0.73,0.83,0.99,0.99);\n"
00287             "   phi_leg = new TLegend(0.73,0.83,0.99,0.99);\n"
00288             "   double scale_factor" << current_plot << " = " << scale_factor << ";\n"
00289             "   double theta_count" << current_plot << "[] = {\n";
00290         {for(int i = 0; i < num_bins; i++)
00291             out_file << std::setw(5) << retrieveThetaFlux(i) << (i%5==4? ",\n" : ",");
00292         }
00293         
00294         out_file <<
00295             "   };\n"
00296             "   double phi_count" << current_plot << "[] = {\n";
00297         {for(int i = 0; i < num_bins; i++)
00298             out_file << std::setw(5) << retrievePhiFlux(i) << (i%5==4? ",\n" : ",");
00299         }
00300         
00301         out_file << 
00302             "   };\n"
00303             "   double upper_angle;"
00304             "   double lower_angle;"
00305             "   double e_theta_count" << current_plot << "[] = {\n";
00306         {for(int i = 0; i < num_bins; i++)
00307             out_file << std::setw(5) << retrieveThetaFluxUncertainty(i) << (i%5==4? ",\n" : ",");
00308         }
00309         out_file <<
00310             "  };\n"
00311             "   double e_phi_count" << current_plot << "[] = {\n";
00312         {for(int i = 0; i < num_bins; i++)
00313             out_file << std::setw(5) << retrievePhiFluxUncertainty(i) << (i%5==4? ",\n" : ",");
00314         }
00315         out_file <<
00316             "   };\n"
00317             "   for(int i = 0; i < num_bins; i++) {\n"
00318             "      e_theta_count" << current_plot << "[i] *= scale_factor" << current_plot << ";\n"
00319             "      e_phi_count" << current_plot << "[i] *= scale_factor" << current_plot << ";\n"
00320             "      theta_count" << current_plot << "[i] *= scale_factor" << current_plot << ";\n"
00321             "      phi_count" << current_plot << "[i] *= scale_factor" << current_plot << ";\n"
00322             "   }\n"
00323             "   c2->cd();"
00324             "   theta_gr" << current_plot << " = new TGraphErrors(num_bins,theta_angle,theta_count" << current_plot 
00325             << ",e_theta_angle,e_theta_count" << current_plot << ");\n"
00326             "   theta_gr" << current_plot << "->SetTitle(theta_graph_title);\n"
00327             "   theta_gr" << current_plot << "->SetMarkerColor(2);\n"
00328             "   theta_gr" << current_plot << "->SetMarkerStyle(21);\n"
00329             "   theta_leg->AddEntry(theta_gr" << current_plot << ",\"" << graphTitle << "\",\"P\");\n"
00330             "   c3->cd();"
00331             "   phi_gr" << current_plot << " = new TGraphErrors(num_bins,phi_angle,phi_count" << current_plot
00332             << ",e_phi_angle,e_phi_count" << current_plot << ");\n"
00333             "   phi_gr" << current_plot << "->SetTitle(phi_graph_title);\n"
00334             "   phi_gr" << current_plot << "->SetMarkerColor(2);\n"
00335             "   phi_gr" << current_plot << "->SetMarkerStyle(21);\n"
00336             "   phi_leg->AddEntry(phi_gr" << current_plot << ",\"" << graphTitle << "\",\"P\");\n";
00337         
00338         out_file.close();
00339    }   
00340    else if(current_plot <= total_plots - 1)
00341    {
00342        std::ofstream out_file("graph.cxx", std::ios::app);
00343        out_file <<
00344            "   double scale_factor" << current_plot << " = " << scale_factor << ";\n"
00345            "   double theta_count" << current_plot << "[] = {\n";
00346        {for(int i = 0; i < num_bins; i++)
00347            out_file << std::setw(5) << retrieveThetaFlux(i) << (i%5==4? ",\n" : ",");
00348        }
00349        
00350        out_file <<
00351            "   };\n"
00352            "   double phi_count" << current_plot << "[] = {\n";
00353        {for(int i = 0; i < num_bins; i++)
00354            out_file << std::setw(5) << retrievePhiFlux(i) << (i%5==4? ",\n" : ",");
00355        }
00356        
00357        out_file << 
00358            "   };\n"
00359            "   double e_theta_count" << current_plot << "[] = {\n";
00360        {for(int i = 0; i < num_bins; i++)
00361            out_file << std::setw(5) << retrieveThetaFluxUncertainty(i) << (i%5==4? ",\n" : ",");
00362        }
00363        out_file <<
00364            "   };\n"
00365            "   double e_phi_count" << current_plot << "[] = {\n";
00366        {for(int i = 0; i < num_bins; i++)
00367            out_file << std::setw(5) << retrievePhiFluxUncertainty(i) << (i%5==4? ",\n" : ",");
00368        }
00369        out_file <<
00370            "   };\n"
00371            "   for(i = 0; i < num_bins; i++) {\n"
00372            "      e_theta_count" << current_plot << "[i] *= scale_factor" << current_plot << ";\n"
00373            "      e_phi_count" << current_plot << "[i] *= scale_factor" << current_plot << ";\n"
00374            "      theta_count" << current_plot << "[i] *= scale_factor" << current_plot << ";\n"
00375            "      phi_count" << current_plot << "[i] *= scale_factor" << current_plot << ";\n"
00376            "   }\n"
00377            "   c2->cd();"
00378            "   theta_gr" << current_plot << " = new TGraphErrors(num_bins,theta_angle,theta_count" << current_plot 
00379            << ",e_theta_angle,e_theta_count" << current_plot << ");\n"
00380            "   theta_gr" << current_plot << "->SetMarkerColor(" << 2+current_plot << ");\n"
00381            "   theta_gr" << current_plot << "->SetMarkerStyle(" << 21 << ");\n"
00382            "   theta_leg->AddEntry(theta_gr" << current_plot << ",\"" << graphTitle << "\",\"P\");\n"
00383            "   c3->cd();"
00384            "   phi_gr" << current_plot << " = new TGraphErrors(num_bins,phi_angle,phi_count" << current_plot
00385            << ",e_phi_angle,e_phi_count" << current_plot << ");\n"
00386            "   phi_gr" << current_plot << "->SetMarkerColor(" << 2+current_plot << ");\n"
00387            "   phi_gr" << current_plot << "->SetMarkerStyle(" << 21 << ");\n"
00388            "   phi_leg->AddEntry(phi_gr" << current_plot << ",\"" << graphTitle << "\",\"P\");\n";
00389        out_file.close();
00390    }
00391    
00392    if(current_plot >= total_plots - 1)
00393    {
00394        std::ofstream out_file("graph.cxx", std::ios::app);
00395        
00396        out_file << 
00397            "   c2->cd();"
00398            "   double theta_max_count = 0;\n"
00399            "   double theta_min_count = 1e12;\n"
00400            "   for(int i = 0; i < num_bins; i++)\n"
00401            "   {\n";
00402        {for(int plot = 0; plot < total_plots; plot++) {
00403            out_file << 
00404                "      if(theta_count" << plot << "[i] > theta_max_count)\n"
00405                "         theta_max_count = theta_count" << plot << "[i];\n"
00406                "      if(theta_count" << plot << "[i] < theta_min_count && theta_count" << plot << "[i] > 0)\n"
00407                "         theta_min_count = theta_count" << plot << "[i];\n";
00408        }}
00409        out_file <<
00410            "   }\n"
00411            "   double theta_angle_limits[] = {-1,1};\n"
00412            "   double theta_count_limits[] = {0,theta_max_count};\n"
00413            "   int theta_bin_limits = 2;\n"
00414            "   theta_graph0 = new TGraph(theta_bin_limits,theta_angle_limits,theta_count_limits);\n"
00415            "   theta_graph0->SetTitle(theta_graph_title);\n"
00416            "   theta_graph0->Draw(\"AP\");\n"
00417            "   TAxis *theta_ax = theta_graph0->GetXaxis();\n"
00418            "   TAxis *theta_ay = theta_graph0->GetYaxis();\n"
00419            "   theta_ay->SetTitle(theta_y_label); theta_ay->CenterTitle(1);\n"
00420            "   theta_ax->SetLimits(-1,1);\n"
00421            "   theta_ax->SetTitle(theta_x_label); theta_ax->CenterTitle(1); \n"
00422            "   theta_ax->SetTitleOffset(1.2);\n";
00423        
00424        {for(int plot = 0; plot < total_plots; plot++) {
00425            out_file <<
00426                "   theta_gr" << plot << "->Draw(\"P\");\n";
00427        }}
00428        
00429        out_file << 
00430            "   theta_leg->Draw();\n"
00431            "   c2->Modified();\n"
00432            "   c2->Update();\n";
00433        
00434        out_file << 
00435            "   c3->cd();"
00436            "   double phi_max_count = 0;\n"
00437            "   double phi_min_count = 1e12;\n"
00438            "   for(int i = 0; i < num_bins; i++)\n"
00439            "   {\n";
00440        {for(int plot = 0; plot < total_plots; plot++) {
00441            out_file << 
00442                "      if(phi_count" << plot << "[i] > phi_max_count)\n"
00443                "         phi_max_count = phi_count" << plot << "[i];\n"
00444                "      if(phi_count" << plot << "[i] < phi_min_count && phi_count" << plot << "[i] > 0)\n"
00445                "         phi_min_count = phi_count" << plot << "[i];\n";
00446        }}
00447        out_file <<
00448            "   }\n"
00449            "   double phi_angle_limits[] = {0,360};\n"
00450            "   double phi_count_limits[] = {0,phi_max_count};\n"
00451            "   int phi_bin_limits = 2;\n"
00452            "   phi_graph0 = new TGraph(phi_bin_limits,phi_angle_limits,phi_count_limits);\n"
00453            "   phi_graph0->SetTitle(phi_graph_title);\n"
00454            "   phi_graph0->Draw(\"AP\");\n"
00455            "   TAxis *phi_ax = phi_graph0->GetXaxis();\n"
00456            "   TAxis *phi_ay = phi_graph0->GetYaxis();\n"
00457            "   phi_ay->SetTitle(phi_y_label); phi_ay->CenterTitle(1);\n"
00458            "   phi_ax->SetLimits(0,360);\n"
00459            "   phi_ax->SetTitle(phi_x_label); phi_ax->CenterTitle(1); \n"
00460            "   phi_ax->SetTitleOffset(1.2);\n";
00461        
00462        {for(int plot = 0; plot < total_plots; plot++) {
00463            out_file <<
00464                "   phi_gr" << plot << "->Draw(\"P\");\n";
00465        }}
00466        
00467        out_file << 
00468            "   phi_leg->Draw();\n"
00469            "   c3->Modified();\n"
00470            "   c3->Update();\n";
00471        
00472        if(mode != "begin")
00473            out_file << "\n}\n";
00474        
00475        out_file.close();
00476        
00477        if(mode != "begin")
00478            system("root -l graph.cxx");
00479    }
00480 }

void rootAngleHist::reset void   
 

This function clears everything in the object except for the number of bins.

Definition at line 202 of file rootAngleHist.cxx.

References graphTitle, num_bins, phi_hist, phi_raw_hist, phi_sigma_hist, PhiXLabel, PhiYLabel, theta_hist, theta_raw_hist, theta_sigma_hist, ThetaXLabel, ThetaYLabel, and rootHist::updateBin().

Referenced by rootplot::rootplot().

00203 {
00204     for(int i = 0; i < num_bins; ++i)
00205     {
00206         phi_hist->updateBin(i,0);
00207         phi_sigma_hist->updateBin(i,0);
00208         phi_raw_hist->updateBin(i,0);
00209         theta_hist->updateBin(i,0);
00210         theta_sigma_hist->updateBin(i,0);
00211         theta_raw_hist->updateBin(i,0);
00212     }
00213     
00214     graphTitle = "No Title";
00215     PhiXLabel = "";
00216     PhiYLabel = "";
00217     ThetaXLabel = "";
00218     ThetaYLabel = "";
00219 }

double rootAngleHist::retrievePhiAngle int    binNumber
 

Retrieves the angle in degrees associated with the bin number.

Definition at line 166 of file rootAngleHist.cxx.

References num_bins.

00167 {
00168     return ((binNumber+0.5) / num_bins * 2 * M_PI);
00169 }

double rootAngleHist::retrievePhiCount int    binNumber
 

Retrieves the phi angle raw count from the specified bin.

Definition at line 131 of file rootAngleHist.cxx.

References phi_raw_hist, and rootHist::retrieveBin().

00132 {
00133     return phi_raw_hist->retrieveBin(binNumber);
00134 }

double rootAngleHist::retrievePhiFlux int    binNumber
 

Retrieves the phi angle flux from the specified bin.

Definition at line 136 of file rootAngleHist.cxx.

References phi_hist, and rootHist::retrieveBin().

Referenced by draw().

00137 {
00138     return phi_hist->retrieveBin(binNumber);
00139 }

double rootAngleHist::retrievePhiFluxUncertainty int    binNumber
 

Retrieves the phi angle flux uncertainty from the specified bin.

Definition at line 141 of file rootAngleHist.cxx.

References phi_sigma_hist, and rootHist::retrieveBin().

Referenced by draw().

00142 {
00143     return phi_sigma_hist->retrieveBin(binNumber);
00144 }

double rootAngleHist::retrieveThetaAngle int    binNumber
 

Retrives the value of cos(theta) associated with the bin number.

Definition at line 161 of file rootAngleHist.cxx.

References num_bins.

00162 {
00163     return (binNumber+0.5) / num_bins * 2 - 1;
00164 }

double rootAngleHist::retrieveThetaCount int    binNumber
 

Retrieves the theta angle raw count from the specified bin.

Definition at line 146 of file rootAngleHist.cxx.

References rootHist::retrieveBin(), and theta_raw_hist.

00147 {
00148     return theta_raw_hist->retrieveBin(binNumber);
00149 }

double rootAngleHist::retrieveThetaFlux int    binNumber
 

Retrieves the theta angle flux from the specified bin.

Definition at line 151 of file rootAngleHist.cxx.

References rootHist::retrieveBin(), and theta_hist.

Referenced by draw().

00152 {
00153     return theta_hist->retrieveBin(binNumber);
00154 }

double rootAngleHist::retrieveThetaFluxUncertainty int    binNumber
 

Retrieves the theta angle flux uncertainty from the specified bin.

Definition at line 156 of file rootAngleHist.cxx.

References rootHist::retrieveBin(), and theta_sigma_hist.

Referenced by draw().

00157 {
00158     return theta_sigma_hist->retrieveBin(binNumber);
00159 }

void rootAngleHist::setGraphType const char *    graph_type
 

Sets the y-axis scaling for the graphs Valid values are "linear" and "log".

Definition at line 104 of file rootAngleHist.cxx.

References currentType, linear, and log.

Referenced by rootplot::rootplot().

00105 {
00106     if(0 == strcmp(graph_type,"linear") || 0 == strcmp(graph_type,"semilogx"))
00107         currentType = linear;
00108     else if(0 == strcmp(graph_type,"log") || 0 == strcmp(graph_type,"semilogy"))
00109         currentType = log;
00110     else
00111         std::cerr << "ERROR:  Invalid Graph Type" << std::endl;
00112 } 

void rootAngleHist::setPhiXLabel std::string    label
 

Sets the x-axis label on the flux vs. azimuth angle graph.

Definition at line 84 of file rootAngleHist.cxx.

References PhiXLabel.

Referenced by rootplot::rootplot().

00085 {
00086     PhiXLabel = label;
00087 }

void rootAngleHist::setPhiYLabel std::string    label
 

Sets the y-axis label on the flux vs. azimuth angle graph.

Definition at line 89 of file rootAngleHist.cxx.

References PhiYLabel.

Referenced by rootplot::rootplot().

00090 {
00091     PhiYLabel = label;
00092 }

void rootAngleHist::setThetaXLabel std::string    label
 

Sets the x-axis label on the flux vs. zenith angle graph.

Definition at line 94 of file rootAngleHist.cxx.

References ThetaXLabel.

Referenced by rootplot::rootplot().

00095 {
00096     ThetaXLabel = label;
00097 }

void rootAngleHist::setThetaYLabel std::string    label
 

Sets the y-axis label on the flux vs. zenith angle graph.

Definition at line 99 of file rootAngleHist.cxx.

References ThetaYLabel.

Referenced by rootplot::rootplot().

00100 {
00101     ThetaYLabel = label;
00102 }

void rootAngleHist::setTitle std::string    title
 

Sets the title for the graphs.

Definition at line 79 of file rootAngleHist.cxx.

References graphTitle.

Referenced by rootplot::rootplot().

00080 {
00081     graphTitle = title;
00082 }

void rootAngleHist::storePhi double    phi_value
 

Increments the temporary bin corresponding to parameter phi.

Definition at line 124 of file rootAngleHist.cxx.

References num_bins, phi_raw_hist, rootHist::retrieveBin(), and rootHist::updateBin().

Referenced by rootplot::rootplot().

00125 {
00126     int binNumber = floor(phi_value / (2*M_PI) * num_bins);
00127     double count = phi_raw_hist->retrieveBin(binNumber);
00128     phi_raw_hist->updateBin(binNumber,++count);
00129 }

void rootAngleHist::storeTheta double    cos_theta_value
 

Increments the temporary bin corresponding to parameter theta.

Definition at line 114 of file rootAngleHist.cxx.

References num_bins, rootHist::retrieveBin(), theta_raw_hist, and rootHist::updateBin().

Referenced by rootplot::rootplot().

00115 {
00116     cos_theta_value += 1;
00117     
00118     
00119     int binNumber = floor((cos_theta_value)/2 * num_bins);
00120     double count = theta_raw_hist->retrieveBin(binNumber);
00121     theta_raw_hist->updateBin(binNumber,++count);
00122 }

void rootAngleHist::writeFile double    scale_factor,
std::ostream &    out_file
 

Not yet implemented.

Definition at line 482 of file rootAngleHist.cxx.

00483 {
00484     
00485 }


Member Data Documentation

enum rootAngleHist::graphType rootAngleHist::currentType [private]
 

Determines whether the y-axis will be linear or logarithmic.

Referenced by rootAngleHist(), and setGraphType().

std::string rootAngleHist::graphTitle [private]
 

title of graph.

Definition at line 120 of file rootAngleHist.h.

Referenced by draw(), reset(), rootAngleHist(), and setTitle().

const int rootAngleHist::num_bins [private]
 

number of bins for the histogram.

Definition at line 119 of file rootAngleHist.h.

Referenced by apply(), draw(), reset(), retrievePhiAngle(), retrieveThetaAngle(), rootAngleHist(), storePhi(), and storeTheta().

rootHist* rootAngleHist::phi_hist [private]
 

histogram for azimuthal angle fluxes.

Definition at line 116 of file rootAngleHist.h.

Referenced by apply(), reset(), retrievePhiFlux(), rootAngleHist(), and ~rootAngleHist().

rootHist* rootAngleHist::phi_raw_hist [private]
 

histogram to store azimuthal angle raw counts.

Definition at line 118 of file rootAngleHist.h.

Referenced by apply(), reset(), retrievePhiCount(), rootAngleHist(), storePhi(), and ~rootAngleHist().

rootHist* rootAngleHist::phi_sigma_hist [private]
 

histogram to store azimuthal angle uncertainties.

Definition at line 117 of file rootAngleHist.h.

Referenced by apply(), reset(), retrievePhiFluxUncertainty(), rootAngleHist(), and ~rootAngleHist().

std::string rootAngleHist::PhiXLabel [private]
 

phi graph x axis title.

Definition at line 121 of file rootAngleHist.h.

Referenced by draw(), reset(), rootAngleHist(), and setPhiXLabel().

std::string rootAngleHist::PhiYLabel [private]
 

phi graph y axis title.

Definition at line 122 of file rootAngleHist.h.

Referenced by draw(), reset(), rootAngleHist(), and setPhiYLabel().

rootHist* rootAngleHist::theta_hist [private]
 

histogram for zenith angle fluxes.

Definition at line 113 of file rootAngleHist.h.

Referenced by apply(), reset(), retrieveThetaFlux(), rootAngleHist(), and ~rootAngleHist().

rootHist* rootAngleHist::theta_raw_hist [private]
 

histogram to store zenith agnle raw counts.

Definition at line 115 of file rootAngleHist.h.

Referenced by apply(), reset(), retrieveThetaCount(), rootAngleHist(), storeTheta(), and ~rootAngleHist().

rootHist* rootAngleHist::theta_sigma_hist [private]
 

histogram to store zenith angle uncertainties.

Definition at line 114 of file rootAngleHist.h.

Referenced by apply(), reset(), retrieveThetaFluxUncertainty(), rootAngleHist(), and ~rootAngleHist().

std::string rootAngleHist::ThetaXLabel [private]
 

theta graph x axis title.

Definition at line 123 of file rootAngleHist.h.

Referenced by draw(), reset(), rootAngleHist(), and setThetaXLabel().

std::string rootAngleHist::ThetaYLabel [private]
 

theta graph y axis title.

Definition at line 124 of file rootAngleHist.h.

Referenced by draw(), reset(), rootAngleHist(), and setThetaYLabel().


The documentation for this class was generated from the following files:
Generated on Wed Oct 16 14:01:35 2002 by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001