NuMMRunNoChargeCut Class Reference

#include <NuMMRunNoChargeCut.h>

Inheritance diagram for NuMMRunNoChargeCut:

NuMMRun List of all members.

Public Member Functions

 NuMMRunNoChargeCut (NuMMHelperNoChargeCut *helper, NuHistInterpolator *ndData, NuHistInterpolator *fdData)
virtual NuMatrixSpectrum MakeFDPred (const NuMMParameters &pars)
virtual Double_t ComparePredWithData (const NuMMParameters &pars)
virtual std::vector< TH1D > WriteFDPredHistos (const NuMMParameters &pars) const

Private Attributes

NuMMHelperNoChargeCutfHelper

Detailed Description

Definition at line 15 of file NuMMRunNoChargeCut.h.


Constructor & Destructor Documentation

NuMMRunNoChargeCut::NuMMRunNoChargeCut ( NuMMHelperNoChargeCut helper,
NuHistInterpolator ndData,
NuHistInterpolator fdData 
)

Definition at line 13 of file NuMMRunNoChargeCut.cxx.

00016   : NuMMRun()
00017 {
00018   fHelper = helper;
00019   fNDData = ndData;
00020   fFDData = fdData;
00021 }


Member Function Documentation

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

Implements NuMMRun.

Definition at line 234 of file NuMMRunNoChargeCut.cxx.

00235 {
00236   NuMatrixSpectrum prediction(this->MakeFDPred(pars));
00237   prediction.RebinForFit();
00238   NuMatrixSpectrum fdData(fFDData->ProvideSpectrum(0.0),
00239                           fFDData->PoT());
00240   fdData.RebinForFit();
00241   return this->StatsLikelihood(prediction.Spectrum(),
00242                                fdData.Spectrum());
00243 }

NuMatrixSpectrum NuMMRunNoChargeCut::MakeFDPred ( const NuMMParameters pars  )  [virtual]

Definition at line 142 of file NuMMRunNoChargeCut.cxx.

References NuMatrix1D::Add(), NuMMParameters::Alpha(), NuMMHelperNoChargeCut::BeamMatrixNuMuCCXSec(), count, NuMatrix1D::DecayCC(), NuMatrix1D::Decohere(), NuMatrixSpectrum::Divide(), NuMMParameters::Dm2(), NuMatrixSpectrum::ExtrapolateNDToFD(), NuMMHelperNoChargeCut::FDEfficiency(), NuMMRun::fDisappearanceModel, NuMMHelperNoChargeCut::FDPurity(), NuMMHelperNoChargeCut::FDRecoVsTrue(), NuMMHelperNoChargeCut::FDTauEfficiency(), NuMMHelperNoChargeCut::FDTauRecoVsTrue(), NuMMRun::fFakeDataStudy, NuMMRun::fFDData, NuMMRun::fFDFidMass, fHelper, NuMMRun::fNDData, NuMMRun::fNDFidMass, NuMMRun::fQuietMode, NuMMRun::fShowerEnergyShifter, NuMatrixSpectrum::InverseOscillate(), NuMMParameters::Mu2(), NuMatrixSpectrum::Multiply(), NuMMParameters::NCBackgroundScale(), NuMMHelperNoChargeCut::NDEfficiency(), NuMMHelperNoChargeCut::NDPurity(), NuMMHelperNoChargeCut::NDRecoVsTrue(), NuMMParameters::Normalisation(), NuMatrixSpectrum::Oscillate(), NuHistInterpolator::PoT(), NuHistInterpolator::ProvideSpectrum(), NuMatrixSpectrum::RecoToTrue(), NuMMParameters::ShwEnScale(), NuMMParameters::Sn2(), NuMatrixSpectrum::Spectrum(), NuMatrix1D::Subtract(), NuMatrixSpectrum::TrueToReco(), NuMMHelperNoChargeCut::XSecGraph(), and NuMMHelperNoChargeCut::XSecGraphTaus().

00143 {
00144    static Int_t count=0;
00145      if ((!(count%3)) && (!fQuietMode)){
00146  cout << "8sn2: " << pars.Sn2() << "; dm2: " << pars.Dm2()
00147       << "; norm: " << pars.Normalisation()
00148       << "; NCBack: " << pars.NCBackgroundScale()
00149       << "; ShwEn: " << pars.ShwEnScale() << endl;
00150      }
00151 
00152   NuMatrixSpectrum prediction(fNDData->ProvideSpectrum(pars.ShwEnScale()));
00153 
00154   NuMatrixSpectrum signal(prediction);
00155   signal.Multiply(fHelper->NDPurity());
00156   NuMatrixSpectrum background(prediction);
00157   background.Subtract(signal);
00158   background.Multiply(pars.NCBackgroundScale());
00159   prediction.Subtract(background);
00160 
00161   prediction.RecoToTrue(fHelper->NDRecoVsTrue());
00162   prediction.Divide(fHelper->NDEfficiency());
00163 //   prediction.Divide(fHelper->XSecGraph());
00164 //   X-secs are in the BM for no charge cut
00165   prediction.Divide(fNDData->PoT());
00166   prediction.Divide(fNDFidMass);
00167   prediction.ExtrapolateNDToFD(fHelper->BeamMatrixNuMuCCXSec());
00168   prediction.Multiply(fFDFidMass);
00169   prediction.Multiply(fFDData->PoT());
00170 
00171   NuMatrixSpectrum potentialTaus(prediction);
00172   //Pretend they're all numus for now. Should be pretty close.
00173   potentialTaus.Divide(fHelper->XSecGraph());
00174   potentialTaus.Multiply(fHelper->XSecGraphTaus());
00175   potentialTaus.Multiply(fHelper->FDTauEfficiency());
00176 
00177 //   prediction.Multiply(fHelper->XSecGraph());
00178 //   X-secs are in the BM.
00179   prediction.Multiply(fHelper->FDEfficiency());
00180 
00181   NuMatrixSpectrum unoscTrueSpectrum(prediction);
00182   unoscTrueSpectrum.TrueToReco(fHelper->FDRecoVsTrue());
00183   NuMatrixSpectrum ncBackground(unoscTrueSpectrum);
00184   ncBackground.Divide(fHelper->FDPurity());
00185   ncBackground.Subtract(unoscTrueSpectrum);
00186   ncBackground.Multiply(pars.NCBackgroundScale());
00187 
00188   potentialTaus.InverseOscillate(pars.Dm2(),pars.Sn2());
00189   potentialTaus.TrueToReco(fHelper->FDTauRecoVsTrue());
00190 
00191 
00192   if (0==fDisappearanceModel){
00193     prediction.Oscillate(pars.Dm2(),pars.Sn2());
00194   }
00195   else if (1==fDisappearanceModel){
00196     prediction.DecayCC(pars.Dm2(),pars.Sn2(),pars.Alpha());
00197   }
00198   else if (2==fDisappearanceModel){
00199     prediction.Decohere(pars.Dm2(),pars.Sn2(),pars.Mu2());
00200   }
00201   else{
00202     cout << "Badly configured disappearance model. "
00203          << "Oscillating as that's probably what you want, "
00204          << "but not including taus."
00205          << endl;
00206     prediction.Oscillate(pars.Dm2(),pars.Sn2());
00207   }
00208   prediction.TrueToReco(fHelper->FDRecoVsTrue());
00209   prediction.Add(ncBackground);
00210   if (0==fDisappearanceModel && (!fFakeDataStudy)){
00211     prediction.Add(potentialTaus);
00212   }
00213 
00214   prediction.Multiply(pars.Normalisation());
00215 
00216   ++count;
00217 
00218   if (fFakeDataStudy){
00219     NuMatrixSpectrum shiftedPrediction(*(prediction.Spectrum()));
00220     return shiftedPrediction;
00221   }
00222   else{
00223     TH1D hshifted(fShowerEnergyShifter->
00224                   ApplyShiftTo(*(prediction.Spectrum()),
00225                                -1.0*pars.ShwEnScale()));
00226     NuMatrixSpectrum shiftedPrediction(hshifted);
00227     return shiftedPrediction;
00228   }
00229 
00230 }

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

Implements NuMMRun.

Definition at line 25 of file NuMMRunNoChargeCut.cxx.

References NuMatrix1D::Add(), NuMMParameters::Alpha(), NuMatrix1D::DecayCC(), NuMatrix1D::Decohere(), NuMatrixSpectrum::Divide(), NuMMParameters::Dm2(), NuMatrixSpectrum::ExtrapolateNDToFD(), NuMatrixSpectrum::InverseOscillate(), NuMMParameters::Mu2(), NuMatrixSpectrum::Multiply(), NuMMParameters::NCBackgroundScale(), NuMMParameters::Normalisation(), NuMatrixSpectrum::Oscillate(), NuMatrixSpectrum::RecoToTrue(), NuMMParameters::ShwEnScale(), NuMMParameters::Sn2(), NuMatrixSpectrum::Spectrum(), NuMatrix1D::Subtract(), and NuMatrixSpectrum::TrueToReco().

00026 {
00027   vector<TH1D> vHistos;
00028   TH1D hNDData(fNDData->ProvideSpectrum(pars.ShwEnScale()));
00029   hNDData.SetName("ndData");
00030   hNDData.SetTitle("ndData");
00031   vHistos.push_back(*(new TH1D(hNDData)));
00032 
00033   NuMatrixSpectrum prediction(fNDData->ProvideSpectrum(pars.ShwEnScale()));
00034 
00035   NuMatrixSpectrum signal(prediction);
00036   signal.Multiply(fHelper->NDPurity());
00037   NuMatrixSpectrum background(prediction);
00038   background.Subtract(signal);
00039   background.Multiply(pars.NCBackgroundScale());
00040   prediction.Subtract(background);
00041 
00042   TH1D ndNCBackground(*(background.Spectrum()));
00043   ndNCBackground.SetName("ndNCBackground");
00044   ndNCBackground.SetTitle("ndNCBackground");
00045   vHistos.push_back(ndNCBackground);
00046 
00047   prediction.RecoToTrue(fHelper->NDRecoVsTrue());
00048   prediction.Divide(fHelper->NDEfficiency());
00049 //   prediction.Divide(fHelper->XSecGraph());
00050 //   X-secs are in the BM for no charge cut
00051   prediction.Divide(fNDData->PoT());
00052   prediction.Divide(fNDFidMass);
00053   prediction.ExtrapolateNDToFD(fHelper->BeamMatrixNuMuCCXSec());
00054   prediction.Multiply(fFDFidMass);
00055   prediction.Multiply(fFDData->PoT());
00056 
00057   NuMatrixSpectrum potentialTaus(prediction);
00058   //Pretend they're all numus for now. Should be pretty close.
00059   potentialTaus.Divide(fHelper->XSecGraph());
00060   potentialTaus.Multiply(fHelper->XSecGraphTaus());
00061   potentialTaus.Multiply(fHelper->FDTauEfficiency());
00062 
00063 //   prediction.Multiply(fHelper->XSecGraph());
00064 //   X-secs are in the BM.
00065   prediction.Multiply(fHelper->FDEfficiency());
00066 
00067   NuMatrixSpectrum unoscTrueSpectrum(prediction);
00068   unoscTrueSpectrum.TrueToReco(fHelper->FDRecoVsTrue());
00069   NuMatrixSpectrum ncBackground(unoscTrueSpectrum);
00070   ncBackground.Divide(fHelper->FDPurity());
00071   ncBackground.Subtract(unoscTrueSpectrum);
00072   ncBackground.Multiply(pars.NCBackgroundScale());
00073 
00074   potentialTaus.InverseOscillate(pars.Dm2(),pars.Sn2());
00075   potentialTaus.TrueToReco(fHelper->FDTauRecoVsTrue());
00076 
00077 
00078   if (0==fDisappearanceModel){
00079     prediction.Oscillate(pars.Dm2(),pars.Sn2());
00080   }
00081   else if (1==fDisappearanceModel){
00082     prediction.DecayCC(pars.Dm2(),pars.Sn2(),pars.Alpha());
00083   }
00084   else if (2==fDisappearanceModel){
00085     prediction.Decohere(pars.Dm2(),pars.Sn2(),pars.Mu2());
00086   }
00087   else{
00088     cout << "Badly configured disappearance model. "
00089          << "Oscillating as that's probably what you want, "
00090          << "but not including taus."
00091          << endl;
00092     prediction.Oscillate(pars.Dm2(),pars.Sn2());
00093   }
00094   prediction.TrueToReco(fHelper->FDRecoVsTrue());
00095   prediction.Add(ncBackground);
00096   if (0==fDisappearanceModel && (!fFakeDataStudy)){
00097     prediction.Add(potentialTaus);
00098   }
00099 
00100   prediction.Multiply(pars.Normalisation());
00101 
00102   TH1D* hshifted = new TH1D(fShowerEnergyShifter->ApplyShiftTo(*(prediction.Spectrum()),-1.0*pars.ShwEnScale()));
00103   NuMatrixSpectrum shiftedPrediction(*hshifted);
00104 
00105   TH1D hFDPrediction(*(shiftedPrediction.Spectrum()));
00106   hFDPrediction.SetName("fdPrediction");
00107   vHistos.push_back(hFDPrediction);
00108 
00109   potentialTaus.Multiply(pars.Normalisation());
00110   TH1D hFDTaus(*(potentialTaus.Spectrum()));
00111   hFDTaus.SetName("fdTaus");
00112   vHistos.push_back(hFDTaus);
00113 
00114   ncBackground.Multiply(pars.Normalisation());
00115   TH1D hFDNCBackground(*(ncBackground.Spectrum()));
00116   hFDNCBackground.SetName("fdNCBackground");
00117   vHistos.push_back(hFDNCBackground);
00118 
00119   TH1D fdData = fFDData->ProvideSpectrum(0.0/*pars.ShwEnScale()*/);
00120   hFDNCBackground.SetName("fdData");
00121   vHistos.push_back(fdData);
00122 
00123   return vHistos;
00124 
00125 //   ++count;
00126 
00127 //   if (fFakeDataStudy){
00128 //     NuMatrixSpectrum shiftedPrediction(*(prediction.Spectrum()));
00129 //     return shiftedPrediction;
00130 //   }
00131 //   else{
00132 //     TH1D hshifted(fShowerEnergyShifter->
00133 //                ApplyShiftTo(*(prediction.Spectrum()),
00134 //                             -1.0*pars.ShwEnScale()));
00135 //     NuMatrixSpectrum shiftedPrediction(hshifted);
00136 //     return shiftedPrediction;
00137 //   }
00138 
00139 }


Member Data Documentation

NuMMHelperNoChargeCut* NuMMRunNoChargeCut::fHelper [private]

Reimplemented from NuMMRun.

Definition at line 27 of file NuMMRunNoChargeCut.h.

Referenced by MakeFDPred().


The documentation for this class was generated from the following files:
Generated on Fri Oct 10 22:46:08 2014 for loon by  doxygen 1.4.7