Rock1DMatrix Class Reference

#include <RockMatrix.h>

Inheritance diagram for Rock1DMatrix:
NuMatrix1D RockMatrix NuMatrix NuMatrix

List of all members.

Public Member Functions

 Rock1DMatrix ()
 Rock1DMatrix (const TH1D &spectrum)
 The spectrum-only constructor.
 Rock1DMatrix (Double_t POT)
 The POT-only constructor.
 Rock1DMatrix (const TH1D &spectrum, Double_t POT)
 The spectrum *and* POT constructor.
 Rock1DMatrix (const Rock1DMatrix &original)
 Rock1DMatrix (const NuMatrix1D &original)
Rock1DMatrixoperator= (const Rock1DMatrix &orig)
 ~Rock1DMatrix ()
virtual void Fill (const NuEvent &evt)
virtual void Fill (const NuEvent &nu, const Double_t weight, const bool display=false)
virtual void Fill (const RockEvent &nu, const Double_t weight, const bool display=false)
virtual Rock1DMatrixCopy (void) const
 Returns a copy of the current RockMatrix instance.
virtual void PrepareBins (RockEvent *nu) const
 Precalculates a RockEvents bins for the RockMatrix histograms.

Protected Member Functions

Double_t GetVariable (const RockEvent &nu) const
 Retrieves the correct variable for the energy state.

Detailed Description

Definition at line 69 of file RockMatrix.h.


Constructor & Destructor Documentation

Rock1DMatrix::Rock1DMatrix (  ) 

Definition at line 18 of file RockMatrix.cxx.

References RockMatrix::Reco().

Referenced by Copy().

00018                            : NuMatrix(), NuMatrix1D(), RockMatrix()
00019 {
00020   // Default to reconstructed energy
00021   Reco();
00022   // Create the storage histogram
00023   // fSpectrum = new TH2D("rockevents", "rockevents", 101, 0, 100, 41, -5, 5);
00024 }

Rock1DMatrix::Rock1DMatrix ( const TH1D &  spectrum  ) 

The spectrum-only constructor.

Definition at line 26 of file RockMatrix.cxx.

References RockMatrix::Reco().

00026                                                : NuMatrix(), NuMatrix1D(spectrum), RockMatrix()
00027 {
00028   // Default to reconstructed energy
00029   Reco();
00030 }

Rock1DMatrix::Rock1DMatrix ( Double_t  POT  ) 

The POT-only constructor.

Definition at line 32 of file RockMatrix.cxx.

References RockMatrix::Reco().

00032                                        : NuMatrix(POT), NuMatrix1D(), RockMatrix()
00033 {
00034   // Default to reconstructed energy
00035   Reco();
00036 }

Rock1DMatrix::Rock1DMatrix ( const TH1D &  spectrum,
Double_t  POT 
)

The spectrum *and* POT constructor.

Definition at line 38 of file RockMatrix.cxx.

References RockMatrix::Reco().

00038                                                              : NuMatrix(POT), NuMatrix1D(spectrum), RockMatrix()
00039 {
00040   // Default to reconstructed energy
00041   Reco();
00042 }

Rock1DMatrix::Rock1DMatrix ( const Rock1DMatrix original  ) 

Definition at line 44 of file RockMatrix.cxx.

References RockMatrix::fEnergyState.

00044                                                        : NuMatrix(original), NuMatrix1D(original), RockMatrix()
00045 {
00046   // Default to reconstructed energy
00047   fEnergyState = original.fEnergyState;
00048 }

Rock1DMatrix::Rock1DMatrix ( const NuMatrix1D original  ) 

Definition at line 50 of file RockMatrix.cxx.

References RockMatrix::Reco().

00050                                                      :  NuMatrix(original), NuMatrix1D(original), RockMatrix()
00051 {
00052   // Default to reconstructed energy
00053   Reco();
00054 }

Rock1DMatrix::~Rock1DMatrix (  ) 

Definition at line 69 of file RockMatrix.cxx.

00070 {
00071   // if (fSpectrum) delete fSpectrum;
00072   // fSpectrum = 0;
00073 }


Member Function Documentation

virtual Rock1DMatrix* Rock1DMatrix::Copy ( void   )  const [inline, virtual]

Returns a copy of the current RockMatrix instance.

Reimplemented from NuMatrix1D.

Definition at line 96 of file RockMatrix.h.

References Rock1DMatrix().

00096 { return new Rock1DMatrix(*this); }

void Rock1DMatrix::Fill ( const RockEvent nu,
const Double_t  weight,
const bool  display = false 
) [virtual]

Fill the histogram with rock information. This ignores the events rw variable, and weights entirely by the weight parameter

Implements RockMatrix.

Definition at line 106 of file RockMatrix.cxx.

References NuMatrix1D::fSpectrum, and GetVariable().

00107 {
00108   // For now, just plain fill. We reserve the option to switch to more
00109   // of a cached method in the near future (or for multiple dimensions)
00110   // fSpectrum->AddBinContent(nu.trkEnBin, weight);
00111   
00112   // if (fEnergyState == kReco) {
00113   //   fSpectrum->Fill(nu.trkEn, weight);
00114   // } else if (fEnergyState == kTrue) {
00115   //   fSpectrum->Fill(nu.neuEnMC, weight);
00116   // } else if (fEnergyState == kTrueTrack) {
00117   //   fSpectrum->Fill(nu.trkStartEnMC, weight);
00118   // } else if (fEnergyState == kFull) {
00119   //   fSpectrum->Fill(nu.trkEn+nu.shwEn, weight);
00120   // } else {
00121   //   MAXMSG("Rock1DMatrix",Msg::kError, 5) << "Rock1DMatrix is in an unknown energy state. Issue True() or Reco()." << endl;
00122   // }
00123   cout << "Not using this value:" << display << endl;
00124   fSpectrum->Fill(GetVariable(nu), weight);
00125 }

void Rock1DMatrix::Fill ( const NuEvent nu,
const Double_t  weight,
const bool  display = false 
) [virtual]

Implements RockMatrix.

Definition at line 79 of file RockMatrix.cxx.

References Fill().

00080 {
00081   // Convert to a RockEvent and fill with that.
00082   this->Fill(RockEvent(nu), weight, display);
00083 }

virtual void Rock1DMatrix::Fill ( const NuEvent evt  )  [inline, virtual]

Fill the histogram with rock information. This ignores the events rw variable, and weights entirely by the weight parameter

Reimplemented from NuMatrix1D.

Definition at line 87 of file RockMatrix.h.

References Fill(), and NuEvent::rw.

Referenced by Fill().

00087 {Fill(evt, evt.rw);}

Double_t Rock1DMatrix::GetVariable ( const RockEvent nu  )  const [protected]

Retrieves the correct variable for the energy state.

Definition at line 87 of file RockMatrix.cxx.

References RockMatrix::fEnergyState, Msg::kError, RockMatrix::kReco, RockMatrix::kTrack, RockMatrix::kTrue, RockMatrix::kTrueTrack, MAXMSG, RockEvent::neuEnMC, RockEvent::trkEn, and RockEvent::trkStartEnMC.

Referenced by Fill(), and PrepareBins().

00088 {
00089   if (fEnergyState == kReco) {
00090     return nu.trkEn;
00091   } else if (fEnergyState == kTrue) {
00092     return nu.neuEnMC;
00093   } else if (fEnergyState == kTrueTrack) {
00094     return nu.trkStartEnMC;
00095   } else if (fEnergyState == kTrack) {
00096     return nu.trkEn;
00097   } else {
00098     MAXMSG("Rock1DMatrix",Msg::kError, 5) 
00099       << "Rock1DMatrix is in an unknown energy state. Issue True() or Reco()."
00100       << endl;
00101     return 0.0;
00102   }
00103 }

Rock1DMatrix & Rock1DMatrix::operator= ( const Rock1DMatrix orig  ) 

Reimplemented from NuMatrix1D.

Definition at line 56 of file RockMatrix.cxx.

References RockMatrix::fEnergyState.

00057 {
00058   // Check for self assignment
00059   if (this == &orig) return *this;
00060   
00061   // Defer to the parent class
00062   this->NuMatrix1D::operator=(orig);
00063   this->fEnergyState = orig.fEnergyState;
00064   
00065   return *this;
00066 }

void Rock1DMatrix::PrepareBins ( RockEvent nu  )  const [virtual]

Precalculates a RockEvents bins for the RockMatrix histograms.

Implements RockMatrix.

Definition at line 129 of file RockMatrix.cxx.

References RockEvent::binNumber, NuMatrix1D::fSpectrum, and GetVariable().

00130 {
00131   // // nu->trkEnBin = fSpectrum->FindBin(nu->trkEn);
00132   // if (fEnergyState == kReco) {
00133   //   nu->binNumber = fSpectrum->FindBin(nu->trkEn);
00134   // } else if (fEnergyState == kTrue) {
00135   //   nu->binNumber = fSpectrum->FindBin(nu->neuEnMC);
00136   // } else if (fEnergyState == kTrueTrack) {
00137   //   nu->binNumber = fSpectrum->FindBin(nu->trkStartEnMC);
00138   // } else if (fEnergyState == kFull) {
00139   //   nu->binNumber = fSpectrum->FindBin(nu->trkEn+nu->shwEn);
00140   // } else {
00141   //   MAXMSG("Rock1DMatrix",Msg::kError, 5) << "Rock1DMatrix is in an unknown energy state. Issue True() or Reco()." << endl;
00142   // }
00143   nu->binNumber = fSpectrum->FindBin(GetVariable(*nu));
00144 }


The documentation for this class was generated from the following files:

Generated on 3 Oct 2018 for loon by  doxygen 1.6.1