AtNuEventSelectionAB Class Reference

#include <AtNuEventSelectionAB.h>

Inheritance diagram for AtNuEventSelectionAB:
AtNuEventSelection

List of all members.

Public Member Functions

 AtNuEventSelectionAB ()
 ~AtNuEventSelectionAB ()
Int_t GetEventType (AtmosEvent *event)
Int_t GetAtmosEventType (AtmosEvent *event)
Double_t GetShieldTime (AtmosEvent *event)
Double_t GetSpillTime (AtmosEvent *event)
Double_t GetShieldTime (AtmosEvent *event, AtmosEvent *shieldevent, Double_t offset)
void SetDebug (bool b)
Bool_t SelectGoodSlice (AtmosEvent *event)
Bool_t SelectGoodEvent (AtmosEvent *event)
Bool_t SelectGoodTrack (AtmosEvent *event)
Bool_t SelectGoodShower (AtmosEvent *event)
Bool_t SelectCV (AtmosEvent *event)
Bool_t SelectCE (AtmosEvent *event)
Bool_t SelectUP (AtmosEvent *event)
Bool_t SelectDN (AtmosEvent *event)
Bool_t SelectHOZ (AtmosEvent *event)
Bool_t SelectUPDN (AtmosEvent *event)
Bool_t SelectFC (AtmosEvent *event)
Bool_t SelectPC (AtmosEvent *event)
Bool_t SelectRAF (AtmosEvent *event)
Bool_t SelectPCDN (AtmosEvent *event)
Bool_t SelectPCUP (AtmosEvent *event)
Bool_t SelectCVUP (AtmosEvent *event)
Bool_t SelectUPMU (AtmosEvent *event)
Bool_t SelectCosmicMuon (AtmosEvent *event)
Bool_t SelectGoodCosmicMuon (AtmosEvent *event)
Bool_t SelectStoppingMuon (AtmosEvent *event)
Bool_t SelectThroughGoingMuon (AtmosEvent *event)
Bool_t SelectSingleMuon (AtmosEvent *event)
Bool_t SelectMultipleMuon (AtmosEvent *event)
Bool_t SelectVeto (AtmosEvent *event)
Bool_t SelectSpill (AtmosEvent *event)
Bool_t SelectBeamSpill (AtmosEvent *event)
Bool_t SelectFakeSpill (AtmosEvent *event)
Bool_t SelectGoodShield (AtmosEvent *event)
Bool_t SelectGoodDirection (AtmosEvent *event)
Bool_t SelectGoodEnergy (AtmosEvent *event)
Bool_t SelectGoodCharge (AtmosEvent *event)
Bool_t SelectPositiveCharge (AtmosEvent *event)
Bool_t SelectNegativeCharge (AtmosEvent *event)
Bool_t SelectAtmosSlice (AtmosEvent *event)
Bool_t SelectAtmosTrack (AtmosEvent *event)
Bool_t SelectAtmosShower (AtmosEvent *event)
Bool_t SelectGoodAtmosSlice (AtmosEvent *event)
Bool_t SelectGoodAtmosTrack (AtmosEvent *event)
Bool_t SelectGoodAtmosShower (AtmosEvent *event)
Bool_t SelectContainedAtmosTrack (AtmosEvent *event)
Bool_t SelectContainedAtmosShower (AtmosEvent *event)
Bool_t SelectAtmosNumu (AtmosEvent *event)
Bool_t SelectAtmosNumuCV (AtmosEvent *event)
Bool_t SelectAtmosNumuUP (AtmosEvent *event)
Bool_t SelectAtmosNumuUPDN (AtmosEvent *event)
Bool_t SelectAtmosNue (AtmosEvent *event)
Bool_t SelectAtmosNueCV (AtmosEvent *event)
Bool_t SelectAtmosNumuCVcut1 (AtmosEvent *event)
Bool_t SelectAtmosNumuCVcut2 (AtmosEvent *event)
Bool_t SelectAtmosNumuCVcut3 (AtmosEvent *event)
Bool_t SelectAtmosNumuCVcut4 (AtmosEvent *event)
Bool_t SelectAtmosNumuUPcut1 (AtmosEvent *event)
Bool_t SelectAtmosNumuUPcut2 (AtmosEvent *event)
Bool_t SelectAtmosNumuUPcut3 (AtmosEvent *event)
Bool_t SelectAtmosNumuUPcut4 (AtmosEvent *event)
Bool_t SelectAtmosNueCVcut1 (AtmosEvent *event)
Bool_t SelectAtmosNueCVcut2 (AtmosEvent *event)
Bool_t SelectAtmosNueCVcut3 (AtmosEvent *event)
Bool_t SelectAtmosNueCVcut4 (AtmosEvent *event)
Bool_t SelectLIevent (AtmosEvent *event)
Bool_t SelectMCscatter (AtmosEvent *event)
AtmosTrackGetLargestTrack (AtmosEvent *event)
AtmosShowerGetLargestShower (AtmosEvent *event)
AtmosTrackGetPrimaryTrack (AtmosEvent *event)
AtmosShowerGetPrimaryShower (AtmosEvent *event)
Int_t GetPrimaryTrackIndex (AtmosEvent *event)
Int_t GetPrimaryShowerIndex (AtmosEvent *event)
void PrimaryTrackShower (AtmosEvent *event, AtmosTrack *&track, AtmosShower *&shower, Bool_t doCleaning=1, Bool_t doSeparation=0)

Private Member Functions

Bool_t ContainedEventDigits (AtmosEvent *event, Bool_t FCfilter, Bool_t PCfilter)
Bool_t ContainedEventDigitsTrace (AtmosEvent *event)
Bool_t ContainedEventTrack (AtmosEvent *event)
Bool_t ContainedEventShower (AtmosEvent *event)
Bool_t SingleTrack (AtmosEvent *event)
Bool_t SingleShower (AtmosEvent *event)
Bool_t GoodAtmosSlice (AtmosEvent *event)
Bool_t GoodAtmosShower (AtmosEvent *event)
Bool_t GoodAtmosTrack (AtmosEvent *event)
Bool_t AtmosNumuCVcuts (AtmosEvent *event, Int_t cut=-1)
Bool_t AtmosNumuUPcuts (AtmosEvent *event, Int_t cut=-1)
Bool_t AtmosNumuUPDNcuts (AtmosEvent *event, Int_t cut=-1)
Bool_t AtmosNueCVcuts (AtmosEvent *event, Int_t cut=-1)
Bool_t GoodTrack (AtmosTrack *track)
Bool_t GoodCosmicTrack (AtmosTrack *track)
Bool_t UpGoingTrack (AtmosTrack *track)
Bool_t HorizontalTrack (AtmosTrack *track)
Bool_t DownGoingTrack (AtmosTrack *track)
Bool_t ContainedVertex (AtmosTrack *track)
Bool_t ContainedEnd (AtmosTrack *track)
Bool_t VertexInCoil (AtmosTrack *track)
Bool_t VertexInCoilSneakily (AtmosTrack *track)
Bool_t EndInCoil (AtmosTrack *track)
Bool_t EndInCoilSneakily (AtmosTrack *track)
Bool_t FiducialTrack (AtmosTrack *track)
Bool_t GoodShower (AtmosShower *shower)
Bool_t ContainedVertex (AtmosShower *shower)
Bool_t ContainedEnd (AtmosShower *shower)
Bool_t VertexInCoil (AtmosShower *shower)
Bool_t VertexInCoilSneakily (AtmosShower *shower)
Bool_t EndInCoil (AtmosShower *shower)
Bool_t EndInCoilSneakily (AtmosShower *shower)
Bool_t FiducialShower (AtmosShower *shower)
Bool_t ContainedTrackCuts (AtmosEvent *event, AtmosTrack *track, AtmosShower *shower, Int_t cut=-1)
Bool_t UpGoingTrackCuts (AtmosEvent *event, AtmosTrack *track, AtmosShower *shower, Int_t cut=-1)
Bool_t ContainedShowerCuts (AtmosEvent *event, AtmosTrack *track, AtmosShower *shower, Int_t cut=-1)
Bool_t LIsieve (AtmosEvent *event)
Bool_t MCscatter (AtmosEvent *event)
Double_t SpillTime (AtmosEvent *event)
Double_t ShieldTime (AtmosEvent *event)
Double_t ShieldTime (AtmosEvent *event, AtmosEvent *shieldevent, Double_t offset)

Private Attributes

Bool_t fDebug

Detailed Description

Definition at line 9 of file AtNuEventSelectionAB.h.


Constructor & Destructor Documentation

AtNuEventSelectionAB::AtNuEventSelectionAB (  ) 

Definition at line 21 of file AtNuEventSelectionAB.cxx.

00021                                            :
00022   fDebug(0)
00023 {
00024   
00025 }

AtNuEventSelectionAB::~AtNuEventSelectionAB (  ) 

Definition at line 27 of file AtNuEventSelectionAB.cxx.

00028 {
00029   
00030 }


Member Function Documentation

Bool_t AtNuEventSelectionAB::AtmosNueCVcuts ( AtmosEvent event,
Int_t  cut = -1 
) [private]

Definition at line 549 of file AtNuEventSelectionAB.cxx.

References ContainedEventShower(), ContainedShowerCuts(), GetLargestTrack(), GetPrimaryShower(), SelectFC(), and SelectGoodShower().

Referenced by SelectAtmosNueCV(), SelectAtmosNueCVcut1(), SelectAtmosNueCVcut2(), SelectAtmosNueCVcut3(), and SelectAtmosNueCVcut4().

00550 {
00551   // select contained vertex
00552   // =======================
00553   if( this->SelectFC(event)==0 ) return 0;
00554 
00555   // select contained vertex (digit cuts)
00556   // ====================================
00557   if( this->ContainedEventShower(event)==0 ) return 0;
00558 
00559   // select good shower
00560   // ==================
00561   // calls (event):
00562   //  GoodAtmosSlice(event)
00563   //  GoodAtmosShower(event)
00564   // calls (shower): 
00565   //  GoodShower(shower)
00566   if( this->SelectGoodShower(event)==0 ) return 0;
00567 
00568   // get primary shower
00569   // ==================
00570   AtmosShower* shower = (AtmosShower*)(this->GetPrimaryShower(event));
00571 
00572   // get largest track
00573   // =================
00574   AtmosTrack* track = (AtmosTrack*)(this->GetLargestTrack(event));
00575 
00576   // select contained vertex (shower cuts)
00577   // =====================================
00578   if( this->ContainedShowerCuts(event,track,shower,cut)==0 ) return 0;
00579 
00580   // pass event
00581   // ==========
00582   return 1;
00583 }

Bool_t AtNuEventSelectionAB::AtmosNumuCVcuts ( AtmosEvent event,
Int_t  cut = -1 
) [private]

Definition at line 467 of file AtNuEventSelectionAB.cxx.

References ContainedEventTrack(), ContainedTrackCuts(), GetLargestShower(), GetPrimaryTrack(), SelectCV(), and SelectGoodTrack().

Referenced by SelectAtmosNumuCV(), SelectAtmosNumuCVcut1(), SelectAtmosNumuCVcut2(), SelectAtmosNumuCVcut3(), and SelectAtmosNumuCVcut4().

00468 {
00469   // select contained vertex
00470   // =======================
00471   if( this->SelectCV(event)==0 ) return 0;
00472 
00473   // select contained vertex (digit cuts)
00474   // ====================================
00475   if( this->ContainedEventTrack(event)==0 ) return 0;
00476 
00477   // select good track
00478   // =================
00479   // calls (event): 
00480   //  GoodAtmosSlice(event)
00481   //  GoodAtmosTrack(event)
00482   // calls (track): 
00483   //  GoodTrack(track)
00484   if( this->SelectGoodTrack(event)==0 ) return 0;
00485 
00486   // get primary track
00487   // =================
00488   AtmosTrack* track = (AtmosTrack*)(this->GetPrimaryTrack(event));
00489 
00490   // get largest shower
00491   // ==================
00492   AtmosShower* shower = (AtmosShower*)(this->GetLargestShower(event));
00493 
00494   // select contained vertex (track cuts)
00495   // ====================================
00496   if( this->ContainedTrackCuts(event,track,shower,cut)==0 ) return 0;
00497   
00498   // pass event
00499   // ==========
00500   return 1;
00501 }

Bool_t AtNuEventSelectionAB::AtmosNumuUPcuts ( AtmosEvent event,
Int_t  cut = -1 
) [private]

Definition at line 537 of file AtNuEventSelectionAB.cxx.

References AtmosNumuUPDNcuts(), SelectCVUP(), and SelectUPMU().

Referenced by SelectAtmosNumuUP(), SelectAtmosNumuUPcut1(), SelectAtmosNumuUPcut2(), SelectAtmosNumuUPcut3(), and SelectAtmosNumuUPcut4().

00538 {
00539   // select up-going event
00540   // =====================
00541   if( this->SelectCVUP(event)==0 
00542    && this->SelectUPMU(event)==0 ) return 0;
00543 
00544   // apply direction cuts
00545   // ====================
00546   return this->AtmosNumuUPDNcuts(event,cut);
00547 }

Bool_t AtNuEventSelectionAB::AtmosNumuUPDNcuts ( AtmosEvent event,
Int_t  cut = -1 
) [private]

Definition at line 503 of file AtNuEventSelectionAB.cxx.

References GetLargestShower(), GetPrimaryTrack(), SelectGoodTrack(), SelectUPDN(), and UpGoingTrackCuts().

Referenced by AtmosNumuUPcuts(), and SelectAtmosNumuUPDN().

00504 {  
00505   // select clean up-going/down-going track
00506   // ======================================
00507   // note: this cuts on reconstructed muon direction,
00508   //       relative vertex/end position, and timing
00509   if( this->SelectUPDN(event)==0 ) return 0;
00510 
00511   // select good track
00512   // =================
00513   // calls (event): 
00514   //  GoodAtmosSlice(event)
00515   //  GoodAtmosTrack(event)
00516   // calls (track): 
00517   //  GoodTrack(track)
00518   if( this->SelectGoodTrack(event)==0 ) return 0;
00519 
00520   // get primary track
00521   // =================
00522   AtmosTrack* track = (AtmosTrack*)(this->GetPrimaryTrack(event));
00523 
00524   // get largest shower
00525   // ==================
00526   AtmosShower* shower = (AtmosShower*)(this->GetLargestShower(event));
00527 
00528   // apply direction cuts
00529   // ====================
00530   if( this->UpGoingTrackCuts(event,track,shower,cut)==0 ) return 0;
00531 
00532   // pass event
00533   // ==========
00534   return 1;
00535 }

Bool_t AtNuEventSelectionAB::ContainedEnd ( AtmosShower shower  )  [private]

Definition at line 2268 of file AtNuEventSelectionAB.cxx.

References ContainedVertex().

02269 {
02270   // apply to vertex for now, need to define shower 'end'
02271   // ====================================================
02272   return this->ContainedVertex(shower);
02273 }

Bool_t AtNuEventSelectionAB::ContainedEnd ( AtmosTrack track  )  [private]

Definition at line 1768 of file AtNuEventSelectionAB.cxx.

References AtmosTrack::EndDistToEdge, AtmosTrack::EndPlane, and AtmosTrack::EndTraceZ.

Referenced by ContainedShowerCuts(), ContainedTrackCuts(), SelectCE(), SelectGoodEnergy(), SelectStoppingMuon(), and SelectThroughGoingMuon().

01769 {
01770   // contained track selection
01771   // =========================
01772   // distance to edge >20cm AND traceZ >15cm
01773   // >5 planes from ends of supermodules
01774   // cuts on end from digits
01775 
01776   if(  ( track->EndDistToEdge>0.20 && track->EndTraceZ>0.15 )
01777    &&  ( track->EndPlane>5 && track->EndPlane<481 )
01778    && !( track->EndPlane>243 && track->EndPlane<255 ) ) return 1;
01779 
01780   return 0;
01781 }

Bool_t AtNuEventSelectionAB::ContainedEventDigits ( AtmosEvent event,
Bool_t  FCfilter,
Bool_t  PCfilter 
) [private]

Definition at line 1372 of file AtNuEventSelectionAB.cxx.

References AtmosFilter::EventId, AtmosEvent::FilterInfo, and AtmosFilter::MaxPlaneCharge.

Referenced by ContainedEventShower(), and ContainedEventTrack().

01373 {
01374   // digit containment
01375   // =================
01376 
01377   // maximum plane charge < 500 PEs
01378   if( event->FilterInfo.MaxPlaneCharge>500.0 ) return 0;
01379   
01380   // filter  noise (ID=-1)
01381   if( event->FilterInfo.EventId<0 ) return 0;
01382 
01383   // filter cosmics (ID=2)
01384   if( event->FilterInfo.EventId>1 ) return 0;
01385 
01386   // filter FC events (ID=0)
01387   if( FCfilter && event->FilterInfo.EventId==0 ) return 1;
01388 
01389   // filter PC events (ID=1)
01390   if( PCfilter && event->FilterInfo.EventId==1 ) return 1;
01391 
01392   // fail event
01393   return 0;
01394 }

Bool_t AtNuEventSelectionAB::ContainedEventDigitsTrace ( AtmosEvent event  )  [private]

Definition at line 1396 of file AtNuEventSelectionAB.cxx.

References AtmosTrack::EndPlane, AtmosTrack::EndTraceZ, AtmosTrack::EndY, AtmosTrack::EndZ, GetPrimaryTrack(), AtmosStrip::Plane, AtmosStrip::Sigcorr, AtmosEvent::StripList, AtmosTrack::VtxPlane, AtmosTrack::VtxTraceZ, AtmosTrack::VtxY, AtmosTrack::VtxZ, and AtmosStrip::Z.

Referenced by ContainedTrackCuts().

01397 {
01398   // get primary track
01399   // =================
01400   // use track digit containment
01401   AtmosTrack* track = (AtmosTrack*)(this->GetPrimaryTrack(event));
01402   if( !track ) return 0;
01403 
01404   // analyse track strips
01405   // ====================
01406   // calculate new vtxZ and traceZ from hits beyond tracks,
01407   // which must satisfy Nhits<5 or newTraceZ>0.4
01408 
01409   TClonesArray* striplist = (TClonesArray*)(event->StripList);
01410 
01411   //If there is a zero size strip list, just pass this test
01412   if(striplist->GetEntries() == 0) return true;
01413 
01414   Double_t hiVtxZ,loVtxZ,hiTraceZ;
01415   Double_t newVtxZ,newTraceZ;
01416   Int_t newVtxPlane;
01417   Int_t Nhits;
01418 
01419   Nhits = 0;
01420 
01421   if( track->VtxY>=track->EndY ){
01422     hiVtxZ = track->VtxZ; loVtxZ = track->EndZ;
01423     newVtxZ = track->VtxZ; newVtxPlane = track->VtxPlane;
01424     hiTraceZ = track->VtxTraceZ; newTraceZ = track->VtxTraceZ;
01425   }
01426   else{
01427     hiVtxZ = track->EndZ; loVtxZ = track->VtxZ;
01428     newVtxZ = track->EndZ; newVtxPlane = track->EndPlane;
01429     hiTraceZ = track->EndTraceZ; newTraceZ = track->EndTraceZ;
01430   }
01431   
01432   for( Int_t j=0; j<1+striplist->GetLast(); j++ ){
01433     AtmosStrip* strip = (AtmosStrip*)(striplist->At(j));
01434 
01435     if( strip->Sigcorr[0]+strip->Sigcorr[1]>100.0 ){
01436       if( strip->Z<hiVtxZ && hiVtxZ<loVtxZ ){
01437         Nhits++; 
01438         if( strip->Z<newVtxZ ){
01439           newVtxPlane = strip->Plane; newVtxZ = strip->Z;
01440         }
01441       }
01442       if( strip->Z>hiVtxZ && hiVtxZ>loVtxZ ){
01443         Nhits++; 
01444         if( strip->Z>newVtxZ ){
01445           newVtxPlane = strip->Plane; newVtxZ = strip->Z;
01446         }
01447       }
01448     }
01449   }   
01450 
01451   if( Nhits>4 ){
01452     if( newVtxPlane<=5 || newVtxPlane>=481 ) return 0;
01453 
01454     if( hiTraceZ>0.4  
01455      && newTraceZ-fabs(newVtxZ-hiVtxZ)<0.4 ) return 0;
01456   }
01457 
01458   return 1;
01459 }

Bool_t AtNuEventSelectionAB::ContainedEventShower ( AtmosEvent event  )  [private]

Definition at line 2242 of file AtNuEventSelectionAB.cxx.

References ContainedEventDigits(), and SelectCV().

Referenced by AtmosNueCVcuts(), and SelectContainedAtmosShower().

02243 {  
02244   // containment for showers
02245   // =======================
02246   if( this->SelectCV(event)
02247    && this->ContainedEventDigits(event,1,0) ) return 1;
02248   
02249   return 0;
02250 }

Bool_t AtNuEventSelectionAB::ContainedEventTrack ( AtmosEvent event  )  [private]

Definition at line 1743 of file AtNuEventSelectionAB.cxx.

References ContainedEventDigits(), and SelectCV().

Referenced by AtmosNumuCVcuts(), and SelectContainedAtmosTrack().

01744 {    
01745   // containment for tracks
01746   // =======================
01747   if( this->SelectCV(event)
01748    && this->ContainedEventDigits(event,1,1) ) return 1;
01749 
01750   return 0;
01751 }

Bool_t AtNuEventSelectionAB::ContainedShowerCuts ( AtmosEvent event,
AtmosTrack track,
AtmosShower shower,
Int_t  cut = -1 
) [private]

Definition at line 2324 of file AtNuEventSelectionAB.cxx.

References ContainedEnd(), ContainedVertex(), AtmosTrack::EndDistToEdge, EndInCoil(), AtmosTrack::EndTraceZ, AtmosShower::MeanChargePerPlane, AtmosShower::MeanStripsPerPlane, AtmosShower::MOIUZEigenValue1, AtmosShower::MOIVZEigenValue1, AtmosShower::Nplanes, AtmosShower::RMSChargePerPlane, AtmosShower::RMSStripsPerPlane, SelectAtmosNumu(), VertexInCoil(), VertexInCoilSneakily(), AtmosTrack::VtxDistToEdge, AtmosTrack::VtxTraceZ, and AtmosShower::VtxUpTraceZ.

Referenced by AtmosNueCVcuts().

02325 {
02326   // sanity check
02327   // ============
02328   if( shower==0 ) return 0;
02329 
02330   // electron neutrino selection
02331   // ===========================
02332   Bool_t NUEcut1 = 1; // cut (I)
02333   Bool_t NUEcut2 = 1; // cut (II)
02334   Bool_t NUEcut3 = 1; // cut (III)
02335   Bool_t NUEcut4 = 1; // cut (IV)
02336 
02337   // pass/fail
02338   Bool_t pass = 1;
02339 
02340   // containment cuts
02341   // ================
02342   // (i) shower containment
02343   
02344   // vertex contained 
02345   if( this->ContainedVertex(shower)==0 ) pass = 0;
02346 
02347   // vertex *not* in coil
02348   if( this->VertexInCoil(shower)==1 ) pass = 0;
02349 
02350   // vertex *not* in coil sneakily
02351   if( this->VertexInCoilSneakily(shower)==1 ) pass = 0;
02352 
02353   // (ii) track containment
02354   if( track ){
02355     if( this->ContainedVertex(track)==0 
02356      || this->VertexInCoil(track)==1
02357      || track->VtxDistToEdge<0.4 ) pass = 0;
02358 
02359     if( this->ContainedEnd(track)==0 
02360      || this->EndInCoil(track)==1
02361      || track->EndDistToEdge<0.4 ) pass = 0;
02362   }
02363 
02364   // (iii) digit containment
02365   // (nothing here yet)
02366 
02367   if( NUEcut1 ) NUEcut1 = pass;
02368 
02369   // trace cut
02370   // =========
02371 
02372   // (i) shower trace
02373   if( shower->VtxUpTraceZ<0.8 ) pass = 0;
02374 
02375   // (ii) track trace
02376   if( track ){
02377     if( track->VtxTraceZ<0.5 ) pass = 0;
02378     if( track->EndTraceZ<0.5 ) pass = 0;
02379   }
02380 
02381   // (iii) digit trace
02382   // (nothing here yet)
02383 
02384   if( NUEcut2 ) NUEcut2 = pass;
02385 
02386   // topology cuts
02387   // =============
02388   // Events divided into short (<=8 planes) and long (>8 planes) 
02389   //
02390   // Optimization of cuts:  
02391   //                             short          long
02392   // ShwPlanes-ShwStrips          3.            
02393   // MeanStripsPerPlane           4.            5.
02394   // RMSStripsPerPlane            3.            4.
02395   // MeanChargePerPlane         100.          150.
02396   // RMSChargePerPlane          100.          150.
02397   // MOIUZEigenValue1             0.05          0.15
02398   //
02399   // Switching order of selection cuts:
02400   //
02401   // before:
02402   //   NUEcut3: Nstrips-Nplanes, 
02403   //            MeanStripsPerPlane, RMSStripsPerPlane, 
02404   //            MeanChargePerPlane, RMSChargePerPlane
02405   //   NUEcut4: MOIUZEigenValue1, MOIVZEigenValue1
02406   // after:
02407   //   [To PreSelection: Nstrips-Nplanes]
02408   //   NUEcut3: MeanStripsPerPlane, RMSStripsPerPlane, 
02409   //            MeanChargePerPlane, RMSChargePerPlane
02410   //            MOIUZEigenValue1, MOIVZEigenValue1
02411   //   NUEcut4: Muon Neutrino Rejection
02412   //
02413 
02414   if( shower->Nplanes<=8 && shower->MeanStripsPerPlane>4.0 ) pass = 0;
02415   if( shower->Nplanes>8 && shower->MeanStripsPerPlane>5.0 ) pass = 0;
02416 
02417   if( shower->Nplanes<=8 && shower->RMSStripsPerPlane>3.0 ) pass = 0;
02418   if( shower->Nplanes>8 && shower->RMSStripsPerPlane>4.0 ) pass = 0;
02419 
02420   if( shower->Nplanes<=8 && shower->MeanChargePerPlane>100.0 ) pass = 0;
02421   if( shower->Nplanes>8 && shower->MeanChargePerPlane>150.0 ) pass = 0;
02422 
02423   if( shower->Nplanes<=8 && shower->RMSChargePerPlane>100.0 ) pass = 0;
02424   if( shower->Nplanes>8 && shower->RMSChargePerPlane>150.0 ) pass = 0;
02425 
02426   if( shower->Nplanes<=8 && shower->MOIUZEigenValue1>0.05 ) pass = 0;
02427   if( shower->Nplanes<=8 && shower->MOIVZEigenValue1>0.05 ) pass = 0;
02428 
02429   if( shower->Nplanes>8 && shower->MOIUZEigenValue1>0.15 ) pass = 0;
02430   if( shower->Nplanes>8 && shower->MOIVZEigenValue1>0.15 ) pass = 0;
02431 
02432   if( NUEcut3 ) NUEcut3 = pass;
02433 
02434   // Reject events selected as muon neutrinos
02435   // (To save time, only apply to selected events)
02436   if( pass && this->SelectAtmosNumu(event) ) pass = 0;
02437 
02438   if( NUEcut4 ) NUEcut4 = pass;
02439 
02440   // pass/fail event
02441   // ===============
02442 
02443   switch(cut){
02444     case 0: pass = 1; break;
02445     case 1: pass = NUEcut1; break;
02446     case 2: pass = NUEcut2; break;
02447     case 3: pass = NUEcut3; break;
02448     case 4: pass = NUEcut4; break;
02449     default: pass = NUEcut4; break; 
02450   }
02451 
02452   return pass;
02453 }

Bool_t AtNuEventSelectionAB::ContainedTrackCuts ( AtmosEvent event,
AtmosTrack track,
AtmosShower shower,
Int_t  cut = -1 
) [private]

Definition at line 1880 of file AtNuEventSelectionAB.cxx.

References ContainedEnd(), ContainedEventDigitsTrace(), ContainedVertex(), AtmosTrack::EndDirCosY, AtmosTrack::EndDirCosZ, AtmosTrack::EndDistToEdgeDigits, EndInCoil(), EndInCoilSneakily(), AtmosTrack::EndPlaneDigits, AtmosTrack::EndQmax, AtmosTrack::EndRmax, AtmosTrack::EndTraceZ, AtmosTrack::EndUmean, AtmosTrack::EndUwidth, AtmosTrack::EndVmean, AtmosTrack::EndVwidth, AtmosTrack::EndY, AtmosTrack::Nplanes, VertexInCoil(), VertexInCoilSneakily(), AtmosTrack::VtxDirCosY, AtmosTrack::VtxDirCosZ, AtmosTrack::VtxDistToEdgeDigits, AtmosTrack::VtxPlaneDigits, AtmosTrack::VtxQmax, AtmosTrack::VtxRmax, AtmosTrack::VtxTraceZ, AtmosTrack::VtxUmean, AtmosTrack::VtxUwidth, AtmosTrack::VtxVmean, AtmosTrack::VtxVwidth, and AtmosTrack::VtxY.

Referenced by AtmosNumuCVcuts().

01881 {  
01882   // sanity check
01883   // ============
01884   if( track==0 ) return 0;
01885 
01886   // contained vertex selection
01887   // ==========================
01888   // (apply containment cuts to highest end of track)
01889   Bool_t CVcut1 = 1; // track/digit containment cut
01890   Bool_t CVcut2 = 1; // trace cut
01891   Bool_t CVcut3 = 1; // topology cuts (I)
01892   Bool_t CVcut4 = 1; // topology cuts (II)
01893 
01894   // pass/fail
01895   Bool_t pass = 1;
01896  
01897   // case 1: vtxY>endY
01898   // ================= 
01899   if( track->VtxY-track->EndY>-0.0 ){
01900 
01901     // containment cuts
01902     // ================
01903     // (i) track containment
01904 
01905     // vertex contained 
01906     if( this->ContainedVertex(track)==0 ) pass = 0;
01907 
01908     // vertex *not* in coil
01909     if( this->VertexInCoil(track)==1 ) pass = 0;
01910 
01911     // vertex *not* in coil sneakily
01912     if( this->VertexInCoilSneakily(track)==1 ) pass = 0;
01913 
01914     // (ii) digit containment
01915     if( track->VtxDistToEdgeDigits<0.3 ) pass = 0;
01916     
01917     if( !( (track->VtxPlaneDigits>5 && track->VtxPlaneDigits<481)    
01918        && !(track->VtxPlaneDigits>243 && track->VtxPlaneDigits<255) ) ) pass = 0;
01919 
01920     if( CVcut1 ) CVcut1 = pass;
01921 
01922     // trace cut
01923     // =========
01924     if( track->VtxTraceZ<0.5 ) pass = 0;
01925  
01926     // digit trace cut
01927     if( this->ContainedEventDigitsTrace(event)==0 ) pass = 0;
01928 
01929     if( CVcut2 ) CVcut2 = pass;
01930 
01931     // topology cuts
01932     // =============
01933 
01934     if( track->VtxUmean>0.25 || track->VtxUwidth>0.5
01935      || track->VtxVmean>0.25 || track->VtxVwidth>0.5 
01936      || track->VtxRmax>1.25 || track->VtxQmax>300.0 ) pass = 0;
01937 
01938     if( CVcut3 ) CVcut3 = pass;
01939 
01940     if( track->Nplanes<25 ){
01941       if( track->VtxRmax>1.0 ) pass = 0;
01942       if( fabs(track->VtxDirCosZ)<0.5 && track->VtxQmax>75.0 ) pass = 0;
01943       if( track->VtxDirCosY<-0.7 && track->VtxQmax>75.0 ) pass = 0;
01944     }
01945 
01946     if( CVcut4 ) CVcut4 = pass;
01947   }
01948 
01949   // case 2: endY>vtxY
01950   // =================
01951   if( track->EndY-track->VtxY>-0.0 ){
01952 
01953     // containment cuts
01954     // ================
01955     // (i) track containment
01956  
01957     // vertex contained 
01958     if( this->ContainedEnd(track)==0 ) pass = 0;
01959 
01960     // vertex *not* in coil
01961     if( this->EndInCoil(track)==1 ) pass = 0;
01962 
01963     // vertex *not* in coil sneakily
01964     if( this->EndInCoilSneakily(track)==1 ) pass = 0;
01965 
01966     // (ii) digit containment
01967     if( track->EndDistToEdgeDigits<0.3 ) pass = 0;
01968     
01969     if( !( (track->EndPlaneDigits>5 && track->EndPlaneDigits<481)    
01970        && !(track->EndPlaneDigits>243 && track->EndPlaneDigits<255) ) ) pass = 0;
01971 
01972     if( CVcut1 ) CVcut1 = pass;
01973 
01974     // trace cut
01975     // =========
01976     if( track->EndTraceZ<0.5 ) pass = 0;
01977 
01978     if( CVcut2 ) CVcut2 = pass;
01979 
01980     // topology cuts
01981     // =============
01982     if( track->EndUmean>0.25 || track->EndUwidth>0.5
01983      || track->EndVmean>0.25 || track->EndVwidth>0.5 
01984      || track->EndRmax>1.25 || track->EndQmax>300.0 ) pass = 0;
01985 
01986     if( CVcut3 ) CVcut3 = pass;
01987 
01988     if( track->Nplanes<25 ){
01989       if( track->EndRmax>1.0 ) pass = 0;
01990       if( fabs(track->EndDirCosZ)<0.5 && track->EndQmax>75.0 ) pass = 0;
01991       if( track->EndDirCosY>+0.7 && track->EndQmax>75.0 ) pass = 0;
01992     }    
01993 
01994     if( CVcut4 ) CVcut4 = pass;
01995   }
01996 
01997   // pass/fail event
01998   // ===============
01999 
02000   switch( cut ){
02001     case 0: pass = 1; break;
02002     case 1: pass = CVcut1; break;
02003     case 2: pass = CVcut2; break;
02004     case 3: pass = CVcut3; break;
02005     case 4: pass = CVcut4; break;
02006     default: pass = CVcut4; break; 
02007   }
02008 
02009   return pass;
02010 }

Bool_t AtNuEventSelectionAB::ContainedVertex ( AtmosShower shower  )  [private]

Definition at line 2252 of file AtNuEventSelectionAB.cxx.

References AtmosShower::MaxPlaneNumber, AtmosShower::MinPlaneNumber, and AtmosShower::VtxDistToEdge.

02253 {
02254   // contained shower selection
02255   // ==========================
02256   // >40cm from edge of detector
02257   // >5 planes from ends of supermodules
02258 
02259   if(  ( shower->VtxDistToEdge>0.40 )
02260    &&  ( shower->MinPlaneNumber>5 && shower->MinPlaneNumber<481 )
02261    &&  ( shower->MaxPlaneNumber>5 && shower->MaxPlaneNumber<481 )
02262    && !( shower->MinPlaneNumber>243 && shower->MinPlaneNumber<255 ) 
02263    && !( shower->MaxPlaneNumber>243 && shower->MaxPlaneNumber<255 ) ) return 1;
02264 
02265   return 0;
02266 }

Bool_t AtNuEventSelectionAB::ContainedVertex ( AtmosTrack track  )  [private]

Definition at line 1753 of file AtNuEventSelectionAB.cxx.

References AtmosTrack::VtxDistToEdge, AtmosTrack::VtxPlane, and AtmosTrack::VtxTraceZ.

Referenced by ContainedEnd(), ContainedShowerCuts(), ContainedTrackCuts(), SelectCV(), SelectGoodEnergy(), SelectRAF(), SelectStoppingMuon(), and SelectThroughGoingMuon().

01754 {
01755   // contained vertex
01756   // ================
01757   // distance to edge >20cm AND traceZ >15cm
01758   // >5 planes from ends of supermodules
01759   // cuts on vertex from digits
01760 
01761   if(  ( track->VtxDistToEdge>0.20 && track->VtxTraceZ>0.15 )
01762    &&  ( track->VtxPlane>5 && track->VtxPlane<481 )
01763    && !( track->VtxPlane>243 && track->VtxPlane<255 ) ) return 1;
01764 
01765   else return 0;
01766 }

Bool_t AtNuEventSelectionAB::DownGoingTrack ( AtmosTrack track  )  [private]

Definition at line 1728 of file AtNuEventSelectionAB.cxx.

References AtmosTrack::EndDirTimeFitRMS, AtmosTrack::EndY, AtmosTrack::VtxDirCosY, AtmosTrack::VtxDirTimeFitRMS, and AtmosTrack::VtxY.

Referenced by SelectDN(), SelectStoppingMuon(), and SelectThroughGoingMuon().

01729 {
01730   // down-going track selection
01731   // ==========================
01732   // track direction cos(zenith)<=-0.05
01733   // vertex-end > -0.5m
01734   // correct timing rms
01735 
01736   if( ( track->VtxDirCosY<=-0.05 )
01737    && ( track->VtxY-track->EndY>-0.5 )
01738    && ( track->VtxDirTimeFitRMS-track->EndDirTimeFitRMS<0.0 ) ) return 1;
01739 
01740   return 0;
01741 }

Bool_t AtNuEventSelectionAB::EndInCoil ( AtmosShower shower  )  [private]

Definition at line 2299 of file AtNuEventSelectionAB.cxx.

References VertexInCoil().

02300 {
02301   // apply to vertex for now, need to define shower 'end'
02302   // ====================================================
02303   return this->VertexInCoil(shower);
02304 }

Bool_t AtNuEventSelectionAB::EndInCoil ( AtmosTrack track  )  [private]

Definition at line 1811 of file AtNuEventSelectionAB.cxx.

References AtmosTrack::EndR.

Referenced by ContainedShowerCuts(), ContainedTrackCuts(), EndInCoilSneakily(), SelectCE(), SelectGoodEnergy(), SelectStoppingMuon(), and SelectThroughGoingMuon().

01812 {
01813   // end coil cut
01814   // ============
01815   
01816   if( track->EndR<0.4 ) return 1;
01817 
01818   return 0;
01819 }

Bool_t AtNuEventSelectionAB::EndInCoilSneakily ( AtmosShower shower  )  [private]

Definition at line 2306 of file AtNuEventSelectionAB.cxx.

References VertexInCoilSneakily().

02307 {
02308   // apply to vertex for now, need to define shower 'end'
02309   // ===================================================
02310   return this->VertexInCoilSneakily(shower);
02311 }

Bool_t AtNuEventSelectionAB::EndInCoilSneakily ( AtmosTrack track  )  [private]

Definition at line 1821 of file AtNuEventSelectionAB.cxx.

References EndInCoil(), AtmosTrack::EndPlane, AtmosTrack::EndR, and AtmosTrack::VtxPlane.

Referenced by ContainedTrackCuts().

01822 {
01823   // extended end coil cut
01824   // =====================
01825 
01826   if( this->EndInCoil(track) ) return 1;
01827 
01828   if( track->EndPlane<track->VtxPlane ){
01829     if( track->EndPlane<21 && track->EndR<1.0 ) return 1;
01830   }
01831 
01832   if( track->EndPlane>track->VtxPlane ){
01833     if( track->EndPlane>465 && track->EndR<1.0 ) return 1;
01834   }
01835 
01836   return 0;
01837 }

Bool_t AtNuEventSelectionAB::FiducialShower ( AtmosShower shower  )  [private]

Definition at line 2313 of file AtNuEventSelectionAB.cxx.

References AtmosShower::NonFidFrac.

02314 {
02315   // fiducial pulse height fraction
02316   // ==============================
02317   if( shower->NonFidFrac>0.5 ) return 0;
02318 
02319   // pass event
02320   // ==========
02321   return 1;
02322 }

Bool_t AtNuEventSelectionAB::FiducialTrack ( AtmosTrack track  )  [private]

Definition at line 1839 of file AtNuEventSelectionAB.cxx.

References AtmosTrack::EndPlane, AtmosTrack::EndU, AtmosTrack::EndV, AtmosTrack::EndX, AtmosTrack::EndY, AtmosTrack::NonFidFrac, AtmosTrack::VtxPlane, AtmosTrack::VtxU, AtmosTrack::VtxV, AtmosTrack::VtxX, and AtmosTrack::VtxY.

01840 {
01841   // fiducial pulse height fraction
01842   // ==============================
01843   if( track->NonFidFrac>0.5 ) return 0;
01844 
01845   // check that track doesn't start and end at same edge
01846   // ===================================================
01847 
01848   Double_t midu = 0.5*(track->VtxU+track->EndU);
01849   Double_t midv = 0.5*(track->VtxV+track->EndV);
01850   Double_t midx = 0.5*(track->VtxX+track->EndX);
01851   Double_t midy = 0.5*(track->VtxY+track->EndY);  
01852   Double_t temp = 0.0;
01853   Double_t dr = 4.0;
01854 
01855   temp=4.0-midu; if(temp<dr) dr=temp;
01856   temp=4.0+midu; if(temp<dr) dr=temp;
01857   temp=4.0-midv; if(temp<dr) dr=temp;
01858   temp=4.0+midv; if(temp<dr) dr=temp;
01859   temp=4.0-midx; if(temp<dr) dr=temp;
01860   temp=4.0+midx; if(temp<dr) dr=temp;
01861   temp=4.0-midy; if(temp<dr) dr=temp;
01862   temp=4.0+midy; if(temp<dr) dr=temp;
01863 
01864   if( dr<0.30 ) return 0;
01865 
01866   // check that track doesn't start and end at same ends
01867   // ===================================================
01868   if( track->VtxPlane<6 && track->EndPlane<6 ) return 0;
01869   
01870   if( track->VtxPlane>480 && track->EndPlane>480 ) return 0;
01871 
01872   if( track->VtxPlane>243 && track->VtxPlane<255
01873    && track->EndPlane>243 && track->EndPlane<255 ) return 0;
01874 
01875   // pass event
01876   // ==========
01877   return 1;
01878 }

Int_t AtNuEventSelectionAB::GetAtmosEventType ( AtmosEvent event  )  [virtual]

Implements AtNuEventSelection.

Definition at line 167 of file AtNuEventSelectionAB.cxx.

References AtNuAtmosEventType::kAtmosNue, AtNuAtmosEventType::kAtmosNueCVcut1, AtNuAtmosEventType::kAtmosNueCVcut2, AtNuAtmosEventType::kAtmosNueCVcut3, AtNuAtmosEventType::kAtmosNueCVcut4, AtNuAtmosEventType::kAtmosNumu, AtNuAtmosEventType::kAtmosNumuCV, AtNuAtmosEventType::kAtmosNumuCVcut1, AtNuAtmosEventType::kAtmosNumuCVcut2, AtNuAtmosEventType::kAtmosNumuCVcut3, AtNuAtmosEventType::kAtmosNumuCVcut4, AtNuAtmosEventType::kAtmosNumuUP, AtNuAtmosEventType::kAtmosNumuUPcut1, AtNuAtmosEventType::kAtmosNumuUPcut2, AtNuAtmosEventType::kAtmosNumuUPcut3, AtNuAtmosEventType::kAtmosNumuUPcut4, AtNuAtmosEventType::kAtmosNumuUPDN, AtNuAtmosEventType::kAtmosShower, AtNuAtmosEventType::kAtmosSlice, AtNuAtmosEventType::kAtmosTrack, AtNuAtmosEventType::kContainedAtmosShower, AtNuAtmosEventType::kContainedAtmosTrack, AtNuAtmosEventType::kGoodAtmosShower, AtNuAtmosEventType::kGoodAtmosSlice, AtNuAtmosEventType::kGoodAtmosTrack, AtNuAtmosEventType::kGoodEvent, AtNuAtmosEventType::kGoodShield, AtNuAtmosEventType::kNothing, AtNuAtmosEventType::kVeto, SelectAtmosNue(), SelectAtmosNueCVcut1(), SelectAtmosNueCVcut2(), SelectAtmosNueCVcut3(), SelectAtmosNueCVcut4(), SelectAtmosNumu(), SelectAtmosNumuCV(), SelectAtmosNumuCVcut1(), SelectAtmosNumuCVcut2(), SelectAtmosNumuCVcut3(), SelectAtmosNumuCVcut4(), SelectAtmosNumuUP(), SelectAtmosNumuUPcut1(), SelectAtmosNumuUPcut2(), SelectAtmosNumuUPcut3(), SelectAtmosNumuUPcut4(), SelectAtmosNumuUPDN(), SelectAtmosShower(), SelectAtmosSlice(), SelectAtmosTrack(), SelectContainedAtmosShower(), SelectContainedAtmosTrack(), SelectGoodAtmosShower(), SelectGoodAtmosSlice(), SelectGoodAtmosTrack(), SelectGoodEvent(), SelectGoodShield(), and SelectVeto().

00168 {
00169   Int_t eventtype = AtNuAtmosEventType::kNothing;
00170 
00171   if( this->SelectGoodEvent(event) ){
00172     eventtype |= AtNuAtmosEventType::kGoodEvent;
00173   }
00174 
00175   if( this->SelectGoodShield(event) ){
00176     eventtype |= AtNuAtmosEventType::kGoodShield;
00177   }
00178 
00179   if( this->SelectVeto(event) ){
00180     eventtype |= AtNuAtmosEventType::kVeto;
00181   }
00182 
00183   if( this->SelectAtmosSlice(event) ){
00184     eventtype |= AtNuAtmosEventType::kAtmosSlice;
00185   }
00186 
00187   if( this->SelectAtmosTrack(event) ){
00188     eventtype |= AtNuAtmosEventType::kAtmosTrack;
00189   }
00190   
00191   if( this->SelectAtmosShower(event) ){
00192     eventtype |= AtNuAtmosEventType::kAtmosShower;
00193   }
00194 
00195   if( this->SelectGoodAtmosSlice(event) ){
00196     eventtype |= AtNuAtmosEventType::kGoodAtmosSlice;
00197   }
00198 
00199   if( this->SelectGoodAtmosTrack(event) ){
00200     eventtype |= AtNuAtmosEventType::kGoodAtmosTrack;
00201   }
00202 
00203   if( this->SelectGoodAtmosShower(event) ){
00204     eventtype |= AtNuAtmosEventType::kGoodAtmosShower;
00205   }
00206 
00207   if( this->SelectContainedAtmosTrack(event) ){
00208     eventtype |= AtNuAtmosEventType::kContainedAtmosTrack;
00209   }
00210 
00211   if( this->SelectContainedAtmosShower(event) ){
00212     eventtype |= AtNuAtmosEventType::kContainedAtmosShower;
00213   }
00214 
00215   if( this->SelectAtmosNumu(event) ){
00216     eventtype |= AtNuAtmosEventType::kAtmosNumu;
00217   }
00218 
00219   if( this->SelectAtmosNumuCV(event) ){
00220     eventtype |= AtNuAtmosEventType::kAtmosNumuCV;
00221   }
00222 
00223   if( this->SelectAtmosNumuUP(event) ){
00224     eventtype |= AtNuAtmosEventType::kAtmosNumuUP;
00225   }
00226 
00227   if( this->SelectAtmosNumuUPDN(event) ){
00228     eventtype |= AtNuAtmosEventType::kAtmosNumuUPDN;
00229   }
00230 
00231   if( this->SelectAtmosNue(event) ){
00232     eventtype |= AtNuAtmosEventType::kAtmosNue;
00233   }
00234 
00235   if( this->SelectAtmosNumuCVcut1(event) ){
00236     eventtype |= AtNuAtmosEventType::kAtmosNumuCVcut1;
00237   }
00238 
00239   if( this->SelectAtmosNumuCVcut2(event) ){
00240     eventtype |= AtNuAtmosEventType::kAtmosNumuCVcut2;
00241   }
00242 
00243   if( this->SelectAtmosNumuCVcut3(event) ){
00244     eventtype |= AtNuAtmosEventType::kAtmosNumuCVcut3;
00245   }
00246 
00247   if( this->SelectAtmosNumuCVcut4(event) ){
00248     eventtype |= AtNuAtmosEventType::kAtmosNumuCVcut4;
00249   }
00250 
00251   if( this->SelectAtmosNumuUPcut1(event) ){
00252     eventtype |= AtNuAtmosEventType::kAtmosNumuUPcut1;
00253   }
00254 
00255   if( this->SelectAtmosNumuUPcut2(event) ){
00256     eventtype |= AtNuAtmosEventType::kAtmosNumuUPcut2;
00257   }
00258 
00259   if( this->SelectAtmosNumuUPcut3(event) ){
00260     eventtype |= AtNuAtmosEventType::kAtmosNumuUPcut3;
00261   }
00262 
00263   if( this->SelectAtmosNumuUPcut4(event) ){
00264     eventtype |= AtNuAtmosEventType::kAtmosNumuUPcut4;
00265   }
00266 
00267   if( this->SelectAtmosNueCVcut1(event) ){
00268     eventtype |= AtNuAtmosEventType::kAtmosNueCVcut1;
00269   }
00270 
00271   if( this->SelectAtmosNueCVcut2(event) ){
00272     eventtype |= AtNuAtmosEventType::kAtmosNueCVcut2;
00273   }
00274 
00275   if( this->SelectAtmosNueCVcut3(event) ){
00276     eventtype |= AtNuAtmosEventType::kAtmosNueCVcut3;
00277   }
00278 
00279   if( this->SelectAtmosNueCVcut4(event) ){
00280     eventtype |= AtNuAtmosEventType::kAtmosNueCVcut4;
00281   }
00282 
00283   return eventtype;
00284 }

Int_t AtNuEventSelectionAB::GetEventType ( AtmosEvent event  )  [virtual]

Implements AtNuEventSelection.

Definition at line 32 of file AtNuEventSelectionAB.cxx.

References AtNuEventType::kAtmosNue, AtNuEventType::kAtmosNumu, AtNuEventType::kAtmosNumuCV, AtNuEventType::kAtmosNumuUP, AtNuEventType::kBeamSpill, AtNuEventType::kCE, AtNuEventType::kCosmic, AtNuEventType::kCV, AtNuEventType::kCVUP, AtNuEventType::kFakeSpill, AtNuEventType::kFC, AtNuEventType::kGoodCharge, AtNuEventType::kGoodCosmic, AtNuEventType::kGoodDirection, AtNuEventType::kGoodEnergy, AtNuEventType::kGoodEvent, AtNuEventType::kGoodShower, AtNuEventType::kGoodSlice, AtNuEventType::kGoodTrack, AtNuEventType::kLIevent, AtNuEventType::kMCscatter, AtNuEventType::kMultipleMuon, AtNuEventType::kNegativeCharge, AtNuEventType::kNothing, AtNuEventType::kPC, AtNuEventType::kPositiveCharge, AtNuEventType::kRAF, AtNuEventType::kSpill, AtNuEventType::kStoppingMuon, AtNuEventType::kThroughGoingMuon, AtNuEventType::kUPDN, AtNuEventType::kUPMU, AtNuEventType::kVeto, SelectAtmosNue(), SelectAtmosNumu(), SelectAtmosNumuCV(), SelectAtmosNumuUP(), SelectBeamSpill(), SelectCE(), SelectCosmicMuon(), SelectCV(), SelectCVUP(), SelectFakeSpill(), SelectFC(), SelectGoodCharge(), SelectGoodCosmicMuon(), SelectGoodDirection(), SelectGoodEnergy(), SelectGoodEvent(), SelectGoodShower(), SelectGoodSlice(), SelectGoodTrack(), SelectLIevent(), SelectMCscatter(), SelectMultipleMuon(), SelectNegativeCharge(), SelectPC(), SelectPositiveCharge(), SelectRAF(), SelectSpill(), SelectStoppingMuon(), SelectThroughGoingMuon(), SelectUPDN(), SelectUPMU(), and SelectVeto().

00033 {
00034   Int_t eventtype = AtNuEventType::kNothing;
00035 
00036   if( this->SelectGoodSlice(event) ){
00037     eventtype |= AtNuEventType::kGoodSlice;
00038   }
00039 
00040   if( this->SelectGoodEvent(event) ){
00041     eventtype |= AtNuEventType::kGoodEvent;
00042   }
00043 
00044   if( this->SelectGoodTrack(event) ){
00045     eventtype |= AtNuEventType::kGoodTrack;
00046   }
00047 
00048   if( this->SelectGoodShower(event) ){
00049     eventtype |= AtNuEventType::kGoodShower;
00050   }
00051 
00052   if( this->SelectCV(event) ){
00053     eventtype |= AtNuEventType::kCV;
00054   }
00055 
00056   if( this->SelectCE(event) ){
00057     eventtype |= AtNuEventType::kCE;
00058   }
00059   
00060   if( this->SelectFC(event) ){
00061     eventtype |= AtNuEventType::kFC;
00062   }
00063 
00064   if( this->SelectPC(event) ){
00065     eventtype |= AtNuEventType::kPC;
00066   }
00067 
00068   if( this->SelectRAF(event) ){
00069     eventtype |= AtNuEventType::kRAF;
00070   }
00071 
00072   if( this->SelectUPDN(event) ){
00073     eventtype |= AtNuEventType::kUPDN;
00074   }
00075 
00076   if( this->SelectCVUP(event) ){
00077     eventtype |= AtNuEventType::kCVUP;
00078   }
00079 
00080   if( this->SelectUPMU(event) ){
00081     eventtype |= AtNuEventType::kUPMU;
00082   }
00083 
00084   if( this->SelectCosmicMuon(event) ){
00085     eventtype |= AtNuEventType::kCosmic;
00086   }
00087 
00088   if( this->SelectGoodCosmicMuon(event) ){
00089     eventtype |= AtNuEventType::kGoodCosmic;
00090   }
00091 
00092   if( this->SelectStoppingMuon(event) ){
00093     eventtype |= AtNuEventType::kStoppingMuon;
00094   }
00095 
00096   if( this->SelectThroughGoingMuon(event) ){
00097     eventtype |= AtNuEventType::kThroughGoingMuon;
00098   }
00099 
00100   if( this->SelectMultipleMuon(event) ){
00101     eventtype |= AtNuEventType::kMultipleMuon;
00102   }
00103 
00104   if( this->SelectVeto(event) ){
00105     eventtype |= AtNuEventType::kVeto;
00106   }
00107 
00108   if( this->SelectSpill(event) ){
00109     eventtype |= AtNuEventType::kSpill;
00110   }
00111 
00112   if( this->SelectBeamSpill(event) ){
00113     eventtype |= AtNuEventType::kBeamSpill;
00114   }
00115 
00116   if( this->SelectFakeSpill(event) ){
00117     eventtype |= AtNuEventType::kFakeSpill;
00118   }
00119 
00120   if( this->SelectGoodDirection(event) ){
00121     eventtype |= AtNuEventType::kGoodDirection;
00122   }
00123 
00124   if( this->SelectGoodEnergy(event) ){
00125     eventtype |= AtNuEventType::kGoodEnergy;
00126   }
00127 
00128   if( this->SelectGoodCharge(event) ){
00129     eventtype |= AtNuEventType::kGoodCharge;
00130   }
00131 
00132   if( this->SelectPositiveCharge(event) ){
00133     eventtype |= AtNuEventType::kPositiveCharge;
00134   }
00135 
00136   if( this->SelectNegativeCharge(event) ){
00137     eventtype |= AtNuEventType::kNegativeCharge;
00138   }
00139 
00140   if( this->SelectAtmosNumu(event) ){
00141     eventtype |= AtNuEventType::kAtmosNumu;
00142   }
00143 
00144   if( this->SelectAtmosNumuCV(event) ){
00145     eventtype |= AtNuEventType::kAtmosNumuCV;
00146   }
00147 
00148   if( this->SelectAtmosNumuUP(event) ){
00149     eventtype |= AtNuEventType::kAtmosNumuUP;
00150   }
00151 
00152   if( this->SelectAtmosNue(event) ){
00153     eventtype |= AtNuEventType::kAtmosNue;
00154   }
00155 
00156   if( this->SelectLIevent(event) ){
00157     eventtype |= AtNuEventType::kLIevent;
00158   }
00159 
00160   if( this->SelectMCscatter(event) ){
00161     eventtype |= AtNuEventType::kMCscatter;
00162   }
00163 
00164   return eventtype;
00165 }

AtmosShower * AtNuEventSelectionAB::GetLargestShower ( AtmosEvent event  ) 

Definition at line 2093 of file AtNuEventSelectionAB.cxx.

References PrimaryTrackShower().

Referenced by AtmosNumuCVcuts(), and AtmosNumuUPDNcuts().

02094 {
02095   // return primary shower
02096   // =====================
02097   AtmosTrack* ptrack = 0;
02098   AtmosShower* pshower = 0;
02099 
02100   this->PrimaryTrackShower(event,ptrack,pshower,0,0); // 0: largest shower,
02101                                                       // 0: track AND shower
02102   return pshower;
02103 }

AtmosTrack * AtNuEventSelectionAB::GetLargestTrack ( AtmosEvent event  ) 

Definition at line 1465 of file AtNuEventSelectionAB.cxx.

References PrimaryTrackShower().

Referenced by AtmosNueCVcuts().

01466 {
01467   // return primary track
01468   // ====================
01469   AtmosTrack* ptrack = 0;
01470   AtmosShower* pshower = 0;
01471 
01472   this->PrimaryTrackShower(event,ptrack,pshower,0,0); // 0: largest track,
01473                                                       // 0: track AND shower
01474   return ptrack;
01475 }

AtmosShower * AtNuEventSelectionAB::GetPrimaryShower ( AtmosEvent event  ) 

Definition at line 2105 of file AtNuEventSelectionAB.cxx.

References PrimaryTrackShower().

Referenced by AtmosNueCVcuts(), GetPrimaryShowerIndex(), GoodAtmosShower(), SelectAtmosShower(), SelectCE(), SelectCV(), SelectGoodEnergy(), and SelectGoodShower().

02106 {
02107   // return primary shower
02108   // =====================
02109   AtmosTrack* ptrack = 0;
02110   AtmosShower* pshower = 0;
02111 
02112   this->PrimaryTrackShower(event,ptrack,pshower,1,0); // 1: primary shower,
02113                                                       // 0: track AND shower
02114   return pshower;
02115 }

Int_t AtNuEventSelectionAB::GetPrimaryShowerIndex ( AtmosEvent event  )  [virtual]

Implements AtNuEventSelection.

Definition at line 2117 of file AtNuEventSelectionAB.cxx.

References GetPrimaryShower(), and AtmosShower::Index.

02118 {
02119   AtmosShower* pshower = this->GetPrimaryShower(event);
02120   if( pshower ) return pshower->Index;
02121   else return -1;
02122 }

AtmosTrack * AtNuEventSelectionAB::GetPrimaryTrack ( AtmosEvent event  ) 

Definition at line 1477 of file AtNuEventSelectionAB.cxx.

References PrimaryTrackShower().

Referenced by AtmosNumuCVcuts(), AtmosNumuUPDNcuts(), ContainedEventDigitsTrace(), GetPrimaryTrackIndex(), GoodAtmosTrack(), SelectAtmosTrack(), SelectCE(), SelectCV(), SelectDN(), SelectGoodCharge(), SelectGoodCosmicMuon(), SelectGoodDirection(), SelectGoodEnergy(), SelectGoodTrack(), SelectHOZ(), SelectNegativeCharge(), SelectPCDN(), SelectPCUP(), SelectPositiveCharge(), SelectRAF(), SelectStoppingMuon(), SelectThroughGoingMuon(), and SelectUP().

01478 {
01479   // return primary track
01480   // ====================
01481   AtmosTrack* ptrack = 0;
01482   AtmosShower* pshower = 0;
01483 
01484   this->PrimaryTrackShower(event,ptrack,pshower,1,0); // 1: primary track,
01485                                                       // 0: track AND shower
01486   return ptrack;
01487 }

Int_t AtNuEventSelectionAB::GetPrimaryTrackIndex ( AtmosEvent event  )  [virtual]

Implements AtNuEventSelection.

Definition at line 1489 of file AtNuEventSelectionAB.cxx.

References GetPrimaryTrack(), and AtmosTrack::Index.

01490 {
01491   AtmosTrack* ptrack = this->GetPrimaryTrack(event);
01492   if( ptrack ) return ptrack->Index;
01493   else return -1;
01494 }

Double_t AtNuEventSelectionAB::GetShieldTime ( AtmosEvent event,
AtmosEvent shieldevent,
Double_t  offset 
) [virtual]

Implements AtNuEventSelection.

Definition at line 291 of file AtNuEventSelectionAB.cxx.

References ShieldTime().

00292 {
00293   return this->ShieldTime(event,shieldevent,offset);
00294 }

Double_t AtNuEventSelectionAB::GetShieldTime ( AtmosEvent event  )  [virtual]

Implements AtNuEventSelection.

Definition at line 286 of file AtNuEventSelectionAB.cxx.

References ShieldTime().

00287 {
00288   return this->ShieldTime(event);
00289 }

Double_t AtNuEventSelectionAB::GetSpillTime ( AtmosEvent event  )  [virtual]

Implements AtNuEventSelection.

Definition at line 296 of file AtNuEventSelectionAB.cxx.

References SpillTime().

00297 {
00298   return this->SpillTime(event);
00299 }

Bool_t AtNuEventSelectionAB::GoodAtmosShower ( AtmosEvent event  )  [private]

Definition at line 2124 of file AtNuEventSelectionAB.cxx.

References GetPrimaryShower(), GoodAtmosSlice(), AtmosShower::Nplanes, AtmosShower::NplanesUview, AtmosShower::NplanesVview, AtmosShower::Nstrips, passfail(), AtmosStrip::QPE, SingleShower(), AtmosEvent::StripList, AtmosStrip::T, AtmosStrip::View, AtmosShower::VtxU, and AtmosShower::VtxV.

Referenced by SelectGoodAtmosShower(), and SelectGoodShower().

02125 {
02126   // good atmos-like slice
02127   // =====================
02128   if( this->GoodAtmosSlice(event)==0 ) return 0;
02129 
02130   // must be single shower
02131   // =====================
02132   if( this->SingleShower(event)==0 ) return 0;
02133 
02134   // good atmos-like shower
02135   // ======================
02136   // tidy up short showers
02137   // analyse shower strips
02138 
02139   // get primary shower
02140   // ==================
02141   AtmosShower* shower = (AtmosShower*)(this->GetPrimaryShower(event));
02142   if( !shower ) return 0;
02143 
02144   // tidy up short showers
02145   // =====================
02146   if( shower->NplanesUview+shower->NplanesVview<=8 ){
02147     if( shower->Nplanes<=4 ) if( shower->Nstrips<7 ) return 0; 
02148     if( shower->Nplanes==5 ) if( shower->Nstrips<8 ) return 0; 
02149     if( shower->Nplanes==6 ) if( shower->Nstrips<8 ) return 0; 
02150     if( shower->Nplanes==7 ) if( shower->Nstrips<9 ) return 0; 
02151     if( shower->Nplanes==8 ) if( shower->Nstrips<9 ) return 0;
02152   }
02153 
02154   // analyse strips
02155   // ==============
02156   // restricts width of event to 50cm
02157 
02158   Bool_t passfail = 0;
02159 
02160   TClonesArray* striplist = (TClonesArray*)(event->StripList);
02161 
02162   //If there is a zero size strip list, just pass this test
02163   if(striplist->GetEntries() == 0) return true;
02164 
02165   Double_t q,dt;
02166   Double_t Uwt2,Uwt,Uw,Un;
02167   Double_t Vwt2,Vwt,Vw,Vn;
02168   Double_t Urms,Vrms;
02169 
02170   Uwt2=0.0; Uwt=0.0; Uw=0.0; Un=0.0; 
02171   Vwt2=0.0; Vwt=0.0; Vw=0.0; Vn=0.0; 
02172 
02173   for( Int_t j=0; j<1+striplist->GetLast(); j++ ){
02174     AtmosStrip* strip = (AtmosStrip*)(striplist->At(j));
02175 
02176     if( strip->View == 0 ){
02177       q = (strip->QPE[0]+strip->QPE[1]);
02178       dt = strip->T-shower->VtxU;
02179       Uwt2 += q*dt*dt; 
02180       Uwt += q*dt;
02181       Uw += q;
02182       Un += 1.0;
02183     }
02184 
02185     if( strip->View == 1 ){
02186       q = (strip->QPE[0]+strip->QPE[1]);
02187       dt = strip->T-shower->VtxV;
02188       Vwt2 += q*dt*dt; 
02189       Vwt += q*dt;
02190       Vw += q;
02191       Vn += 1.0;
02192     }   
02193   }
02194  
02195   Urms = 999.9;
02196   if( Un>1.0 && (Uwt2/Uw)-(Uwt/Uw)*(Uwt/Uw)>0.0 ){
02197     Urms = sqrt( (Uwt2/Uw)-(Uwt/Uw)*(Uwt/Uw) );
02198   }
02199     
02200   Vrms = 999.9;
02201   if( Vn>1.0 && (Vwt2/Vw)-(Vwt/Vw)*(Vwt/Vw)>0.0 ){
02202     Vrms = sqrt( (Vwt2/Vw) - (Vwt/Vw)*(Vwt/Vw) );
02203   }
02204 
02205   if( Urms<0.5 && Vrms<0.5 ) passfail = 1;
02206 
02207   return passfail;
02208 }

Bool_t AtNuEventSelectionAB::GoodAtmosSlice ( AtmosEvent event  )  [private]

Definition at line 1352 of file AtNuEventSelectionAB.cxx.

References AtmosReco::DoubleEndedChargeUview, AtmosReco::DoubleEndedChargeVview, AtmosEvent::FilterInfo, AtmosFilter::GoodPlanes, AtmosFilter::GoodStrips, AtmosFilter::GoodUPlanes, AtmosFilter::GoodVPlanes, AtmosEvent::RecoInfo, AtmosReco::SingleEndedChargeUview, and AtmosReco::SingleEndedChargeVview.

Referenced by GoodAtmosShower(), GoodAtmosTrack(), and SelectGoodAtmosSlice().

01353 {
01354   // good event selection
01355   // ====================
01356   // good U planes >= 2, good V planes >=2
01357   // good U planes + good V planes >= 4
01358   // double-ended charge in U and V view > 50%
01359 
01360   if( ( event->FilterInfo.GoodStrips>=4
01361      && event->FilterInfo.GoodPlanes>=4
01362      && event->FilterInfo.GoodUPlanes>=2
01363      && event->FilterInfo.GoodVPlanes>=2 )
01364    && ( event->RecoInfo.DoubleEndedChargeUview>0.0
01365      && event->RecoInfo.DoubleEndedChargeUview/(event->RecoInfo.SingleEndedChargeUview+event->RecoInfo.DoubleEndedChargeUview)>0.5 )
01366    && ( event->RecoInfo.DoubleEndedChargeVview>0.0
01367      && event->RecoInfo.DoubleEndedChargeVview/(event->RecoInfo.SingleEndedChargeVview+event->RecoInfo.DoubleEndedChargeVview)>0.5 ) ) return 1;
01368 
01369   return 0;
01370 }

Bool_t AtNuEventSelectionAB::GoodAtmosTrack ( AtmosEvent event  )  [private]

Definition at line 1496 of file AtNuEventSelectionAB.cxx.

References AtmosTrack::EndPlane, AtmosEvent::FilterInfo, GetPrimaryTrack(), GoodAtmosSlice(), AtmosTrack::Index, AtmosFilter::MaxPlaneCharge, AtmosTrack::NplanesTrackGaps, AtmosTrack::NplanesTrackOnly, AtmosTrack::NplanesUview, AtmosTrack::NplanesVview, AtmosStrip::Plane, AtmosEvent::RecoInfo, SingleTrack(), AtmosEvent::StripList, AtmosStrip::T, AtmosReco::TotalCharge, AtmosStrip::Trk, AtmosTrack::TrkPH, AtmosStrip::View, AtmosTrack::VtxPlane, AtmosTrack::VtxU, and AtmosTrack::VtxV.

Referenced by SelectGoodAtmosTrack(), and SelectGoodTrack().

01497 {
01498   // good atmos-like slice
01499   // =====================
01500   if( this->GoodAtmosSlice(event)==0 ) return 0;
01501 
01502   // must be single track
01503   // ====================
01504   if( this->SingleTrack(event)==0 ) return 0;
01505 
01506   // good atmos-like track
01507   // ======================
01508   // tidy up short tracks
01509   // analyse track strips
01510 
01511   // get primary track
01512   // =================
01513   AtmosTrack* track = (AtmosTrack*)(this->GetPrimaryTrack(event));
01514   if( !track ) return 0;
01515 
01516   // tidy up short tracks
01517   // ====================
01518   if( track->NplanesUview+track->NplanesVview<15 ){
01519 
01520     // cut on track only planes
01521     if( track->NplanesTrackOnly<4 ) return 0;
01522 
01523     // cut on track gap planes
01524     if( track->NplanesTrackGaps>4 ) return 0;
01525 
01526     // cut on track pulse height 
01527     if( track->NplanesTrackOnly<8
01528      && track->NplanesUview+track->NplanesVview<12
01529      && track->NplanesTrackOnly<track->NplanesUview+track->NplanesVview-2
01530      && track->TrkPH/event->RecoInfo.TotalCharge<0.5 ) return 0;
01531 
01532     // cut on maximum plane charge
01533     if( event->FilterInfo.MaxPlaneCharge>300.0 ) return 0;
01534 
01535     // tidy up tracks at ends of detector
01536     if( track->VtxPlane<=15 && track->EndPlane<=15 ) return 0;
01537     if( track->VtxPlane>=471 && track->EndPlane>=471 ) return 0;
01538   }
01539 
01540   // analyse track strips
01541   // ====================
01542   TClonesArray* striplist = (TClonesArray*)(event->StripList);
01543 
01544   //If there is a zero size strip list, just pass this test
01545   if(striplist->GetEntries() == 0) return true;
01546 
01547 
01548   // track vertex should be within 1m of track
01549   // =========================================
01550   Int_t index;
01551   Double_t dt,dtminU,dtminV;
01552 
01553   index = track->Index;
01554   dtminU = 999.9; dtminV = 999.9;
01555   
01556   for( Int_t j=0; j<1+striplist->GetLast(); j++ ){
01557     AtmosStrip* strip = (AtmosStrip*)(striplist->At(j));
01558 
01559     if( strip->View == 0 ){
01560       if( (strip->Trk&index)==index ){
01561         dt = fabs(strip->T-track->VtxU);
01562         if( dt<dtminU ) dtminU = dt;
01563       }
01564     }
01565 
01566     if( strip->View == 1 ){
01567       if( (strip->Trk&index)==index ){
01568         dt = fabs(strip->T-track->VtxV);
01569         if( dt<dtminV ) dtminV = dt;
01570       }
01571     }
01572   }   
01573 
01574   if( dtminU>1.0 || dtminV>1.0 ){
01575     return 0;
01576   }
01577 
01578 
01579   // track vertex should be close to event vertex
01580   // ============================================
01581   Int_t vtxCtr20 = 0; // hits extended by >20 planes
01582 
01583   for( Int_t j=0; j<1+striplist->GetLast(); j++ ){
01584     AtmosStrip* strip = (AtmosStrip*)(striplist->At(j));
01585 
01586     if( track->VtxPlane<track->EndPlane 
01587      && strip->Plane-track->VtxPlane<-20 ) vtxCtr20++;
01588 
01589     if( track->VtxPlane>track->EndPlane 
01590      && strip->Plane-track->VtxPlane>+20 ) vtxCtr20++;
01591  
01592   }
01593 
01594   if( vtxCtr20>20 ){
01595     return 0;
01596   }
01597 
01598   // track end should be close to event end
01599   // ======================================
01600   Int_t endCtr10 = 0; // hits extended by <10 planes
01601   Int_t endCtr20 = 0; // hits extended by <20 planes
01602 
01603   for( Int_t j=0; j<1+striplist->GetLast(); j++ ){
01604     AtmosStrip* strip = (AtmosStrip*)(striplist->At(j));
01605 
01606     if( track->EndPlane>track->VtxPlane ){
01607       if( strip->Plane-track->EndPlane>0 ){
01608         if( strip->Plane-track->EndPlane<+10 ) endCtr10++;
01609         if( strip->Plane-track->EndPlane<+20 ) endCtr20++;
01610       }
01611     }
01612 
01613     if( track->EndPlane<track->VtxPlane ){
01614       if( strip->Plane<track->EndPlane ){
01615         if( strip->Plane-track->EndPlane>-10 ) endCtr10++;
01616         if( strip->Plane-track->EndPlane>-20 ) endCtr20++;
01617       }
01618     }
01619 
01620   }
01621 
01622   if( endCtr10>10 && endCtr20>15 ){
01623     return 0;
01624   }
01625 
01626   return 1;
01627 }

Bool_t AtNuEventSelectionAB::GoodCosmicTrack ( AtmosTrack track  )  [private]

Definition at line 1664 of file AtNuEventSelectionAB.cxx.

References AtmosTrack::EndY, AtmosTrack::LinearDirFitChisqU, AtmosTrack::LinearDirFitChisqV, AtmosTrack::LinearDirFitNdfU, AtmosTrack::LinearDirFitNdfV, AtmosTrack::Nplanes, AtmosTrack::NplanesUview, AtmosTrack::NplanesVview, AtmosTrack::TrkLikePlanes, AtmosTrack::VtxDirCosY, and AtmosTrack::VtxY.

Referenced by SelectGoodCosmicMuon().

01665 {    
01666   // good cosmic track selection
01667   // ===========================
01668   // Uplanes > 10
01669   // Vplanes > 10
01670   // Uplanes+Vplanes >= 20
01671   // track-like planes >= 10
01672   // linear fit: sqrt(chi2/ndf)<3.5, both views
01673   // down-going (dirY<0 && vtxY>endY)
01674   // fiducial track
01675 
01676   if( track->Nplanes>=20 && track->TrkLikePlanes>=10
01677    && track->NplanesUview>10 && track->NplanesVview>10
01678    && track->LinearDirFitNdfU>10 && track->LinearDirFitNdfV>10
01679    && sqrt(track->LinearDirFitChisqU/track->LinearDirFitNdfU)<3.5
01680    && sqrt(track->LinearDirFitChisqV/track->LinearDirFitNdfV)<3.5 
01681    && track->VtxDirCosY<0.0 && track->VtxY>track->EndY
01682    && this->FiducialTrack(track) ) return 1;
01683    
01684   return 0;
01685 }

Bool_t AtNuEventSelectionAB::GoodShower ( AtmosShower shower  )  [private]

Definition at line 2221 of file AtNuEventSelectionAB.cxx.

References AtmosShower::AssocShwPHfrac, AtmosShower::Ndigits, AtmosShower::NplanesUview, AtmosShower::NplanesVview, and AtmosShower::Nstrips.

Referenced by SelectGoodShower().

02222 {
02223   // good shower selection
02224   // ====================
02225   // Uplanes >= 2, Vplanes >= 2
02226   // Uplanes+Vplanes >= 4
02227   // Nstrips >= 7, Ndigits >= 11
02228   // Ndigits-Nstrips >=4
02229   // shower pulse height > 0.66
02230   // 50% of pulse height in fiducial volume
02231 
02232   if( ( shower->NplanesUview>=2 && shower->NplanesVview>=2 )
02233    && ( shower->NplanesUview+shower->NplanesVview>=4 )
02234    && ( shower->Nstrips>=7 && shower->Ndigits>=11 )
02235    && ( shower->Ndigits-shower->Nstrips>=4 )
02236    && ( shower->AssocShwPHfrac>0.66 ) 
02237    && ( this->FiducialShower(shower) ) ) return 1;
02238 
02239   return 0;
02240 }

Bool_t AtNuEventSelectionAB::GoodTrack ( AtmosTrack track  )  [private]

Definition at line 1629 of file AtNuEventSelectionAB.cxx.

References AtmosTrack::AssocTrkPHfrac, AtmosTrack::EMcharge, AtmosTrack::EndDirCosU, AtmosTrack::EndDirCosV, AtmosTrack::EndDirCosZ, AtmosTrack::FitPass, AtmosTrack::LinearDirFitChisqU, AtmosTrack::LinearDirFitChisqV, AtmosTrack::LinearDirFitNdfU, AtmosTrack::LinearDirFitNdfV, AtmosTrack::NplanesTrackOnly, AtmosTrack::NplanesUview, AtmosTrack::NplanesVview, AtmosTrack::RangeMetres, AtmosTrack::TrkLikePlanes, AtmosTrack::VtxDirCosU, AtmosTrack::VtxDirCosV, AtmosTrack::VtxDirCosZ, AtmosTrack::VtxLinearDirFitChisqU, AtmosTrack::VtxLinearDirFitChisqV, AtmosTrack::VtxLinearDirFitNdfU, and AtmosTrack::VtxLinearDirFitNdfV.

Referenced by SelectGoodCosmicMuon(), and SelectGoodTrack().

01630 {  
01631   // good track selection
01632   // ====================
01633   // Uplanes >= 3, Vplanes >= 3
01634   // Uplanes+Vplanes >= 8
01635   // |Uplanes-Vplanes| < 10
01636   // track-like planes >= 5
01637   // track-only planes >= 3
01638   // track range > 0.5m
01639   // fraction of charge associated with track > 0.33 
01640   // reject >90 degree deviations between vertex and end of track
01641   // agreement between best/linear fit directions for straight tracks
01642   // track passes through fiducial volume
01643   // track fit converges
01644 
01645   if( ( track->NplanesUview>=3 && track->NplanesVview>=3 )
01646    && ( track->NplanesUview+track->NplanesVview>=8 )
01647    && ( fabs(track->NplanesUview-track->NplanesVview)<10 )
01648    && ( track->TrkLikePlanes>=5 && track->NplanesTrackOnly>=3 )
01649    && ( track->RangeMetres>=0.5 )
01650    && ( track->AssocTrkPHfrac>0.33 ) 
01651    && ( track->VtxDirCosU*track->EndDirCosU
01652       + track->VtxDirCosV*track->EndDirCosV
01653       + track->VtxDirCosZ*track->EndDirCosZ>0.0 )
01654    && ( ( track->LinearDirFitNdfU>0 && track->LinearDirFitChisqU/track->LinearDirFitNdfU>1875 )   
01655      || ( track->VtxLinearDirFitNdfU>0 && track->VtxLinearDirFitChisqU/track->VtxLinearDirFitNdfU<7500 ) ) 
01656    && ( ( track->LinearDirFitNdfV>0 && track->LinearDirFitChisqV/track->LinearDirFitNdfV>1875 )    
01657      || ( track->VtxLinearDirFitNdfV>0 && track->VtxLinearDirFitChisqV/track->VtxLinearDirFitNdfV<7500 ) )
01658    && ( track->FitPass!=0 && track->EMcharge!=0 )
01659    && ( this->FiducialTrack(track) ) ) return 1;
01660 
01661   return 0;
01662 }

Bool_t AtNuEventSelectionAB::HorizontalTrack ( AtmosTrack track  )  [private]

Definition at line 1713 of file AtNuEventSelectionAB.cxx.

References AtmosTrack::EndDirTimeFitRMS, AtmosTrack::EndY, AtmosTrack::VtxDirCosY, AtmosTrack::VtxDirTimeFitRMS, and AtmosTrack::VtxY.

Referenced by SelectHOZ().

01714 {
01715   // horizontal track selection
01716   // ==========================
01717   // track direction -0.05<cos(zenith)<+0.05
01718   // vertex-end < +0.5m
01719   // correct timing rms
01720   
01721   if( ( track->VtxDirCosY>-0.05 && track->VtxDirCosY<+0.05 )
01722    && ( track->VtxY-track->EndY<+0.5 )
01723    && ( track->VtxDirTimeFitRMS-track->EndDirTimeFitRMS<0.0 ) ) return 1;
01724 
01725   return 0;
01726 }

Bool_t AtNuEventSelectionAB::LIsieve ( AtmosEvent event  )  [private]

Definition at line 2834 of file AtNuEventSelectionAB.cxx.

References AtmosEvent::DataInfo, AtmosReco::EastSideCharge, AtmosData::LiSubtractedTime, AtmosData::LiTrigger, n, AtmosReco::Nplndigits, Munits::ns, AtmosStrip::Plane, AtmosEvent::RecoInfo, SelectGoodSlice(), AtmosStrip::Sigcorr, AtmosReco::SingleEndedCharge, AtmosEvent::StripList, AtmosReco::TotalCharge, and AtmosReco::WestSideCharge.

Referenced by SelectLIevent().

02835 {  
02836   // accomodate events that we run without DataQualityReader
02837   // (change this: instead, require LiTrigger==1 in below cut)
02838   // ========================================================
02839   // if( event->DataInfo.LiTrigger == -1) return 0;
02840   
02841   // remove LI *with* TPMT hits
02842   // ==========================
02843   if( event->DataInfo.LiTrigger==1
02844    && event->DataInfo.LiSubtractedTime>-50000.0 
02845    && event->DataInfo.LiSubtractedTime<1000.0 ) return 1;
02846 
02847   // remove LI *without* TPMT hits
02848   // =============================
02849   Int_t lisieve = 0;
02850   if( this->SelectGoodSlice(event)==0 ) return 0;
02851 
02852   // std ph LI removal
02853   // =================
02854   // digits >1000 AND
02855   // east+west pulse height >15,000 PEs
02856   // east-west pulse height >7,500 PEs
02857   // east,west pulse height >75%
02858   if( ( event->RecoInfo.Nplndigits>1000
02859      && event->RecoInfo.EastSideCharge+event->RecoInfo.WestSideCharge>15000 )
02860    || ( event->RecoInfo.Nplndigits>1000
02861      && fabs(event->RecoInfo.EastSideCharge-event->RecoInfo.WestSideCharge)>7500 ) 
02862    || ( event->RecoInfo.Nplndigits>1000
02863      && event->RecoInfo.EastSideCharge/event->RecoInfo.TotalCharge>0.75 )
02864    || ( event->RecoInfo.Nplndigits>1000
02865      && event->RecoInfo.WestSideCharge/event->RecoInfo.TotalCharge>0.75 ) ){
02866     lisieve = 1;
02867   }
02868 
02869   // low ph LI removal
02870   // =================
02871   // pulse height >1000.0 AND
02872   // single-ended pulse height >50%
02873   // east,west pulse height >80%
02874   if( ( event->RecoInfo.TotalCharge>1000.0
02875      && event->RecoInfo.SingleEndedCharge/event->RecoInfo.TotalCharge>0.5 )
02876    || ( event->RecoInfo.TotalCharge>1000.0
02877      && event->RecoInfo.EastSideCharge/event->RecoInfo.TotalCharge>0.8 )
02878    || ( event->RecoInfo.TotalCharge>1000.0
02879      && event->RecoInfo.WestSideCharge/event->RecoInfo.TotalCharge>0.8 ) ){
02880     lisieve = 1;
02881   }
02882 
02883   // LI removal using crate info
02884   // ===========================
02885   Double_t ph[500];
02886  
02887   Int_t crate_beg[8] = { 1, 65, 129, 193, 250, 314, 378, 442 };
02888   Int_t crate_end[8] = { 64, 128, 192, 248, 313, 377, 441, 485 };
02889 
02890   Double_t crate_pln[8] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
02891   Double_t crate_ph[8] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
02892 
02893   Double_t qin,qout,qtot,plnin,plncrate,plntot;
02894   Double_t fomtemp,fom;
02895 
02896   TClonesArray* striplist = (TClonesArray*)(event->StripList);
02897 
02898   //Skip empty striplist
02899   if(striplist->GetEntries() == 0) return 0;
02900 
02901   for( Int_t n=0; n<500; n++ ){ ph[n]=0.0; }
02902 
02903   for( Int_t n=0; n<8; n++ ){ crate_ph[n]=0.0; crate_pln[n]=0.0; } 
02904 
02905   for( Int_t ns=0; ns<event->NStrips; ns++ ){
02906     AtmosStrip* strip = (AtmosStrip*)(striplist->At(ns));
02907     ph[strip->Plane] += (strip->Sigcorr[0]+strip->Sigcorr[1])/65.0;
02908   }
02909 
02910   for( Int_t n=0; n<8; n++ ){
02911     for( Int_t np=crate_beg[n]; np<=crate_end[n]; np++ ){
02912       if( ph[np]>0.0 ){ crate_ph[n]+=ph[np]; crate_pln[n]+=1.0; }
02913     }
02914   }
02915   
02916   qtot = 0.0; plntot = 0.0;
02917   for( Int_t n=0; n<8; n++ ){
02918     qtot += crate_ph[n];
02919     plntot += crate_pln[n];
02920   }
02921 
02922   fom = 0.0; fomtemp = 0.0;
02923   for( Int_t n=0; n<8; n++ ){
02924     qin = crate_ph[n];
02925     qout = qtot - crate_ph[n];
02926     plncrate = (1.0+crate_end[n]-crate_beg[n]);
02927     plnin = crate_pln[n];
02928     fomtemp = (plnin)/(plntot+plncrate-plnin);
02929     if( fomtemp>fom ) fom=fomtemp;
02930   }
02931 
02932   // veto event
02933   // ==========
02934   if( lisieve ) return 1;
02935 
02936   // event is okay
02937   // =============
02938   return 0;
02939 }

Bool_t AtNuEventSelectionAB::MCscatter ( AtmosEvent event  )  [private]

Definition at line 2941 of file AtNuEventSelectionAB.cxx.

References AtmosMC::Emu, AtmosScintHit::Id, AtmosMC::IDnu, AtmosEvent::MCInfo, AtmosMC::MuPbeg, AtmosMC::MuPend, AtmosScintHit::ParticleE, AtmosScintHit::Plane, AtmosScintHit::X, AtmosScintHit::Y, and AtmosScintHit::Z.

Referenced by SelectMCscatter().

02942 {
02943   // get scint hit list
02944   // ==================
02945   TClonesArray* scintlist = dynamic_cast<TClonesArray*>(event->ScintHitList);
02946   if( !scintlist ) return 0;
02947 
02948   // check that there actually are scint hits
02949   // ========================================
02950   if( scintlist && 1+scintlist->GetLast()==0 ) return 0;
02951 
02952   // apply to MC cosmic muons
02953   // ========================
02954   Int_t mcscatter = 0;
02955   if( event->MCInfo.IDnu==0 && event->MCInfo.Emu!=0 ){
02956 
02957     // analyse truth info
02958     // ==================
02959     if( event->MCInfo.MuPbeg>0.0 && event->MCInfo.MuPend>0.0
02960      && event->MCInfo.MuPbeg-event->MCInfo.MuPend>0.0 ){
02961       Double_t dx1 = event->MCInfo.MuVtxX-event->MCInfo.VtxX;
02962       Double_t dy1 = event->MCInfo.MuVtxY-event->MCInfo.VtxY;
02963       Double_t dz1 = event->MCInfo.MuVtxZ-event->MCInfo.VtxZ;
02964       Double_t ds1 = sqrt(dx1*dx1+dy1*dy1+dz1*dz1);
02965 
02966       Double_t px1 = dx1/ds1;
02967       Double_t py1 = dy1/ds1;
02968       Double_t pz1 = dz1/ds1;
02969 
02970       Double_t dx2 = event->MCInfo.MuEndX-event->MCInfo.MuVtxX;
02971       Double_t dy2 = event->MCInfo.MuEndY-event->MCInfo.MuVtxY;
02972       Double_t dz2 = event->MCInfo.MuEndZ-event->MCInfo.MuVtxZ;
02973       Double_t ds2 = sqrt(dx2*dx2+dy2*dy2+dz2*dz2);
02974 
02975       Double_t px2 = px1;
02976       Double_t py2 = py1;
02977       Double_t pz2 = pz1;
02978 
02979       if( ds2>0.0 ){
02980         px2 = dx2/ds2;
02981         py2 = dy2/ds2;
02982         pz2 = dz2/ds2;
02983       }
02984 
02985       Double_t costh = 2.0;
02986       if( ds1>0.5 && ds2>0.5 ){
02987         costh = py1*py2+pz1*pz2;
02988       }
02989 
02990       // reject scatters greater than 60 degrees
02991       // =======================================
02992       if( costh<0.5 ) mcscatter=1;
02993 
02994     }
02995 
02996     // analyse scint hits
02997     // ==================
02998     AtmosScintHit* prev = 0;
02999     for( Int_t k=0; k<1+scintlist->GetLast(); k++ ){
03000       AtmosScintHit* curr = (AtmosScintHit*)(scintlist->At(k));
03001 
03002       if( ( event->MCInfo.Emu>0 && curr->Id==-13 )
03003        || ( event->MCInfo.Emu<0 && curr->Id==+13 ) ){
03004         if( prev 
03005          && fabs(prev->Plane-curr->Plane)>0
03006          && fabs(prev->Plane-curr->Plane)<=2
03007          && curr->ParticleE<prev->ParticleE 
03008          && curr->ParticleE>1.0 ){
03009 
03010           Double_t dx1 = prev->X[1]-prev->X[0];
03011           Double_t dy1 = prev->Y[1]-prev->Y[0];
03012           Double_t dz1 = prev->Z[1]-prev->Z[0];
03013           Double_t ds1 = sqrt(dx1*dx1+dy1*dy1+dz1*dz1);
03014           Double_t px1 = dx1/ds1;
03015           Double_t py1 = dy1/ds1;
03016           Double_t pz1 = dz1/ds1;
03017               
03018           Double_t dx2 = curr->X[1]-curr->X[0];
03019           Double_t dy2 = curr->Y[1]-curr->Y[0];
03020           Double_t dz2 = curr->Z[1]-curr->Z[0];
03021           Double_t ds2 = sqrt(dx2*dx2+dy2*dy2+dz2*dz2);
03022           Double_t px2 = dx2/ds2;
03023           Double_t py2 = dy2/ds2;
03024           Double_t pz2 = dz2/ds2;
03025 
03026           Double_t dx = 0.5*(curr->X[1]+curr->X[0])-0.5*(prev->X[1]+prev->X[0]);
03027           Double_t dy = 0.5*(curr->Y[1]+curr->Y[0])-0.5*(prev->Y[1]+prev->Y[0]);
03028           Double_t dz = 0.5*(curr->Z[1]+curr->Z[0])-0.5*(prev->Z[1]+prev->Z[0]);
03029           Double_t ds = sqrt(dx*dx+dy*dy+dz*dz);
03030           Double_t costh = px1*px2+py1*py2+pz1*pz2;
03031 
03032           // reject scatters greater than 30 degrees
03033           // =======================================
03034           if( ds<0.5 && costh<0.866 ) mcscatter=1;
03035 
03036         }
03037         prev=curr;    
03038       }
03039     }
03040   }
03041 
03042   // veto event
03043   // ==========
03044   if( mcscatter ) return 1;
03045 
03046   // fail event
03047   // ==========
03048   return 0;
03049 }

void AtNuEventSelectionAB::PrimaryTrackShower ( AtmosEvent event,
AtmosTrack *&  track,
AtmosShower *&  shower,
Bool_t  doCleaning = 1,
Bool_t  doSeparation = 0 
)

Definition at line 2461 of file AtNuEventSelectionAB.cxx.

References AtmosShower::Ndigits, AtmosShower::Nplanes, AtmosTrack::Nplanes, AtmosTrack::NplanesTrackOnly, AtmosShower::Nstrips, AtmosEvent::ShowerList, AtmosEvent::TrackList, and AtmosTrack::TrkLikePlanes.

Referenced by GetLargestShower(), GetLargestTrack(), GetPrimaryShower(), and GetPrimaryTrack().

02462 {
02463   // reset track/shower pointers  
02464   // ===========================
02465   ptrack = 0; pshower = 0;
02466 
02467   // select longest track
02468   // ====================
02469   AtmosTrack* mytrack = 0;
02470   for( Int_t i=0; i<event->NTracks; i++){
02471     AtmosTrack* track = (AtmosTrack*)(event->TrackList->At(i));
02472     if( track ){
02473       if( mytrack==0 ) mytrack = track;
02474       else if( track->Nplanes>mytrack->Nplanes ) mytrack = track;
02475     }
02476   }
02477 
02478   // select longest shower
02479   // =====================
02480   AtmosShower* myshower = 0;
02481   for( Int_t i=0; i<event->NShowers; i++){
02482     AtmosShower* shower = (AtmosShower*)(event->ShowerList->At(i));
02483     if( shower ){
02484       if( myshower==0 ) myshower = shower;
02485       else if( shower->Nplanes>myshower->Nplanes ) myshower = shower;
02486     }
02487   }
02488 
02489   // return longest track/shower
02490   // ===========================
02491   if( doCleaning==0 ){
02492     ptrack = mytrack;  pshower = myshower;
02493     return;
02494   }
02495 
02496   // sort tracks and showers
02497   // =======================
02498   AtmosTrack* mygoodtrack = 0;
02499   if( mytrack
02500    && mytrack->Nplanes>=8
02501    && mytrack->TrkLikePlanes>=5 ){
02502     if( myshower==0
02503      || ( mytrack->Nplanes-myshower->Nplanes>=-3 ) ){
02504       mygoodtrack = mytrack;
02505     }
02506   }
02507 
02508   AtmosShower* mygoodshower = 0;
02509   if( myshower
02510    && myshower->Nplanes>=4 
02511    && myshower->Nstrips>=7
02512    && myshower->Ndigits>=11 ){
02513     if( mytrack==0
02514      || ( mytrack->NplanesTrackOnly<=8
02515        && mytrack->TrkLikePlanes<=12
02516        && mytrack->Nplanes<=20
02517        && myshower->Nplanes-mytrack->Nplanes>=-3 ) ){
02518       mygoodshower = myshower;
02519     }
02520   }
02521 
02522   // return track AND shower
02523   // =======================
02524   if( doSeparation==0 ){
02525     ptrack = mygoodtrack;  pshower = mygoodshower;
02526     return;
02527   }  
02528 
02529   // return track OR shower
02530   // ======================
02531   if( mygoodtrack
02532    && ( mygoodshower==0
02533      || mygoodtrack->Nplanes>mygoodshower->Nplanes ) ){
02534     ptrack = mygoodtrack;
02535   }
02536 
02537   if( mygoodshower
02538    && ( mygoodtrack==0
02539      || mygoodshower->Nplanes>=mygoodtrack->Nplanes ) ){
02540     pshower = mygoodshower;
02541   }
02542 
02543   return;
02544 }

Bool_t AtNuEventSelectionAB::SelectAtmosNue ( AtmosEvent event  ) 

Definition at line 369 of file AtNuEventSelectionAB.cxx.

References SelectAtmosNueCV().

Referenced by GetAtmosEventType(), and GetEventType().

00370 {
00371   // select atmospheric electron neutrino
00372   // ====================================
00373 
00374   // reject beam spills and bad events
00375   // =================================
00376   // (now do this in the final analysis)
00377   // if( this->SelectSpill(event)==1 ) return 0;
00378   // if( this->SelectGoodEvent(event)==0 ) return 0;
00379 
00380   // select contained event
00381   // ======================
00382   if( this->SelectAtmosNueCV(event)==1 ) return 1;
00383 
00384   return 0;
00385 }

Bool_t AtNuEventSelectionAB::SelectAtmosNueCV ( AtmosEvent event  ) 

Definition at line 402 of file AtNuEventSelectionAB.cxx.

References AtmosNueCVcuts().

Referenced by SelectAtmosNue().

00403 {
00404   return this->AtmosNueCVcuts(event);
00405 }

Bool_t AtNuEventSelectionAB::SelectAtmosNueCVcut1 ( AtmosEvent event  ) 

Definition at line 447 of file AtNuEventSelectionAB.cxx.

References AtmosNueCVcuts().

Referenced by GetAtmosEventType().

00448 {
00449   return this->AtmosNueCVcuts(event,1);
00450 }

Bool_t AtNuEventSelectionAB::SelectAtmosNueCVcut2 ( AtmosEvent event  ) 

Definition at line 452 of file AtNuEventSelectionAB.cxx.

References AtmosNueCVcuts().

Referenced by GetAtmosEventType().

00453 {
00454   return this->AtmosNueCVcuts(event,2);
00455 }

Bool_t AtNuEventSelectionAB::SelectAtmosNueCVcut3 ( AtmosEvent event  ) 

Definition at line 457 of file AtNuEventSelectionAB.cxx.

References AtmosNueCVcuts().

Referenced by GetAtmosEventType().

00458 {
00459   return this->AtmosNueCVcuts(event,3);
00460 }

Bool_t AtNuEventSelectionAB::SelectAtmosNueCVcut4 ( AtmosEvent event  ) 

Definition at line 462 of file AtNuEventSelectionAB.cxx.

References AtmosNueCVcuts().

Referenced by GetAtmosEventType().

00463 {
00464   return this->AtmosNueCVcuts(event,4);
00465 }

Bool_t AtNuEventSelectionAB::SelectAtmosNumu ( AtmosEvent event  ) 

Definition at line 347 of file AtNuEventSelectionAB.cxx.

References SelectAtmosNumuCV(), and SelectAtmosNumuUP().

Referenced by ContainedShowerCuts(), GetAtmosEventType(), and GetEventType().

00348 {
00349   // select atmospheric muon neutrino
00350   // ================================
00351 
00352   // reject beam spills and bad events
00353   // =================================
00354   // (now do this in the final analysis)
00355   // if( this->SelectSpill(event)==1 ) return 0;
00356   // if( this->SelectGoodEvent(event)==0 ) return 0;
00357 
00358   // select contained event
00359   // ======================
00360   if( this->SelectAtmosNumuCV(event)==1 ) return 1;
00361 
00362   // select up-going event
00363   // =====================
00364   if( this->SelectAtmosNumuUP(event)==1 ) return 1;
00365 
00366   return 0;
00367 }

Bool_t AtNuEventSelectionAB::SelectAtmosNumuCV ( AtmosEvent event  ) 

Definition at line 387 of file AtNuEventSelectionAB.cxx.

References AtmosNumuCVcuts().

Referenced by GetAtmosEventType(), GetEventType(), and SelectAtmosNumu().

00388 {
00389   return this->AtmosNumuCVcuts(event);
00390 }

Bool_t AtNuEventSelectionAB::SelectAtmosNumuCVcut1 ( AtmosEvent event  ) 

Definition at line 407 of file AtNuEventSelectionAB.cxx.

References AtmosNumuCVcuts().

Referenced by GetAtmosEventType().

00408 {
00409   return this->AtmosNumuCVcuts(event,1);
00410 }

Bool_t AtNuEventSelectionAB::SelectAtmosNumuCVcut2 ( AtmosEvent event  ) 

Definition at line 412 of file AtNuEventSelectionAB.cxx.

References AtmosNumuCVcuts().

Referenced by GetAtmosEventType().

00413 {
00414   return this->AtmosNumuCVcuts(event,2);
00415 }

Bool_t AtNuEventSelectionAB::SelectAtmosNumuCVcut3 ( AtmosEvent event  ) 

Definition at line 417 of file AtNuEventSelectionAB.cxx.

References AtmosNumuCVcuts().

Referenced by GetAtmosEventType().

00418 {
00419   return this->AtmosNumuCVcuts(event,3);
00420 }

Bool_t AtNuEventSelectionAB::SelectAtmosNumuCVcut4 ( AtmosEvent event  ) 

Definition at line 422 of file AtNuEventSelectionAB.cxx.

References AtmosNumuCVcuts().

Referenced by GetAtmosEventType().

00423 {
00424   return this->AtmosNumuCVcuts(event,4);
00425 }

Bool_t AtNuEventSelectionAB::SelectAtmosNumuUP ( AtmosEvent event  ) 

Definition at line 392 of file AtNuEventSelectionAB.cxx.

References AtmosNumuUPcuts().

Referenced by GetAtmosEventType(), GetEventType(), and SelectAtmosNumu().

00393 {
00394   return this->AtmosNumuUPcuts(event);
00395 }

Bool_t AtNuEventSelectionAB::SelectAtmosNumuUPcut1 ( AtmosEvent event  ) 

Definition at line 427 of file AtNuEventSelectionAB.cxx.

References AtmosNumuUPcuts().

Referenced by GetAtmosEventType().

00428 {
00429   return this->AtmosNumuUPcuts(event,1);
00430 }

Bool_t AtNuEventSelectionAB::SelectAtmosNumuUPcut2 ( AtmosEvent event  ) 

Definition at line 432 of file AtNuEventSelectionAB.cxx.

References AtmosNumuUPcuts().

Referenced by GetAtmosEventType().

00433 {
00434   return this->AtmosNumuUPcuts(event,2);
00435 }

Bool_t AtNuEventSelectionAB::SelectAtmosNumuUPcut3 ( AtmosEvent event  ) 

Definition at line 437 of file AtNuEventSelectionAB.cxx.

References AtmosNumuUPcuts().

Referenced by GetAtmosEventType().

00438 {
00439   return this->AtmosNumuUPcuts(event,3);
00440 }

Bool_t AtNuEventSelectionAB::SelectAtmosNumuUPcut4 ( AtmosEvent event  ) 

Definition at line 442 of file AtNuEventSelectionAB.cxx.

References AtmosNumuUPcuts().

Referenced by GetAtmosEventType().

00443 {
00444   return this->AtmosNumuUPcuts(event,4);
00445 }

Bool_t AtNuEventSelectionAB::SelectAtmosNumuUPDN ( AtmosEvent event  ) 

Definition at line 397 of file AtNuEventSelectionAB.cxx.

References AtmosNumuUPDNcuts().

Referenced by GetAtmosEventType().

00398 {
00399   return this->AtmosNumuUPDNcuts(event);
00400 }

Bool_t AtNuEventSelectionAB::SelectAtmosShower ( AtmosEvent event  ) 

Definition at line 316 of file AtNuEventSelectionAB.cxx.

References GetPrimaryShower().

Referenced by GetAtmosEventType().

00317 {
00318   AtmosShower* shower = (AtmosShower*)(this->GetPrimaryShower(event));
00319   if( shower ) return 1; else return 0;
00320 }

Bool_t AtNuEventSelectionAB::SelectAtmosSlice ( AtmosEvent event  ) 

Definition at line 305 of file AtNuEventSelectionAB.cxx.

References SelectGoodSlice().

Referenced by GetAtmosEventType().

00306 {
00307   return this->SelectGoodSlice(event);
00308 }  

Bool_t AtNuEventSelectionAB::SelectAtmosTrack ( AtmosEvent event  ) 

Definition at line 310 of file AtNuEventSelectionAB.cxx.

References GetPrimaryTrack().

Referenced by GetAtmosEventType().

00311 {
00312   AtmosTrack* track = (AtmosTrack*)(this->GetPrimaryTrack(event));
00313   if( track ) return 1; else return 0;
00314 }

Bool_t AtNuEventSelectionAB::SelectBeamSpill ( AtmosEvent event  ) 

Definition at line 2565 of file AtNuEventSelectionAB.cxx.

References AtmosEvent::DataInfo, SpillTime(), AtmosData::SpillType, and AtmosData::TriggerSource.

Referenced by GetEventType(), and SelectSpill().

02566 {
02567   // select spill triggers
02568   // =====================
02569   Bool_t beamspill = 0;
02570   if( event->DataInfo.TriggerSource>=131072
02571    && event->DataInfo.SpillType==1 ){
02572     beamspill = 1;
02573   }
02574 
02575   // select events in spill proximity 
02576   // ================================
02577   if( fabs(this->SpillTime(event))<50.0 ){
02578     beamspill = 1;
02579   }
02580 
02581   // pass beam spills
02582   // ================
02583   if( beamspill ) return 1;
02584 
02585   // fail event
02586   // ==========
02587   return 0;
02588 }

Bool_t AtNuEventSelectionAB::SelectCE ( AtmosEvent event  ) 

Definition at line 778 of file AtNuEventSelectionAB.cxx.

References ContainedEnd(), EndInCoil(), fDebug, GetPrimaryShower(), and GetPrimaryTrack().

Referenced by GetEventType(), SelectFC(), and SelectPC().

00779 {
00780   // get primary track
00781   // =================
00782   AtmosTrack* track = (AtmosTrack*)(this->GetPrimaryTrack(event));
00783   if( track ){
00784 
00785     // end must be contained
00786     // =====================
00787     if( this->ContainedEnd(track)==0 ) return 0;
00788 
00789     // end coil cut
00790     // ============
00791     if( this->EndInCoil(track)==1 ) return 0;
00792 
00793     // pass event
00794     // ==========
00795     if( fDebug ) std::cout << " *** CE *** " << std::endl;
00796     return 1;
00797   }  
00798 
00799   // get primary shower
00800   // ==================
00801   AtmosShower* shower = (AtmosShower*)(this->GetPrimaryShower(event));
00802   if( shower ){
00803 
00804     // end must be contained
00805     // =====================
00806     if( this->ContainedEnd(shower)==0 ) return 0;
00807 
00808     // end coil cut
00809     // ============
00810     if( this->EndInCoil(shower)==1 ) return 0;
00811 
00812     // pass event
00813     // ==========
00814     if( fDebug ) std::cout << " *** CE *** " << std::endl;
00815     return 1;
00816   }
00817 
00818   // fail event
00819   // ==========
00820   return 0; 
00821 }

Bool_t AtNuEventSelectionAB::SelectContainedAtmosShower ( AtmosEvent event  ) 

Definition at line 342 of file AtNuEventSelectionAB.cxx.

References ContainedEventShower().

Referenced by GetAtmosEventType().

00343 {
00344   return this->ContainedEventShower(event);
00345 }

Bool_t AtNuEventSelectionAB::SelectContainedAtmosTrack ( AtmosEvent event  ) 

Definition at line 337 of file AtNuEventSelectionAB.cxx.

References ContainedEventTrack().

Referenced by GetAtmosEventType().

00338 {
00339   return this->ContainedEventTrack(event);
00340 }

Bool_t AtNuEventSelectionAB::SelectCosmicMuon ( AtmosEvent event  ) 

Definition at line 1022 of file AtNuEventSelectionAB.cxx.

References fDebug, SelectMultipleMuon(), SelectSpill(), SelectStoppingMuon(), and SelectThroughGoingMuon().

Referenced by GetEventType(), and SelectGoodCosmicMuon().

01023 {
01024   // reject spills
01025   // =============
01026   if( this->SelectSpill(event)==1 ) return 0;
01027 
01028   // select stopping cosmic muons
01029   // ============================
01030   if( this->SelectStoppingMuon(event) ){
01031     if( fDebug ) std::cout << " *** COSMIC *** " << std::endl;
01032     return 1;
01033   }
01034 
01035   // select through-going cosmic muons
01036   // =================================
01037   if( this->SelectThroughGoingMuon(event) ){
01038     if( fDebug ) std::cout << " *** COSMIC *** " << std::endl;
01039     return 1;
01040   }
01041 
01042   // select multiple cosmic muons
01043   // ============================
01044   if( this->SelectMultipleMuon(event) ){
01045     if( fDebug ) std::cout << " *** COSMIC *** " << std::endl;
01046     return 1;
01047   }
01048 
01049   return 0;
01050 }

Bool_t AtNuEventSelectionAB::SelectCV ( AtmosEvent event  ) 

Definition at line 740 of file AtNuEventSelectionAB.cxx.

References ContainedVertex(), fDebug, GetPrimaryShower(), GetPrimaryTrack(), and VertexInCoil().

Referenced by AtmosNumuCVcuts(), ContainedEventShower(), ContainedEventTrack(), GetEventType(), SelectFC(), and SelectPC().

00741 {
00742   // get primary track
00743   // =================
00744   AtmosTrack* track = (AtmosTrack*)(this->GetPrimaryTrack(event));
00745   if( track ){
00746 
00747     // vertex must be contained
00748     // ========================
00749     if( this->ContainedVertex(track)==0 ) return 0;
00750 
00751     // vertex coil cut 
00752     // ===============
00753     if( this->VertexInCoil(track)==1 ) return 0;
00754 
00755   }
00756   
00757   // get primary shower
00758   // ==================
00759   AtmosShower* shower = (AtmosShower*)(this->GetPrimaryShower(event));
00760   if( shower ){
00761 
00762     // vertex must be contained
00763     // ========================
00764     if( this->ContainedVertex(shower)==0 ) return 0;
00765 
00766     // vertex coil cut 
00767     // ===============
00768     if( this->VertexInCoil(shower)==1 ) return 0;
00769 
00770   }
00771   
00772   // pass event
00773   // ==========
00774   if( fDebug ) std::cout << " *** CV *** " << std::endl;
00775   return 1; 
00776 }

Bool_t AtNuEventSelectionAB::SelectCVUP ( AtmosEvent event  ) 

Definition at line 987 of file AtNuEventSelectionAB.cxx.

References fDebug, SelectFC(), SelectHOZ(), SelectPC(), and SelectUP().

Referenced by AtmosNumuUPcuts(), and GetEventType().

00988 {
00989   // must be up-going or horizontal event
00990   // ====================================
00991   if( this->SelectUP(event)==0 
00992    && this->SelectHOZ(event)==0 ) return 0;
00993 
00994   // must be fully or partially contained
00995   // ====================================
00996   if( this->SelectFC(event)==0
00997    && this->SelectPC(event)==0 ) return 0;
00998 
00999   // pass event
01000   // ==========
01001   if( fDebug ) std::cout << " *** CVUP *** " << std::endl;
01002   return 1;
01003 }

Bool_t AtNuEventSelectionAB::SelectDN ( AtmosEvent event  ) 

Definition at line 857 of file AtNuEventSelectionAB.cxx.

References DownGoingTrack(), fDebug, and GetPrimaryTrack().

Referenced by SelectUPDN().

00858 {
00859   // get primary track
00860   // =================
00861   AtmosTrack* track = (AtmosTrack*)(this->GetPrimaryTrack(event));
00862   if( !track ) return 0;
00863 
00864   // select up-going event
00865   // =====================
00866   if( this->DownGoingTrack(track)==0 ) return 0;
00867 
00868   // pass event
00869   // ==========
00870   if( fDebug ) std::cout << " *** DN *** " << std::endl;
00871   return 1;
00872 }

Bool_t AtNuEventSelectionAB::SelectFakeSpill ( AtmosEvent event  ) 

Definition at line 2590 of file AtNuEventSelectionAB.cxx.

References AtmosEvent::DataInfo, AtmosData::SpillType, and AtmosData::TriggerSource.

Referenced by GetEventType(), and SelectSpill().

02591 { 
02592   // select fake spill triggers
02593   // ==========================
02594   Bool_t fakespill = 0;
02595   if( event->DataInfo.TriggerSource>=131072 
02596    && event->DataInfo.SpillType==3 ){
02597     fakespill = 1;
02598   }
02599 
02600   // pass fake spills
02601   // ================
02602   if( fakespill ) return 1;
02603 
02604   // fail event
02605   // ==========
02606   return 0;
02607 }

Bool_t AtNuEventSelectionAB::SelectFC ( AtmosEvent event  ) 

Definition at line 890 of file AtNuEventSelectionAB.cxx.

References fDebug, SelectCE(), and SelectCV().

Referenced by AtmosNueCVcuts(), GetEventType(), SelectCVUP(), and SelectUPDN().

00891 {
00892   // must be CV event
00893   // ================
00894   if( this->SelectCV(event)==0 ) return 0;
00895 
00896   // must be CE event
00897   // ================
00898   if( this->SelectCE(event)==0 ) return 0;
00899 
00900   // pass event
00901   // ==========
00902   if( fDebug ) std::cout << " *** FC *** " << std::endl;
00903   return 1;
00904 }

Bool_t AtNuEventSelectionAB::SelectGoodAtmosShower ( AtmosEvent event  ) 

Definition at line 332 of file AtNuEventSelectionAB.cxx.

References GoodAtmosShower().

Referenced by GetAtmosEventType().

00333 {
00334   return this->GoodAtmosShower(event);
00335 }

Bool_t AtNuEventSelectionAB::SelectGoodAtmosSlice ( AtmosEvent event  ) 

Definition at line 322 of file AtNuEventSelectionAB.cxx.

References GoodAtmosSlice().

Referenced by GetAtmosEventType().

00323 {
00324   return this->GoodAtmosSlice(event);
00325 }

Bool_t AtNuEventSelectionAB::SelectGoodAtmosTrack ( AtmosEvent event  ) 

Definition at line 327 of file AtNuEventSelectionAB.cxx.

References GoodAtmosTrack().

Referenced by GetAtmosEventType().

00328 {
00329   return this->GoodAtmosTrack(event);
00330 }

Bool_t AtNuEventSelectionAB::SelectGoodCharge ( AtmosEvent event  ) 

Definition at line 1254 of file AtNuEventSelectionAB.cxx.

References AtmosTrack::EMcharge, AtmosTrack::FitPass, GetPrimaryTrack(), AtmosTrack::QPvtx, AtmosTrack::QPvtxErr, SelectGoodDirection(), AtmosTrack::ZeroCurveChi2, and AtmosTrack::ZeroCurveNdf.

Referenced by GetEventType(), SelectNegativeCharge(), and SelectPositiveCharge().

01255 {
01256   // event must have good direction
01257   // ==============================
01258   if( this->SelectGoodDirection(event)==0 ) return 0;
01259 
01260   // get primary track
01261   // =================
01262   AtmosTrack* track = (AtmosTrack*)(this->GetPrimaryTrack(event));
01263   if( !track ) return 0;
01264 
01265   // good charge
01266   // ===========
01267   // passes track fitter
01268   // sigma(q/p) > 1.0e-4
01269   // |q/p| / sigma(q/p) > 2.5
01270   // chi^{2}_{line}/ndf > 4.0
01271     
01272   if( track->FitPass!=0 && track->EMcharge!=0 
01273    && track->QPvtxErr>1.0e-4 && fabs(track->QPvtx)/track->QPvtxErr>2.5 
01274    && track->ZeroCurveNdf>0 && track->ZeroCurveChi2/track->ZeroCurveNdf>4.0 ) return 1;
01275 
01276   return 0;
01277 }

Bool_t AtNuEventSelectionAB::SelectGoodCosmicMuon ( AtmosEvent event  ) 

Definition at line 1052 of file AtNuEventSelectionAB.cxx.

References fDebug, GetPrimaryTrack(), GoodCosmicTrack(), GoodTrack(), SelectCosmicMuon(), and SelectSingleMuon().

Referenced by GetEventType().

01053 {
01054   // must be cosmic muon
01055   // ===================
01056   if( this->SelectCosmicMuon(event)==0 ) return 0;
01057 
01058   // must be single muon
01059   // ===================
01060   if( this->SelectSingleMuon(event)==0 ) return 0;
01061 
01062   // get primary track
01063   // =================
01064   AtmosTrack* track = (AtmosTrack*)(this->GetPrimaryTrack(event));
01065   if( !track ) return 0;
01066 
01067   // good track selection
01068   // =====================
01069   if( this->GoodTrack(track)==0 ) return 0;  
01070 
01071   // good cosmic track selection
01072   // ===========================
01073   if( this->GoodCosmicTrack(track)==0 ) return 0;  
01074 
01075   // pass event
01076   // ==========
01077   if( fDebug ) std::cout << " *** GOOD COSMIC *** " << std::endl;
01078   return 1;
01079 }

Bool_t AtNuEventSelectionAB::SelectGoodDirection ( AtmosEvent event  ) 

Definition at line 1175 of file AtNuEventSelectionAB.cxx.

References AtmosTrack::EndDirTimeFitNdf, AtmosTrack::EndDirTimeFitRMS, GetPrimaryTrack(), AtmosTrack::Nplanes, AtmosTrack::RangeMetres, SelectGoodTrack(), AtmosTrack::TrkLikePlanes, AtmosTrack::VtxDirTimeFitNdf, and AtmosTrack::VtxDirTimeFitRMS.

Referenced by GetEventType(), and SelectGoodCharge().

01176 {
01177   // event must have good track
01178   // ==========================
01179   if( this->SelectGoodTrack(event)==0 ) return 0;
01180 
01181   // get primary track
01182   // =================
01183   AtmosTrack* track = (AtmosTrack*)(this->GetPrimaryTrack(event));
01184   if( !track ) return 0;
01185 
01186   // good direction
01187   // ==============
01188   // track-like planes >=5
01189   // track planes >= 10
01190   // track range >= 1.0m
01191   // hits used for timing fit >=15
01192   // RMS(vtx) - RMS(end) < -0.66 ns
01193   // RMS(vtx) < 5.00 ns
01194 
01195   if( track->TrkLikePlanes>=5 
01196    && track->Nplanes>=10 && track->RangeMetres>=1.0
01197    && track->VtxDirTimeFitNdf>=15 && track->EndDirTimeFitNdf>=15
01198    && (track->VtxDirTimeFitRMS-track->EndDirTimeFitRMS)/0.3<-0.66
01199    && (track->VtxDirTimeFitRMS/0.3)<5.00 ) return 1;
01200 
01201   return 0;
01202 }

Bool_t AtNuEventSelectionAB::SelectGoodEnergy ( AtmosEvent event  ) 

Definition at line 1204 of file AtNuEventSelectionAB.cxx.

References ContainedEnd(), ContainedVertex(), EndInCoil(), AtmosTrack::FitPass, GetPrimaryShower(), GetPrimaryTrack(), AtmosTrack::QPvtxErr, SelectGoodShower(), and SelectGoodTrack().

Referenced by GetEventType().

01205 {
01206   // good track
01207   // ==========
01208   if( this->SelectGoodTrack(event) ){
01209 
01210     // get primary track
01211     // =================
01212     AtmosTrack* track = (AtmosTrack*)(this->GetPrimaryTrack(event));
01213     if( !track ) return 0;
01214 
01215     // successful track fit
01216     if( track->FitPass!=0 ){
01217 
01218       // track is stopping 
01219       if( this->ContainedEnd(track)==1 
01220        && this->EndInCoil(track)==0 ){
01221         if( 1 ){
01222           return 1;
01223         }
01224       }
01225 
01226       // track is exiting, or ending in coil
01227       else{
01228         if( track->QPvtxErr>1.0e-4 ){
01229           return 1;
01230         }
01231       }
01232     }
01233   }
01234 
01235   // good shower
01236   // ===========
01237   if( this->SelectGoodShower(event) ){
01238 
01239     // get primary shower
01240     // ==================
01241     AtmosShower* shower = (AtmosShower*)(this->GetPrimaryShower(event));
01242     if( !shower ) return 0;
01243 
01244     // fully contained
01245     if( this->ContainedVertex(shower)==1 ){
01246       return 1;
01247     }
01248 
01249   }
01250 
01251   return 0;
01252 }

Bool_t AtNuEventSelectionAB::SelectGoodEvent ( AtmosEvent event  ) 

Definition at line 611 of file AtNuEventSelectionAB.cxx.

References AtmosData::BusyChips, AtmosData::ColdChips, AtmosEvent::DataInfo, AtmosEvent::Date, fDebug, AtNuRunTimes::GoodData(), AtNuRunTimes::GoodSpillCalibration(), AtNuBeamTimes::InBeam(), AtNuSettings::RejectingBadSpillCalibration(), AtmosEvent::Run, SelectGoodSlice(), SelectLIevent(), SelectMCscatter(), AtmosEvent::SimFlag, AtmosEvent::SpillInfo, AtmosData::SpillTimeError, AtmosData::SpillType, AtmosSpill::stfDataAvailable, and AtmosData::TriggerTime.

Referenced by GetAtmosEventType(), and GetEventType().

00612 {
00613   // must be good slice
00614   // ==================
00615   if( this->SelectGoodSlice(event)==0 ) return 0;
00616 
00617   // remove LI events from data
00618   // (also apply to MC for consistency)
00619   // ==================================
00620   if( this->SelectLIevent(event) ) return 0;
00621 
00622   // data quality cuts
00623   // =================
00624   if( event->SimFlag==1 ){ // apply to data only
00625 
00626     // remove very small events
00627     // (now overridden by good slice selection)
00628     // ========================================
00629     // if( event->DataInfo.SnarlMultiplicity<10 ) return 0;
00630 
00631     // remove events with many busy/dead chips
00632     // =======================================
00633     if( event->DataInfo.BusyChips+event->DataInfo.ColdChips>20 ) return 0;
00634 
00635     // remove Light Injection events
00636     // (now moved to LIsieve code)
00637     // ===========================
00638     // if( event->DataInfo.LiTrigger==1
00639     //  && event->DataInfo.LiSubtractedTime>-50000.0
00640     //  && event->DataInfo.LiSubtractedTime<1000.0 ) return 0;
00641 
00642     // remove events close to timeframe boundary
00643     // =========================================
00644     // (only apply *before* timeframe overlaps implemented)
00645     if( event->Date<550   // Feb 1st 2005
00646      && event->DataInfo.TriggerTime>999900000.0 ) return 0;
00647 
00648     // remove bad runs from September 2003
00649     // ===================================
00650     // also applied in RunQuality::RejectRun(...)
00651     if( event->Run>=18884 && event->Run<=18896 ) return 0;
00652 
00653     // remove other periods of bad data
00654     // ================================
00655     if( AtNuRunTimes::GoodData(event)==0 ) return 0;
00656 
00657     // beam era
00658     // ========
00659     // use AtNuBeamTimes to see if beam was on 
00660     // note: need to keep AtNuBeamTimes up to date
00661     Bool_t beam_era = AtNuBeamTimes::InBeam(event);
00662 
00663     // remove events where ND spill data is unavailable
00664     // (only apply during beam running)
00665     // ================================
00666     if( beam_era          // (see above)
00667      && event->SpillInfo.stfDataAvailable==0 ) return 0;
00668 
00669     // remove events with large GPS errors
00670     // (only apply during beam running)
00671     // ================================
00672     if( beam_era          // (see above)
00673      && event->DataInfo.SpillType==1 // ignore fake spills
00674      && event->DataInfo.SpillTimeError>1000 ) return 0;
00675 
00676     // remove events with bad spill calibration
00677     // ========================================
00678     if( AtNuSettings::RejectingBadSpillCalibration() ){
00679       if( AtNuRunTimes::GoodSpillCalibration(event)==0 ) return 0;
00680     }
00681   }
00682 
00683   // Monte Carlo cuts
00684   // ================
00685   else{
00686 
00687     // remove large cosmic muon scatters in MC
00688     // =======================================
00689     if( this->SelectMCscatter(event) ) return 0;
00690   }
00691 
00692   // pass event
00693   // ==========
00694   if( fDebug ) std::cout << " *** GOOD EVENT *** " << std::endl;
00695   return 1;
00696 }

Bool_t AtNuEventSelectionAB::SelectGoodShield ( AtmosEvent event  ) 

Definition at line 2654 of file AtNuEventSelectionAB.cxx.

References AtNuShieldTimes::GoodShield(), and AtmosEvent::SimFlag.

Referenced by GetAtmosEventType().

02655 {
02656   // check shield was operational
02657   // ============================
02658   if( event->SimFlag==1 ){ // must be data
02659     return AtNuShieldTimes::GoodShield(event);
02660   }
02661 
02662   // pass event
02663   // ==========
02664   return 1;
02665 }

Bool_t AtNuEventSelectionAB::SelectGoodShower ( AtmosEvent event  ) 

Definition at line 719 of file AtNuEventSelectionAB.cxx.

References fDebug, GetPrimaryShower(), GoodAtmosShower(), and GoodShower().

Referenced by AtmosNueCVcuts(), GetEventType(), and SelectGoodEnergy().

00720 {
00721   // must be good atmos shower
00722   // =========================
00723   if( this->GoodAtmosShower(event)==0 ) return 0;
00724 
00725   // get primary shower
00726   // ==================
00727   AtmosShower* shower = (AtmosShower*)(this->GetPrimaryShower(event));
00728   if( !shower ) return 0;
00729 
00730   // select good showers
00731   // ===================
00732   if( this->GoodShower(shower)==0 ) return 0;
00733 
00734   // pass event
00735   // ==========
00736   if( fDebug ) std::cout << " *** GOOD SHOWER *** " << std::endl;
00737   return 1;
00738 }

Bool_t AtNuEventSelectionAB::SelectGoodSlice ( AtmosEvent event  ) 

Definition at line 590 of file AtNuEventSelectionAB.cxx.

References fDebug, AtmosEvent::FilterInfo, AtmosFilter::GoodStrips, AtmosFilter::GoodUPlanes, AtmosFilter::GoodVPlanes, AtmosEvent::RecoInfo, and AtmosReco::TotalCharge.

Referenced by GetEventType(), LIsieve(), SelectAtmosSlice(), and SelectGoodEvent().

00591 {
00592   // remove events with zero charge (sanity check)
00593   // =============================================
00594   if( event->RecoInfo.TotalCharge<=0 ) return 0;
00595 
00596   // remove events with <=1 good strips (i.e. double-ended, >2 PEs)
00597   // ==============================================================
00598   if( event->FilterInfo.GoodStrips<=1 ) return 0;
00599 
00600   // remove events with <=0 good planes (i.e. planes with 0 good strips) 
00601   // ===================================================================
00602   if( event->FilterInfo.GoodUPlanes<=0 ) return 0; // (U view)
00603   if( event->FilterInfo.GoodVPlanes<=0 ) return 0; // (V view)
00604 
00605   // pass event
00606   // ==========
00607   if( fDebug ) std::cout << " *** GOOD SLICE *** " << std::endl;
00608   return 1;
00609 }

Bool_t AtNuEventSelectionAB::SelectGoodTrack ( AtmosEvent event  ) 

Definition at line 698 of file AtNuEventSelectionAB.cxx.

References fDebug, GetPrimaryTrack(), GoodAtmosTrack(), and GoodTrack().

Referenced by AtmosNumuCVcuts(), AtmosNumuUPDNcuts(), GetEventType(), SelectGoodDirection(), and SelectGoodEnergy().

00699 {
00700   // must be good atmos track
00701   // ========================
00702   if( this->GoodAtmosTrack(event)==0 ) return 0;
00703 
00704   // get primary track
00705   // =================
00706   AtmosTrack* track = (AtmosTrack*)(this->GetPrimaryTrack(event));
00707   if( !track ) return 0;
00708 
00709   // select good tracks
00710   // ==================
00711   if( this->GoodTrack(track)==0 ) return 0;
00712 
00713   // pass event
00714   // ==========
00715   if( fDebug ) std::cout << " *** GOOD TRACK *** " << std::endl;
00716   return 1;
00717 }

Bool_t AtNuEventSelectionAB::SelectHOZ ( AtmosEvent event  ) 

Definition at line 840 of file AtNuEventSelectionAB.cxx.

References fDebug, GetPrimaryTrack(), and HorizontalTrack().

Referenced by SelectCVUP(), SelectUPDN(), and SelectUPMU().

00841 {
00842   // get primary track
00843   // =================
00844   AtmosTrack* track = (AtmosTrack*)(this->GetPrimaryTrack(event));
00845   if( !track ) return 0;
00846 
00847   // select up-going event
00848   // =====================
00849   if( this->HorizontalTrack(track)==0 ) return 0;
00850 
00851   // pass event
00852   // ==========
00853   if( fDebug ) std::cout << " *** HORIZON *** " << std::endl;
00854   return 1;
00855 }

Bool_t AtNuEventSelectionAB::SelectLIevent ( AtmosEvent event  ) 

Definition at line 1329 of file AtNuEventSelectionAB.cxx.

References LIsieve().

Referenced by GetEventType(), and SelectGoodEvent().

01330 {
01331   // Light Injection
01332   // ===============
01333   if( this->LIsieve(event) ) return 1;
01334 
01335   return 0;
01336 }

Bool_t AtNuEventSelectionAB::SelectMCscatter ( AtmosEvent event  ) 

Definition at line 1338 of file AtNuEventSelectionAB.cxx.

References MCscatter().

Referenced by GetEventType(), and SelectGoodEvent().

01339 {
01340   // MC scatter
01341   // ==========
01342   if( this->MCscatter(event) ) return 1;
01343   
01344   return 0;
01345 }

Bool_t AtNuEventSelectionAB::SelectMultipleMuon ( AtmosEvent event  ) 

Definition at line 1162 of file AtNuEventSelectionAB.cxx.

References fDebug, AtmosReco::MultipleMuonFlag, AtmosEvent::NTracks, and AtmosEvent::RecoInfo.

Referenced by GetEventType(), SelectCosmicMuon(), and SelectSingleMuon().

01163 {
01164   // multiple muon cuts
01165   // ==================
01166   if( event->RecoInfo.MultipleMuonFlag==0 ) return 0;
01167   if( event->NTracks<=1 ) return 0;
01168 
01169   // pass event
01170   // ==========
01171   if( fDebug ) std::cout << " *** MULTIPLE MUON *** " << std::endl;
01172   return 1;
01173 }

Bool_t AtNuEventSelectionAB::SelectNegativeCharge ( AtmosEvent event  ) 

Definition at line 1304 of file AtNuEventSelectionAB.cxx.

References AtmosTrack::EMcharge, GetPrimaryTrack(), AtNuSettings::ReversingBField(), and SelectGoodCharge().

Referenced by GetEventType().

01305 {
01306   // event must have good charge
01307   // ===========================
01308   if( this->SelectGoodCharge(event)==0 ) return 0;
01309 
01310   // get primary track
01311   // =================
01312   AtmosTrack* track = (AtmosTrack*)(this->GetPrimaryTrack(event));
01313   if( !track ) return 0;
01314 
01315   // reverse field, if necessary
01316   // ===========================
01317   Double_t fBReverse = +1.0;
01318   if( AtNuSettings::ReversingBField() ){
01319     fBReverse = -1.0;
01320   }
01321 
01322   // negative charge
01323   // ===============
01324   if( fBReverse*track->EMcharge<-0.5 ) return 1;
01325 
01326   return 0;
01327 }

Bool_t AtNuEventSelectionAB::SelectPC ( AtmosEvent event  ) 

Definition at line 906 of file AtNuEventSelectionAB.cxx.

References fDebug, SelectCE(), and SelectCV().

Referenced by GetEventType(), SelectCVUP(), SelectPCDN(), SelectPCUP(), and SelectUPDN().

00907 {
00908   // must be CV event
00909   // ================
00910   if( this->SelectCV(event)==0 ) return 0;
00911 
00912   // must not be CE event
00913   // ====================
00914   if( this->SelectCE(event)==1 ) return 0;
00915 
00916   // pass event
00917   // ==========
00918   if( fDebug ) std::cout << " *** PC *** " << std::endl;
00919   return 1;
00920 }

Bool_t AtNuEventSelectionAB::SelectPCDN ( AtmosEvent event  ) 

Definition at line 922 of file AtNuEventSelectionAB.cxx.

References fDebug, GetPrimaryTrack(), SelectPC(), and AtmosTrack::VtxDirCosY.

00923 {
00924   // must be PC event
00925   // ================
00926   if( this->SelectPC(event)==0 ) return 0;
00927 
00928   // get primary track
00929   // =================
00930   AtmosTrack* track = (AtmosTrack*)(this->GetPrimaryTrack(event));
00931   if( !track ) return 0;
00932 
00933   // track must be down-going
00934   // ========================
00935   // if( this->DownGoingTrack(track)==0 ) return 0;
00936   if( !(track->VtxDirCosY<=0.0) ) return 0;
00937 
00938   // pass event
00939   // ==========
00940   if( fDebug ) std::cout << " *** PCDN *** " << std::endl;
00941   return 1;
00942 }

Bool_t AtNuEventSelectionAB::SelectPCUP ( AtmosEvent event  ) 

Definition at line 944 of file AtNuEventSelectionAB.cxx.

References fDebug, GetPrimaryTrack(), SelectPC(), and AtmosTrack::VtxDirCosY.

00945 {
00946   // must be CV event
00947   // ================
00948   if( this->SelectPC(event)==0 ) return 0;
00949 
00950   // get primary track
00951   // =================
00952   AtmosTrack* track = (AtmosTrack*)(this->GetPrimaryTrack(event));
00953   if( !track ) return 0;
00954 
00955   // track must be up-going
00956   // ========================
00957   // if( this->UpGoingTrack(track)==0 ) return 0;
00958   if( !(track->VtxDirCosY>0.0) ) return 0;
00959 
00960   // pass event
00961   // ==========
00962   if( fDebug ) std::cout << " *** PCUP *** " << std::endl;
00963   return 1;
00964 }

Bool_t AtNuEventSelectionAB::SelectPositiveCharge ( AtmosEvent event  ) 

Definition at line 1279 of file AtNuEventSelectionAB.cxx.

References AtmosTrack::EMcharge, GetPrimaryTrack(), AtNuSettings::ReversingBField(), and SelectGoodCharge().

Referenced by GetEventType().

01280 {
01281   // event must have good charge
01282   // ===========================
01283   if( this->SelectGoodCharge(event)==0 ) return 0;
01284 
01285   // get primary track
01286   // =================
01287   AtmosTrack* track = (AtmosTrack*)(this->GetPrimaryTrack(event));
01288   if( !track ) return 0;
01289 
01290   // reverse field, if necessary
01291   // ===========================
01292   Double_t fBReverse = +1.0;
01293   if( AtNuSettings::ReversingBField() ){
01294     fBReverse = -1.0;
01295   }
01296 
01297   // positive charge
01298   // ===============
01299   if( fBReverse*track->EMcharge>+0.5 ) return 1;
01300 
01301   return 0;
01302 }

Bool_t AtNuEventSelectionAB::SelectRAF ( AtmosEvent event  ) 

Definition at line 966 of file AtNuEventSelectionAB.cxx.

References ContainedVertex(), fDebug, GetPrimaryTrack(), and VertexInCoil().

Referenced by GetEventType(), SelectUPDN(), and SelectUPMU().

00967 {
00968   // get primary track
00969   // =================
00970   AtmosTrack* track = (AtmosTrack*)(this->GetPrimaryTrack(event));
00971   if( !track ) return 0;
00972 
00973   // vertex must not be contained
00974   // ============================
00975   if( this->ContainedVertex(track)==1 ) return 0;
00976 
00977   // vertex coil cut 
00978   // ===============
00979   if( this->VertexInCoil(track)==1 ) return 0;
00980 
00981   // pass event
00982   // ==========
00983   if( fDebug ) std::cout << " *** RAF *** " << std::endl;
00984   return 1;
00985 }

Bool_t AtNuEventSelectionAB::SelectSingleMuon ( AtmosEvent event  ) 

Definition at line 1147 of file AtNuEventSelectionAB.cxx.

References SelectMultipleMuon(), and SingleTrack().

Referenced by SelectGoodCosmicMuon(), SelectStoppingMuon(), and SelectThroughGoingMuon().

01148 {
01149   // multiple muon cuts
01150   // ==================
01151   if( this->SelectMultipleMuon(event)==1 ) return 0;
01152 
01153   // single muon cuts
01154   // ================
01155   if( this->SingleTrack(event)==0 ) return 0;
01156   
01157   // pass event
01158   // ==========
01159   return 1;
01160 }

Bool_t AtNuEventSelectionAB::SelectSpill ( AtmosEvent event  ) 

Definition at line 2546 of file AtNuEventSelectionAB.cxx.

References SelectBeamSpill(), and SelectFakeSpill().

Referenced by GetEventType(), and SelectCosmicMuon().

02547 {
02548   // beam spills
02549   // ===========
02550   Bool_t beamspill = this->SelectBeamSpill(event);
02551 
02552   // fake spills
02553   // ===========
02554   Bool_t fakespill = this->SelectFakeSpill(event);
02555 
02556   // pass any spills
02557   // ===============
02558   if( beamspill || fakespill ) return 1;
02559 
02560   // fail event
02561   // ==========
02562   return 0;
02563 }

Bool_t AtNuEventSelectionAB::SelectStoppingMuon ( AtmosEvent event  ) 

Definition at line 1081 of file AtNuEventSelectionAB.cxx.

References ContainedEnd(), ContainedVertex(), DownGoingTrack(), EndInCoil(), fDebug, GetPrimaryTrack(), and SelectSingleMuon().

Referenced by GetEventType(), and SelectCosmicMuon().

01082 {
01083   // must be single muon
01084   // ===================
01085   if( this->SelectSingleMuon(event)==0 ) return 0;
01086 
01087   // get primary track
01088   // =================
01089   AtmosTrack* track = (AtmosTrack*)(this->GetPrimaryTrack(event));
01090   if( !track ) return 0;
01091 
01092   // track must be down-going
01093   // ========================
01094   if( this->DownGoingTrack(track)==0 ) return 0;
01095 
01096   // vertex must not be contained
01097   // ============================
01098   if( this->ContainedVertex(track)==1 ) return 0;
01099 
01100   // end must be contained
01101   // =====================
01102   if( this->ContainedEnd(track)==0 ) return 0;
01103 
01104   // end coil cut
01105   // ============
01106   if( this->EndInCoil(track)==1 ) return 0;
01107 
01108   // pass event
01109   // ==========
01110   if( fDebug ) std::cout << " *** STOPPING MUON *** " << std::endl;
01111   return 1;
01112 }

Bool_t AtNuEventSelectionAB::SelectThroughGoingMuon ( AtmosEvent event  ) 

Definition at line 1114 of file AtNuEventSelectionAB.cxx.

References ContainedEnd(), ContainedVertex(), DownGoingTrack(), EndInCoil(), fDebug, GetPrimaryTrack(), and SelectSingleMuon().

Referenced by GetEventType(), and SelectCosmicMuon().

01115 {
01116   // must be single muon
01117   // ===================
01118   if( this->SelectSingleMuon(event)==0 ) return 0;
01119 
01120   // get primary track
01121   // =================
01122   AtmosTrack* track = (AtmosTrack*)(this->GetPrimaryTrack(event));
01123   if( !track ) return 0;
01124 
01125   // track must be down-going
01126   // ========================
01127   if( this->DownGoingTrack(track)==0 ) return 0;
01128 
01129   // vertex must not be contained
01130   // ============================
01131   if( this->ContainedVertex(track)==1 ) return 0;
01132 
01133   // end must not be contained
01134   // =========================
01135   if( this->ContainedEnd(track)==1 ) return 0;
01136 
01137   // end coil cut
01138   // ============
01139   if( this->EndInCoil(track)==1 ) return 0;
01140 
01141   // pass event
01142   // ==========
01143   if( fDebug ) std::cout << " *** THROUGH-GOING MUON *** " << std::endl;
01144   return 1;
01145 }

Bool_t AtNuEventSelectionAB::SelectUP ( AtmosEvent event  ) 

Definition at line 823 of file AtNuEventSelectionAB.cxx.

References fDebug, GetPrimaryTrack(), and UpGoingTrack().

Referenced by SelectCVUP(), SelectUPDN(), and SelectUPMU().

00824 {
00825   // get primary track
00826   // =================
00827   AtmosTrack* track = (AtmosTrack*)(this->GetPrimaryTrack(event));
00828   if( !track ) return 0;
00829 
00830   // select up-going event
00831   // =====================
00832   if( this->UpGoingTrack(track)==0 ) return 0;
00833 
00834   // pass event
00835   // ==========
00836   if( fDebug ) std::cout << " *** UP *** " << std::endl;
00837   return 1;
00838 }

Bool_t AtNuEventSelectionAB::SelectUPDN ( AtmosEvent event  ) 

Definition at line 874 of file AtNuEventSelectionAB.cxx.

References fDebug, SelectDN(), SelectFC(), SelectHOZ(), SelectPC(), SelectRAF(), and SelectUP().

Referenced by AtmosNumuUPDNcuts(), and GetEventType().

00875 {
00876   if( this->SelectUP(event)==0
00877    && this->SelectHOZ(event)==0
00878    && this->SelectDN(event)==0 ) return 0;
00879 
00880   if( this->SelectFC(event)==0
00881    && this->SelectPC(event)==0
00882    && this->SelectRAF(event)==0 ) return 0;  
00883 
00884   // pass event
00885   // ==========
00886   if( fDebug ) std::cout << " *** UPDN *** " << std::endl;
00887   return 1;
00888 }

Bool_t AtNuEventSelectionAB::SelectUPMU ( AtmosEvent event  ) 

Definition at line 1005 of file AtNuEventSelectionAB.cxx.

References fDebug, SelectHOZ(), SelectRAF(), and SelectUP().

Referenced by AtmosNumuUPcuts(), and GetEventType().

01006 {
01007   // must be up-going or horizontal event
01008   // ====================================
01009   if( this->SelectUP(event)==0 
01010    && this->SelectHOZ(event)==0 ) return 0;
01011 
01012   // must be rock or anti-fiducial
01013   // =============================
01014   if( this->SelectRAF(event)==0 ) return 0;
01015 
01016   // pass event
01017   // ==========
01018   if( fDebug ) std::cout << " *** UPMU *** " << std::endl;
01019   return 1;
01020 }

Bool_t AtNuEventSelectionAB::SelectVeto ( AtmosEvent event  ) 

Definition at line 2638 of file AtNuEventSelectionAB.cxx.

References ShieldTime().

Referenced by GetAtmosEventType(), and GetEventType().

02639 {
02640   // select events in shield proximity 
02641   // =================================
02642   Bool_t veto = 0;
02643   if( fabs(this->ShieldTime(event))<50.0 ) veto = 1;
02644 
02645   // pass event
02646   // ==========
02647   if( veto ) return 1;
02648 
02649   // fail event
02650   // ==========
02651   return 0;
02652 }

void AtNuEventSelectionAB::SetDebug ( bool  b  )  [inline]

Definition at line 25 of file AtNuEventSelectionAB.h.

References fDebug.

00025 {fDebug=b;}

Double_t AtNuEventSelectionAB::ShieldTime ( AtmosEvent event,
AtmosEvent shieldevent,
Double_t  offset 
) [private]

Definition at line 2672 of file AtNuEventSelectionAB.cxx.

References AtmosShieldPlank::ClearFibre, MuELoss::e, AtmosTrack::EndTime, AtmosTrack::EndU, AtmosTrack::EndV, AtmosTrack::EndX, AtmosTrack::EndY, AtmosTrack::EndZ, AtmosShieldPlank::QPE, AtmosEvent::ShieldPlankList, AtmosEvent::ShowerList, AtmosShieldPlank::Tcal, AtmosEvent::TrackList, AtmosShower::VtxTime, AtmosTrack::VtxTime, AtmosTrack::VtxU, AtmosTrack::VtxV, AtmosShower::VtxX, AtmosTrack::VtxX, AtmosShower::VtxY, AtmosTrack::VtxY, AtmosShower::VtxZ, AtmosTrack::VtxZ, AtmosShieldPlank::WlsPigtail, AtmosShieldPlank::X, AtmosShieldPlank::Y, and AtmosShieldPlank::Z.

02673 {
02674   // return shield time in *nanoseconds*
02675   // ===================================
02676   Double_t shieldtime = -99999.9;
02677 
02678   // get shield plank list
02679   // =====================
02680   TClonesArray* shieldlist = (TClonesArray*)(shieldevent->ShieldPlankList);
02681   if(!shieldlist) return 0;
02682 
02683   // veto flags
02684   // ==========
02685   Bool_t trackveto = 0;
02686   Bool_t showerveto = 0;
02687   Double_t trackDT = -99999e-9;
02688   Double_t showerDT = -99999e-9;
02689   
02690   // loop over tracks
02691   // ================
02692   TClonesArray* tracklist = (TClonesArray*)(event->TrackList);
02693   if( tracklist ){
02694     if( 1+tracklist->GetLast()>0 ) trackveto = 0;
02695 
02696     for( Int_t i=0; i<1+tracklist->GetLast(); i++ ){
02697       AtmosTrack* track = (AtmosTrack*)(tracklist->At(i));
02698     
02699       Double_t topvtxX = 0.0;
02700       Double_t topvtxY = 0.0;
02701       Double_t topvtxZ = -999.9;
02702       Double_t topvtxtime = 0.0;
02703 
02704       Double_t shldminU = -999.9;
02705       Double_t shldmaxU = +999.9;
02706       Double_t shldminV = -999.9;
02707       Double_t shldmaxV = +999.9;
02708       Double_t shldminX = -999.9;
02709       Double_t shldmaxX = +999.9;
02710       Double_t shldminY = -999.9;
02711       Double_t shldmaxY = +999.9;
02712 
02713       if( track->VtxY>=track->EndY ){
02714         topvtxX=track->VtxX; 
02715         topvtxY=track->VtxY; 
02716         topvtxZ=track->VtxZ;
02717         topvtxtime=track->VtxTime; 
02718         if( track->EndX>+3.5 ) shldmaxX=+4.5; if( track->EndX<-3.5 ) shldminX=-4.5;
02719         if( track->EndU<-3.5 ) shldminU=-4.5; if( track->EndV<-3.5 ) shldminV=-4.5;
02720         shldminY=track->VtxY-0.1;
02721       } 
02722       else{
02723         topvtxX=track->EndX; 
02724         topvtxY=track->EndY; 
02725         topvtxZ=track->EndZ;
02726         topvtxtime=track->EndTime; 
02727         if( track->VtxX>+3.5 ) shldmaxX=+4.5; if( track->VtxX<-3.5 ) shldminX=-4.5;
02728         if( track->VtxU<-3.5 ) shldminU=-4.5; if( track->VtxV<-3.5 ) shldminV=-4.5;
02729         shldminY=track->EndY-0.1;
02730       }
02731 
02732       for( Int_t j=0; j<1+shieldlist->GetLast(); j++ ){
02733         AtmosShieldPlank* shield = (AtmosShieldPlank*)(shieldlist->At(j));
02734 
02735         Double_t shldU = 0.7071*(+shield->X+shield->Y);
02736         Double_t shldV = 0.7071*(-shield->X+shield->Y);
02737         Double_t shldX = shield->X;
02738         Double_t shldY = shield->Y;
02739 
02740         Double_t shldT0 = shield->Tcal[0] + 26.e-9 + 1.0e-9*offset
02741                        - (1.77/3.0e8)*( shield->WlsPigtail[0] 
02742                                       + shield->ClearFibre[0] 
02743                                       + (shield->Z[0]-topvtxZ) );
02744         Double_t shldT1 = shield->Tcal[1] + 26.e-9 + 1.0e-9*offset
02745                        - (1.77/3.0e8)*( shield->WlsPigtail[1] 
02746                                       + shield->ClearFibre[1] 
02747                                       + (topvtxZ-shield->Z[1]) );
02748 
02749         Double_t travelDT = (1.0/3.0e8)*sqrt( (shield->X-topvtxX)*(shield->X-topvtxX) 
02750                                             + (shield->Y-topvtxY)*(shield->Y-topvtxY) );
02751 
02752         Double_t shldDT0 = shldT0 + travelDT - topvtxtime;
02753         Double_t shldDT1 = shldT1 + travelDT - topvtxtime;
02754 
02755         if( shield->Z[0]+0.5>topvtxZ
02756          && shield->Z[1]-0.5<topvtxZ
02757          && shldU>shldminU && shldU<shldmaxU
02758          && shldV>shldminV && shldV<shldmaxV
02759          && shldX>shldminX && shldX<shldmaxX
02760          && shldY>shldminY && shldY<shldmaxY ){
02761           if( shield->QPE[0]>0 && fabs(shldDT0)<fabs(trackDT) ){
02762             trackDT = shldDT0; trackveto = 1;
02763           }
02764           if( shield->QPE[1]>0 && fabs(shldDT1)<fabs(trackDT) ){
02765             trackDT = shldDT1; trackveto = 1;
02766           }
02767         }
02768       }
02769     }
02770   }
02771 
02772   // loop over showers
02773   // =================
02774   TClonesArray* showerlist = (TClonesArray*)(event->ShowerList);
02775   if( showerlist ){
02776     if( 1+showerlist->GetLast()>0 ) showerveto = 0;
02777 
02778     for( Int_t i=0; i<1+showerlist->GetLast(); i++ ){
02779       AtmosShower* shower = (AtmosShower*)(showerlist->At(i));
02780     
02781       Double_t topvtxX = shower->VtxX;
02782       Double_t topvtxY = shower->VtxY;
02783       Double_t topvtxZ = shower->VtxZ;
02784       Double_t topvtxtime = shower->VtxTime;
02785 
02786       for( Int_t j=0; j<1+shieldlist->GetLast(); j++ ){
02787         AtmosShieldPlank* shield = (AtmosShieldPlank*)(shieldlist->At(j));
02788 
02789         Double_t shldT0 = shield->Tcal[0] + 26.e-9 + 1.0e-9*offset
02790                        - (1.77/3.0e8)*( shield->WlsPigtail[0] 
02791                                       + shield->ClearFibre[0] 
02792                                       + (shield->Z[0]-topvtxZ) );
02793         Double_t shldT1 = shield->Tcal[1] + 26.e-9 + 1.0e-9*offset
02794                        - (1.77/3.0e8)*( shield->WlsPigtail[1] 
02795                                       + shield->ClearFibre[1] 
02796                                       + (topvtxZ-shield->Z[1]) );
02797 
02798         Double_t travelDT = (1.0/3.0e8)*sqrt( (shield->X-topvtxX)*(shield->X-topvtxX) 
02799                                             + (shield->Y-topvtxY)*(shield->Y-topvtxY) );
02800 
02801         Double_t shldDT0 = shldT0 + travelDT - topvtxtime;
02802         Double_t shldDT1 = shldT1 + travelDT - topvtxtime;
02803 
02804         if( shield->Z[0]+0.5>topvtxZ 
02805          && shield->Z[1]-0.5<topvtxZ
02806          && shield->Y>topvtxY-0.5 ){
02807           if( shield->QPE[0]>0 && fabs(shldDT0)<fabs(showerDT) ){
02808             showerDT = shldDT0; showerveto = 1;
02809           }
02810           if( shield->QPE[1]>0 && fabs(shldDT1)<fabs(showerDT) ){
02811             showerDT = shldDT1; showerveto = 1;
02812           }
02813         }
02814       }
02815     }
02816 
02817   }
02818 
02819   // calculate shield time
02820   // =====================
02821   if( trackveto ){
02822     trackDT = 1.0e9*trackDT;
02823     if( fabs(trackDT)<fabs(shieldtime) ) shieldtime = trackDT;
02824   }
02825 
02826   if( showerveto ){
02827     showerDT = 1.0e9*showerDT;
02828     if( fabs(showerDT)<fabs(shieldtime) ) shieldtime = showerDT;
02829   }
02830 
02831   return shieldtime;
02832 }

Double_t AtNuEventSelectionAB::ShieldTime ( AtmosEvent event  )  [private]

Definition at line 2667 of file AtNuEventSelectionAB.cxx.

Referenced by GetShieldTime(), and SelectVeto().

02668 {
02669   return this->ShieldTime(event,event,0.0);
02670 }

Bool_t AtNuEventSelectionAB::SingleShower ( AtmosEvent event  )  [private]

Definition at line 2210 of file AtNuEventSelectionAB.cxx.

References AtmosEvent::NShowers.

Referenced by GoodAtmosShower().

02211 {
02212   // must be single shower
02213   // =====================
02214   if( event->NShowers!=1 ) return 0;
02215   
02216   // pass event
02217   // ==========
02218   return 1;
02219 }

Bool_t AtNuEventSelectionAB::SingleTrack ( AtmosEvent event  )  [private]

Definition at line 1687 of file AtNuEventSelectionAB.cxx.

References AtmosEvent::NTracks.

Referenced by GoodAtmosTrack(), and SelectSingleMuon().

01688 {
01689   // must be single track
01690   // ====================
01691   if( event->NTracks!=1 ) return 0;
01692   
01693   // pass event
01694   // ==========
01695   return 1;
01696 }

Double_t AtNuEventSelectionAB::SpillTime ( AtmosEvent event  )  [private]

Definition at line 2609 of file AtNuEventSelectionAB.cxx.

References AtmosEvent::SpillInfo, AtmosSpill::stfDataAvailable, and AtmosEvent::SubRun.

Referenced by GetSpillTime(), and SelectBeamSpill().

02610 {
02611   // return spill time in *microseconds*
02612   // ==================================
02613   Double_t spilltime = -99999.9;
02614 
02615   // must have spill time ND data
02616   // ============================
02617   if( event->SpillInfo.stfDataAvailable==1 ){
02618     Double_t spilltime_microsec = 0.0;
02619     Double_t eventtime_microsec = 1.0e+6*event->RecoInfo.AbsTime;
02620 
02621     if( event->SubRun>=0 ){ // look for presence of subrun number...
02622       spilltime_microsec = 1.0e-3*event->DataInfo.TriggerTime
02623                          + 1.0e+6*event->SpillInfo.TimeToNearestSpill_stf;
02624     }
02625     else{
02626       spilltime_microsec = 0.0  // relative to start of timeframe (I hope...)
02627                          + 1.0e+6*event->SpillInfo.TimeToNearestSpill_stf;
02628     }
02629 
02630     Double_t tempspilltime = eventtime_microsec - spilltime_microsec;
02631 
02632     if( fabs(tempspilltime)<fabs(spilltime) ) spilltime = tempspilltime;
02633   }
02634 
02635   return spilltime;
02636 }

Bool_t AtNuEventSelectionAB::UpGoingTrack ( AtmosTrack track  )  [private]

Definition at line 1698 of file AtNuEventSelectionAB.cxx.

References AtmosTrack::EndDirTimeFitRMS, AtmosTrack::EndY, AtmosTrack::VtxDirCosY, AtmosTrack::VtxDirTimeFitRMS, and AtmosTrack::VtxY.

Referenced by SelectUP().

01699 {
01700   // up-going track selection
01701   // ========================
01702   // track direction cos(zenith)>=+0.05
01703   // vertex-end < +0.5m
01704   // correct timing rms
01705 
01706   if( ( track->VtxDirCosY>=+0.05 )
01707    && ( track->VtxY-track->EndY<+0.5 )
01708    && ( track->VtxDirTimeFitRMS-track->EndDirTimeFitRMS<0.0 ) ) return 1;
01709 
01710   return 0;
01711 }

Bool_t AtNuEventSelectionAB::UpGoingTrackCuts ( AtmosEvent event,
AtmosTrack track,
AtmosShower shower,
Int_t  cut = -1 
) [private]

Definition at line 2012 of file AtNuEventSelectionAB.cxx.

References AtmosTrack::EndDirTimeFitNdf, AtmosTrack::EndDirTimeFitRMS, AtmosTrack::Nplanes, AtmosTrack::RangeMetres, AtmosTrack::TimingFitChi2, AtmosTrack::TimingFitNdf, AtmosTrack::TrkLikePlanes, AtmosTrack::VtxDirTimeFitNdf, and AtmosTrack::VtxDirTimeFitRMS.

Referenced by AtmosNumuUPDNcuts().

02013 {  
02014   // sanity check
02015   // ============
02016   if( track==0 ) return 0;
02017 
02018   // up-going selection
02019   // ==================
02020   // N.B: up-going selection should encompass 
02021   //  *all* of the above GoodDirection cuts
02022   Bool_t UPcut1 = 1; // topology cuts (I)
02023   Bool_t UPcut2 = 1; // topology cuts (II)
02024   Bool_t UPcut3 = 1; // timing cuts (I)
02025   Bool_t UPcut4 = 1; // timing cuts (II)
02026 
02027   // pass/fail
02028   Bool_t pass = 1;
02029 
02030   if( UPcut1 ) UPcut1 = pass;
02031 
02032   // topology cuts
02033   // =============
02034   // (i) track length cuts
02035   if( track->TrkLikePlanes<=5
02036    || track->Nplanes<=15 
02037    || track->RangeMetres<=1.5 ) pass = 0;
02038 
02039   if( UPcut2 ) UPcut2 = pass;
02040 
02041   // timing cuts
02042   // ===========
02043   // (i) sufficient hits
02044   if( track->VtxDirTimeFitNdf<20 || track->EndDirTimeFitNdf<20 ) pass = 0;
02045   
02046   // (ii) asymmetry in hits
02047   if( track->VtxDirTimeFitNdf-track->EndDirTimeFitNdf<-5 ) pass = 0;
02048 
02049   // (iii) time fit cuts
02050   if( track->TimingFitNdf<20 
02051    || track->TimingFitChi2/track->TimingFitNdf>2.25 ) pass = 0;
02052                             // NOTE: 2.25 = sqrt(4.66) [+0.1 ns]
02053 
02054   if( (track->VtxDirTimeFitRMS/0.3)>4.66 
02055    || (track->EndDirTimeFitRMS/0.3)<3.66 ) pass = 0;
02056 
02057   if( (track->VtxDirTimeFitRMS/track->RangeMetres)>0.57735 ) pass = 0;
02058                             // NOTE: 0.57735 = 1./sqrt(3.)
02059 
02060   // (iv) timeslope cuts (removed for now)
02061   // if( track->VtxPlane<track->EndPlane
02062   //  && 3.0e8*track->TimeSlope<+0.5 ) pass = 0;
02063   // if( track->EndPlane<track->VtxPlane
02064   //  && 3.0e8*track->TimeSlope>-0.5 ) pass = 0;
02065 
02066   if( UPcut3 ) UPcut3 = pass;
02067 
02068   // (v) RMSup - RMSdown cuts
02069   if( (track->VtxDirTimeFitRMS-track->EndDirTimeFitRMS)/0.3>-1.66 ) pass = 0;
02070 
02071   if( UPcut4 ) UPcut4 = pass;
02072 
02073   // pass/fail event
02074   // ===============
02075 
02076   switch( cut ){
02077     case 0: pass = 1; break;
02078     case 1: pass = UPcut1; break;
02079     case 2: pass = UPcut2; break;
02080     case 3: pass = UPcut3; break;
02081     case 4: pass = UPcut4; break;
02082     default: pass = UPcut4; break; 
02083   }
02084 
02085   return pass;
02086 }

Bool_t AtNuEventSelectionAB::VertexInCoil ( AtmosShower shower  )  [private]

Definition at line 2275 of file AtNuEventSelectionAB.cxx.

References AtmosShower::VtxR.

02276 {
02277   // vertex coil cut 
02278   // ===============
02279 
02280   if( shower->VtxR<0.4 ) return 1;
02281 
02282   return 0;
02283 }

Bool_t AtNuEventSelectionAB::VertexInCoil ( AtmosTrack track  )  [private]

Definition at line 1783 of file AtNuEventSelectionAB.cxx.

References AtmosTrack::VtxR.

Referenced by ContainedShowerCuts(), ContainedTrackCuts(), EndInCoil(), SelectCV(), SelectRAF(), and VertexInCoilSneakily().

01784 {
01785   // vertex coil cut 
01786   // ===============
01787 
01788   if( track->VtxR<0.4 ) return 1;
01789 
01790   return 0;
01791 }

Bool_t AtNuEventSelectionAB::VertexInCoilSneakily ( AtmosShower shower  )  [private]

Definition at line 2285 of file AtNuEventSelectionAB.cxx.

References AtmosShower::MaxPlaneNumber, AtmosShower::MinPlaneNumber, VertexInCoil(), and AtmosShower::VtxR.

02286 {
02287   // extended vertex coil cut
02288   // ========================
02289 
02290   if( this->VertexInCoil(shower) ) return 1;
02291 
02292   if( shower->MinPlaneNumber<21 && shower->VtxR<1.0 ) return 1;
02293 
02294   if( shower->MaxPlaneNumber>465 && shower->VtxR<1.0 ) return 1;
02295  
02296   return 0; 
02297 }

Bool_t AtNuEventSelectionAB::VertexInCoilSneakily ( AtmosTrack track  )  [private]

Definition at line 1793 of file AtNuEventSelectionAB.cxx.

References AtmosTrack::EndPlane, VertexInCoil(), AtmosTrack::VtxPlane, and AtmosTrack::VtxR.

Referenced by ContainedShowerCuts(), ContainedTrackCuts(), and EndInCoilSneakily().

01794 {
01795   // extended vertex coil cut
01796   // ========================
01797 
01798   if( this->VertexInCoil(track) ) return 1;
01799 
01800   if( track->VtxPlane<track->EndPlane ){
01801     if( track->VtxPlane<21 && track->VtxR<1.0 ) return 1;
01802   }
01803 
01804   if( track->VtxPlane>track->EndPlane ){
01805     if( track->VtxPlane>465 && track->VtxR<1.0 ) return 1;
01806   }
01807 
01808   return 0;
01809 }


Member Data Documentation

Bool_t AtNuEventSelectionAB::fDebug [private]

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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1