NuMMRunTransition Class Reference

#include <NuMMRunTransition.h>

Inheritance diagram for NuMMRunTransition:

NuMMRunNuBar NuMMRun List of all members.

Public Member Functions

 NuMMRunTransition (NuMMHelperCPT *helper, NuMatrixSpectrum *ndNuData, NuMatrixSpectrum *ndBarData, double pot)
 NuMMRunTransition (NuMMHelperCPT *helper, NuMatrixSpectrum *ndNuData, NuMatrixSpectrum *ndBarData, NuMatrixSpectrum *fdNuData, NuMatrixSpectrum *fdBarData)
 ~NuMMRunTransition ()
Double_t ComparePredWithData (const NuMMParameters &pars)
pair< NuMatrixSpectrum, NuMatrixSpectrumMakeFDPred (const NuMMParameters &pars)
 Return a pair (NQ,PQ) of NuMatrixSpectra of the far detector prediction with oscillation parameters described in pars. Pure virtual.
std::vector< TH1D > WriteFDPredHistos (const NuMMParameters &pars) const
NuMatrixSpectrum TrueComponents (const NuMMParameters &pars, Sample_t s) const
 Return the individual true energy prediction of the far detector sub sample s with oscillation parameters described in pars. Default implementation just drops an error.
NuMatrixSpectrum TrueComponents (const NuMMParameters &pars, Sample_t s)
virtual NuMatrixSpectrumMakeFDPredNuMu (const NuMMParameters &pars)
 Get just the NuMu component of the prediction with oscillations parameters pars.
virtual NuMatrixSpectrumMakeFDPredNuBar (const NuMMParameters &pars)
 Get just the NuMuBar component of the prediction with oscillations parameters pars.

Private Member Functions

void CacheExtrapolation (const NuMMParameters &pars)
void ResetCache ()

Private Attributes

NuMatrixSpectrumPreCalcnuPrediction
NuMatrixSpectrumPreCalcbarPrediction
NuMatrixSpectrumPreCalcnuPredictionReco
NuMatrixSpectrumPreCalcbarPredictionReco
NuMatrixSpectrumPreCalcnuAppeared
NuMatrixSpectrumPreCalcbarAppeared
NuMatrixSpectrumPreCalcnuAppearedReco
NuMatrixSpectrumPreCalcbarAppearedReco
NuMatrixSpectrumPreCalcpotentialNuTaus
NuMatrixSpectrumPreCalcpotentialTauBars
NuMatrixSpectrumPreCalcpotentialNuTausReco
NuMatrixSpectrumPreCalcpotentialTauBarsReco
NuMatrixSpectrumPreCalcnuNCBackground
NuMatrixSpectrumPreCalcbarNCBackground
NuMatrixSpectrumPreCalcwrongSignNuMus
NuMatrixSpectrumPreCalcwrongSignNuBars
NuMatrixSpectrumPreCalcwrongSignNuMusReco
NuMatrixSpectrumPreCalcwrongSignNuBarsReco

Detailed Description

Definition at line 18 of file NuMMRunTransition.h.


Constructor & Destructor Documentation

NuMMRunTransition::NuMMRunTransition ( NuMMHelperCPT helper,
NuMatrixSpectrum ndNuData,
NuMatrixSpectrum ndBarData,
double  pot 
)

Definition at line 20 of file NuMMRunTransition.cxx.

00024   : NuMMRunNuBar()
00025 {
00026   fPredictNeutrinos = false;
00027   fPredictAntiNeutrinos = true;
00028 
00029   TString name = "hError";
00030   name += (counter++);
00031   TH1D hBlank(name, "Something Went Wrong", 10, 0, 30);
00032   
00033   fndNuData = ndNuData;
00034   fndBarData = ndBarData;
00035   fHelper = helper;
00036   
00037   ffdNuData = new NuMatrixSpectrum(hBlank, pot);
00038   ffdBarData = new NuMatrixSpectrum(hBlank, pot);
00039   
00040   
00041   // Blank out all the Precache variables
00042   PreCalcnuPrediction   = PreCalcbarPrediction      = 0;
00043   PreCalcnuAppeared     = PreCalcbarAppeared        = 0;
00044   PreCalcpotentialNuTaus= PreCalcpotentialTauBars   = 0;
00045   PreCalcnuNCBackground = PreCalcbarNCBackground    = 0;
00046   PreCalcwrongSignNuMus = PreCalcwrongSignNuBars    = 0;  
00047   
00048   PreCalcnuPredictionReco   = PreCalcbarPredictionReco      = 0;
00049   PreCalcnuAppearedReco     = PreCalcbarAppearedReco        = 0;
00050   PreCalcpotentialNuTausReco= PreCalcpotentialTauBarsReco   = 0;
00051   PreCalcwrongSignNuMusReco = PreCalcwrongSignNuBarsReco    = 0;  
00052   
00053 }

NuMMRunTransition::NuMMRunTransition ( NuMMHelperCPT helper,
NuMatrixSpectrum ndNuData,
NuMatrixSpectrum ndBarData,
NuMatrixSpectrum fdNuData,
NuMatrixSpectrum fdBarData 
)

Definition at line 56 of file NuMMRunTransition.cxx.

References NuMMRunNuBar::ffdBarData, NuMMRunNuBar::ffdNuData, NuMMRunNuBar::fHelper, NuMMRunNuBar::fndBarData, NuMMRunNuBar::fndNuData, NuMMRunNuBar::fPredictAntiNeutrinos, NuMMRunNuBar::fPredictNeutrinos, PreCalcbarAppeared, PreCalcbarAppearedReco, PreCalcbarNCBackground, PreCalcbarPrediction, PreCalcbarPredictionReco, PreCalcnuAppeared, PreCalcnuAppearedReco, PreCalcnuNCBackground, PreCalcnuPrediction, PreCalcnuPredictionReco, PreCalcpotentialNuTaus, PreCalcpotentialNuTausReco, PreCalcpotentialTauBars, PreCalcpotentialTauBarsReco, PreCalcwrongSignNuBars, PreCalcwrongSignNuBarsReco, PreCalcwrongSignNuMus, and PreCalcwrongSignNuMusReco.

00061   : NuMMRunNuBar()
00062 { 
00063   fPredictNeutrinos = false;
00064   fPredictAntiNeutrinos = true;
00065 
00066   fndNuData = ndNuData;
00067   fndBarData = ndBarData;
00068   ffdNuData = fdNuData;
00069   ffdBarData = fdBarData;
00070   fHelper = helper;
00071    
00072   
00073   // Blank out all the Precache variables
00074   PreCalcnuPrediction   = PreCalcbarPrediction      = 0;
00075   PreCalcnuAppeared     = PreCalcbarAppeared        = 0;
00076   PreCalcpotentialNuTaus= PreCalcpotentialTauBars   = 0;
00077   PreCalcnuNCBackground = PreCalcbarNCBackground    = 0;
00078   PreCalcwrongSignNuMus = PreCalcwrongSignNuBars    = 0;  
00079 
00080   PreCalcnuPredictionReco   = PreCalcbarPredictionReco      = 0;
00081   PreCalcnuAppearedReco     = PreCalcbarAppearedReco        = 0;
00082   PreCalcpotentialNuTausReco= PreCalcpotentialTauBarsReco   = 0;
00083   PreCalcwrongSignNuMusReco = PreCalcwrongSignNuBarsReco    = 0;  
00084   
00085 }

NuMMRunTransition::~NuMMRunTransition (  ) 

Definition at line 89 of file NuMMRunTransition.cxx.

References ResetCache().

00090 {
00091   ResetCache();
00092 }


Member Function Documentation

void NuMMRunTransition::CacheExtrapolation ( const NuMMParameters pars  )  [private]

Pre-calculate much of the extrapolation. Most of the matrix method extrapolation does not depend on the oscillation parameters. This includes lots of complicated matrix multiplications and histogram divisions. This function seperates out this code, and is called from the constructor (as everything it needs should exist with a validly called constructor)

Definition at line 142 of file NuMMRunTransition.cxx.

References NuMMHelperCPT::BarBeamMatrix(), NuMMHelperCPT::BarXSecGraph(), NuMatrixSpectrum::Divide(), NuMMParameters::Dm2(), NuMMParameters::Dm2Bar(), NuMMHelperCPT::DoTaus(), NuMatrixSpectrum::ExtrapolateNDToFD(), NuMMRunNuBar::fCached, NuMMHelperCPT::FDBarEfficiency(), NuMMHelperCPT::FDBarNCContamination(), NuMMHelperCPT::FDBarPurity(), NuMMHelperCPT::FDBarRecoVsTrue(), NuMMHelperCPT::FDNuEfficiency(), NuMMHelperCPT::FDNuNCContamination(), NuMMHelperCPT::FDNuPurity(), NuMMHelperCPT::FDNuRecoVsTrue(), NuMMHelperCPT::FDNuTauEfficiency(), NuMMHelperCPT::FDNuTauRecoVsTrue(), NuMMHelperCPT::FDTauBarEfficiency(), NuMMHelperCPT::FDTauBarRecoVsTrue(), NuMMHelperCPT::FDWrongSignBarEfficiency(), NuMMHelperCPT::FDWrongSignBarRecoVsTrue(), NuMMHelperCPT::FDWrongSignNuEfficiency(), NuMMHelperCPT::FDWrongSignNuRecoVsTrue(), NuMMRunNuBar::ffdBarData, NuMMRun::fFDFidMass, NuMMRunNuBar::ffdNuData, NuMMRunNuBar::fHelper, NuMMRunNuBar::fndBarData, NuMMRun::fNDFidMass, NuMMRunNuBar::fndNuData, NuMMRun::fQuietMode, NuMatrix::GetPOT(), NuMatrixSpectrum::InverseOscillate(), Msg::kInfo, MSG, NuMatrixSpectrum::Multiply(), NuMMHelperCPT::NDBarEfficiency(), NuMMHelperCPT::NDBarPurity(), NuMMHelperCPT::NDBarRecoVsTrue(), NuMMHelperCPT::NDNuEfficiency(), NuMMHelperCPT::NDNuPurity(), NuMMHelperCPT::NDNuRecoVsTrue(), NuMMHelperCPT::NuBeamMatrix(), NuMMHelperCPT::NuXSecGraph(), NuMatrixSpectrum::Oscillate(), PreCalcbarAppeared, PreCalcbarAppearedReco, PreCalcbarNCBackground, PreCalcbarPrediction, PreCalcbarPredictionReco, PreCalcnuAppeared, PreCalcnuAppearedReco, PreCalcnuNCBackground, PreCalcnuPrediction, PreCalcnuPredictionReco, PreCalcpotentialNuTaus, PreCalcpotentialNuTausReco, PreCalcpotentialTauBars, PreCalcpotentialTauBarsReco, PreCalcwrongSignNuBars, PreCalcwrongSignNuBarsReco, PreCalcwrongSignNuMus, PreCalcwrongSignNuMusReco, NuMatrixSpectrum::RecoToTrue(), ResetCache(), NuMatrix::ResetPOT(), NuMatrixSpectrum::SetName(), NuMMParameters::Sn2(), NuMMParameters::Sn2Bar(), NuMatrixSpectrum::TrueToReco(), NuMMHelperCPT::XSecGraphNuTaus(), and NuMMHelperCPT::XSecGraphTauBars().

Referenced by MakeFDPred(), MakeFDPredNuBar(), MakeFDPredNuMu(), and TrueComponents().

00143 {
00144   // Only cache once.
00145   if (fCached) return;
00146   
00147   ResetCache();
00148   
00149   if (!fQuietMode) {
00150     MSG("NuMMRunTransitions",Msg::kInfo) << "Pre-calculating static extrapolation variables..." << endl;
00151   }
00152   
00153   // Caching variables, to reduce the workload of each step of the fitter
00154   // Initialise these the way they would be before
00155   PreCalcnuPrediction = new NuMatrixSpectrum(*fndNuData);
00156   PreCalcbarPrediction = new NuMatrixSpectrum(*fndBarData);
00157   
00158   // Be lazy and just alias the pointers to references so can keep
00159   // the code the same
00160   NuMatrixSpectrum &nuPrediction = *PreCalcnuPrediction;
00161   NuMatrixSpectrum &barPrediction = *PreCalcbarPrediction;
00162 
00163   
00164   // Now we have prepared the extrapolation variables, calculate them
00165   // Get the neutrinos to the FD
00166   nuPrediction.Multiply(fHelper->NDNuPurity());
00167   nuPrediction.RecoToTrue(fHelper->NDNuRecoVsTrue());
00168   nuPrediction.Divide(fHelper->NDNuEfficiency());
00169   nuPrediction.Divide(fHelper->NuXSecGraph());
00170   nuPrediction.Divide(fndNuData->GetPOT());
00171   nuPrediction.Divide(fNDFidMass);
00172   nuPrediction.ExtrapolateNDToFD(fHelper->NuBeamMatrix());
00173   nuPrediction.Multiply(fFDFidMass);
00174   nuPrediction.Multiply(ffdNuData->GetPOT());
00175   // Reset the spectrum to the new PoT
00176   nuPrediction.ResetPOT(ffdNuData->GetPOT());
00177   
00178   //Get the antineutrinos to the FD
00179   barPrediction.Multiply(fHelper->NDBarPurity());
00180   barPrediction.RecoToTrue(fHelper->NDBarRecoVsTrue());
00181   barPrediction.Divide(fHelper->NDBarEfficiency());
00182   barPrediction.Divide(fHelper->BarXSecGraph());
00183   barPrediction.Divide(fndBarData->GetPOT());
00184   barPrediction.Divide(fNDFidMass);
00185   barPrediction.ExtrapolateNDToFD(fHelper->BarBeamMatrix());
00186   barPrediction.Multiply(fFDFidMass);
00187   barPrediction.Multiply(ffdBarData->GetPOT());
00188   // Reset the spectrum to the new PoT
00189   barPrediction.ResetPOT(ffdBarData->GetPOT());
00190   
00191   PreCalcpotentialNuTaus = new NuMatrixSpectrum(nuPrediction);
00192   PreCalcpotentialTauBars = new NuMatrixSpectrum(barPrediction);  
00193   // Create and link to the Tau components, before we include the
00194   // cross section in the predictions (tau Xsec is different)
00195   NuMatrixSpectrum &potentialNuTaus = *PreCalcpotentialNuTaus;
00196   NuMatrixSpectrum &potentialTauBars = *PreCalcpotentialTauBars;
00197   
00198   if (fHelper->DoTaus()) {
00199     //Get the taus (ignoring any wrong-sign taubars)
00200     potentialNuTaus.Multiply(fHelper->XSecGraphNuTaus());
00201     potentialNuTaus.Multiply(fHelper->FDNuTauEfficiency());
00202     potentialNuTaus.InverseOscillate(pars.Dm2(),pars.Sn2());
00203   
00204     //Get the taubars (ignoring any wrong-sign taus)
00205     potentialTauBars.Multiply(fHelper->XSecGraphTauBars());
00206     potentialTauBars.Multiply(fHelper->FDTauBarEfficiency());
00207     potentialTauBars.InverseOscillate(pars.Dm2Bar(),pars.Sn2Bar());
00208   }
00209   else {
00210     PreCalcpotentialNuTaus->Multiply(0.0);
00211     PreCalcpotentialTauBars->Multiply(0.0);
00212   }
00213   
00214   // Create and link to the appeared components, before we include the
00215   // cross section in the predictions (Xsec is different)
00216   PreCalcnuAppeared = new NuMatrixSpectrum(barPrediction);
00217   PreCalcbarAppeared = new NuMatrixSpectrum(nuPrediction);
00218   NuMatrixSpectrum &appearedNuMus = *PreCalcnuAppeared;
00219   NuMatrixSpectrum &appearedNuBars = *PreCalcbarAppeared;
00220   appearedNuMus.SetName("Appeared_NuMus");
00221   appearedNuBars.SetName("Appeared_NuMuBars");
00222   
00223   // Apply the appeared cross-sectinos, efficiencies, true to reco
00224   appearedNuMus.Multiply(fHelper->NuXSecGraph());
00225   appearedNuMus.InverseOscillate(pars.Dm2Bar(),pars.Sn2Bar());
00226   appearedNuMus.Multiply(fHelper->FDNuEfficiency());
00227 
00228   appearedNuBars.Multiply(fHelper->BarXSecGraph());
00229   appearedNuBars.InverseOscillate(pars.Dm2(),pars.Sn2());
00230   appearedNuBars.Multiply(fHelper->FDBarEfficiency());
00231   
00232   
00233   // Now do the main spectrum, xsecs
00234   nuPrediction.Multiply(fHelper->NuXSecGraph());
00235   barPrediction.Multiply(fHelper->BarXSecGraph());
00236   
00237   
00238   // Now build the NC Spectrum, after the cross section calculation!
00239   PreCalcnuNCBackground = new NuMatrixSpectrum(*PreCalcnuPrediction);;
00240   PreCalcbarNCBackground = new NuMatrixSpectrum(*PreCalcbarPrediction);
00241   NuMatrixSpectrum &nuNCBackground = *PreCalcnuNCBackground;
00242   NuMatrixSpectrum &barNCBackground = *PreCalcbarNCBackground;  
00243 
00244   
00245   //Get the neutrino NC background
00246   nuNCBackground.Multiply(fHelper->FDNuEfficiency());
00247   nuNCBackground.TrueToReco(fHelper->FDNuRecoVsTrue());
00248   nuNCBackground.Divide(fHelper->FDNuPurity());
00249   nuNCBackground.Multiply(fHelper->FDNuNCContamination());
00250   
00251   //Get the antineutrino NC background
00252   barNCBackground.Multiply(fHelper->FDBarEfficiency());
00253   barNCBackground.TrueToReco(fHelper->FDBarRecoVsTrue());
00254   barNCBackground.Divide(fHelper->FDBarPurity());
00255   barNCBackground.Multiply(fHelper->FDBarNCContamination());
00256   
00257   
00258   
00259   // Now build the wrong sign spectrum
00260   PreCalcwrongSignNuMus = new NuMatrixSpectrum(*PreCalcnuPrediction);
00261   PreCalcwrongSignNuBars = new NuMatrixSpectrum(*PreCalcbarPrediction);
00262   NuMatrixSpectrum &wrongSignNuMus = *PreCalcwrongSignNuMus;
00263   NuMatrixSpectrum &wrongSignNuBars = *PreCalcwrongSignNuBars;
00264 
00265   // Do the Neutrino background for the antineutrino spectrum
00266   wrongSignNuMus.Multiply(fHelper->FDWrongSignNuEfficiency());
00267   wrongSignNuMus.Oscillate(pars.Dm2(),pars.Sn2());
00268   
00269   // Do the Antineutrino background for the neutrino spectrum
00270   wrongSignNuBars.Multiply(fHelper->FDWrongSignBarEfficiency());
00271   wrongSignNuBars.Oscillate(pars.Dm2Bar(),pars.Sn2Bar());
00272   
00273   
00274   // Now apply oscillations, efficeicnies to the main spectrum
00275   nuPrediction.Oscillate(pars.Dm2(),pars.Sn2());
00276   nuPrediction.Multiply(fHelper->FDNuEfficiency());
00277   
00278   barPrediction.Oscillate(pars.Dm2Bar(),pars.Sn2Bar());
00279   barPrediction.Multiply(fHelper->FDBarEfficiency());
00280   
00281 
00282   // If we have precalculated the wrong sign oscillations,
00283   // then we need to recalculate them next time we are given
00284   // the oscilaltion parameters. Reset the flags used to
00285   // control this
00286   //fDoneWsNeutrinos = fDoneWsAntineutrinos = false;
00287 
00288   nuPrediction.SetName("NuMus");
00289   barPrediction.SetName("NuMuBars");
00290 
00291   potentialNuTaus.SetName("NuTaus");
00292   potentialTauBars.SetName("NuTauBars");
00293   
00294   wrongSignNuMus.SetName("WrongSign_NuMus");
00295   wrongSignNuBars.SetName("WrongSign_NuMuBars");
00296   
00297   nuNCBackground.SetName("NC_NuMus");
00298   barNCBackground.SetName("NC_NuMuBars");
00299   
00300   // Now perform all the Reco To True's for the Reco prediction
00301   PreCalcnuPredictionReco = new NuMatrixSpectrum(*PreCalcnuPrediction);
00302   PreCalcbarPredictionReco = new NuMatrixSpectrum(*PreCalcbarPrediction);
00303   PreCalcnuPredictionReco->TrueToReco(fHelper->FDNuRecoVsTrue());
00304   PreCalcbarPredictionReco->TrueToReco(fHelper->FDBarRecoVsTrue());
00305   
00306   if (fHelper->DoTaus()) {
00307     PreCalcpotentialNuTausReco = new NuMatrixSpectrum(*PreCalcpotentialNuTaus);
00308     PreCalcpotentialTauBarsReco = new NuMatrixSpectrum(*PreCalcpotentialTauBars);
00309     PreCalcpotentialNuTausReco->TrueToReco(fHelper->FDNuTauRecoVsTrue());
00310     PreCalcpotentialTauBarsReco->TrueToReco(fHelper->FDTauBarRecoVsTrue());    
00311   }
00312   
00313   PreCalcnuAppearedReco = new NuMatrixSpectrum(*PreCalcnuAppeared);
00314   PreCalcbarAppearedReco = new NuMatrixSpectrum(*PreCalcbarAppeared);
00315   PreCalcnuAppearedReco->TrueToReco(fHelper->FDNuRecoVsTrue());
00316   PreCalcbarAppearedReco->TrueToReco(fHelper->FDBarRecoVsTrue());
00317   
00318   PreCalcwrongSignNuMusReco = new NuMatrixSpectrum(*PreCalcwrongSignNuMus);
00319   PreCalcwrongSignNuBarsReco = new NuMatrixSpectrum(*PreCalcwrongSignNuBars);
00320   PreCalcwrongSignNuMusReco->TrueToReco(fHelper->FDWrongSignNuRecoVsTrue());    
00321   PreCalcwrongSignNuBarsReco->TrueToReco(fHelper->FDWrongSignBarRecoVsTrue());
00322   
00323   fCached = true;
00324     
00325   // Disable this output for now - this process should be fast anyway!
00326   if (!fQuietMode)
00327     cout << "Extrapolation variables cached..." << endl;
00328 }

Double_t NuMMRunTransition::ComparePredWithData ( const NuMMParameters pars  )  [virtual]

Implements NuMMRun.

Definition at line 863 of file NuMMRunTransition.cxx.

References NuMMRunNuBar::ffdBarData, NuMMRunNuBar::ffdNuData, NuMMRunNuBar::fPredictAntiNeutrinos, NuMMRunNuBar::fPredictNeutrinos, MakeFDPred(), MakeFDPredNuBar(), MakeFDPredNuMu(), NuMatrixSpectrum::Spectrum(), and NuMMRun::StatsLikelihood().

00864 {
00865   // Generate a prediction
00866   const pair<NuMatrixSpectrum,NuMatrixSpectrum> predictions =
00867     this->MakeFDPred(pars);
00868   Double_t like = 0;
00869   // Now, only count a likelihood for components we want - this is just
00870   // a constant offset, but should help speed things up a little.
00871   if (fPredictNeutrinos) {
00872     NuMatrixSpectrum* nuPrediction = MakeFDPredNuMu(pars);
00873     like += this->StatsLikelihood(nuPrediction->Spectrum(),
00874                                   ffdNuData->Spectrum());
00875     delete nuPrediction;
00876   }
00877   if (fPredictAntiNeutrinos) {
00878     NuMatrixSpectrum* barPrediction = MakeFDPredNuBar(pars);
00879     like += this->StatsLikelihood(barPrediction->Spectrum(),
00880                                   ffdBarData->Spectrum());
00881     delete barPrediction;
00882   }
00883   return like;
00884 }

pair< NuMatrixSpectrum, NuMatrixSpectrum > NuMMRunTransition::MakeFDPred ( const NuMMParameters pars  )  [virtual]

Return a pair (NQ,PQ) of NuMatrixSpectra of the far detector prediction with oscillation parameters described in pars. Pure virtual.

Implements NuMMRunNuBar.

Definition at line 586 of file NuMMRunTransition.cxx.

References NuMatrix1D::Add(), CacheExtrapolation(), NuMMParameters::Dm2(), NuMMParameters::Dm2Bar(), NuMMHelperCPT::DoTaus(), NuMMRunNuBar::fHelper, NuMMRunNuBar::fPredictAntiNeutrinos, NuMMRunNuBar::fPredictNeutrinos, NuMMRun::fQuietMode, NuMatrixSpectrum::Multiply(), PreCalcbarAppearedReco, PreCalcbarNCBackground, PreCalcbarPredictionReco, PreCalcnuAppearedReco, PreCalcnuNCBackground, PreCalcnuPredictionReco, PreCalcpotentialNuTausReco, PreCalcpotentialTauBarsReco, PreCalcwrongSignNuBarsReco, PreCalcwrongSignNuMusReco, NuMMParameters::Sn2(), NuMMParameters::Sn2Bar(), NuMatrixSpectrum::Spectrum(), and NuMMParameters::TransitionProb().

Referenced by ComparePredWithData().

00587 {
00588   if (!fQuietMode) {
00589     cout << "sn2: " << pars.Sn2() << "; dm2: " << pars.Dm2() 
00590      << "; sn2bar: " << pars.Sn2Bar() << "; dm2bar: " << pars.Dm2Bar()
00591      << "; alpha: " << pars.TransitionProb()
00592      << endl;
00593   }
00594   
00595   CacheExtrapolation(pars);
00596   
00598   // For all neutrinos
00599   
00600   // Make copies of the prepared extrapolation variables, so that
00601   // we can alter them locally with the oscillation parameters
00602   NuMatrixSpectrum nuPrediction(*PreCalcnuPredictionReco);
00603   NuMatrixSpectrum barPrediction(*PreCalcbarPredictionReco);
00604   
00605   NuMatrixSpectrum potentialNuTaus(*PreCalcpotentialNuTausReco);
00606   NuMatrixSpectrum potentialTauBars(*PreCalcpotentialTauBarsReco);
00607   
00608   NuMatrixSpectrum appearedNuMus(*PreCalcnuAppearedReco);
00609   NuMatrixSpectrum appearedNuBars(*PreCalcbarAppearedReco);
00610   
00611   NuMatrixSpectrum wrongSignNuMus(*PreCalcwrongSignNuMusReco);
00612   NuMatrixSpectrum wrongSignNuBars(*PreCalcwrongSignNuBarsReco);
00613   
00614   NuMatrixSpectrum nuNCBackground(*PreCalcnuNCBackground);
00615   NuMatrixSpectrum barNCBackground(*PreCalcbarNCBackground);  
00616   
00617   
00619   // Processes for neutrinos
00620   
00621   if (fPredictNeutrinos) {  
00622     // Apply alpha
00623     if (fHelper->DoTaus()) potentialNuTaus.Multiply(1.-pars.TransitionProb());
00624     appearedNuMus.Multiply(pars.TransitionProb());
00625     
00626     //Add everything together
00627     nuPrediction.Add(appearedNuMus);
00628     if (fHelper->DoTaus()) nuPrediction.Add(potentialNuTaus);    
00629     nuPrediction.Add(wrongSignNuBars);
00630     nuPrediction.Add(nuNCBackground);
00631   } else {
00632     // Scale the histogram to zero, so as not to confuse people
00633     // if they look at the spectrum with neutrinos turned off
00634     nuPrediction.Spectrum()->Scale(0);
00635   }
00636   
00638   // Processes for Antineutrinos
00639   
00640   if (fPredictAntiNeutrinos) {
00641     if (fHelper->DoTaus()) potentialTauBars.Multiply(1.-pars.TransitionProb());
00642     appearedNuBars.Multiply(pars.TransitionProb());
00643     
00644     //Add everything together
00645     barPrediction.Add(appearedNuBars);
00646     if (fHelper->DoTaus()) barPrediction.Add(potentialTauBars);
00647     barPrediction.Add(wrongSignNuMus);
00648     barPrediction.Add(barNCBackground);
00649   } else {
00650     // Scale the histogram to zero, so as not to confuse people
00651     barPrediction.Spectrum()->Scale(0);
00652   }
00653   
00654   pair<NuMatrixSpectrum,NuMatrixSpectrum> predictions(nuPrediction,barPrediction);
00655   return predictions;
00656 }

NuMatrixSpectrum * NuMMRunTransition::MakeFDPredNuBar ( const NuMMParameters pars  )  [virtual]

Get just the NuMuBar component of the prediction with oscillations parameters pars.

Reimplemented from NuMMRunNuBar.

Definition at line 707 of file NuMMRunTransition.cxx.

References NuMatrix1D::Add(), CacheExtrapolation(), NuMMParameters::Dm2(), NuMMParameters::Dm2Bar(), NuMMHelperCPT::DoTaus(), NuMMRunNuBar::fHelper, NuMMRunNuBar::fPredictAntiNeutrinos, NuMMRun::fQuietMode, NuMatrixSpectrum::Multiply(), PreCalcbarAppearedReco, PreCalcbarNCBackground, PreCalcbarPredictionReco, PreCalcpotentialTauBarsReco, PreCalcwrongSignNuMusReco, NuMMParameters::Sn2(), NuMMParameters::Sn2Bar(), NuMatrixSpectrum::Spectrum(), and NuMMParameters::TransitionProb().

Referenced by ComparePredWithData().

00708 {
00709   if (!fQuietMode) {
00710     cout << "sn2: " << pars.Sn2() << "; dm2: " << pars.Dm2() 
00711     << "; sn2bar: " << pars.Sn2Bar() << "; dm2bar: " << pars.Dm2Bar()
00712     << "; alpha: " << pars.TransitionProb()
00713     << endl;
00714   }
00715   
00716   CacheExtrapolation(pars);
00717   
00719   // For all neutrinos
00720   
00721   // Make copies of the prepared extrapolation variables, so that
00722   // we can alter them locally with the oscillation parameters
00723   NuMatrixSpectrum *barPrediction = new NuMatrixSpectrum(*PreCalcbarPredictionReco);
00724   
00725   NuMatrixSpectrum potentialTauBars(*PreCalcpotentialTauBarsReco);
00726   NuMatrixSpectrum appearedNuBars(*PreCalcbarAppearedReco);  
00727   NuMatrixSpectrum wrongSignNuMus(*PreCalcwrongSignNuMusReco);  
00728   NuMatrixSpectrum barNCBackground(*PreCalcbarNCBackground);  
00729   
00731   // Processes for Antineutrinos
00732   
00733   if (fPredictAntiNeutrinos) {
00734     if (fHelper->DoTaus()) potentialTauBars.Multiply(1.-pars.TransitionProb());
00735     appearedNuBars.Multiply(pars.TransitionProb());
00736     
00737     //Add everything together
00738     barPrediction->Add(appearedNuBars);
00739     if (fHelper->DoTaus()) barPrediction->Add(potentialTauBars);
00740     barPrediction->Add(wrongSignNuMus);
00741     barPrediction->Add(barNCBackground);
00742   } else {
00743     // Scale the histogram to zero, so as not to confuse people
00744     barPrediction->Spectrum()->Scale(0);
00745   }
00746 
00747   return barPrediction;
00748 }

NuMatrixSpectrum * NuMMRunTransition::MakeFDPredNuMu ( const NuMMParameters pars  )  [virtual]

Get just the NuMu component of the prediction with oscillations parameters pars.

Reimplemented from NuMMRunNuBar.

Definition at line 659 of file NuMMRunTransition.cxx.

References NuMatrix1D::Add(), CacheExtrapolation(), NuMMParameters::Dm2(), NuMMParameters::Dm2Bar(), NuMMHelperCPT::DoTaus(), NuMMRunNuBar::fHelper, NuMMRunNuBar::fPredictNeutrinos, NuMMRun::fQuietMode, NuMatrixSpectrum::Multiply(), PreCalcnuAppearedReco, PreCalcnuNCBackground, PreCalcnuPredictionReco, PreCalcpotentialNuTausReco, PreCalcwrongSignNuBarsReco, NuMMParameters::Sn2(), NuMMParameters::Sn2Bar(), NuMatrixSpectrum::Spectrum(), and NuMMParameters::TransitionProb().

Referenced by ComparePredWithData().

00660 {
00661   if (!fQuietMode) {
00662     cout << "sn2: " << pars.Sn2() << "; dm2: " << pars.Dm2() 
00663     << "; sn2bar: " << pars.Sn2Bar() << "; dm2bar: " << pars.Dm2Bar()
00664     << "; alpha: " << pars.TransitionProb()
00665     << endl;
00666   }
00667   
00668   CacheExtrapolation(pars);
00669   
00671   // For all neutrinos
00672   
00673   // Make copies of the prepared extrapolation variables, so that
00674   // we can alter them locally with the oscillation parameters
00675   NuMatrixSpectrum *nuPrediction = new NuMatrixSpectrum(*PreCalcnuPredictionReco);
00676   
00677   NuMatrixSpectrum potentialNuTaus(*PreCalcpotentialNuTausReco);  
00678   NuMatrixSpectrum appearedNuMus(*PreCalcnuAppearedReco);  
00679   NuMatrixSpectrum wrongSignNuBars(*PreCalcwrongSignNuBarsReco);  
00680   NuMatrixSpectrum nuNCBackground(*PreCalcnuNCBackground);
00681   
00682   
00684   // Processes for neutrinos
00685   
00686   if (fPredictNeutrinos) {  
00687     // Apply alpha
00688     if (fHelper->DoTaus()) potentialNuTaus.Multiply(1.-pars.TransitionProb());
00689     appearedNuMus.Multiply(pars.TransitionProb());
00690     
00691     //Add everything together
00692     nuPrediction->Add(appearedNuMus);
00693     if (fHelper->DoTaus()) nuPrediction->Add(potentialNuTaus);    
00694     nuPrediction->Add(wrongSignNuBars);
00695     nuPrediction->Add(nuNCBackground);
00696   } else {
00697     // Scale the histogram to zero, so as not to confuse people
00698     // if they look at the spectrum with neutrinos turned off
00699     nuPrediction->Spectrum()->Scale(0);
00700   }
00701   
00702   return nuPrediction;
00703 }

void NuMMRunTransition::ResetCache (  )  [private]

Definition at line 96 of file NuMMRunTransition.cxx.

References NuMMRunNuBar::fCached, PreCalcbarAppeared, PreCalcbarAppearedReco, PreCalcbarNCBackground, PreCalcbarPrediction, PreCalcbarPredictionReco, PreCalcnuAppeared, PreCalcnuAppearedReco, PreCalcnuNCBackground, PreCalcnuPrediction, PreCalcnuPredictionReco, PreCalcpotentialNuTaus, PreCalcpotentialNuTausReco, PreCalcpotentialTauBars, PreCalcpotentialTauBarsReco, PreCalcwrongSignNuBars, PreCalcwrongSignNuBarsReco, PreCalcwrongSignNuMus, and PreCalcwrongSignNuMusReco.

Referenced by CacheExtrapolation(), and ~NuMMRunTransition().

00097 {
00098   // delete the precalculated MM spectra we previously created
00099   if (PreCalcnuPrediction)    delete PreCalcnuPrediction;
00100   if (PreCalcbarPrediction)   delete PreCalcbarPrediction;
00101   
00102   if (PreCalcnuAppeared)      delete PreCalcnuAppeared;
00103   if (PreCalcbarAppeared)     delete PreCalcbarAppeared; 
00104   
00105   if (PreCalcpotentialNuTaus) delete PreCalcpotentialNuTaus; 
00106   if (PreCalcpotentialTauBars)delete PreCalcpotentialTauBars; 
00107   
00108   if (PreCalcnuNCBackground)  delete PreCalcnuNCBackground; 
00109   if (PreCalcbarNCBackground) delete PreCalcbarNCBackground; 
00110   
00111   if (PreCalcwrongSignNuMus)  delete PreCalcwrongSignNuMus; 
00112   if (PreCalcwrongSignNuBars) delete PreCalcwrongSignNuBars; 
00113   
00114   if (PreCalcnuPredictionReco)    delete PreCalcnuPredictionReco;
00115   if (PreCalcbarPredictionReco)   delete PreCalcbarPredictionReco;
00116   
00117   if (PreCalcnuAppearedReco)      delete PreCalcnuAppearedReco;
00118   if (PreCalcbarAppearedReco)     delete PreCalcbarAppearedReco;
00119   
00120   if (PreCalcpotentialNuTausReco) delete PreCalcpotentialNuTausReco; 
00121   if (PreCalcpotentialTauBarsReco)delete PreCalcpotentialTauBarsReco; 
00122   
00123   if (PreCalcwrongSignNuMusReco)  delete PreCalcwrongSignNuMusReco; 
00124   if (PreCalcwrongSignNuBarsReco) delete PreCalcwrongSignNuBarsReco; 
00125   
00126   PreCalcnuPrediction   = PreCalcbarPrediction      = 0;
00127   PreCalcnuAppeared     = PreCalcbarAppeared        = 0;
00128   PreCalcpotentialNuTaus= PreCalcpotentialTauBars   = 0;
00129   PreCalcnuNCBackground = PreCalcbarNCBackground    = 0;
00130   PreCalcwrongSignNuMus = PreCalcwrongSignNuBars    = 0;  
00131   
00132   PreCalcnuPredictionReco   = PreCalcbarPredictionReco      = 0;
00133   PreCalcnuAppearedReco     = PreCalcbarAppearedReco        = 0;
00134   PreCalcpotentialNuTausReco= PreCalcpotentialTauBarsReco   = 0;
00135   PreCalcwrongSignNuMusReco = PreCalcwrongSignNuBarsReco    = 0; 
00136   
00137   fCached = false;
00138 }

NuMatrixSpectrum NuMMRunTransition::TrueComponents ( const NuMMParameters pars,
Sample_t  s 
)

Definition at line 753 of file NuMMRunTransition.cxx.

References CacheExtrapolation(), and TrueComponents().

00754 {
00755   CacheExtrapolation(pars);
00756   
00757   // Return the const version
00758   return static_cast<const NuMMRunTransition *>(this)->TrueComponents(pars, s);
00759 }

NuMatrixSpectrum NuMMRunTransition::TrueComponents ( const NuMMParameters pars,
Sample_t  s 
) const [virtual]

Return the individual true energy prediction of the far detector sub sample s with oscillation parameters described in pars. Default implementation just drops an error.

Reimplemented from NuMMRun.

Definition at line 762 of file NuMMRunTransition.cxx.

References NuMMParameters::Dm2(), NuMMParameters::Dm2Bar(), NuMMRunNuBar::fCached, NuMMRunNuBar::fPredictAntiNeutrinos, NuMMRunNuBar::fPredictNeutrinos, NuMMRun::fQuietMode, Sample::kAppearedNQ, Sample::kAppearedPQ, Msg::kError, Sample::kNCNQ, Sample::kNCPQ, Sample::kSignalNQ, Sample::kSignalPQ, Sample::kTauNQ, Sample::kTauPQ, Msg::kWarning, Sample::kWrongSignNQ, Sample::kWrongSignPQ, MSG, NuMatrixSpectrum::Multiply(), PreCalcbarAppeared, PreCalcbarNCBackground, PreCalcbarPrediction, PreCalcnuAppeared, PreCalcnuNCBackground, PreCalcnuPrediction, PreCalcpotentialNuTaus, PreCalcpotentialTauBars, PreCalcwrongSignNuBars, PreCalcwrongSignNuMus, NuMatrixSpectrum::SetName(), NuMMParameters::Sn2(), NuMMParameters::Sn2Bar(), NuMatrixSpectrum::Spectrum(), and NuMMParameters::TransitionProb().

Referenced by TrueComponents().

00763 {
00764   if (!fQuietMode) {
00765     cout << "sn2: " << pars.Sn2() << "; dm2: " << pars.Dm2() 
00766     << "; sn2bar: " << pars.Sn2Bar() << "; dm2bar: " << pars.Dm2Bar()
00767     << "; alpha: " << pars.TransitionProb()
00768     << endl;
00769   }
00770   
00771   // Request NQ spectrum, but no NuBar Predictions OR
00772   // Request PQ spectrum, but no NuMu Predictions
00773   if ( (s < 0 && !fPredictNeutrinos) || 
00774        (s > 0 && !fPredictAntiNeutrinos) ) {
00775     NuMatrixSpectrum blank(*PreCalcnuPrediction);
00776     blank.SetName("Blank");
00777     blank.Spectrum()->Scale(0);
00778     return blank;
00779   }
00780   
00781   if (!fCached) {
00782     // CacheExtrapolation(pars);
00783     MSG("NuMMRunTransition",Msg::kError) << "Calling TrueComponents without previously caching the extrapolation" << endl;
00784     assert(fCached);
00785   }
00786   
00787 
00788   if (s == kSignalPQ) {
00789     if (!fQuietMode) cout << "Getting kSignalPQ" << endl;
00790     NuMatrixSpectrum barPrediction(*PreCalcbarPrediction);
00791     if (!fQuietMode) cout << "Returning kSignalPQ" << endl;
00792     return barPrediction;
00793   }
00794   else if (s == kSignalNQ) {
00795     if (!fQuietMode) cout << "Getting kSignalNQ" << endl;
00796     NuMatrixSpectrum nuPrediction(*PreCalcnuPrediction);  
00797     if (!fQuietMode) cout << "Returning kSignalNQ" << endl;
00798     return nuPrediction;
00799   }
00800   else if (s == kWrongSignPQ) {
00801     if (!fQuietMode) cout << "Getting kWrongSignPQ" << endl;
00802     NuMatrixSpectrum wrongSignNuMus(*PreCalcwrongSignNuMus);
00803     if (!fQuietMode) cout << "Returning kWrongSignPQ" << endl;
00804     return wrongSignNuMus;
00805   }
00806   else if (s == kWrongSignNQ) {
00807     if (!fQuietMode) cout << "Getting kWrongSignNQ" << endl;
00808     NuMatrixSpectrum wrongSignNuBars(*PreCalcwrongSignNuBars);
00809     if (!fQuietMode) cout << "Returning kWrongSignNQ" << endl;
00810     return wrongSignNuBars;
00811   }  
00812   else if (s == kNCPQ) {
00813     if (!fQuietMode) cout << "Getting kNCPQ" << endl;
00814     NuMatrixSpectrum barNCBackground(*PreCalcbarNCBackground);
00815     if (!fQuietMode) cout << "Returning kNCPQ" << endl;
00816     return barNCBackground;
00817   }
00818   else if (s == kNCNQ) {
00819     if (!fQuietMode) cout << "Getting kNCNQ" << endl;
00820     NuMatrixSpectrum nuNCBackground(*PreCalcnuNCBackground);
00821     if (!fQuietMode) cout << "Returning kNCNQ" << endl;
00822     return nuNCBackground;
00823   }
00824   else if (s == kTauPQ) {
00825     if (!fQuietMode) cout << "Getting kTauPQ" << endl;
00826     NuMatrixSpectrum potentialTauBars(*PreCalcpotentialTauBars);
00827     potentialTauBars.Multiply(1.-pars.TransitionProb());
00828     if (!fQuietMode) cout << "Returning kTauPQ" << endl;
00829     return potentialTauBars;
00830   }
00831   else if (s == kTauNQ) {
00832     if (!fQuietMode) cout << "Getting kTauNQ" << endl;
00833     NuMatrixSpectrum potentialNuTaus(*PreCalcpotentialNuTaus);
00834     potentialNuTaus.Multiply(1.-pars.TransitionProb());
00835     if (!fQuietMode) cout << "Returning kTauNQ" << endl;
00836     return potentialNuTaus;
00837   }
00838   else if (s == kAppearedPQ) {
00839     if (!fQuietMode) cout << "Getting kAppearedPQ" << endl;
00840     NuMatrixSpectrum appearedNuBars(*PreCalcbarAppeared);
00841     appearedNuBars.Multiply(pars.TransitionProb());
00842     if (!fQuietMode) cout << "Returning kAppearedPQ" << endl;
00843     return appearedNuBars;
00844   }
00845   else if (s == kAppearedNQ) {
00846     if (!fQuietMode) cout << "Getting kAppearedNQ" << endl;
00847     NuMatrixSpectrum appearedNuMus(*PreCalcnuAppeared);
00848     appearedNuMus.Multiply(pars.TransitionProb());
00849     if (!fQuietMode) cout << "Returning kAppearedNQ" << endl;
00850     return appearedNuMus;
00851   }
00852   else {
00853     MSG("NuMMRunTransitions",Msg::kWarning) << "Requested unknown prediction #" << s << ", returning blank." << endl;
00854     NuMatrixSpectrum blank(*PreCalcnuPrediction);
00855     blank.SetName("Blank");
00856     blank.Spectrum()->Scale(0);
00857     return blank;
00858   }
00859 }

std::vector< TH1D > NuMMRunTransition::WriteFDPredHistos ( const NuMMParameters pars  )  const [virtual]

Implements NuMMRun.

Definition at line 333 of file NuMMRunTransition.cxx.

References NuMatrix1D::Add(), NuMMHelperCPT::BarBeamMatrix(), NuMMHelperCPT::BarXSecGraph(), NuMatrixSpectrum::Divide(), NuMMParameters::Dm2(), NuMMParameters::Dm2Bar(), NuMMHelperCPT::DoTaus(), NuMatrixSpectrum::ExtrapolateNDToFD(), NuMMHelperCPT::FDBarEfficiency(), NuMMHelperCPT::FDBarNCContamination(), NuMMHelperCPT::FDBarPurity(), NuMMHelperCPT::FDBarRecoVsTrue(), NuMMHelperCPT::FDNuEfficiency(), NuMMHelperCPT::FDNuNCContamination(), NuMMHelperCPT::FDNuPurity(), NuMMHelperCPT::FDNuRecoVsTrue(), NuMMHelperCPT::FDNuTauEfficiency(), NuMMHelperCPT::FDNuTauRecoVsTrue(), NuMMHelperCPT::FDTauBarEfficiency(), NuMMHelperCPT::FDTauBarRecoVsTrue(), NuMMHelperCPT::FDWrongSignBarEfficiency(), NuMMHelperCPT::FDWrongSignBarRecoVsTrue(), NuMMHelperCPT::FDWrongSignNuEfficiency(), NuMMHelperCPT::FDWrongSignNuRecoVsTrue(), NuMMRunNuBar::ffdBarData, NuMMRun::fFDFidMass, NuMMRunNuBar::ffdNuData, NuMMRunNuBar::fHelper, NuMMRunNuBar::fndBarData, NuMMRun::fNDFidMass, NuMMRunNuBar::fndNuData, NuMatrix::GetPOT(), NuMatrixSpectrum::InverseOscillate(), NuMatrixSpectrum::Multiply(), NuMMHelperCPT::NDBarEfficiency(), NuMMHelperCPT::NDBarPurity(), NuMMHelperCPT::NDBarRecoVsTrue(), NuMMHelperCPT::NDNuEfficiency(), NuMMHelperCPT::NDNuPurity(), NuMMHelperCPT::NDNuRecoVsTrue(), NuMMHelperCPT::NuBeamMatrix(), NuMMHelperCPT::NuXSecGraph(), NuMatrixSpectrum::Oscillate(), NuMatrixSpectrum::RecoToTrue(), NuMMParameters::Sn2(), NuMMParameters::Sn2Bar(), NuMatrixSpectrum::Spectrum(), NuMMParameters::TransitionProb(), NuMatrixSpectrum::TrueToReco(), NuMMHelperCPT::XSecGraphNuTaus(), and NuMMHelperCPT::XSecGraphTauBars().

00334 {
00335   //Set up a vector to push the histograms into.
00336   vector<TH1D> vHistos;
00337 
00338   //Put the ND data in the vector:
00339   TH1D hNDNuData(*(fndNuData->Spectrum()));
00340   hNDNuData.SetName("ndDataNQ");
00341   hNDNuData.SetTitle("ndDataNQ");
00342   vHistos.push_back(*(new TH1D(hNDNuData)));
00343   TH1D hNDBarData(*(fndBarData->Spectrum()));
00344   hNDBarData.SetName("ndDataPQ");
00345   hNDBarData.SetTitle("ndDataPQ");
00346   vHistos.push_back(*(new TH1D(hNDBarData)));
00347 
00348 //cout << "sn2: " << pars.Sn2() << "; dm2: " << pars.Dm2() 
00349 //     << "; sn2bar: " << pars.Sn2Bar() << "; dm2bar: " << pars.Dm2Bar()
00350 //     << "; Prob: " << pars.TransitionProb()
00351 //     << endl;
00352   //Get the neutrinos to the FD
00353   NuMatrixSpectrum nuPrediction(*fndNuData);
00354   nuPrediction.Multiply(fHelper->NDNuPurity());
00355   nuPrediction.RecoToTrue(fHelper->NDNuRecoVsTrue());
00356   nuPrediction.Divide(fHelper->NDNuEfficiency());
00357   nuPrediction.Divide(fHelper->NuXSecGraph());
00358   nuPrediction.Divide(fndNuData->GetPOT());
00359   nuPrediction.Divide(fNDFidMass);
00360   nuPrediction.ExtrapolateNDToFD(fHelper->NuBeamMatrix());
00361   nuPrediction.Multiply(fFDFidMass);
00362   nuPrediction.Multiply(ffdNuData->GetPOT());
00363 
00364   //Get the antineutrinos to the FD
00365   NuMatrixSpectrum barPrediction(*fndBarData);
00366   barPrediction.Multiply(fHelper->NDBarPurity());
00367   barPrediction.RecoToTrue(fHelper->NDBarRecoVsTrue());
00368   barPrediction.Divide(fHelper->NDBarEfficiency());
00369   barPrediction.Divide(fHelper->BarXSecGraph());
00370   barPrediction.Divide(fndBarData->GetPOT());
00371   barPrediction.Divide(fNDFidMass);
00372   barPrediction.ExtrapolateNDToFD(fHelper->BarBeamMatrix());
00373   barPrediction.Multiply(fFDFidMass);
00374   barPrediction.Multiply(ffdBarData->GetPOT());
00375 
00376   NuMatrixSpectrum potentialNuTaus(nuPrediction);
00377   NuMatrixSpectrum potentialTauBars(barPrediction);
00378   if (fHelper->DoTaus())  {
00379     //Get the taus (ignoring any wrong-sign taubars)
00380     potentialNuTaus.Multiply(fHelper->XSecGraphNuTaus());
00381     potentialNuTaus.Multiply(fHelper->FDNuTauEfficiency());
00382     potentialNuTaus.InverseOscillate(pars.Dm2(),pars.Sn2());
00383     potentialNuTaus.TrueToReco(fHelper->FDNuTauRecoVsTrue());
00384     //Get the taubars (ignoring any wrong-sign taus)
00385     potentialTauBars.Multiply(fHelper->XSecGraphTauBars());
00386     potentialTauBars.Multiply(fHelper->FDTauBarEfficiency());
00387     potentialTauBars.InverseOscillate(pars.Dm2Bar(),pars.Sn2Bar());
00388     potentialTauBars.TrueToReco(fHelper->FDTauBarRecoVsTrue());
00389   }
00390   else {
00391     potentialNuTaus.Multiply(0.0);
00392     potentialTauBars.Multiply(0.0);
00393   }
00394   
00395   //Get the transitioned neutrinos (they're now antineutrinos)
00396   NuMatrixSpectrum appearedNuBars(nuPrediction);
00397   TH1D hRawAppearPQ(*(appearedNuBars.Spectrum()));
00398   hRawAppearPQ.SetName("hRawAppearPQ");
00399   vHistos.push_back(hRawAppearPQ); 
00400   
00401   appearedNuBars.Multiply(fHelper->BarXSecGraph());
00402   TH1D hTrueEffAppearPQ(*(appearedNuBars.Spectrum()));
00403   hTrueEffAppearPQ.SetName("hTrueEffAppearPQ");
00404   vHistos.push_back(hTrueEffAppearPQ); 
00405   
00406   appearedNuBars.Multiply(fHelper->FDBarEfficiency());
00407   TH1D hTrueAppearPQ(*(appearedNuBars.Spectrum()));
00408   hTrueAppearPQ.SetName("hTrueAppearPQ");
00409   vHistos.push_back(hTrueAppearPQ); 
00410   
00411   appearedNuBars.InverseOscillate(pars.Dm2(),pars.Sn2());
00412   appearedNuBars.Multiply(pars.TransitionProb());
00413   TH1D hTrueTransitionPQ(*(appearedNuBars.Spectrum()));
00414   hTrueTransitionPQ.SetName("hTrueTransitionPQ");
00415   vHistos.push_back(hTrueTransitionPQ); 
00416     
00417   appearedNuBars.TrueToReco(fHelper->FDBarRecoVsTrue());
00418   TH1D hRecoAppearPQ(*(appearedNuBars.Spectrum()));
00419   hRecoAppearPQ.SetName("hRecoAppearPQ");
00420   vHistos.push_back(hRecoAppearPQ);
00421   
00422   //Get the transitioned antineutrinos (they're now neutrinos)
00423   NuMatrixSpectrum appearedNuMus(barPrediction);
00424   TH1D hRawAppearNQ(*(appearedNuMus.Spectrum()));
00425   hRawAppearNQ.SetName("hRawAppearNQ");
00426   vHistos.push_back(hRawAppearNQ); 
00427   
00428   appearedNuMus.Multiply(fHelper->NuXSecGraph());
00429   TH1D hTrueEffAppearNQ(*(appearedNuMus.Spectrum()));
00430   hTrueEffAppearNQ.SetName("hTrueEffAppearNQ");
00431   vHistos.push_back(hTrueEffAppearNQ); 
00432   
00433   appearedNuMus.Multiply(fHelper->FDNuEfficiency());
00434   TH1D hTrueAppearNQ(*(appearedNuMus.Spectrum()));
00435   hTrueAppearNQ.SetName("hTrueAppearNQ");
00436   vHistos.push_back(hTrueAppearNQ); 
00437   
00438   appearedNuMus.InverseOscillate(pars.Dm2(),pars.Sn2());
00439   appearedNuMus.Multiply(pars.TransitionProb());
00440   TH1D hTrueTransitionNQ(*(appearedNuMus.Spectrum()));
00441   hTrueTransitionNQ.SetName("hTrueTransitionNQ");
00442   vHistos.push_back(hTrueTransitionNQ); 
00443   
00444   appearedNuMus.TrueToReco(fHelper->FDNuRecoVsTrue());
00445   TH1D hRecoAppearNQ(*(appearedNuMus.Spectrum()));
00446   hRecoAppearNQ.SetName("hRecoAppearNQ");
00447   vHistos.push_back(hRecoAppearNQ);
00448   
00449 
00450   //Cross sections
00451   nuPrediction.Multiply(fHelper->NuXSecGraph());
00452   barPrediction.Multiply(fHelper->BarXSecGraph());
00453   
00454   // True NuMus (flux x sigma)
00455   TH1D hTrueNuMus(*(nuPrediction.Spectrum()));
00456   hTrueNuMus.SetName("hTrueNuMus");
00457   vHistos.push_back(hTrueNuMus); 
00458   
00459   // True NuBars (flux x sigma)
00460   TH1D hTrueNuBars(*(barPrediction.Spectrum()));
00461   hTrueNuBars.SetName("hTrueNuBars");
00462   vHistos.push_back(hTrueNuBars); 
00463 
00464   //Get the neutrino NC background
00465   NuMatrixSpectrum nuNCBackground(nuPrediction);
00466   nuNCBackground.Multiply(fHelper->FDNuEfficiency());
00467   nuNCBackground.TrueToReco(fHelper->FDNuRecoVsTrue());
00468   nuNCBackground.Divide(fHelper->FDNuPurity());
00469   nuNCBackground.Multiply(fHelper->FDNuNCContamination());
00470   
00471   //Get the antineutrino NC background
00472   NuMatrixSpectrum barNCBackground(barPrediction);
00473   barNCBackground.Multiply(fHelper->FDBarEfficiency());
00474   barNCBackground.TrueToReco(fHelper->FDBarRecoVsTrue());
00475   barNCBackground.Divide(fHelper->FDBarPurity());
00476   barNCBackground.Multiply(fHelper->FDBarNCContamination());
00477   
00478   //Get the wrong-sign neutrino background for the antineutrino
00479   //prediction
00480   NuMatrixSpectrum wrongSignNuMus(nuPrediction);
00481   wrongSignNuMus.Multiply(fHelper->FDWrongSignNuEfficiency());
00482   wrongSignNuMus.Oscillate(pars.Dm2(),pars.Sn2());
00483   
00484   //Get the wrong-sign antineutrino background for the neutrino
00485   //prediction
00486   NuMatrixSpectrum wrongSignNuBars(barPrediction);
00487   wrongSignNuBars.Multiply(fHelper->FDWrongSignBarEfficiency());
00488   wrongSignNuBars.Oscillate(pars.Dm2Bar(),pars.Sn2Bar());  
00489 
00490 
00491   TH1D hFDWrongSignPQ(*(wrongSignNuBars.Spectrum()));
00492   hFDWrongSignPQ.SetName("fdWrongSignPQ");
00493   vHistos.push_back(hFDWrongSignPQ);
00494 
00495   TH1D hFDWrongSignNQ(*(wrongSignNuMus.Spectrum()));
00496   hFDWrongSignNQ.SetName("fdWrongSignNQ");
00497   vHistos.push_back(hFDWrongSignNQ);
00498 
00499   // Do the truetoreco seperately so that we can write out the histos first
00500   wrongSignNuBars.TrueToReco(fHelper->FDWrongSignBarRecoVsTrue());
00501   wrongSignNuMus.TrueToReco(fHelper->FDWrongSignNuRecoVsTrue()); 
00502 
00503   //Oscillations
00504   nuPrediction.Oscillate(pars.Dm2(),pars.Sn2());
00505   barPrediction.Oscillate(pars.Dm2Bar(),pars.Sn2Bar());
00506   //Efficiencies
00507   nuPrediction.Multiply(fHelper->FDNuEfficiency());
00508   barPrediction.Multiply(fHelper->FDBarEfficiency());
00509 
00510   //True to reco
00511   nuPrediction.TrueToReco(fHelper->FDNuRecoVsTrue());
00512   barPrediction.TrueToReco(fHelper->FDBarRecoVsTrue());
00513   
00514   // Dump out the prediction spectrum before adding in the backgrounds
00515   TH1D hFDNoBackNQ(*(nuPrediction.Spectrum()));
00516   hFDNoBackNQ.SetName("fdBasePredictionNQ");
00517   vHistos.push_back(hFDNoBackNQ);
00518   
00519   TH1D hFDNoBackPQ(*(barPrediction.Spectrum()));
00520   hFDNoBackPQ.SetName("fdBasePredictionPQ");
00521   vHistos.push_back(hFDNoBackPQ);
00522   
00523   //Add in backgrounds
00524   nuPrediction.Add(wrongSignNuBars);
00525   barPrediction.Add(wrongSignNuMus);
00526   nuPrediction.Add(nuNCBackground);
00527   if (fHelper->DoTaus()) nuPrediction.Add(potentialNuTaus);
00528   barPrediction.Add(barNCBackground);
00529   if (fHelper->DoTaus()) barPrediction.Add(potentialTauBars);
00530 
00531   
00532   TH1D hFDPredictionNoTransNQ(*(nuPrediction.Spectrum()));
00533   hFDPredictionNoTransNQ.SetName("fdPredictionNoTransNQ");
00534   vHistos.push_back(hFDPredictionNoTransNQ);
00535   
00536   TH1D hFDPredictionNoTransPQ(*(barPrediction.Spectrum()));
00537   hFDPredictionNoTransPQ.SetName("fdPredictionNoTransPQ");
00538   vHistos.push_back(hFDPredictionNoTransPQ);
00539   
00540   
00541   
00542   //Add in transitions
00543   nuPrediction.Add(appearedNuMus);
00544   barPrediction.Add(appearedNuBars);
00545   
00546   //Put the componants of the predictions in the vector
00547 
00548   TH1D hFDPredictionNQ(*(nuPrediction.Spectrum()));
00549   hFDPredictionNQ.SetName("fdPredictionNQ");
00550   vHistos.push_back(hFDPredictionNQ);
00551 
00552   TH1D hFDPredictionPQ(*(barPrediction.Spectrum()));
00553   hFDPredictionPQ.SetName("fdPredictionPQ");
00554   vHistos.push_back(hFDPredictionPQ);
00555 
00556   TH1D hFDNCNQ(*(nuNCBackground.Spectrum()));
00557   hFDNCNQ.SetName("fdNCNQ");
00558   vHistos.push_back(hFDNCNQ);
00559 
00560   TH1D hFDNCPQ(*(barNCBackground.Spectrum()));
00561   hFDNCPQ.SetName("fdNCPQ");
00562   vHistos.push_back(hFDNCPQ);
00563   
00564   if (fHelper->DoTaus()) {
00565     TH1D hFDTausNQ(*(potentialNuTaus.Spectrum()));
00566     hFDTausNQ.SetName("fdTausNQ");
00567     vHistos.push_back(hFDTausNQ);
00568     
00569     TH1D hFDTausPQ(*(potentialTauBars.Spectrum()));
00570     hFDTausPQ.SetName("fdTausPQ");
00571     vHistos.push_back(hFDTausPQ);
00572   }
00573   
00574   TH1D hFDDataNQ(*(ffdNuData->Spectrum()));
00575   hFDDataNQ.SetName("fdDataNQ");
00576   vHistos.push_back(hFDDataNQ);
00577 
00578   TH1D hFDDataPQ(*(ffdBarData->Spectrum()));
00579   hFDDataPQ.SetName("fdDataPQ");
00580   vHistos.push_back(hFDDataPQ);
00581 
00582   return vHistos;
00583 }


Member Data Documentation

NuMatrixSpectrum* NuMMRunTransition::PreCalcbarAppeared [private]

Definition at line 62 of file NuMMRunTransition.h.

Referenced by CacheExtrapolation(), NuMMRunTransition(), ResetCache(), and TrueComponents().

NuMatrixSpectrum* NuMMRunTransition::PreCalcbarAppearedReco [private]

Definition at line 64 of file NuMMRunTransition.h.

Referenced by CacheExtrapolation(), MakeFDPred(), MakeFDPredNuBar(), NuMMRunTransition(), and ResetCache().

NuMatrixSpectrum* NuMMRunTransition::PreCalcbarNCBackground [private]

Definition at line 75 of file NuMMRunTransition.h.

Referenced by CacheExtrapolation(), MakeFDPred(), MakeFDPredNuBar(), NuMMRunTransition(), ResetCache(), and TrueComponents().

NuMatrixSpectrum* NuMMRunTransition::PreCalcbarPrediction [private]

Definition at line 56 of file NuMMRunTransition.h.

Referenced by CacheExtrapolation(), NuMMRunTransition(), ResetCache(), and TrueComponents().

NuMatrixSpectrum* NuMMRunTransition::PreCalcbarPredictionReco [private]

Definition at line 58 of file NuMMRunTransition.h.

Referenced by CacheExtrapolation(), MakeFDPred(), MakeFDPredNuBar(), NuMMRunTransition(), and ResetCache().

NuMatrixSpectrum* NuMMRunTransition::PreCalcnuAppeared [private]

Definition at line 61 of file NuMMRunTransition.h.

Referenced by CacheExtrapolation(), NuMMRunTransition(), ResetCache(), and TrueComponents().

NuMatrixSpectrum* NuMMRunTransition::PreCalcnuAppearedReco [private]

Definition at line 63 of file NuMMRunTransition.h.

Referenced by CacheExtrapolation(), MakeFDPred(), MakeFDPredNuMu(), NuMMRunTransition(), and ResetCache().

NuMatrixSpectrum* NuMMRunTransition::PreCalcnuNCBackground [private]

Definition at line 74 of file NuMMRunTransition.h.

Referenced by CacheExtrapolation(), MakeFDPred(), MakeFDPredNuMu(), NuMMRunTransition(), ResetCache(), and TrueComponents().

NuMatrixSpectrum* NuMMRunTransition::PreCalcnuPrediction [private]

Definition at line 55 of file NuMMRunTransition.h.

Referenced by CacheExtrapolation(), NuMMRunTransition(), ResetCache(), and TrueComponents().

NuMatrixSpectrum* NuMMRunTransition::PreCalcnuPredictionReco [private]

Definition at line 57 of file NuMMRunTransition.h.

Referenced by CacheExtrapolation(), MakeFDPred(), MakeFDPredNuMu(), NuMMRunTransition(), and ResetCache().

NuMatrixSpectrum* NuMMRunTransition::PreCalcpotentialNuTaus [private]

Definition at line 68 of file NuMMRunTransition.h.

Referenced by CacheExtrapolation(), NuMMRunTransition(), ResetCache(), and TrueComponents().

NuMatrixSpectrum* NuMMRunTransition::PreCalcpotentialNuTausReco [private]

Definition at line 70 of file NuMMRunTransition.h.

Referenced by CacheExtrapolation(), MakeFDPred(), MakeFDPredNuMu(), NuMMRunTransition(), and ResetCache().

NuMatrixSpectrum* NuMMRunTransition::PreCalcpotentialTauBars [private]

Definition at line 69 of file NuMMRunTransition.h.

Referenced by CacheExtrapolation(), NuMMRunTransition(), ResetCache(), and TrueComponents().

NuMatrixSpectrum* NuMMRunTransition::PreCalcpotentialTauBarsReco [private]

Definition at line 71 of file NuMMRunTransition.h.

Referenced by CacheExtrapolation(), MakeFDPred(), MakeFDPredNuBar(), NuMMRunTransition(), and ResetCache().

NuMatrixSpectrum* NuMMRunTransition::PreCalcwrongSignNuBars [private]

Definition at line 81 of file NuMMRunTransition.h.

Referenced by CacheExtrapolation(), NuMMRunTransition(), ResetCache(), and TrueComponents().

NuMatrixSpectrum* NuMMRunTransition::PreCalcwrongSignNuBarsReco [private]

Definition at line 83 of file NuMMRunTransition.h.

Referenced by CacheExtrapolation(), MakeFDPred(), MakeFDPredNuMu(), NuMMRunTransition(), and ResetCache().

NuMatrixSpectrum* NuMMRunTransition::PreCalcwrongSignNuMus [private]

Definition at line 80 of file NuMMRunTransition.h.

Referenced by CacheExtrapolation(), NuMMRunTransition(), ResetCache(), and TrueComponents().

NuMatrixSpectrum* NuMMRunTransition::PreCalcwrongSignNuMusReco [private]

Definition at line 82 of file NuMMRunTransition.h.

Referenced by CacheExtrapolation(), MakeFDPred(), MakeFDPredNuBar(), NuMMRunTransition(), and ResetCache().


The documentation for this class was generated from the following files:
Generated on Thu Jul 10 22:53:18 2014 for loon by  doxygen 1.4.7