NuMMRunLED Class Reference

#include <NuMMRunLED.h>

Inheritance diagram for NuMMRunLED:
NuMMRunNuBar NuMMRun

List of all members.

Public Member Functions

 NuMMRunLED (NuMMHelperCPT *helper, const NuMatrixSpectrum *ndNuData, const NuMatrixSpectrum *ndBarData, double pot)
 NuMMRunLED (NuMMHelperCPT *helper, const NuMatrixSpectrum *ndNuData, const NuMatrixSpectrum *ndBarData, const NuMatrixSpectrum *fdNuData, const NuMatrixSpectrum *fdBarData)
 NuMMRunLED (const NuMMRunLED &old)
 ~NuMMRunLED ()
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 > MakeFDPredBackgrounds (const NuMMParameters &pars)
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)
void OscillateNuMu (NuMatrixSpectrum &numu, const NuMMParameters &pars) const
void InverseOscillateNuTau (NuMatrixSpectrum &nutau, const NuMMParameters &pars) const
void OscillateNuBar (NuMatrixSpectrum &numu, const NuMMParameters &pars) const
void InverseOscillateTauBar (NuMatrixSpectrum &nutau, const NuMMParameters &pars) const
virtual void PredictNus (Bool_t predict)
 Will the (anti)neutrino prediction be calculated?
virtual void PredictNuBars (Bool_t predict)
virtual Bool_t PredictNus ()
virtual Bool_t PredictNuBars ()
Bool_t PreCalcWrongSign (const NuMMParameters &pars)
void ResetCache ()
virtual void ResetNDData (const NuMatrix &nddata)
 Replace the ND data used in extrapolation.
virtual void ResetFDData (const NuMatrix &fddata)
 Replace the FD data used in extrapolation.
virtual std::auto_ptr< NuMatrixGetNDData (void) const
 Returns the ND data used in extrapolation.
virtual std::auto_ptr< NuMatrixGetFDData (void) const
 Return the FD data used in extrapolation.

Private Member Functions

void Init (NuMMHelperCPT *helper, const NuMatrixSpectrum *ndNuData, const NuMatrixSpectrum *ndBarData, const NuMatrixSpectrum *fdNuData, const NuMatrixSpectrum *fdBarData)
NuMMRunLEDoperator= (const NuMMRunLED &rhs)
 Disallow assignment: This is broken, so don't let people do it.
void CacheExtrapolation (void)

Private Attributes

NuMatrixSpectrumPreCalcnuPrediction
NuMatrixSpectrumPreCalcbarPrediction
NuMatrixSpectrumPreCalcpotentialNuTaus
NuMatrixSpectrumPreCalcpotentialTauBars
NuMatrixSpectrumPreCalcnuNCBackground
NuMatrixSpectrumPreCalcbarNCBackground
NuMatrixSpectrumPreCalcwrongSignNuMus
NuMatrixSpectrumPreCalcwrongSignNuBars
Bool_t fDoneWsNeutrinos
 Flags to remember if the wrong sign has been precalculated.
Bool_t fDoneWsAntineutrinos

Detailed Description

Definition at line 17 of file NuMMRunLED.h.


Constructor & Destructor Documentation

NuMMRunLED::NuMMRunLED ( NuMMHelperCPT helper,
const NuMatrixSpectrum ndNuData,
const NuMatrixSpectrum ndBarData,
double  pot 
)

Definition at line 26 of file NuMMRunLED.cxx.

References Msg::kError, and MSG.

00030                : NuMMRunNuBar()
00031 {
00032   if (!helper) {
00033     MSG("NuMMRunLED",Msg::kError) << "Passed a null pointer for helper" << endl;
00034     assert(helper);
00035   }
00036   
00037   assert(helper->FDNuPurity());
00038   TH1D hBlank(*reinterpret_cast<const TH1D*>(helper->FDNuPurity()));
00039   hBlank.SetNameTitle("herror", "Blank default FD data: Something went wrong");
00040 
00041   NuMatrixSpectrum *tmpNu = new NuMatrixSpectrum(hBlank, pot);
00042   NuMatrixSpectrum *tmpBar = new NuMatrixSpectrum(hBlank, pot);
00043   Init(helper, ndNuData, ndBarData, tmpNu, tmpBar);
00044 
00045   delete tmpNu;
00046   delete tmpBar;
00047 }

NuMMRunLED::NuMMRunLED ( NuMMHelperCPT helper,
const NuMatrixSpectrum ndNuData,
const NuMatrixSpectrum ndBarData,
const NuMatrixSpectrum fdNuData,
const NuMatrixSpectrum fdBarData 
)

Definition at line 50 of file NuMMRunLED.cxx.

References Init().

00055                    : NuMMRunNuBar()
00056 {
00057   Init(helper, ndNuData, ndBarData, fdNuData, fdBarData);
00058 }

NuMMRunLED::NuMMRunLED ( const NuMMRunLED old  ) 

Definition at line 119 of file NuMMRunLED.cxx.

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

00119                                             : NuMMRunNuBar(old)
00120 {
00121   // Copy all the old histograms
00122   fndNuData =  new NuMatrixSpectrum(*old.fndNuData);
00123   fndBarData = new NuMatrixSpectrum(*old.fndBarData);
00124   ffdNuData =  new NuMatrixSpectrum(*old.ffdNuData);
00125   ffdBarData = new NuMatrixSpectrum(*old.ffdBarData);
00126 
00127   fHelper = old.fHelper;
00128   
00129   // Blank out all the Precache variables before reassignment
00130   PreCalcnuPrediction   = PreCalcbarPrediction      = 0;
00131   PreCalcpotentialNuTaus= PreCalcpotentialTauBars   = 0;
00132   PreCalcnuNCBackground = PreCalcbarNCBackground    = 0;
00133   PreCalcwrongSignNuMus = PreCalcwrongSignNuBars    = 0;
00134     
00135   // Make copies of all the precalculations frmo the old runner
00136   if (old.PreCalcnuPrediction)
00137     PreCalcnuPrediction = new NuMatrixSpectrum(*old.PreCalcnuPrediction);
00138   if (old.PreCalcbarPrediction)
00139     PreCalcbarPrediction = new NuMatrixSpectrum(*old.PreCalcbarPrediction);
00140   if (old.PreCalcpotentialNuTaus)
00141     PreCalcpotentialNuTaus = new NuMatrixSpectrum(*old.PreCalcpotentialNuTaus);
00142   if (old.PreCalcpotentialTauBars)
00143     PreCalcpotentialTauBars = new NuMatrixSpectrum(*old.PreCalcpotentialTauBars);
00144   
00145   if (old.PreCalcnuNCBackground)
00146     PreCalcnuNCBackground = new NuMatrixSpectrum(*old.PreCalcnuNCBackground);
00147   if (old.PreCalcbarNCBackground)
00148     PreCalcbarNCBackground = new NuMatrixSpectrum(*old.PreCalcbarNCBackground);
00149 
00150   if (old.PreCalcwrongSignNuMus)
00151     PreCalcwrongSignNuMus = new NuMatrixSpectrum(*old.PreCalcwrongSignNuMus);
00152   if (old.PreCalcwrongSignNuBars)
00153     PreCalcwrongSignNuBars = new NuMatrixSpectrum(*old.PreCalcwrongSignNuBars);
00154   
00155   fPredictNeutrinos = old.fPredictNeutrinos;
00156   fPredictAntiNeutrinos = old.fPredictAntiNeutrinos;
00157   
00158   // Set the wrong sign to false however - this copy may want different
00159   // oscillation parameters!
00160   fDoneWsNeutrinos = fDoneWsAntineutrinos = false;
00161 }

NuMMRunLED::~NuMMRunLED (  ) 

Definition at line 165 of file NuMMRunLED.cxx.

References NuMMRunNuBar::ffdBarData, NuMMRunNuBar::ffdNuData, NuMMRunNuBar::fndBarData, NuMMRunNuBar::fndNuData, and ResetCache().

00166 {
00167   ResetCache();
00168   
00169   // We now take copies of the data histograms - clean them up
00170   if (fndNuData)  delete fndNuData;   fndNuData   = 0;
00171   if (fndBarData) delete fndBarData;  fndBarData  = 0;
00172   if (ffdNuData)  delete ffdNuData;   ffdNuData   = 0;
00173   if (ffdBarData) delete ffdBarData;  ffdBarData  = 0;
00174 }


Member Function Documentation

void NuMMRunLED::CacheExtrapolation ( void   )  [private]

Definition at line 391 of file NuMMRunLED.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 Init(), MakeFDPred(), MakeFDPredBackgrounds(), PredictNuBars(), PredictNus(), ResetFDData(), ResetNDData(), and TrueComponents().

00392 {
00393     // Only cache once.
00394     if (fCached) return;
00395   
00396     ResetCache();
00397   
00398     // Caching variables, to reduce the workload of each step of the fitter
00399     // Initialise these the way they would be before
00400     PreCalcnuPrediction = new NuMatrixSpectrum(*fndNuData);
00401     PreCalcbarPrediction = new NuMatrixSpectrum(*fndBarData);
00402     
00403     NuMatrixSpectrum &nuPrediction = *PreCalcnuPrediction;
00404     NuMatrixSpectrum &barPrediction = *PreCalcbarPrediction;
00405     
00406     // Now we have prepared the extrapolation variables, calculate them
00407     // Get the neutrinos to ND Flux x Xsec
00408     nuPrediction.Multiply(fHelper->NDNuPurity());
00409     nuPrediction.RecoToTrue(fHelper->NDNuRecoVsTrue());
00410     nuPrediction.Divide(fHelper->NDNuEfficiency());
00411     nuPrediction.Divide(fndNuData->GetPOT());
00412     nuPrediction.Divide(fNDFidMass);
00413     
00414     // Get the antineutrinos to ND Flux x Xsec
00415     barPrediction.Multiply(fHelper->NDBarPurity());
00416     barPrediction.RecoToTrue(fHelper->NDBarRecoVsTrue());
00417     barPrediction.Divide(fHelper->NDBarEfficiency());
00418     barPrediction.Divide(fndBarData->GetPOT());
00419     barPrediction.Divide(fNDFidMass);
00420     
00421     // Create and link to the Tau components, before we include the
00422     // cross section in the predictions (tau Xsec is different)
00423     PreCalcpotentialNuTaus = new NuMatrixSpectrum(nuPrediction);
00424     PreCalcpotentialTauBars = new NuMatrixSpectrum(barPrediction);
00425     NuMatrixSpectrum &potentialNuTaus = *PreCalcpotentialNuTaus;
00426     NuMatrixSpectrum &potentialTauBars = *PreCalcpotentialTauBars;
00427 
00428     
00429     // Get the Neutrinos to the FD
00430     nuPrediction.ExtrapolateNDToFD(fHelper->NuBeamMatrixNuMuCCXSec());
00431     nuPrediction.Multiply(fFDFidMass);
00432     nuPrediction.Multiply(ffdNuData->GetPOT());
00433     // Reset the spectrum to the new POT
00434     nuPrediction.ResetPOT(ffdNuData->GetPOT());
00435     
00436     // Get the Antineutrinos to the FD
00437     barPrediction.ExtrapolateNDToFD(fHelper->BarBeamMatrixNuMuCCXSec());
00438     barPrediction.Multiply(fFDFidMass);
00439     barPrediction.Multiply(ffdBarData->GetPOT());
00440     // Reset the spectrum to the new PoT
00441     barPrediction.ResetPOT(ffdBarData->GetPOT());
00442     
00443     if (fHelper->DoTaus()) {
00444         // Get the Neutrinos to the FD
00445         if (fHelper->NuBeamMatrixTauCCXSec()) {
00446             potentialNuTaus.ExtrapolateNDToFD(fHelper->NuBeamMatrixTauCCXSec());
00447             potentialTauBars.ExtrapolateNDToFD(fHelper->BarBeamMatrixTauCCXSec());
00448         }
00449         else {
00450             MAXMSG("NuMMRunLED",Msg::kWarning,10) << "Doing tau extrapolation the old way." << endl;
00451             potentialNuTaus.Divide(fHelper->NuXSecGraph());
00452             potentialNuTaus.ExtrapolateNDToFD(fHelper->NuBeamMatrix());
00453             potentialNuTaus.Multiply(fHelper->XSecGraphNuTaus());
00454             potentialTauBars.Divide(fHelper->BarXSecGraph());
00455             potentialTauBars.ExtrapolateNDToFD(fHelper->BarBeamMatrix());
00456             potentialTauBars.Multiply(fHelper->XSecGraphTauBars());
00457         }
00458             
00459         potentialNuTaus.Multiply(fFDFidMass);
00460         potentialNuTaus.Multiply(ffdNuData->GetPOT());
00461         // Reset the spectrum to the new PoT
00462         potentialNuTaus.ResetPOT(ffdNuData->GetPOT());
00463         potentialNuTaus.Multiply(fHelper->FDNuTauEfficiency());
00464         
00465         // Get the Antineutrinos to the FD
00466         potentialTauBars.Multiply(fFDFidMass);
00467         potentialTauBars.Multiply(ffdBarData->GetPOT());
00468         // Reset the spectrum to the new PoT
00469         potentialTauBars.ResetPOT(ffdBarData->GetPOT());
00470         potentialTauBars.Multiply(fHelper->FDTauBarEfficiency());
00471     }
00472     else {
00473         PreCalcpotentialNuTaus->Multiply(0.0);
00474         PreCalcpotentialTauBars->Multiply(0.0);
00475     }
00476   
00477     // Now build the NC Spectrum, after the cross section calculation!
00478     PreCalcnuNCBackground = new NuMatrixSpectrum(*PreCalcnuPrediction);;
00479     PreCalcbarNCBackground = new NuMatrixSpectrum(*PreCalcbarPrediction);
00480     NuMatrixSpectrum &nuNCBackground = *PreCalcnuNCBackground;
00481     NuMatrixSpectrum &barNCBackground = *PreCalcbarNCBackground;  
00482 
00483     //Get the neutrino NC background
00484     nuNCBackground.Multiply(fHelper->FDNuEfficiency());
00485     nuNCBackground.TrueToReco(fHelper->FDNuRecoVsTrue());
00486     nuNCBackground.Divide(fHelper->FDNuPurity());
00487     nuNCBackground.Multiply(fHelper->FDNuNCContamination());
00488 
00489     //Get the antineutrino NC background
00490     barNCBackground.Multiply(fHelper->FDBarEfficiency());
00491     barNCBackground.TrueToReco(fHelper->FDBarRecoVsTrue());
00492     barNCBackground.Divide(fHelper->FDBarPurity());
00493     barNCBackground.Multiply(fHelper->FDBarNCContamination());
00494     
00495     // Now build the wrong sign spectrum
00496     PreCalcwrongSignNuMus = new NuMatrixSpectrum(*PreCalcnuPrediction);
00497     PreCalcwrongSignNuBars = new NuMatrixSpectrum(*PreCalcbarPrediction);
00498     NuMatrixSpectrum &wrongSignNuMus = *PreCalcwrongSignNuMus;
00499     NuMatrixSpectrum &wrongSignNuBars = *PreCalcwrongSignNuBars;
00500     
00501     // Do the Neutrino background for the antineutrino spectrum
00502     wrongSignNuMus.Multiply(fHelper->FDWrongSignNuEfficiency());
00503     
00504     // Do the Antineutrino background for the neutrino spectrum
00505     wrongSignNuBars.Multiply(fHelper->FDWrongSignBarEfficiency());
00506     
00507     // Apply the efficiency to the predictions
00508     barPrediction.Multiply(fHelper->FDBarEfficiency());
00509     nuPrediction.Multiply(fHelper->FDNuEfficiency());
00510       
00511     nuPrediction.SetName("NuMus");
00512     barPrediction.SetName("NuMuBars");
00513     
00514     if (fHelper->DoTaus()) {
00515       potentialNuTaus.SetName("NuTaus");
00516       potentialTauBars.SetName("NuTauBars");
00517     }
00518     
00519     wrongSignNuMus.SetName("WrongSign_NuMus");
00520     wrongSignNuBars.SetName("WrongSign_NuMuBars");
00521     
00522     nuNCBackground.SetName("NC_NuMus");
00523     barNCBackground.SetName("NC_NuMuBars");
00524   
00525     fCached = true;
00526   
00527     // If we have precalculated the wrong sign oscillations,
00528     // then we need to recalculate them next time we are given
00529     // the oscilaltion parameters. Reset the flags used to
00530     // control this  
00531     fDoneWsNeutrinos = fDoneWsAntineutrinos = false;
00532 }

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

Implements NuMMRun.

Definition at line 946 of file NuMMRunLED.cxx.

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

00947 {
00948   // Generate a prediction
00949   const pair<NuMatrixSpectrum,NuMatrixSpectrum> predictions =
00950     this->MakeFDPred(pars);
00951   Double_t like = 0;
00952   // Now, only count a likelihood for components we want - this is just
00953   // a constant offset, but should help speed things up a little.
00954   if (fPredictNeutrinos)
00955   {
00956     like += this->StatsLikelihood(predictions.first.Spectrum(),
00957         ffdNuData->Spectrum());
00958   }
00959   if (fPredictAntiNeutrinos) {
00960     like += this->StatsLikelihood(predictions.second.Spectrum(),
00961         ffdBarData->Spectrum());
00962   }
00963   return like;
00964 }

auto_ptr< NuMatrix > NuMMRunLED::GetFDData ( void   )  const [virtual]

Return the FD data used in extrapolation.

Reimplemented from NuMMRun.

Definition at line 1194 of file NuMMRunLED.cxx.

References NuMMRunNuBar::ffdBarData, NuMMRunNuBar::ffdNuData, and Munits::nm.

01195 {
01196   // NOTE: The data objects are stored as protected data members in the
01197   // NuMMRunNuBar class. However, the way the data is dealt with is very
01198   // specific to each extrapolation, so it turns out to be easier to 
01199   // do this here, in this leaf class than centrally.
01200   
01201   // Convert to a NuMatrixCPT, as charge-signs are separated internally
01202   NuMatrixCPT *nm = new NuMatrixCPT(ffdNuData, ffdBarData);
01203   return auto_ptr<NuMatrix>(nm);
01204 }

auto_ptr< NuMatrix > NuMMRunLED::GetNDData ( void   )  const [virtual]

Returns the ND data used in extrapolation.

Reimplemented from NuMMRun.

Definition at line 1180 of file NuMMRunLED.cxx.

References NuMMRunNuBar::fndBarData, NuMMRunNuBar::fndNuData, and Munits::nm.

01181 {
01182   // NOTE: The data objects are stored as protected data members in the
01183   // NuMMRunNuBar class. However, the way the data is dealt with is very
01184   // specific to each extrapolation, so it turns out to be easier to 
01185   // do this here, in this leaf class than centrally.
01186   
01187   // Convert to a NuMatrixCPT, as charge-signs are separated internally
01188   NuMatrixCPT *nm = new NuMatrixCPT(fndNuData, fndBarData);
01189   return auto_ptr<NuMatrix>(nm);
01190 }

void NuMMRunLED::Init ( NuMMHelperCPT helper,
const NuMatrixSpectrum ndNuData,
const NuMatrixSpectrum ndBarData,
const NuMatrixSpectrum fdNuData,
const NuMatrixSpectrum fdBarData 
) [private]

Definition at line 61 of file NuMMRunLED.cxx.

References NuMMHelperCPT::BarBeamMatrixNuMuCCXSec(), CacheExtrapolation(), fDoneWsAntineutrinos, fDoneWsNeutrinos, NuMMRunNuBar::ffdBarData, NuMMRunNuBar::ffdNuData, NuMMRunNuBar::fHelper, NuMMRunNuBar::fndBarData, NuMMRunNuBar::fndNuData, NuMMRunNuBar::fPredictAntiNeutrinos, NuMMRunNuBar::fPredictNeutrinos, Msg::kError, MSG, NuMMHelperCPT::NuBeamMatrixNuMuCCXSec(), NuMMHelperCPT::NuBeamMatrixTauCCXSec(), PreCalcbarNCBackground, PreCalcbarPrediction, PreCalcnuNCBackground, PreCalcnuPrediction, PreCalcpotentialNuTaus, PreCalcpotentialTauBars, PreCalcwrongSignNuBars, and PreCalcwrongSignNuMus.

Referenced by NuMMRunLED().

00066 {
00067   fDoneWsNeutrinos = false;
00068   fDoneWsAntineutrinos = false;  
00069   fPredictNeutrinos = true;
00070   fPredictAntiNeutrinos = true;
00071   
00072   if (!helper) {
00073     MSG("NuMMRunLED",Msg::kError) << "Passed a null pointer for helper" << endl;
00074     assert(helper);
00075   }
00076   if (!ndNuData) {
00077     MSG("NuMMRunLED",Msg::kError) << "Passed a null pointer for ndNuData" << endl;
00078     assert(ndNuData);
00079   }
00080   if (!ndBarData) {
00081     MSG("NuMMRunLED",Msg::kError) << "Passed a null pointer for ndBarData" << endl;
00082     assert(ndBarData);
00083   }
00084   if (!fdNuData) {
00085     MSG("NuMMRunLED",Msg::kError) << "Passed a null pointer for fdNuData" << endl;
00086     assert(fdNuData);
00087   }
00088   if (!fdBarData) {
00089     MSG("NuMMRunLED",Msg::kError) << "Passed a null pointer for fdBarData" << endl;
00090     assert(fdBarData);
00091   }  
00092   
00093   
00094   fndNuData   = new NuMatrixSpectrum(*ndNuData);
00095   fndBarData  = new NuMatrixSpectrum(*ndBarData);
00096   ffdNuData   = new NuMatrixSpectrum(*fdNuData);
00097   ffdBarData  = new NuMatrixSpectrum(*fdBarData);
00098 
00099   fHelper = helper;
00100   
00101   // Protect against being passed an ancient helper
00102   if ( !fHelper->NuBeamMatrixNuMuCCXSec()
00103        || !fHelper->BarBeamMatrixNuMuCCXSec()
00104        || !fHelper->NuBeamMatrixTauCCXSec()) {
00105     throw runtime_error("Have been passed an ancient helper without cross-section histograms");
00106   }
00107   
00108   // Blank out all the Precache variables
00109   PreCalcnuPrediction   = PreCalcbarPrediction      = 0;
00110   PreCalcpotentialNuTaus= PreCalcpotentialTauBars   = 0;
00111   PreCalcnuNCBackground = PreCalcbarNCBackground    = 0;
00112   PreCalcwrongSignNuMus = PreCalcwrongSignNuBars    = 0;
00113   
00114   CacheExtrapolation();
00115 }

void NuMMRunLED::InverseOscillateNuTau ( NuMatrixSpectrum nutau,
const NuMMParameters pars 
) const

Definition at line 1002 of file NuMMRunLED.cxx.

References NuMMParameters::Alpha(), NuMatrix1D::DecayMuToTau(), NuMMParameters::Delta1(), NuMMParameters::Dm2(), NuMMParameters::Dm221(), NuMMParameters::Epsilon(), NuMMRun::fDisappearanceModel, NuMatrix1D::InverseDecohere(), NuMatrixSpectrum::InverseOscillate(), NuMatrixSpectrum::InverseOscillateNSI(), NuMMParameters::LEDa(), NuMMParameters::LEDm0(), NuMMParameters::Mu2(), NuMatrixSpectrum::Oscillate_3flavour(), NuMatrixSpectrum::OscillateLED(), NuMMParameters::Sn2(), NuMMParameters::Theta12(), NuMMParameters::Theta13(), and NuMMParameters::Theta23().

Referenced by MakeFDPred(), MakeFDPredBackgrounds(), TrueComponents(), and WriteFDPredHistos().

01004 {
01005   if(fDisappearanceModel == 0) {
01006     nutau.InverseOscillate(pars.Dm2(), pars.Sn2());
01007   }
01008   if(fDisappearanceModel == 1)
01009     nutau.DecayMuToTau(pars.Dm2(), pars.Sn2(), pars.Alpha());
01010   if(fDisappearanceModel == 2)
01011     nutau.InverseDecohere(pars.Dm2(), pars.Sn2(), pars.Mu2());
01012   if(fDisappearanceModel == 3)
01013     nutau.InverseOscillateNSI(pars.Dm2(), pars.Sn2(), pars.Epsilon(), 1.0);
01014   if(fDisappearanceModel == 4)
01015     nutau.Oscillate_3flavour(pars.Dm2(), pars.Theta23(), pars.Dm221(), pars.Theta12(), pars.Theta13(), pars.Delta1(), 16);
01016   if(fDisappearanceModel == 5)
01017     nutau.OscillateLED(1, 2, 1,
01018                        pars.Theta12(), pars.Theta13(), pars.Theta23(),
01019                        pars.Delta1(),
01020                        pars.Dm221(), pars.Dm2(),
01021                        pars.LEDm0(), pars.LEDa());
01022 }

void NuMMRunLED::InverseOscillateTauBar ( NuMatrixSpectrum nutau,
const NuMMParameters pars 
) const

Definition at line 1058 of file NuMMRunLED.cxx.

References NuMMParameters::Alpha(), NuMatrix1D::DecayMuToTau(), NuMMParameters::Delta1(), NuMMParameters::Dm2(), NuMMParameters::Dm221(), NuMMParameters::Dm2Bar(), NuMMParameters::Epsilon(), NuMMRun::fDisappearanceModel, NuMatrix1D::InverseDecohere(), NuMatrixSpectrum::InverseOscillate(), NuMatrixSpectrum::InverseOscillateNSI(), NuMMParameters::LEDa(), NuMMParameters::LEDm0(), NuMMParameters::Mu2(), NuMatrixSpectrum::Oscillate_3flavour(), NuMatrixSpectrum::OscillateLED(), NuMMParameters::Sn2(), NuMMParameters::Sn2Bar(), NuMMParameters::Theta12(), NuMMParameters::Theta13(), and NuMMParameters::Theta23().

Referenced by MakeFDPred(), MakeFDPredBackgrounds(), TrueComponents(), and WriteFDPredHistos().

01060 {
01061   if(fDisappearanceModel == 0) {
01062     nutau.InverseOscillate(pars.Dm2Bar(), pars.Sn2Bar());
01063   }
01064   if(fDisappearanceModel == 1)
01065     nutau.DecayMuToTau(pars.Dm2Bar(), pars.Sn2Bar(), pars.Alpha());
01066   if(fDisappearanceModel == 2)
01067     nutau.InverseDecohere(pars.Dm2Bar(), pars.Sn2Bar(), pars.Mu2());
01068   if(fDisappearanceModel == 3)
01069     nutau.InverseOscillateNSI(pars.Dm2(), pars.Sn2(), pars.Epsilon(), -1.0);
01070   if(fDisappearanceModel == 4)
01071     nutau.Oscillate_3flavour(pars.Dm2(), pars.Theta23(), pars.Dm221(), pars.Theta12(), pars.Theta13(), pars.Delta1(), -16);
01072   if(fDisappearanceModel == 5)
01073     nutau.OscillateLED(1, 2, -1,
01074                        pars.Theta12(), pars.Theta13(), pars.Theta23(),
01075                        pars.Delta1(),
01076                        pars.Dm221(), pars.Dm2(),
01077                        pars.LEDm0(), pars.LEDa());
01078   
01079 }

pair< NuMatrixSpectrum, NuMatrixSpectrum > NuMMRunLED::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 573 of file NuMMRunLED.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, NuMMRunNuBar::fPredictAntiNeutrinos, NuMMRunNuBar::fPredictNeutrinos, NuMMRun::fQuietMode, InverseOscillateNuTau(), InverseOscillateTauBar(), OscillateNuBar(), OscillateNuMu(), PreCalcbarNCBackground, PreCalcbarPrediction, PreCalcnuNCBackground, PreCalcnuPrediction, PreCalcpotentialNuTaus, PreCalcpotentialTauBars, PreCalcwrongSignNuBars, PreCalcwrongSignNuMus, NuMMParameters::Sn2(), NuMMParameters::Sn2Bar(), NuMatrixSpectrum::Spectrum(), and NuMatrixSpectrum::TrueToReco().

Referenced by ComparePredWithData().

00574 {
00575   // Precache extrap, but only if needed
00576   CacheExtrapolation(); 
00577   
00578   // Output the oscillation settings!
00579   if (!fQuietMode) {
00580       //pars.PrintStatus();
00581     cout << "sn2: " << pars.Sn2() << "; dm2: " << pars.Dm2() 
00582     << "; sn2bar: " << pars.Sn2Bar() << "; dm2bar: " << pars.Dm2Bar()
00583        << "; epsilon: " << pars.Epsilon() << endl;
00584   }
00585   
00587   // For all neutrinos
00588 
00589   // Make copies of the prepared extrapolation variables, so that
00590   // we can alter them locally with the oscillation parameters
00591   NuMatrixSpectrum nuPrediction(*PreCalcnuPrediction);
00592   NuMatrixSpectrum barPrediction(*PreCalcbarPrediction);
00593   
00594   NuMatrixSpectrum potentialNuTaus(*PreCalcpotentialNuTaus);
00595   NuMatrixSpectrum potentialTauBars(*PreCalcpotentialTauBars);
00596 
00597   NuMatrixSpectrum nuNCBackground(*PreCalcnuNCBackground);
00598   NuMatrixSpectrum barNCBackground(*PreCalcbarNCBackground);
00599   
00600   NuMatrixSpectrum wrongSignNuMus(*PreCalcwrongSignNuMus);
00601   NuMatrixSpectrum wrongSignNuBars(*PreCalcwrongSignNuBars);
00602 
00604   // Processes for neutrinos
00605   
00606   if (fPredictNeutrinos)
00607   {  
00608     if (fHelper->DoTaus()) {
00609       // Oscillate the taus
00610       InverseOscillateNuTau(potentialNuTaus,pars);
00611       potentialNuTaus.TrueToReco(fHelper->FDNuTauRecoVsTrue());
00612     }
00613 
00614     // If we have pre-oscillated the wrong sign, do not do so again
00615     if (!fDoneWsAntineutrinos) {
00616         // Antineutrinos in the neutrino spectrum
00617         OscillateNuBar(wrongSignNuBars,pars);
00618         wrongSignNuBars.TrueToReco(fHelper->FDWrongSignBarRecoVsTrue());
00619     }
00620 
00621     // Oscillate the Neutrino spectrum!
00622     OscillateNuMu(nuPrediction,pars);
00623 
00624     // True to Reco
00625     nuPrediction.TrueToReco(fHelper->FDNuRecoVsTrue());
00626 
00627     //Add in backgrounds
00628     nuPrediction.Add(wrongSignNuBars);
00629     nuPrediction.Add(nuNCBackground);
00630     if (fHelper->DoTaus()) nuPrediction.Add(potentialNuTaus);
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   {
00642       if (fHelper->DoTaus()) {
00643         // Oscillate the taubars
00644         InverseOscillateTauBar(potentialTauBars,pars);
00645         potentialTauBars.TrueToReco(fHelper->FDTauBarRecoVsTrue());
00646       }
00647 
00648       // Only oscillate the wrong sign if it hasn't been done already
00649       if (!fDoneWsNeutrinos) {
00650           // Oscillate the wrong sign component
00651           // Neutrinos for the antineutrino spectrum
00652           OscillateNuMu(wrongSignNuMus,pars);
00653           wrongSignNuMus.TrueToReco(fHelper->FDWrongSignNuRecoVsTrue());
00654       }
00655       // Oscillate the antineutrino spectrum!
00656       OscillateNuBar(barPrediction,pars);
00657 
00658       // True to reco
00659      barPrediction.TrueToReco(fHelper->FDBarRecoVsTrue());
00660       
00661       // Add in backgrounds
00662       barPrediction.Add(wrongSignNuMus);
00663       barPrediction.Add(barNCBackground);
00664       if (fHelper->DoTaus()) barPrediction.Add(potentialTauBars);
00665   } else {
00666       // Scale the histogram to zero, so as not to confuse people
00667       barPrediction.Spectrum()->Scale(0);
00668   }
00669   
00670   // Return the two predictions, as a pair
00671   pair<NuMatrixSpectrum,NuMatrixSpectrum>
00672     predictions(nuPrediction,barPrediction);
00673   return predictions;
00674 }

std::vector< TH1D > NuMMRunLED::MakeFDPredBackgrounds ( const NuMMParameters pars  )  [virtual]

Definition at line 680 of file NuMMRunLED.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::ffdBarData, NuMMRunNuBar::ffdNuData, NuMMRunNuBar::fHelper, NuMMRunNuBar::fndBarData, NuMMRunNuBar::fndNuData, NuMMRun::fQuietMode, InverseOscillateNuTau(), InverseOscillateTauBar(), OscillateNuBar(), OscillateNuMu(), PreCalcbarNCBackground, PreCalcbarPrediction, PreCalcnuNCBackground, PreCalcnuPrediction, PreCalcpotentialNuTaus, PreCalcpotentialTauBars, PreCalcwrongSignNuBars, PreCalcwrongSignNuMus, NuMMParameters::Sn2(), NuMMParameters::Sn2Bar(), NuMatrixSpectrum::Spectrum(), and NuMatrixSpectrum::TrueToReco().

00681 {
00682   cout << "Making FD predictions, including background predictions" << endl << endl;
00683   //Set up a vector to push the histograms into.
00684   vector<TH1D> vHistos;
00685 
00686   //Put the ND data in the vector:
00687   TH1D hNDNuData(*(fndNuData->Spectrum()));
00688   hNDNuData.SetName("ndDataNQ");
00689   hNDNuData.SetTitle("ndDataNQ");
00690   vHistos.push_back(*(new TH1D(hNDNuData)));
00691   TH1D hNDBarData(*(fndBarData->Spectrum()));
00692   hNDBarData.SetName("ndDataPQ");
00693   hNDBarData.SetTitle("ndDataPQ");
00694   vHistos.push_back(*(new TH1D(hNDBarData)));
00695 
00696 
00697   // Precache extrap, but only if needed
00698   CacheExtrapolation(); 
00699   
00700   // Output the oscillation settings!
00701   if (!fQuietMode) {
00702       //pars.PrintStatus();
00703     cout << "sn2: " << pars.Sn2() << "; dm2: " << pars.Dm2() 
00704     << "; sn2bar: " << pars.Sn2Bar() << "; dm2bar: " << pars.Dm2Bar()
00705        << "; epsilon: " << pars.Epsilon() << endl;
00706   }
00707   
00709   // For all neutrinos
00710 
00711   // Make copies of the prepared extrapolation variables, so that
00712   // we can alter them locally with the oscillation parameters
00713   NuMatrixSpectrum nuPrediction(*PreCalcnuPrediction);
00714   NuMatrixSpectrum barPrediction(*PreCalcbarPrediction);
00715   
00716   NuMatrixSpectrum potentialNuTaus(*PreCalcpotentialNuTaus);
00717   NuMatrixSpectrum potentialTauBars(*PreCalcpotentialTauBars);
00718 
00719   NuMatrixSpectrum nuNCBackground(*PreCalcnuNCBackground);
00720   NuMatrixSpectrum barNCBackground(*PreCalcbarNCBackground);
00721   
00722   NuMatrixSpectrum wrongSignNuMus(*PreCalcwrongSignNuMus);
00723   NuMatrixSpectrum wrongSignNuBars(*PreCalcwrongSignNuBars);
00724 
00726   // Processes for neutrinos
00727   
00728   if (fHelper->DoTaus()) {
00729     // Oscillate the taus
00730     InverseOscillateNuTau(potentialNuTaus,pars);
00731     potentialNuTaus.TrueToReco(fHelper->FDNuTauRecoVsTrue());
00732   }
00733 
00734   // If we have pre-oscillated the wrong sign, do not do so again
00735   if (!fDoneWsAntineutrinos) {
00736     // Antineutrinos in the neutrino spectrum
00737     OscillateNuBar(wrongSignNuBars,pars);
00738     wrongSignNuBars.TrueToReco(fHelper->FDWrongSignBarRecoVsTrue());
00739   }
00740   
00741   // Oscillate the Neutrino spectrum!
00742   OscillateNuMu(nuPrediction,pars);
00743   
00744   // True to Reco
00745   nuPrediction.TrueToReco(fHelper->FDNuRecoVsTrue());
00746   
00747   // Write out the spectra for the prediction components
00748   // before we add in backgrounds
00749   TH1D hFDNoBackTrueNQ(*(nuPrediction.Spectrum()));
00750   hFDNoBackTrueNQ.SetName("fdBasePredictionNQ");
00751   vHistos.push_back(hFDNoBackTrueNQ);
00752   
00753   //Add in backgrounds
00754   nuPrediction.Add(wrongSignNuBars);
00755   nuPrediction.Add(nuNCBackground);
00756   if (fHelper->DoTaus()) nuPrediction.Add(potentialNuTaus);
00757 
00758   // Write out the wrong sign spectrum
00759   TH1D hFDWrongSignNQ(*(wrongSignNuBars.Spectrum()));
00760   hFDWrongSignNQ.SetName("fdWrongSignNQ");
00761   vHistos.push_back(hFDWrongSignNQ);
00762   
00763   // Write out the tau spectrum
00764   TH1D hFDTausNuMu(*(potentialNuTaus.Spectrum()));
00765   hFDTausNuMu.SetName("fdTausNQ");
00766   vHistos.push_back(hFDTausNuMu);
00767 
00768   // Write out the NC spectrum
00769   TH1D hFDNCNQ(*(nuNCBackground.Spectrum()));
00770   hFDNCNQ.SetName("fdNCNQ");
00771   vHistos.push_back(hFDNCNQ);
00772 
00773   // Write out the FD data spectrum
00774   TH1D hFDDataNQ(*(ffdNuData->Spectrum()));
00775   hFDDataNQ.SetName("fdDataNQ");
00776   vHistos.push_back(hFDDataNQ);
00777 
00778   // Write out the FD predicted spectrum
00779   TH1D hFDPredictionNQ(*(nuPrediction.Spectrum()));
00780   hFDPredictionNQ.SetName("fdPredictionNQ");
00781   vHistos.push_back(hFDPredictionNQ);
00782 
00784   // Processes for Antineutrinos
00785   
00786   if (fHelper->DoTaus()) {
00787     // Oscillate the taubars
00788     InverseOscillateTauBar(potentialTauBars,pars);
00789     potentialTauBars.TrueToReco(fHelper->FDTauBarRecoVsTrue());
00790   }
00791   
00792   // Only oscillate the wrong sign if it hasn't been done already
00793   if (!fDoneWsNeutrinos) {
00794     // Oscillate the wrong sign component
00795     // Neutrinos for the antineutrino spectrum
00796     OscillateNuMu(wrongSignNuMus,pars);
00797     wrongSignNuMus.TrueToReco(fHelper->FDWrongSignNuRecoVsTrue());
00798   }
00799   
00800   // Oscillate the antineutrino spectrum!
00801   OscillateNuBar(barPrediction,pars);
00802   
00803   // True to reco
00804   barPrediction.TrueToReco(fHelper->FDBarRecoVsTrue());
00805   
00806   // Write out the antineutrino spectrum, without backgrounds
00807   TH1D hFDNoBackTruePQ(*(barPrediction.Spectrum()));
00808   hFDNoBackTruePQ.SetName("fdBasePredictionPQ");
00809   vHistos.push_back(hFDNoBackTruePQ);
00810   
00811   // Add in backgrounds
00812   barPrediction.Add(wrongSignNuMus);
00813   barPrediction.Add(barNCBackground);
00814   if (fHelper->DoTaus()) barPrediction.Add(potentialTauBars);
00815 
00816   // write out the wrong sign spectrum
00817   TH1D hFDWrongSignPQ(*(wrongSignNuMus.Spectrum()));
00818   hFDWrongSignPQ.SetName("fdWrongSignPQ");
00819   vHistos.push_back(hFDWrongSignPQ);
00820 
00821   // Write out the tau spectrum
00822   TH1D hFDTausNuBar(*(potentialTauBars.Spectrum()));
00823   hFDTausNuBar.SetName("fdTausPQ");
00824   vHistos.push_back(hFDTausNuBar);
00825 
00826   // Write out the NC spectrum
00827   TH1D hFDNCPQ(*(barNCBackground.Spectrum()));
00828   hFDNCPQ.SetName("fdNCPQ");
00829   vHistos.push_back(hFDNCPQ);
00830 
00831   // Write out the FD data spectrum
00832   TH1D hFDDataPQ(*(ffdBarData->Spectrum()));
00833   hFDDataPQ.SetName("fdDataPQ");
00834   vHistos.push_back(hFDDataPQ);
00835 
00836   // Write out the total predicted spectrum
00837   TH1D hFDPredictionPQ(*(barPrediction.Spectrum()));
00838   hFDPredictionPQ.SetName("fdPredictionPQ");
00839   vHistos.push_back(hFDPredictionPQ);
00840 
00841 
00842   return vHistos;
00843 }

NuMMRunLED& NuMMRunLED::operator= ( const NuMMRunLED rhs  )  [private]

Disallow assignment: This is broken, so don't let people do it.

void NuMMRunLED::OscillateNuBar ( NuMatrixSpectrum numu,
const NuMMParameters pars 
) const

Definition at line 1025 of file NuMMRunLED.cxx.

References NuMMParameters::Alpha(), NuMatrix1D::DecayCC(), NuMatrix1D::Decohere(), NuMMParameters::Delta1(), NuMMParameters::Dm2(), NuMMParameters::Dm221(), NuMMParameters::Dm2Bar(), NuMMParameters::Epsilon(), NuMMRun::fDisappearanceModel, NuMMParameters::LEDa(), NuMMParameters::LEDm0(), NuMMParameters::Mu2(), NuMatrixSpectrum::Oscillate(), NuMatrixSpectrum::Oscillate_3flavour(), NuMatrixSpectrum::OscillateLED(), NuMatrixSpectrum::OscillateNSI(), NuMMParameters::Sn2(), NuMMParameters::Sn2Bar(), NuMMParameters::Theta12(), NuMMParameters::Theta13(), and NuMMParameters::Theta23().

Referenced by MakeFDPred(), MakeFDPredBackgrounds(), PreCalcWrongSign(), TrueComponents(), and WriteFDPredHistos().

01027 {
01028   switch(fDisappearanceModel){
01029   case 0:
01030     numu.Oscillate(pars.Dm2Bar(), pars.Sn2Bar());
01031     return;
01032   case 1:
01033     numu.DecayCC(pars.Dm2Bar(), pars.Sn2Bar(), pars.Alpha());
01034     return;
01035   case 2:
01036     numu.Decohere(pars.Dm2Bar(), pars.Sn2Bar(), pars.Mu2());
01037     return;
01038   case 3: 
01039     numu.OscillateNSI(pars.Dm2(), pars.Sn2(), pars.Epsilon(), -1.0);
01040     return;
01041   case 4:
01042     numu.Oscillate_3flavour(pars.Dm2(), pars.Theta23(), pars.Dm221(), pars.Theta12(), pars.Theta13(), pars.Delta1(), -14);
01043     return;
01044   case 5:
01045     numu.OscillateLED(1, 1, -1,
01046                       pars.Theta12(), pars.Theta13(), pars.Theta23(),
01047                       pars.Delta1(),
01048                       pars.Dm221(), pars.Dm2(),
01049                       pars.LEDm0(), pars.LEDa());
01050     return;    
01051 
01052   default:
01053     assert(0 && "Badly configured disappearance model");
01054   }
01055 }   

void NuMMRunLED::OscillateNuMu ( NuMatrixSpectrum numu,
const NuMMParameters pars 
) const

Definition at line 967 of file NuMMRunLED.cxx.

References NuMMParameters::Alpha(), NuMatrix1D::DecayCC(), NuMatrix1D::Decohere(), NuMMParameters::Delta1(), NuMMParameters::Dm2(), NuMMParameters::Dm221(), NuMMParameters::Epsilon(), NuMMRun::fDisappearanceModel, NuMMParameters::LEDa(), NuMMParameters::LEDm0(), NuMMParameters::Mu2(), NuMatrixSpectrum::Oscillate(), NuMatrixSpectrum::Oscillate_3flavour(), NuMatrixSpectrum::OscillateLED(), NuMatrixSpectrum::OscillateNSI(), NuMMParameters::Sn2(), NuMMParameters::Theta12(), NuMMParameters::Theta13(), and NuMMParameters::Theta23().

Referenced by MakeFDPred(), MakeFDPredBackgrounds(), PreCalcWrongSign(), TrueComponents(), and WriteFDPredHistos().

00969 {
00970   switch(fDisappearanceModel){
00971   case 0:
00972     numu.Oscillate(pars.Dm2(), pars.Sn2());
00973     cout<<"NuMu2"<<endl;
00974     return;
00975   case 1:
00976     numu.DecayCC(pars.Dm2(), pars.Sn2(), pars.Alpha());
00977     return;
00978   case 2:
00979     numu.Decohere(pars.Dm2(), pars.Sn2(), pars.Mu2());
00980     return;
00981   case 3:
00982     numu.OscillateNSI(pars.Dm2(), pars.Sn2(), pars.Epsilon(), 1.0);
00983     return;
00984   case 4:
00985     numu.Oscillate_3flavour(pars.Dm2(), pars.Theta23(), pars.Dm221(), pars.Theta12(), pars.Theta13(), pars.Delta1(), 14);
00986     return;
00987   case 5:
00988     numu.OscillateLED(1,      // initial flavor state (0 for e, 1 for mu, 2 for tau) 
00989                       1,      // final flavor state (0 for e, 1 for mu, 2 for tau) 
00990                       1,      // nu/nubar (1 for nu and -1 for nubar) 
00991                       pars.Theta12(), pars.Theta13(), pars.Theta23(),
00992                       pars.Delta1(),
00993                       pars.Dm221(), pars.Dm2(),
00994                       pars.LEDm0(), pars.LEDa());
00995     return;
00996   default:
00997     assert(0 && "Badly configured disappearance model");
00998   }
00999 }

Bool_t NuMMRunLED::PreCalcWrongSign ( const NuMMParameters pars  ) 

Definition at line 536 of file NuMMRunLED.cxx.

References fDoneWsAntineutrinos, fDoneWsNeutrinos, NuMMHelperCPT::FDWrongSignBarRecoVsTrue(), NuMMHelperCPT::FDWrongSignNuRecoVsTrue(), NuMMRunNuBar::fHelper, NuMMRunNuBar::fPredictAntiNeutrinos, NuMMRunNuBar::fPredictNeutrinos, NuMMRun::fQuietMode, OscillateNuBar(), OscillateNuMu(), PreCalcwrongSignNuBars, PreCalcwrongSignNuMus, and NuMatrixSpectrum::TrueToReco().

00537 {
00538     // Did we change anything in this run?
00539     Bool_t change = false;
00540     
00541     // Precalculate the wrong sign, if we have disabled predictions
00542     // for that class, and it hasn't been done already. This should only
00543     // be done once, unless of course the user does something strange like
00544     // turning on neutrino prediction in the middle of an extrapolation.
00545     if(!fDoneWsNeutrinos) {
00546         if (!fPredictNeutrinos)
00547         {
00548             change = true;
00549             if (!fQuietMode) cout << "Neutrino prediction off: Precalculating wrong sign oscillation." << endl;
00550             OscillateNuMu(*PreCalcwrongSignNuMus,pars);
00551             PreCalcwrongSignNuMus->TrueToReco(fHelper->FDWrongSignNuRecoVsTrue());
00552             fDoneWsNeutrinos = true;
00553         }
00554     }
00555     if(!fPredictAntiNeutrinos) {
00556         if (!fDoneWsAntineutrinos)
00557         {
00558             change = true;
00559             if (!fQuietMode) cout << "Antineutrino prediction off: Precalculating wrong sign oscillation." << endl;
00560             OscillateNuBar(*PreCalcwrongSignNuBars,pars);
00561             PreCalcwrongSignNuBars->TrueToReco(fHelper->FDWrongSignBarRecoVsTrue());
00562             fDoneWsAntineutrinos = true;
00563         }
00564     }
00565     
00566     // Return the flag saying if we have changed anything
00567     return change;
00568 }

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

Reimplemented from NuMMRunNuBar.

Definition at line 58 of file NuMMRunLED.h.

References NuMMRunNuBar::fPredictAntiNeutrinos.

00058 { return fPredictAntiNeutrinos;}

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

Reimplemented from NuMMRunNuBar.

Definition at line 52 of file NuMMRunLED.h.

References CacheExtrapolation(), fDoneWsAntineutrinos, and NuMMRunNuBar::fPredictAntiNeutrinos.

00052                                              {
00053       fPredictAntiNeutrinos = predict;
00054       if(fDoneWsAntineutrinos) CacheExtrapolation();
00055   }

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

Reimplemented from NuMMRunNuBar.

Definition at line 57 of file NuMMRunLED.h.

References NuMMRunNuBar::fPredictNeutrinos.

00057 { return fPredictNeutrinos;}

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

Will the (anti)neutrino prediction be calculated?

Reimplemented from NuMMRunNuBar.

Definition at line 47 of file NuMMRunLED.h.

References CacheExtrapolation(), fDoneWsNeutrinos, and NuMMRunNuBar::fPredictNeutrinos.

00047                                           {
00048       fPredictNeutrinos = predict;
00049       if(fDoneWsNeutrinos) CacheExtrapolation();
00050   }

void NuMMRunLED::ResetCache (  ) 
void NuMMRunLED::ResetFDData ( const NuMatrix fddata  )  [virtual]

Replace the FD data used in extrapolation.

Reimplemented from NuMMRun.

Definition at line 1119 of file NuMMRunLED.cxx.

References CacheExtrapolation(), NuMatrixSpectrum::Copy(), NuMMRunNuBar::ffdBarData, NuMMRunNuBar::ffdNuData, NuMatrix1D::GetNuMatrixSpectrum(), NuMatrix::GetPOT(), Msg::kFatal, MSG, NuMatrixCPT::NQ(), NuMatrixCPT::PQ(), and ResetCache().

01120 {
01121   // Attempt downcast to a CPT object
01122   const NuMatrixCPT *cpt = dynamic_cast<const NuMatrixCPT*>(&fddata);
01123   if (!cpt) {
01124     MSG("NuMMRunLED",Msg::kFatal) << "Error: Have not been passed a CPT matrix object to reset ND Data" << endl;
01125   }
01126 
01127   // Pointers to temporary storage if we need to convert NuMatrix1D->NuMatrixspectrum
01128   // This is because we use borrowed pointers normally, but by creating a new NuMatrixSpectrum
01129   // we become responsible for destroying the objects, and leaking them is not an option.
01130   auto_ptr<NuMatrixSpectrum> tmpPQ, tmpNQ;
01131   
01132   // Extract the NQ and PQ spectra
01133   const NuMatrixSpectrum *pq = dynamic_cast<const NuMatrixSpectrum*>(cpt->PQ());
01134   if (!pq) {
01135     // Try a NuMatrix1D, then convert it to a NuMatrixSpecturm if it is
01136     const NuMatrix1D *nm1d = dynamic_cast<const NuMatrix1D*>(cpt->PQ());
01137     if (!nm1d) {
01138       // Fail if we cannot handle this histogram
01139       MSG("NuMMRunLED",Msg::kFatal) << "Error: PQ spectrum appears not to be a NuMatrixSpectrum or NuMatrix1D" << endl;
01140     }
01141     tmpPQ.reset(nm1d->GetNuMatrixSpectrum().Copy());
01142     pq = tmpPQ.get();
01143   }
01144   
01145   const NuMatrixSpectrum *nq = dynamic_cast<NuMatrixSpectrum*>(cpt->NQ());
01146   if (!nq) {
01147     // Try a NuMatrix1D, then convert it to a NuMatrixSpecturm if it is
01148     const NuMatrix1D *nm1d = dynamic_cast<const NuMatrix1D*>(cpt->NQ());
01149     if (!nm1d) {
01150       // Fail if we cannot handle this histogram
01151       MSG("NuMMRunLED",Msg::kFatal) << "Error: NQ spectrum appears not to be a NuMatrixSpectrum" << endl;
01152     }
01153     tmpNQ.reset(nm1d->GetNuMatrixSpectrum().Copy());
01154     nq = tmpNQ.get();
01155   }
01156   
01157   // Store the old FD data POT
01158   Double_t oldPOT = ffdNuData->GetPOT();
01159   
01160   // Delete the old spectra, if they exist
01161   if (ffdNuData) delete ffdNuData; ffdNuData = 0;
01162   if (ffdBarData) delete ffdBarData; ffdBarData = 0;
01163   
01164   // Copy the spectra to this object
01165   ffdNuData = nq->Copy();
01166   ffdBarData = pq->Copy();
01167   
01168   // If the POT has changed, we need to recache the extrapolation
01169   if (ffdNuData->GetPOT() != oldPOT)
01170   {
01171     // cout << "POT CHANGE: " << oldPOT << " -> " << ffdNuData->GetPOT()
01172     //   << " = change of " << ffdNuData->GetPOT() - oldPOT << " POT" << endl;
01173     ResetCache();
01174     CacheExtrapolation();
01175   }
01176 }

void NuMMRunLED::ResetNDData ( const NuMatrix nddata  )  [virtual]

Replace the ND data used in extrapolation.

Reimplemented from NuMMRun.

Definition at line 1084 of file NuMMRunLED.cxx.

References CacheExtrapolation(), NuMatrixSpectrum::Copy(), NuMMRunNuBar::fndBarData, NuMMRunNuBar::fndNuData, Msg::kFatal, MSG, NuMatrixCPT::NQ(), NuMatrixCPT::PQ(), and ResetCache().

01085 {
01086   // Attempt downcast to a CPT object
01087   const NuMatrixCPT *cpt = dynamic_cast<const NuMatrixCPT*>(&nddata);
01088   if (!cpt) {
01089     MSG("NuMMRunLED",Msg::kFatal) << "Error: Have not been passed a CPT matrix object to reset ND Data" << endl;
01090   }
01091   
01092   // Extract the NQ and PQ spectra
01093   const NuMatrixSpectrum *pq = dynamic_cast<NuMatrixSpectrum*>(cpt->PQ());
01094   if (!pq) {
01095     MSG("NuMMRunLED",Msg::kFatal) << "Error: PQ spectrum appears not to be a NuMatrixSpectrum" << endl;
01096   }
01097   
01098   const NuMatrixSpectrum *nq = dynamic_cast<NuMatrixSpectrum*>(cpt->NQ());
01099   if (!nq) {
01100     MSG("NuMMRunLED",Msg::kFatal) << "Error: NQ spectrum appears not to be a NuMatrixSpectrum" << endl;
01101   }
01102   
01103   // Delete the old spectra, if they exist
01104   if (fndNuData) delete fndNuData; fndNuData = 0;
01105   if (fndBarData) delete fndBarData; fndBarData = 0;
01106   
01107   // Now we have the spectra!
01108   fndNuData = nq->Copy();
01109   fndBarData = pq->Copy();
01110   
01111   // Recalculate the extrapolation caches
01112   ResetCache();
01113   CacheExtrapolation();
01114 }

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

Definition at line 847 of file NuMMRunLED.cxx.

References CacheExtrapolation(), fDoneWsAntineutrinos, fDoneWsNeutrinos, Msg::kWarning, MAXMSG, ResetCache(), and TrueComponents().

00848 {
00849   if (fDoneWsNeutrinos || fDoneWsAntineutrinos) {
00850     MAXMSG("NuMMRunLED",Msg::kWarning,10) << "Already True-To-Recoed the wrong signs.  Re-caching -- this may be slow event-by-event." << endl;
00851     ResetCache();
00852   }
00853 
00854   CacheExtrapolation(); 
00855   
00856   return static_cast<const NuMMRunLED *>(this)->TrueComponents(pars, s);
00857 }

NuMatrixSpectrum NuMMRunLED::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 859 of file NuMMRunLED.cxx.

References NuMMParameters::Dm2(), NuMMParameters::Dm2Bar(), NuMMParameters::Epsilon(), NuMMRunNuBar::fCached, fDoneWsAntineutrinos, fDoneWsNeutrinos, NuMMRunNuBar::fPredictAntiNeutrinos, NuMMRunNuBar::fPredictNeutrinos, NuMMRun::fQuietMode, InverseOscillateNuTau(), InverseOscillateTauBar(), 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, MAXMSG, MSG, OscillateNuBar(), OscillateNuMu(), PreCalcbarNCBackground, PreCalcbarPrediction, PreCalcnuNCBackground, PreCalcnuPrediction, PreCalcpotentialNuTaus, PreCalcpotentialTauBars, PreCalcwrongSignNuBars, PreCalcwrongSignNuMus, NuMatrixSpectrum::SetName(), NuMMParameters::Sn2(), NuMMParameters::Sn2Bar(), and NuMatrixSpectrum::Spectrum().

Referenced by TrueComponents().

00860 {
00861   if (fDoneWsNeutrinos || fDoneWsAntineutrinos) {
00862     MAXMSG("NuMMRunLED",Msg::kWarning,10) << "Already True-To-Recoed the wrong signs.  Re-caching -- this may be slow event-by-event." << endl;
00863     MSG("NuMMRunLED",Msg::kFatal) << "Cannot recache as TrueComponents is now constant" << endl;    
00864   } 
00865   
00866   // Check that we are cached and throw an error otherwise
00867   if (!fCached) {
00868     MSG("NuMMRunLED",Msg::kError) << "Have not cached extrapolation prior to asking for true components!" << endl;
00869     assert(fCached);
00870   }
00871   
00872   // Output the oscillation settings!
00873   if (!fQuietMode) {
00874     cout << "sn2: " << pars.Sn2() << "; dm2: " << pars.Dm2() 
00875          << "; sn2bar: " << pars.Sn2Bar() << "; dm2bar: " << pars.Dm2Bar()
00876          << "; epsilon: " << pars.Epsilon() << endl;
00877   }
00878   
00879   // No appeared spectrum for oscillations
00880   if (s == kAppearedPQ || s == kAppearedNQ) {
00881     NuMatrixSpectrum blank(*PreCalcnuPrediction);
00882     blank.SetName("Blank");
00883     blank.Spectrum()->Scale(0);
00884     return blank;    
00885   }
00886   
00887   // Request NQ spectrum, but no NuBar Predictions OR
00888   // Request PQ spectrum, but no NuMu Predictions
00889   if ( (s < 0 && !fPredictNeutrinos) || 
00890       (s > 0 && !fPredictAntiNeutrinos) ) {
00891     NuMatrixSpectrum blank(*PreCalcnuPrediction);
00892     blank.SetName("Blank");
00893     blank.Spectrum()->Scale(0);
00894     return blank;
00895   }
00896   
00897   if (s == kSignalPQ) {
00898     NuMatrixSpectrum barPrediction(*PreCalcbarPrediction);
00899     OscillateNuBar(barPrediction,pars);
00900     return barPrediction;
00901   }
00902   else if (s == kSignalNQ) {
00903     NuMatrixSpectrum nuPrediction(*PreCalcnuPrediction);  
00904     OscillateNuMu(nuPrediction,pars);
00905     return nuPrediction;
00906   }
00907   else if (s == kWrongSignPQ) {
00908     NuMatrixSpectrum wrongSignNuMus(*PreCalcwrongSignNuMus);
00909     OscillateNuMu(wrongSignNuMus,pars);
00910     return wrongSignNuMus;
00911   }
00912   else if (s == kWrongSignNQ) {
00913     NuMatrixSpectrum wrongSignNuBars(*PreCalcwrongSignNuBars);
00914     OscillateNuBar(wrongSignNuBars,pars);
00915     return wrongSignNuBars;
00916   }  
00917   else if (s == kNCPQ) {
00918     NuMatrixSpectrum barNCBackground(*PreCalcbarNCBackground);
00919     return barNCBackground;
00920   }
00921   else if (s == kNCNQ) {
00922     NuMatrixSpectrum nuNCBackground(*PreCalcnuNCBackground);
00923     return nuNCBackground;
00924   }
00925   else if (s == kTauPQ) {
00926     NuMatrixSpectrum potentialTauBars(*PreCalcpotentialTauBars);
00927     InverseOscillateTauBar(potentialTauBars,pars);
00928     return potentialTauBars;
00929   }
00930   else if (s == kTauNQ) {
00931     NuMatrixSpectrum potentialNuTaus(*PreCalcpotentialNuTaus);
00932     InverseOscillateNuTau(potentialNuTaus,pars);
00933     return potentialNuTaus;
00934   }
00935   else {
00936     MSG("NuMMRunTransitions",Msg::kWarning) << "Requested unknown prediction #" << s << ", returning blank." << endl;
00937     NuMatrixSpectrum blank(*PreCalcnuPrediction);
00938     blank.SetName("Blank");
00939     blank.Spectrum()->Scale(0);
00940     return blank;
00941   }
00942 }

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

Implements NuMMRun.

Definition at line 205 of file NuMMRunLED.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, NuMMRunNuBar::fPredictAntiNeutrinos, NuMMRunNuBar::fPredictNeutrinos, NuMMRun::fQuietMode, InverseOscillateNuTau(), InverseOscillateTauBar(), OscillateNuBar(), OscillateNuMu(), PreCalcbarNCBackground, PreCalcbarPrediction, PreCalcnuNCBackground, PreCalcnuPrediction, PreCalcpotentialNuTaus, PreCalcpotentialTauBars, PreCalcwrongSignNuBars, PreCalcwrongSignNuMus, NuMMParameters::Sn2(), NuMMParameters::Sn2Bar(), NuMatrixSpectrum::Spectrum(), and NuMatrixSpectrum::TrueToReco().

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


Member Data Documentation

Bool_t NuMMRunLED::fDoneWsNeutrinos [private]

Flags to remember if the wrong sign has been precalculated.

Definition at line 104 of file NuMMRunLED.h.

Referenced by CacheExtrapolation(), Init(), MakeFDPred(), MakeFDPredBackgrounds(), NuMMRunLED(), PreCalcWrongSign(), PredictNus(), TrueComponents(), and WriteFDPredHistos().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1