NuMMHelperPRL Class Reference

#include <NuMMHelperPRL.h>

Inheritance diagram for NuMMHelperPRL:
NuMMHelper NuMMHelperNoChargeCut NuMMHelperPRLPQ

List of all members.

Public Member Functions

 NuMMHelperPRL ()
 NuMMHelperPRL (const std::string &helperFilename, const std::string &xSecFilename)
virtual ~NuMMHelperPRL ()
virtual const TH2D * UnNormNDRecoVsTrue ()
virtual const TH1D * NDPurity ()
virtual const TH1D * NDCCContamination ()
virtual const TH2D * NDRecoVsTrue ()
virtual const TH1D * NDEfficiency ()
virtual const TGraph * XSecGraph ()
virtual const TH2D * BeamMatrix ()
virtual const TH2D * BeamMatrixNuMuCCXSec ()
virtual const TH2D * BeamMatrixTauCCXSec ()
virtual const TGraph * XSecGraphTaus ()
virtual const TH1D * FDTauEfficiency ()
virtual const TH1D * FDEfficiency ()
virtual const TH1D * FDCCContamination ()
virtual const TH2D * FDRecoVsTrue ()
virtual const TH2D * NDRecoVsTrueNC ()
virtual const TH2D * FDRecoVsTrueNC ()
virtual const TH2D * FDCCContaminationRecoVsTrue ()
virtual const TH2D * RecoVsTrueNC (int truth, int det)
virtual const TH1D * FDPurity ()
virtual const TH2D * FDTauRecoVsTrue ()
virtual const TH1D * FDEfficiencyOtherChargeWS ()
virtual void OverrideBeamMatrix (const TH2D *beamMatrix)

Private Attributes

TH2D * fUnNormRecoVsTrue_ND
TH1D * fPurity_ND
TH1D * fCCContamination_ND
TH2D * fRecoVsTrueEnergy_ND
TH1D * fEfficiency_ND
TGraph * fXSec_CC_Graph
TGraph * fTau_XSec_CC_Graph
TH2D * fFDVsNDMatrixRW
TH2D * fFDVsNDMatrixXSecRW
TH2D * fFDVsNDMatrixTauXSecRW
TH1D * fEfficiency_FD
TH1D * fCCContamination_FD
TH2D * fRecoVsTrueEnergy_FD
TH2D * fRecoVsTrueEnergy_ND_NC
TH2D * fRecoVsTrueEnergy_FD_NC
TH2D * fRecoVsTrueEnergy_NC_truly [ENCTruth::kNumTruths][2]
TH1D * fPurity_FD
TH2D * fCCContaminationRecoVsTrue_FD
TH1D * fSuppliedTrueUnoscCCBackground_FD
TH1D * fOtherEfficiency_FD
TH1D * fEfficiencyTau_FD
TH2D * fRecoVsTrueEnergyTau_FD
TH1D * fEfficiencyOtherChargeWS_FD

Detailed Description

Definition at line 11 of file NuMMHelperPRL.h.


Constructor & Destructor Documentation

NuMMHelperPRL::NuMMHelperPRL (  ) 

Definition at line 16 of file NuMMHelperPRL.cxx.

00017 {
00018 }

NuMMHelperPRL::NuMMHelperPRL ( const std::string &  helperFilename,
const std::string &  xSecFilename 
) [explicit]

Definition at line 21 of file NuMMHelperPRL.cxx.

References det, fCCContamination_FD, fCCContamination_ND, fCCContaminationRecoVsTrue_FD, fEfficiency_FD, fEfficiency_ND, fEfficiencyOtherChargeWS_FD, fEfficiencyTau_FD, fFDVsNDMatrixRW, fFDVsNDMatrixTauXSecRW, fFDVsNDMatrixXSecRW, fPurity_FD, fPurity_ND, fRecoVsTrueEnergy_FD, fRecoVsTrueEnergy_FD_NC, fRecoVsTrueEnergy_NC_truly, fRecoVsTrueEnergy_ND, fRecoVsTrueEnergy_ND_NC, fRecoVsTrueEnergyTau_FD, fTau_XSec_CC_Graph, fUnNormRecoVsTrue_ND, fXSec_CC_Graph, ENCTruth::kNumTruths, Msg::kWarning, MSG, and ENCTruth::truthNames.

00023 {
00024   TFile helperFile(helperFilename.c_str(),"READ");
00025 
00026   fUnNormRecoVsTrue_ND = (TH2D*) helperFile.Get("RecoVsTrueEnergyUnnormNQ_ND");
00027   if (fUnNormRecoVsTrue_ND){fUnNormRecoVsTrue_ND->SetDirectory(0);}
00028 
00029   fRecoVsTrueEnergy_ND = (TH2D*) helperFile.Get("RecoVsTrueEnergy_ND");
00030   fRecoVsTrueEnergy_ND->SetDirectory(0);
00031   fRecoVsTrueEnergy_FD = (TH2D*) helperFile.Get("RecoVsTrueEnergy_FD");
00032   fRecoVsTrueEnergy_FD->SetDirectory(0);
00033 
00034   fRecoVsTrueEnergy_ND_NC = (TH2D*) helperFile.Get("RecoVsTrueEnergy_ND_NC");
00035   if(fRecoVsTrueEnergy_ND_NC){
00036     fRecoVsTrueEnergy_ND_NC->SetDirectory(0);
00037     fRecoVsTrueEnergy_FD_NC = (TH2D*) helperFile.Get("RecoVsTrueEnergy_FD_NC");
00038     fRecoVsTrueEnergy_FD_NC->SetDirectory(0);
00039 
00040     for(int truth = 0; truth < ENCTruth::kNumTruths; ++truth){
00041       for(int det = 0; det <= 1; ++det){
00042         const TString detStr = det ? "FD" : "ND";
00043         fRecoVsTrueEnergy_NC_truly[truth][det] = (TH2D*)helperFile.Get("RecoVsTrueEnergy_truly"+ENCTruth::truthNames[truth]+"_"+detStr+"_NC");
00044         fRecoVsTrueEnergy_NC_truly[truth][det]->SetDirectory(0);
00045       }
00046     } // end for truth
00047   }
00048   else{ // We didn't get any NC plots, warn and null them out
00049     MSG("NuMMHelperPRL", Msg::kWarning) << "No NC plots found in helper file " << helperFilename << endl;
00050     fRecoVsTrueEnergy_FD_NC = 0;
00051     for(int truth = 0; truth < ENCTruth::kNumTruths; ++truth)
00052       for(int det = 0; det <= 1; ++det)
00053         fRecoVsTrueEnergy_NC_truly[truth][det] = 0;
00054   }
00055   
00056   fFDVsNDMatrixRW = (TH2D*) helperFile.Get("FDVsNDMatrixRW");
00057   if(fFDVsNDMatrixRW) fFDVsNDMatrixRW->SetDirectory(0);  
00058   fFDVsNDMatrixXSecRW = (TH2D*) helperFile.Get("FDVsNDMatrixXSecRW");
00059   if(fFDVsNDMatrixXSecRW) fFDVsNDMatrixXSecRW->SetDirectory(0);
00060   fFDVsNDMatrixTauXSecRW = (TH2D*) helperFile.Get("FDVsNDMatrixTauXSecRW");
00061   if(fFDVsNDMatrixTauXSecRW) fFDVsNDMatrixTauXSecRW->SetDirectory(0);
00062   
00063   fEfficiency_ND = (TH1D*) helperFile.Get("Efficiency_ND");
00064   fEfficiency_ND->SetDirectory(0);
00065   fEfficiency_FD = (TH1D*) helperFile.Get("Efficiency_FD");
00066   fEfficiency_FD->SetDirectory(0);
00067 
00068   //The purity histograms in the helper file remove both the ND
00069   //background and the wrong sign CCs: the PRL analysis doesn't
00070   //remove the latter.
00071   fPurity_FD = (TH1D*) helperFile.Get("NCContamination_FD");
00072   fPurity_FD->SetDirectory(0);
00073   fPurity_ND = (TH1D*) helperFile.Get("NCContamination_ND");
00074   fPurity_ND->SetDirectory(0);
00075   for (int i=1; i<=fPurity_ND->GetNbinsX()+1; ++i){
00076     fPurity_ND->SetBinContent(i, 1.0 -
00077                               fPurity_ND->GetBinContent(i));
00078     fPurity_FD->SetBinContent(i, 1.0 -
00079                               fPurity_FD->GetBinContent(i));
00080   }
00081 
00082   fCCContamination_ND = (TH1D*) helperFile.Get("CCContamination_ND");
00083   fCCContamination_ND->SetDirectory(0);
00084   fCCContamination_FD = (TH1D*) helperFile.Get("CCContamination_FD");
00085   fCCContamination_FD->SetDirectory(0);
00086 
00087   fCCContaminationRecoVsTrue_FD =
00088     (TH2D*) helperFile.Get("CCContaminationRecoVsTrue_FD");
00089   fCCContaminationRecoVsTrue_FD->SetDirectory(0);
00090 
00091   //Tau helpers
00092   fEfficiencyTau_FD = (TH1D*) helperFile.Get("EfficiencyTau_FD");
00093   fEfficiencyTau_FD->SetDirectory(0);
00094   fRecoVsTrueEnergyTau_FD = (TH2D*)
00095     helperFile.Get("RecoVsTrueEnergyTau_FD");
00096   fRecoVsTrueEnergyTau_FD->SetDirectory(0);
00097   
00098   fEfficiencyOtherChargeWS_FD = 
00099     (TH1D*) helperFile.Get("OtherEfficiency_FD");
00100   fEfficiencyOtherChargeWS_FD->SetDirectory(0);
00101   
00102   helperFile.Close();
00103   
00104   //Get cross-sections (numu)
00105   TFile *xsecfile = new TFile(xSecFilename.c_str(),"READ");
00106   TH1F* XSec_CC = (TH1F*) xsecfile->Get("h_numu_cc_tot");
00107   XSec_CC->SetDirectory(0);
00108   xsecfile->Close();
00109   if (xsecfile){delete xsecfile; xsecfile = 0;}
00110   Float_t *x = new Float_t[XSec_CC->GetNbinsX()];
00111   Float_t *y = new Float_t[XSec_CC->GetNbinsX()];
00112   for(int i=0;i<XSec_CC->GetNbinsX();i++) {
00113     x[i] = XSec_CC->GetBinCenter(i+1);
00114     y[i] = XSec_CC->GetBinContent(i+1);
00115   }
00116   fXSec_CC_Graph = new TGraph(XSec_CC->GetNbinsX(),x,y);
00117   if (x) {delete[] x; x = 0;}
00118   if (y) {delete[] y; y = 0;}
00119   
00120   //Get cross-sections (tau)
00121   xsecfile = new TFile(xSecFilename.c_str(),"READ");
00122   TH1F* tau_XSec_CC = (TH1F*) xsecfile->Get("h_nutau_cc_tot");
00123   tau_XSec_CC->SetDirectory(0);
00124   xsecfile->Close();
00125   if (xsecfile){delete xsecfile; xsecfile = 0;}
00126   x = new Float_t[tau_XSec_CC->GetNbinsX()];
00127   y = new Float_t[tau_XSec_CC->GetNbinsX()];
00128   for(int i=0;i<tau_XSec_CC->GetNbinsX();i++) {
00129     x[i] = tau_XSec_CC->GetBinCenter(i+1);
00130     y[i] = tau_XSec_CC->GetBinContent(i+1);
00131   }
00132   fTau_XSec_CC_Graph = new TGraph(tau_XSec_CC->GetNbinsX(),x,y);
00133   if (x) {delete[] x; x = 0;}
00134   if (y) {delete[] y; y = 0;}
00135   
00136   if (fCCContaminationRecoVsTrue_FD){ 
00137     //Normalise the FD CC contamination true to reco CC matrix
00138     //First loop over reco axis:
00139     for (Int_t i=1; i<=fCCContaminationRecoVsTrue_FD->GetNbinsX()+1; ++i){
00140       //Find out the total number of true events in this column:
00141       Double_t trueEvents = 0.0;
00142       for (Int_t j=1; j<=fCCContaminationRecoVsTrue_FD->GetNbinsY()+1; ++j){
00143         trueEvents += fCCContaminationRecoVsTrue_FD->GetBinContent(i,j);
00144       }
00145       //Loop again, this time normalise.
00146       for (Int_t j=1; j<=fCCContaminationRecoVsTrue_FD->GetNbinsY()+1; ++j){
00147         if (trueEvents>0){
00148           Double_t oldContent =
00149             fCCContaminationRecoVsTrue_FD->GetBinContent(i,j);
00150           Double_t oldError =
00151             fCCContaminationRecoVsTrue_FD->GetBinError(i,j);
00152           fCCContaminationRecoVsTrue_FD->SetBinContent
00153             (i,j,oldContent/trueEvents);
00154           fCCContaminationRecoVsTrue_FD->SetBinError
00155             (i,j,oldError/trueEvents);
00156         }
00157         else{
00158           fCCContaminationRecoVsTrue_FD->SetBinContent(i,j,0);
00159           
00160           fCCContaminationRecoVsTrue_FD->SetBinError(i,j,0);
00161         }
00162       }
00163     }
00164   }
00165 }

virtual NuMMHelperPRL::~NuMMHelperPRL (  )  [inline, virtual]

Definition at line 17 of file NuMMHelperPRL.h.

00017 {};


Member Function Documentation

virtual const TH2D* NuMMHelperPRL::BeamMatrix ( void   )  [inline, virtual]
virtual const TH2D* NuMMHelperPRL::BeamMatrixNuMuCCXSec (  )  [inline, virtual]
virtual const TH2D* NuMMHelperPRL::BeamMatrixTauCCXSec (  )  [inline, virtual]
virtual const TH1D* NuMMHelperPRL::FDCCContamination (  )  [inline, virtual]
virtual const TH2D* NuMMHelperPRL::FDCCContaminationRecoVsTrue (  )  [inline, virtual]
virtual const TH1D* NuMMHelperPRL::FDEfficiency (  )  [inline, virtual]
virtual const TH1D* NuMMHelperPRL::FDEfficiencyOtherChargeWS (  )  [inline, virtual]
virtual const TH1D* NuMMHelperPRL::FDPurity (  )  [inline, virtual]
virtual const TH2D* NuMMHelperPRL::FDRecoVsTrue (  )  [inline, virtual]
virtual const TH2D* NuMMHelperPRL::FDRecoVsTrueNC (  )  [inline, virtual]

Reimplemented in NuMMHelperPRLPQ.

Definition at line 34 of file NuMMHelperPRL.h.

References fRecoVsTrueEnergy_FD_NC.

00034 {return fRecoVsTrueEnergy_FD_NC;}

virtual const TH1D* NuMMHelperPRL::FDTauEfficiency (  )  [inline, virtual]
virtual const TH2D* NuMMHelperPRL::FDTauRecoVsTrue (  )  [inline, virtual]
virtual const TH1D* NuMMHelperPRL::NDCCContamination (  )  [inline, virtual]
virtual const TH1D* NuMMHelperPRL::NDEfficiency (  )  [inline, virtual]
virtual const TH1D* NuMMHelperPRL::NDPurity (  )  [inline, virtual]
virtual const TH2D* NuMMHelperPRL::NDRecoVsTrue (  )  [inline, virtual]
virtual const TH2D* NuMMHelperPRL::NDRecoVsTrueNC (  )  [inline, virtual]

Reimplemented in NuMMHelperPRLPQ.

Definition at line 33 of file NuMMHelperPRL.h.

References fRecoVsTrueEnergy_ND_NC.

00033 {return fRecoVsTrueEnergy_ND_NC;}

void NuMMHelperPRL::OverrideBeamMatrix ( const TH2D *  beamMatrix  )  [virtual]

Definition at line 168 of file NuMMHelperPRL.cxx.

References fFDVsNDMatrixRW.

00169 {
00170   if (fFDVsNDMatrixRW){delete fFDVsNDMatrixRW; fFDVsNDMatrixRW=0;}
00171   fFDVsNDMatrixRW = new TH2D(*beamMatrix);
00172 }

virtual const TH2D* NuMMHelperPRL::RecoVsTrueNC ( int  truth,
int  det 
) [inline, virtual]

Reimplemented in NuMMHelperPRLPQ.

Definition at line 37 of file NuMMHelperPRL.h.

References fRecoVsTrueEnergy_NC_truly.

00038   {
00039     return fRecoVsTrueEnergy_NC_truly[truth][det];
00040   }

virtual const TH2D* NuMMHelperPRL::UnNormNDRecoVsTrue (  )  [inline, virtual]

Definition at line 19 of file NuMMHelperPRL.h.

References fUnNormRecoVsTrue_ND.

00019 {return fUnNormRecoVsTrue_ND;}

virtual const TGraph* NuMMHelperPRL::XSecGraph (  )  [inline, virtual]
virtual const TGraph* NuMMHelperPRL::XSecGraphTaus (  )  [inline, virtual]

Member Data Documentation

Reimplemented in NuMMHelperNoChargeCut, and NuMMHelperPRLPQ.

Definition at line 64 of file NuMMHelperPRL.h.

Referenced by FDCCContamination(), and NuMMHelperPRL().

Reimplemented in NuMMHelperNoChargeCut, and NuMMHelperPRLPQ.

Definition at line 55 of file NuMMHelperPRL.h.

Referenced by NDCCContamination(), and NuMMHelperPRL().

Reimplemented in NuMMHelperNoChargeCut, and NuMMHelperPRLPQ.

Definition at line 73 of file NuMMHelperPRL.h.

Referenced by FDCCContaminationRecoVsTrue(), and NuMMHelperPRL().

Reimplemented in NuMMHelperNoChargeCut, and NuMMHelperPRLPQ.

Definition at line 63 of file NuMMHelperPRL.h.

Referenced by FDEfficiency(), and NuMMHelperPRL().

Reimplemented in NuMMHelperNoChargeCut, and NuMMHelperPRLPQ.

Definition at line 57 of file NuMMHelperPRL.h.

Referenced by NDEfficiency(), and NuMMHelperPRL().

Reimplemented in NuMMHelperNoChargeCut, and NuMMHelperPRLPQ.

Definition at line 80 of file NuMMHelperPRL.h.

Referenced by FDEfficiencyOtherChargeWS(), and NuMMHelperPRL().

Reimplemented in NuMMHelperNoChargeCut, and NuMMHelperPRLPQ.

Definition at line 77 of file NuMMHelperPRL.h.

Referenced by FDTauEfficiency(), and NuMMHelperPRL().

Reimplemented in NuMMHelperNoChargeCut, and NuMMHelperPRLPQ.

Definition at line 60 of file NuMMHelperPRL.h.

Referenced by BeamMatrix(), NuMMHelperPRL(), and OverrideBeamMatrix().

Reimplemented in NuMMHelperNoChargeCut, and NuMMHelperPRLPQ.

Definition at line 62 of file NuMMHelperPRL.h.

Referenced by BeamMatrixTauCCXSec(), and NuMMHelperPRL().

Reimplemented in NuMMHelperNoChargeCut, and NuMMHelperPRLPQ.

Definition at line 61 of file NuMMHelperPRL.h.

Referenced by BeamMatrixNuMuCCXSec(), and NuMMHelperPRL().

Reimplemented in NuMMHelperNoChargeCut, and NuMMHelperPRLPQ.

Definition at line 75 of file NuMMHelperPRL.h.

TH1D* NuMMHelperPRL::fPurity_FD [private]

Reimplemented in NuMMHelperNoChargeCut, and NuMMHelperPRLPQ.

Definition at line 72 of file NuMMHelperPRL.h.

Referenced by FDPurity(), and NuMMHelperPRL().

TH1D* NuMMHelperPRL::fPurity_ND [private]

Reimplemented in NuMMHelperNoChargeCut, and NuMMHelperPRLPQ.

Definition at line 54 of file NuMMHelperPRL.h.

Referenced by NDPurity(), and NuMMHelperPRL().

Reimplemented in NuMMHelperNoChargeCut, and NuMMHelperPRLPQ.

Definition at line 65 of file NuMMHelperPRL.h.

Referenced by FDRecoVsTrue(), and NuMMHelperPRL().

Definition at line 69 of file NuMMHelperPRL.h.

Referenced by FDRecoVsTrueNC(), and NuMMHelperPRL().

TH2D* NuMMHelperPRL::fRecoVsTrueEnergy_NC_truly[ENCTruth::kNumTruths][2] [private]

Definition at line 70 of file NuMMHelperPRL.h.

Referenced by NuMMHelperPRL(), and RecoVsTrueNC().

Reimplemented in NuMMHelperNoChargeCut, and NuMMHelperPRLPQ.

Definition at line 56 of file NuMMHelperPRL.h.

Referenced by NDRecoVsTrue(), and NuMMHelperPRL().

Definition at line 68 of file NuMMHelperPRL.h.

Referenced by NDRecoVsTrueNC(), and NuMMHelperPRL().

Reimplemented in NuMMHelperNoChargeCut, and NuMMHelperPRLPQ.

Definition at line 78 of file NuMMHelperPRL.h.

Referenced by FDTauRecoVsTrue(), and NuMMHelperPRL().

Reimplemented in NuMMHelperNoChargeCut, and NuMMHelperPRLPQ.

Definition at line 74 of file NuMMHelperPRL.h.

Reimplemented in NuMMHelperNoChargeCut, and NuMMHelperPRLPQ.

Definition at line 59 of file NuMMHelperPRL.h.

Referenced by NuMMHelperPRL(), and XSecGraphTaus().

Definition at line 53 of file NuMMHelperPRL.h.

Referenced by NuMMHelperPRL(), and UnNormNDRecoVsTrue().

TGraph* NuMMHelperPRL::fXSec_CC_Graph [private]

Reimplemented in NuMMHelperNoChargeCut, and NuMMHelperPRLPQ.

Definition at line 58 of file NuMMHelperPRL.h.

Referenced by NuMMHelperPRL(), and XSecGraph().


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

Generated on 19 Jun 2017 for loon by  doxygen 1.6.1