NuMatrixCPT Class Reference

Class that holds both PQ and NQ histograms. More...

#include <NuMatrixCPT.h>

Inheritance diagram for NuMatrixCPT:
NuMatrix

List of all members.

Public Member Functions

 NuMatrixCPT ()
 NuMatrixCPT (Double_t POT)
 NuMatrixCPT (const NuMatrixCPT &orig)
NuMatrixCPToperator= (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 NuMatrixCopy (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)
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)
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 Add (const NuMatrix &correction, Bool_t addpot=false)
 Functions for addition and subtraction.
virtual void Add (const NuMatrixCPT &correction, Bool_t addpot=false)
 Functions for addition and subtraction.
virtual void Subtract (const NuMatrix &correction)
virtual void Subtract (const NuMatrixCPT &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) const
 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 void Fill (const NuEvent &evt)
 Stores a NuEvent in the data representation of this NuMatrix.
virtual void SetFillTrueEnergy (void)
 We want to fill this matrix with true energy varaibles.
virtual void SetFillRecoEnergy (void)
 We want to fill this matrix with reco energy variables.
virtual NuMatrixPQ (void) const
virtual NuMatrixNQ (void) const
virtual NuMatrixNuBar (void) const
virtual NuMatrixNu (void) const
virtual void Oscillate (const Double_t dm2, const Double_t sn2)
virtual void Oscillate (const NuMMParameters &parameters)
 The NuMatrix contract.
virtual void Oscillate (Double_t dm2, Double_t sn2, Double_t dm2bar, Double_t sn2bar)
virtual void DecayCC (const double dm2, double sn2, double alpha)
virtual void DecayCC (const NuMMParameters &parameters)
virtual void DecayNC (double alpha, double sn2)
virtual void DecayNC (const NuMMParameters &parameters)
virtual void DecayMuToTau (double dm2, double sn2, double alpha)
virtual void DecayMuToTau (const NuMMParameters &parameters)
virtual void Decohere (const NuMMParameters &parameters)
virtual void Decohere (double dm2, double sn2, double mu2)

Private Attributes

NuMatrixfPQMatrix
NuMatrixfNQMatrix

Detailed Description

Class that holds both PQ and NQ histograms.

Definition at line 13 of file NuMatrixCPT.h.


Constructor & Destructor Documentation

NuMatrixCPT::NuMatrixCPT (  ) 

Definition at line 21 of file NuMatrixCPT.cxx.

Referenced by Copy().

00021                          : NuMatrix(), fPQMatrix(0), fNQMatrix(0)
00022 {
00023   
00024 }

NuMatrixCPT::NuMatrixCPT ( Double_t  POT  ) 

Definition at line 26 of file NuMatrixCPT.cxx.

00026                                      : NuMatrix(POT), fPQMatrix(0), fNQMatrix(0)
00027 {
00028   
00029 }

NuMatrixCPT::NuMatrixCPT ( const NuMatrixCPT orig  ) 

Definition at line 31 of file NuMatrixCPT.cxx.

References NuMatrix::Copy(), fNQMatrix, and fPQMatrix.

00031                                                 : NuMatrix(orig), fPQMatrix(0), fNQMatrix(0)
00032 {
00033   // Copy the histograms over
00034   if (orig.fPQMatrix) fPQMatrix = orig.fPQMatrix->Copy();
00035   if (orig.fNQMatrix) fNQMatrix = orig.fNQMatrix->Copy();
00036 }

NuMatrixCPT::NuMatrixCPT ( const NuMatrix NQ,
const NuMatrix PQ 
)

Definition at line 55 of file NuMatrixCPT.cxx.

References NuMatrix::Copy(), MuELoss::e, fNQMatrix, fPQMatrix, NuMatrix::GetPOT(), Msg::kWarning, MSG, and ResetPOT().

00056   : NuMatrix(),
00057     fPQMatrix(0),
00058     fNQMatrix(0)
00059 {
00060   // Vector to count POT of valid histograms
00061   vector<Double_t> pots;
00062   
00063   if (NQ) {
00064     fNQMatrix = NQ->Copy();
00065     pots.push_back(fNQMatrix->GetPOT());
00066   }
00067   if (PQ) {
00068     fPQMatrix = PQ->Copy();
00069     pots.push_back(fPQMatrix->GetPOT());
00070   }
00071   
00072   // Check that every POT is the same, and display a warning otherwise
00073   // This is because I can't imagine a legitimate reason to have this
00074   // scenario, at the moment.
00075   // Now, how do we set the POT? Check they are both the same, for now.
00076   // For 'same' define POT to 1e-5. Surely nobody makes values that different?
00077   if (fPQMatrix && fNQMatrix) {
00078     if (TMath::Abs(NQ->GetPOT() - PQ->GetPOT()) > 1e-5) {
00079       MSG("NuMatrixCPT",Msg::kWarning) << "POT count for pre-initialised NuMatrix objects differ." << endl;
00080       MSG("NuMatrixCPT",Msg::kWarning) << "  PQ: " << fPQMatrix->GetPOT() << endl;
00081       MSG("NuMatrixCPT",Msg::kWarning) << "  NQ: " << fNQMatrix->GetPOT() << endl;
00082       MSG("NuMatrixCPT",Msg::kWarning) << "Storing POT of NQ in object" << endl;
00083       assert(0);
00084     }
00085   }
00086   
00087   // Set out POT to the first one, recorded, if we have any.
00088   if (pots.size()) ResetPOT(pots[0]);
00089   
00090 }

NuMatrixCPT::~NuMatrixCPT (  ) 

Definition at line 122 of file NuMatrixCPT.cxx.

References fNQMatrix, and fPQMatrix.

00123 {
00124   if (fPQMatrix) delete fPQMatrix; fPQMatrix = 0;
00125   if (fNQMatrix) delete fNQMatrix; fNQMatrix = 0;
00126 }

NuMatrixCPT::NuMatrixCPT ( const TString &  filename,
const TString &  NQhistname,
const TString &  PQhistname,
const TString &  pothistname = "hTotalPot" 
)

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.

Parameters:
filename The file to read in
NQhistname The NQ histogram to read from the file
PQhistname The PQ histogram to read from the file
pothistname The files histogram to integrate to get the POT

Definition at line 94 of file NuMatrixCPT.cxx.

References fNQMatrix, fPQMatrix, NuMatrix::GetPOT(), Msg::kWarning, MSG, and ResetPOT().

00098                         : NuMatrix(),
00099                           fPQMatrix(0),
00100                           fNQMatrix(0)
00101 {
00102   // Create the two histograms
00103   fNQMatrix = new NuMatrix1D(filename, NQhistname, pothistname);
00104   fPQMatrix = new NuMatrix1D(filename, PQhistname, pothistname);
00105   
00106   // Now, Grab the POT out of each
00107   Double_t potPQ = 0.0, potNQ = 0.0;
00108   potPQ = fPQMatrix->GetPOT();
00109   potNQ = fNQMatrix->GetPOT();
00110   
00111   if (potPQ != potNQ)
00112   {
00113     MSG("NuMatrixCPT",Msg::kWarning) << "POT read from file "
00114       << filename << " does not seem to match between histograms."
00115       << endl;
00116   } else {
00117     this->ResetPOT(potNQ);
00118   }
00119   
00120 }


Member Function Documentation

void NuMatrixCPT::Add ( const NuMatrixCPT correction,
Bool_t  addpot = false 
) [virtual]

Functions for addition and subtraction.

Implements NuMatrix.

Definition at line 279 of file NuMatrixCPT.cxx.

References NuMatrix::Add(), fNQMatrix, fPQMatrix, NuMatrix::GetPOT(), NQ(), PQ(), and ResetPOT().

00280 {
00281   if (fPQMatrix && with.PQ()) fPQMatrix->Add(*with.PQ(), addpot);
00282   if (fNQMatrix && with.NQ()) fNQMatrix->Add(*with.NQ(), addpot);
00283   
00284   // Add the POT if this is requested
00285   if (addpot) ResetPOT(GetPOT()+with.GetPOT());
00286 }

void NuMatrixCPT::Add ( const NuMatrix correction,
Bool_t  addpot = false 
) [virtual]

Functions for addition and subtraction.

Definition at line 266 of file NuMatrixCPT.cxx.

References Msg::kWarning, and MSG.

00267 {
00268   // Convert the NuMatrix to a NuMatrixCPT
00269   const NuMatrixCPT *other = dynamic_cast<const NuMatrixCPT*>(&with);
00270   if (other == 0) {
00271     MSG("NuMatrixCPT",Msg::kWarning) << "Attempting to add a NuMatrixCPT to something other than a NuMatrixCPT" << endl;
00272   }
00273 
00274   this->Add(*other, addpot);
00275 }

Bool_t NuMatrixCPT::Complete (  )  const [virtual]

Tells the user if the class is completely configured.

Implements NuMatrix.

Definition at line 539 of file NuMatrixCPT.cxx.

References NuMatrix::Complete(), fNQMatrix, and fPQMatrix.

Referenced by RockFiller::GetRockMatrix(), RockFiller::RockFiller(), and RockRunCPT::RockRunCPT().

00540 {
00541   if (!(fPQMatrix && fNQMatrix)) return false;
00542   
00543   if (!fPQMatrix->Complete()) return false;
00544   if (!fNQMatrix->Complete()) return false;
00545   
00546   return true;
00547 }

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

Makes a deep-object copy.

Implements NuMatrix.

Definition at line 55 of file NuMatrixCPT.h.

References NuMatrixCPT().

00055 { return new NuMatrixCPT(*this); }

void NuMatrixCPT::DecayCC ( const NuMMParameters parameters  )  [virtual]

Definition at line 376 of file NuMatrixCPT.cxx.

References NuMMParameters::Alpha(), DecayCC(), NuMMParameters::Dm2(), and NuMMParameters::Sn2().

00377 {
00378   // NB doesn't allow CPT-violating neutrino decay
00379   DecayCC(p.Dm2(), p.Sn2(), p.Alpha());
00380 }

void NuMatrixCPT::DecayCC ( const double  dm2,
double  sn2,
double  alpha 
) [virtual]

Definition at line 384 of file NuMatrixCPT.cxx.

References NuMatrix::DecayCC(), fNQMatrix, and fPQMatrix.

Referenced by DecayCC(), and RockFiller::GetRockMatrix().

00385 {
00386   // NB doesn't allow CPT-violating neutrino decay
00387   if(fPQMatrix) fPQMatrix->DecayCC(dm2, sn2, alpha);
00388   if(fNQMatrix) fNQMatrix->DecayCC(dm2, sn2, alpha);
00389 }

void NuMatrixCPT::DecayMuToTau ( const NuMMParameters parameters  )  [virtual]

Definition at line 410 of file NuMatrixCPT.cxx.

References NuMMParameters::Alpha(), DecayMuToTau(), NuMMParameters::Dm2(), and NuMMParameters::Sn2().

00411 {
00412   // NB doesn't allow CPT-violating neutrino decay
00413   DecayMuToTau(p.Dm2(), p.Sn2(), p.Alpha());
00414 }

void NuMatrixCPT::DecayMuToTau ( double  dm2,
double  sn2,
double  alpha 
) [virtual]

Definition at line 418 of file NuMatrixCPT.cxx.

References NuMatrix::DecayMuToTau(), fNQMatrix, and fPQMatrix.

Referenced by DecayMuToTau(), and RockFiller::GetRockMatrix().

00419 {
00420   // NB doesn't allow CPT-violating neutrino decay
00421   if(fPQMatrix) fPQMatrix->DecayMuToTau(dm2, sn2, alpha);
00422   if(fNQMatrix) fNQMatrix->DecayMuToTau(dm2, sn2, alpha);
00423 }

void NuMatrixCPT::DecayNC ( const NuMMParameters parameters  )  [virtual]

Definition at line 393 of file NuMatrixCPT.cxx.

References NuMMParameters::Alpha(), DecayNC(), and NuMMParameters::Sn2().

00394 {
00395   // NB doesn't allow CPT-violating neutrino decay
00396   DecayNC(p.Sn2(), p.Alpha());
00397 }

void NuMatrixCPT::DecayNC ( double  alpha,
double  sn2 
) [virtual]

Definition at line 401 of file NuMatrixCPT.cxx.

References NuMatrix::DecayNC(), fNQMatrix, and fPQMatrix.

Referenced by DecayNC(), and RockFiller::GetRockMatrix().

00402 {
00403   // NB doesn't allow CPT-violating neutrino decay
00404   if(fPQMatrix) fPQMatrix->DecayNC(sn2, alpha);
00405   if(fNQMatrix) fNQMatrix->DecayNC(sn2, alpha);
00406 }

void NuMatrixCPT::Decohere ( double  dm2,
double  sn2,
double  mu2 
) [virtual]

Definition at line 435 of file NuMatrixCPT.cxx.

References NuMatrix::Decohere(), fNQMatrix, and fPQMatrix.

00436 {
00437   // NB doesn't allow CPT-violating neutrino decay
00438   if(fPQMatrix) fPQMatrix->Decohere(dm2, sn2, mu2);
00439   if(fNQMatrix) fNQMatrix->Decohere(dm2, sn2, mu2);
00440 }

void NuMatrixCPT::Decohere ( const NuMMParameters parameters  )  [virtual]

Definition at line 427 of file NuMatrixCPT.cxx.

References NuMMParameters::Dm2(), NuMMParameters::Mu2(), and NuMMParameters::Sn2().

Referenced by RockFiller::GetRockMatrix().

00428 {
00429   // NB doesn't allow CPT-violating neutrino decay
00430   Decohere(p.Dm2(), p.Sn2(), p.Mu2());
00431 }

void NuMatrixCPT::Divide ( const std::pair< const TGraph *, const TGraph * > &  correction  )  [virtual]

Definition at line 206 of file NuMatrixCPT.cxx.

References NuMatrix::Divide(), fNQMatrix, and fPQMatrix.

00207 {
00208   if (fNQMatrix && corr.first) fNQMatrix->Divide(*corr.first);
00209   if (fPQMatrix && corr.second) fPQMatrix->Divide(*corr.second);
00210 }

void NuMatrixCPT::Divide ( const std::pair< const TH1D *, const TH1D * > &  correction  )  [virtual]

Definition at line 198 of file NuMatrixCPT.cxx.

References NuMatrix::Divide(), fNQMatrix, and fPQMatrix.

00199 {
00200   if (fNQMatrix && corr.first) fNQMatrix->Divide(*corr.first);
00201   if (fPQMatrix && corr.second) fPQMatrix->Divide(*corr.second);
00202 }

void NuMatrixCPT::Divide ( const TGraph &  correction  )  [virtual]

Implements NuMatrix.

Definition at line 190 of file NuMatrixCPT.cxx.

References NuMatrix::Divide(), fNQMatrix, and fPQMatrix.

00191 {
00192   if (fPQMatrix) fPQMatrix->Divide(correction);
00193   if (fNQMatrix) fNQMatrix->Divide(correction);
00194 }

void NuMatrixCPT::Divide ( const TH1 &  correction,
const Option_t *  option = "" 
) [virtual]

Implements NuMatrix.

Definition at line 182 of file NuMatrixCPT.cxx.

References NuMatrix::Divide(), fNQMatrix, and fPQMatrix.

00183 {
00184   if (fPQMatrix) fPQMatrix->Divide(correction, option);
00185   if (fNQMatrix) fNQMatrix->Divide(correction, option);
00186 }

void NuMatrixCPT::Divide ( const NuMatrixCPT correction  )  [virtual]

If a component is null, operation will fail silently.

Implements NuMatrix.

Definition at line 174 of file NuMatrixCPT.cxx.

References NuMatrix::Divide(), fNQMatrix, fPQMatrix, NQ(), and PQ().

00175 {
00176   if (fPQMatrix && correction.PQ()) fPQMatrix->Divide(*correction.PQ());
00177   if (fNQMatrix && correction.NQ()) fNQMatrix->Divide(*correction.NQ());
00178 }

void NuMatrixCPT::Divide ( const NuMatrix correction  )  [virtual]

Definition at line 161 of file NuMatrixCPT.cxx.

References Msg::kWarning, and MSG.

Referenced by RockRunCPT::CalculateFDFlux(), and RockRunCPT::RockRunCPT().

00162 {
00163   // Convert the NuMatrix to a NuMatrixCPT
00164   const NuMatrixCPT *other = dynamic_cast<const NuMatrixCPT*>(&correction);
00165   if (other == 0) {
00166     MSG("NuMatrixCPT",Msg::kWarning) << "Attempting to divide a NuMatrixCPT by something other than a NuMatrixCPT" << endl;
00167   }
00168   
00169   this->Divide(*other);
00170 }

void NuMatrixCPT::Draw ( Option_t *  option = ""  )  [virtual]

Implements NuMatrix.

Definition at line 355 of file NuMatrixCPT.cxx.

References Msg::kInfo, and MSG.

00356 {
00357   MSG("NuMatrixCPT",Msg::kInfo) << "Cannot draw CPT matrix directly at this time. Draw NQ() and PQ() independently." << endl;
00358   
00359 }

void NuMatrixCPT::ExtrapolateNDToFD ( const std::pair< const TH2D *, const TH2D * > &  beammatrix  )  [virtual]

Definition at line 489 of file NuMatrixCPT.cxx.

References NuMatrix::ExtrapolateNDToFD(), fNQMatrix, and fPQMatrix.

00490 {
00491   if (fNQMatrix) fNQMatrix->ExtrapolateNDToFD(*beammatrix.first);
00492   if (fPQMatrix) fPQMatrix->ExtrapolateNDToFD(*beammatrix.second);
00493 }

void NuMatrixCPT::ExtrapolateNDToFD ( const TH2D &  beammatrix  )  [virtual]

Implements NuMatrix.

Definition at line 466 of file NuMatrixCPT.cxx.

References Msg::kError, and MSG.

Referenced by RockRunCPT::CalculateFDFlux().

00467 {
00468     MSG("NuMatrixCPT",Msg::kError) << "Trying to extrapolate a CPT matrix with only one histogram!" << endl;
00469 }

void NuMatrixCPT::Fill ( const NuEvent evt  )  [virtual]

Stores a NuEvent in the data representation of this NuMatrix.

Reimplemented from NuMatrix.

Definition at line 498 of file NuMatrixCPT.cxx.

References NuEvent::charge, NuMatrix::Fill(), fNQMatrix, Plot::Format(), fPQMatrix, NuMatrix::GetFillTypeEnergy(), and NuMatrix::kTrue.

00499 {
00500   // For now, throw an error if we are set to True - we don't know if we
00501   // want to split on true charge or reconstructed charge
00502 
00503   if (GetFillTypeEnergy() == kTrue) {
00504     // MSG("NuMatrixCPT",Msg::kError)
00505     //   << "Do not know how to handle true energy charges in NuMatrixCPT" << endl;
00506     assert(!(GetFillTypeEnergy() == kTrue));
00507   }
00508   
00509   if (evt.charge == -1) {
00510     if (fNQMatrix) fNQMatrix->Fill(evt);
00511   } else if (evt.charge == +1) {
00512     if (fPQMatrix) fPQMatrix->Fill(evt);
00513   } else {
00514     TString str = TString::Format("Can not handle charge=%d in NuMatrixCPT!", evt.charge);
00515     throw std::runtime_error(str.Data());
00516   }
00517 }

void NuMatrixCPT::Multiply ( const std::pair< const TGraph *, const TGraph * > &  correction  )  [virtual]

Definition at line 258 of file NuMatrixCPT.cxx.

References fNQMatrix, fPQMatrix, and NuMatrix::Multiply().

00259 {
00260   if (fNQMatrix && corr.first) fNQMatrix->Multiply(*corr.first);
00261   if (fPQMatrix && corr.second) fPQMatrix->Multiply(*corr.second);  
00262 }

void NuMatrixCPT::Multiply ( const std::pair< const TH1D *, const TH1D * > &  correction  )  [virtual]

Definition at line 250 of file NuMatrixCPT.cxx.

References fNQMatrix, fPQMatrix, and NuMatrix::Multiply().

00251 {
00252   if (fNQMatrix && corr.first) fNQMatrix->Multiply(*corr.first);
00253   if (fPQMatrix && corr.second) fPQMatrix->Multiply(*corr.second);
00254 }

void NuMatrixCPT::Multiply ( const TGraph &  correction  )  [virtual]

Implements NuMatrix.

Definition at line 243 of file NuMatrixCPT.cxx.

References fNQMatrix, fPQMatrix, and NuMatrix::Multiply().

00244 {
00245   if (fPQMatrix) fPQMatrix->Multiply(correction);
00246   if (fNQMatrix) fNQMatrix->Multiply(correction);
00247 }

void NuMatrixCPT::Multiply ( const TH1 &  correction,
const Option_t *  option = "" 
) [virtual]

Implements NuMatrix.

Definition at line 235 of file NuMatrixCPT.cxx.

References fNQMatrix, fPQMatrix, and NuMatrix::Multiply().

00236 {
00237   if (fPQMatrix) fPQMatrix->Multiply(correction, option);
00238   if (fNQMatrix) fNQMatrix->Multiply(correction, option);
00239 }

void NuMatrixCPT::Multiply ( const NuMatrixCPT correction  )  [virtual]

If a component is null, operation will fail silently.

Implements NuMatrix.

Definition at line 227 of file NuMatrixCPT.cxx.

References fNQMatrix, fPQMatrix, NuMatrix::Multiply(), NQ(), and PQ().

00228 {
00229   if (fPQMatrix && correction.PQ()) fPQMatrix->Multiply(*correction.PQ());
00230   if (fNQMatrix && correction.NQ()) fNQMatrix->Multiply(*correction.NQ());  
00231 }

void NuMatrixCPT::Multiply ( const NuMatrix correction  )  [virtual]

Definition at line 214 of file NuMatrixCPT.cxx.

References Msg::kWarning, and MSG.

Referenced by RockRunCPT::CalculateFDFlux().

00215 {
00216   // Convert the NuMatrix to a NuMatrixCPT
00217   const NuMatrixCPT *other = dynamic_cast<const NuMatrixCPT*>(&correction);
00218   if (other == 0) {
00219     MSG("NuMatrixCPT",Msg::kWarning) << "Attempting to multiply a NuMatrixCPT by something other than a NuMatrixCPT" << endl;
00220   }
00221   
00222   this->Multiply(*other);
00223 }

virtual NuMatrix* NuMatrixCPT::NQ ( void   )  const [inline, virtual]
virtual NuMatrix* NuMatrixCPT::Nu ( void   )  const [inline, virtual]

Definition at line 132 of file NuMatrixCPT.h.

References fNQMatrix.

Referenced by RockFiller::GetRockMatrix().

00132 { return fNQMatrix; }

virtual NuMatrix* NuMatrixCPT::NuBar ( void   )  const [inline, virtual]

Definition at line 131 of file NuMatrixCPT.h.

References fPQMatrix.

Referenced by RockFiller::GetRockMatrix().

00131 { return fPQMatrix; }

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

Definition at line 38 of file NuMatrixCPT.cxx.

References NuMatrix::Copy(), fNQMatrix, and fPQMatrix.

00039 {
00040   // Copy the base class stuff
00041   this->NuMatrix::operator=(orig);
00042   
00043   // If our spectra exist, delete them
00044   if (fPQMatrix) delete fPQMatrix; fPQMatrix = 0;
00045   if (fNQMatrix) delete fNQMatrix; fNQMatrix = 0;
00046   
00047   // Now, copy over the matrix data from the other object
00048   if (orig.fPQMatrix) fPQMatrix = orig.fPQMatrix->Copy();
00049   if (orig.fNQMatrix) fNQMatrix = orig.fNQMatrix->Copy();
00050   
00051   return *this;
00052 }

void NuMatrixCPT::Oscillate ( Double_t  dm2,
Double_t  sn2,
Double_t  dm2bar,
Double_t  sn2bar 
) [virtual]

Definition at line 368 of file NuMatrixCPT.cxx.

References fNQMatrix, fPQMatrix, and NuMatrix::Oscillate().

00369 {
00370   if (fPQMatrix) fPQMatrix->Oscillate(dm2bar, sn2bar);
00371   if (fNQMatrix) fNQMatrix->Oscillate(dm2, sn2);
00372 }

void NuMatrixCPT::Oscillate ( const NuMMParameters parameters  )  [virtual]

The NuMatrix contract.

Definition at line 363 of file NuMatrixCPT.cxx.

References NuMMParameters::Dm2(), NuMMParameters::Dm2Bar(), Oscillate(), NuMMParameters::Sn2(), and NuMMParameters::Sn2Bar().

00364 {
00365   Oscillate(p.Dm2(), p.Sn2(),p.Dm2Bar(),p.Sn2Bar());
00366 }

virtual void NuMatrixCPT::Oscillate ( const Double_t  dm2,
const Double_t  sn2 
) [inline, virtual]

Implements NuMatrix.

Definition at line 135 of file NuMatrixCPT.h.

References Oscillate().

Referenced by RockFiller::GetRockMatrix(), and Oscillate().

00135 { Oscillate(dm2,sn2,dm2,sn2); }; 

virtual NuMatrix* NuMatrixCPT::PQ ( void   )  const [inline, virtual]
void NuMatrixCPT::RecoToTrue ( const std::pair< const TH2D *, const TH2D * > &  correction  )  [virtual]

Definition at line 473 of file NuMatrixCPT.cxx.

References fNQMatrix, fPQMatrix, and NuMatrix::RecoToTrue().

00474 {
00475   if (fNQMatrix) fNQMatrix->RecoToTrue(*correction.first);
00476   if (fPQMatrix) fPQMatrix->RecoToTrue(*correction.second);
00477 }

void NuMatrixCPT::RecoToTrue ( const TH2D &  correction  )  [virtual]

Implements NuMatrix.

Definition at line 452 of file NuMatrixCPT.cxx.

References Msg::kError, and MSG.

Referenced by RockRunCPT::CalculateFDFlux().

00453 {
00454   MSG("NuMatrixCPT",Msg::kError) << "Trying to Reco->True a CPT matrix with only one histogram!" << endl;
00455 }

void NuMatrixCPT::ResetPOT ( Double_t  new_POT  )  [virtual]

Sets the POT count directly, without scaling.

Reimplemented from NuMatrix.

Definition at line 346 of file NuMatrixCPT.cxx.

References fNQMatrix, NuMatrix::fPot, fPQMatrix, and NuMatrix::ResetPOT().

Referenced by Add(), NuMatrixCPT(), and ScaleToPOT().

00347 {
00348   fPot = new_POT;
00349   if (fPQMatrix) fPQMatrix->ResetPOT(new_POT);
00350   if (fNQMatrix) fNQMatrix->ResetPOT(new_POT);
00351 }

void NuMatrixCPT::Scale ( Double_t  value  )  [virtual]

Scales the Matrix, without changing the POT.

Implements NuMatrix.

Definition at line 153 of file NuMatrixCPT.cxx.

References fNQMatrix, fPQMatrix, and NuMatrix::Scale().

00154 {
00155   if (fPQMatrix) fPQMatrix->Scale(value);
00156   if (fNQMatrix) fNQMatrix->Scale(value);
00157 }

void NuMatrixCPT::ScaleToPOT ( Double_t  new_POT  )  [virtual]

Changes the POT, by scaling the data.

Implements NuMatrix.

Definition at line 144 of file NuMatrixCPT.cxx.

References fNQMatrix, fPQMatrix, ResetPOT(), and NuMatrix::ScaleToPOT().

00145 {
00146   if (fPQMatrix) fPQMatrix->ScaleToPOT(new_POT);
00147   if (fNQMatrix) fNQMatrix->ScaleToPOT(new_POT);
00148   this->ResetPOT(new_POT);
00149 }

void NuMatrixCPT::SetFillRecoEnergy ( void   )  [virtual]

We want to fill this matrix with reco energy variables.

Reimplemented from NuMatrix.

Definition at line 530 of file NuMatrixCPT.cxx.

References fNQMatrix, fPQMatrix, and NuMatrix::SetFillRecoEnergy().

void NuMatrixCPT::SetFillTrueEnergy ( void   )  [virtual]

We want to fill this matrix with true energy varaibles.

Reimplemented from NuMatrix.

Definition at line 521 of file NuMatrixCPT.cxx.

References fNQMatrix, fPQMatrix, and NuMatrix::SetFillTrueEnergy().

void NuMatrixCPT::SetValue ( Double_t  val  )  [virtual]

Implements NuMatrix.

Definition at line 444 of file NuMatrixCPT.cxx.

References fNQMatrix, fPQMatrix, and NuMatrix::SetValue().

Referenced by RockFiller::GetRockMatrix().

00445 {
00446   if (fPQMatrix) fPQMatrix->SetValue(val);
00447   if (fNQMatrix) fNQMatrix->SetValue(val);
00448 }

virtual TH1* NuMatrixCPT::Spectrum ( void   )  const [inline, virtual]

Returning a spectrum doesn't make sense for this class.

Implements NuMatrix.

Definition at line 109 of file NuMatrixCPT.h.

00109 { return 0; }

Double_t NuMatrixCPT::StatsLikelihood ( const NuMatrix with  )  const [virtual]

Compares two NuMatrix objects and returns the LL difference.

Definition at line 133 of file NuMatrixCPT.cxx.

References fNQMatrix, fPQMatrix, and NuMatrix::StatsLikelihood().

00134 {
00135   Double_t like = 0.0;
00136   if (fPQMatrix) like += fPQMatrix->StatsLikelihood(with);
00137   if (fNQMatrix) like += fNQMatrix->StatsLikelihood(with);
00138   
00139   return like;
00140 }

void NuMatrixCPT::Subtract ( const NuMatrixCPT correction  )  [virtual]

Implements NuMatrix.

Definition at line 302 of file NuMatrixCPT.cxx.

References fNQMatrix, fPQMatrix, NQ(), PQ(), and NuMatrix::Subtract().

00303 {
00304   if (fPQMatrix && with.PQ()) fPQMatrix->Subtract(*with.PQ());
00305   if (fNQMatrix && with.NQ()) fNQMatrix->Subtract(*with.NQ());
00306 }

void NuMatrixCPT::Subtract ( const NuMatrix correction  )  [virtual]

Definition at line 289 of file NuMatrixCPT.cxx.

References Msg::kWarning, and MSG.

00290 {
00291   // Convert the NuMatrix to a NuMatrixCPT
00292   const NuMatrixCPT *other = dynamic_cast<const NuMatrixCPT*>(&with);
00293   if (other == 0) {
00294     MSG("NuMatrixCPT",Msg::kWarning) << "Attempting to subtract a NuMatrixCPT to something other than a NuMatrixCPT" << endl;
00295   }
00296 
00297   this->Subtract(*other);
00298 }

void NuMatrixCPT::TrueToReco ( const std::pair< const TH2D *, const TH2D * > &  correction  )  [virtual]

Definition at line 481 of file NuMatrixCPT.cxx.

References fNQMatrix, fPQMatrix, and NuMatrix::TrueToReco().

00482 {
00483   if (fNQMatrix) fNQMatrix->TrueToReco(*correction.first);
00484   if (fPQMatrix) fPQMatrix->TrueToReco(*correction.second);
00485 }

void NuMatrixCPT::TrueToReco ( const TH2D &  correction  )  [virtual]

Implements NuMatrix.

Definition at line 459 of file NuMatrixCPT.cxx.

References Msg::kError, and MSG.

00460 {
00461   MSG("NuMatrixCPT",Msg::kError) << "Trying to True-Reco a CPT matrix with only one histogram!" << endl;  
00462 }

Int_t NuMatrixCPT::Write ( const TString &  name  )  const [virtual]

Writes to the current file.

Implements NuMatrix.

Definition at line 311 of file NuMatrixCPT.cxx.

References fNQMatrix, fPQMatrix, Msg::kWarning, MSG, and NuMatrix::Write().

00312 {
00313   // MSG("NuMatrixCPT",Msg::kWarning) << "Histogram writing not properly implemented: Only uses PQ/NQ suffixes." << endl;
00314   
00315   Int_t bytetotal = 0;
00316   
00317   // If we haven't been given a name, amend the names of the histograms
00318   if (name=="")
00319   {
00320     // Don't allow the user to write with no name - this is because we
00321     // cannot (currently) access the histograms name in a Storage-independant way
00322     MSG("NuMatrixCPT",Msg::kWarning) << "Must specify a name when writing. Current limitation of NuMatrix framework." << endl;
00323 
00324     // TString hname;
00325     // 
00326     // if (fPQMatrix) {
00327     //   hname = fPQMatrix->Spectrum()->GetName();
00328     //   bytetotal += fPQMatrix->Write(hname + "_PQ");
00329     // }
00330     // 
00331     // if (fNQMatrix) {
00332     //   hname = fNQMatrix->Spectrum()->GetName();
00333     //   bytetotal += fNQMatrix->Write(name + "_NQ");
00334     // }
00335     
00336   } else {
00337     if (fPQMatrix) bytetotal += fPQMatrix->Write(name + "_PQ");
00338     if (fNQMatrix) bytetotal += fNQMatrix->Write(name + "_NQ");
00339   }
00340   
00341   return bytetotal;
00342 }


Member Data Documentation


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1