NuMatrixSpectrum Class Reference

#include <NuMatrixSpectrum.h>

Inheritance diagram for NuMatrixSpectrum:
NuMatrix1D NuMatrix

List of all members.

Public Member Functions

 NuMatrixSpectrum ()
 NuMatrixSpectrum (const TH1D &spectrum)
 NuMatrixSpectrum (const TH1D &spectrum, const Double_t pot)
 NuMatrixSpectrum (const Double_t pot)
 For when you want to set PoT and not the spectrum.
 NuMatrixSpectrum (const std::string &filename, const std::string &histname, const std::string &POTHistname="hTotalPot")
 Loads a histogram from a .root file.
 NuMatrixSpectrum (TFile *specfile, const std::string &histname, const std::string &POTHistname="hTotalPot")
virtual ~NuMatrixSpectrum ()
const char * GetName () const
void SetName (const char *_name)
virtual void Multiply (const TH1 *c)
virtual void Multiply (const NuMatrixSpectrum *c)
virtual void Multiply (const TGraph *c)
virtual void Multiply (TF1 *c)
virtual void Divide (const TH1 *correction, Option_t *option="")
virtual void Divide (const NuMatrixSpectrum *c, Option_t *option="")
virtual void Divide (const NuMatrixSpectrum c, Option_t *option="")
virtual void Divide (const TGraph *correction)
virtual void MultiplyPurity (const TH1D *corr, const Double_t corrShift)
virtual void DividePurity (const TH1D *corr, const Double_t corrShift)
virtual void RecoToTrue (const TH2D *correction)
virtual void TrueToReco (const TH2D *correction)
virtual void GenerateSystErrors ()
virtual void GenerateErrors (Double_t scale=1)
virtual void RemoveErrors ()
virtual void BinWidthNormalize (double width=-1)
virtual void NuBarCompressX ()
virtual void NCCompressX ()
virtual void CC2010CompressX ()
virtual void CC2014CompressX ()
virtual void CompressTopBins ()
virtual void DrawNuBarAxes (int lsize=-1)
virtual void DrawNCAxes (int lsize=-1)
virtual void DrawCC2010Axes (bool labels=true)
virtual void DrawCC2014Axes (bool labels=true)
virtual void CutLastBin ()
virtual void BlessedND (bool rebin=true, bool scale=true)
virtual void BlessedFD (bool scale=true)
virtual void BlessedForNC (void)
virtual void BlessedFDRatio (bool scale=true)
virtual void SetFontAndSize (int textFont, int textSize)
virtual void BlessedFD2010 ()
virtual void BlessedFD2014 ()
virtual void BlessedFD7e20 (bool scale=true)
virtual const TH2D MakeJessTemplate (const TH2D *recoVtrue) const
virtual void DrawPoisson (Option_t *opt="")
virtual void SetLineColor (Color_t color)
virtual void SetLineWidth (Width_t width)
virtual void SetLineStyle (Style_t style)
virtual void SetMarkerColor (Color_t col)
virtual void SetMarkerSize (Size_t size)
virtual void SetMarkerStyle (Style_t sty)
virtual void SetFillColor (Color_t color)
virtual void SetFillStyle (Style_t style)
virtual void SetTitle (const char *title)
virtual void CenterTitles (Bool_t cent=true)
virtual void SetRangeUser (double low, double high)
virtual TAxis * GetXaxis ()
virtual TAxis * GetYaxis ()
virtual Double_t Integral (Option_t *op="")
virtual Double_t Integral (Int_t binx1, Int_t binx2, Option_t *option="")
virtual Double_t IntegralVals (Double_t low, Double_t high, Option_t *option="")
virtual Int_t GetNbinsX () const
virtual Double_t GetEntries () const
virtual void ExtrapolateNDToFD (const TH2D *corr)
virtual void Oscillate (Double_t dm2, Double_t sn2)
 Oscillation function.
virtual void Oscillate_3flavour (Double_t dm232, Double_t t23, Double_t dm221, Double_t t12, Double_t t13, Double_t delta, int inu)
virtual void OscillateSimpleAverage (Double_t dm2, Double_t sn2)
virtual void OscillatePreAveraged (Double_t dm2, Double_t sn2)
virtual void OscillateLinearInterp (Double_t dm2, Double_t sn2)
virtual void OscillateHybrid (Double_t dm2, Double_t sn2)
virtual void OscillateHybrid_3flavour (Double_t dm232, Double_t t23, Double_t dm221, Double_t t12, Double_t t13, Double_t delta, int inu)
virtual void OscillateBasic_3flavour (Double_t dm232, Double_t t23, Double_t dm221, Double_t t12, Double_t t13, Double_t delta, int inu)
virtual void OscillateNSI (Double_t dm2, Double_t sn2, Double_t epsilon, Double_t sign)
void OscillateLED (int initialFlavor, int finalFlavor, int cp_sign, double th12, double th13, double th23, double deltacp, double sdm, double ldm, double m0, double a)
virtual void OscillateMu2Mu (Double_t dm2, Double_t sn2, Double_t gmu, Double_t gtau, Double_t cmumu, Double_t ctautau)
virtual void OscillateMu2MuBar (Double_t dm2, Double_t sn2, Double_t gmu, Double_t gtau, Double_t cmumu, Double_t ctautau)
virtual void OscillateMu2Tau (Double_t dm2, Double_t sn2, Double_t gmu, Double_t gtau, Double_t cmumu, Double_t ctautau)
virtual void OscillateMu2TauBar (Double_t dm2, Double_t sn2, Double_t gmu, Double_t gtau, Double_t cmumu, Double_t ctautau)
void OscillateFourFlavour (const double dm2, const double theta23, const double dm221, const double dm243, const double theta12, const double theta13, const double theta14, const double theta24, const double theta34, const double delta1, const double delta2, const double delta3, const double baseline)
void OscillateFourFlavourAverage (const double dm2, const double theta23, const double dm221, const double dm243, const double theta12, const double theta13, const double theta14, const double theta24, const double theta34, const double delta1, const double delta2, const double delta3, const double baseline)
void UnoscillateND (const double dm2, const double theta23, const double dm221, const double dm243, const double theta12, const double theta13, const double theta14, const double theta24, const double theta34, const double delta1, const double delta2, const double delta3, const double baseline)
void UnoscillateNDAverage (const double dm2, const double theta23, const double dm221, const double dm243, const double theta12, const double theta13, const double theta14, const double theta24, const double theta34, const double delta1, const double delta2, const double delta3, const double baseline)
virtual void InverseOscillate (Double_t dm2, Double_t sn2)
virtual void InverseOscillateSimpleAverage (Double_t dm2, Double_t sn2)
virtual void InverseOscillatePreAveraged (Double_t dm2, Double_t sn2)
virtual void InverseOscillateLinearInterp (Double_t dm2, Double_t sn2)
virtual void InverseOscillateHybrid (Double_t dm2, Double_t sn2)
virtual void InverseOscillateNSI (Double_t dm2, Double_t sn2, Double_t epsilon, Double_t sign)
virtual void RebinToArray (std::vector< Double_t > &bins)
virtual void RebinToArray (int nbins, const double binedges[999])
virtual void RebinToScheme (int scheme)
virtual void RebinToScheme (NuBinningScheme::NuBinningScheme_t scheme)
virtual void RebinForFit ()
virtual void RebinForPlotAsFit ()
virtual void RebinToHalfGeV ()
virtual void RebinForPlots ()
virtual void RebinTo4GeV ()
 Bins in 4Gev Jumps up to 48Gev, then one bin to 200Gev.
virtual void RebinToGeV (Double_t binwidth)
virtual void RebinToNMB ()
virtual void ResetSpectrum (TH1D &spectrum)
NuMatrixSpectrumFluctuate ()
void FluctuateMe ()
virtual NuMatrixSpectrumCopy (void) const
 Makes a deep-object copy.
TH1D * Spectrum () const
 Returns a TH1 object representing the data the spectrum holds. Or zero.
Double_t PoT (void) const
void ResetPoT (Double_t pot)
void ScaleToPot (Double_t pot)

Static Public Member Functions

static TF1 * GetAxisFunc ()

Static Public Attributes

static double compress = 5
static double xlimit = 10

Protected Member Functions

virtual Double_t PoiErr (double y, bool up)
virtual void CalcPoisson ()
void FillOscCache (double dmsq) const
void FillOscCache_3flavour (Double_t dm232, Double_t t23, Double_t dm221, Double_t t12, Double_t t13, Double_t delta, int inu) const
double threeFlavourWeight (double energy, double dm232, double t23, double dm221, double t12, double t13, double delta, int inu)
 ClassDef (NuMatrixSpectrum, 0)

Protected Attributes

TArrayD fPoiUp
TArrayD fPoiDn
bool fDoPoisson

Static Protected Attributes

static double fgCachedDmsq = -123456789
 The value of dmsq that fgCachedOsc was generated at.
static NuMatrixSpectrumfgCachedOsc = 0
 The oscillation dip calculated at dmsq = fgCachedDmsq, sinsq = 1.

Detailed Description

Definition at line 15 of file NuMatrixSpectrum.h.


Constructor & Destructor Documentation

NuMatrixSpectrum::NuMatrixSpectrum (  ) 

Definition at line 41 of file NuMatrixSpectrum.cxx.

Referenced by Copy(), FillOscCache(), and Fluctuate().

00042   : NuMatrix1D(), fPoiUp(200), fPoiDn(200), fDoPoisson(false)
00043 {
00044 }

NuMatrixSpectrum::NuMatrixSpectrum ( const TH1D &  spectrum  )  [explicit]

Definition at line 47 of file NuMatrixSpectrum.cxx.

00048   : NuMatrix1D(spectrum), fPoiUp(200), fPoiDn(200), fDoPoisson(false)
00049 {
00050 }

NuMatrixSpectrum::NuMatrixSpectrum ( const TH1D &  spectrum,
const Double_t  pot 
)

Definition at line 53 of file NuMatrixSpectrum.cxx.

00055   : NuMatrix(pot), NuMatrix1D(spectrum, pot), fPoiUp(200), fPoiDn(200), fDoPoisson(false)
00056 {
00057 }

NuMatrixSpectrum::NuMatrixSpectrum ( const Double_t  pot  ) 

For when you want to set PoT and not the spectrum.

Definition at line 148 of file NuMatrixSpectrum.cxx.

00149   : NuMatrix(pot), NuMatrix1D(pot), fPoiUp(200), fPoiDn(200), fDoPoisson(false)
00150 {
00151 }

NuMatrixSpectrum::NuMatrixSpectrum ( const std::string &  filename,
const std::string &  histname,
const std::string &  POTHistname = "hTotalPot" 
)

Loads a histogram from a .root file.

NuMatrixSpectrum::NuMatrixSpectrum ( TFile *  specfile,
const std::string &  histname,
const std::string &  POTHistname = "hTotalPot" 
)
NuMatrixSpectrum::~NuMatrixSpectrum (  )  [virtual]

Definition at line 154 of file NuMatrixSpectrum.cxx.

00155 {
00156   //done by base class:
00157   // if (fSpectrum){delete fSpectrum; fSpectrum = 0;}
00158 }


Member Function Documentation

void NuMatrixSpectrum::BinWidthNormalize ( double  width = -1  )  [virtual]

Definition at line 342 of file NuMatrixSpectrum.cxx.

References MuELoss::e, fDoPoisson, fPoiDn, fPoiUp, NuMatrix1D::fSpectrum, and GetNbinsX().

Referenced by BlessedFD(), BlessedFD2010(), BlessedFD2014(), BlessedFD7e20(), BlessedForNC(), BlessedND(), NuStatistics::PredSpectrum(), RatioPlot::RatioPlot(), RebinForPlotAsFit(), and RebinForPlots().

00343 {
00344   double wi, w, c, e;
00345   if (w0 < 0) {
00346     w0 = fSpectrum->GetBinWidth(1);
00347   }
00348 
00349   for (int i = 0; i <= fSpectrum->GetNbinsX() + 1; i++) {
00350     wi = fSpectrum->GetBinWidth(i);
00351     w = wi / w0;
00352     c = fSpectrum->GetBinContent(i);
00353     e = fSpectrum->GetBinError(i);
00354     fSpectrum->SetBinContent(i, c/w);
00355     fSpectrum->SetBinError(i, e/w);
00356 
00357     // Make sure to also scale the poisson errors we have calculated
00358     if (fDoPoisson && i >= 1 && i <= fSpectrum->GetNbinsX()) {
00359       fPoiUp[i-1] /= w;
00360       fPoiDn[i-1] /= w;
00361     }
00362   }
00363 }

void NuMatrixSpectrum::BlessedFD ( bool  scale = true  )  [virtual]

Definition at line 889 of file NuMatrixSpectrum.cxx.

References BinWidthNormalize(), CalcPoisson(), NuMatrix1D::fSpectrum, NuMatrix::GetPOT(), NuBinningScheme::kDisplayFDRHC, NuBarCompressX(), RebinToScheme(), and NuMatrix1D::ScaleToPOT().

Referenced by NuStatistics::DataSpectrum().

00890 {
00891   static bool firstRun = true;
00892   if (firstRun) {
00893     cout << "Formatting blessed FD plot:" << endl
00894          << "* Binning scheme: DisplayFD (5) " << endl;
00895     if (scale) cout << "* PoT: 1.7085e20 " << endl;
00896     else       cout << "* PoT: Unchanged (" << GetPOT() << ")" << endl;
00897     cout << "* Normalized to bin width" << endl
00898          << "* Events per GeV" << endl
00899          << "* X axis compressed" << endl;
00900     firstRun = false;
00901   }
00902   RebinToScheme(NuBinningScheme::kDisplayFDRHC);
00903   if (scale) ScaleToPOT(1.7085e20);
00904   CalcPoisson();
00905   BinWidthNormalize();
00906   NuBarCompressX();
00907   fSpectrum->SetLineWidth(3);
00908 }

void NuMatrixSpectrum::BlessedFD2010 (  )  [virtual]

Definition at line 1003 of file NuMatrixSpectrum.cxx.

References BinWidthNormalize(), CalcPoisson(), CC2010CompressX(), NuBinningScheme::kDisplayFD2010, RebinToScheme(), and SetRangeUser().

01004 {
01005   RebinToScheme(NuBinningScheme::kDisplayFD2010);
01006   CalcPoisson();
01007   BinWidthNormalize(1);
01008   CC2010CompressX();
01009   SetRangeUser(0, 17.99);
01010   //  fSpectrum->SetLineWidth(3);
01011 }

void NuMatrixSpectrum::BlessedFD2014 (  )  [virtual]

Definition at line 1014 of file NuMatrixSpectrum.cxx.

References BinWidthNormalize(), CalcPoisson(), CC2010CompressX(), NuBinningScheme::kDisplayFD2014, RebinToScheme(), and SetRangeUser().

01015 {
01016   RebinToScheme(NuBinningScheme::kDisplayFD2014);
01017   CalcPoisson();
01018   BinWidthNormalize(1);
01019   CC2010CompressX();
01020   SetRangeUser(0, 17.99);
01021   //  fSpectrum->SetLineWidth(3);
01022 }

void NuMatrixSpectrum::BlessedFD7e20 ( bool  scale = true  )  [virtual]

Definition at line 935 of file NuMatrixSpectrum.cxx.

References BinWidthNormalize(), CalcPoisson(), compress, NuMatrix1D::fSpectrum, NuMatrix::GetPOT(), NuBinningScheme::kDisplayFD7e20, NuBarCompressX(), RebinToScheme(), NuMatrix1D::ScaleToPOT(), and xlimit.

00936 {
00937   static bool firstRun = true;
00938   if (firstRun) {
00939     NuMatrixSpectrum::xlimit = 20;
00940     NuMatrixSpectrum::compress = 2.5;
00941 
00942     cout << "Formatting blessed FD plot:" << endl
00943          << "* Binning scheme: DisplayFD7e20 (5) " << endl;
00944     if (scale) cout << "* PoT: 7.1e20 " << endl;
00945     else       cout << "* PoT: Unchanged (" << GetPOT() << ")" << endl;
00946     cout << "* Normalized to bin width" << endl
00947          << "* Events per 2 GeV (smallest bin size)" << endl
00948          << "* X axis compressed - reset for FHC" << endl
00949          << endl
00950          << "NOTE: The axis compression has been reset for FHC" << endl
00951          << "      (factor of 2.5 above 20 GeV).  If you did" << endl
00952          << "      axis compression for any previous spectra" << endl
00953          << "      or use a BlessedFD method other than this" << endl
00954          << "      one (BlessedFD7e20) in the same script," << endl 
00955          << "      the results not be what you expect." << endl;
00956     firstRun = false;
00957   }
00958   RebinToScheme(NuBinningScheme::kDisplayFD7e20);
00959   if (scale) ScaleToPOT(7.1e20);
00960   //Multiply(2);  // Scale per 2 GeV
00961   CalcPoisson();
00962   BinWidthNormalize();
00963   NuBarCompressX();
00964   fSpectrum->SetLineWidth(3);
00965 }

void NuMatrixSpectrum::BlessedFDRatio ( bool  scale = true  )  [virtual]

Definition at line 969 of file NuMatrixSpectrum.cxx.

References CalcPoisson(), NuMatrix1D::fSpectrum, NuMatrix::GetPOT(), NuBinningScheme::kDisplayFDRHC, NuBarCompressX(), RebinToScheme(), and NuMatrix1D::ScaleToPOT().

00970 {
00971   static bool firstRun = true;
00972   if (firstRun) {
00973     cout << "Formatting blessed FD ratio plot:" << endl
00974     << "* Binning scheme: DisplayFD (5) " << endl;
00975     if (scale) cout << "* PoT: 1.7085e20 " << endl;
00976     else       cout << "* PoT: Unchanged (" << GetPOT() << ")" << endl;
00977     cout << "* X axis compressed" << endl;
00978     firstRun = false;
00979   }
00980   RebinToScheme(NuBinningScheme::kDisplayFDRHC);
00981   if (scale) ScaleToPOT(1.7085e20);
00982   CalcPoisson();
00983   NuBarCompressX();
00984   fSpectrum->SetLineWidth(3);
00985 }

void NuMatrixSpectrum::BlessedForNC ( void   )  [virtual]

Definition at line 911 of file NuMatrixSpectrum.cxx.

References BinWidthNormalize(), CalcPoisson(), compress, NuMatrix1D::fSpectrum, NuMatrix::GetPOT(), NuBinningScheme::kDisplay1GevTo20, NCCompressX(), RebinToScheme(), and xlimit.

00912 {
00913   static bool firstRun = true;
00914   if (firstRun) {
00915     NuMatrixSpectrum::xlimit = 20;
00916     NuMatrixSpectrum::compress = 10;
00917 
00918     cout << "Formatting blessed FD plot:" << endl
00919          << "* Binning scheme: Display1GevTo20 (10) " << endl;
00920     cout << "* PoT: Unchanged (" << GetPOT() << ")" << endl;
00921     cout << "* Normalized to bin width" << endl
00922          << "* Events per GeV" << endl
00923          << "* X axis compressed" << endl;
00924     firstRun = false;
00925   }
00926   RebinToScheme(NuBinningScheme::kDisplay1GevTo20);
00927   CalcPoisson();
00928   BinWidthNormalize();
00929   NCCompressX();
00930   fSpectrum->SetLineWidth(3);
00931 }

void NuMatrixSpectrum::BlessedND ( bool  rebin = true,
bool  scale = true 
) [virtual]

Definition at line 869 of file NuMatrixSpectrum.cxx.

References BinWidthNormalize(), NuMatrix1D::fSpectrum, NuBinningScheme::kDisplayND, NuBarCompressX(), RebinToScheme(), and NuMatrix1D::ScaleToPOT().

00870 {
00871   static bool firstRun = true;
00872   if (firstRun) {
00873     cout << "Formatting blessed ND plot:" << endl;
00874     if (rebin) cout << "* Binning scheme: ND Display (6) " << endl;
00875     if (scale) cout << "* PoT: 1e20 " << endl;
00876     cout << "* Normalized to bin width" << endl
00877     << "* Events per 1 GeV" << endl
00878     << "* X axis compressed" << endl;
00879     firstRun = false;
00880   }
00881   if (rebin) RebinToScheme(NuBinningScheme::kDisplayND);
00882   if (scale) ScaleToPOT(1.e20);
00883   BinWidthNormalize();
00884   NuBarCompressX();
00885   fSpectrum->SetLineWidth(3);
00886 }

void NuMatrixSpectrum::CalcPoisson (  )  [protected, virtual]

Definition at line 1097 of file NuMatrixSpectrum.cxx.

References fDoPoisson, fPoiDn, fPoiUp, NuMatrix1D::fSpectrum, n, and PoiErr().

Referenced by BlessedFD(), BlessedFD2010(), BlessedFD2014(), BlessedFD7e20(), BlessedFDRatio(), BlessedForNC(), and DrawPoisson().

01098 {
01099   fDoPoisson = true;
01100 
01101   const Int_t n = fSpectrum->GetNbinsX();
01102 
01103   Int_t y;
01104   for (Int_t i=1; i<=n; i++){
01105     y = TMath::Nint(fSpectrum->GetBinContent(i));
01106     fPoiUp[i-1] = PoiErr(y, true);
01107     fPoiDn[i-1] = PoiErr(y, false);
01108   }
01109 }

void NuMatrixSpectrum::CC2010CompressX (  )  [virtual]

Definition at line 471 of file NuMatrixSpectrum.cxx.

References NuMatrix1D::fSpectrum, GetXaxis(), and ResetSpectrum().

Referenced by BlessedFD2010(), and BlessedFD2014().

00472 {
00473   //cout << "Calling CC2010CompressX:" << endl
00474   //<< "  Make sure this step is performed after you have rebinned into" << endl
00475   //<< "  your desired binning scheme AND have already called BinWidthNormalize" << endl
00476   //<< "  since this method changes the width of the bins." << endl;
00477 
00478   Double_t bins_old[999];
00479   Double_t bins_new[999];
00480   GetXaxis()->GetLowEdge(bins_old);
00481   const int Nbins = GetXaxis()->GetNbins();
00482 
00483   for(int i = 0; i < Nbins; i++){
00484     bins_new[i] = bins_old[i];
00485 
00486     if(bins_old[i] > 10 && bins_old[i] < 20) bins_new[i] = .4*bins_old[i]+6;
00487     if(bins_old[i] == 20) bins_new[i] = 14;
00488     if(bins_old[i] == 30) bins_new[i] = 16;
00489     if(bins_old[i] == 50) bins_new[i] = 18;
00490   }
00491   bins_new[Nbins] = 20;
00492 
00493   // Reassign bin contents based on bin number,
00494   // not on actual bin value.
00495   TH1D newHist("NewHist", "", Nbins, bins_new);
00496   for (int i = 1; i < Nbins+1; i++) {
00497     newHist.SetBinContent(i, fSpectrum->GetBinContent(i));
00498     newHist.SetBinError(i, fSpectrum->GetBinError(i));
00499   }
00500 
00501   // Store our new hist as fSpectrum
00502   string name = fSpectrum->GetName();
00503   string title = fSpectrum->GetTitle();
00504   ResetSpectrum(newHist);
00505   fSpectrum->SetName(name.c_str());
00506   fSpectrum->SetTitle(name.c_str());
00507 
00508   fSpectrum->SetLabelSize(0);
00509 }

void NuMatrixSpectrum::CC2014CompressX (  )  [virtual]

Definition at line 512 of file NuMatrixSpectrum.cxx.

References NuMatrix1D::fSpectrum, GetXaxis(), and ResetSpectrum().

00513 {
00514   //cout << "Calling CC2014CompressX:" << endl
00515   //<< "  Make sure this step is performed after you have rebinned into" << endl
00516   //<< "  your desired binning scheme AND have already called BinWidthNormalize" << endl
00517   //<< "  since this method changes the width of the bins." << endl;
00518 
00519   Double_t bins_old[999];
00520   Double_t bins_new[999];
00521   GetXaxis()->GetLowEdge(bins_old);
00522   const int Nbins = GetXaxis()->GetNbins();
00523 
00524   for(int i = 0; i < Nbins; i++){
00525     bins_new[i] = bins_old[i];
00526 
00527     if(bins_old[i] > 15 && bins_old[i] < 20) bins_new[i] = .4*bins_old[i]+6;
00528     if(bins_old[i] == 20) bins_new[i] = 17;
00529     if(bins_old[i] == 30) bins_new[i] = 19;
00530     if(bins_old[i] == 50) bins_new[i] = 21;
00531   }
00532   bins_new[Nbins] = 23;
00533 
00534   // Reassign bin contents based on bin number,
00535   // not on actual bin value.
00536   TH1D newHist("NewHist", "", Nbins, bins_new);
00537   for (int i = 1; i < Nbins+1; i++) {
00538     newHist.SetBinContent(i, fSpectrum->GetBinContent(i));
00539     newHist.SetBinError(i, fSpectrum->GetBinError(i));
00540   }
00541 
00542   // Store our new hist as fSpectrum
00543   string name = fSpectrum->GetName();
00544   string title = fSpectrum->GetTitle();
00545   ResetSpectrum(newHist);
00546   fSpectrum->SetName(name.c_str());
00547   fSpectrum->SetTitle(name.c_str());
00548 
00549   fSpectrum->SetLabelSize(0);
00550 }

virtual void NuMatrixSpectrum::CenterTitles ( Bool_t  cent = true  )  [inline, virtual]

Definition at line 116 of file NuMatrixSpectrum.h.

References NuMatrix1D::fSpectrum.

Referenced by SetFontAndSize().

00117   {
00118     fSpectrum->GetXaxis()->CenterTitle(cent);
00119     fSpectrum->GetYaxis()->CenterTitle(cent);
00120   }

NuMatrixSpectrum::ClassDef ( NuMatrixSpectrum  ,
 
) [protected]

Reimplemented from NuMatrix1D.

void NuMatrixSpectrum::CompressTopBins (  )  [virtual]

Definition at line 665 of file NuMatrixSpectrum.cxx.

References base, NuMatrix1D::fSpectrum, GetXaxis(), and ResetSpectrum().

Referenced by RebinForPlotAsFit(), and RebinForPlots().

00666 {
00667   //cout << "Calling NuBarCompressX:" << endl
00668   //<< "  Make sure this step is performed after you have rebinned into" << endl
00669   //<< "  your desired binning scheme AND have already called BinWidthNormalize" << endl
00670   //<< "  since this method changes the width of the bins." << endl;
00671 
00672   // Get Current Bins
00673   Double_t bins_old[99];
00674   Double_t bins_new[99];
00675   GetXaxis()->GetLowEdge(bins_old);
00676   int Nbins = GetXaxis()->GetNbins();
00677   //cout << "Nbins = " << Nbins << endl;
00678   // Compress bins - number of bins stays the same
00679   //   but higher bins become half as wide
00680   for (int i = 0; i <= Nbins-3; i++) {
00681     bins_new[i] = bins_old[i];
00682   }
00683   double base = bins_new[Nbins-3];
00684   bins_new[Nbins-2] = base+2;
00685   bins_new[Nbins-1] = base+4;
00686   bins_new[Nbins]   = base+6;
00687 
00688 
00689   // Reassign bin contents based on bin number,
00690   // not on actual bin value.
00691   TH1D newHist("NewHist", "", Nbins, bins_new);
00692   for (int i = 1; i < Nbins+1; i++) {
00693     newHist.SetBinContent(i, fSpectrum->GetBinContent(i));
00694     newHist.SetBinError(i, fSpectrum->GetBinError(i));
00695   }
00696 
00697   // Store our new hist as fSpectrum
00698   string name = fSpectrum->GetName();
00699   string title = fSpectrum->GetTitle();
00700   ResetSpectrum(newHist);
00701   fSpectrum->SetName(name.c_str());
00702   fSpectrum->SetTitle(name.c_str());
00703 }

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

Definition at line 860 of file NuMatrixSpectrum.cxx.

References NuMatrix1D::fSpectrum, GetXaxis(), and SetRangeUser().

00861 {
00862   double maxX = GetXaxis()->GetBinLowEdge(fSpectrum->GetNbinsX()) - 0.005;
00863   SetRangeUser(0, maxX);
00864   cout << "Setting max X to " << maxX << endl;
00865 }

virtual void NuMatrixSpectrum::Divide ( const TGraph *  correction  )  [inline, virtual]

Definition at line 54 of file NuMatrixSpectrum.h.

References Divide().

Referenced by Divide().

00054 {Divide(*correction);}

virtual void NuMatrixSpectrum::Divide ( const NuMatrixSpectrum  c,
Option_t *  option = "" 
) [inline, virtual]

Definition at line 52 of file NuMatrixSpectrum.h.

References Divide(), option, and Spectrum().

Referenced by Divide().

00053     {Divide(c.Spectrum(), option);}

virtual void NuMatrixSpectrum::Divide ( const NuMatrixSpectrum c,
Option_t *  option = "" 
) [inline, virtual]

Definition at line 50 of file NuMatrixSpectrum.h.

References Divide(), option, and Spectrum().

Referenced by Divide().

00051     {Divide(c->Spectrum(), option);}

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

Definition at line 199 of file NuMatrixSpectrum.cxx.

References fDoPoisson, fPoiDn, fPoiUp, NuMatrix1D::fSpectrum, Msg::kInfo, and MSG.

Referenced by NuFCRunInfo::BuildSampleWeights(), NuMMRunTransSME::CacheExtrapolation(), NuMMRunLED::CacheExtrapolation(), NuMMRunFCNSINu::CacheExtrapolation(), NuMMRunNSI::CacheExtrapolation(), NuMMRunFCNSINubar::CacheExtrapolation(), NuMMRunTransition::CacheExtrapolation(), NuMMRunFC::CacheExtrapolation(), NuSterileRunFC::CalcNDDataMCRatio(), NuMMRunNDOsc::CalculateFDFlux(), NuMMRunNSINu::CalculateFDFlux(), NuMMRunNSINubar::CalculateFDFlux(), NuMMRunCC2010New::CalculateFDFlux(), NuMMRunCC2010::CalculateFDFlux(), NuMMRunCC2010New::CalculateFDNCBackground(), NuMMRunNDOsc::CalculateFDNCBackground(), NuMMRunNSINubar::CalculateFDNCBackground(), NuMMRunNSINu::CalculateFDNCBackground(), NuMMRunCC2010New::CalculateFDTauFlux(), NuMMRunNSINubar::CalculateFDTauFlux(), NuMMRunNDOsc::CalculateFDTauFlux(), NuMMRunNSINu::CalculateFDTauFlux(), NuMMRunNC2010::CalculateNDFlux(), RatioPlot::Draw(), GenerateErrors(), NuMMRunTemplates::Go(), NuMMRunCCTutorial::MakeFDPred(), NuMMRunNoChargeCut::MakeFDPred(), NuMMRunCPT::MakeFDPred(), NuMMRunCC2010::MakeFDPred(), NuMMRunCPTSyst::MakeFDPred(), NuMMRunPRL::MakeFDPred(), NuMMRunNC2010::NuMMRunNC2010(), NuMMRunNDOsc::PrecalculateWSFlux(), NuMMRunNSINu::PrecalculateWSFlux(), NuMMRunCC2010New::PrecalculateWSFlux(), NuMMRunNSINubar::PrecalculateWSFlux(), NuMMRunNoChargeCut::WriteFDPredHistos(), NuMMRunCC2010::WriteFDPredHistos(), NuMMRunTransSME::WriteFDPredHistos(), NuMMRunPRL::WriteFDPredHistos(), NuMMRunTransition::WriteFDPredHistos(), NuMMRunCPT::WriteFDPredHistos(), and NuMMRunCCTutorial::WriteFDPredHistos().

00200 {
00201   
00202   // Calculate non-poisson errors by hand because I don't trust root
00203   double errs[999];
00204   for (int i = 0 ; i <= fSpectrum->GetNbinsX()+1; i++) {
00205     double da = 0, db = 0;
00206     
00207     if (fSpectrum->GetBinContent(i) != 0) {
00208       da = fSpectrum->GetBinError(i) / fSpectrum->GetBinContent(i);
00209     }
00210     if (correction->GetBinContent(i) != 0) {
00211       db = correction->GetBinError(i) / correction->GetBinContent(i); 
00212     }
00213     errs[i] = TMath::Sqrt(da*da + db*db);
00214   }
00215   
00216   fSpectrum->Divide(fSpectrum, correction, 1, 1, option);
00217 
00218   for (int i = 0 ; i <= fSpectrum->GetNbinsX()+1; i++) {
00219     errs[i] *= fSpectrum->GetBinContent(i);
00220     fSpectrum->SetBinError(i, errs[i]);
00221   }
00222   
00223   
00224   if(fDoPoisson){
00225     MSG("NuMatrixSpectrum",Msg::kInfo)
00226       << "Scaling Poisson, assuming correction "
00227       << correction->GetName() << " has zero error." << endl;
00228     for(int i = 0; i < fSpectrum->GetNbinsX(); ++i){
00229       const double si = fSpectrum->GetBinContent(i+1);
00230       const double ci = correction->GetBinContent(i+1);
00231       // Where are the tops and bottoms of the error bars?
00232       double hi = si+fPoiUp[i];
00233       double lo = si-fPoiDn[i];
00234       // Scale those points
00235       hi /= ci;
00236       lo /= ci;
00237       // Express as a difference to where the central point will end up
00238       fPoiUp[i] = hi - si/ci;
00239       fPoiDn[i] = si/ci - lo;
00240     }
00241   }
00242 }

void NuMatrixSpectrum::DividePurity ( const TH1D *  corr,
const Double_t  corrShift 
) [virtual]

Definition at line 268 of file NuMatrixSpectrum.cxx.

References fDoPoisson, NuMatrix1D::fSpectrum, Msg::kWarning, and MSG.

00270 {
00271   TH1D oneOverCorrMinusOne(*correction);
00272   oneOverCorrMinusOne.Reset();
00273   for (Int_t bin=0; bin<=oneOverCorrMinusOne.GetNbinsX()+1; ++bin){
00274     oneOverCorrMinusOne.SetBinContent(bin,1.0);
00275   }
00276   oneOverCorrMinusOne.Divide(correction);
00277   for (Int_t bin=0; bin<=oneOverCorrMinusOne.GetNbinsX()+1; ++bin){
00278     oneOverCorrMinusOne.
00279       SetBinContent(bin,
00280                     oneOverCorrMinusOne.GetBinContent(1)-1.0);
00281   }
00282 
00283 
00284 
00285   TH1D background(*fSpectrum);
00286   background.Multiply(&oneOverCorrMinusOne);
00287   background.Scale(correctionShift);
00288 
00289   fSpectrum->Add(&background);
00290 
00291   if (fDoPoisson) {
00292     fDoPoisson = false;
00293     MSG("NuMatrixSpectrum",Msg::kWarning) << "Poisson errors cannot handle purity corrections.  Ignoring Poisson errors." << endl;
00294   }
00295 }

void NuMatrixSpectrum::DrawCC2010Axes ( bool  labels = true  )  [virtual]

Definition at line 553 of file NuMatrixSpectrum.cxx.

References GetXaxis(), and GetYaxis().

00554 {
00555   // Supress the usual labels and ticks
00556   GetXaxis()->SetLabelSize(0);
00557   //const double tick = GetXaxis()->GetTickLength();
00558   const double tick = 0.04;
00559   GetXaxis()->SetTickLength(0);
00560 
00561   for(int top = false; top <= true; ++top){
00562     gPad->Update();
00563     const double y = top ? gPad->GetUymax() : 0;
00564 
00565     const TString sn = top ? "SN-" : "SN+";
00566 
00567     // Ticks and labels from zero to ten
00568     TGaxis* gaxis = new TGaxis(0, y, 10, y, 0, 10, 502, sn);
00569     gaxis->SetLabelSize(GetYaxis()->GetLabelSize());
00570     gaxis->SetLabelFont(GetYaxis()->GetLabelFont());
00571     if(top || !labels) gaxis->SetLabelSize(0);
00572     // Tick length is a fraction of axis length - apply correction
00573     gaxis->SetTickSize(18/10.*tick);
00574     gaxis->Draw();
00575 
00576     // Ticks from ten to twenty
00577     gaxis = new TGaxis(10, y, 14, y, 10, 20, 502, sn);
00578     gaxis->SetLabelSize(0);
00579     // Tick length is a fraction of axis length - apply correction
00580     gaxis->SetTickSize(18/4.*tick);
00581     gaxis->Draw();
00582 
00583     // Ticks from twenty to fifty
00584     gaxis = new TGaxis(14, y, 18, y, 20, 50, 2, sn);
00585     gaxis->SetLabelSize(0);
00586     // Tick length is a fraction of axis length - apply correction
00587     gaxis->SetTickSize(18/4.*tick);
00588     gaxis->Draw();
00589 
00590     if(!top && labels){
00591       // Labels for fifteen and twenty
00592       gaxis = new TGaxis(12, y, 14, y, 15, 20, 1, sn);
00593       gaxis->SetTickSize(0);
00594       gaxis->SetLabelSize(GetYaxis()->GetLabelSize());
00595       gaxis->SetLabelFont(GetYaxis()->GetLabelFont());
00596       gaxis->Draw();
00597       
00598       // Labels for thirty and fifty
00599       gaxis = new TGaxis(16, y, 18, y, 30, 50, 1, sn);
00600       gaxis->SetTickSize(0);
00601       gaxis->SetLabelSize(GetYaxis()->GetLabelSize());
00602       gaxis->SetLabelFont(GetYaxis()->GetLabelFont());
00603       gaxis->Draw();
00604     }
00605   } // end for top
00606 }

void NuMatrixSpectrum::DrawCC2014Axes ( bool  labels = true  )  [virtual]

Definition at line 609 of file NuMatrixSpectrum.cxx.

References GetXaxis(), and GetYaxis().

00610 {
00611   // Supress the usual labels and ticks
00612   GetXaxis()->SetLabelSize(0);
00613   //const double tick = GetXaxis()->GetTickLength();
00614   const double tick = 0.04;
00615   GetXaxis()->SetTickLength(0);
00616 
00617   for(int top = false; top <= true; ++top){
00618     gPad->Update();
00619     const double y = top ? gPad->GetUymax() : 0;
00620 
00621     const TString sn = top ? "SN-" : "SN+";
00622 
00623     // Ticks and labels from zero to ten
00624     TGaxis* gaxis = new TGaxis(0, y, 15, y, 0, 15, 502, sn);
00625     gaxis->SetLabelSize(GetYaxis()->GetLabelSize());
00626     gaxis->SetLabelFont(GetYaxis()->GetLabelFont());
00627     if(top || !labels) gaxis->SetLabelSize(0);
00628     // Tick length is a fraction of axis length - apply correction
00629     gaxis->SetTickSize(18/10.*tick);
00630     gaxis->Draw();
00631 
00632     // Ticks from ten to twenty
00633     gaxis = new TGaxis(15, y, 17, y, 15, 20, 502, sn);
00634     gaxis->SetLabelSize(0);
00635     // Tick length is a fraction of axis length - apply correction
00636     gaxis->SetTickSize(18/4.*tick);
00637     gaxis->Draw();
00638 
00639     // Ticks from twenty to fifty
00640     gaxis = new TGaxis(17, y, 21, y, 20, 50, 2, sn);
00641     gaxis->SetLabelSize(0);
00642     // Tick length is a fraction of axis length - apply correction
00643     gaxis->SetTickSize(18/4.*tick);
00644     gaxis->Draw();
00645 
00646     if(!top && labels){
00647       // Labels for fifteen and twenty
00648       gaxis = new TGaxis(15, y, 17, y, 15, 20, 1, sn);
00649       gaxis->SetTickSize(0);
00650       gaxis->SetLabelSize(GetYaxis()->GetLabelSize());
00651       gaxis->SetLabelFont(GetYaxis()->GetLabelFont());
00652       gaxis->Draw();
00653       
00654       // Labels for thirty and fifty
00655       gaxis = new TGaxis(19, y, 21, y, 30, 50, 1, sn);
00656       gaxis->SetTickSize(0);
00657       gaxis->SetLabelSize(GetYaxis()->GetLabelSize());
00658       gaxis->SetLabelFont(GetYaxis()->GetLabelFont());
00659       gaxis->Draw();
00660     }
00661   } // end for top
00662 }

void NuMatrixSpectrum::DrawNCAxes ( int  lsize = -1  )  [virtual]

Definition at line 789 of file NuMatrixSpectrum.cxx.

References Plot::Format(), GetAxisFunc(), Msg::kInfo, MAXMSG, and xlimit.

00790 {
00791   gPad->Update();
00792 
00793   double aspectRatio = (double)gPad->GetCanvas()->GetWindowWidth() / 
00794     (double)gPad->GetCanvas()->GetWindowHeight();
00795   cout << "Found aspectRatio = " << gPad->GetCanvas()->GetWindowWidth() 
00796        << " / " << gPad->GetCanvas()->GetWindowHeight();
00797   bool wide = aspectRatio > 7.0 / 5.0 - 0.002;
00798   if (wide) cout << " (wide)" << endl;
00799   else cout << " (narrow)" << endl;
00800 
00801   double xmax = gPad->GetUxmax();
00802   double ymin = gPad->GetUymin();
00803   double ymax = gPad->GetUymax();
00804   if (gPad->GetLogy()) {
00805     ymin = pow(10, ymin);
00806     ymax = pow(10, ymax);
00807   }
00808 
00809   MAXMSG("NuMatrixSpectrum",Msg::kInfo,3) << "Drawing NC compressed axis from 0 to "
00810   << xmax << " at y = " << ymin << " and y = " << ymax << endl;
00811 
00812   TF1 * fAxis = GetAxisFunc();
00813   fAxis->GetName();  // Get rid of warning
00814 
00815   int div = 510; // 510
00816 
00817   TGaxis *aBotFD = new TGaxis(0, ymin, xmax, ymin, "fAxis", div);
00818   aBotFD->SetLabelSize(0); // Drawing manually now
00819   aBotFD->Draw();
00820 
00821   TGaxis *aTopFD = new TGaxis(0, ymax, xmax, ymax, "fAxis", div, "-");
00822   aTopFD->SetLabelSize(0);
00823   aTopFD->Draw();
00824 
00825   // Draw the axis labels manually
00826   TLatex* p[20];
00827   double xlab = 0;
00828   for (int i = 0; i < 20; i++) {
00829     if (xlab > 50) break;
00830 
00831     Double_t xpos;
00832     xpos = fAxis->Eval(xlab);
00833     TString xs = TString::Format("%.0f", xlab);
00834 
00835     //    cout << "Drawing label " << xs << " at " << xpos << endl;
00836     // Create a TLatex in a vaguely appropriate position
00837     p[i] = new TLatex(xpos, ymin - 0.025 * (ymax - ymin), xs);
00838     p[i]->SetTextAlign(23);
00839     if (lsize > 0) {
00840       p[i]->SetTextFont(43);
00841       p[i]->SetTextSize(lsize);
00842     }
00843     else {
00844       p[i]->SetTextFont(42);
00845       p[i]->SetTextSize(0.06);
00846     }
00847     p[i]->Draw();
00848 
00849     if (xlab < xlimit) {
00850       xlab += 5;
00851     } else {
00852       xlab += 30;
00853     }
00854 
00855   }
00856 } // DrawNCAxes

void NuMatrixSpectrum::DrawNuBarAxes ( int  lsize = -1  )  [virtual]

Definition at line 715 of file NuMatrixSpectrum.cxx.

References Plot::Format(), GetAxisFunc(), Msg::kInfo, MAXMSG, and xlimit.

00716 {
00717   gPad->Update();
00718 
00719   double aspectRatio = (double)gPad->GetCanvas()->GetWindowWidth() / (double)gPad->GetCanvas()->GetWindowHeight();
00720   cout << "Found aspectRatio = " << gPad->GetCanvas()->GetWindowWidth() << " / " << gPad->GetCanvas()->GetWindowHeight();
00721   bool wide = aspectRatio > 7.0 / 5.0 - 0.002;
00722   //bool wide = false;
00723   if (wide) cout << " (wide)" << endl;
00724   else cout << " (narrow)" << endl;
00725 
00726   double xmax = gPad->GetUxmax();
00727   double ymin = gPad->GetUymin();
00728   double ymax = gPad->GetUymax();
00729   if (gPad->GetLogy()) {
00730     ymin = pow(10, ymin);
00731     ymax = pow(10, ymax);
00732   }
00733 
00734   MAXMSG("NuMatrixSpectrum",Msg::kInfo,3) << "Drawing compressed axis from 0 to "
00735   << xmax << " at y = " << ymin << " and y = " << ymax << endl;
00736 
00737   //cout << "compress = " << form << endl;
00738   TF1 * fAxis = GetAxisFunc();
00739   fAxis->GetName();  // Get rid of warning
00740 
00741   int div = 510;
00742   //if (wide) div = 510;
00743   //else div = 509;
00744 
00745   TGaxis *aBotFD = new TGaxis(0,ymin,xmax,ymin,"fAxis",div);
00746   aBotFD->SetLabelSize(0); // Drawing manually now
00747   aBotFD->Draw();
00748 
00749   TGaxis *aTopFD = new TGaxis(0,ymax,xmax,ymax,"fAxis",div,"-");
00750   aTopFD->SetLabelSize(0);
00751   aTopFD->Draw();
00752 
00753   // Draw the axis labels manually instead
00754   //const char *xs[] = {"0", "5", "10", "15", "20", "30", "40", "50"};
00755   //const Double_t xp[] = {0, 5, 10, 15, 20, 30, 40, 50};
00756   // Now draw the labels
00757   TLatex *p[20];
00758   double xlab = 0;
00759   for (int i = 0; i < 20; i++) {
00760     if (xlab > 50) break;
00761 
00762     Double_t xpos;
00763     xpos = fAxis->Eval(xlab);
00764     TString xs = TString::Format("%.0f",xlab);
00765 
00766     //xpos = fAxis->Eval(xp[i]);
00767     //xpos = xp[i] <= 20 ? xp[i] : 20 + (xp[i]-20)/compress;
00768     //cout << "Drawing label " << xs << " at " << xpos << endl;
00769     // Create a TLatex in a vaguely appropriate position
00770     p[i] = new TLatex(xpos, ymin-0.025*(ymax-ymin), xs);
00771     p[i]->SetTextAlign(23);
00772     if (lsize > 0) {
00773       p[i]->SetTextFont(43);
00774       p[i]->SetTextSize(lsize);
00775     }
00776     else {
00777       p[i]->SetTextFont(42);
00778       p[i]->SetTextSize(0.06);
00779     }
00780     p[i]->Draw();
00781 
00782     if (xlab < xlimit) xlab += 5;
00783     else               xlab += 10;
00784   }
00785 }

void NuMatrixSpectrum::DrawPoisson ( Option_t *  opt = ""  )  [virtual]

Definition at line 1113 of file NuMatrixSpectrum.cxx.

References CalcPoisson(), fDoPoisson, fPoiDn, fPoiUp, NuMatrix1D::fSpectrum, Msg::kWarning, MSG, and option.

01114 {
01115   if (!fDoPoisson) {
01116     MSG("NuMatrixSpectrum", Msg::kWarning)
01117     << "CalcPoisson() not already called.  Poisson errors are being calculated based on current bin values."
01118     << endl;
01119     CalcPoisson();
01120   }
01121 
01122   TGraphAsymmErrors* g1 = new TGraphAsymmErrors(fSpectrum);
01123 
01124 
01125   for (Int_t i = 0; i< g1->GetN(); i++){
01126     Double_t x, y;
01127     g1->GetPoint(i, x, y);
01128     //cout << "i = " << i  << ", x = " << x << ", y = " << y
01129     //     << ", fPoiUp["<< i << "] = " << fPoiUp[i] << endl;
01130     g1->SetPointEYlow(i, fPoiDn[i]);
01131     g1->SetPointEYhigh(i, fPoiUp[i]);
01132   }
01133   TString option = opt;
01134   if (!option.Contains("same",TString::kIgnoreCase)) {
01135     option += "axis";
01136     fSpectrum->Draw(option);
01137     option = opt;
01138   }
01139   g1->Draw(option);
01140 }

virtual void NuMatrixSpectrum::ExtrapolateNDToFD ( const TH2D *  corr  )  [inline, virtual]

Definition at line 137 of file NuMatrixSpectrum.h.

References ExtrapolateNDToFD().

Referenced by NuMMRunTransSME::CacheExtrapolation(), NuMMRunLED::CacheExtrapolation(), NuMMRunFCNSINu::CacheExtrapolation(), NuMMRunNSI::CacheExtrapolation(), NuMMRunFCNSINubar::CacheExtrapolation(), NuMMRunTransition::CacheExtrapolation(), NuMMRunFC::CacheExtrapolation(), NuMMRunNDOsc::CalculateFDFlux(), NuMMRunNC2010::CalculateFDFlux(), NuMMRunNSINu::CalculateFDFlux(), NuMMRunNSINubar::CalculateFDFlux(), NuMMRunCC2010New::CalculateFDFlux(), NuMMRunCC2010::CalculateFDFlux(), NuMMRunCC2010New::CalculateFDNCBackground(), NuMMRunNDOsc::CalculateFDNCBackground(), NuMMRunNSINubar::CalculateFDNCBackground(), NuMMRunNSINu::CalculateFDNCBackground(), NuMMRunCC2010New::CalculateFDTauFlux(), NuMMRunNSINubar::CalculateFDTauFlux(), NuMMRunNDOsc::CalculateFDTauFlux(), NuMMRunNSINu::CalculateFDTauFlux(), ExtrapolateNDToFD(), NuMMRunTemplates::Go(), NuMMRunCCTutorial::MakeFDPred(), NuMMRunNoChargeCut::MakeFDPred(), NuMMRunCPT::MakeFDPred(), NuMMRunPRL::MakeFDPred(), NuMMRunNDOsc::PrecalculateWSFlux(), NuMMRunNSINu::PrecalculateWSFlux(), NuMMRunCC2010New::PrecalculateWSFlux(), NuMMRunNSINubar::PrecalculateWSFlux(), NuMMRunNoChargeCut::WriteFDPredHistos(), NuMMRunCC2010::WriteFDPredHistos(), NuMMRunTransSME::WriteFDPredHistos(), NuMMRunPRL::WriteFDPredHistos(), NuMMRunTransition::WriteFDPredHistos(), NuMMRunCPT::WriteFDPredHistos(), and NuMMRunCCTutorial::WriteFDPredHistos().

00137 {ExtrapolateNDToFD(*corr);}

void NuMatrixSpectrum::FillOscCache ( double  dmsq  )  const [protected]

Ensure fgCachedOsc is filled with a usable oscillation dip

If dmsq is wrong, or the binning is wrong, regenerate the cache, else leave it be.

Reimplemented from NuMatrix1D.

Definition at line 1177 of file NuMatrixSpectrum.cxx.

References NuUtilities::CheckConsistency(), fgCachedDmsq, fgCachedOsc, NuMatrix1D::fSpectrum, Integral(), n, NuMatrixSpectrum(), and OscillateHybrid().

Referenced by InverseOscillate(), and Oscillate().

01178 {
01179   // Cache at wrong dmsq can't help us
01180   if(fgCachedDmsq != dm2){
01181     delete fgCachedOsc;
01182     fgCachedOsc = 0;
01183   }
01184 
01185   // Cache with wrong binning can't help us
01186   if(fgCachedOsc &&
01187      !NuUtilities::CheckConsistency(fSpectrum, fgCachedOsc->fSpectrum)){
01188     delete fgCachedOsc;
01189     fgCachedOsc = 0;
01190   }
01191 
01192   // Cache is bad one way or another. Fill it in
01193   if(!fgCachedOsc){
01194     // Get correct binning
01195     NuMatrixSpectrum* osc = new NuMatrixSpectrum(*this);
01196     for(int n = 0; n < osc->fSpectrum->GetNbinsX()+2; ++n)
01197       osc->fSpectrum->SetBinContent(n, 1);
01198     osc->OscillateHybrid(dm2, 1);
01199     cout<<osc->Integral();
01200     fgCachedOsc = osc;
01201     fgCachedDmsq = dm2;
01202   }
01203 
01204   // We either started with a good cache, or we now have one
01205 }

void NuMatrixSpectrum::FillOscCache_3flavour ( Double_t  dm232,
Double_t  t23,
Double_t  dm221,
Double_t  t12,
Double_t  t13,
Double_t  delta,
int  inu 
) const [protected]

Definition at line 1480 of file NuMatrixSpectrum.cxx.

References NuMatrix1D::fSpectrum, n, and OscillateHybrid_3flavour().

Referenced by Oscillate_3flavour().

01481 {
01482   // Get correct binning
01483     NuMatrixSpectrum* osc = new NuMatrixSpectrum(*this);
01484     for(int n = 0; n < osc->fSpectrum->GetNbinsX()+2; ++n)
01485       osc->fSpectrum->SetBinContent(n, 1);
01486     osc->OscillateHybrid_3flavour(dm232, t23, dm221, t12, t13, delta, inu);
01487     //osc->OscillateBasic_3flavour(dm232, t23, dm221, t12, t13, delta, inu);
01488     //cout<<osc->Integral();
01489 
01490     fgCachedOsc = osc;
01491     fgCachedDmsq = dm232;
01492 }

NuMatrixSpectrum * NuMatrixSpectrum::Fluctuate (  ) 

Definition at line 2254 of file NuMatrixSpectrum.cxx.

References FluctuateMe(), and NuMatrixSpectrum().

02255 {
02256   NuMatrixSpectrum *fluctSpect = new NuMatrixSpectrum(*this);
02257   fluctSpect->FluctuateMe();
02258   return fluctSpect;
02259 }

void NuMatrixSpectrum::FluctuateMe (  ) 

Definition at line 2262 of file NuMatrixSpectrum.cxx.

References NuFluctuator::Fluctuate(), ResetSpectrum(), and Spectrum().

Referenced by Fluctuate().

02263 {
02264   static NuFluctuator *fl = 0;
02265   if (!fl) {
02266     fl = new NuFluctuator();
02267   }
02268 
02269   TH1D tmp = fl->Fluctuate(Spectrum());
02270   ResetSpectrum(tmp);
02271 }

void NuMatrixSpectrum::GenerateErrors ( Double_t  scale = 1  )  [virtual]

Definition at line 319 of file NuMatrixSpectrum.cxx.

References Divide(), NuMatrix1D::fSpectrum, and Multiply().

Referenced by NuStatistics::PredSpectrum(), and RebinForPlots().

00320 {
00321   Multiply(scale);
00322   double c, err1, err2, errtot;
00323   for (int i = 1; i <= fSpectrum->GetNbinsX(); i++) {
00324     c = fSpectrum->GetBinContent(i);
00325     err1 = fSpectrum->GetBinError(i);
00326     err2 = sqrt(c);
00327     errtot = sqrt(err1*err1+err2*err2);
00328     fSpectrum->SetBinError(i, errtot);
00329   }
00330   Divide(scale);
00331 }

void NuMatrixSpectrum::GenerateSystErrors (  )  [virtual]

Definition at line 298 of file NuMatrixSpectrum.cxx.

References NuMatrix1D::fSpectrum.

Referenced by NuStatistics::PredSpectrum().

00299 {
00300   double ebins[] = {0,     4,     8,     12,    16,    20,    30,    50, 200};
00301   double errbins[]    = {0.078, 0.070, 0.055, 0.060, 0.065, 0.092, 0.10,  1.0};
00302   double c, energy, err1, err2, errtot;
00303   for (int i = 1; i <= fSpectrum->GetNbinsX(); i++) {
00304     energy = fSpectrum->GetBinLowEdge(i);
00305     c = fSpectrum->GetBinContent(i);
00306     err1 = fSpectrum->GetBinError(i);
00307 
00308     for (int j = 0; j < 8; j++) {
00309       if (energy >= ebins[j] && energy < ebins[j+1]) {
00310         err2 = c*errbins[j];
00311         errtot = sqrt(err1*err1+err2*err2);
00312         fSpectrum->SetBinError(i, errtot);
00313       }
00314     }
00315   }
00316 }

TF1 * NuMatrixSpectrum::GetAxisFunc (  )  [static]

Definition at line 706 of file NuMatrixSpectrum.cxx.

References compress, Msg::kInfo, MAXMSG, and xlimit.

Referenced by DrawNCAxes(), DrawNuBarAxes(), and NuStatistics::GetMaxE().

00706                                    {
00707     TString form;
00708     form.Form("(x<=%f)*x+(x > %f)*(%f+(x-%f)/%f)", xlimit, xlimit, xlimit, xlimit, compress);
00709     MAXMSG("NuMatrixSpectrum",Msg::kInfo, 1) << "Using function " << form << endl;
00710     TF1 * fAxis = new TF1("fAxis",form.Data(),0,50);
00711     return fAxis;
00712 }

virtual Double_t NuMatrixSpectrum::GetEntries (  )  const [inline, virtual]

Definition at line 133 of file NuMatrixSpectrum.h.

References NuMatrix1D::fSpectrum.

00133 {return fSpectrum->GetEntries();}

const char * NuMatrixSpectrum::GetName ( void   )  const

Definition at line 161 of file NuMatrixSpectrum.cxx.

References NuMatrix1D::fSpectrum.

00162 {
00163   if (fSpectrum) return fSpectrum->GetName();
00164   return "Blank";
00165 }

virtual Int_t NuMatrixSpectrum::GetNbinsX (  )  const [inline, virtual]
virtual TAxis* NuMatrixSpectrum::GetXaxis (  )  [inline, virtual]
virtual TAxis* NuMatrixSpectrum::GetYaxis (  )  [inline, virtual]

Definition at line 123 of file NuMatrixSpectrum.h.

References NuMatrix1D::fSpectrum.

Referenced by RatioPlot::Draw(), DrawCC2010Axes(), DrawCC2014Axes(), and SetFontAndSize().

00123 {return fSpectrum->GetYaxis();}

virtual Double_t NuMatrixSpectrum::Integral ( Int_t  binx1,
Int_t  binx2,
Option_t *  option = "" 
) [inline, virtual]

Definition at line 126 of file NuMatrixSpectrum.h.

References NuMatrix1D::fSpectrum, and option.

00127   {
00128     return fSpectrum->Integral(binx1, binx2, option);
00129   }

virtual Double_t NuMatrixSpectrum::Integral ( Option_t *  op = ""  )  [inline, virtual]
virtual Double_t NuMatrixSpectrum::IntegralVals ( Double_t  low,
Double_t  high,
Option_t *  option = "" 
) [virtual]
void NuMatrixSpectrum::InverseOscillate ( Double_t  dm2,
Double_t  sn2 
) [virtual]

Definition at line 1918 of file NuMatrixSpectrum.cxx.

References fgCachedOsc, FillOscCache(), NuMatrix1D::fSpectrum, InverseOscillateHybrid(), n, and NuOscProbCalc::OscillationWeight().

Referenced by NuMMRunTransition::CacheExtrapolation(), NuMMRunNSINu::InverseOscillateNuTau(), NuMMRunFC::InverseOscillateNuTau(), NuMMRunCC2010New::InverseOscillateNuTau(), NuMMRunTransSME::InverseOscillateNuTau(), NuMMRunNSINubar::InverseOscillateNuTau(), NuMMRunLED::InverseOscillateNuTau(), NuMMRunTransSME::InverseOscillateTauBar(), NuMMRunFC::InverseOscillateTauBar(), NuMMRunNSINu::InverseOscillateTauBar(), NuMMRunNSINubar::InverseOscillateTauBar(), NuMMRunLED::InverseOscillateTauBar(), NuMMRunCCTutorial::MakeFDPred(), NuMMRunNoChargeCut::MakeFDPred(), NuMMRunPRL::MakeFDPred(), NuMMRunNC2010::Oscillate(), NuMMRunNoChargeCut::WriteFDPredHistos(), NuMMRunPRL::WriteFDPredHistos(), NuMMRunTransition::WriteFDPredHistos(), and NuMMRunCCTutorial::WriteFDPredHistos().

01919 {
01920   FillOscCache(dm2);
01921 
01922   for(int n = 0; n < fSpectrum->GetNbinsX()+2; ++n){
01923     fSpectrum->SetBinContent(n,
01924                              fSpectrum->GetBinContent(n)*
01925                              sn2*(1-fgCachedOsc->fSpectrum->GetBinContent(n)));
01926   }
01927   return;
01928 
01929 
01930   InverseOscillateHybrid(dm2, sn2);
01931   return;
01932 
01933   for(int i=1;i<=fSpectrum->GetNbinsX();i++) {
01934     Double_t energy = fSpectrum->GetBinCenter(i);
01935     Double_t oscProb = 1-NuOscProbCalc::OscillationWeight(energy, dm2, sn2);
01936     fSpectrum->
01937       SetBinContent(i,fSpectrum->GetBinContent(i)*oscProb);
01938     fSpectrum->
01939       SetBinError(i,fSpectrum->GetBinError(i)*oscProb);
01940   }
01941 }

void NuMatrixSpectrum::InverseOscillateHybrid ( Double_t  dm2,
Double_t  sn2 
) [virtual]

Definition at line 1944 of file NuMatrixSpectrum.cxx.

References count, NuMatrix1D::fSpectrum, Munits::km, minimum, and NuOscProbCalc::OscillationWeight().

Referenced by InverseOscillate().

01945 {
01946   // Calculate the cut-off point
01947   const Double_t threshold = 0.25; // The minimum spacing between oscillation minima/maxima
01948   Double_t minimum, previous;
01949   Int_t i = 2;
01950   minimum = (k1267 * 2 * (kFDDistance/Munits::km) * dm2) / (1*TMath::Pi());
01951   // cout << "Initial min: " << minimum << endl;
01952   previous = minimum + threshold + 1;
01953 
01954   while (previous - minimum > threshold) {
01955     previous = minimum;
01956     minimum = (k1267 * 2 * (kFDDistance/Munits::km) * dm2) / (i*TMath::Pi());
01957     ++i;
01958     // cout << i-1 << ": Min: " << minimum << ", Prev: " << previous << ", diff: " << previous - minimum << endl;
01959   }
01960 
01961   // Now min is the energy that we stop oscillating and start normalising
01962   for(int bin=1;bin<=fSpectrum->GetNbinsX();bin++) {
01963     Double_t energy = fSpectrum->GetBinCenter(bin);
01964     Double_t oscProb = 0;
01965 
01966     const Double_t increment=0.001;
01967 
01968     // Check our cut-off point
01969     if (energy > previous) {
01970       oscProb = 1-NuOscProbCalc::OscillationWeight(energy, dm2, sn2);
01971     } else {
01972 
01976 
01977       if (1==bin || fSpectrum->GetNbinsX()==bin){
01978         Int_t count=0;
01979         for (Double_t energy = fSpectrum->GetBinLowEdge(bin)+increment/2.0;
01980              energy<fSpectrum->GetBinLowEdge(bin+1);
01981              energy+=increment){
01982           oscProb += 1-NuOscProbCalc::OscillationWeight(energy, dm2, sn2);
01983           ++count;
01984         }
01985         oscProb /= count;
01986         //fSpectrum->SetBinContent(bin,
01987         //        oscProb*fSpectrum->GetBinContent(bin));
01988         //fSpectrum->SetBinError(bin, oscProb*fSpectrum->GetBinError(bin));
01989       }
01990       else{
01991         Double_t denominator=0.0;
01992         Double_t lowGrad =
01993           (fSpectrum->GetBinContent(bin)-fSpectrum->GetBinContent(bin-1))/
01994           (fSpectrum->GetBinWidth(bin)/2.0 +
01995            fSpectrum->GetBinWidth(bin-1)/2.0);
01996         Double_t highGrad =
01997           (fSpectrum->GetBinContent(bin+1)-fSpectrum->GetBinContent(bin))/
01998           (fSpectrum->GetBinWidth(bin+1)/2.0 +
01999            fSpectrum->GetBinWidth(bin)/2.0);
02000         for (Double_t energy=fSpectrum->GetBinLowEdge(bin) + increment/2.0;
02001              energy<fSpectrum->GetBinLowEdge(bin+1);
02002              energy+=increment){
02003           if (energy<fSpectrum->GetBinCenter(bin)){
02004             oscProb += (1-NuOscProbCalc::OscillationWeight(energy, dm2, sn2))*
02005               (fSpectrum->GetBinContent(bin-1) +
02006                lowGrad*(energy-fSpectrum->GetBinCenter(bin-1)));
02007             denominator +=
02008               fSpectrum->GetBinContent(bin-1) +
02009               lowGrad*(energy-fSpectrum->GetBinCenter(bin-1));
02010           }
02011           else {
02012             oscProb += (1-NuOscProbCalc::OscillationWeight(energy, dm2, sn2))*
02013               (fSpectrum->GetBinContent(bin) +
02014                highGrad*(energy-fSpectrum->GetBinCenter(bin)));
02015             denominator +=
02016               fSpectrum->GetBinContent(bin) +
02017               highGrad*(energy-fSpectrum->GetBinCenter(bin));
02018           }
02019         }
02020         if (denominator>0){
02021           oscProb /= denominator;
02022         }
02023         else{
02024           oscProb = 0;
02025         }
02026       }
02027 
02031     }
02032 
02033     fSpectrum->
02034       SetBinContent(bin,fSpectrum->GetBinContent(bin)*oscProb);
02035     fSpectrum->
02036       SetBinError(bin,fSpectrum->GetBinError(bin)*oscProb);
02037 
02038   }
02039 }

void NuMatrixSpectrum::InverseOscillateLinearInterp ( Double_t  dm2,
Double_t  sn2 
) [virtual]

Definition at line 2076 of file NuMatrixSpectrum.cxx.

References count, NuMatrix1D::fSpectrum, and NuOscProbCalc::OscillationWeight().

Referenced by NuMMRunFCNSINu::InverseOscillateNuTau(), NuMMRunCC2010::InverseOscillateNuTau(), NuMMRunFCNSINubar::InverseOscillateNuTau(), NuMMRunFCNSINubar::InverseOscillateTauBar(), NuMMRunFCNSINu::InverseOscillateTauBar(), NuMMRunCPT::MakeFDPred(), NuMMRunCPTSyst::MakeFDPred(), and NuMMRunCPT::WriteFDPredHistos().

02077 {
02078   for (Int_t bin=1; bin<=fSpectrum->GetNbinsX(); bin++){
02079     Double_t oscProb=0.0;
02080     Double_t increment=0.001;
02081     if (1==bin || fSpectrum->GetNbinsX()==bin){
02082       Int_t count=0;
02083       for (Double_t energy = fSpectrum->GetBinLowEdge(bin)+increment/2.0;
02084            energy<fSpectrum->GetBinLowEdge(bin+1);
02085            energy+=increment){
02086         oscProb += 1-NuOscProbCalc::OscillationWeight(energy, dm2, sn2);
02087         ++count;
02088       }
02089       oscProb /= count;
02090       //fSpectrum->SetBinContent(bin,
02091       //        oscProb*fSpectrum->GetBinContent(bin));
02092       //fSpectrum->SetBinError(bin, oscProb*fSpectrum->GetBinError(bin));
02093     }
02094     else{
02095       Double_t denominator=0.0;
02096       Double_t lowGrad =
02097         (fSpectrum->GetBinContent(bin)-fSpectrum->GetBinContent(bin-1))/
02098         (fSpectrum->GetBinWidth(bin)/2.0 +
02099          fSpectrum->GetBinWidth(bin-1)/2.0);
02100       Double_t highGrad =
02101         (fSpectrum->GetBinContent(bin+1)-fSpectrum->GetBinContent(bin))/
02102         (fSpectrum->GetBinWidth(bin+1)/2.0 +
02103          fSpectrum->GetBinWidth(bin)/2.0);
02104       for (Double_t energy=fSpectrum->GetBinLowEdge(bin) + increment/2.0;
02105            energy<fSpectrum->GetBinLowEdge(bin+1);
02106            energy+=increment){
02107         if (energy<fSpectrum->GetBinCenter(bin)){
02108           oscProb += (1-NuOscProbCalc::OscillationWeight(energy, dm2, sn2))*
02109             (fSpectrum->GetBinContent(bin-1) +
02110              lowGrad*(energy-fSpectrum->GetBinCenter(bin-1)));
02111           denominator +=
02112             fSpectrum->GetBinContent(bin-1) +
02113             lowGrad*(energy-fSpectrum->GetBinCenter(bin-1));
02114         }
02115         else {
02116           oscProb += (1-NuOscProbCalc::OscillationWeight(energy, dm2, sn2))*
02117             (fSpectrum->GetBinContent(bin) +
02118              highGrad*(energy-fSpectrum->GetBinCenter(bin)));
02119           denominator +=
02120             fSpectrum->GetBinContent(bin) +
02121             highGrad*(energy-fSpectrum->GetBinCenter(bin));
02122         }
02123       }
02124       if (denominator>0){
02125         oscProb /= denominator;
02126       }
02127       else{
02128         oscProb = 0;
02129       }
02130     }
02131   fSpectrum->SetBinContent(bin,oscProb*fSpectrum->GetBinContent(bin));
02132   fSpectrum->SetBinError(bin, oscProb*fSpectrum->GetBinError(bin));
02133   }
02134 }

void NuMatrixSpectrum::InverseOscillateNSI ( Double_t  dm2,
Double_t  sn2,
Double_t  epsilon,
Double_t  sign 
) [virtual]

Reimplemented from NuMatrix1D.

Definition at line 2137 of file NuMatrixSpectrum.cxx.

References NuMatrix1D::fSpectrum, and NuOscProbCalc::NSIWeight().

Referenced by NuMMRunNSINu::InverseOscillateNuTau(), NuMMRunFC::InverseOscillateNuTau(), NuMMRunFCNSINu::InverseOscillateNuTau(), NuMMRunTransSME::InverseOscillateNuTau(), NuMMRunNSINubar::InverseOscillateNuTau(), NuMMRunLED::InverseOscillateNuTau(), NuMMRunFCNSINubar::InverseOscillateNuTau(), NuMMRunTransSME::InverseOscillateTauBar(), NuMMRunFCNSINubar::InverseOscillateTauBar(), NuMMRunFC::InverseOscillateTauBar(), NuMMRunNSINu::InverseOscillateTauBar(), NuMMRunNSINubar::InverseOscillateTauBar(), NuMMRunLED::InverseOscillateTauBar(), NuMMRunFCNSINu::InverseOscillateTauBar(), NuMMRunNSI::MakeFDPred(), NuMMRunNSI::TrueComponents(), and NuMMRunNSI::WriteFDPredHistos().

02139 {
02140 
02141   for(int i=1;i<=fSpectrum->GetNbinsX();i++) {
02142     Double_t energy = fSpectrum->GetBinCenter(i);
02143     Double_t oscProb = 1-NuOscProbCalc::NSIWeight(energy, dm2, sn2,
02144                                                   epsilon, sign);
02145     fSpectrum->
02146       SetBinContent(i,fSpectrum->GetBinContent(i)*oscProb);
02147     fSpectrum->
02148       SetBinError(i,fSpectrum->GetBinError(i)*oscProb);
02149 
02150 //     cout << "InverseOscillateNSI: energy= " << energy
02151 //       << ", dm2= " << dm2
02152 //       << ", sn2= " << sn2
02153 //       << ", epsilon= " << epsilon
02154 //       << ", sign= " << sign
02155 //       << ", oscProb= " << oscProb << endl;
02156   }
02157 }

void NuMatrixSpectrum::InverseOscillatePreAveraged ( Double_t  dm2,
Double_t  sn2 
) [virtual]

Definition at line 2062 of file NuMatrixSpectrum.cxx.

References NuOscProbCalc::AverageOscillationWeight(), and NuMatrix1D::fSpectrum.

Referenced by NuMMRunFCNSINu::InverseOscillateNuTau(), NuMMRunFCNSINubar::InverseOscillateNuTau(), NuMMRunFCNSINubar::InverseOscillateTauBar(), and NuMMRunFCNSINu::InverseOscillateTauBar().

02063 {
02064   for (Int_t bin=1; bin<=fSpectrum->GetNbinsX(); bin++){
02065     Double_t energy = fSpectrum->GetBinCenter(bin);
02066     Double_t binwidth = fSpectrum->GetBinWidth(bin);
02067     Double_t oscProb = 1-NuOscProbCalc::AverageOscillationWeight(energy,
02068                                                  dm2, sn2, binwidth);
02069     fSpectrum->SetBinContent(bin,
02070                              oscProb*fSpectrum->GetBinContent(bin));
02071     fSpectrum->SetBinError(bin, oscProb*fSpectrum->GetBinError(bin));
02072   }
02073 }

void NuMatrixSpectrum::InverseOscillateSimpleAverage ( Double_t  dm2,
Double_t  sn2 
) [virtual]

Definition at line 2042 of file NuMatrixSpectrum.cxx.

References count, NuMatrix1D::fSpectrum, and NuOscProbCalc::OscillationWeight().

02043 {
02044   for (Int_t bin=1; bin<=fSpectrum->GetNbinsX(); bin++){
02045     Double_t oscProb=0.0;
02046     Double_t increment=0.001;
02047     Int_t count=0;
02048     for (Double_t energy = fSpectrum->GetBinLowEdge(bin)+increment/2.0;
02049          energy<fSpectrum->GetBinLowEdge(bin+1);
02050          energy+=increment){
02051       oscProb += 1-NuOscProbCalc::OscillationWeight(energy, dm2, sn2);
02052       ++count;
02053     }
02054     oscProb /= count;
02055     fSpectrum->SetBinContent(bin,
02056                              oscProb*fSpectrum->GetBinContent(bin));
02057     fSpectrum->SetBinError(bin, oscProb*fSpectrum->GetBinError(bin));
02058   }
02059 }

const TH2D NuMatrixSpectrum::MakeJessTemplate ( const TH2D *  recoVtrue  )  const [virtual]

Definition at line 1153 of file NuMatrixSpectrum.cxx.

References NuMatrix1D::fSpectrum.

Referenced by NuMMRunTemplates::Go(), NuMMRunNSINubar::WriteToJess(), NuMMRunNSINu::WriteToJess(), NuMMRunNDOsc::WriteToJess(), and NuMMRunCC2010New::WriteToJess().

01155 {
01156   //The x-axis of recoVtrue is true energy.
01157   //The fSpectrum should be in true energy at this point.
01158   const int NX = recoVtrue->GetNbinsX();
01159   const int NY = recoVtrue->GetNbinsY();
01160 
01161   TH2D output(*recoVtrue);
01162   output.GetXaxis()->SetTitle("true energy");
01163   output.GetYaxis()->SetTitle("reco energy");
01164   for (Int_t xBin=0; xBin<=NX+1; ++xBin){
01165     Double_t multiplier = fSpectrum->GetBinContent(xBin);
01166     for (Int_t yBin=0; yBin<=NY+1; ++yBin){
01167       Double_t oldBinContent = output.GetBinContent(xBin,yBin);
01168       output.SetBinContent(xBin,yBin,oldBinContent*multiplier);
01169     }
01170   }
01171 
01172   return output;
01173 
01174 }

void NuMatrixSpectrum::Multiply ( TF1 *  c  )  [virtual]

Definition at line 183 of file NuMatrixSpectrum.cxx.

References NuMatrix1D::fSpectrum.

00184 {
00185   fSpectrum->Multiply(correction);
00186   /* Not Correct
00187   if (fDoPoisson) {
00188     MSG("NuMatrixSpectrum",Msg::kInfo) << "Scaling Poisson, assuming correction "
00189     << correction->GetName() << " has 0 error." << endl;
00190     for (int i = 0; i < fSpectrum->GetNbinsX(); i++) {
00191       fPoiUp[i] *= correction->Eval(fSpectrum->GetBinCenter(i+1));
00192       fPoiDn[i] *= correction->Eval(fSpectrum->GetBinCenter(i+1));
00193     }
00194   }
00195   */
00196 }

virtual void NuMatrixSpectrum::Multiply ( const TGraph *  c  )  [inline, virtual]

Definition at line 42 of file NuMatrixSpectrum.h.

References Multiply().

Referenced by Multiply().

00042 {Multiply(*c);}

virtual void NuMatrixSpectrum::Multiply ( const NuMatrixSpectrum c  )  [inline, virtual]

Definition at line 41 of file NuMatrixSpectrum.h.

References Multiply(), and Spectrum().

Referenced by Multiply().

00041 {Multiply(c->Spectrum());}

virtual void NuMatrixSpectrum::Multiply ( const TH1 *  c  )  [inline, virtual]

Definition at line 40 of file NuMatrixSpectrum.h.

References Multiply().

Referenced by NuFCRunInfo::BuildSampleWeights(), NuMMRunTransSME::CacheExtrapolation(), NuMMRunLED::CacheExtrapolation(), NuMMRunFCNSINu::CacheExtrapolation(), NuMMRunNSI::CacheExtrapolation(), NuMMRunFCNSINubar::CacheExtrapolation(), NuMMRunTransition::CacheExtrapolation(), NuMMRunFC::CacheExtrapolation(), NuMMRunNDOsc::CalculateFDFlux(), NuMMRunNSINu::CalculateFDFlux(), NuMMRunNSINubar::CalculateFDFlux(), NuMMRunCC2010New::CalculateFDFlux(), NuMMRunCC2010::CalculateFDFlux(), NuMMRunCC2010New::CalculateFDNCBackground(), NuMMRunNDOsc::CalculateFDNCBackground(), NuMMRunNSINubar::CalculateFDNCBackground(), NuMMRunNSINu::CalculateFDNCBackground(), NuMMRunCC2010New::CalculateFDTauFlux(), NuMMRunNSINubar::CalculateFDTauFlux(), NuMMRunNDOsc::CalculateFDTauFlux(), NuMMRunNSINu::CalculateFDTauFlux(), NuMMRunNC2010::CalculateNDFlux(), GenerateErrors(), NuFCExperimentFactory::GenerateNewExperiment(), NuFCExperimentFactoryNSI::GenerateNewExperiment(), NuMMRunTemplates::Go(), NuMMRunCCTutorial::MakeFDPred(), NuMMRunCC2010New::MakeFDPred(), NuMMRunNSINu::MakeFDPred(), NuMMRunNoChargeCut::MakeFDPred(), NuMMRunCPT::MakeFDPred(), NuMMRunCC2010::MakeFDPred(), NuMMRunTransSME::MakeFDPred(), NuMMRunCPTSyst::MakeFDPred(), NuMMRunPRL::MakeFDPred(), NuMMRunNDOsc::MakeFDPred(), NuMMRunTransition::MakeFDPred(), NuMMRunNSINubar::MakeFDPred(), NuMMRunTransition::MakeFDPredNuBar(), NuMMRunTransition::MakeFDPredNuMu(), Multiply(), NuMMRunNDOsc::PrecalculateWSFlux(), NuMMRunNSINu::PrecalculateWSFlux(), NuMMRunCC2010New::PrecalculateWSFlux(), NuMMRunNSINubar::PrecalculateWSFlux(), NuMMRunNSINubar::TrueComponents(), NuMMRunTransition::TrueComponents(), NuMMRunTransSME::TrueComponents(), NuMMRunNSINu::TrueComponents(), NuMMRunNSINu::WriteFDPredHistos(), NuMMRunNoChargeCut::WriteFDPredHistos(), NuMMRunCC2010::WriteFDPredHistos(), NuMMRunTransSME::WriteFDPredHistos(), NuMMRunCC2010New::WriteFDPredHistos(), NuMMRunPRL::WriteFDPredHistos(), NuMMRunTransition::WriteFDPredHistos(), NuMMRunNSINubar::WriteFDPredHistos(), NuMMRunNDOsc::WriteFDPredHistos(), NuMMRunCPT::WriteFDPredHistos(), and NuMMRunCCTutorial::WriteFDPredHistos().

00040 {Multiply(*c);}

void NuMatrixSpectrum::MultiplyPurity ( const TH1D *  corr,
const Double_t  corrShift 
) [virtual]

Definition at line 246 of file NuMatrixSpectrum.cxx.

References fDoPoisson, NuMatrix1D::fSpectrum, Msg::kWarning, and MSG.

00248 {
00249   TH1D oneMinusCorrection(*correction);
00250   oneMinusCorrection.Reset();
00251   for (Int_t bin=0; bin<=oneMinusCorrection.GetNbinsX()+1; ++bin){
00252     oneMinusCorrection.SetBinContent(bin,1.0);
00253   }
00254   oneMinusCorrection.Add(correction,-1.0);
00255   TH1D background(*fSpectrum);
00256   background.Multiply(&oneMinusCorrection);
00257   background.Scale(correctionShift);
00258 
00259   fSpectrum->Add(&background,-1.0);
00260 
00261   if (fDoPoisson) {
00262     fDoPoisson = false;
00263     MSG("NuMatrixSpectrum",Msg::kWarning) << "Poisson errors cannot handle purity corrections.  Ignoring Poisson errors." << endl;
00264   }
00265 }

void NuMatrixSpectrum::NCCompressX (  )  [virtual]

Definition at line 418 of file NuMatrixSpectrum.cxx.

References compress, NuMatrix1D::fSpectrum, GetXaxis(), ResetSpectrum(), SetRangeUser(), and xlimit.

Referenced by BlessedForNC().

00419 {
00420   //cout << "Calling NCCompressX: compress = " << compress << ", xlimit = " << xlimit << endl;
00421   //<< "  Make sure this step is performed after you have rebinned into" << endl
00422   //<< "  your desired binning scheme AND have already called BinWidthNormalize" << endl
00423   //<< "  since this method changes the width of the bins." << endl;
00424 
00425   // Get Current Bins
00426   Double_t bins_old[999];
00427   Double_t bins_new[999];
00428   GetXaxis()->GetLowEdge(bins_old);
00429 
00430   int Nbins = GetXaxis()->GetNbins();
00431 
00432   // Compress bins - number of bins stays the same
00433   //   but higher bins become half as wide
00434   for (int i = 0; i <= Nbins; i++) {
00435     if (i == Nbins) { // Overflow bin special case
00436       bins_new[i] = bins_new[i-1] + 150. / compress;
00437     }
00438     else if (bins_old[i] < xlimit + 0.001) {
00439       bins_new[i] = bins_old[i];
00440     }
00441     else {
00442       double width = bins_old[i] - bins_old[i-1];
00443       bins_new[i] = bins_new[i-1] + width / compress;
00444     }
00445   }
00446 
00447   // Reassign bin contents based on bin number,
00448   // not on actual bin value.
00449   TH1D newHist("NewHist", "", Nbins, bins_new);
00450   for (int i = 1; i < Nbins + 1; i++) {
00451     newHist.SetBinContent(i, fSpectrum->GetBinContent(i));
00452     newHist.SetBinError(i, fSpectrum->GetBinError(i));
00453   }
00454 
00455   // Store our new hist as fSpectrum
00456   string name = fSpectrum->GetName();
00457   string title = fSpectrum->GetTitle();
00458   ResetSpectrum(newHist);
00459   fSpectrum->SetName(name.c_str());
00460   fSpectrum->SetTitle(name.c_str());
00461 
00462   // Style away the axis and labels since they are meaningless
00463   // fSpectrum->SetAxisColor(kWhite); // White ticks interfere with plot
00464   fSpectrum->GetXaxis()->SetTickLength(0);
00465   fSpectrum->SetLabelSize(0);
00466   SetRangeUser(0, bins_new[Nbins-1] - 0.005);
00467 } // NCCompressX

void NuMatrixSpectrum::NuBarCompressX (  )  [virtual]

Definition at line 367 of file NuMatrixSpectrum.cxx.

References compress, NuMatrix1D::fSpectrum, GetXaxis(), ResetSpectrum(), SetRangeUser(), and xlimit.

Referenced by BlessedFD(), BlessedFD7e20(), BlessedFDRatio(), BlessedND(), and NuStatistics::PredSpectrum().

00368 {
00369   //cout << "Calling NuBarCompressX: compress = " << compress << ", xlimit = " << xlimit << endl;
00370   //<< "  Make sure this step is performed after you have rebinned into" << endl
00371   //<< "  your desired binning scheme AND have already called BinWidthNormalize" << endl
00372   //<< "  since this method changes the width of the bins." << endl;
00373 
00374   // Get Current Bins
00375   Double_t bins_old[999];
00376   Double_t bins_new[999];
00377   GetXaxis()->GetLowEdge(bins_old);
00378   int Nbins = GetXaxis()->GetNbins();
00379   // Compress bins - number of bins stays the same
00380   //   but higher bins become half as wide
00381   for (int i = 0; i <= Nbins; i++) {
00382     if (i == Nbins) { // Overflow bin special case
00383       bins_new[i] = bins_new[i-1] + 150. / compress;
00384     }
00385     else if (bins_old[i] < xlimit + 0.001) {
00386       bins_new[i] = bins_old[i];
00387     }
00388     else {
00389       double width = bins_old[i] - bins_old[i-1];
00390       bins_new[i] = bins_new[i-1] + width / compress;
00391     }
00392   }
00393 
00394   // Reassign bin contents based on bin number,
00395   // not on actual bin value.
00396   TH1D newHist("NewHist", "", Nbins, bins_new);
00397   for (int i = 1; i < Nbins+1; i++) {
00398     newHist.SetBinContent(i, fSpectrum->GetBinContent(i));
00399     newHist.SetBinError(i, fSpectrum->GetBinError(i));
00400   }
00401 
00402   // Store our new hist as fSpectrum
00403   string name = fSpectrum->GetName();
00404   string title = fSpectrum->GetTitle();
00405   ResetSpectrum(newHist);
00406   fSpectrum->SetName(name.c_str());
00407   fSpectrum->SetTitle(name.c_str());
00408 
00409   // Style away the axis and labels since they are meaningless
00410   // fSpectrum->SetAxisColor(kWhite); // White ticks interfere with plot
00411   fSpectrum->GetXaxis()->SetTickLength(0);
00412   fSpectrum->SetLabelSize(0);
00413   SetRangeUser(0, bins_new[Nbins-1] - 0.005);
00414 }

void NuMatrixSpectrum::Oscillate ( Double_t  dm2,
Double_t  sn2 
) [virtual]

Oscillation function.

Reimplemented from NuMatrix1D.

Definition at line 1209 of file NuMatrixSpectrum.cxx.

References fgCachedOsc, FillOscCache(), NuMatrix1D::fSpectrum, n, OscillateHybrid(), and NuOscProbCalc::OscillationWeight().

Referenced by NuMMRunTransition::CacheExtrapolation(), NuMMRunCCTutorial::MakeFDPred(), NuMMRunNoChargeCut::MakeFDPred(), NuMMRunPRL::MakeFDPred(), NuMMRunNC2010::Oscillate(), NuUtilities::OscillateJesstogram(), NuMMRunNSINubar::OscillateNuBar(), NuMMRunLED::OscillateNuBar(), NuMMRunNSINu::OscillateNuBar(), NuMMRunTransSME::OscillateNuBar(), NuMMRunFC::OscillateNuBar(), NuMMRunNSINu::OscillateNuMu(), NuMMRunLED::OscillateNuMu(), NuMMRunNSINubar::OscillateNuMu(), NuMMRunCC2010New::OscillateNuMu(), NuMMRunFC::OscillateNuMu(), NuMMRunTransSME::OscillateNuMu(), NuMMRunNoChargeCut::WriteFDPredHistos(), NuMMRunPRL::WriteFDPredHistos(), NuMMRunTransition::WriteFDPredHistos(), and NuMMRunCCTutorial::WriteFDPredHistos().

01210 {
01211   FillOscCache(dm2);
01212 
01213   for(int n = 0; n < fSpectrum->GetNbinsX()+2; ++n){
01214     fSpectrum->SetBinContent(n,
01215                              fSpectrum->GetBinContent(n)*
01216                              (1-sn2*(1-fgCachedOsc->fSpectrum->GetBinContent(n))));
01217   }
01218   return;
01219 
01220 
01221   OscillateHybrid(dm2, sn2);
01222   return;
01223 
01224   for(int i=1;i<=fSpectrum->GetNbinsX();i++) {
01225     const Double_t energy = fSpectrum->GetBinCenter(i);
01226     const Double_t oscProb = NuOscProbCalc::OscillationWeight(energy, dm2, sn2);
01227     fSpectrum->
01228       SetBinContent(i,fSpectrum->GetBinContent(i)*oscProb);
01229     fSpectrum->
01230       SetBinError(i,fSpectrum->GetBinError(i)*oscProb);
01231   }
01232 }

void NuMatrixSpectrum::Oscillate_3flavour ( Double_t  dm232,
Double_t  t23,
Double_t  dm221,
Double_t  t12,
Double_t  t13,
Double_t  delta,
int  inu 
) [virtual]
void NuMatrixSpectrum::OscillateBasic_3flavour ( Double_t  dm232,
Double_t  t23,
Double_t  dm221,
Double_t  t12,
Double_t  t13,
Double_t  delta,
int  inu 
) [virtual]

Definition at line 1643 of file NuMatrixSpectrum.cxx.

References NuMatrix1D::fSpectrum, Munits::km, minimum, and threeFlavourWeight().

01644 {
01645   const Double_t threshold = 0.5; // The minimum spacing between oscillation minima/maxima
01646   Double_t minimum, previous;
01647   Int_t i = 2;
01648   minimum = (k1267 * 2 * (kFDDistance/Munits::km) * dm232) / (1*TMath::Pi());
01649   // cout << "Initial min: " << minimum << endl;
01650   previous = minimum + threshold + 1;
01651 
01652   while (previous - minimum > threshold) {
01653     previous = minimum;
01654     minimum = (k1267 * 2 * (kFDDistance/Munits::km) * dm232) / (i*TMath::Pi());
01655     ++i;
01656     // cout << i-1 << ": Min: " << minimum << ", Prev: " << previous << ", diff: " << previous - minimum << endl;
01657   }
01658 
01659   // cout << "Calculated cutoff energy: " << previous << endl;
01660 
01661   // Now min is the energy that we stop oscillating by center and start linear averaging
01662   for(int bin=1;bin<=fSpectrum->GetNbinsX();bin++) {
01663     Double_t oscProb = 0;
01664 
01665     Double_t energy = fSpectrum->GetBinCenter(bin);
01666     oscProb = threeFlavourWeight(energy, dm232, t23, dm221, t12, t13, delta, inu);
01667       
01668     // cout << "Prob: " << oscProb << endl;
01669     // Now do the 'oscillation'
01670     fSpectrum->
01671       SetBinContent(bin,fSpectrum->GetBinContent(bin)*oscProb);
01672     fSpectrum->
01673       SetBinError(bin,fSpectrum->GetBinError(bin)*oscProb);
01674 
01675   }
01676 }

void NuMatrixSpectrum::OscillateFourFlavour ( const double  dm2,
const double  theta23,
const double  dm221,
const double  dm243,
const double  theta12,
const double  theta13,
const double  theta14,
const double  theta24,
const double  theta34,
const double  delta1,
const double  delta2,
const double  delta3,
const double  baseline 
)

Definition at line 1800 of file NuMatrixSpectrum.cxx.

References NuOscProb::FourFlavourDisappearanceWeight(), and NuMatrix1D::fSpectrum.

01808 {
01809   for(int i=1;i<=fSpectrum->GetNbinsX();i++) {
01810     const Double_t energy = fSpectrum->GetBinCenter(i);
01811     const Double_t oscProb =
01812       NuOscProbCalc::FourFlavourDisappearanceWeight(energy,
01813                                                     dm2, theta23, dm221, dm243, theta12,
01814                                                     theta13, theta14,
01815                                                     theta24, theta34,
01816                                                     delta1, delta2, delta3,
01817                                                     baseline);
01818     fSpectrum->
01819       SetBinContent(i,fSpectrum->GetBinContent(i)*oscProb);
01820     fSpectrum->
01821       SetBinError(i,fSpectrum->GetBinError(i)*oscProb);
01822   }
01823 }

void NuMatrixSpectrum::OscillateFourFlavourAverage ( const double  dm2,
const double  theta23,
const double  dm221,
const double  dm243,
const double  theta12,
const double  theta13,
const double  theta14,
const double  theta24,
const double  theta34,
const double  delta1,
const double  delta2,
const double  delta3,
const double  baseline 
)

Definition at line 1826 of file NuMatrixSpectrum.cxx.

References count, NuOscProb::FourFlavourDisappearanceWeight(), and NuMatrix1D::fSpectrum.

Referenced by NuMMRunNDOsc::OscillateFD().

01834 {
01835 
01836   for(int bin=1;bin<=fSpectrum->GetNbinsX();bin++) {
01837     Double_t oscProb=0.0;
01838     Double_t increment=0.001;
01839     Int_t count=0;
01840     for (Double_t energy = fSpectrum->GetBinLowEdge(bin)+increment/2.0;
01841          energy<fSpectrum->GetBinLowEdge(bin+1);
01842          energy+=increment){
01843       oscProb += NuOscProbCalc::FourFlavourDisappearanceWeight(energy,
01844                                                                dm2, theta23, dm221, dm243, theta12,
01845                                                                theta13, theta14,
01846                                                                theta24, theta34,
01847                                                                delta1, delta2, delta3,
01848                                                                baseline);
01849       ++count;
01850     }
01851     oscProb /= count;
01852     fSpectrum->SetBinContent(bin,
01853                              oscProb*fSpectrum->GetBinContent(bin));
01854     fSpectrum->SetBinError(bin, oscProb*fSpectrum->GetBinError(bin));
01855   }
01856 }

void NuMatrixSpectrum::OscillateHybrid ( Double_t  dm2,
Double_t  sn2 
) [virtual]

Definition at line 1238 of file NuMatrixSpectrum.cxx.

References count, NuMatrix1D::fSpectrum, Munits::km, minimum, and NuOscProbCalc::OscillationWeight().

Referenced by FillOscCache(), and Oscillate().

01239 {
01240   const Double_t threshold = 0.5; // The minimum spacing between oscillation minima/maxima
01241   Double_t minimum, previous;
01242   Int_t i = 2;
01243   minimum = (k1267 * 2 * (kFDDistance/Munits::km) * dm2) / (1*TMath::Pi());
01244   // cout << "Initial min: " << minimum << endl;
01245   previous = minimum + threshold + 1;
01246 
01247   while (previous - minimum > threshold) {
01248     previous = minimum;
01249     minimum = (k1267 * 2 * (kFDDistance/Munits::km) * dm2) / (i*TMath::Pi());
01250     ++i;
01251     // cout << i-1 << ": Min: " << minimum << ", Prev: " << previous << ", diff: " << previous - minimum << endl;
01252   }
01253 
01254   // cout << "Calculated cutoff energy: " << previous << endl;
01255 
01256   // Now min is the energy that we stop oscillating by center and start linear averaging
01257   for(int bin=1;bin<=fSpectrum->GetNbinsX();bin++) {
01258     Double_t oscProb = 0;
01259 
01260     Double_t energy = fSpectrum->GetBinCenter(bin);
01261     // cout << "Bin " << bin << ": ";
01262     // Check our cut-off point
01263     if (energy > previous) {
01264       // oscProb = 1. - (0.5 * sn2);
01265       oscProb = NuOscProbCalc::OscillationWeight(energy, dm2, sn2);
01266      // cout << "Simple center-bin oscillation (" << energy << " = " << oscProb << "). ";
01267     } else {
01268 
01269       // cout << "Linear interpolation. ";
01273       // Use linear interpolation for the complicated parts
01274       const Double_t increment=0.001;
01275 
01276       if (1==bin || fSpectrum->GetNbinsX()==bin){
01277         // cout << "End bins. ";
01278         Int_t count=0;
01279         for (Double_t energy = fSpectrum->GetBinLowEdge(bin)+increment/2.0;
01280              energy<fSpectrum->GetBinLowEdge(bin+1);
01281              energy+=increment){
01282           oscProb += NuOscProbCalc::OscillationWeight(energy, dm2, sn2);
01283           ++count;
01284         }
01285         oscProb /= count;
01286         //fSpectrum->SetBinContent(bin,
01287         //                       oscProb*fSpectrum->GetBinContent(bin));
01288         //fSpectrum->SetBinError(bin, oscProb*fSpectrum->GetBinError(bin));
01289       }
01290       else{
01291         Double_t denominator=0.0;
01292         Double_t lowGrad =
01293           (fSpectrum->GetBinContent(bin)-fSpectrum->GetBinContent(bin-1))/
01294           (fSpectrum->GetBinWidth(bin)/2.0 +
01295            fSpectrum->GetBinWidth(bin-1)/2.0);
01296         Double_t highGrad =
01297           (fSpectrum->GetBinContent(bin+1)-fSpectrum->GetBinContent(bin))/
01298           (fSpectrum->GetBinWidth(bin+1)/2.0 +
01299            fSpectrum->GetBinWidth(bin)/2.0);
01300         for (Double_t energy=fSpectrum->GetBinLowEdge(bin) + increment/2.0;
01301              energy<fSpectrum->GetBinLowEdge(bin+1);
01302              energy+=increment){
01303           if (energy<fSpectrum->GetBinCenter(bin)){
01304             oscProb += NuOscProbCalc::OscillationWeight(energy, dm2, sn2)*
01305               (fSpectrum->GetBinContent(bin-1) +
01306                lowGrad*(energy-fSpectrum->GetBinCenter(bin-1)));
01307             denominator +=
01308               fSpectrum->GetBinContent(bin-1) +
01309               lowGrad*(energy-fSpectrum->GetBinCenter(bin-1));
01310           }
01311           else {
01312             oscProb += NuOscProbCalc::OscillationWeight(energy, dm2, sn2)*
01313               (fSpectrum->GetBinContent(bin) +
01314                highGrad*(energy-fSpectrum->GetBinCenter(bin)));
01315             denominator +=
01316               fSpectrum->GetBinContent(bin) +
01317               highGrad*(energy-fSpectrum->GetBinCenter(bin));
01318           }
01319         }
01320         if (denominator>0){
01321           oscProb /= denominator;
01322         }
01323         else{
01324           oscProb = 0;
01325         }
01326       }
01327 
01332 
01333 
01334 
01335 
01336 
01337 
01338 
01339 
01340 
01341     }
01342 
01343     // cout << "Prob: " << oscProb << endl;
01344     // Now do the 'oscillation'
01345     fSpectrum->
01346       SetBinContent(bin,fSpectrum->GetBinContent(bin)*oscProb);
01347     fSpectrum->
01348       SetBinError(bin,fSpectrum->GetBinError(bin)*oscProb);
01349 
01350   }
01351 }

void NuMatrixSpectrum::OscillateHybrid_3flavour ( Double_t  dm232,
Double_t  t23,
Double_t  dm221,
Double_t  t12,
Double_t  t13,
Double_t  delta,
int  inu 
) [virtual]

Definition at line 1528 of file NuMatrixSpectrum.cxx.

References count, NuMatrix1D::fSpectrum, Munits::km, minimum, and threeFlavourWeight().

Referenced by FillOscCache_3flavour().

01529 {
01530   const Double_t threshold = 0.5; // The minimum spacing between oscillation minima/maxima
01531   Double_t minimum, previous;
01532   Int_t i = 2;
01533   minimum = (k1267 * 2 * (kFDDistance/Munits::km) * dm232) / (1*TMath::Pi());
01534   // cout << "Initial min: " << minimum << endl;
01535   previous = minimum + threshold + 1;
01536 
01537   while (previous - minimum > threshold) {
01538     previous = minimum;
01539     minimum = (k1267 * 2 * (kFDDistance/Munits::km) * dm232) / (i*TMath::Pi());
01540     ++i;
01541     // cout << i-1 << ": Min: " << minimum << ", Prev: " << previous << ", diff: " << previous - minimum << endl;
01542   }
01543 
01544   // cout << "Calculated cutoff energy: " << previous << endl;
01545 
01546   // Now min is the energy that we stop oscillating by center and start linear averaging
01547   for(int bin=1;bin<=fSpectrum->GetNbinsX();bin++) {
01548     Double_t oscProb = 0;
01549 
01550     Double_t energy = fSpectrum->GetBinCenter(bin);
01551     // cout << "Bin " << bin << ": ";
01552     // Check our cut-off point
01553     if (energy > previous) {
01554       // oscProb = 1. - (0.5 * sn2);
01555       oscProb = threeFlavourWeight(energy, dm232, t23, dm221, t12, t13, delta, inu);
01556      // cout << "Simple center-bin oscillation (" << energy << " = " << oscProb << "). ";
01557     } else {
01558 
01559       // cout << "Linear interpolation. ";
01563       // Use linear interpolation for the complicated parts
01564       const Double_t increment=0.001;
01565 
01566       if (1==bin || fSpectrum->GetNbinsX()==bin){
01567         // cout << "End bins. ";
01568         Int_t count=0;
01569         for (Double_t energy = fSpectrum->GetBinLowEdge(bin)+increment/2.0;
01570              energy<fSpectrum->GetBinLowEdge(bin+1);
01571              energy+=increment){
01572           oscProb += threeFlavourWeight(energy, dm232, t23, dm221, t12, t13, delta, inu);
01573           ++count;
01574         }
01575         oscProb /= count;
01576         //fSpectrum->SetBinContent(bin,
01577         //                       oscProb*fSpectrum->GetBinContent(bin));
01578         //fSpectrum->SetBinError(bin, oscProb*fSpectrum->GetBinError(bin));
01579       }
01580       else{
01581         Double_t denominator=0.0;
01582         Double_t lowGrad =
01583           (fSpectrum->GetBinContent(bin)-fSpectrum->GetBinContent(bin-1))/
01584           (fSpectrum->GetBinWidth(bin)/2.0 +
01585            fSpectrum->GetBinWidth(bin-1)/2.0);
01586         Double_t highGrad =
01587           (fSpectrum->GetBinContent(bin+1)-fSpectrum->GetBinContent(bin))/
01588           (fSpectrum->GetBinWidth(bin+1)/2.0 +
01589            fSpectrum->GetBinWidth(bin)/2.0);
01590         for (Double_t energy=fSpectrum->GetBinLowEdge(bin) + increment/2.0;
01591              energy<fSpectrum->GetBinLowEdge(bin+1);
01592              energy+=increment){
01593           if (energy<fSpectrum->GetBinCenter(bin)){
01594             oscProb += threeFlavourWeight(energy, dm232, t23, dm221, t12, t13, delta, inu)*
01595               (fSpectrum->GetBinContent(bin-1) +
01596                lowGrad*(energy-fSpectrum->GetBinCenter(bin-1)));
01597             denominator +=
01598               fSpectrum->GetBinContent(bin-1) +
01599               lowGrad*(energy-fSpectrum->GetBinCenter(bin-1));
01600           }
01601           else {
01602             oscProb += threeFlavourWeight(energy, dm232, t23, dm221, t12, t13, delta, inu)*
01603               (fSpectrum->GetBinContent(bin) +
01604                highGrad*(energy-fSpectrum->GetBinCenter(bin)));
01605             denominator +=
01606               fSpectrum->GetBinContent(bin) +
01607               highGrad*(energy-fSpectrum->GetBinCenter(bin));
01608           }
01609         }
01610         if (denominator>0){
01611           oscProb /= denominator;
01612         }
01613         else{
01614           oscProb = 0;
01615         }
01616       }
01617 
01622 
01623 
01624 
01625 
01626 
01627 
01628 
01629 
01630 
01631     }
01632 
01633     // cout << "Prob: " << oscProb << endl;
01634     // Now do the 'oscillation'
01635     fSpectrum->
01636       SetBinContent(bin,fSpectrum->GetBinContent(bin)*oscProb);
01637     fSpectrum->
01638       SetBinError(bin,fSpectrum->GetBinError(bin)*oscProb);
01639 
01640   }
01641 }

void NuMatrixSpectrum::OscillateLED ( int  initialFlavor,
int  finalFlavor,
int  cp_sign,
double  th12,
double  th13,
double  th23,
double  deltacp,
double  sdm,
double  ldm,
double  m0,
double  a 
)

Definition at line 2160 of file NuMatrixSpectrum.cxx.

References NuMatrix1D::fSpectrum, and NuOscProbCalc::LargeExtraDimensionProbability().

Referenced by NuMMRunLED::InverseOscillateNuTau(), NuMMRunLED::InverseOscillateTauBar(), NuMMRunLED::OscillateNuBar(), and NuMMRunLED::OscillateNuMu().

02164                                                         {
02165 
02166   for(int i=1;i<=fSpectrum->GetNbinsX();i++) {
02167 
02168     Double_t energy = fSpectrum->GetBinCenter(i);
02169     Double_t oscProb = NuOscProbCalc::LargeExtraDimensionProbability(initialFlavor, finalFlavor, cp_sign,
02170                                                                      th12, th13, th23,
02171                                                                      deltacp,
02172                                                                      sdm, ldm,
02173                                                                      m0, a,
02174                                                                      energy); 
02175     fSpectrum->SetBinContent(i, fSpectrum->GetBinContent(i) * oscProb);
02176     fSpectrum->SetBinError(i, fSpectrum->GetBinError(i) * oscProb);      
02177   }
02178 }

void NuMatrixSpectrum::OscillateLinearInterp ( Double_t  dm2,
Double_t  sn2 
) [virtual]

Definition at line 1714 of file NuMatrixSpectrum.cxx.

References count, NuMatrix1D::fSpectrum, and NuOscProbCalc::OscillationWeight().

Referenced by NuMMRunCPT::MakeFDPred(), NuMMRunCPTSyst::MakeFDPred(), NuMMRunFCNSINubar::OscillateNuBar(), NuMMRunFCNSINu::OscillateNuBar(), NuMMRunFCNSINu::OscillateNuMu(), NuMMRunCC2010::OscillateNuMu(), NuMMRunFCNSINubar::OscillateNuMu(), and NuMMRunCPT::WriteFDPredHistos().

01715 {
01716   for (Int_t bin=1; bin<=fSpectrum->GetNbinsX(); bin++){
01717     Double_t oscProb=0.0;
01718     Double_t increment=0.001;
01719     if (1==bin || fSpectrum->GetNbinsX()==bin){
01720       Int_t count=0;
01721       for (Double_t energy = fSpectrum->GetBinLowEdge(bin)+increment/2.0;
01722            energy<fSpectrum->GetBinLowEdge(bin+1);
01723            energy+=increment){
01724         oscProb += NuOscProbCalc::OscillationWeight(energy, dm2, sn2);
01725         ++count;
01726       }
01727       oscProb /= count;
01728       //fSpectrum->SetBinContent(bin,
01729       //                       oscProb*fSpectrum->GetBinContent(bin));
01730       //fSpectrum->SetBinError(bin, oscProb*fSpectrum->GetBinError(bin));
01731     }
01732     else{
01733       Double_t denominator=0.0;
01734       Double_t lowGrad =
01735         (fSpectrum->GetBinContent(bin)-fSpectrum->GetBinContent(bin-1))/
01736         (fSpectrum->GetBinWidth(bin)/2.0 +
01737          fSpectrum->GetBinWidth(bin-1)/2.0);
01738       Double_t highGrad =
01739         (fSpectrum->GetBinContent(bin+1)-fSpectrum->GetBinContent(bin))/
01740         (fSpectrum->GetBinWidth(bin+1)/2.0 +
01741          fSpectrum->GetBinWidth(bin)/2.0);
01742       for (Double_t energy=fSpectrum->GetBinLowEdge(bin) + increment/2.0;
01743            energy<fSpectrum->GetBinLowEdge(bin+1);
01744            energy+=increment){
01745         if (energy<fSpectrum->GetBinCenter(bin)){
01746           oscProb += NuOscProbCalc::OscillationWeight(energy, dm2, sn2)*
01747             (fSpectrum->GetBinContent(bin-1) +
01748              lowGrad*(energy-fSpectrum->GetBinCenter(bin-1)));
01749           denominator +=
01750             fSpectrum->GetBinContent(bin-1) +
01751             lowGrad*(energy-fSpectrum->GetBinCenter(bin-1));
01752         }
01753         else {
01754           oscProb += NuOscProbCalc::OscillationWeight(energy, dm2, sn2)*
01755             (fSpectrum->GetBinContent(bin) +
01756              highGrad*(energy-fSpectrum->GetBinCenter(bin)));
01757           denominator +=
01758             fSpectrum->GetBinContent(bin) +
01759             highGrad*(energy-fSpectrum->GetBinCenter(bin));
01760         }
01761       }
01762       if (denominator>0){
01763         oscProb /= denominator;
01764       }
01765       else{
01766         oscProb = 0;
01767       }
01768     }
01769   fSpectrum->SetBinContent(bin,oscProb*fSpectrum->GetBinContent(bin));
01770   fSpectrum->SetBinError(bin, oscProb*fSpectrum->GetBinError(bin));
01771   }
01772 }

void NuMatrixSpectrum::OscillateMu2Mu ( Double_t  dm2,
Double_t  sn2,
Double_t  gmu,
Double_t  gtau,
Double_t  cmumu,
Double_t  ctautau 
) [virtual]

Definition at line 1354 of file NuMatrixSpectrum.cxx.

References NuMatrix1D::fSpectrum, and NuOscProbCalc::OscillationWeightMu2Mu().

Referenced by NuMMRunTransSME::MakeFDPred(), NuMMRunTransSME::MakeFDPredNuBar(), and NuMMRunTransSME::WriteFDPredHistos().

01355 {
01356  // FillOscCache(dm2);
01357 //cout<<"Mu 2 Mu"<<endl;
01358 //  for(int n = 0; n < fSpectrum->GetNbinsX()+2; ++n){
01359 //    fSpectrum->SetBinContent(n,
01360 //                             fSpectrum->GetBinContent(n)*
01361 //                             (1-sn2*(1-fgCachedOsc->fSpectrum->GetBinContent(n))));
01362 //  }
01363 //  return;
01364 
01365 
01366 //  OscillateHybrid(dm2, sn2);
01367 //  return;
01368 //not using the hybrid oscillations.
01369   for(int i=1;i<=fSpectrum->GetNbinsX();i++) {
01370     const Double_t energy = fSpectrum->GetBinCenter(i);
01371     const Double_t oscProb = NuOscProbCalc::OscillationWeightMu2Mu(energy, dm2, sn2, gmu, gtau, cmumu, ctautau);
01372 
01373 //    cout<<"OscillateMu2Mu.. "<<endl;
01374 //    cout<<"energy...="<<energy<<", oscProb...="<<oscProb<<", dm2="<<dm2<<", sn2="<<sn2<<endl;
01375 //    cout<<i<<": bincontent="<<fSpectrum->GetBinContent(i)<<": setbincontent="<<fSpectrum->GetBinContent(i)*oscProb<<endl;
01376 //    cout<<"......."<<endl;
01377     fSpectrum->
01378       SetBinContent(i,fSpectrum->GetBinContent(i)*oscProb);
01379     fSpectrum->
01380       SetBinError(i,fSpectrum->GetBinError(i)*oscProb);
01381 
01382   }
01383 }

void NuMatrixSpectrum::OscillateMu2MuBar ( Double_t  dm2,
Double_t  sn2,
Double_t  gmu,
Double_t  gtau,
Double_t  cmumu,
Double_t  ctautau 
) [virtual]

Definition at line 1386 of file NuMatrixSpectrum.cxx.

References NuMatrix1D::fSpectrum, and NuOscProbCalc::OscillationWeightMu2MuBar().

Referenced by NuMMRunTransSME::MakeFDPred(), NuMMRunTransSME::MakeFDPredNuBar(), and NuMMRunTransSME::WriteFDPredHistos().

01387 {
01388  // FillOscCache(dm2);
01389 
01390 //  for(int n = 0; n < fSpectrum->GetNbinsX()+2; ++n){
01391 //    fSpectrum->SetBinContent(n,
01392 //                             fSpectrum->GetBinContent(n)*
01393 //                             (1-sn2*(1-fgCachedOsc->fSpectrum->GetBinContent(n))));
01394 //  }
01395 //  return;
01396 
01397 
01398 //  OscillateHybrid(dm2, sn2);
01399 //  return;
01400 //cout<<"Mu 2 MuBar"<<endl;
01401   for(int i=1;i<=fSpectrum->GetNbinsX();i++) {
01402     const Double_t energy = fSpectrum->GetBinCenter(i);
01403     const Double_t oscProb = NuOscProbCalc::OscillationWeightMu2MuBar(energy, dm2, sn2, gmu, gtau, cmumu, ctautau);
01404   
01405 //    cout<<"OscillateMu2MuBar.. "<<endl;
01406 //    cout<<"energy...="<<energy<<", oscProb...="<<oscProb<<", dm2="<<dm2<<", sn2="<<sn2<<endl;
01407 //    cout<<i<<": bincontent="<<fSpectrum->GetBinContent(i)<<": setbincontent="<<fSpectrum->GetBinContent(i)*oscProb<<endl;
01408 //    cout<<"......."<<endl;
01409     fSpectrum->
01410       SetBinContent(i,fSpectrum->GetBinContent(i)*oscProb);
01411     fSpectrum->
01412       SetBinError(i,fSpectrum->GetBinError(i)*oscProb);
01413   }
01414 }   

void NuMatrixSpectrum::OscillateMu2Tau ( Double_t  dm2,
Double_t  sn2,
Double_t  gmu,
Double_t  gtau,
Double_t  cmumu,
Double_t  ctautau 
) [virtual]

Definition at line 1416 of file NuMatrixSpectrum.cxx.

References NuMatrix1D::fSpectrum, and NuOscProbCalc::OscillationWeightMu2Tau().

Referenced by NuMMRunTransSME::MakeFDPred(), NuMMRunTransSME::MakeFDPredNuBar(), and NuMMRunTransSME::WriteFDPredHistos().

01417 {
01418  // FillOscCache(dm2);
01419 //cout<<"Mu 2 Tau"<<endl;
01420 //  for(int n = 0; n < fSpectrum->GetNbinsX()+2; ++n){
01421 //    fSpectrum->SetBinContent(n,
01422 //                             fSpectrum->GetBinContent(n)*
01423 //                             (1-sn2*(1-fgCachedOsc->fSpectrum->GetBinContent(n))));
01424 //  }
01425 //  return;
01426 
01427 
01428 //  OscillateHybrid(dm2, sn2);
01429 //  return;
01430 
01431   for(int i=1;i<=fSpectrum->GetNbinsX();i++) {
01432     const Double_t energy = fSpectrum->GetBinCenter(i);
01433     const Double_t oscProb = NuOscProbCalc::OscillationWeightMu2Tau(energy, dm2, sn2, gmu, gtau, cmumu, ctautau);
01434 
01435 //    cout<<"OscillateMu2Tau.. "<<endl;
01436 //    cout<<"energy...="<<energy<<", oscProb...="<<oscProb<<", dm2="<<dm2<<", sn2="<<sn2<<endl;
01437 //    cout<<i<<": bincontent="<<fSpectrum->GetBinContent(i)<<": setbincontent="<<fSpectrum->GetBinContent(i)*oscProb<<endl;
01438 //    cout<<"......."<<endl;
01439     fSpectrum->
01440       SetBinContent(i,fSpectrum->GetBinContent(i)*oscProb);
01441     fSpectrum->
01442       SetBinError(i,fSpectrum->GetBinError(i)*oscProb);
01443   }
01444 }

void NuMatrixSpectrum::OscillateMu2TauBar ( Double_t  dm2,
Double_t  sn2,
Double_t  gmu,
Double_t  gtau,
Double_t  cmumu,
Double_t  ctautau 
) [virtual]

Definition at line 1446 of file NuMatrixSpectrum.cxx.

References NuMatrix1D::fSpectrum, and NuOscProbCalc::OscillationWeightMu2TauBar().

Referenced by NuMMRunTransSME::MakeFDPred(), NuMMRunTransSME::MakeFDPredNuBar(), and NuMMRunTransSME::WriteFDPredHistos().

01447 {
01448   //FillOscCache(dm2);
01449 //cout<<"Mu 2 TauBar"<<endl;
01450 //  for(int n = 0; n < fSpectrum->GetNbinsX()+2; ++n){
01451 //    fSpectrum->SetBinContent(n,
01452 //                             fSpectrum->GetBinContent(n)*
01453 //                             (1-sn2*(1-fgCachedOsc->fSpectrum->GetBinContent(n))));
01454 //  }
01455 //  return;
01456 
01457 
01458 //  OscillateHybrid(dm2, sn2);
01459 //  return;
01460 
01461   for(int i=1;i<=fSpectrum->GetNbinsX();i++) {
01462     const Double_t energy = fSpectrum->GetBinCenter(i);
01463     const Double_t oscProb = NuOscProbCalc::OscillationWeightMu2TauBar(energy, dm2, sn2, gmu, gtau, cmumu, ctautau);
01464   
01465 //    cout<<"OscillateMu2MuBar.. "<<endl;
01466 //    cout<<"energy...="<<energy<<", oscProb...="<<oscProb<<", dm2="<<dm2<<", sn2="<<sn2<<endl;
01467 //    cout<<i<<": bincontent="<<fSpectrum->GetBinContent(i)<<": setbincontent="<<fSpectrum->GetBinContent(i)*oscProb<<endl;
01468 //    cout<<"......."<<endl;
01469     fSpectrum->
01470       SetBinContent(i,fSpectrum->GetBinContent(i)*oscProb);
01471     fSpectrum->
01472       SetBinError(i,fSpectrum->GetBinError(i)*oscProb);
01473 //cout<<"OscillateMu2TauBar.. energy="<<energy<<", gmu="<<gmu<<endl;
01474   }
01475 }

void NuMatrixSpectrum::OscillateNSI ( Double_t  dm2,
Double_t  sn2,
Double_t  epsilon,
Double_t  sign 
) [virtual]

Reimplemented from NuMatrix1D.

Definition at line 1774 of file NuMatrixSpectrum.cxx.

References NuMatrix1D::fSpectrum, and NuOscProbCalc::NSIWeight().

Referenced by NuMMRunNSI::MakeFDPred(), NuMMRunNSINubar::OscillateNuBar(), NuMMRunFCNSINubar::OscillateNuBar(), NuMMRunLED::OscillateNuBar(), NuMMRunFCNSINu::OscillateNuBar(), NuMMRunNSINu::OscillateNuBar(), NuMMRunTransSME::OscillateNuBar(), NuMMRunFC::OscillateNuBar(), NuMMRunNSINu::OscillateNuMu(), NuMMRunFCNSINu::OscillateNuMu(), NuMMRunLED::OscillateNuMu(), NuMMRunNSINubar::OscillateNuMu(), NuMMRunFC::OscillateNuMu(), NuMMRunTransSME::OscillateNuMu(), NuMMRunFCNSINubar::OscillateNuMu(), NuMMRunNSI::PreCalcWrongSign(), NuMMRunNSI::TrueComponents(), and NuMMRunNSI::WriteFDPredHistos().

01776 {
01777   //I'm doing the simple oscillation, not the cache or the hybrid which
01778   //apparently accounts for more complicated situations. May need to add 
01779   //those in once the basic is up and running. 
01780   for(int i=1;i<=fSpectrum->GetNbinsX();i++) {
01781     const Double_t energy = fSpectrum->GetBinCenter(i);
01782     const Double_t oscProb = NuOscProbCalc::NSIWeight(energy, dm2, sn2,
01783                                                       epsilon, sign);
01784     fSpectrum->
01785       SetBinContent(i,fSpectrum->GetBinContent(i)*oscProb);
01786     fSpectrum->
01787       SetBinError(i,fSpectrum->GetBinError(i)*oscProb);
01788 
01789 //     cout << "OscillateNSI: energy= " << energy
01790 //       << ", dm2= " << dm2
01791 //       << ", sn2= " << sn2
01792 //       << ", epsilon= " << epsilon
01793 //       << ", sign= " << sign
01794 //       << ", oscProb= " << oscProb << endl;
01795 
01796   }
01797 }

void NuMatrixSpectrum::OscillatePreAveraged ( Double_t  dm2,
Double_t  sn2 
) [virtual]

Definition at line 1700 of file NuMatrixSpectrum.cxx.

References NuOscProbCalc::AverageOscillationWeight(), and NuMatrix1D::fSpectrum.

Referenced by NuMMRunFCNSINubar::OscillateNuBar(), NuMMRunFCNSINu::OscillateNuBar(), NuMMRunFCNSINu::OscillateNuMu(), and NuMMRunFCNSINubar::OscillateNuMu().

01701 {
01702   for (Int_t bin=1; bin<=fSpectrum->GetNbinsX(); bin++){
01703     Double_t energy = fSpectrum->GetBinCenter(bin);   
01704     Double_t binwidth = fSpectrum->GetBinWidth(bin);                 
01705     Double_t oscProb = NuOscProbCalc::AverageOscillationWeight(energy,
01706                                                  dm2, sn2, binwidth);
01707     fSpectrum->SetBinContent(bin,
01708                              oscProb*fSpectrum->GetBinContent(bin));
01709     fSpectrum->SetBinError(bin, oscProb*fSpectrum->GetBinError(bin));
01710   }   
01711 }  

void NuMatrixSpectrum::OscillateSimpleAverage ( Double_t  dm2,
Double_t  sn2 
) [virtual]

Definition at line 1680 of file NuMatrixSpectrum.cxx.

References count, NuMatrix1D::fSpectrum, and NuOscProbCalc::OscillationWeight().

01681 {
01682   for (Int_t bin=1; bin<=fSpectrum->GetNbinsX(); bin++){
01683     Double_t oscProb=0.0;
01684     Double_t increment=0.001;
01685     Int_t count=0;
01686     for (Double_t energy = fSpectrum->GetBinLowEdge(bin)+increment/2.0;
01687          energy<fSpectrum->GetBinLowEdge(bin+1);
01688          energy+=increment){
01689       oscProb += NuOscProbCalc::OscillationWeight(energy, dm2, sn2);
01690       ++count;
01691     }
01692     oscProb /= count;
01693     fSpectrum->SetBinContent(bin,
01694                              oscProb*fSpectrum->GetBinContent(bin));
01695     fSpectrum->SetBinError(bin, oscProb*fSpectrum->GetBinError(bin));
01696   }
01697 }

Double_t NuMatrixSpectrum::PoiErr ( double  y,
bool  up 
) [protected, virtual]

Definition at line 1025 of file NuMatrixSpectrum.cxx.

References n.

Referenced by CalcPoisson().

01026 {
01027   assert(y >= 0);
01028 
01029   // Poisson Error Table
01030   Double_t jimeu[51];
01031   Double_t jimed[51];
01032   jimeu[0]=  1.841;  jimed[0]= 0.000;
01033   jimeu[1]=  3.3  ;  jimed[1]= 0.173;
01034   jimeu[2]=  4.638;  jimed[2]= 0.708;
01035   jimeu[3]=  5.918;  jimed[3]= 1.367;
01036   jimeu[4]=  7.163;  jimed[4]= 2.086;
01037   jimeu[5]=  8.382;  jimed[5]= 2.84 ;
01038   jimeu[6]=  9.584;  jimed[6]= 3.62 ;
01039   jimeu[7]=  10.77;  jimed[7]= 4.419;
01040   jimeu[8]=  11.95;  jimed[8]= 5.232;
01041   jimeu[9]=  13.11;  jimed[9]= 6.057;
01042   jimeu[10]= 14.27;  jimed[10]=6.891;
01043   jimeu[11]= 15.42;  jimed[11]=7.734;
01044   jimeu[12]= 16.56;  jimed[12]=8.585;
01045   jimeu[13]= 17.7;   jimed[13]=9.441;
01046   jimeu[14]= 18.83;  jimed[14]=10.3 ;
01047   jimeu[15]= 19.96;  jimed[15]=11.17;
01048   jimeu[16]= 21.08;  jimed[16]=12.04;
01049   jimeu[17]= 22.2 ;  jimed[17]=12.92;
01050   jimeu[18]= 23.32;  jimed[18]=13.8 ;
01051   jimeu[19]= 24.44;  jimed[19]=14.68;
01052   jimeu[20]= 25.55;  jimed[20]=15.57;
01053   jimeu[21]= 26.66;  jimed[21]=16.45;
01054   jimeu[22]= 27.76;  jimed[22]=17.35;
01055   jimeu[23]= 28.87;  jimed[23]=18.24;
01056   jimeu[24]= 29.97;  jimed[24]=19.14;
01057   jimeu[25]= 31.07;  jimed[25]=20.03;
01058   jimeu[26]= 32.16;  jimed[26]=20.93;
01059   jimeu[27]= 33.26;  jimed[27]=21.84;
01060   jimeu[28]= 34.35;  jimed[28]=22.74;
01061   jimeu[29]= 35.45;  jimed[29]=23.65;
01062   jimeu[30]= 36.54;  jimed[30]=24.55;
01063   jimeu[31]= 37.63;  jimed[31]=25.46;
01064   jimeu[32]= 38.72;  jimed[32]=26.37;
01065   jimeu[33]= 39.80;  jimed[33]=27.28;
01066   jimeu[34]= 40.89;  jimed[34]=28.20;
01067   jimeu[35]= 41.97;  jimed[35]=29.11;
01068   jimeu[36]= 43.06;  jimed[36]=30.03;
01069   jimeu[37]= 44.14;  jimed[37]=30.94;
01070   jimeu[38]= 45.22;  jimed[38]=31.86;
01071   jimeu[39]= 46.30;  jimed[39]=32.78;
01072   jimeu[40]= 47.32;  jimed[40]=33.70;
01073   jimeu[41]= 48.46;  jimed[41]=34.62;
01074   jimeu[42]= 49.53;  jimed[42]=35.55;
01075   jimeu[43]= 50.61;  jimed[43]=36.47;
01076   jimeu[44]= 51.68;  jimed[44]=37.39;
01077   jimeu[45]= 52.76;  jimed[45]=38.32;
01078   jimeu[46]= 53.83;  jimed[46]=39.24;
01079   jimeu[47]= 54.90;  jimed[47]=40.17;
01080   jimeu[48]= 55.98;  jimed[48]=41.10;
01081   jimeu[49]= 57.05;  jimed[49]=42.02;
01082   jimeu[50]= 58.12;  jimed[50]=42.95;
01083 
01084   const Int_t n = TMath::Nint(y);
01085 
01086   if(n > 50){
01087     // Fallback to sqrt errors
01088     return TMath::Sqrt(n);
01089   }
01090 
01091   if(up) return jimeu[n] - n;
01092   return n - jimed[n];
01093 }

Double_t NuMatrixSpectrum::PoT ( void   )  const [inline]

Definition at line 237 of file NuMatrixSpectrum.h.

References NuMatrix::GetPOT().

00237 { return GetPOT(); }

void NuMatrixSpectrum::RebinForFit (  )  [virtual]

Definition at line 2220 of file NuMatrixSpectrum.cxx.

References NuUtilities::GenerateBins(), and RebinToArray().

Referenced by NuMMRunPRL::ComparePredWithData(), and NuMMRunNoChargeCut::ComparePredWithData().

02221 {
02222   double edges[] = {0,   10,  20, 30, 50, 200};
02223   double steps[] = {0.5, 1.0, 10, 20, 150};
02224   vector<Double_t> bins = NuUtilities::GenerateBins(5, edges, steps);
02225   RebinToArray(bins);
02226 }

void NuMatrixSpectrum::RebinForPlotAsFit (  )  [virtual]

Definition at line 2230 of file NuMatrixSpectrum.cxx.

References BinWidthNormalize(), CompressTopBins(), NuUtilities::GenerateBins(), and RebinToArray().

02231 {
02232   double edges[] = {0,   10,  20, 30, 50, 200};
02233   double steps[] = {0.5, 1.0, 10, 20, 150};
02234   vector<Double_t> bins = NuUtilities::GenerateBins(5, edges, steps);
02235   RebinToArray(bins);
02236   BinWidthNormalize();
02237   CompressTopBins();
02238 }

void NuMatrixSpectrum::RebinForPlots (  )  [virtual]

Definition at line 2241 of file NuMatrixSpectrum.cxx.

References BinWidthNormalize(), CompressTopBins(), NuUtilities::GenerateBins(), GenerateErrors(), RebinToArray(), and RemoveErrors().

02242 {
02243   double edges[] = {0,   10,  20, 30, 50, 200};
02244   double steps[] = {1.0, 2.0, 10, 20, 150};
02245   vector<Double_t> bins = NuUtilities::GenerateBins(5, edges, steps);
02246   RemoveErrors();
02247   GenerateErrors();
02248   RebinToArray(bins);
02249   BinWidthNormalize();
02250   CompressTopBins();
02251 }

virtual void NuMatrixSpectrum::RebinTo4GeV (  )  [inline, virtual]

Bins in 4Gev Jumps up to 48Gev, then one bin to 200Gev.

Definition at line 215 of file NuMatrixSpectrum.h.

References RebinToGeV().

00215 {RebinToGeV(4);}

void NuMatrixSpectrum::RebinToArray ( int  nbins,
const double  binedges[999] 
) [virtual]

Definition at line 2189 of file NuMatrixSpectrum.cxx.

References NuMatrix1D::fSpectrum, NuUtilities::RebinHistogram(), and ResetSpectrum().

02190 {
02191   TH1D* tmp = NuUtilities::RebinHistogram(fSpectrum, nbins, binedges);
02192   ResetSpectrum(*tmp);
02193   delete tmp;
02194 }

void NuMatrixSpectrum::RebinToArray ( std::vector< Double_t > &  bins  )  [virtual]

Definition at line 2181 of file NuMatrixSpectrum.cxx.

References NuMatrix1D::fSpectrum, NuUtilities::RebinHistogram(), and ResetSpectrum().

Referenced by RatioPlot::RatioPlot(), RebinForFit(), RebinForPlotAsFit(), RebinForPlots(), and RebinToGeV().

02182 {
02183   TH1D* tmp = NuUtilities::RebinHistogram(fSpectrum, bins);
02184   ResetSpectrum(*tmp);
02185   delete tmp;
02186 }

void NuMatrixSpectrum::RebinToGeV ( Double_t  binwidth  )  [virtual]

Rebins to arbitrary bins. This function will rebin to an arbitrary bin width, but only if the bin edges line up exactly. At the first non-aligning bin, the rest of the spectrum will be put into one bin.

Definition at line 2211 of file NuMatrixSpectrum.cxx.

References NuUtilities::GenerateBins(), and RebinToArray().

Referenced by RebinTo4GeV(), and RebinToHalfGeV().

02212 {
02213   double edges[] = {0, 200};
02214   double steps[] = {binwidth};
02215   vector<Double_t> bins = NuUtilities::GenerateBins(1, edges, steps);
02216   RebinToArray(bins);
02217 }

virtual void NuMatrixSpectrum::RebinToHalfGeV (  )  [inline, virtual]

Definition at line 212 of file NuMatrixSpectrum.h.

References RebinToGeV().

00212 {RebinToGeV(0.5);}

virtual void NuMatrixSpectrum::RebinToNMB (  )  [inline, virtual]
void NuMatrixSpectrum::RebinToScheme ( NuBinningScheme::NuBinningScheme_t  scheme  )  [virtual]

Definition at line 2203 of file NuMatrixSpectrum.cxx.

References NuMatrix1D::fSpectrum, NuUtilities::RebinHistogram(), and ResetSpectrum().

02204 {
02205   TH1D* tmp = NuUtilities::RebinHistogram(fSpectrum, scheme);
02206   ResetSpectrum(*tmp);
02207   delete tmp;
02208 }

void NuMatrixSpectrum::RebinToScheme ( int  scheme  )  [virtual]

Definition at line 2197 of file NuMatrixSpectrum.cxx.

Referenced by BlessedFD(), BlessedFD2010(), BlessedFD2014(), BlessedFD7e20(), BlessedFDRatio(), BlessedForNC(), BlessedND(), NuMMRunCPTSyst::ComparePredWithData(), NuStatistics::PredSpectrum(), and RebinToNMB().

02198 {
02199   RebinToScheme(static_cast<NuBinningScheme::NuBinningScheme_t>(scheme));
02200 }

virtual void NuMatrixSpectrum::RecoToTrue ( const TH2D *  correction  )  [inline, virtual]
void NuMatrixSpectrum::RemoveErrors (  )  [virtual]
void NuMatrixSpectrum::ResetPoT ( Double_t  pot  )  [inline]

Definition at line 238 of file NuMatrixSpectrum.h.

References NuMatrix::ResetPOT().

00238 { ResetPOT(pot); }

void NuMatrixSpectrum::ResetSpectrum ( TH1D &  spectrum  )  [virtual]
void NuMatrixSpectrum::ScaleToPot ( Double_t  pot  )  [inline]

Definition at line 239 of file NuMatrixSpectrum.h.

References NuMatrix1D::ScaleToPOT().

Referenced by NuFCRunInfo::BuildSampleWeights().

00239 { ScaleToPOT(pot); }

virtual void NuMatrixSpectrum::SetFillColor ( Color_t  color  )  [inline, virtual]

Definition at line 112 of file NuMatrixSpectrum.h.

References NuMatrix1D::fSpectrum.

Referenced by RatioPlot::Draw().

00112 {fSpectrum->SetFillColor(color);}

virtual void NuMatrixSpectrum::SetFillStyle ( Style_t  style  )  [inline, virtual]

Definition at line 113 of file NuMatrixSpectrum.h.

References NuMatrix1D::fSpectrum.

Referenced by RatioPlot::Draw().

00113 {fSpectrum->SetFillStyle(style);}

void NuMatrixSpectrum::SetFontAndSize ( int  textFont,
int  textSize 
) [virtual]

Definition at line 989 of file NuMatrixSpectrum.cxx.

References CenterTitles(), GetXaxis(), and GetYaxis().

00990 {
00991   GetYaxis()->SetLabelFont(textFont);
00992   GetYaxis()->SetLabelSize(textSize);
00993   GetXaxis()->SetTitleFont(textFont);
00994   GetXaxis()->SetTitleSize(textSize);
00995   GetXaxis()->SetTitleOffset(1);
00996   GetYaxis()->SetTitleFont(textFont);
00997   GetYaxis()->SetTitleSize(textSize);
00998   CenterTitles();
00999 }

virtual void NuMatrixSpectrum::SetLineColor ( Color_t  color  )  [inline, virtual]

Definition at line 106 of file NuMatrixSpectrum.h.

References NuMatrix1D::fSpectrum.

Referenced by RatioPlot::Draw().

00106 {fSpectrum->SetLineColor(color);}

virtual void NuMatrixSpectrum::SetLineStyle ( Style_t  style  )  [inline, virtual]

Definition at line 108 of file NuMatrixSpectrum.h.

References NuMatrix1D::fSpectrum.

00108 {fSpectrum->SetLineStyle(style);}

virtual void NuMatrixSpectrum::SetLineWidth ( Width_t  width  )  [inline, virtual]

Definition at line 107 of file NuMatrixSpectrum.h.

References NuMatrix1D::fSpectrum.

00107 {fSpectrum->SetLineWidth(width);}

virtual void NuMatrixSpectrum::SetMarkerColor ( Color_t  col  )  [inline, virtual]

Definition at line 109 of file NuMatrixSpectrum.h.

References NuMatrix1D::fSpectrum.

00109 {fSpectrum->SetMarkerColor(col);}

virtual void NuMatrixSpectrum::SetMarkerSize ( Size_t  size  )  [inline, virtual]

Definition at line 110 of file NuMatrixSpectrum.h.

References NuMatrix1D::fSpectrum.

00110 {fSpectrum->SetMarkerSize(size);}

virtual void NuMatrixSpectrum::SetMarkerStyle ( Style_t  sty  )  [inline, virtual]

Definition at line 111 of file NuMatrixSpectrum.h.

References NuMatrix1D::fSpectrum.

00111 {fSpectrum->SetMarkerStyle(sty);}

void NuMatrixSpectrum::SetName ( const char *  _name  ) 
virtual void NuMatrixSpectrum::SetRangeUser ( double  low,
double  high 
) [inline, virtual]

Definition at line 121 of file NuMatrixSpectrum.h.

References NuMatrix1D::fSpectrum.

Referenced by BlessedFD2010(), BlessedFD2014(), CutLastBin(), NCCompressX(), and NuBarCompressX().

00121 {fSpectrum->GetXaxis()->SetRangeUser(low, high);}

virtual void NuMatrixSpectrum::SetTitle ( const char *  title  )  [inline, virtual]
TH1D* NuMatrixSpectrum::Spectrum (  )  const [inline, virtual]

Returns a TH1 object representing the data the spectrum holds. Or zero.

Reimplemented from NuMatrix1D.

Definition at line 232 of file NuMatrixSpectrum.h.

References NuMatrix1D::fSpectrum.

Referenced by NuMMRunNC2010::ApplyCorrectionFactors(), NuABFitter::Archive(), NuFCFitter::Archive(), NuFCFitterNSINu::Archive(), NuFCFitterNSINubar::Archive(), NuFCFitterNSI::Archive(), NuFCRunInfo::BuildSampleWeights(), NuSterileRunFC::CalcNDDataMCRatio(), NuStatistics::ChisqCount(), NuStatistics::ChisqDOF(), NuStatistics::ChisqShape(), NuMMRunCCTutorial::ComparePredWithData(), NuSterileRunFC::ComparePredWithData(), NuMMRunTransSME::ComparePredWithData(), NuMMRunTransition::ComparePredWithData(), NuMMRunPRL::ComparePredWithData(), NuMMRunNoChargeCut::ComparePredWithData(), NuMMRunNC2010::ComparePredWithData(), NuMMRunLED::ComparePredWithData(), NuMMRunCPTSyst::ComparePredWithData(), NuStatistics::DataSpectrum(), Divide(), RatioPlot::Draw(), FluctuateMe(), NuFCExperiment::GenerateExperiment(), NuFCExperimentGenerator::GenerateFDSample(), NuFCExperimentFactory::GenerateNewExperiment(), NuFCExperimentFactoryNSI::GenerateNewExperiment(), NuMMRunTemplates::Go(), NuMMRunFCNSINubar::Init(), NuSterileRunFC::Init(), NuMMRunFCNSINu::Init(), NuMMRunFC::Init(), NuStatistics::KolmogorovShape(), NuMMRunNoChargeCut::MakeFDPred(), NuMMRunNC2010::MakeFDPred(), NuMMRunTransSME::MakeFDPred(), NuMMRunPRL::MakeFDPred(), NuMMRunFCNSINubar::MakeFDPred(), NuMMRunTransition::MakeFDPred(), NuMMRunLED::MakeFDPred(), NuMMRunNSI::MakeFDPred(), NuMMRunFCNSINu::MakeFDPred(), NuMMRunFC::MakeFDPred(), NuMMRunFC::MakeFDPredBackgrounds(), NuMMRunLED::MakeFDPredBackgrounds(), NuMMRunNC2010::MakeFDPredForSample(), NuMMRunTransSME::MakeFDPredNuBar(), NuMMRunTransition::MakeFDPredNuBar(), NuMMRunTransition::MakeFDPredNuMu(), NuMMRunTransSME::MakeFDPredNuMu(), NuMMRunNC2010::MakeFDTrueVsRecoPredForSample(), NuFCExperimentFactoryNSI::MakeSampler(), NuFCExperimentFactory::MakeSampler(), Multiply(), NuMatrix1D::NuMatrix1D(), NuMMRunNC2010::NuMMRunNC2010(), NuMMRunNSI::NuMMRunNSI(), NuMatrix1D::operator=(), NuUtilities::OscillateJesstogram(), NuStatistics::PredSpectrum(), NuMMRunNSINubar::SanityCheckSpecialWSFiles(), NuMMRunNSINu::SanityCheckSpecialWSFiles(), NuMMRunNDOsc::SanityCheckSpecialWSFiles(), NuMMRunCC2010New::SanityCheckSpecialWSFiles(), NuFCExperiment::SetId(), NuEZFitterNSI::SetPoT(), NuEZFitter::SetPoT(), TestExperimentGenerator::testAccessSummary(), NuMMRunNSINubar::TrueComponents(), NuMMRunFCNSINu::TrueComponents(), NuMMRunTransition::TrueComponents(), NuMMRunLED::TrueComponents(), NuMMRunFCNSINubar::TrueComponents(), NuMMRunTransSME::TrueComponents(), NuMMRunNSINu::TrueComponents(), NuMMRunNSI::TrueComponents(), NuMMRunFC::TrueComponents(), NuMMRunNSINu::WriteFDPredHistos(), NuMMRunNoChargeCut::WriteFDPredHistos(), NuMMRunCC2010::WriteFDPredHistos(), NuMMRunTransSME::WriteFDPredHistos(), NuMMRunCC2010New::WriteFDPredHistos(), NuMMRunPRL::WriteFDPredHistos(), NuMMRunFCNSINu::WriteFDPredHistos(), NuMMRunLED::WriteFDPredHistos(), NuMMRunFC::WriteFDPredHistos(), NuSterileRunFC::WriteFDPredHistos(), NuMMRunFCNSINubar::WriteFDPredHistos(), NuMMRunNC2010::WriteFDPredHistos(), NuMMRunTransition::WriteFDPredHistos(), NuMMRunNSINubar::WriteFDPredHistos(), NuMMRunNDOsc::WriteFDPredHistos(), NuMMRunNSI::WriteFDPredHistos(), NuMMRunCPT::WriteFDPredHistos(), NuMMRunCCTutorial::WriteFDPredHistos(), NuMMRunNSINubar::WriteToJess(), NuMMRunNSINu::WriteToJess(), NuMMRunNDOsc::WriteToJess(), and NuMMRunCC2010New::WriteToJess().

00232 {return fSpectrum;}

double NuMatrixSpectrum::threeFlavourWeight ( double  energy,
double  dm232,
double  t23,
double  dm221,
double  t12,
double  t13,
double  delta,
int  inu 
) [protected]

Definition at line 1494 of file NuMatrixSpectrum.cxx.

References Munits::km, NuOscProb::ThreeFlavourExactNuMuToNuElectron(), NuOscProb::ThreeFlavourExactNuMuToNuMu(), and NuOscProb::ThreeFlavourExactNuMuToNuTau().

Referenced by OscillateBasic_3flavour(), and OscillateHybrid_3flavour().

01495 {
01496   //cout<<dm232<<" "<<t23<<" "<<dm221<<" "<<t12<<" "<<t13<<" "<<delta<<endl;
01497   double prob;
01498   if(inu==14|inu==-14){
01499     prob = NuOscProbCalc::ThreeFlavourExactNuMuToNuMu(energy, dm232, t23, dm221, t12, t13, delta,735.0 * Munits::km, inu);
01500     //cout <<prob<<" "<< NuOscProbCalc::OscillationWeight(energy, dm232, 1)<<endl;
01501     //cout<<"NuMu"<<endl;
01502   }
01503   else if(inu==16|inu==-16){
01504     prob = NuOscProbCalc::ThreeFlavourExactNuMuToNuTau(energy, dm232, t23, dm221, t12, t13, delta,735.0 * Munits::km, inu);
01505     //cout<<"Tau"<<" "<<inu<<endl;
01506   }
01507   else{
01508     prob = NuOscProbCalc::ThreeFlavourExactNuMuToNuElectron(energy, dm232, t23, dm221, t12, t13, delta,735.0 * Munits::km, inu);
01509     //cout<<"Electron"<<endl;
01510   }
01511   return prob;
01512 }

virtual void NuMatrixSpectrum::TrueToReco ( const TH2D *  correction  )  [inline, virtual]

Definition at line 64 of file NuMatrixSpectrum.h.

References TrueToReco().

Referenced by NuMMRunTransSME::CacheExtrapolation(), NuMMRunLED::CacheExtrapolation(), NuMMRunFCNSINu::CacheExtrapolation(), NuMMRunNSI::CacheExtrapolation(), NuMMRunFCNSINubar::CacheExtrapolation(), NuMMRunTransition::CacheExtrapolation(), NuMMRunFC::CacheExtrapolation(), NuMMRunCC2010New::CalculateFDNCBackground(), NuMMRunNDOsc::CalculateFDNCBackground(), NuMMRunNSINubar::CalculateFDNCBackground(), NuMMRunNSINu::CalculateFDNCBackground(), NuMMRunTemplates::Go(), NuMMRunCCTutorial::MakeFDPred(), NuMMRunCC2010New::MakeFDPred(), NuMMRunNSINu::MakeFDPred(), NuMMRunNoChargeCut::MakeFDPred(), NuMMRunCPT::MakeFDPred(), NuMMRunCC2010::MakeFDPred(), NuMMRunTransSME::MakeFDPred(), NuMMRunCPTSyst::MakeFDPred(), NuMMRunPRL::MakeFDPred(), NuMMRunNDOsc::MakeFDPred(), NuMMRunFCNSINubar::MakeFDPred(), NuMMRunNSINubar::MakeFDPred(), NuMMRunLED::MakeFDPred(), NuMMRunNSI::MakeFDPred(), NuMMRunFCNSINu::MakeFDPred(), NuMMRunFC::MakeFDPred(), NuMMRunFC::MakeFDPredBackgrounds(), NuMMRunLED::MakeFDPredBackgrounds(), NuMMRunNSI::PreCalcWrongSign(), NuMMRunFC::PreCalcWrongSign(), NuMMRunLED::PreCalcWrongSign(), NuMMRunFCNSINu::PreCalcWrongSign(), NuMMRunFCNSINubar::PreCalcWrongSign(), TrueToReco(), NuMMRunNSINu::WriteFDPredHistos(), NuMMRunNoChargeCut::WriteFDPredHistos(), NuMMRunCC2010::WriteFDPredHistos(), NuMMRunTransSME::WriteFDPredHistos(), NuMMRunCC2010New::WriteFDPredHistos(), NuMMRunPRL::WriteFDPredHistos(), NuMMRunFCNSINu::WriteFDPredHistos(), NuMMRunLED::WriteFDPredHistos(), NuMMRunFC::WriteFDPredHistos(), NuMMRunFCNSINubar::WriteFDPredHistos(), NuMMRunTransition::WriteFDPredHistos(), NuMMRunNSINubar::WriteFDPredHistos(), NuMMRunNDOsc::WriteFDPredHistos(), NuMMRunNSI::WriteFDPredHistos(), NuMMRunCPT::WriteFDPredHistos(), and NuMMRunCCTutorial::WriteFDPredHistos().

00064 {TrueToReco(*correction);}

void NuMatrixSpectrum::UnoscillateND ( const double  dm2,
const double  theta23,
const double  dm221,
const double  dm243,
const double  theta12,
const double  theta13,
const double  theta14,
const double  theta24,
const double  theta34,
const double  delta1,
const double  delta2,
const double  delta3,
const double  baseline 
)

Definition at line 1892 of file NuMatrixSpectrum.cxx.

References NuOscProb::FourFlavourDisappearanceWeight(), and NuMatrix1D::fSpectrum.

Referenced by NuMMRunNDOsc::UnoscillateND().

01900 {
01901   for(int i=1;i<=fSpectrum->GetNbinsX();i++) {
01902     const Double_t energy = fSpectrum->GetBinCenter(i);
01903     const Double_t oscProb =
01904       NuOscProbCalc::FourFlavourDisappearanceWeight(energy,
01905                                                     dm2, theta23, dm221, dm243, theta12,
01906                                                     theta13, theta14,
01907                                                     theta24, theta34,
01908                                                     delta1, delta2, delta3,
01909                                                     baseline);
01910     fSpectrum->
01911       SetBinContent(i,fSpectrum->GetBinContent(i)/oscProb);
01912     fSpectrum->
01913       SetBinError(i,fSpectrum->GetBinError(i)/oscProb);
01914   }
01915 }

void NuMatrixSpectrum::UnoscillateNDAverage ( const double  dm2,
const double  theta23,
const double  dm221,
const double  dm243,
const double  theta12,
const double  theta13,
const double  theta14,
const double  theta24,
const double  theta34,
const double  delta1,
const double  delta2,
const double  delta3,
const double  baseline 
)

Definition at line 1859 of file NuMatrixSpectrum.cxx.

References count, NuOscProb::FourFlavourDisappearanceWeight(), and NuMatrix1D::fSpectrum.

01867 {
01868   for(int bin=1;bin<=fSpectrum->GetNbinsX();bin++) {
01869     Double_t oscProb=0.0;
01870     Double_t increment=0.001;
01871     Int_t count=0;
01872     for (Double_t energy = fSpectrum->GetBinLowEdge(bin)+increment/2.0;
01873          energy<fSpectrum->GetBinLowEdge(bin+1);
01874          energy+=increment){
01875       oscProb += NuOscProbCalc::FourFlavourDisappearanceWeight(energy,
01876                                                                dm2, theta23, dm221, dm243, theta12,
01877                                                                theta13, theta14,
01878                                                                theta24, theta34,
01879                                                                delta1, delta2, delta3,
01880                                                                baseline);
01881       ++count;
01882     }
01883     oscProb /= count;
01884     fSpectrum->
01885       SetBinContent(bin,fSpectrum->GetBinContent(bin)/oscProb);
01886     fSpectrum->
01887       SetBinError(bin,fSpectrum->GetBinError(bin)/oscProb);
01888   }
01889 }


Member Data Documentation

double NuMatrixSpectrum::compress = 5 [static]
bool NuMatrixSpectrum::fDoPoisson [protected]
double NuMatrixSpectrum::fgCachedDmsq = -123456789 [static, protected]

The value of dmsq that fgCachedOsc was generated at.

Reimplemented from NuMatrix1D.

Definition at line 259 of file NuMatrixSpectrum.h.

Referenced by FillOscCache().

The oscillation dip calculated at dmsq = fgCachedDmsq, sinsq = 1.

Reimplemented from NuMatrix1D.

Definition at line 261 of file NuMatrixSpectrum.h.

Referenced by FillOscCache(), InverseOscillate(), Oscillate(), and Oscillate_3flavour().

TArrayD NuMatrixSpectrum::fPoiDn [protected]

Definition at line 245 of file NuMatrixSpectrum.h.

Referenced by BinWidthNormalize(), CalcPoisson(), Divide(), and DrawPoisson().

TArrayD NuMatrixSpectrum::fPoiUp [protected]

Definition at line 244 of file NuMatrixSpectrum.h.

Referenced by BinWidthNormalize(), CalcPoisson(), Divide(), and DrawPoisson().

double NuMatrixSpectrum::xlimit = 10 [static]

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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1