#include <NCExtractionCutswkNN.h>
Inheritance diagram for NCExtractionCutswkNN:

Public Member Functions | |
| NCExtractionCutswkNN (NCAnalysisCuts *cuts, const Registry &r) | |
| void | FillAnalysisInfo (NCEventInfo &evtInfo, int beamType) |
| Fill the analysisInfo member of evtInfo based on the other members and the beamType (in whatever convention that is). | |
Protected Member Functions | |
| virtual double | GetIdProbability (NCEventInfo &evtInfo, int) |
| The probability that this event is CC. | |
| virtual double | GetCutPosition () const |
| Where to cut on the IdProbability. | |
Private Member Functions | |
| bool | PassesTrackReclamation (NCEventInfo &evtInfo) |
| Does the event pass the ND "good track or track reclamation" cut? | |
| bool | PassesNCCuts (NCEventInfo &evtInfo) |
| Does the event pass the NC selection algorithm? | |
| bool | PassesCCCuts (NCEventInfo &evtInfo) |
| Does the event pass the CC selection algorithm? | |
Private Attributes | |
| BeamType::BeamType_t | fBeamType |
Definition at line 22 of file NCExtractionCutswkNN.h.
| NCExtractionCutswkNN::NCExtractionCutswkNN | ( | NCAnalysisCuts * | cuts, | |
| const Registry & | r | |||
| ) |
Definition at line 20 of file NCExtractionCutswkNN.cxx.
References BeamType::TagToEnum().
00021 : 00022 NCExtraction(cuts, r), 00023 fBeamType(BeamType::kUnknown) 00024 00025 { 00026 const char* tmps; 00027 if (r.Get("BeamType", tmps)) fBeamType=BeamType::TagToEnum(tmps); 00028 }
| void NCExtractionCutswkNN::FillAnalysisInfo | ( | NCEventInfo & | evtInfo, | |
| int | beamType | |||
| ) | [virtual] |
Fill the analysisInfo member of evtInfo based on the other members and the beamType (in whatever convention that is).
The default implementation fills separationParameter with the value of GetIdProbability(), separationParameterCut with the value of GetCutPosition(), and sets isCC to 1 if separationParameter >= separationParameterCut, and isNC to 1 otherwise
Reimplemented from NCExtraction.
Definition at line 100 of file NCExtractionCutswkNN.cxx.
References NCEventInfo::analysis, NCExtraction::fCuts, GetCutPosition(), GetIdProbability(), NCAnalysisCuts::InBeamFiducialVolume(), ANtpAnalysisInfo::isCC, NCAnalysisCuts::IsGoodBeamEvent(), ANtpAnalysisInfo::isNC, ANtpAnalysisInfo::pass, PassesCCCuts(), PassesNCCuts(), NCEventInfo::reco, ANtpAnalysisInfo::Reset(), ANtpAnalysisInfo::separationParameter, ANtpAnalysisInfo::separationParameterCut, and ANtpRecoInfo::trackMomentum.
00101 { 00102 00103 ANtpAnalysisInfo* ana=evtInfo.analysis; 00104 double separationCut=GetCutPosition(); 00105 00106 ana->Reset(); 00107 00108 ana->separationParameterCut = separationCut; 00109 ana->separationParameter = GetIdProbability(evtInfo, beamType); 00110 00111 // Events that pass the NC algorithm are NC... 00112 ana->isNC = PassesNCCuts(evtInfo); 00113 // ...of those that aren't, only the ones passing the CC cuts are CC 00114 ana->isCC = (!ana->isNC) && PassesCCCuts(evtInfo); 00115 00116 if(ana->isCC) { 00117 ana->pass = (int)( evtInfo.reco->trackMomentum <= 0 && 00118 fCuts->IsGoodBeamEvent() && 00119 fCuts->InBeamFiducialVolume() ); 00120 } else if(ana->isNC) { 00121 ana->pass = (int)fCuts->InBeamFiducialVolume(); 00122 } 00123 else ana->pass=0; // neither NC nor CC 00124 }
| virtual double NCExtractionCutswkNN::GetCutPosition | ( | ) | const [inline, protected, virtual] |
Where to cut on the IdProbability.
Implements NCExtraction.
Definition at line 32 of file NCExtractionCutswkNN.h.
Referenced by FillAnalysisInfo().
| double NCExtractionCutswkNN::GetIdProbability | ( | NCEventInfo & | evtInfo, | |
| int | ||||
| ) | [protected, virtual] |
The probability that this event is CC.
Implements NCExtraction.
Definition at line 31 of file NCExtractionCutswkNN.cxx.
References Msg::kDebug, MAXMSG, PassesCCCuts(), and PassesNCCuts().
Referenced by FillAnalysisInfo().
00032 { 00033 MAXMSG("NCExtractionCuts", Msg::kDebug,20) << "GetIdProbabilty" << endl; 00034 00035 bool passesNCCuts=PassesNCCuts(evtInfo); 00036 bool passesCCCuts=PassesCCCuts(evtInfo); 00037 00038 // Mini truth table for return value: 00039 // | CC | !CC 00040 // ---------------- 00041 // NC | -1 | 0 00042 // !NC | 1 | -2 00043 00044 if ( passesCCCuts && !passesNCCuts) return 1; 00045 else if(!passesCCCuts && passesNCCuts) return 0; 00046 else if( passesCCCuts && passesNCCuts) return -1; 00047 else if(!passesCCCuts && !passesNCCuts) return -2; 00048 00049 assert(0 && "This should never happen"); 00050 }
| bool NCExtractionCutswkNN::PassesCCCuts | ( | NCEventInfo & | evtInfo | ) | [private] |
Does the event pass the CC selection algorithm?
Definition at line 85 of file NCExtractionCutswkNN.cxx.
References ANtpTrackInfoNC::kNN, ANtpTrackInfoNC::kNNShort, and NCEventInfo::track.
Referenced by FillAnalysisInfo(), and GetIdProbability().
| bool NCExtractionCutswkNN::PassesNCCuts | ( | NCEventInfo & | evtInfo | ) | [private] |
Does the event pass the NC selection algorithm?
Definition at line 53 of file NCExtractionCutswkNN.cxx.
References det, ANtpHeaderInfo::detector, NCEventInfo::event, NCEventInfo::header, Detector::kNear, ANtpEventInfoNC::lengthInPlanes, ANtpTrackInfo::planes, ANtpShowerInfo::planes, ANtpEventInfo::planes, NCEventInfo::shower, NCEventInfo::track, and ANtpEventInfo::tracks.
Referenced by FillAnalysisInfo(), and GetIdProbability().
00054 { 00055 const Detector::Detector_t det = (Detector::Detector_t)evtInfo.header->detector; 00056 00057 int tracks = evtInfo.event->tracks; 00058 00059 int planes = det==Detector::kNear ? evtInfo.event->lengthInPlanes : 00060 evtInfo.event->planes; 00061 00062 int trackExtension = evtInfo.shower->planes - evtInfo.track->planes; 00063 00064 //NC Algorithm: 00065 00066 // 1. Long events are definitely not NC 00067 if(planes >= 47) return false; 00068 else{ 00069 // 2. Events without tracks definitely *are* NC 00070 if(tracks == 0) { 00071 return true; 00072 } else { 00073 // 3. Short events with tracks need to pass the track extension cut 00074 if(trackExtension > -6) { 00075 return true; 00076 } else { 00077 return false; 00078 } 00079 } 00080 } 00081 00082 }
| bool NCExtractionCutswkNN::PassesTrackReclamation | ( | NCEventInfo & | evtInfo | ) | [private] |
Does the event pass the ND "good track or track reclamation" cut?
Definition at line 91 of file NCExtractionCutswkNN.cxx.
References ANtpTrackInfo::begPlaneU, ANtpTrackInfo::begPlaneV, ANtpTrackInfo::endPlane, ANtpTrackInfo::endPlaneU, ANtpTrackInfo::endPlaneV, ANtpTrackInfo::passedFit, and NCEventInfo::track.
00092 { 00093 return evtInfo.track->passedFit>0 || 00094 (TMath::Abs(evtInfo.track->begPlaneU - evtInfo.track->begPlaneV) < 6 00095 && TMath::Abs(evtInfo.track->endPlaneU - evtInfo.track->endPlaneV) < 41 00096 && evtInfo.track->endPlane < 270); 00097 }
Definition at line 45 of file NCExtractionCutswkNN.h.
1.4.7