NCExtractionANN Class Reference

Artificial Neural Network extraction. More...

#include <NCExtractionANN.h>

Inheritance diagram for NCExtractionANN:
NCExtraction NCExtractionANNFar NCExtractionANNNear

List of all members.

Public Member Functions

 NCExtractionANN (NCAnalysisCuts *cuts, const Registry &r)

Protected Member Functions

double GetIdProbability (NCEventInfo &evtInfo, int beamType)
 The probability that this event is CC.
virtual double GetCutPosition () const
 Where to cut on the IdProbability.

Protected Attributes

Detector::Detector_t fDetector

Private Attributes

Bool_t fRPannUseLowETrain

Detailed Description

Artificial Neural Network extraction.

The actual ANN comes in four variants: near/far, and trained on all energies/low energies only.

The choice of low/all energies is done via the Registry setting "RPAnnUseLowETrain"

The choice of near/far is done as appropriate for the detector being processed. To force a particular detector, use the NCExtractionANNNear or NCExtractionANNFar class

Definition at line 30 of file NCExtractionANN.h.


Constructor & Destructor Documentation

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

Definition at line 42 of file NCExtractionANN.cxx.

00043                                                     :
00044   NCExtraction(cuts, r),
00045   fDetector(Detector::kUnknown),
00046   fRPannUseLowETrain(false)
00047 {
00048   int         tmpb;
00049   if (r.Get("RPAnnUseLowETrain",tmpb)) fRPannUseLowETrain = tmpb;
00050 }


Member Function Documentation

virtual double NCExtractionANN::GetCutPosition (  )  const [inline, protected, virtual]

Where to cut on the IdProbability.

Implements NCExtraction.

Definition at line 39 of file NCExtractionANN.h.

References fRPannUseLowETrain.

00040   {
00041     if(fRPannUseLowETrain) return 0.5875;
00042     return 0.675;
00043   }

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

The probability that this event is CC.

Implements NCExtraction.

Definition at line 53 of file NCExtractionANN.cxx.

References ANtpTrackInfo::dcosZVtx, det, ANtpHeaderInfo::detector, NCEventInfo::event, fDetector, fRPannUseLowETrain, NCEventInfo::header, Msg::kDebug, Detector::kFar, Msg::kInfo, Detector::kNear, Detector::kUnknown, MAXMSG, ANtpEventInfoNC::phPerPlane, ANtpEventInfoNC::phPerStrip, ANtpShowerInfo::planes, ANtpTrackInfo::planes, ANtpEventInfo::planes, ANtpTrackInfo::reducedChi2, NCEventInfo::shower, ANtpEventInfo::showers, ANtpTrackInfo::totalStrips, NCEventInfo::track, ANtpEventInfo::tracks, ANtpTrackInfoNC::trackSigCorFraction, and RPTrackANN::value().

00054 {
00055   MAXMSG("NCExtractionANN", Msg::kDebug,1) << "GetIdProbabilty from ANN"
00056                                              << endl;
00057 
00058   // set up ANN input parameters from info objects
00059   // all ANN inputs must be doubles for some reason
00060 
00061   Double_t evtPlanes = evtInfo.event->planes;
00062   Double_t evtPHperPlane = evtInfo.event->phPerPlane;
00063   Double_t evtPHperStrip = evtInfo.event->phPerStrip;
00064   Double_t nshowers = evtInfo.event->showers;
00065 
00066   Double_t shwPlanes = 0.;
00067   if (nshowers>0) {
00068     shwPlanes = (Double_t) evtInfo.shower->planes;
00069   }
00070 
00071   // if longer than 40 planes, assign 1.5 (very CC like)
00072   if (evtPlanes>40) return 1.5;
00073 
00074   // now get the ANN values
00075   if (evtInfo.event->tracks>0) {
00076     Double_t trkPlanes = (Double_t) evtInfo.track->planes;
00077     Double_t trackExtension = (Double_t) trkPlanes - shwPlanes;
00078     Double_t trkdCosZvtx = evtInfo.track->dcosZVtx;
00079     Double_t trkredChi2 = evtInfo.track->reducedChi2;
00080     Double_t trkStrips = evtInfo.track->totalStrips;
00081     Double_t trkPHFraction = evtInfo.track->trackSigCorFraction;
00082     if(trkPHFraction < 0) trkPHFraction = -1.0 ;
00083 
00084     Detector::Detector_t det=(Detector::Detector_t)evtInfo.header->detector;
00085     assert(det==Detector::kNear || det==Detector::kFar);
00086 
00087     RPTrackANN* ann=0;
00088 
00089     // This is which detector we should actually use. If fDetector is
00090     // unset, we use the detector of the files we're running on,
00091     // otherwise we use the value of fDetector
00092     Detector::Detector_t detToUse=(fDetector==Detector::kUnknown) ? det : fDetector;
00093 
00094     if(fRPannUseLowETrain){
00095       MAXMSG("NCExtractionANN", Msg::kInfo, 1) 
00096         << "Using Low Energy Trained ANNs" << endl;
00097       assert(0 && "Actually don't have a low energy trained dogwood ANN FAILING");
00098       // Boo, the ternary operator won't implicitly upcast here
00099       
00100       //if(detToUse==Detector::kNear) ann=new RPnearTrackLowEANN;
00101       //else                          ann=new RPfarTrackLowEANN;
00102       
00103     } 
00104     else{
00105       MAXMSG("NCExtractionANN", Msg::kInfo, 1) 
00106         << "Using All Energy Trained ANNs" << endl;
00107       if(detToUse==Detector::kNear) ann=new RPNearTrackANNDogwood;
00108       else                          ann=new RPFarTrackANNDogwood;
00109     }
00110     
00111     double ret = ann->value(0,
00112                             evtPHperPlane,
00113                             evtPHperStrip,
00114                             trkPHFraction,
00115                             trkStrips,
00116                             trkdCosZvtx,
00117                             trackExtension,
00118                             trkredChi2);
00119     // Make sure not to leak the ann
00120     delete ann;
00121     return ret;
00122     
00123   }//if tracks > 0
00124   else return 0; //no tracks
00125 
00126 }


Member Data Documentation

Which detector to run for. If set to kUnknown, use the detector from the input file

Definition at line 47 of file NCExtractionANN.h.

Referenced by GetIdProbability(), NCExtractionANNFar::NCExtractionANNFar(), and NCExtractionANNNear::NCExtractionANNNear().

Definition at line 50 of file NCExtractionANN.h.

Referenced by GetCutPosition(), and GetIdProbability().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1