#include <NuMatrix2D.h>
Inheritance diagram for NuMatrix2D:

Public Member Functions | |
| NuMatrix2D () | |
| NuMatrix2D (const TH2D &spectrum) | |
| The spectrum-only constructor. | |
| NuMatrix2D (Double_t POT) | |
| The POT-only constructor. | |
| NuMatrix2D (const TH2D &spectrum, Double_t POT) | |
| The spectrum *and* POT constructor. | |
| NuMatrix2D (const NuMatrix2D &original) | |
| NuMatrix2D & | operator= (const NuMatrix2D &orig) |
| virtual | ~NuMatrix2D () |
| Double_t | StatsLikelihood (const NuMatrix *with) const |
| Checks the passed object is a NuMatrix2D then returns the log-likelihood difference. | |
| Double_t | StatsLikelihood (const NuMatrix2D *with) const |
| Compares two 2D histograms and returns the log-likelihood difference. | |
| virtual void | ScaleToPOT (Double_t new_POT) |
| virtual TH1 * | Spectrum (void) const |
| Returns a pointer to the built in data storage. | |
| virtual Bool_t | Complete () const |
| Returns true if the spectrum is properly configured. | |
| virtual void | Draw (Option_t *option="") |
| virtual NuMatrix2D * | Copy (void) const |
| Makes a 'deep copy' - every subclass should implement this. | |
| virtual void | Scale (Double_t value) |
| Scales the Matrix, without changing the POT. | |
| virtual void | Divide (const NuMatrix &correction) |
| Make a correction by Dividing. | |
| virtual void | Divide (const NuMatrix2D &correction) |
| virtual void | Divide (const TH1 &correction, const Option_t *option="") |
| virtual void | Divide (const TGraph &correction) |
| virtual void | Multiply (const NuMatrix &correction) |
| Make a correction by Multiplying. | |
| virtual void | Multiply (const NuMatrix2D &correction) |
| virtual void | Multiply (const TH1 &correction, const Option_t *option="") |
| virtual void | Multiply (const TGraph &correction) |
| virtual void | RecoToTrue (const TH2D &correction) |
| virtual void | TrueToReco (const TH2D &correction) |
| virtual void | ExtrapolateNDToFD (const TH2D &beammatrix) |
| virtual void | SetValue (Double_t val) |
| virtual Int_t | Write (const TString &name) |
| Writes to the current file. | |
| virtual TH2 * | Spectrum (void) |
| Returns a TH1 object representing the data the spectrum holds. Or zero. | |
| virtual void | SetSpectrum (const TH2D &spectrum) |
| virtual void | Oscillate (const Double_t dm2, const Double_t sn2) |
| virtual void | Divide (const NuMatrix &correction)=0 |
| Make a correction by Dividing. | |
| virtual void | Divide (const TH1 &correction, const Option_t *option="")=0 |
| Make a correction by Dividing. | |
| virtual void | Divide (const TGraph &correction)=0 |
| Make a correction by Dividing. | |
| virtual void | Divide (const Double_t by) |
| Make a correction by Dividing. | |
| virtual void | Multiply (const NuMatrix &correction)=0 |
| Make a correction by Multiplying. | |
| virtual void | Multiply (const TH1 &correction, const Option_t *option="")=0 |
| Make a correction by Multiplying. | |
| virtual void | Multiply (const TGraph &correction)=0 |
| Make a correction by Multiplying. | |
| virtual void | Multiply (const Double_t factor) |
| Make a correction by Multiplying. | |
Protected Member Functions | |
| ClassDef (NuMatrix2D, 0) | |
Protected Attributes | |
| TH2D * | fSpectrum |
| The 2D data storage. | |
|
|
Definition at line 24 of file NuMatrix2D.cxx. Referenced by Copy().
|
|
|
The spectrum-only constructor.
Definition at line 36 of file NuMatrix2D.cxx. References fSpectrum.
|
|
|
The POT-only constructor.
Definition at line 30 of file NuMatrix2D.cxx.
|
|
||||||||||||
|
The spectrum *and* POT constructor.
Definition at line 42 of file NuMatrix2D.cxx. References fSpectrum.
|
|
|
Definition at line 48 of file NuMatrix2D.cxx. References fSpectrum. 00048 : NuMatrix(original), fSpectrum(0) 00049 { 00050 fSpectrum = new TH2D(*original.fSpectrum); 00051 }
|
|
|
Definition at line 70 of file NuMatrix2D.cxx. References fSpectrum. 00071 {
00072 if (fSpectrum) delete fSpectrum; fSpectrum = 0;
00073 }
|
|
||||||||||||
|
Reimplemented from NuMatrix. |
|
|
Returns true if the spectrum is properly configured.
Implements NuMatrix. Definition at line 37 of file NuMatrix2D.h. 00037 { return fSpectrum; }
|
|
|
Makes a 'deep copy' - every subclass should implement this.
Implements NuMatrix. Definition at line 48 of file NuMatrix2D.h. References NuMatrix2D(). 00048 { return new NuMatrix2D(*this); }
|
|
|
Make a correction by Dividing.
Definition at line 84 of file NuMatrix.h. 00084 { Scale(1./by); }
|
|
|
Make a correction by Dividing.
|
|
||||||||||||
|
Make a correction by Dividing.
|
|
|
Make a correction by Dividing.
|
|
|
Implements NuMatrix. Definition at line 170 of file NuMatrix2D.cxx. References MSG. 00171 {
00172 MSG("NuMatrix2D",Msg::kWarning)
00173 << "2D histograms cannot be corrected with graphs without further information"
00174 << endl;
00175 }
|
|
||||||||||||
|
Implements NuMatrix. Definition at line 162 of file NuMatrix2D.cxx. References Divide(), fSpectrum, and option. 00163 {
00164 // fSpectrum->Divide(&correction);
00165 fSpectrum->Divide(fSpectrum, &correction, 1, 1, option);
00166 }
|
|
|
Definition at line 155 of file NuMatrix2D.cxx. References Divide(), fSpectrum, and Spectrum().
|
|
|
Make a correction by Dividing.
Implements NuMatrix. Definition at line 142 of file NuMatrix2D.cxx. References MSG. Referenced by Divide(). 00143 {
00144 // Convert the NuMatrix to a NuMatrix1D
00145 const NuMatrix2D *other = dynamic_cast<const NuMatrix2D*>(&correction);
00146 if (other == 0) {
00147 MSG("NuMatrix2D",Msg::kWarning) << "Attempting to divide a NuMatrix2D to something other than a NuMatrix2D" << endl;
00148 }
00149
00150 this->Divide(*other);
00151 }
|
|
|
Implements NuMatrix. Definition at line 282 of file NuMatrix2D.cxx. References fSpectrum, MSG, and option. 00283 {
00284 if(fSpectrum) {
00285 fSpectrum->Draw(option);
00286 } else {
00287 MSG("NuMatrix2D",Msg::kWarning) << "No spectrum exists: Cannot draw" << endl;
00288 }
00289 }
|
|
|
Implements NuMatrix. Definition at line 233 of file NuMatrix2D.cxx. References MSG. 00234 {
00235 MSG("NuMatrix2D",Msg::kWarning) << "Base NuMatrix2D cannot be extrapolated" << endl;
00236 }
|
|
|
Make a correction by Multiplying.
Definition at line 83 of file NuMatrix.h. 00083 { Scale(factor); }
|
|
|
Make a correction by Multiplying.
|
|
||||||||||||
|
Make a correction by Multiplying.
|
|
|
Make a correction by Multiplying.
|
|
|
Implements NuMatrix. Definition at line 209 of file NuMatrix2D.cxx. References MSG. 00210 {
00211 MSG("NuMatrix2D",Msg::kWarning)
00212 << "2D histograms cannot be corrected with graphs without further information"
00213 << endl;
00214 }
|
|
||||||||||||
|
Implements NuMatrix. Definition at line 201 of file NuMatrix2D.cxx. References fSpectrum, Multiply(), and option. 00202 {
00203 // fSpectrum->Multiply(&correction);
00204 fSpectrum->Multiply(fSpectrum, &correction, 1, 1, option);
00205 }
|
|
|
Definition at line 194 of file NuMatrix2D.cxx. References fSpectrum, Multiply(), and Spectrum().
|
|
|
Make a correction by Multiplying.
Implements NuMatrix. Definition at line 181 of file NuMatrix2D.cxx. References MSG. Referenced by Multiply(). 00182 {
00183 // Convert the NuMatrix to a NuMatrix1D
00184 const NuMatrix2D *other = dynamic_cast<const NuMatrix2D*>(&correction);
00185 if (other == 0) {
00186 MSG("NuMatrix2D",Msg::kWarning) << "Attempting to divide a NuMatrix2D to something other than a NuMatrix2D" << endl;
00187 }
00188
00189 this->Multiply(*other);
00190 }
|
|
|
Definition at line 54 of file NuMatrix2D.cxx. References fSpectrum. 00055 {
00056 if (this == &orig) return *this;
00057
00058 // Copy the base class stuff
00059 this->NuMatrix::operator=(orig);
00060
00061 // Copy the histogram
00062 if (fSpectrum) delete fSpectrum;
00063 fSpectrum = new TH2D(*orig.fSpectrum);
00064
00065 return *this;
00066 }
|
|
||||||||||||
|
Implements NuMatrix. Definition at line 275 of file NuMatrix2D.cxx. References MSG. 00276 {
00277 MSG("NuMatrix2D",Msg::kWarning) << "Base NuMatrix2D cannot be oscillated" << endl;
00278 }
|
|
|
Implements NuMatrix. Definition at line 219 of file NuMatrix2D.cxx. References MSG. 00220 {
00221 MSG("NuMatrix2D",Msg::kWarning) << "Base NuMatrix2D cannot Reco->True" << endl;
00222 }
|
|
|
Scales the Matrix, without changing the POT.
Implements NuMatrix. Definition at line 134 of file NuMatrix2D.cxx. References fSpectrum. Referenced by ScaleToPOT(). 00135 {
00136 fSpectrum->Scale(value);
00137 }
|
|
|
Changes the POT, by scaling the data. Beware when using this function that all the data you are storing scales with POT. Enumerations and plane numbers and such fall into this category. Re-implement the function in derived classes if it is needed. Implements NuMatrix. Definition at line 119 of file NuMatrix2D.cxx. References fSpectrum, NuMatrix::GetPOT(), NuMatrix::ResetPOT(), and Scale(). 00120 {
00121 // If the old POT is zero, or the spectrum does not exist
00122 if (GetPOT() == 0.0 || fSpectrum == 0) {
00123 // Simply set the new POT (avoids infinite scaling)
00124 ResetPOT(new_POT);
00125 } else {
00126 // The spectrum must exist - calculate the scale factor
00127 Double_t scale_factor = new_POT / GetPOT();
00128 fSpectrum->Scale(scale_factor);
00129 }
00130 }
|
|
|
Definition at line 81 of file NuMatrix2D.h. References fSpectrum. 00081 {
00082 if (fSpectrum) delete fSpectrum;
00083 fSpectrum = static_cast<TH2D*>(spectrum.Clone());
00084 }
|
|
|
Implements NuMatrix. Definition at line 240 of file NuMatrix2D.cxx. References fSpectrum, and MSG. 00241 {
00242 // No spectrum - don't set
00243 if (!fSpectrum) {
00244 MSG("NuMatrix1D",Msg::kWarning) << "Cannot set constant value: No histogram" << endl;
00245 return;
00246 }
00247
00248 for (Int_t i = 1; i <= fSpectrum->GetNbinsX(); ++i)
00249 {
00250 for (Int_t j = 1; j <= fSpectrum->GetNbinsY(); ++j)
00251 {
00252 fSpectrum->SetBinContent(i, j, val);
00253 }
00254 }
00255 }
|
|
|
Returns a TH1 object representing the data the spectrum holds. Or zero.
Definition at line 79 of file NuMatrix2D.h. 00079 { return fSpectrum; };
|
|
|
Returns a pointer to the built in data storage.
Implements NuMatrix. Definition at line 33 of file NuMatrix2D.h. Referenced by Divide(), Multiply(), and StatsLikelihood(). 00033 { return fSpectrum; };
|
|
|
Compares two 2D histograms and returns the log-likelihood difference.
Definition at line 96 of file NuMatrix2D.cxx. References fSpectrum, NuUtilities::LogLikelihood(), and Spectrum(). 00097 {
00098 // Do the same as the 1D, but over all bins
00099 Double_t like = 0.0;
00100
00101 //Aim to minimise -2lnL. That's what I'm returning.
00102 for (Int_t i=1; i<= fSpectrum->GetNbinsX(); ++i)
00103 {
00104 for (Int_t j=1; j <= fSpectrum->GetNbinsY(); ++j)
00105 {
00106 //Bizarre limits because root histograms are silly
00107 Double_t mnu = fSpectrum->GetBinContent(i, j);
00108 Double_t dnu = with->Spectrum()->GetBinContent(i, j);
00109
00110 like += NuUtilities::LogLikelihood(dnu,mnu);
00111 }
00112 }
00113
00114 return like;
00115 }
|
|
|
Checks the passed object is a NuMatrix2D then returns the log-likelihood difference.
Implements NuMatrix. Definition at line 79 of file NuMatrix2D.cxx. References MSG. 00080 {
00081 // Convert the NuMatrix to a NuMatrix2D
00082 const NuMatrix2D *other = dynamic_cast<const NuMatrix2D*>(with);
00083 if (other == 0) {
00084 MSG("NuMatrix2D",Msg::kWarning) << "Attempting to compare a NuMatrix2D to something other than a NuMatrix2D" << endl;
00085 return -1;
00086 }
00087
00088 // // Do the statistical comparison
00089 // MSG("NuMatrix2D",Msg::kError) << "Comparing statistical likelihood - but function not implemented" << endl;
00090 // return 0;
00091 return this->StatsLikelihood(other);
00092 }
|
|
|
Implements NuMatrix. Definition at line 226 of file NuMatrix2D.cxx. References MSG. 00227 {
00228 MSG("NuMatrix2D",Msg::kWarning) << "Base NuMatrix2D cannot True->Reco" << endl;
00229 }
|
|
|
Writes to the current file.
Implements NuMatrix. Definition at line 259 of file NuMatrix2D.cxx. References fSpectrum. 00260 {
00261 if (fSpectrum) {
00262 if (name == "")
00263 {
00264 return fSpectrum->Write();
00265 } else {
00266 return fSpectrum->Write(name);
00267 }
00268 } else {
00269 return 0;
00270 }
00271 }
|
|
|
The 2D data storage.
Definition at line 98 of file NuMatrix2D.h. Referenced by Divide(), Draw(), Multiply(), NuMatrix2D(), operator=(), Scale(), ScaleToPOT(), SetSpectrum(), SetValue(), StatsLikelihood(), Write(), and ~NuMatrix2D(). |
1.3.9.1