NuMMRunCC2010New Class Reference

#include <NuMMRunCC2010New.h>

Inheritance diagram for NuMMRunCC2010New:
NuMMRun

List of all members.

Public Member Functions

 NuMMRunCC2010New (NuMMHelperPRL *helper, NuMatrixSpectrum *ndCCData, NuMatrixSpectrum *fdCCData, string corfile="")
virtual Double_t ComparePredWithData (const NuMMParameters &pars)
virtual vector< NuMatrixSpectrumMakeFDPred (const NuMMParameters &pars)
virtual std::vector< TH1D > WriteFDPredHistos (const NuMMParameters &pars) const
virtual void PrecalculateWSFlux (NuMMHelperPRL *helper, const NuMatrixSpectrum *ndOtherData)
virtual void SetFDData (NuMatrixSpectrum *fdData)

Private Member Functions

virtual vector< NuMatrixSpectrumCalculateFDFlux (const Double_t ncScale=1.0) const
virtual vector< NuMatrixSpectrumCalculateFDTauFlux (const Double_t ncScale=1.0) const
virtual vector< NuMatrixSpectrumCalculateFDNCBackground (const Double_t ncScale=1.0) const
void OscillateNuMu (NuMatrixSpectrum &numu, const NuMMParameters &pars) const
 Helper. Oscillates, decays or decoheres a true energy numu spectrum.
void InverseOscillateNuTau (NuMatrixSpectrum &nutau, const NuMMParameters &pars) const
 Helper. Inverse oscillates a true energy nutau spectrum.
virtual void SanityCheckSpecialWSFiles (NuMMHelperPRL *helper, const NuMatrixSpectrum *ndOtherData) const
virtual void WriteToJess (NuMatrixSpectrum spectrum, const std::string name, bool osc)
TH1D * RebinCor (TH1D *&SystHist, TH1D *Spectrum) const

Private Attributes

Bool_t fSpecialWSMode
NuMatrixSpectrumfNDCCData
NuMatrixSpectrumfFDCCData
vector< NuMatrixSpectrumfFDFlux
vector< NuMatrixSpectrumfFDTauFlux
vector< NuMatrixSpectrumfFDNCBackground
vector< NuMatrixSpectrumfSpecialWSBackgroundFlux
NuMMHelperPRLfHelper
TH1D * fShwEnCorPlus
TH1D * fTrkEnCorPlus
TH1D * fShwEnCorMinus
TH1D * fTrkEnCorMinus
TH1D * fhOne
Bool_t fFitSysts

Detailed Description

Definition at line 13 of file NuMMRunCC2010New.h.


Constructor & Destructor Documentation

NuMMRunCC2010New::NuMMRunCC2010New ( NuMMHelperPRL helper,
NuMatrixSpectrum ndCCData,
NuMatrixSpectrum fdCCData,
string  corfile = "" 
)

Definition at line 19 of file NuMMRunCC2010New.cxx.

00023   : NuMMRun(),
00024     fSpecialWSMode(false),
00025     fNDCCData(ndCCData),
00026     fFDCCData(fdCCData),
00027     fHelper(helper)
00028 {
00029   assert(helper);
00030   assert(ndCCData);
00031   assert(fdCCData);
00032   
00033   //Independent of fit parameters for a stats-only fit
00034   fFDFlux = this->CalculateFDFlux();
00035   fFDTauFlux = this->CalculateFDTauFlux();
00036   fFDNCBackground = this->CalculateFDNCBackground();
00037   if(corfilename!=""){
00038 
00039     TFile* corfile = new TFile(corfilename.c_str(),"read");
00040 
00041     fShwEnCorPlus = (TH1D*)corfile->Get("ShwEnCorPlus");
00042     fTrkEnCorPlus = (TH1D*)corfile->Get("TrkEnCorPlus");
00043     fShwEnCorMinus = (TH1D*)corfile->Get("ShwEnCorMinus");
00044     fTrkEnCorMinus = (TH1D*)corfile->Get("TrkEnCorMinus");
00045 
00046     fShwEnCorPlus = RebinCor(fShwEnCorPlus,fFDCCData->Spectrum());
00047     fTrkEnCorPlus = RebinCor(fTrkEnCorPlus,fFDCCData->Spectrum());
00048     fShwEnCorMinus = RebinCor(fShwEnCorMinus,fFDCCData->Spectrum());
00049     fTrkEnCorMinus = RebinCor(fTrkEnCorMinus,fFDCCData->Spectrum());
00050 
00051     fhOne = (TH1D*)fFDCCData->Spectrum()->Clone();
00052     for(int i=0; i<=fhOne->GetNbinsX()+1; i++){
00053       fhOne->SetBinContent(i,1);
00054       fhOne->SetBinError(i,0);
00055     }
00056 
00057     fFitSysts = true;
00058 
00059 //    corfile->Close();
00060 
00061   }
00062   else fFitSysts = false;
00063    
00064 }


Member Function Documentation

vector< NuMatrixSpectrum > NuMMRunCC2010New::CalculateFDFlux ( const Double_t  ncScale = 1.0  )  const [private, virtual]

Definition at line 188 of file NuMMRunCC2010New.cxx.

References NuMMHelperPRL::BeamMatrixNuMuCCXSec(), NuMatrixSpectrum::Divide(), NuMatrixSpectrum::ExtrapolateNDToFD(), fFDCCData, NuMMRun::fFDFidMass, fHelper, fNDCCData, NuMMRun::fNDFidMass, NuMatrix::GetPOT(), NuMatrixSpectrum::Multiply(), NuMMHelperPRL::NDCCContamination(), NuMMHelperPRL::NDEfficiency(), NuMMHelperPRL::NDPurity(), NuMMHelperPRL::NDRecoVsTrue(), NuMatrixSpectrum::RecoToTrue(), and NuMatrix1D::Subtract().

Referenced by MakeFDPred().

00189 {
00190     NuMatrixSpectrum prediction(*fNDCCData);
00191     NuMatrixSpectrum wsBackground(prediction);
00192 
00193     NuMatrixSpectrum signal(prediction);
00194     signal.Multiply(fHelper->NDPurity());
00195     NuMatrixSpectrum ncBackground(prediction);
00196     ncBackground.Subtract(signal);
00197     ncBackground.Multiply(ncScale);
00198     prediction.Subtract(ncBackground);
00199     //    prediction.Multiply(fHelper->NDPurity());
00200 
00201     wsBackground.Multiply(fHelper->NDCCContamination());
00202     prediction.Subtract(wsBackground);
00203 
00204     prediction.RecoToTrue(fHelper->NDRecoVsTrue());
00205     prediction.Divide(fHelper->NDEfficiency());
00206     prediction.Divide(fNDCCData->GetPOT());
00207     prediction.Divide(fNDFidMass);
00208     prediction.ExtrapolateNDToFD(fHelper->BeamMatrixNuMuCCXSec());
00209     prediction.Multiply(fFDFidMass);
00210     prediction.Multiply(fFDCCData->GetPOT());
00211     
00212     vector<NuMatrixSpectrum> predictions;
00213     predictions.push_back(prediction);
00214     return predictions;
00215 }

vector< NuMatrixSpectrum > NuMMRunCC2010New::CalculateFDNCBackground ( const Double_t  ncScale = 1.0  )  const [private, virtual]

Definition at line 250 of file NuMMRunCC2010New.cxx.

References NuMatrix1D::Add(), NuMMHelperPRL::BeamMatrixNuMuCCXSec(), NuMatrixSpectrum::Divide(), NuMatrixSpectrum::ExtrapolateNDToFD(), NuMMHelperPRL::FDCCContamination(), NuMMHelperPRL::FDCCContaminationRecoVsTrue(), NuMMHelperPRL::FDEfficiency(), NuMMHelperPRL::FDPurity(), NuMMHelperPRL::FDRecoVsTrue(), fFDCCData, NuMMRun::fFDFidMass, fHelper, fNDCCData, NuMMRun::fNDFidMass, NuMatrix::GetPOT(), NuMatrixSpectrum::Multiply(), NuMMHelperPRL::NDCCContamination(), NuMMHelperPRL::NDEfficiency(), NuMMHelperPRL::NDPurity(), NuMMHelperPRL::NDRecoVsTrue(), NuMatrixSpectrum::RecoToTrue(), NuMatrix1D::Subtract(), and NuMatrixSpectrum::TrueToReco().

Referenced by MakeFDPred().

00251 {
00252     NuMatrixSpectrum prediction(*fNDCCData);
00253     NuMatrixSpectrum wsBackground(prediction);
00254 
00255     NuMatrixSpectrum signal(prediction);
00256     signal.Multiply(fHelper->NDPurity());
00257     NuMatrixSpectrum ndncBackground(prediction);
00258     ndncBackground.Subtract(signal);
00259     ndncBackground.Multiply(ncScale);
00260     prediction.Subtract(ndncBackground);
00261     //    prediction.Multiply(fHelper->NDPurity());
00262 
00263     wsBackground.Multiply(fHelper->NDCCContamination());
00264     prediction.Subtract(wsBackground);
00265 
00266     prediction.RecoToTrue(fHelper->NDRecoVsTrue());
00267     prediction.Divide(fHelper->NDEfficiency());
00268     prediction.Divide(fNDCCData->GetPOT());
00269     prediction.Divide(fNDFidMass);
00270     prediction.ExtrapolateNDToFD(fHelper->BeamMatrixNuMuCCXSec());
00271     prediction.Multiply(fFDFidMass);
00272     prediction.Multiply(fFDCCData->GetPOT());
00273 
00274     NuMatrixSpectrum unoscWsBackground(prediction);
00275     unoscWsBackground.Multiply(fHelper->FDCCContamination());
00276     unoscWsBackground.TrueToReco(fHelper->FDCCContaminationRecoVsTrue());
00277 
00278     prediction.Multiply(fHelper->FDEfficiency());
00279   
00280     NuMatrixSpectrum unoscTrueSpectrum(prediction);
00281     unoscTrueSpectrum.TrueToReco(fHelper->FDRecoVsTrue());
00282     unoscTrueSpectrum.Add(unoscWsBackground);
00283 
00284     NuMatrixSpectrum ncBackground(unoscTrueSpectrum);
00285     ncBackground.Divide(fHelper->FDPurity());
00286     ncBackground.Subtract(unoscTrueSpectrum);
00287     
00288     vector<NuMatrixSpectrum> predictions;
00289     predictions.push_back(ncBackground);
00290     return predictions;
00291 }

vector< NuMatrixSpectrum > NuMMRunCC2010New::CalculateFDTauFlux ( const Double_t  ncScale = 1.0  )  const [private, virtual]

Definition at line 219 of file NuMMRunCC2010New.cxx.

References NuMMHelperPRL::BeamMatrixTauCCXSec(), NuMatrixSpectrum::Divide(), NuMatrixSpectrum::ExtrapolateNDToFD(), fFDCCData, NuMMRun::fFDFidMass, fHelper, fNDCCData, NuMMRun::fNDFidMass, NuMatrix::GetPOT(), NuMatrixSpectrum::Multiply(), NuMMHelperPRL::NDCCContamination(), NuMMHelperPRL::NDEfficiency(), NuMMHelperPRL::NDPurity(), NuMMHelperPRL::NDRecoVsTrue(), NuMatrixSpectrum::RecoToTrue(), and NuMatrix1D::Subtract().

Referenced by MakeFDPred().

00220 {
00221     NuMatrixSpectrum prediction(*fNDCCData);
00222     NuMatrixSpectrum wsBackground(prediction);
00223 
00224     NuMatrixSpectrum signal(prediction);
00225     signal.Multiply(fHelper->NDPurity());
00226     NuMatrixSpectrum ncBackground(prediction);
00227     ncBackground.Subtract(signal);
00228     ncBackground.Multiply(ncScale);
00229     prediction.Subtract(ncBackground);
00230     //    prediction.Multiply(fHelper->NDPurity());
00231 
00232     wsBackground.Multiply(fHelper->NDCCContamination());
00233     prediction.Subtract(wsBackground);
00234 
00235     prediction.RecoToTrue(fHelper->NDRecoVsTrue());
00236     prediction.Divide(fHelper->NDEfficiency());
00237     prediction.Divide(fNDCCData->GetPOT());
00238     prediction.Divide(fNDFidMass);
00239     prediction.ExtrapolateNDToFD(fHelper->BeamMatrixTauCCXSec());
00240     prediction.Multiply(fFDFidMass);
00241     prediction.Multiply(fFDCCData->GetPOT());
00242     
00243     vector<NuMatrixSpectrum> predictions;
00244     predictions.push_back(prediction);
00245     return predictions;
00246 }

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

Implements NuMMRun.

Definition at line 479 of file NuMMRunCC2010New.cxx.

00480 {
00481   const vector<NuMatrixSpectrum> predictions =
00482     this->MakeFDPred(pars);
00483   Double_t like = 0.0;
00484   
00485   like += this->StatsLikelihood(predictions[0].Spectrum(),
00486                                 fFDCCData->Spectrum());
00487 
00488   return like;
00489 }

void NuMMRunCC2010New::InverseOscillateNuTau ( NuMatrixSpectrum nutau,
const NuMMParameters pars 
) const [private]

Helper. Inverse oscillates a true energy nutau spectrum.

Definition at line 518 of file NuMMRunCC2010New.cxx.

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

Referenced by MakeFDPred().

00520 {
00521   switch(fDisappearanceModel){
00522   case 0:
00523     nutau.InverseOscillate(pars.Dm2(), pars.Sn2());
00524     return;
00525   case 1:
00526     nutau.DecayMuToTau(pars.Dm2(), pars.Sn2(), pars.Alpha());
00527     return;
00528   case 2:
00529     nutau.InverseDecohere(pars.Dm2(), pars.Sn2(), pars.Mu2());
00530     return; 
00531   case 4:
00532     nutau.Oscillate_3flavour(pars.Dm232(), pars.Theta23(), pars.Dm221(), pars.Theta12(), pars.Theta13(), pars.Delta1(), 16);
00533     return;
00534   default:
00535     assert(0 && "Badly configured disappearance model");
00536   }
00537 }

vector< NuMatrixSpectrum > NuMMRunCC2010New::MakeFDPred ( const NuMMParameters pars  )  [virtual]

Definition at line 295 of file NuMMRunCC2010New.cxx.

References NuMatrix1D::Add(), CalculateFDFlux(), CalculateFDNCBackground(), CalculateFDTauFlux(), NuMMParameters::Dm2(), NuMMHelperPRL::FDCCContamination(), NuMMHelperPRL::FDCCContaminationRecoVsTrue(), NuMMHelperPRL::FDEfficiency(), NuMMHelperPRL::FDRecoVsTrue(), NuMMHelperPRL::FDTauEfficiency(), NuMMHelperPRL::FDTauRecoVsTrue(), fFDCCData, fFDFlux, fFDNCBackground, fFDTauFlux, fFitSysts, fHelper, fhOne, NuMMRun::fQuietMode, fShwEnCorMinus, fShwEnCorPlus, fSpecialWSBackgroundFlux, fSpecialWSMode, fTrkEnCorMinus, fTrkEnCorPlus, InverseOscillateNuTau(), NuMMParameters::Mu2(), NuMatrixSpectrum::Multiply(), NuMMParameters::NCBackgroundScale(), NuMMParameters::Normalisation(), OscillateNuMu(), NuMatrixSpectrum::RemoveErrors(), NuMatrixSpectrum::SetName(), NuMatrixSpectrum::SetTitle(), NuMMParameters::ShwEnScale(), NuMMParameters::Sn2(), NuMMParameters::TrkEnScale(), NuMatrixSpectrum::TrueToReco(), and WriteToJess().

00296 {
00297   if (!fQuietMode) {
00298     cout << "sn2: " << pars.Sn2() << "; dm2: " << pars.Dm2() 
00299          << "; mu2: " << pars.Mu2() << endl
00300 //       << "; sn2bar: " << pars.Sn2Bar() 
00301 //       << "; dm2bar: " << pars.Dm2Bar() << endl
00302          << "; norm: " << pars.Normalisation() 
00303          << "; ShwEn: " << pars.ShwEnScale()
00304          << "; TrkEn: " << pars.TrkEnScale()
00305          << "; NCBack: " << pars.NCBackgroundScale() << endl;
00306   }
00307 
00308   vector<NuMatrixSpectrum> NewFDFlux = fFDFlux;
00309   vector<NuMatrixSpectrum> NewFDTauFlux = fFDTauFlux;
00310   vector<NuMatrixSpectrum> NewFDNCBackground = fFDNCBackground;
00311 
00312   if(pars.NCBackgroundScale()!=1.0){
00313     NewFDFlux = this->CalculateFDFlux(pars.NCBackgroundScale());
00314     NewFDTauFlux = this->CalculateFDTauFlux(pars.NCBackgroundScale());
00315     NewFDNCBackground = this->CalculateFDNCBackground(pars.NCBackgroundScale());
00316   }
00317 
00318   //Pick up the pre-calculated stuff
00319   // TODO CJB - the destruction of these histograms takes ages
00320   NuMatrixSpectrum nuPrediction = NewFDFlux[0];  
00321   NuMatrixSpectrum potentialTaus = NewFDTauFlux[0];
00322   NuMatrixSpectrum wsBackground = NewFDFlux[0];
00323   NuMatrixSpectrum ncBackground = NewFDNCBackground[0];
00324 
00325   //Do extrapolation
00326   potentialTaus.Multiply(fHelper->FDTauEfficiency());
00327   
00328   wsBackground.Multiply(fHelper->FDCCContamination());
00329   if (fSpecialWSMode){
00330     wsBackground = fSpecialWSBackgroundFlux[0];
00331   }
00332 
00333   WriteToJess(wsBackground,"wsBackground", false);
00334   OscillateNuMu(wsBackground, pars);
00335   WriteToJess(wsBackground,"wsBackground", true);
00336   wsBackground.TrueToReco(fHelper->FDCCContaminationRecoVsTrue());
00337 
00338   nuPrediction.Multiply(fHelper->FDEfficiency());
00339   
00340   WriteToJess(nuPrediction,"nuPrediction", false);
00341   OscillateNuMu(nuPrediction, pars);
00342   WriteToJess(nuPrediction,"nuPrediction", true);
00343 
00344   WriteToJess(potentialTaus,"potentialTaus", false);
00345   InverseOscillateNuTau(potentialTaus, pars);
00346   WriteToJess(potentialTaus,"potentialTaus", true);
00347   
00348   potentialTaus.TrueToReco(fHelper->FDTauRecoVsTrue());
00349   nuPrediction.TrueToReco(fHelper->FDRecoVsTrue());
00350 
00351   ncBackground.Multiply(pars.NCBackgroundScale());
00352 
00353   WriteToJess(ncBackground,"ncBackground", false);
00354   // We don't oscillate the NC background. Which means it doesn't get
00355   // decayed or decohered either. Probably OK since it's a tiny component,
00356   // but not exactly ideal.
00357 
00358   nuPrediction.Add(ncBackground);
00359   nuPrediction.Add(potentialTaus);
00360   nuPrediction.Add(wsBackground);
00361 
00362   nuPrediction.Multiply(pars.Normalisation());
00363 
00364   if( fFitSysts && (pars.ShwEnScale()!=0 || pars.TrkEnScale()!=0) ){
00365   
00366     TH1D *ScaledShwEnCor = (TH1D*)fShwEnCorPlus->Clone();
00367 
00368     TH1D *ScaledTrkEnCor = (TH1D*)fTrkEnCorPlus->Clone();
00369     if(pars.ShwEnScale()<0) ScaledShwEnCor = (TH1D*)fShwEnCorMinus->Clone();
00370     if(pars.TrkEnScale()<0) ScaledTrkEnCor = (TH1D*)fTrkEnCorMinus->Clone();
00371   
00372     ScaledShwEnCor->Scale(TMath::Abs(pars.ShwEnScale()));
00373     ScaledShwEnCor->Add(fhOne);
00374     nuPrediction.Multiply(ScaledShwEnCor);
00375     
00376     ScaledTrkEnCor->Scale(TMath::Abs(pars.TrkEnScale()));
00377     ScaledTrkEnCor->Add(fhOne);
00378     nuPrediction.Multiply(ScaledTrkEnCor);
00379     
00380   }//Apply systematics if present
00381 
00382   WriteToJess(*fFDCCData, "data", false);
00383 
00384   //Prediction is done. Now fix the stupid error bars and give it a
00385   //better name
00386   nuPrediction.RemoveErrors();
00387   nuPrediction.SetName("fdPred");  
00388   nuPrediction.SetTitle("fdPred");  
00389   vector<NuMatrixSpectrum> ccPredictions;
00390   ccPredictions.push_back(nuPrediction);
00391   return ccPredictions;
00392 }

void NuMMRunCC2010New::OscillateNuMu ( NuMatrixSpectrum numu,
const NuMMParameters pars 
) const [private]

Helper. Oscillates, decays or decoheres a true energy numu spectrum.

Definition at line 493 of file NuMMRunCC2010New.cxx.

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

Referenced by MakeFDPred().

00495 {
00496   //  cout<<fDisappearanceModel<<endl;
00497   switch(fDisappearanceModel){
00498   case 0:
00499     numu.Oscillate(pars.Dm2(), pars.Sn2());
00500     return;
00501   case 1:
00502     numu.DecayCC(pars.Dm2(), pars.Sn2(), pars.Alpha());
00503     return;
00504   case 2:
00505     numu.Decohere(pars.Dm2(), pars.Sn2(), pars.Mu2());
00506     return;
00507   case 4:
00508     numu.Oscillate_3flavour(pars.Dm232(), pars.Theta23(), pars.Dm221(), pars.Theta12(), pars.Theta13(), pars.Delta1(), 14);
00509     //numu.Oscillate_3flavour(pars.Dm2(), asin(sqrt(pars.Sn2())) / 2.0, pars.Dm221(), pars.Theta12(), pars.Theta13(), pars.Delta1(), 14);
00510     return;
00511   default:
00512     assert(0 && "Badly configured disappearance model");
00513   }
00514 }

void NuMMRunCC2010New::PrecalculateWSFlux ( NuMMHelperPRL helper,
const NuMatrixSpectrum ndOtherData 
) [virtual]

Definition at line 451 of file NuMMRunCC2010New.cxx.

References NuMMHelperPRL::BeamMatrixNuMuCCXSec(), NuMatrixSpectrum::Divide(), NuMatrixSpectrum::ExtrapolateNDToFD(), NuMMHelperPRL::FDEfficiencyOtherChargeWS(), fFDCCData, NuMMRun::fFDFidMass, NuMMRun::fNDFidMass, fSpecialWSBackgroundFlux, fSpecialWSMode, NuMatrix::GetPOT(), NuMatrixSpectrum::Multiply(), NuMMHelperPRL::NDCCContamination(), NuMMHelperPRL::NDEfficiency(), NuMMHelperPRL::NDPurity(), NuMMHelperPRL::NDRecoVsTrue(), NuMatrixSpectrum::RecoToTrue(), SanityCheckSpecialWSFiles(), and NuMatrix1D::Subtract().

00453 {
00454   cout << "Running PrecalculateWSFlux" << endl;
00455   this->SanityCheckSpecialWSFiles(helper,ndOtherData);
00456   fSpecialWSMode = true;
00457   fSpecialWSBackgroundFlux.clear();
00458   NuMatrixSpectrum prediction(*ndOtherData);
00459   NuMatrixSpectrum wsBackground(prediction);
00460   prediction.Multiply(helper->NDPurity());
00461   
00462   wsBackground.Multiply(helper->NDCCContamination());
00463   prediction.Subtract(wsBackground);
00464   
00465   prediction.RecoToTrue(helper->NDRecoVsTrue());
00466   prediction.Divide(helper->NDEfficiency());
00467   prediction.Divide(ndOtherData->GetPOT());
00468   prediction.Divide(fNDFidMass);
00469   prediction.ExtrapolateNDToFD(helper->BeamMatrixNuMuCCXSec());
00470   prediction.Multiply(fFDFidMass);
00471   prediction.Multiply(fFDCCData->GetPOT());
00472   prediction.Multiply(helper->FDEfficiencyOtherChargeWS());
00473   
00474   fSpecialWSBackgroundFlux.push_back(prediction);
00475 }

TH1D * NuMMRunCC2010New::RebinCor ( TH1D *&  SystHist,
TH1D *  Spectrum 
) const [private]

Definition at line 581 of file NuMMRunCC2010New.cxx.

00582 {
00583  
00584   TH1D *outhist = (TH1D*)Spectrum->Clone();
00585  
00586   for(int i=0;i<=outhist->GetNbinsX()+1;i++){
00587     double xval = outhist->GetBinCenter(i);  
00588     double yval = SystHist->Interpolate(xval);
00589     outhist->SetBinContent(i,yval);
00590     outhist->SetBinError(i,0);
00591   }
00592    
00593   return outhist;
00594  
00595 }

void NuMMRunCC2010New::SanityCheckSpecialWSFiles ( NuMMHelperPRL helper,
const NuMatrixSpectrum ndOtherData 
) const [private, virtual]

Definition at line 396 of file NuMMRunCC2010New.cxx.

References NuMMHelperPRL::NDEfficiency(), and NuMatrixSpectrum::Spectrum().

Referenced by PrecalculateWSFlux().

00398 {
00399 
00400   string dataName = fNDCCData->Spectrum()->GetName();
00401   string otherDataName = ndOtherData->Spectrum()->GetName();
00402   string helperEffName = helper->NDEfficiency()->GetName();
00403 
00404   if ("RecoEnergy_ND" == dataName){
00405     if ("RecoEnergyPQ_ND" == otherDataName){
00406       cout << "You are extrapolating NuMu data. "
00407            << "WS histograms sanity checked as OK."
00408            << endl;
00409     }
00410     else{
00411       cout << "You are extrapolating NuMu data. "
00412            << "WS histograms failing sanity check."
00413            << endl;
00414       assert(false);
00415     }
00416     if ("EfficiencyPQ_ND" == helperEffName){
00417       cout << "WS helper sanity checked as OK."
00418            << endl;
00419     }
00420     else{
00421       cout << "WS helper failing sanity check."
00422            << endl;
00423       assert(false);
00424     }
00425   }
00426   else if ("RecoEnergyPQ_ND" == dataName){
00427     if ("RecoEnergy_ND" == otherDataName){
00428       cout << "You are extrapolating NuMu data. "
00429            << "WS histograms sanity checked as OK."
00430            << endl;
00431     }
00432     else{
00433       cout << "You are extrapolating NuMu data. "
00434            << "WS histograms failing sanity check."
00435            << endl;
00436       assert(false);
00437     }
00438     if ("Efficiency_ND" == helperEffName){
00439       cout << "WS helper sanity checked as OK."
00440            << endl;
00441     }
00442     else{
00443       cout << "WS helper failing sanity check."
00444            << endl;
00445       assert(false);
00446     }
00447   }
00448 }

virtual void NuMMRunCC2010New::SetFDData ( NuMatrixSpectrum fdData  )  [inline, virtual]

Definition at line 33 of file NuMMRunCC2010New.h.

References fFDCCData.

00033 {fFDCCData = fdData;}

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

Implements NuMMRun.

Definition at line 68 of file NuMMRunCC2010New.cxx.

References NuMatrix1D::Add(), NuMMParameters::Dm2(), NuMMParameters::Mu2(), NuMatrixSpectrum::Multiply(), NuMMParameters::NCBackgroundScale(), NuMMParameters::Normalisation(), NuMMParameters::ShwEnScale(), NuMMParameters::Sn2(), NuMatrixSpectrum::Spectrum(), NuMMParameters::TrkEnScale(), and NuMatrixSpectrum::TrueToReco().

00069 {
00070   vector<TH1D> vHistos;
00071 
00072   if (!fQuietMode) {
00073     cout << "sn2: " << pars.Sn2() << "; dm2: " << pars.Dm2()
00074        << "; mu2: " << pars.Mu2() << endl
00075        << "; norm: " << pars.Normalisation()
00076        << "; NCBack: " << pars.NCBackgroundScale()
00077        << "; TrkEn: " << pars.TrkEnScale()
00078        << "; ShwEn: " << pars.ShwEnScale() << endl;
00079   }
00080 
00081   vector<NuMatrixSpectrum> NewFDFlux = fFDFlux;
00082   vector<NuMatrixSpectrum> NewFDTauFlux = fFDTauFlux;
00083   vector<NuMatrixSpectrum> NewFDNCBackground = fFDNCBackground;
00084 
00085   if(pars.NCBackgroundScale()!=1.0){
00086     NewFDFlux = this->CalculateFDFlux(pars.NCBackgroundScale());
00087     NewFDTauFlux = this->CalculateFDTauFlux(pars.NCBackgroundScale());
00088     NewFDNCBackground = this->CalculateFDNCBackground(pars.NCBackgroundScale());
00089   }
00090 
00091   //Pick up the pre-calculated stuff
00092   // TODO CJB - the destruction of these histograms takes ages
00093   NuMatrixSpectrum nuPrediction = NewFDFlux[0];
00094   NuMatrixSpectrum potentialTaus = NewFDTauFlux[0];
00095   NuMatrixSpectrum wsBackground = NewFDFlux[0];
00096   NuMatrixSpectrum ncBackground = NewFDNCBackground[0];
00097 
00098   //Do extrapolation
00099   nuPrediction.Multiply(fHelper->FDEfficiency());   
00100   potentialTaus.Multiply(fHelper->FDTauEfficiency());
00101   wsBackground.Multiply(fHelper->FDCCContamination());
00102   if (fSpecialWSMode) wsBackground = fSpecialWSBackgroundFlux[0];
00103 
00104   OscillateNuMu(nuPrediction, pars);
00105   InverseOscillateNuTau(potentialTaus, pars);
00106   OscillateNuMu(wsBackground, pars);
00107 
00108   ncBackground.Multiply(pars.NCBackgroundScale());
00109   
00110   //Output the prediction in true energy
00111   TH1D hTrueFDPrediction(*(nuPrediction.Spectrum()));
00112   hTrueFDPrediction.SetName("fdTruePrediction");
00113   vHistos.push_back(hTrueFDPrediction);
00114          
00115   TH1D hTrueFDTaus(*(potentialTaus.Spectrum()));
00116   hTrueFDTaus.SetName("fdTrueTaus");
00117   vHistos.push_back(hTrueFDTaus);
00118 
00119   TH1D hTrueFDWSBackground(*(wsBackground.Spectrum()));
00120   hTrueFDWSBackground.SetName("fdTrueWSBackground");
00121   vHistos.push_back(hTrueFDWSBackground);
00122 
00123   nuPrediction.TrueToReco(fHelper->FDRecoVsTrue());
00124   potentialTaus.TrueToReco(fHelper->FDTauRecoVsTrue());
00125   wsBackground.TrueToReco(fHelper->FDCCContaminationRecoVsTrue());
00126 
00127   //Get the prediction in reco energy   
00128   TH1D hBaseFDPrediction(*(nuPrediction.Spectrum()));
00129   hBaseFDPrediction.SetName("fdBasePrediction");
00130   vHistos.push_back(hBaseFDPrediction);
00131 
00132   // Add in the backgrounds:
00133   nuPrediction.Add(ncBackground);   
00134   nuPrediction.Add(potentialTaus);
00135   nuPrediction.Add(wsBackground);
00136   
00137   nuPrediction.Multiply(pars.Normalisation());
00138   
00139   if( fFitSysts && (pars.ShwEnScale()!=0 || pars.TrkEnScale()!=0) ){
00140   
00141     TH1D *ScaledShwEnCor = (TH1D*)fShwEnCorPlus->Clone();
00142     TH1D *ScaledTrkEnCor = (TH1D*)fTrkEnCorPlus->Clone();
00143     if(pars.ShwEnScale()<0) ScaledShwEnCor = (TH1D*)fShwEnCorMinus->Clone();
00144     if(pars.TrkEnScale()<0) ScaledTrkEnCor = (TH1D*)fTrkEnCorMinus->Clone();
00145   
00146     ScaledShwEnCor->Scale(TMath::Abs(pars.ShwEnScale()));
00147     ScaledShwEnCor->Add(fhOne);
00148     nuPrediction.Multiply(ScaledShwEnCor);
00149 
00150     ScaledTrkEnCor->Scale(TMath::Abs(pars.TrkEnScale()));
00151     ScaledTrkEnCor->Add(fhOne);
00152     nuPrediction.Multiply(ScaledTrkEnCor);
00153   
00154   }//Apply systematics if present
00155 
00156   //Get the prediction with backgrounds
00157   TH1D hFDPrediction(*(nuPrediction.Spectrum()));
00158   hFDPrediction.SetName("fdPrediction");
00159   vHistos.push_back(hFDPrediction);
00160     
00161   TH1D hFDTaus(*(potentialTaus.Spectrum()));
00162   hFDTaus.SetName("fdTaus");
00163   vHistos.push_back(hFDTaus);
00164     
00165   TH1D hFDNCBackground(*(ncBackground.Spectrum()));
00166   hFDNCBackground.SetName("fdNCBackground");
00167   vHistos.push_back(hFDNCBackground);
00168     
00169   TH1D hFDWSBackground(*(wsBackground.Spectrum()));
00170   hFDWSBackground.SetName("fdWSBackground");
00171   vHistos.push_back(hFDWSBackground);
00172 
00173   TH1D hNDData(*(fNDCCData->Spectrum()));
00174   hNDData.SetName("ndData");
00175   hNDData.SetTitle("ndData");
00176   vHistos.push_back(*(new TH1D(hNDData)));
00177 
00178   TH1D hfdData(*(fFDCCData->Spectrum()));   
00179   hfdData.SetName("fdData");
00180   vHistos.push_back(hfdData);
00181     
00182   return vHistos;
00183 
00184 }

void NuMMRunCC2010New::WriteToJess ( NuMatrixSpectrum  spectrum,
const std::string  name,
bool  osc 
) [private, virtual]

Definition at line 540 of file NuMMRunCC2010New.cxx.

References NuMMHelperPRL::FDCCContaminationRecoVsTrue(), NuMMHelperPRL::FDRecoVsTrue(), NuMMHelperPRL::FDTauRecoVsTrue(), fHelper, NuMMRun::fJessFile, Msg::kError, NuMatrixSpectrum::MakeJessTemplate(), MSG, NuMatrixSpectrum::RemoveErrors(), and NuMatrixSpectrum::Spectrum().

Referenced by MakeFDPred().

00543 {
00544   // If they don't want the plots don't try to give them
00545   if (!fJessFile) return;
00546 
00547   const string opName = osc ? (name+"_osc") : name;
00548 
00549   fJessFile->cd();
00550   if ("wsBackground" == name){
00551     TH2D jessHist =
00552       spectrum.MakeJessTemplate(fHelper->FDCCContaminationRecoVsTrue());
00553     jessHist.Write(opName.c_str());
00554   }
00555   else if ("nuPrediction" == name){
00556     TH2D jessHist =
00557       spectrum.MakeJessTemplate(fHelper->FDRecoVsTrue());
00558     jessHist.Write(opName.c_str());
00559   }
00560   else if ("potentialTaus" == name){
00561     TH2D jessHist =
00562       spectrum.MakeJessTemplate(fHelper->FDTauRecoVsTrue());
00563     jessHist.Write(opName.c_str());
00564   }
00565   else if ("ncBackground" == name){
00566     spectrum.RemoveErrors();
00567     spectrum.Spectrum()->Write(opName.c_str());
00568   }
00569   else if ("data" == name){
00570     spectrum.Spectrum()->Write(opName.c_str());
00571   }
00572   else{
00573     MSG("NuMatrixSpectrum", Msg::kError)
00574       << "You're trying to write a Jess template which has an "
00575       << "unrecognized name"
00576       << endl;
00577   }
00578 }


Member Data Documentation

Definition at line 60 of file NuMMRunCC2010New.h.

Referenced by MakeFDPred().

Definition at line 62 of file NuMMRunCC2010New.h.

Referenced by MakeFDPred().

Definition at line 61 of file NuMMRunCC2010New.h.

Referenced by MakeFDPred().

Bool_t NuMMRunCC2010New::fFitSysts [private]

Definition at line 70 of file NuMMRunCC2010New.h.

Referenced by MakeFDPred().

Reimplemented from NuMMRun.

Definition at line 64 of file NuMMRunCC2010New.h.

Referenced by CalculateFDFlux(), CalculateFDNCBackground(), CalculateFDTauFlux(), MakeFDPred(), and WriteToJess().

TH1D* NuMMRunCC2010New::fhOne [private]

Definition at line 69 of file NuMMRunCC2010New.h.

Referenced by MakeFDPred().

Definition at line 58 of file NuMMRunCC2010New.h.

Referenced by CalculateFDFlux(), CalculateFDNCBackground(), and CalculateFDTauFlux().

Definition at line 67 of file NuMMRunCC2010New.h.

Referenced by MakeFDPred().

Definition at line 65 of file NuMMRunCC2010New.h.

Referenced by MakeFDPred().

Definition at line 63 of file NuMMRunCC2010New.h.

Referenced by MakeFDPred(), and PrecalculateWSFlux().

Definition at line 56 of file NuMMRunCC2010New.h.

Referenced by MakeFDPred(), and PrecalculateWSFlux().

Definition at line 68 of file NuMMRunCC2010New.h.

Referenced by MakeFDPred().

Definition at line 66 of file NuMMRunCC2010New.h.

Referenced by MakeFDPred().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1