Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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.

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, NCEventInfo::header, MAXMSG, ANtpEventInfoNC::phPerPlane, ANtpEventInfoNC::phPerStrip, ANtpTrackInfo::planes, ANtpShowerInfo::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 
00083     Detector::Detector_t det=(Detector::Detector_t)evtInfo.header->detector;
00084     assert(det==Detector::kNear || det==Detector::kFar);
00085 
00086     RPTrackANN* ann=0;
00087 
00088     // This is which detector we should actually use. If fDetector is
00089     // unset, we use the detector of the files we're running on,
00090     // otherwise we use the value of fDetector
00091     Detector::Detector_t detToUse=(fDetector==Detector::kUnknown) ? det : fDetector;
00092 
00093     if(fRPannUseLowETrain){
00094       MAXMSG("NCExtractionANN", Msg::kInfo, 1) 
00095         << "Using Low Energy Trained ANNs" << endl;
00096       // Boo, the ternary operator won't implicitly upcast here
00097 
00098       if(detToUse==Detector::kNear) ann=new RPnearTrackLowEANN;
00099       else                          ann=new RPfarTrackLowEANN;
00100       
00101     } 
00102     else{
00103       MAXMSG("NCExtractionANN", Msg::kInfo, 1) 
00104         << "Using All Energy Trained ANNs" << endl;
00105       if(detToUse==Detector::kNear) ann=new RPnearTrackANN;
00106       else                          ann=new RPfarTrackANN;
00107     }
00108     
00109     double ret = ann->value(0,
00110                             evtPHperPlane,
00111                             evtPHperStrip,
00112                             trkPHFraction,
00113                             trkStrips,
00114                             trkdCosZvtx,
00115                             trackExtension,
00116                             trkredChi2);
00117     // Make sure not to leak the ann
00118     delete ann;
00119     return ret;
00120     
00121   }//if tracks > 0
00122   else return 0; //no tracks
00123 
00124 }


Member Data Documentation

Detector::Detector_t NCExtractionANN::fDetector [protected]
 

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().

Bool_t NCExtractionANN::fRPannUseLowETrain [private]
 

Definition at line 50 of file NCExtractionANN.h.


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:09:39 2010 for loon by  doxygen 1.3.9.1