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

Public Member Functions | |
| NuMatrixCPT () | |
| NuMatrixCPT (Double_t POT) | |
| NuMatrixCPT (const NuMatrixCPT &orig) | |
| NuMatrixCPT & | operator= (const NuMatrixCPT &orig) |
| NuMatrixCPT (const NuMatrix *NQ, const NuMatrix *PQ) | |
| ~NuMatrixCPT () | |
| NuMatrixCPT (const TString &filename, const TString &NQhistname, const TString &PQhistname, const TString &pothistname="hTotalPot") | |
| virtual NuMatrix * | Copy (void) const |
| Makes a deep-object copy. | |
| virtual Double_t | StatsLikelihood (const NuMatrix *with) const |
| Compares two NuMatrix objects and returns the LL difference. | |
| virtual void | ScaleToPOT (Double_t new_POT) |
| Changes the POT, by scaling the data. | |
| 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 NuMatrixCPT &correction) |
| If a component is null, operation will fail silently. | |
| virtual void | Divide (const TH1 &correction, const Option_t *option="") |
| virtual void | Divide (const TGraph &correction) |
| virtual void | Divide (const std::pair< const TH1D *, const TH1D * > &correction) |
| virtual void | Divide (const std::pair< const TGraph *, const TGraph * > &correction) |
| virtual void | Multiply (const NuMatrix &correction) |
| Make a correction by Multiplying. | |
| virtual void | Multiply (const NuMatrixCPT &correction) |
| If a component is null, operation will fail silently. | |
| virtual void | Multiply (const TH1 &correction, const Option_t *option="") |
| virtual void | Multiply (const TGraph &correction) |
| virtual void | Multiply (const std::pair< const TH1D *, const TH1D * > &correction) |
| virtual void | Multiply (const std::pair< const TGraph *, const TGraph * > &correction) |
| virtual void | RecoToTrue (const TH2D &correction) |
| virtual void | RecoToTrue (const std::pair< const TH2D *, const TH2D * > &correction) |
| virtual void | TrueToReco (const TH2D &correction) |
| virtual void | TrueToReco (const std::pair< const TH2D *, const TH2D * > &correction) |
| virtual void | ExtrapolateNDToFD (const TH2D &beammatrix) |
| virtual void | ExtrapolateNDToFD (const std::pair< const TH2D *, const TH2D * > &beammatrix) |
| virtual void | SetValue (Double_t val) |
| virtual Int_t | Write (const TString &name) |
| Writes to the current file. | |
| virtual void | ResetPOT (Double_t new_POT) |
| Sets the POT count directly, without scaling. | |
| virtual TH1 * | Spectrum (void) const |
| Returning a spectrum doesn't make sense for this class. | |
| virtual void | Draw (Option_t *option="") |
| virtual Bool_t | Complete () const |
| Tells the user if the class is completely configured. | |
| virtual NuMatrix * | PQ (void) const |
| virtual NuMatrix * | NQ (void) const |
| virtual NuMatrix * | NuBar (void) const |
| virtual NuMatrix * | Nu (void) const |
| virtual void | Oscillate (const Double_t dm2, const Double_t sn2) |
| virtual void | Oscillate (const NuMMParameters ¶meters) |
| virtual void | Oscillate (Double_t dm2, Double_t sn2, Double_t dm2bar, Double_t sn2bar) |
| 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. | |
Private Attributes | |
| NuMatrix * | fPQMatrix |
| NuMatrix * | fNQMatrix |
Definition at line 16 of file NuMatrixCPT.h.
|
|
Definition at line 16 of file NuMatrixCPT.cxx. Referenced by Copy().
|
|
|
Definition at line 21 of file NuMatrixCPT.cxx.
|
|
|
Definition at line 26 of file NuMatrixCPT.cxx. References NuMatrix::Copy(), fNQMatrix, and fPQMatrix. 00026 : NuMatrix(orig), fPQMatrix(0), fNQMatrix(0) 00027 { 00028 // Copy the histograms over 00029 if (orig.fPQMatrix) fPQMatrix = orig.fPQMatrix->Copy(); 00030 if (orig.fNQMatrix) fNQMatrix = orig.fNQMatrix->Copy(); 00031 }
|
|
||||||||||||
|
Definition at line 50 of file NuMatrixCPT.cxx. References NuMatrix::Copy(), fNQMatrix, fPQMatrix, NuMatrix::GetPOT(), MSG, and ResetPOT(). 00051 : NuMatrix(), 00052 fPQMatrix(0), 00053 fNQMatrix(0) 00054 { 00055 // Vector to count POT of valid histograms 00056 vector<Double_t> pots; 00057 00058 if (NQ) { 00059 fNQMatrix = NQ->Copy(); 00060 pots.push_back(fNQMatrix->GetPOT()); 00061 } 00062 if (PQ) { 00063 fPQMatrix = PQ->Copy(); 00064 pots.push_back(fPQMatrix->GetPOT()); 00065 } 00066 00067 // Check that every POT is the same, and display a warning otherwise 00068 // This is because I can't imagine a legitimate reason to have this 00069 // scenario, at the moment. 00070 // Now, how do we set the POT? Check they are both the same, for now. 00071 // For 'same' define POT to 1e-5. Surely nobody makes values that different? 00072 if (fPQMatrix && fNQMatrix) { 00073 if (TMath::Abs(NQ->GetPOT() - PQ->GetPOT()) > 1e-5) { 00074 MSG("NuMatrixCPT",Msg::kWarning) << "POT count for pre-initialised NuMatrix objects differ." << endl; 00075 MSG("NuMatrixCPT",Msg::kWarning) << " PQ: " << fPQMatrix->GetPOT() << endl; 00076 MSG("NuMatrixCPT",Msg::kWarning) << " NQ: " << fNQMatrix->GetPOT() << endl; 00077 MSG("NuMatrixCPT",Msg::kWarning) << "Storing POT of NQ in object" << endl; 00078 } 00079 } 00080 00081 // Set out POT to the first one, recorded, if we have any. 00082 if (pots.size()) ResetPOT(pots[0]); 00083 00084 }
|
|
|
Definition at line 116 of file NuMatrixCPT.cxx. References fNQMatrix, and fPQMatrix. 00117 {
00118 if (fPQMatrix) delete fPQMatrix; fPQMatrix = 0;
00119 if (fNQMatrix) delete fNQMatrix; fNQMatrix = 0;
00120 }
|
|
||||||||||||||||||||
|
Loads a set of 1D histograms from file. This version reads the POT from a histogram in the same file by integrating it. The default name to try is the DST framework convention of "hTotalPot". If there is an error reading anything, an error is printed and the spectrum and POT are left blank.
Definition at line 88 of file NuMatrixCPT.cxx. References fNQMatrix, fPQMatrix, NuMatrix::GetPOT(), MSG, and ResetPOT(). 00092 : NuMatrix(), 00093 fPQMatrix(0), 00094 fNQMatrix(0) 00095 { 00096 // Create the two histograms 00097 fNQMatrix = new NuMatrix1D(filename, NQhistname, pothistname); 00098 fPQMatrix = new NuMatrix1D(filename, PQhistname, pothistname); 00099 00100 // Now, Grab the POT out of each 00101 Double_t potPQ = 0.0, potNQ = 0.0; 00102 potPQ = fPQMatrix->GetPOT(); 00103 potNQ = fNQMatrix->GetPOT(); 00104 00105 if (potPQ != potNQ) 00106 { 00107 MSG("NuMatrixCPT",Msg::kWarning) << "POT read from file " 00108 << filename << " does not seem to match between histograms." 00109 << endl; 00110 } else { 00111 this->ResetPOT(potNQ); 00112 } 00113 00114 }
|
|
|
Tells the user if the class is completely configured.
Implements NuMatrix. Definition at line 112 of file NuMatrixCPT.h. References fPQMatrix. 00112 { return fPQMatrix && fNQMatrix; }
|
|
|
Makes a deep-object copy.
Implements NuMatrix. Definition at line 58 of file NuMatrixCPT.h. References NuMatrixCPT(). 00058 { return new NuMatrixCPT(*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.
|
|
|
Definition at line 200 of file NuMatrixCPT.cxx. References NuMatrix::Divide(), fNQMatrix, and fPQMatrix. 00201 {
00202 if (fNQMatrix && corr.first) fNQMatrix->Divide(*corr.first);
00203 if (fPQMatrix && corr.second) fPQMatrix->Divide(*corr.second);
00204 }
|
|
|
Definition at line 192 of file NuMatrixCPT.cxx. References NuMatrix::Divide(), fNQMatrix, and fPQMatrix. 00193 {
00194 if (fNQMatrix && corr.first) fNQMatrix->Divide(*corr.first);
00195 if (fPQMatrix && corr.second) fPQMatrix->Divide(*corr.second);
00196 }
|
|
|
Implements NuMatrix. Definition at line 184 of file NuMatrixCPT.cxx. References NuMatrix::Divide(), fNQMatrix, and fPQMatrix. 00185 {
00186 if (fPQMatrix) fPQMatrix->Divide(correction);
00187 if (fNQMatrix) fNQMatrix->Divide(correction);
00188 }
|
|
||||||||||||
|
Implements NuMatrix. Definition at line 176 of file NuMatrixCPT.cxx. References NuMatrix::Divide(), fNQMatrix, fPQMatrix, and option. 00177 {
00178 if (fPQMatrix) fPQMatrix->Divide(correction, option);
00179 if (fNQMatrix) fNQMatrix->Divide(correction, option);
00180 }
|
|
|
If a component is null, operation will fail silently.
Definition at line 168 of file NuMatrixCPT.cxx. References NuMatrix::Divide(), fNQMatrix, fPQMatrix, NQ(), and PQ(). 00169 {
00170 if (fPQMatrix && correction.PQ()) fPQMatrix->Divide(*correction.PQ());
00171 if (fNQMatrix && correction.NQ()) fNQMatrix->Divide(*correction.NQ());
00172 }
|
|
|
Make a correction by Dividing.
Implements NuMatrix. Definition at line 155 of file NuMatrixCPT.cxx. References MSG. 00156 {
00157 // Convert the NuMatrix to a NuMatrixCPT
00158 const NuMatrixCPT *other = dynamic_cast<const NuMatrixCPT*>(&correction);
00159 if (other == 0) {
00160 MSG("NuMatrixCPT",Msg::kWarning) << "Attempting to divide a NuMatrixCPT by something other than a NuMatrixCPT" << endl;
00161 }
00162
00163 this->Divide(*other);
00164 }
|
|
|
Implements NuMatrix. Definition at line 304 of file NuMatrixCPT.cxx. References MSG. 00305 {
00306 MSG("NuMatrixCPT",Msg::kInfo) << "Cannot draw CPT matrix directly at this time. Draw NQ() and PQ() independently." << endl;
00307
00308 }
|
|
|
Definition at line 371 of file NuMatrixCPT.cxx. References NuMatrix::ExtrapolateNDToFD(), fNQMatrix, and fPQMatrix. 00372 {
00373 if (fNQMatrix) fNQMatrix->ExtrapolateNDToFD(*beammatrix.first);
00374 if (fPQMatrix) fPQMatrix->ExtrapolateNDToFD(*beammatrix.second);
00375 }
|
|
|
Implements NuMatrix. Definition at line 348 of file NuMatrixCPT.cxx. References MSG. 00349 {
00350 MSG("NuMatrixCPT",Msg::kError) << "Trying to extrapolate a CPT matrix with only one histogram!" << endl;
00351 }
|
|
|
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.
|
|
|
Definition at line 252 of file NuMatrixCPT.cxx. References fNQMatrix, fPQMatrix, and NuMatrix::Multiply(). 00253 {
00254 if (fNQMatrix && corr.first) fNQMatrix->Multiply(*corr.first);
00255 if (fPQMatrix && corr.second) fPQMatrix->Multiply(*corr.second);
00256 }
|
|
|
Definition at line 244 of file NuMatrixCPT.cxx. References fNQMatrix, fPQMatrix, and NuMatrix::Multiply(). 00245 {
00246 if (fNQMatrix && corr.first) fNQMatrix->Multiply(*corr.first);
00247 if (fPQMatrix && corr.second) fPQMatrix->Multiply(*corr.second);
00248 }
|
|
|
Implements NuMatrix. Definition at line 237 of file NuMatrixCPT.cxx. References fNQMatrix, fPQMatrix, and NuMatrix::Multiply(). 00238 {
00239 if (fPQMatrix) fPQMatrix->Multiply(correction);
00240 if (fNQMatrix) fNQMatrix->Multiply(correction);
00241 }
|
|
||||||||||||
|
Implements NuMatrix. Definition at line 229 of file NuMatrixCPT.cxx. References fNQMatrix, fPQMatrix, NuMatrix::Multiply(), and option. 00230 {
00231 if (fPQMatrix) fPQMatrix->Multiply(correction, option);
00232 if (fNQMatrix) fNQMatrix->Multiply(correction, option);
00233 }
|
|
|
If a component is null, operation will fail silently.
Definition at line 221 of file NuMatrixCPT.cxx. References fNQMatrix, fPQMatrix, NuMatrix::Multiply(), NQ(), and PQ(). 00222 {
00223 if (fPQMatrix && correction.PQ()) fPQMatrix->Multiply(*correction.PQ());
00224 if (fNQMatrix && correction.NQ()) fNQMatrix->Multiply(*correction.NQ());
00225 }
|
|
|
Make a correction by Multiplying.
Implements NuMatrix. Definition at line 208 of file NuMatrixCPT.cxx. References MSG. 00209 {
00210 // Convert the NuMatrix to a NuMatrixCPT
00211 const NuMatrixCPT *other = dynamic_cast<const NuMatrixCPT*>(&correction);
00212 if (other == 0) {
00213 MSG("NuMatrixCPT",Msg::kWarning) << "Attempting to multiply a NuMatrixCPT by something other than a NuMatrixCPT" << endl;
00214 }
00215
00216 this->Multiply(*other);
00217 }
|
|
|
Definition at line 120 of file NuMatrixCPT.h. Referenced by Divide(), and Multiply(). 00120 { return fNQMatrix; }
|
|
|
Definition at line 122 of file NuMatrixCPT.h. 00122 { return fNQMatrix; }
|
|
|
Definition at line 121 of file NuMatrixCPT.h. 00121 { return fPQMatrix; }
|
|
|
Definition at line 33 of file NuMatrixCPT.cxx. References NuMatrix::Copy(), fNQMatrix, and fPQMatrix. 00034 {
00035 // Copy the base class stuff
00036 this->NuMatrix::operator=(orig);
00037
00038 // If our spectra exist, delete them
00039 if (fPQMatrix) delete fPQMatrix; fPQMatrix = 0;
00040 if (fNQMatrix) delete fNQMatrix; fNQMatrix = 0;
00041
00042 // Now, copy over the matrix data from the other object
00043 if (orig.fPQMatrix) fPQMatrix = orig.fPQMatrix->Copy();
00044 if (orig.fNQMatrix) fNQMatrix = orig.fNQMatrix->Copy();
00045
00046 return *this;
00047 }
|
|
||||||||||||||||||||
|
Definition at line 318 of file NuMatrixCPT.cxx. References fNQMatrix, fPQMatrix, and NuMatrix::Oscillate(). 00319 {
00320 if (fPQMatrix) fPQMatrix->Oscillate(dm2bar, sn2bar);
00321 if (fNQMatrix) fNQMatrix->Oscillate(dm2, sn2);
00322 }
|
|
|
Definition at line 312 of file NuMatrixCPT.cxx. References NuMMParameters::Dm2(), NuMMParameters::Dm2Bar(), Oscillate(), NuMMParameters::Sn2(), and NuMMParameters::Sn2Bar().
|
|
||||||||||||
|
Implements NuMatrix. Definition at line 125 of file NuMatrixCPT.h. Referenced by Oscillate(). 00125 { Oscillate(dm2,sn2,dm2,sn2); };
|
|
|
Definition at line 119 of file NuMatrixCPT.h. Referenced by Divide(), and Multiply(). 00119 { return fPQMatrix; }
|
|
|
Definition at line 355 of file NuMatrixCPT.cxx. References fNQMatrix, fPQMatrix, and NuMatrix::RecoToTrue(). 00356 {
00357 if (fNQMatrix) fNQMatrix->RecoToTrue(*correction.first);
00358 if (fPQMatrix) fPQMatrix->RecoToTrue(*correction.second);
00359 }
|
|
|
Implements NuMatrix. Definition at line 334 of file NuMatrixCPT.cxx. References MSG. 00335 {
00336 MSG("NuMatrixCPT",Msg::kError) << "Trying to Reco->True a CPT matrix with only one histogram!" << endl;
00337 }
|
|
|
Sets the POT count directly, without scaling.
Reimplemented from NuMatrix. Definition at line 295 of file NuMatrixCPT.cxx. References fNQMatrix, fPQMatrix, and NuMatrix::ResetPOT(). Referenced by NuMatrixCPT(), and ScaleToPOT(). 00296 {
00297 fPot = new_POT;
00298 if (fPQMatrix) fPQMatrix->ResetPOT(new_POT);
00299 if (fNQMatrix) fNQMatrix->ResetPOT(new_POT);
00300 }
|
|
|
Scales the Matrix, without changing the POT.
Implements NuMatrix. Definition at line 147 of file NuMatrixCPT.cxx. References fNQMatrix, fPQMatrix, and NuMatrix::Scale(). 00148 {
00149 if (fPQMatrix) fPQMatrix->Scale(value);
00150 if (fNQMatrix) fNQMatrix->Scale(value);
00151 }
|
|
|
Changes the POT, by scaling the data.
Implements NuMatrix. Definition at line 138 of file NuMatrixCPT.cxx. References fNQMatrix, fPQMatrix, ResetPOT(), and NuMatrix::ScaleToPOT(). 00139 {
00140 if (fPQMatrix) fPQMatrix->ScaleToPOT(new_POT);
00141 if (fNQMatrix) fNQMatrix->ScaleToPOT(new_POT);
00142 this->ResetPOT(new_POT);
00143 }
|
|
|
Implements NuMatrix. Definition at line 326 of file NuMatrixCPT.cxx. References fNQMatrix, fPQMatrix, and NuMatrix::SetValue(). 00327 {
00328 if (fPQMatrix) fPQMatrix->SetValue(val);
00329 if (fNQMatrix) fNQMatrix->SetValue(val);
00330 }
|
|
|
Returning a spectrum doesn't make sense for this class.
Implements NuMatrix. Definition at line 106 of file NuMatrixCPT.h. 00106 { return 0; }
|
|
|
Compares two NuMatrix objects and returns the LL difference.
Implements NuMatrix. Definition at line 127 of file NuMatrixCPT.cxx. References fNQMatrix, fPQMatrix, and NuMatrix::StatsLikelihood(). 00128 {
00129 Double_t like = 0.0;
00130 if (fPQMatrix) like += fPQMatrix->StatsLikelihood(with);
00131 if (fNQMatrix) like += fNQMatrix->StatsLikelihood(with);
00132
00133 return like;
00134 }
|
|
|
Definition at line 363 of file NuMatrixCPT.cxx. References fNQMatrix, fPQMatrix, and NuMatrix::TrueToReco(). 00364 {
00365 if (fNQMatrix) fNQMatrix->TrueToReco(*correction.first);
00366 if (fPQMatrix) fPQMatrix->TrueToReco(*correction.second);
00367 }
|
|
|
Implements NuMatrix. Definition at line 341 of file NuMatrixCPT.cxx. References MSG. 00342 {
00343 MSG("NuMatrixCPT",Msg::kError) << "Trying to True-Reco a CPT matrix with only one histogram!" << endl;
00344 }
|
|
|
Writes to the current file.
Implements NuMatrix. Definition at line 260 of file NuMatrixCPT.cxx. References fNQMatrix, fPQMatrix, MSG, and NuMatrix::Write(). 00261 {
00262 MSG("NuMatrixCPT",Msg::kWarning) << "Histogram writing properly implemented: Only uses PQ/NQ suffixes." << endl;
00263
00264 Int_t bytetotal = 0;
00265
00266 // If we haven't been given a name, amend the names of the histograms
00267 if (name=="")
00268 {
00269 // Don't allow the user to write with no name - this is because we
00270 // cannot (currently) access the histograms name in a Storage-independant way
00271 MSG("NuMatrixCPT",Msg::kWarning) << "Must specify a name when writing. Current limitation of NuMatrix framework." << endl;
00272
00273 // TString hname;
00274 //
00275 // if (fPQMatrix) {
00276 // hname = fPQMatrix->Spectrum()->GetName();
00277 // bytetotal += fPQMatrix->Write(hname + "_PQ");
00278 // }
00279 //
00280 // if (fNQMatrix) {
00281 // hname = fNQMatrix->Spectrum()->GetName();
00282 // bytetotal += fNQMatrix->Write(name + "_NQ");
00283 // }
00284
00285 } else {
00286 if (fPQMatrix) bytetotal += fPQMatrix->Write(name + "_PQ");
00287 if (fNQMatrix) bytetotal += fNQMatrix->Write(name + "_NQ");
00288 }
00289
00290 return bytetotal;
00291 }
|
|
|
Definition at line 20 of file NuMatrixCPT.h. Referenced by Divide(), ExtrapolateNDToFD(), Multiply(), NuMatrixCPT(), operator=(), Oscillate(), RecoToTrue(), ResetPOT(), Scale(), ScaleToPOT(), SetValue(), StatsLikelihood(), TrueToReco(), Write(), and ~NuMatrixCPT(). |
|
|
Definition at line 19 of file NuMatrixCPT.h. Referenced by Complete(), Divide(), ExtrapolateNDToFD(), Multiply(), NuMatrixCPT(), operator=(), Oscillate(), RecoToTrue(), ResetPOT(), Scale(), ScaleToPOT(), SetValue(), StatsLikelihood(), TrueToReco(), Write(), and ~NuMatrixCPT(). |
1.3.9.1