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

EventFilter.cxx

Go to the documentation of this file.
00001 #include "CandNtupleSR/NtpSRRecord.h"
00002 #include "CandNtupleSR/NtpSREvent.h"
00003 #include "CandNtupleSR/NtpSRTrack.h"
00004 #include "CandNtupleSR/NtpSRShower.h"
00005 #include "StandardNtuple/NtpStRecord.h"
00006 #include "NueAna/EventFilter.h"
00007 #include "NueAna/SntpHelpers.h"
00008 #include "NueAna/NueRecord.h"
00009 
00010 Bool_t EventFilter::PassesHiTrackCut(NtpSREvent *event, NtpStRecord *st, int cut){
00011 
00012 
00013     Bool_t passesCut=false;
00014     if(cut<0) {passesCut=true; return passesCut;}
00015 
00016     int longestTrack=0;
00017     for(int j=0;j<event->ntrack;j++){
00018         int tindex = SntpHelpers::GetTrackIndex(j,event);
00019         NtpSRTrack *track = SntpHelpers::GetTrack(tindex,st);
00020         if(longestTrack<track->plane.n){
00021             longestTrack = track->plane.n;
00022         }
00023     }
00024     
00025     if(longestTrack<cut){passesCut=true;}
00026     return passesCut;
00027 }
00028 
00029 Bool_t EventFilter::PassesHiTrackCut(NtpSREvent *event, NtpSRRecord *st, int cut){
00030 
00031 
00032     Bool_t passesCut=false;
00033     if(cut<0) {passesCut=true; return passesCut;}
00034 
00035     int longestTrack=0;
00036     for(int j=0;j<event->ntrack;j++){
00037         int tindex = SntpHelpers::GetTrackIndex(j,event);
00038         NtpSRTrack *track = SntpHelpers::GetTrack(tindex,st);
00039         if(longestTrack<track->plane.n){
00040             longestTrack = track->plane.n;
00041         }
00042     }
00043     
00044     if(longestTrack<cut){passesCut=true;}
00045     return passesCut;
00046 }
00047 Bool_t EventFilter::PassesTrackLikeCut(NtpSREvent *event, NtpStRecord *st, int cut){
00048 
00049 
00050     Bool_t passesCut=false;
00051     if(cut<0) {passesCut=true; return passesCut;}
00052 
00053     int longestTrack=0;
00054     for(int j=0;j<event->ntrack;j++){
00055         int tindex = SntpHelpers::GetTrackIndex(j,event);
00056         NtpSRTrack *track = SntpHelpers::GetTrack(tindex,st);
00057         if(longestTrack<track->plane.ntrklike){
00058             longestTrack = track->plane.ntrklike;
00059         }
00060     }
00061     
00062     if(longestTrack<cut){passesCut=true;}
00063     return passesCut;
00064 }
00065 
00066 Bool_t EventFilter::PassesTrackLikeCut(NtpSREvent *event, NtpSRRecord *st, int cut){
00067 
00068 
00069     Bool_t passesCut=false;
00070     if(cut<0) {passesCut=true; return passesCut;}
00071 
00072     int longestTrack=0;
00073     for(int j=0;j<event->ntrack;j++){
00074         int tindex = SntpHelpers::GetTrackIndex(j,event);
00075         NtpSRTrack *track = SntpHelpers::GetTrack(tindex,st);
00076         if(longestTrack<track->plane.ntrklike){
00077             longestTrack = track->plane.ntrklike;
00078         }
00079     }
00080     
00081     if(longestTrack<cut){passesCut=true;}
00082     return passesCut;
00083 }
00084 Bool_t EventFilter::PassesHiShowerCut(NtpSREvent *event, NtpStRecord *st, float cut){
00085 
00086     Bool_t passesCut=false;
00087     if(cut<0) {passesCut=true; return passesCut;}
00088     
00089 
00090     float highestShwEng=0;
00091     for(int j=0;j<event->nshower;j++){
00092         int index = SntpHelpers::GetShowerIndex(j,event);
00093         NtpSRShower *shower = SntpHelpers::GetShower(index,st);
00094         if(highestShwEng<shower->ph.gev){
00095             highestShwEng=shower->ph.gev;
00096         }
00097     }
00098     
00099     if(highestShwEng<cut){passesCut=true;}
00100     return passesCut;
00101 }
00102 Bool_t EventFilter::PassesHiShowerCut(NtpSREvent *event, NtpSRRecord *st, float cut){
00103 
00104     Bool_t passesCut=false;
00105     if(cut<0) {passesCut=true; return passesCut;}
00106     
00107 
00108     float highestShwEng=0;
00109     for(int j=0;j<event->nshower;j++){
00110         int index = SntpHelpers::GetShowerIndex(j,event);
00111         NtpSRShower *shower = SntpHelpers::GetShower(index,st);
00112         if(highestShwEng<shower->ph.gev){
00113             highestShwEng=shower->ph.gev;
00114         }
00115     }
00116     
00117     if(highestShwEng<cut){passesCut=true;}
00118     return passesCut;
00119 
00120 }
00121 
00122 Bool_t EventFilter::PassesLoShowerCut(NtpSREvent *event, NtpStRecord *st, float cut){
00123 
00124     Bool_t passesCut=false;
00125     if(cut<0) {passesCut=true; return passesCut;}
00126     
00127     int nshws = event->nshower;  //no. of showers
00128     if(nshws==0) {passesCut=false; return passesCut;}
00129 
00130     float highestShwEng=0;
00131     for(int j=0;j<event->nshower;j++){
00132         int index = SntpHelpers::GetShowerIndex(j,event);
00133         NtpSRShower *shower = SntpHelpers::GetShower(index,st);
00134         if(highestShwEng<shower->ph.gev){
00135             highestShwEng=shower->ph.gev;
00136         }
00137     }
00138     
00139 
00140     if(nshws==1&&highestShwEng>cut){passesCut=true;}
00141     else if(nshws>1&&highestShwEng>cut/2){passesCut=true;}
00142     return passesCut;
00143 }
00144 Bool_t EventFilter::PassesLoShowerCut(NtpSREvent *event, NtpSRRecord *st, float cut){
00145 
00146     Bool_t passesCut=false;
00147     if(cut<0) {passesCut=true; return passesCut;}
00148     
00149     int nshws = event->nshower;  //no. of showers
00150     if(nshws==0) {passesCut=false; return passesCut;}
00151 
00152     float highestShwEng=0;
00153     for(int j=0;j<event->nshower;j++){
00154         int index = SntpHelpers::GetShowerIndex(j,event);
00155         NtpSRShower *shower = SntpHelpers::GetShower(index,st);
00156         if(highestShwEng<shower->ph.gev){
00157             highestShwEng=shower->ph.gev;
00158         }
00159     }
00160     
00161     if(nshws==1&&highestShwEng>cut){passesCut=true;}
00162     else if(nshws>1&&highestShwEng>cut/2){passesCut=true;}
00163     return passesCut;
00164 
00165 }
00166 
00167 
00168 
00169 
00170 Bool_t EventFilter::PassesHiEnergyCut(NtpSREvent *event, float cut){
00171     Bool_t passesCut=false;
00172     if(cut<0) {passesCut=true; return passesCut;}
00173     if(event->ph.sigcor<cut) passesCut=true;
00174     return passesCut;
00175 }
00176 
00177 
00178 Bool_t EventFilter::PassesLoEnergyCut(NtpSREvent *event,  float cut){
00179     Bool_t passesCut=false;
00180     if(cut<0) {passesCut=true; return passesCut;}
00181     if(event->ph.sigcor>cut) passesCut=true;
00182     return passesCut;
00183 }
00184 
00185 Bool_t EventFilter::PassesLoEventCut(NtpSREvent *event,  int cut){
00186     Bool_t passesCut=false;
00187     if(cut<0) {passesCut=true; return passesCut;}
00188     if(event->plane.n>cut) passesCut=true;
00189     return passesCut;
00190 }
00191 
00192 
00193 Bool_t EventFilter::PassesAllCuts(NtpSREvent *event, NtpStRecord *st, int trkcut,int trklike, int loevtcut, float hiecut, float loecut, float hishwcut, float loshwcut){
00194 
00195 
00196     Bool_t passesCut=false;
00197 
00198     if(PassesHiTrackCut(event,st,trkcut)&&
00199        PassesTrackLikeCut(event,st,trklike)&&
00200        PassesHiEnergyCut(event,hiecut) && 
00201        PassesLoEnergyCut(event,loecut) && 
00202        PassesHiShowerCut(event,st,hishwcut) && 
00203        PassesLoShowerCut(event,st,loshwcut) && 
00204        PassesLoEventCut(event,loevtcut) ) passesCut=true;
00205 
00206     return passesCut;
00207 }
00208 
00209 
00210 
00211 Bool_t EventFilter::PassesAllCuts(NtpSREvent *event, NtpSRRecord *st, int trkcut, int trklike, int loevtcut, float hiecut, float loecut, float hishwcut, float loshwcut){
00212 
00213     Bool_t passesCut=false;
00214 
00215     if(PassesHiTrackCut(event,st,trkcut)&&
00216        PassesTrackLikeCut(event,st,trklike)&&
00217        PassesHiEnergyCut(event,hiecut) && 
00218        PassesLoEnergyCut(event,loecut) && 
00219        PassesHiShowerCut(event,st,hishwcut) && 
00220        PassesLoShowerCut(event,st,loshwcut) && 
00221        PassesLoEventCut(event,loevtcut) ) passesCut=true;
00222 
00223     return passesCut;
00224 }
00225 
00226 
00227 
00228 
00229 
00230 
00231 Bool_t EventFilter::PassesHiTrackCut(NueRecord *nr, int cut){
00232 
00233 
00234     Bool_t passesCut=false;
00235     if(cut<0) {passesCut=true; return passesCut;}
00236     if(nr->srtrack.planes<cut){passesCut=true;}
00237     return passesCut;
00238 }
00239 
00240 Bool_t EventFilter::PassesTrackLikeCut(NueRecord *nr, int cut){
00241 
00242 
00243     Bool_t passesCut=false;
00244     if(cut<0) {passesCut=true; return passesCut;}
00245     if(nr->srtrack.trklikePlanes<cut){passesCut=true;}
00246     return passesCut;
00247 }
00248 
00249 Bool_t EventFilter::PassesHiShowerCut(NueRecord *nr, float cut){
00250 
00251     Bool_t passesCut=false;
00252     if(cut<0) {passesCut=true; return passesCut;}
00253     if(nr->srshower.phNueGeV<cut){passesCut=true;}
00254     return passesCut;
00255 
00256 }
00257 
00258 Bool_t EventFilter::PassesLoShowerCut(NueRecord *nr, float cut){
00259 
00260     Bool_t passesCut=false;
00261     if(cut<0) {passesCut=true; return passesCut;}
00262     
00263     int nshws = nr->srevent.showers;  //no. of showers
00264     if(nshws==0) {passesCut=false; return passesCut;}
00265 
00266     if(nshws==1 && nr->srshower.phNueGeV > cut){passesCut=true;}
00267     else if(nshws>1 && nr->srshower.phNueGeV > cut/2.0){passesCut=true;}
00268     return passesCut;
00269 }
00270 
00271 Bool_t EventFilter::PassesHiEnergyCut(NueRecord *nr, float cut){
00272     Bool_t passesCut=false;
00273     if(cut<0) {passesCut=true; return passesCut;}
00274     if(nr->srevent.phMeu<cut) passesCut=true;
00275     return passesCut;
00276 }
00277 
00278 
00279 Bool_t EventFilter::PassesLoEnergyCut(NueRecord *nr,  float cut){
00280     Bool_t passesCut=false;
00281     if(cut<0) {passesCut=true; return passesCut;}
00282     if(nr->srevent.phMeu>cut) passesCut=true;
00283     return passesCut;
00284 }
00285 
00286 Bool_t EventFilter::PassesLoEventCut(NueRecord *nr,  int cut){
00287     Bool_t passesCut=false;
00288     if(cut<0) {passesCut=true; return passesCut;}
00289     if(nr->srevent.planes>cut) passesCut=true;
00290     return passesCut;
00291 }
00292 
00293 
00294 Bool_t EventFilter::PassesAllCuts(NueRecord *nr, int trkcut,int trklike, int loevtcut, float hiecut, float loecut, float hishwcut, float loshwcut){
00295 
00296 
00297     Bool_t passesCut=false;
00298 
00299     if(PassesHiTrackCut(nr,trkcut)&&
00300        PassesTrackLikeCut(nr,trklike)&&
00301        PassesHiEnergyCut(nr,hiecut) && 
00302        PassesLoEnergyCut(nr,loecut) && 
00303        PassesHiShowerCut(nr,hishwcut) && 
00304        PassesLoShowerCut(nr,loshwcut) && 
00305        PassesLoEventCut(nr,loevtcut) ) passesCut=true;
00306 
00307     return passesCut;
00308 }
00309 

Generated on Mon Feb 15 11:06:39 2010 for loon by  doxygen 1.3.9.1