NuMMRunNSI Class Reference

#include <NuMMRunNSI.h>

Inheritance diagram for NuMMRunNSI:
NuMMRunNuBar NuMMRun

List of all members.

Public Member Functions

 NuMMRunNSI (NuMMHelperCPT *helper, NuMatrixSpectrum *ndNuData, NuMatrixSpectrum *ndBarData, double pot)
 NuMMRunNSI (NuMMHelperCPT *helper, NuMatrixSpectrum *ndNuData, NuMatrixSpectrum *ndBarData, NuMatrixSpectrum *fdNuData, NuMatrixSpectrum *fdBarData)
 NuMMRunNSI (const NuMMRunNSI &old)
 ~NuMMRunNSI ()
virtual Double_t ComparePredWithData (const NuMMParameters &pars)
virtual std::pair
< NuMatrixSpectrum,
NuMatrixSpectrum
MakeFDPred (const NuMMParameters &pars)
 Return a pair (NQ,PQ) of NuMatrixSpectra of the far detector prediction with oscillation parameters described in pars. Pure virtual.
virtual std::vector< TH1D > WriteFDPredHistos (const NuMMParameters &pars) const
virtual 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.
virtual NuMatrixSpectrum TrueComponents (const NuMMParameters &pars, Sample_t s)
virtual void PredictNus (Bool_t predict)
 Will the neutrino prediction be calculated?
virtual void PredictNuBars (Bool_t predict)
 Will the antineutrino prediction be calculated?
virtual Bool_t PredictNus ()
virtual Bool_t PredictNuBars ()

Private Member Functions

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

Private Attributes

NuMatrixSpectrumPreCalcnuPrediction
NuMatrixSpectrumPreCalcbarPrediction
NuMatrixSpectrumPreCalcpotentialNuTaus
NuMatrixSpectrumPreCalcpotentialTauBars
NuMatrixSpectrumPreCalcnuNCBackground
NuMatrixSpectrumPreCalcbarNCBackground
NuMatrixSpectrumPreCalcwrongSignNuMus
NuMatrixSpectrumPreCalcwrongSignNuBars
Bool_t fPredictNeutrinos
 Controls neutrino component of prediction.
Bool_t fPredictAntiNeutrinos
 Controls antineutrino component of prediction.
Bool_t fDoneWsNeutrinos
 Flags to remember if the wrong sign has been precalculated.
Bool_t fDoneWsAntineutrinos

Detailed Description

Definition at line 16 of file NuMMRunNSI.h.


Constructor & Destructor Documentation

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

Definition at line 21 of file NuMMRunNSI.cxx.

References Msg::kError, and MSG.

00025                 : NuMMRunNuBar(),
00026                   fPredictNeutrinos(true),
00027                   fPredictAntiNeutrinos(true),
00028                   fDoneWsNeutrinos(false),
00029                   fDoneWsAntineutrinos(false)
00030 {
00031   if (!helper) {
00032     MSG("NuMMRunNSI",Msg::kError) << "Passed a null pointer for helper" << endl;
00033     assert(helper);
00034   }
00035   if (!ndNuData) {
00036     MSG("NuMMRunNSI",Msg::kError) << "Passed a null pointer for ndNuData" << endl;
00037     assert(ndNuData);
00038   }
00039   if (!ndBarData) {
00040     MSG("NuMMRunNSI",Msg::kError) << "Passed a null pointer for ndBarData" << endl;
00041     assert(ndBarData);
00042   }
00043   
00044   TString name = "hError";
00045   name += (counter++);
00046   TH1D hBlank(name, "Something Went Wrong", 10, 0, 30);
00047   
00048   fndNuData = ndNuData;
00049   fndBarData = ndBarData;
00050   fHelper = helper;
00051   
00052   ffdNuData = new NuMatrixSpectrum(hBlank, pot);
00053   ffdBarData = new NuMatrixSpectrum(hBlank, pot);
00054 
00055   
00056   // Blank out all the Precache variables
00057   PreCalcnuPrediction   = PreCalcbarPrediction      = 0;
00058   PreCalcpotentialNuTaus= PreCalcpotentialTauBars   = 0;
00059   PreCalcnuNCBackground = PreCalcbarNCBackground    = 0;
00060   PreCalcwrongSignNuMus = PreCalcwrongSignNuBars    = 0;
00061   
00062   // We should now be completely capable of calculating the
00063   // halfway point of the prediction. Do so now.
00064   CacheExtrapolation();
00065   
00066 }

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

Definition at line 69 of file NuMMRunNSI.cxx.

References CacheExtrapolation(), NuMMHelperCPT::FDBarEfficiency(), NuMMHelperCPT::FDNuEfficiency(), NuMMRunNuBar::ffdBarData, NuMMRunNuBar::ffdNuData, NuMMRunNuBar::fHelper, NuMMRunNuBar::fndBarData, NuMMRunNuBar::fndNuData, Msg::kError, MSG, PreCalcbarNCBackground, PreCalcbarPrediction, PreCalcnuNCBackground, PreCalcnuPrediction, PreCalcpotentialNuTaus, PreCalcpotentialTauBars, PreCalcwrongSignNuBars, PreCalcwrongSignNuMus, and NuMatrixSpectrum::Spectrum().

00074                : NuMMRunNuBar(),
00075                  fPredictNeutrinos(true),
00076                  fPredictAntiNeutrinos(true),
00077                  fDoneWsNeutrinos(false),
00078                  fDoneWsAntineutrinos(false)
00079 {
00080   if (!helper) {
00081     MSG("NuMMRunNSI",Msg::kError) << "Passed a null pointer for helper" << endl;
00082     assert(helper);
00083   }
00084   if (!ndNuData) {
00085     MSG("NuMMRunNSI",Msg::kError) << "Passed a null pointer for ndNuData" << endl;
00086     assert(ndNuData);
00087   }
00088   if (!ndBarData) {
00089     MSG("NuMMRunNSI",Msg::kError) << "Passed a null pointer for ndBarData" << endl;
00090     assert(ndBarData);
00091   }
00092   if (!fdNuData) {
00093     MSG("NuMMRunNSI",Msg::kError) << "Passed a null pointer for fdNuData" << endl;
00094     assert(fdNuData);
00095   }
00096   if (!fdBarData) {
00097     MSG("NuMMRunNSI",Msg::kError) << "Passed a null pointer for fdBarData" << endl;
00098     assert(fdBarData);
00099   }  
00100   
00101   fndNuData = ndNuData;
00102   fndBarData = ndBarData;
00103   ffdNuData = fdNuData;
00104   ffdBarData = fdBarData;
00105   fHelper = helper;
00106 
00107   // Protect against cases where the FD data is not the same
00108   // binning as the prediction would be. Use the helper file
00109   // as a guide to what this should be...
00110   // Only perform this check if the passed in data has a spectrum
00111   if (fdNuData->Spectrum()) {
00112     if (fdNuData->Spectrum()->GetNbinsX() != fHelper->FDNuEfficiency()->GetNbinsX()) {
00113       MSG("NuMMRunNSI",Msg::kError) << "Nu Binning Mismatch: fdNuData # bins: " << fdNuData->Spectrum()->GetNbinsX() 
00114                                    << " and fHelper # bins: " << fHelper->FDNuEfficiency()->GetNbinsX() << endl;
00115       assert(fdNuData->Spectrum()->GetNbinsX() == fHelper->FDNuEfficiency()->GetNbinsX());
00116     }
00117   }
00118   if (fdBarData->Spectrum()) {
00119     if (fdBarData->Spectrum()->GetNbinsX() != fHelper->FDBarEfficiency()->GetNbinsX()) {
00120       MSG("NuMMRunNSI",Msg::kError) << "Bar Binning Mismatch: fdNuData # bins: " << fdBarData->Spectrum()->GetNbinsX() 
00121                                    << " and fHelper # bins: " << fHelper->FDBarEfficiency()->GetNbinsX() << endl;
00122       assert(fdBarData->Spectrum()->GetNbinsX() == fHelper->FDBarEfficiency()->GetNbinsX());
00123     }
00124   }
00125 
00126   // Blank out all the Precache variables
00127   PreCalcnuPrediction   = PreCalcbarPrediction      = 0;
00128   PreCalcpotentialNuTaus= PreCalcpotentialTauBars   = 0;
00129   PreCalcnuNCBackground = PreCalcbarNCBackground    = 0;
00130   PreCalcwrongSignNuMus = PreCalcwrongSignNuBars    = 0;
00131 
00132   // We should now be completely capable of calculating the
00133   // halfway point of the prediction. Do so now.
00134   CacheExtrapolation();
00135 }

NuMMRunNSI::NuMMRunNSI ( const NuMMRunNSI old  ) 

Definition at line 140 of file NuMMRunNSI.cxx.

References fDoneWsAntineutrinos, fDoneWsNeutrinos, NuMMRunNuBar::ffdBarData, NuMMRunNuBar::ffdNuData, NuMMRunNuBar::fndBarData, NuMMRunNuBar::fndNuData, fPredictAntiNeutrinos, fPredictNeutrinos, PreCalcbarNCBackground, PreCalcbarPrediction, PreCalcnuNCBackground, PreCalcnuPrediction, PreCalcpotentialNuTaus, PreCalcpotentialTauBars, PreCalcwrongSignNuBars, and PreCalcwrongSignNuMus.

00140                                             : NuMMRunNuBar()
00141 {
00142   fndNuData = old.fndNuData;
00143   fndBarData = old.fndBarData;
00144   ffdNuData = old.ffdNuData;
00145   ffdBarData = old.ffdBarData;
00146   
00147   // Blank out all the Precache variables before reassignment
00148   PreCalcnuPrediction   = PreCalcbarPrediction      = 0;
00149   PreCalcpotentialNuTaus= PreCalcpotentialTauBars   = 0;
00150   PreCalcnuNCBackground = PreCalcbarNCBackground    = 0;
00151   PreCalcwrongSignNuMus = PreCalcwrongSignNuBars    = 0;
00152     
00153   // Make copies of all the precalculations from the old runner
00154   if (old.PreCalcnuPrediction)
00155     PreCalcnuPrediction = new NuMatrixSpectrum(*old.PreCalcnuPrediction);
00156   if (old.PreCalcbarPrediction)
00157     PreCalcbarPrediction = new NuMatrixSpectrum(*old.PreCalcbarPrediction);
00158   if (old.PreCalcpotentialNuTaus)
00159     PreCalcpotentialNuTaus = new NuMatrixSpectrum(*old.PreCalcpotentialNuTaus);
00160   if (old.PreCalcpotentialTauBars)
00161     PreCalcpotentialTauBars = new NuMatrixSpectrum(*old.PreCalcpotentialTauBars);
00162   
00163   if (old.PreCalcnuNCBackground)
00164     PreCalcnuNCBackground = new NuMatrixSpectrum(*old.PreCalcnuNCBackground);
00165   if (old.PreCalcbarNCBackground)
00166     PreCalcbarNCBackground = new NuMatrixSpectrum(*old.PreCalcbarNCBackground);
00167 
00168   if (old.PreCalcwrongSignNuMus)
00169     PreCalcwrongSignNuMus = new NuMatrixSpectrum(*old.PreCalcwrongSignNuMus);
00170   if (old.PreCalcwrongSignNuBars)
00171     PreCalcwrongSignNuBars = new NuMatrixSpectrum(*old.PreCalcwrongSignNuBars);
00172   
00173   fPredictNeutrinos = old.fPredictNeutrinos;
00174   fPredictAntiNeutrinos = old.fPredictAntiNeutrinos;
00175   
00176   // Set the wrong sign to false however - this copy may want different
00177   // oscillation parameters!
00178   fDoneWsNeutrinos = fDoneWsAntineutrinos = false;
00179 }

NuMMRunNSI::~NuMMRunNSI (  ) 

Definition at line 183 of file NuMMRunNSI.cxx.

References ResetCache().

00184 {
00185   ResetCache();
00186 }


Member Function Documentation

void NuMMRunNSI::CacheExtrapolation ( void   )  [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 423 of file NuMMRunNSI.cxx.

References NuMMHelperCPT::BarBeamMatrix(), NuMMHelperCPT::BarBeamMatrixNuMuCCXSec(), NuMMHelperCPT::BarBeamMatrixTauCCXSec(), NuMMHelperCPT::BarXSecGraph(), NuMatrixSpectrum::Divide(), NuMMHelperCPT::DoTaus(), NuMatrixSpectrum::ExtrapolateNDToFD(), NuMMRunNuBar::fCached, NuMMHelperCPT::FDBarEfficiency(), NuMMHelperCPT::FDBarNCContamination(), NuMMHelperCPT::FDBarPurity(), NuMMHelperCPT::FDBarRecoVsTrue(), NuMMHelperCPT::FDNuEfficiency(), NuMMHelperCPT::FDNuNCContamination(), NuMMHelperCPT::FDNuPurity(), NuMMHelperCPT::FDNuRecoVsTrue(), NuMMHelperCPT::FDNuTauEfficiency(), fDoneWsAntineutrinos, fDoneWsNeutrinos, NuMMHelperCPT::FDTauBarEfficiency(), NuMMHelperCPT::FDWrongSignBarEfficiency(), NuMMHelperCPT::FDWrongSignNuEfficiency(), NuMMRunNuBar::ffdBarData, NuMMRun::fFDFidMass, NuMMRunNuBar::ffdNuData, NuMMRunNuBar::fHelper, NuMMRunNuBar::fndBarData, NuMMRun::fNDFidMass, NuMMRunNuBar::fndNuData, NuMatrix::GetPOT(), Msg::kWarning, MAXMSG, NuMatrixSpectrum::Multiply(), NuMMHelperCPT::NDBarEfficiency(), NuMMHelperCPT::NDBarPurity(), NuMMHelperCPT::NDBarRecoVsTrue(), NuMMHelperCPT::NDNuEfficiency(), NuMMHelperCPT::NDNuPurity(), NuMMHelperCPT::NDNuRecoVsTrue(), NuMMHelperCPT::NuBeamMatrix(), NuMMHelperCPT::NuBeamMatrixNuMuCCXSec(), NuMMHelperCPT::NuBeamMatrixTauCCXSec(), NuMMHelperCPT::NuXSecGraph(), PreCalcbarNCBackground, PreCalcbarPrediction, PreCalcnuNCBackground, PreCalcnuPrediction, PreCalcpotentialNuTaus, PreCalcpotentialTauBars, PreCalcwrongSignNuBars, PreCalcwrongSignNuMus, NuMatrixSpectrum::RecoToTrue(), ResetCache(), NuMatrix::ResetPOT(), NuMatrixSpectrum::SetName(), NuMatrixSpectrum::TrueToReco(), NuMMHelperCPT::XSecGraphNuTaus(), and NuMMHelperCPT::XSecGraphTauBars().

Referenced by MakeFDPred(), NuMMRunNSI(), PredictNuBars(), PredictNus(), and TrueComponents().

00424 {
00425     // Only cache once.
00426     if (fCached) return;
00427   
00428     ResetCache();
00429   
00430     // Disable this output for now - this process should be fast anyway!
00431     // if (!fQuietMode)
00432     //     cout << "Pre-calculating static extrapolation variables..." << endl;
00433     
00434     // Caching variables, to reduce the workload of each step of the fitter
00435     // Initialise these the way they would be before
00436     PreCalcnuPrediction = new NuMatrixSpectrum(*fndNuData);
00437     PreCalcbarPrediction = new NuMatrixSpectrum(*fndBarData);
00438     
00439     // Be lazy and just alias the pointers to references so can keep
00440     // the code the same
00441     NuMatrixSpectrum &nuPrediction = *PreCalcnuPrediction;
00442     NuMatrixSpectrum &barPrediction = *PreCalcbarPrediction;
00443     
00444     // Now we have prepared the extrapolation variables, calculate them
00445     // Get the neutrinos to ND Flux x Xsec
00446     nuPrediction.Multiply(fHelper->NDNuPurity());
00447     nuPrediction.RecoToTrue(fHelper->NDNuRecoVsTrue());
00448     nuPrediction.Divide(fHelper->NDNuEfficiency());
00449     nuPrediction.Divide(fndNuData->GetPOT());
00450     nuPrediction.Divide(fNDFidMass);
00451 
00452     // Get the antineutrinos to ND Flux x Xsec
00453     barPrediction.Multiply(fHelper->NDBarPurity());
00454     barPrediction.RecoToTrue(fHelper->NDBarRecoVsTrue());
00455     barPrediction.Divide(fHelper->NDBarEfficiency());
00456     barPrediction.Divide(fndBarData->GetPOT());
00457     barPrediction.Divide(fNDFidMass);
00458     
00459 
00460     // Create and link to the Tau components, before we include the
00461     // cross section in the predictions (tau Xsec is different)
00462     PreCalcpotentialNuTaus = new NuMatrixSpectrum(nuPrediction);
00463     PreCalcpotentialTauBars = new NuMatrixSpectrum(barPrediction);
00464     NuMatrixSpectrum &potentialNuTaus = *PreCalcpotentialNuTaus;
00465     NuMatrixSpectrum &potentialTauBars = *PreCalcpotentialTauBars;
00466 
00467     
00468     // Get the Neutrinos to the FD
00469     nuPrediction.ExtrapolateNDToFD(fHelper->NuBeamMatrixNuMuCCXSec());
00470     nuPrediction.Multiply(fFDFidMass);
00471     nuPrediction.Multiply(ffdNuData->GetPOT());
00472     // Reset the spectrum to the new PoT
00473     nuPrediction.ResetPOT(ffdNuData->GetPOT());
00474 
00475     // Get the Antineutrinos to the FD
00476     barPrediction.ExtrapolateNDToFD(fHelper->BarBeamMatrixNuMuCCXSec());
00477     barPrediction.Multiply(fFDFidMass);
00478     barPrediction.Multiply(ffdBarData->GetPOT());
00479     // Reset the spectrum to the new PoT
00480     barPrediction.ResetPOT(ffdBarData->GetPOT());
00481 
00482 
00483     if (fHelper->DoTaus()) {
00484         // Get the Neutrinos to the FD
00485         if (fHelper->NuBeamMatrixTauCCXSec()) {
00486             potentialNuTaus.ExtrapolateNDToFD(fHelper->NuBeamMatrixTauCCXSec());
00487             potentialTauBars.ExtrapolateNDToFD(fHelper->BarBeamMatrixTauCCXSec());
00488         }
00489         else {
00490             MAXMSG("NuMMRunNSI",Msg::kWarning,10) << "Doing tau extrapolation the old way." << endl;
00491             potentialNuTaus.Divide(fHelper->NuXSecGraph());
00492             potentialNuTaus.ExtrapolateNDToFD(fHelper->NuBeamMatrix());
00493             potentialNuTaus.Multiply(fHelper->XSecGraphNuTaus());
00494             potentialTauBars.Divide(fHelper->BarXSecGraph());
00495             potentialTauBars.ExtrapolateNDToFD(fHelper->BarBeamMatrix());
00496             potentialTauBars.Multiply(fHelper->XSecGraphTauBars());
00497         }
00498             
00499         potentialNuTaus.Multiply(fFDFidMass);
00500         potentialNuTaus.Multiply(ffdNuData->GetPOT());
00501         // Reset the spectrum to the new PoT
00502         potentialNuTaus.ResetPOT(ffdNuData->GetPOT());
00503         potentialNuTaus.Multiply(fHelper->FDNuTauEfficiency());
00504         
00505         // Get the Antineutrinos to the FD
00506         potentialTauBars.Multiply(fFDFidMass);
00507         potentialTauBars.Multiply(ffdBarData->GetPOT());
00508         // Reset the spectrum to the new PoT
00509         potentialTauBars.ResetPOT(ffdBarData->GetPOT());
00510         potentialTauBars.Multiply(fHelper->FDTauBarEfficiency());
00511     }
00512     else {
00513         PreCalcpotentialNuTaus->Multiply(0.0);
00514         PreCalcpotentialTauBars->Multiply(0.0);
00515     }
00516   
00517     // Now build the NC Spectrum, after the cross section calculation!
00518     PreCalcnuNCBackground = new NuMatrixSpectrum(*PreCalcnuPrediction);;
00519     PreCalcbarNCBackground = new NuMatrixSpectrum(*PreCalcbarPrediction);
00520     NuMatrixSpectrum &nuNCBackground = *PreCalcnuNCBackground;
00521     NuMatrixSpectrum &barNCBackground = *PreCalcbarNCBackground;  
00522 
00523     //Get the neutrino NC background
00524     nuNCBackground.Multiply(fHelper->FDNuEfficiency());
00525     nuNCBackground.TrueToReco(fHelper->FDNuRecoVsTrue());
00526     nuNCBackground.Divide(fHelper->FDNuPurity());
00527     nuNCBackground.Multiply(fHelper->FDNuNCContamination());
00528 
00529     //Get the antineutrino NC background
00530     barNCBackground.Multiply(fHelper->FDBarEfficiency());
00531     barNCBackground.TrueToReco(fHelper->FDBarRecoVsTrue());
00532     barNCBackground.Divide(fHelper->FDBarPurity());
00533     barNCBackground.Multiply(fHelper->FDBarNCContamination());
00534     
00535     // Now build the wrong sign spectrum
00536     PreCalcwrongSignNuMus = new NuMatrixSpectrum(*PreCalcnuPrediction);
00537     PreCalcwrongSignNuBars = new NuMatrixSpectrum(*PreCalcbarPrediction);
00538     NuMatrixSpectrum &wrongSignNuMus = *PreCalcwrongSignNuMus;
00539     NuMatrixSpectrum &wrongSignNuBars = *PreCalcwrongSignNuBars;
00540     
00541     // Do the Neutrino background for the antineutrino spectrum
00542     wrongSignNuMus.Multiply(fHelper->FDWrongSignNuEfficiency());
00543     
00544     // Do the Antineutrino background for the neutrino spectrum
00545     wrongSignNuBars.Multiply(fHelper->FDWrongSignBarEfficiency());
00546     
00547     // Apply the efficiency to the predictions
00548     barPrediction.Multiply(fHelper->FDBarEfficiency());
00549     nuPrediction.Multiply(fHelper->FDNuEfficiency());
00550     
00551   
00552     nuPrediction.SetName("NuMus");
00553     barPrediction.SetName("NuMuBars");
00554     
00555     if (fHelper->DoTaus()) {
00556       potentialNuTaus.SetName("NuTaus");
00557       potentialTauBars.SetName("NuTauBars");
00558     }
00559     
00560     wrongSignNuMus.SetName("WrongSign_NuMus");
00561     wrongSignNuBars.SetName("WrongSign_NuMuBars");
00562     
00563     nuNCBackground.SetName("NC_NuMus");
00564     barNCBackground.SetName("NC_NuMuBars");
00565   
00566     fCached = true;
00567   
00568     // If we have precalculated the wrong sign oscillations,
00569     // then we need to recalculate them next time we are given
00570     // the oscilaltion parameters. Reset the flags used to
00571     // control this  
00572     fDoneWsNeutrinos = fDoneWsAntineutrinos = false;
00573 }

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

Implements NuMMRun.

Definition at line 817 of file NuMMRunNSI.cxx.

00818 {
00819   // Generate a prediction
00820   const pair<NuMatrixSpectrum,NuMatrixSpectrum> predictions =
00821     this->MakeFDPred(pars);
00822   Double_t like = 0;
00823 
00824    // Now, only count a likelihood for components we want - this is just
00825   // a constant offset, but should help speed things up a little.
00826   if (fPredictNeutrinos)
00827   {
00828     like += this->StatsLikelihood(predictions.first.Spectrum(),
00829         ffdNuData->Spectrum());
00830   }
00831   if (fPredictAntiNeutrinos) {
00832     like += this->StatsLikelihood(predictions.second.Spectrum(),
00833         ffdBarData->Spectrum());
00834   }
00835   return like;
00836 }

pair< NuMatrixSpectrum, NuMatrixSpectrum > NuMMRunNSI::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 608 of file NuMMRunNSI.cxx.

References NuMatrix1D::Add(), CacheExtrapolation(), NuMMParameters::Dm2(), NuMMParameters::Dm2Bar(), NuMMHelperCPT::DoTaus(), NuMMParameters::Epsilon(), NuMMHelperCPT::FDBarRecoVsTrue(), NuMMHelperCPT::FDNuRecoVsTrue(), NuMMHelperCPT::FDNuTauRecoVsTrue(), fDoneWsAntineutrinos, fDoneWsNeutrinos, NuMMHelperCPT::FDTauBarRecoVsTrue(), NuMMHelperCPT::FDWrongSignBarRecoVsTrue(), NuMMHelperCPT::FDWrongSignNuRecoVsTrue(), NuMMRunNuBar::fHelper, fPredictAntiNeutrinos, fPredictNeutrinos, NuMMRun::fQuietMode, NuMatrixSpectrum::InverseOscillateNSI(), NuMatrixSpectrum::OscillateNSI(), PreCalcbarNCBackground, PreCalcbarPrediction, PreCalcnuNCBackground, PreCalcnuPrediction, PreCalcpotentialNuTaus, PreCalcpotentialTauBars, PreCalcWrongSign(), PreCalcwrongSignNuBars, PreCalcwrongSignNuMus, NuMMParameters::Sn2(), NuMMParameters::Sn2Bar(), NuMatrixSpectrum::Spectrum(), and NuMatrixSpectrum::TrueToReco().

00609 {
00610   // Precache extrap, but only if needed
00611   CacheExtrapolation(); 
00612   // Do the wrong sign precalcuation, if it hasn't been done
00613   PreCalcWrongSign(pars);
00614   // Output the oscillation settings!
00615   if (!fQuietMode) {
00616     //pars.PrintStatus();
00617     cout << "sn2: " << pars.Sn2() << "; dm2: " << pars.Dm2() 
00618          << "; sn2bar: " << pars.Sn2Bar() << "; dm2bar: " << pars.Dm2Bar()
00619          << "; epsilon: " << pars.Epsilon() 
00620          << endl;
00621   }
00622   
00624   // For all neutrinos
00625 
00626   // Make copies of the prepared extrapolation variables, so that
00627   // we can alter them locally with the oscillation parameters
00628   NuMatrixSpectrum nuPrediction(*PreCalcnuPrediction);
00629   NuMatrixSpectrum barPrediction(*PreCalcbarPrediction);
00630   
00631   NuMatrixSpectrum potentialNuTaus(*PreCalcpotentialNuTaus);
00632   NuMatrixSpectrum potentialTauBars(*PreCalcpotentialTauBars);
00633 
00634   NuMatrixSpectrum nuNCBackground(*PreCalcnuNCBackground);
00635   NuMatrixSpectrum barNCBackground(*PreCalcbarNCBackground);
00636   
00637   NuMatrixSpectrum wrongSignNuMus(*PreCalcwrongSignNuMus);
00638   NuMatrixSpectrum wrongSignNuBars(*PreCalcwrongSignNuBars);
00639 
00641   // Processes for neutrinos
00642   if (fPredictNeutrinos)
00643   {  
00644     if (fHelper->DoTaus()) {
00645       // Oscillate the taus
00646       potentialNuTaus.InverseOscillateNSI(pars.Dm2(),pars.Sn2(),
00647                                           pars.Epsilon(), 1);
00648       potentialNuTaus.TrueToReco(fHelper->FDNuTauRecoVsTrue());
00649     }
00650 
00651     // If we have pre-oscillated the wrong sign, do not do so again
00652     if (!fDoneWsAntineutrinos) {
00653         // Antineutrinos in the neutrino spectrum
00654         wrongSignNuBars.OscillateNSI(pars.Dm2Bar(),pars.Sn2Bar(),
00655                                   pars.Epsilon(), -1);
00656         wrongSignNuBars.TrueToReco(fHelper->FDWrongSignBarRecoVsTrue());
00657     }
00658 
00659     // Oscillate the Neutrino spectrum!
00660     nuPrediction.OscillateNSI(pars.Dm2(),pars.Sn2(),pars.Epsilon(),1);
00661 
00662     // True to Reco
00663     nuPrediction.TrueToReco(fHelper->FDNuRecoVsTrue());
00664 
00665     //Add in backgrounds
00666     nuPrediction.Add(wrongSignNuBars);
00667     nuPrediction.Add(nuNCBackground);
00668     if (fHelper->DoTaus()) nuPrediction.Add(potentialNuTaus);
00669   } else {
00670       // Scale the histogram to zero, so as not to confuse people
00671       // if they look at the spectrum with neutrinos turned off
00672       nuPrediction.Spectrum()->Scale(0);
00673   }
00675   // Processes for Antineutrinos
00676   if (fPredictAntiNeutrinos)
00677   {
00678     if (fHelper->DoTaus()) {
00679         // Oscillate the taubars
00680         potentialTauBars.InverseOscillateNSI(pars.Dm2Bar(),pars.Sn2Bar(),
00681                                              pars.Epsilon(), -1);
00682         potentialTauBars.TrueToReco(fHelper->FDTauBarRecoVsTrue());
00683       }
00684       // Only oscillate the wrong sign if it hasn't been done already
00685       if (!fDoneWsNeutrinos) {
00686           // Oscillate the wrong sign component
00687           // Neutrinos for the antineutrino spectrum
00688           wrongSignNuMus.OscillateNSI(pars.Dm2(),pars.Sn2(),pars.Epsilon(),1);
00689           wrongSignNuMus.TrueToReco(fHelper->FDWrongSignNuRecoVsTrue());
00690       }
00691       // Oscillate the antineutrino spectrum!
00692       barPrediction.OscillateNSI(pars.Dm2Bar(),pars.Sn2Bar(),
00693                               pars.Epsilon(), -1);
00694       // True to reco
00695      barPrediction.TrueToReco(fHelper->FDBarRecoVsTrue());
00696       // Add in backgrounds
00697       barPrediction.Add(wrongSignNuMus);
00698       barPrediction.Add(barNCBackground);
00699       if (fHelper->DoTaus()) barPrediction.Add(potentialTauBars);
00700   } else {
00701       // Scale the histogram to zero, so as not to confuse people
00702       barPrediction.Spectrum()->Scale(0);
00703   }
00704   // Return the two predictions, as a pair
00705   pair<NuMatrixSpectrum,NuMatrixSpectrum>
00706     predictions(nuPrediction,barPrediction);
00707   return predictions;
00708 }

void NuMMRunNSI::PreCalcWrongSign ( const NuMMParameters pars  )  [private]

Pre-calculate the wrong sign oscillation. This is a valid action in cases where, for instance, the neutrino prediction has been turned off. It is assumed that if you are not predicting neutrinos, then the neutrino mixing parameters remain constant throughout the fit.

Definition at line 577 of file NuMMRunNSI.cxx.

References NuMMParameters::Dm2(), NuMMParameters::Dm2Bar(), NuMMParameters::Epsilon(), fDoneWsAntineutrinos, fDoneWsNeutrinos, NuMMHelperCPT::FDWrongSignBarRecoVsTrue(), NuMMHelperCPT::FDWrongSignNuRecoVsTrue(), NuMMRunNuBar::fHelper, fPredictAntiNeutrinos, fPredictNeutrinos, NuMMRun::fQuietMode, NuMatrixSpectrum::OscillateNSI(), PreCalcwrongSignNuBars, PreCalcwrongSignNuMus, NuMMParameters::Sn2(), NuMMParameters::Sn2Bar(), and NuMatrixSpectrum::TrueToReco().

Referenced by MakeFDPred().

00578 {
00579     // Precalculate the wrong sign, if we have disabled predictions
00580     // for that class, and it hasn't been done already. This should only
00581     // be done once, unless of course the user does something strange like
00582     // turning on neutrino prediction in the middle of an extrapolation.
00583     if(!fDoneWsNeutrinos) {
00584         if (!fPredictNeutrinos)
00585         {
00586             if (!fQuietMode) cout << "Neutrino prediction off: Precalculating wrong sign oscillation." << endl;
00587             PreCalcwrongSignNuMus->OscillateNSI(pars.Dm2(),pars.Sn2(),
00588                                              pars.Epsilon(), 1);
00589             PreCalcwrongSignNuMus->TrueToReco(fHelper->FDWrongSignNuRecoVsTrue());
00590             fDoneWsNeutrinos = true;
00591         }
00592     }
00593     if(!fPredictAntiNeutrinos) {
00594         if (!fDoneWsAntineutrinos)
00595         {
00596             if (!fQuietMode) cout << "Antineutrino prediction off: Precalculating wrong sign oscillation." << endl;
00597             PreCalcwrongSignNuBars->OscillateNSI(pars.Dm2Bar(),pars.Sn2Bar(),
00598                                               pars.Epsilon(), -1);
00599             PreCalcwrongSignNuBars->TrueToReco(fHelper->FDWrongSignBarRecoVsTrue());
00600             fDoneWsAntineutrinos = true;
00601         }
00602     }
00603 }

virtual Bool_t NuMMRunNSI::PredictNuBars (  )  [inline, virtual]

Reimplemented from NuMMRunNuBar.

Definition at line 51 of file NuMMRunNSI.h.

References fPredictAntiNeutrinos.

00051 { return fPredictAntiNeutrinos;}

virtual void NuMMRunNSI::PredictNuBars ( Bool_t  predict  )  [inline, virtual]

Will the antineutrino prediction be calculated?

Reimplemented from NuMMRunNuBar.

Definition at line 45 of file NuMMRunNSI.h.

References CacheExtrapolation(), fDoneWsAntineutrinos, and fPredictAntiNeutrinos.

00045                                              {
00046       fPredictAntiNeutrinos = predict;
00047       if(fDoneWsAntineutrinos) CacheExtrapolation();
00048   }

virtual Bool_t NuMMRunNSI::PredictNus (  )  [inline, virtual]

Reimplemented from NuMMRunNuBar.

Definition at line 50 of file NuMMRunNSI.h.

References fPredictNeutrinos.

00050 { return fPredictNeutrinos;}

virtual void NuMMRunNSI::PredictNus ( Bool_t  predict  )  [inline, virtual]

Will the neutrino prediction be calculated?

Reimplemented from NuMMRunNuBar.

Definition at line 40 of file NuMMRunNSI.h.

References CacheExtrapolation(), fDoneWsNeutrinos, and fPredictNeutrinos.

00040                                           {
00041       fPredictNeutrinos = predict;
00042       if(fDoneWsNeutrinos) CacheExtrapolation();
00043   }

void NuMMRunNSI::ResetCache (  )  [private]
NuMatrixSpectrum NuMMRunNSI::TrueComponents ( const NuMMParameters pars,
Sample_t  s 
) [virtual]

Definition at line 714 of file NuMMRunNSI.cxx.

References CacheExtrapolation(), and TrueComponents().

00715 {
00716   CacheExtrapolation(); 
00717   
00718   // Return the const version
00719   return static_cast<const NuMMRunNSI *>(this)->TrueComponents(pars, s);
00720 }

NuMatrixSpectrum NuMMRunNSI::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 722 of file NuMMRunNSI.cxx.

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

Referenced by TrueComponents().

00723 {
00724   // Precache extrap, but only if needed
00725   if (!fCached) {
00726     MSG("NuMMRunNSI",Msg::kError) << "Trying to call TrueComponents without first caching the extrapolation" << endl;
00727     assert(fCached);
00728   }
00729 
00730   // Output the oscillation settings!
00731   if (!fQuietMode) {
00732     cout << "sn2: " << pars.Sn2() << "; dm2: " << pars.Dm2() 
00733          << "; sn2bar: " << pars.Sn2Bar() << "; dm2bar: " << pars.Dm2Bar()
00734          << "; epsilon: " << pars.Epsilon() 
00735          << endl;
00736   }
00737   
00738   if (fDoneWsNeutrinos || fDoneWsAntineutrinos) {
00739     MSG("NuMMRunNSI",Msg::kError) << "Already True-To-Recoed the wrong signs.  Cannot precalculate the wrong-signs for event-by-event.  Bailing." << endl;
00740     MSG("NuMMRunNSI",Msg::kFatal) << "Already True-To-Recoed the wrong signs.  Cannot precalculate the wrong-signs for event-by-event.  Bailing." << endl;
00741   } 
00742   
00743   // No appeared spectrum for oscillations
00744   if (s == kAppearedPQ || s == kAppearedNQ) {
00745     NuMatrixSpectrum blank(*PreCalcnuPrediction);
00746     blank.SetName("Blank");
00747     blank.Spectrum()->Scale(0);
00748     return blank;    
00749   }
00750   
00751   // Request NQ spectrum, but no NuBar Predictions OR
00752   // Request PQ spectrum, but no NuMu Predictions
00753   if ( (s < 0 && !fPredictNeutrinos) || 
00754       (s > 0 && !fPredictAntiNeutrinos) ) {
00755     NuMatrixSpectrum blank(*PreCalcnuPrediction);
00756     blank.SetName("Blank");
00757     blank.Spectrum()->Scale(0);
00758     return blank;
00759   }
00760   
00761   if (s == kSignalPQ) {
00762     NuMatrixSpectrum barPrediction(*PreCalcbarPrediction);
00763     barPrediction.OscillateNSI(pars.Dm2Bar(),pars.Sn2Bar(),
00764                                pars.Epsilon(),-1);
00765     return barPrediction;
00766   }
00767   else if (s == kSignalNQ) {
00768     NuMatrixSpectrum nuPrediction(*PreCalcnuPrediction);  
00769     nuPrediction.OscillateNSI(pars.Dm2(),pars.Sn2(),
00770                               pars.Epsilon(), 1);
00771     return nuPrediction;
00772   }
00773   else if (s == kWrongSignPQ) {
00774     NuMatrixSpectrum wrongSignNuMus(*PreCalcwrongSignNuMus);
00775     wrongSignNuMus.OscillateNSI(pars.Dm2(),pars.Sn2(),
00776                              pars.Epsilon(), 1);
00777     return wrongSignNuMus;
00778   }
00779   else if (s == kWrongSignNQ) {
00780     NuMatrixSpectrum wrongSignNuBars(*PreCalcwrongSignNuBars);
00781     wrongSignNuBars.OscillateNSI(pars.Dm2Bar(),pars.Sn2Bar(),
00782                                  pars.Epsilon(), -1);
00783     return wrongSignNuBars;
00784   }  
00785   else if (s == kNCPQ) {
00786     NuMatrixSpectrum barNCBackground(*PreCalcbarNCBackground);
00787     return barNCBackground;
00788   }
00789   else if (s == kNCNQ) {
00790     NuMatrixSpectrum nuNCBackground(*PreCalcnuNCBackground);
00791     return nuNCBackground;
00792   }
00793   else if (s == kTauPQ) {
00794     NuMatrixSpectrum potentialTauBars(*PreCalcpotentialTauBars);
00795     potentialTauBars.InverseOscillateNSI(pars.Dm2Bar(),pars.Sn2Bar(),
00796                                          pars.Epsilon(), -1);
00797     return potentialTauBars;
00798   }
00799   else if (s == kTauNQ) {
00800     NuMatrixSpectrum potentialNuTaus(*PreCalcpotentialNuTaus);
00801     potentialNuTaus.InverseOscillateNSI(pars.Dm2(),pars.Sn2(),
00802                                         pars.Epsilon(), 1);
00803     return potentialNuTaus;
00804   }
00805   else {
00806     MSG("NuMMRunTransitions",Msg::kWarning) << "Requested unknown prediction #" << s << ", returning blank." << endl;
00807     NuMatrixSpectrum blank(*PreCalcnuPrediction);
00808     blank.SetName("Blank");
00809     blank.Spectrum()->Scale(0);
00810     return blank;
00811   }
00812 }

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

Implements NuMMRun.

Definition at line 217 of file NuMMRunNSI.cxx.

References NuMatrix1D::Add(), NuMMParameters::Dm2(), NuMMParameters::Dm2Bar(), NuMMHelperCPT::DoTaus(), NuMMParameters::Epsilon(), NuMMHelperCPT::FDBarRecoVsTrue(), NuMMHelperCPT::FDNuRecoVsTrue(), NuMMHelperCPT::FDNuTauRecoVsTrue(), fDoneWsAntineutrinos, fDoneWsNeutrinos, NuMMHelperCPT::FDTauBarRecoVsTrue(), NuMMHelperCPT::FDWrongSignBarRecoVsTrue(), NuMMHelperCPT::FDWrongSignNuRecoVsTrue(), NuMMRunNuBar::ffdBarData, NuMMRunNuBar::ffdNuData, NuMMRunNuBar::fHelper, NuMMRunNuBar::fndBarData, NuMMRunNuBar::fndNuData, fPredictAntiNeutrinos, fPredictNeutrinos, NuMMRun::fQuietMode, NuMatrixSpectrum::InverseOscillateNSI(), NuMatrixSpectrum::OscillateNSI(), PreCalcbarNCBackground, PreCalcbarPrediction, PreCalcnuNCBackground, PreCalcnuPrediction, PreCalcpotentialNuTaus, PreCalcpotentialTauBars, PreCalcwrongSignNuBars, PreCalcwrongSignNuMus, NuMMParameters::Sn2(), NuMMParameters::Sn2Bar(), NuMatrixSpectrum::Spectrum(), and NuMatrixSpectrum::TrueToReco().

00218 {    
00219   //Set up a vector to push the histograms into.
00220   vector<TH1D> vHistos;
00221 
00222   //Put the ND data in the vector:
00223   TH1D hNDNuData(*(fndNuData->Spectrum()));
00224   hNDNuData.SetName("ndDataNQ");
00225   hNDNuData.SetTitle("ndDataNQ");
00226   vHistos.push_back(*(new TH1D(hNDNuData)));
00227   TH1D hNDBarData(*(fndBarData->Spectrum()));
00228   hNDBarData.SetName("ndDataPQ");
00229   hNDBarData.SetTitle("ndDataPQ");
00230   vHistos.push_back(*(new TH1D(hNDBarData)));
00231 
00232   if (!fQuietMode) {
00233     cout << "sn2: " << pars.Sn2() << "; dm2: " << pars.Dm2() 
00234          << "; sn2bar: " << pars.Sn2Bar() << "; dm2bar: " << pars.Dm2Bar()
00235          << "; epsilon: " << pars.Epsilon()
00236          << endl;
00237   }
00238 
00239   // Make copies of the prepared extrapolation variables
00240   NuMatrixSpectrum nuPrediction(*PreCalcnuPrediction);
00241   NuMatrixSpectrum barPrediction(*PreCalcbarPrediction);
00242   
00243   NuMatrixSpectrum potentialNuTaus(*PreCalcpotentialNuTaus);
00244   NuMatrixSpectrum potentialTauBars(*PreCalcpotentialTauBars);
00245 
00246   NuMatrixSpectrum nuNCBackground(*PreCalcnuNCBackground);
00247   NuMatrixSpectrum barNCBackground(*PreCalcbarNCBackground);
00248   
00249   NuMatrixSpectrum wrongSignNuMus(*PreCalcwrongSignNuMus);
00250   NuMatrixSpectrum wrongSignNuBars(*PreCalcwrongSignNuBars);
00251   
00252   cout << "NC Integral: " << barNCBackground.Spectrum()->Integral() << endl;
00253 
00254 
00255 
00256 // 
00257 //   //Add in backgrounds
00258 //   nuPrediction.Add(wrongSignNuBars);
00259 //   barPrediction.Add(wrongSignNuMus);
00260 //   nuPrediction.Add(nuNCBackground);
00261 //   nuPrediction.Add(potentialNuTaus);
00262 //   barPrediction.Add(barNCBackground);
00263 //   barPrediction.Add(potentialTauBars);
00264   
00266   // Processes for neutrinos
00267   //For NSI oscillations sign=1 for nu -1 for nubar
00268 
00269   if (fPredictNeutrinos)
00270   {  
00271     // Oscillate the taus
00272     if (fHelper->DoTaus()) {
00273       potentialNuTaus.InverseOscillateNSI(pars.Dm2(),pars.Sn2(),
00274                                           pars.Epsilon(),1);
00275     
00276       // Write out the true tau spectra
00277       TH1D hFDTausNuMu(*(potentialNuTaus.Spectrum()));
00278       hFDTausNuMu.SetName("fdTausNuMu");
00279       vHistos.push_back(hFDTausNuMu);
00280       
00281       potentialNuTaus.TrueToReco(fHelper->FDNuTauRecoVsTrue());
00282     }
00283 
00284     // Antineutrinos in the neutrino spectrum
00285     if (!fDoneWsAntineutrinos) wrongSignNuBars.OscillateNSI(pars.Dm2Bar(),pars.Sn2Bar(),
00286                                                             pars.Epsilon(),-1);
00287 
00288     // Now convert wrong sign to reco
00289     if (!fDoneWsAntineutrinos) wrongSignNuBars.TrueToReco(fHelper->FDWrongSignBarRecoVsTrue());
00290     
00291     // Write out the true wrong sign components
00292     TH1D hFDWrongSignNQ(*(wrongSignNuBars.Spectrum()));
00293     hFDWrongSignNQ.SetName("fdWrongSignNQ");
00294     vHistos.push_back(hFDWrongSignNQ);
00295     
00296     // Oscillation and efficiency for the Neutrino spectrum
00297     nuPrediction.OscillateNSI(pars.Dm2(),pars.Sn2(),pars.Epsilon(),1);
00298 //    nuPrediction.Multiply(fHelper->FDNuEfficiency());
00299 
00300     // Write out the true spectra for the prediction components
00301     // before we add in backgrounds
00302     TH1D hFDNoBackTrueNQ(*(nuPrediction.Spectrum()));
00303     hFDNoBackTrueNQ.SetName("fdBasePredictionNuMus");
00304     vHistos.push_back(hFDNoBackTrueNQ);
00305 
00306     // True to Reco
00307     nuPrediction.TrueToReco(fHelper->FDNuRecoVsTrue());
00308 
00309     // Dump out the reco spectrum before adding in the backgrounds
00310     TH1D hFDNoBackNQ(*(nuPrediction.Spectrum()));
00311     hFDNoBackNQ.SetName("fdBasePredictionNQ");
00312     vHistos.push_back(hFDNoBackNQ);
00313 
00314     //Add in backgrounds
00315     nuPrediction.Add(wrongSignNuBars);
00316     nuPrediction.Add(nuNCBackground);
00317     if (fHelper->DoTaus()) nuPrediction.Add(potentialNuTaus);
00318     
00319     //Put the other componants of the predictions in the vector
00320     TH1D hFDPredictionNQ(*(nuPrediction.Spectrum()));
00321     hFDPredictionNQ.SetName("fdPredictionNQ");
00322     vHistos.push_back(hFDPredictionNQ);
00323 
00324     TH1D hFDNCNQ(*(nuNCBackground.Spectrum()));
00325     hFDNCNQ.SetName("fdNCNQ");
00326     vHistos.push_back(hFDNCNQ);
00327 
00328     if (fHelper->DoTaus()) {
00329       TH1D hFDTausNQ(*(potentialNuTaus.Spectrum()));
00330       hFDTausNQ.SetName("fdTausNQ");
00331       vHistos.push_back(hFDTausNQ);
00332     }
00333     
00334     TH1D hFDDataNQ(*(ffdNuData->Spectrum()));
00335     hFDDataNQ.SetName("fdDataNQ");
00336     vHistos.push_back(hFDDataNQ);
00337     
00338   } else {
00339       // Scale the histogram to zero, so as not to confuse people
00340       nuPrediction.Spectrum()->Scale(0);
00341   }
00342   
00344   // Processes for Antineutrinos
00345   //For NSI oscillations sign=1 for nu -1 for nubar
00346   if (fPredictAntiNeutrinos)
00347   {
00348     if (fHelper->DoTaus()) {
00349       // Oscillate the taubars
00350       potentialTauBars.InverseOscillateNSI(pars.Dm2Bar(),pars.Sn2Bar(),
00351                                            pars.Epsilon(), -1);
00352       // Write out the True Tau Spectrum
00353       TH1D hFDTausNuBar(*(potentialTauBars.Spectrum()));
00354       hFDTausNuBar.SetName("fdTausNuBar");
00355       vHistos.push_back(hFDTausNuBar);
00356       // Convert taus to reco energy
00357       potentialTauBars.TrueToReco(fHelper->FDTauBarRecoVsTrue());
00358     }
00359     // Oscillate the wrong sign component
00360     // Neutrinos for the antineutrino spectrum
00361     if (!fDoneWsNeutrinos) wrongSignNuMus.OscillateNSI(pars.Dm2(),pars.Sn2(),
00362                                                        pars.Epsilon(), 1);
00363 
00364     // Now, convert wrong sign to reco energy
00365     if (!fDoneWsNeutrinos) wrongSignNuMus.TrueToReco(fHelper->FDWrongSignNuRecoVsTrue());
00366     
00367     // write out the true wrong sign spectra
00368     TH1D hFDWrongSignPQ(*(wrongSignNuMus.Spectrum()));
00369     hFDWrongSignPQ.SetName("fdWrongSignPQ");
00370     vHistos.push_back(hFDWrongSignPQ);
00371     
00372     //Oscillation and efficiency for the antineutrino spectrum
00373     barPrediction.OscillateNSI(pars.Dm2Bar(),pars.Sn2Bar(),
00374                                pars.Epsilon(),-1);
00375 
00376     // Write out the true antineutrino spectrum, without backgrounds
00377     TH1D hFDNoBackTruePQ(*(barPrediction.Spectrum()));
00378     hFDNoBackTruePQ.SetName("fdBasePredictionNuBars");
00379     vHistos.push_back(hFDNoBackTruePQ);
00380 
00381     //True to reco
00382     barPrediction.TrueToReco(fHelper->FDBarRecoVsTrue());
00383 
00384     // Antineutrino reco spectrum, before backgrounds
00385     TH1D hFDNoBackPQ(*(barPrediction.Spectrum()));
00386     hFDNoBackPQ.SetName("fdBasePredictionPQ");
00387     vHistos.push_back(hFDNoBackPQ);
00388 
00389     //Add in backgrounds
00390     barPrediction.Add(wrongSignNuMus);
00391     barPrediction.Add(barNCBackground);
00392     if (fHelper->DoTaus()) barPrediction.Add(potentialTauBars);
00393     
00394     TH1D hFDPredictionPQ(*(barPrediction.Spectrum()));
00395     hFDPredictionPQ.SetName("fdPredictionPQ");
00396     vHistos.push_back(hFDPredictionPQ);
00397 
00398     TH1D hFDNCPQ(*(barNCBackground.Spectrum()));
00399     hFDNCPQ.SetName("fdNCPQ");
00400     vHistos.push_back(hFDNCPQ);
00401 
00402     if (fHelper->DoTaus()) {
00403       TH1D hFDTausPQ(*(potentialTauBars.Spectrum()));
00404       hFDTausPQ.SetName("fdTausPQ");
00405       vHistos.push_back(hFDTausPQ);
00406     }
00407 
00408     TH1D hFDDataPQ(*(ffdBarData->Spectrum()));
00409     hFDDataPQ.SetName("fdDataPQ");
00410     vHistos.push_back(hFDDataPQ);
00411     
00412   } else {
00413       // Scale the histogram to zero, so as not to confuse people
00414       barPrediction.Spectrum()->Scale(0);
00415   }
00416 
00417   return vHistos;
00418 }


Member Data Documentation

Bool_t NuMMRunNSI::fDoneWsNeutrinos [private]

Flags to remember if the wrong sign has been precalculated.

Definition at line 99 of file NuMMRunNSI.h.

Referenced by CacheExtrapolation(), MakeFDPred(), NuMMRunNSI(), PreCalcWrongSign(), PredictNus(), TrueComponents(), and WriteFDPredHistos().

Controls antineutrino component of prediction.

Reimplemented from NuMMRunNuBar.

Definition at line 96 of file NuMMRunNSI.h.

Referenced by MakeFDPred(), NuMMRunNSI(), PreCalcWrongSign(), PredictNuBars(), TrueComponents(), and WriteFDPredHistos().

Controls neutrino component of prediction.

Reimplemented from NuMMRunNuBar.

Definition at line 94 of file NuMMRunNSI.h.

Referenced by MakeFDPred(), NuMMRunNSI(), PreCalcWrongSign(), PredictNus(), TrueComponents(), and WriteFDPredHistos().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1