NCExtractionPDF Class Reference

A simple PDF based extraction. More...

#include <NCExtractionPDF.h>

Inheritance diagram for NCExtractionPDF:
NCExtraction

List of all members.

Public Member Functions

 NCExtractionPDF (NCAnalysisCuts *cuts, const Registry &r)
virtual ~NCExtractionPDF ()
virtual double GetCutPosition () const
 Where to cut on the IdProbability.
virtual double GetIdProbability (NCEventInfo &evtInfo, int beamType)
 The probability that this event is CC.

Protected Attributes

TH2 * fLikelihoodHist

Detailed Description

A simple PDF based extraction.

Definition at line 18 of file NCExtractionPDF.h.


Constructor & Destructor Documentation

NCExtractionPDF::NCExtractionPDF ( NCAnalysisCuts cuts,
const Registry r 
)

Definition at line 27 of file NCExtractionPDF.cxx.

00029   : NCExtraction(cuts, r)
00030 {
00031   const char* tmps;
00032   TString trainingFilePath;
00033   if(r.Get("ExtractionPDFTrainingFilePath", tmps)) trainingFilePath = tmps;
00034   assert(trainingFilePath != "");
00035 
00036   TFile fin(trainingFilePath, "READ");
00037   fLikelihoodHist = (TH2*)fin.Get("hFrac");
00038   fLikelihoodHist->SetDirectory(0);
00039   fin.Close();
00040 
00041 }

NCExtractionPDF::~NCExtractionPDF (  )  [virtual]

Definition at line 44 of file NCExtractionPDF.cxx.

References fLikelihoodHist.

00045 {
00046   if(fLikelihoodHist) delete fLikelihoodHist;
00047 }


Member Function Documentation

virtual double NCExtractionPDF::GetCutPosition (  )  const [inline, virtual]

Where to cut on the IdProbability.

Implements NCExtraction.

Definition at line 25 of file NCExtractionPDF.h.

00025 {return 0.375;}

double NCExtractionPDF::GetIdProbability ( NCEventInfo evtInfo,
int  beamType 
) [virtual]

The probability that this event is CC.

Implements NCExtraction.

Definition at line 50 of file NCExtractionPDF.cxx.

References fLikelihoodHist, ANtpRecoInfo::numberTracks, ANtpRecoInfo::planes, NCEventInfo::reco, ANtpRecoInfo::showerPlanes, and ANtpRecoInfo::trackPlanes.

00052 {
00053   assert(evtInfo.reco);
00054   assert(fLikelihoodHist);
00055 
00056   double idProb = 0;
00057 
00058   if(!evtInfo.reco->numberTracks){
00059     idProb = 1;
00060   }
00061   else{
00062     const double ext = evtInfo.reco->showerPlanes - evtInfo.reco->trackPlanes;
00063 
00064     const int bin = fLikelihoodHist->FindBin(evtInfo.reco->planes, ext);
00065     const double lhoodVal = fLikelihoodHist->GetBinContent(bin);
00066 
00067     if(lhoodVal == 0){
00068       idProb = (ext > 0) ? 1 : 0;
00069     }
00070     else{
00071       idProb = lhoodVal;
00072     }
00073   }
00074 
00075   return idProb;
00076 }


Member Data Documentation

Definition at line 30 of file NCExtractionPDF.h.

Referenced by GetIdProbability(), and ~NCExtractionPDF().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1