NuMMRunPRL Class Reference

#include <NuMMRunPRL.h>

Inheritance diagram for NuMMRunPRL:
NuMMRun

List of all members.

Public Member Functions

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

Detailed Description

Definition at line 13 of file NuMMRunPRL.h.


Constructor & Destructor Documentation

NuMMRunPRL::NuMMRunPRL ( NuMMHelperPRL helper,
NuHistInterpolator ndData,
NuHistInterpolator fdData 
)

Definition at line 16 of file NuMMRunPRL.cxx.

00019   : NuMMRun(helper,ndData,fdData)
00020 {
00021 }


Member Function Documentation

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

Implements NuMMRun.

Definition at line 209 of file NuMMRunPRL.cxx.

References NuMatrixSpectrum::RebinForFit(), and NuMatrixSpectrum::Spectrum().

00210 {
00211   NuMatrixSpectrum prediction(this->MakeFDPred(pars));
00212   prediction.RebinForFit();
00213   //   TH1D fdData = fFDData->ProvideSpectrum(pars.ShwEnScale());
00214   NuMatrixSpectrum fdData(fFDData->ProvideSpectrum(0.0/*pars.ShwEnScale()*/),
00215                           fFDData->PoT());
00216   fdData.RebinForFit();
00217   //   return this->StatsLikelihood(prediction.Spectrum(),
00218   //                           &fdData);
00219   return this->StatsLikelihood(prediction.Spectrum(),
00220                                fdData.Spectrum());
00221 }

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

Definition at line 121 of file NuMMRunPRL.cxx.

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

00122 {
00123    static Int_t count=0;
00124      if ((!(count%3)) && (!fQuietMode)){
00125  cout << "8sn2: " << pars.Sn2() << "; dm2: " << pars.Dm2()
00126       << "; norm: " << pars.Normalisation()
00127       << "; NCBack: " << pars.NCBackgroundScale()
00128       << "; ShwEn: " << pars.ShwEnScale() << endl;
00129      }
00130 
00131   NuMatrixSpectrum prediction(fNDData->ProvideSpectrum(pars.ShwEnScale()));
00132 
00133   NuMatrixSpectrum signal(prediction);
00134   signal.Multiply(fHelper->NDPurity());
00135   NuMatrixSpectrum background(prediction);
00136   background.Subtract(signal);
00137   background.Multiply(pars.NCBackgroundScale());
00138   prediction.Subtract(background);
00139 
00140   prediction.RecoToTrue(fHelper->NDRecoVsTrue());
00141   prediction.Divide(fHelper->NDEfficiency());
00142   prediction.Divide(fHelper->XSecGraph());
00143   prediction.Divide(fNDData->PoT());
00144   prediction.Divide(fNDFidMass);
00145   prediction.ExtrapolateNDToFD(fHelper->BeamMatrix());
00146   prediction.Multiply(fFDFidMass);
00147   prediction.Multiply(fFDData->PoT());
00148 
00149   NuMatrixSpectrum potentialTaus(prediction);
00150   potentialTaus.Multiply(fHelper->XSecGraphTaus());
00151   potentialTaus.Multiply(fHelper->FDTauEfficiency());
00152 
00153   prediction.Multiply(fHelper->XSecGraph());
00154   prediction.Multiply(fHelper->FDEfficiency());
00155 
00156   NuMatrixSpectrum unoscTrueSpectrum(prediction);
00157   unoscTrueSpectrum.TrueToReco(fHelper->FDRecoVsTrue());
00158   NuMatrixSpectrum ncBackground(unoscTrueSpectrum);
00159   ncBackground.Divide(fHelper->FDPurity());
00160   ncBackground.Subtract(unoscTrueSpectrum);
00161   ncBackground.Multiply(pars.NCBackgroundScale());
00162 
00163   potentialTaus.InverseOscillate(pars.Dm2(),pars.Sn2());
00164   potentialTaus.TrueToReco(fHelper->FDTauRecoVsTrue());
00165 
00166 
00167   if (0==fDisappearanceModel){
00168     prediction.Oscillate(pars.Dm2(),pars.Sn2());
00169   }
00170   else if (1==fDisappearanceModel){
00171     prediction.DecayCC(pars.Dm2(),pars.Sn2(),pars.Alpha());
00172   }
00173   else if (2==fDisappearanceModel){
00174     prediction.Decohere(pars.Dm2(),pars.Sn2(),pars.Mu2());
00175   }
00176   else{
00177     cout << "Badly configured disappearance model. "
00178          << "Oscillating as that's probably what you want, "
00179          << "but not including taus."
00180          << endl;
00181     prediction.Oscillate(pars.Dm2(),pars.Sn2());
00182   }
00183   prediction.TrueToReco(fHelper->FDRecoVsTrue());
00184   prediction.Add(ncBackground);
00185   if (0==fDisappearanceModel && (!fFakeDataStudy)){
00186     prediction.Add(potentialTaus);
00187   }
00188 
00189   prediction.Multiply(pars.Normalisation());
00190 
00191   ++count;
00192 
00193   if (fFakeDataStudy){
00194     NuMatrixSpectrum shiftedPrediction(*(prediction.Spectrum()));
00195     return shiftedPrediction;
00196   }
00197   else{
00198     TH1D hshifted(fShowerEnergyShifter->
00199                   ApplyShiftTo(*(prediction.Spectrum()),
00200                                -1.0*pars.ShwEnScale()));
00201     NuMatrixSpectrum shiftedPrediction(hshifted);
00202     return shiftedPrediction;
00203   }
00204 
00205 }

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

Implements NuMMRun.

Definition at line 25 of file NuMMRunPRL.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   prediction.Divide(fNDData->PoT());
00051   prediction.Divide(fNDFidMass);
00052   prediction.ExtrapolateNDToFD(fHelper->BeamMatrix());
00053   prediction.Multiply(fFDFidMass);
00054   prediction.Multiply(fFDData->PoT());
00055 
00056   NuMatrixSpectrum potentialTaus(prediction);
00057   potentialTaus.Multiply(fHelper->XSecGraphTaus());
00058   potentialTaus.Multiply(fHelper->FDTauEfficiency());
00059 
00060   prediction.Multiply(fHelper->XSecGraph());
00061   prediction.Multiply(fHelper->FDEfficiency());
00062 
00063   NuMatrixSpectrum unoscTrueSpectrum(prediction);
00064   unoscTrueSpectrum.TrueToReco(fHelper->FDRecoVsTrue());
00065   NuMatrixSpectrum ncBackground(unoscTrueSpectrum);
00066   ncBackground.Divide(fHelper->FDPurity());
00067   ncBackground.Subtract(unoscTrueSpectrum);
00068   ncBackground.Multiply(pars.NCBackgroundScale());
00069 
00070   potentialTaus.InverseOscillate(pars.Dm2(),pars.Sn2());
00071   potentialTaus.TrueToReco(fHelper->FDTauRecoVsTrue());
00072 
00073   if (0==fDisappearanceModel){
00074     prediction.Oscillate(pars.Dm2(),pars.Sn2());
00075   }
00076   else if (1==fDisappearanceModel){
00077     prediction.DecayCC(pars.Dm2(),pars.Sn2(),pars.Alpha());
00078   }
00079   else if (2==fDisappearanceModel){
00080     prediction.Decohere(pars.Dm2(),pars.Sn2(),pars.Mu2());
00081   }
00082   else{
00083     cout << "Badly configured disappearance model. "
00084          << "Oscillating as that's probably what you want."
00085          << endl;
00086     prediction.Oscillate(pars.Dm2(),pars.Sn2());
00087   }
00088   prediction.TrueToReco(fHelper->FDRecoVsTrue());
00089   prediction.Add(ncBackground);
00090   if (0==fDisappearanceModel && (!fFakeDataStudy)){
00091     prediction.Add(potentialTaus);
00092   }
00093 
00094   prediction.Multiply(pars.Normalisation());
00095 
00096   TH1D* hshifted = new TH1D(fShowerEnergyShifter->ApplyShiftTo(*(prediction.Spectrum()),-1.0*pars.ShwEnScale()));
00097   NuMatrixSpectrum shiftedPrediction(*hshifted);
00098 
00099   TH1D hFDPrediction(*(shiftedPrediction.Spectrum()));
00100   hFDPrediction.SetName("fdPrediction");
00101   vHistos.push_back(hFDPrediction);
00102 
00103   potentialTaus.Multiply(pars.Normalisation());
00104   TH1D hFDTaus(*(potentialTaus.Spectrum()));
00105   hFDTaus.SetName("fdTaus");
00106   vHistos.push_back(hFDTaus);
00107 
00108   ncBackground.Multiply(pars.Normalisation());
00109   TH1D hFDNCBackground(*(ncBackground.Spectrum()));
00110   hFDNCBackground.SetName("fdNCBackground");
00111   vHistos.push_back(hFDNCBackground);
00112 
00113   TH1D fdData = fFDData->ProvideSpectrum(0.0/*pars.ShwEnScale()*/);
00114   hFDNCBackground.SetName("fdData");
00115   vHistos.push_back(fdData);
00116 
00117   return vHistos;
00118 }


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1