TrackFilterBFCalibND Class Reference

#include <TrackFilterBFCalibND.h>

Inheritance diagram for TrackFilterBFCalibND:
TrackFilter

List of all members.

Public Member Functions

 TrackFilterBFCalibND ()
 ~TrackFilterBFCalibND ()
virtual Bool_t Pass (const TrackContext &) const
virtual void Config (const AlgConfig &)

Private Member Functions

Bool_t IsInCoverage (const TrackContext &trackContext) const

Private Attributes

Int_t fNHitsInViewMin
Int_t fEndPlaneMax
Int_t fNPlanesMin
Float_t fEdgeDistanceMin
PlaneOutline fOutline

Detailed Description

Filter that selects only tracks useful for calibrating ND b-field. Requires minimum number of planes, entire track goes through "partial coverage" area and ends in the detector.

Author:
Sergei avva@fnal.gov

Definition at line 22 of file TrackFilterBFCalibND.h.


Constructor & Destructor Documentation

TrackFilterBFCalibND::TrackFilterBFCalibND (  ) 

ctor

Definition at line 41 of file TrackFilterBFCalibND.cxx.

00041                                            :
00042     fNHitsInViewMin(5), 
00043     fEndPlaneMax(115), 
00044     fNPlanesMin(20),
00045     fEdgeDistanceMin(0.25),
00046     fOutline()
00047 {
00048     TracerSA trace("TrackFilterBFCalibND::TrackFilterBFCalibND()");
00049 }

TrackFilterBFCalibND::~TrackFilterBFCalibND (  ) 

dtor

Definition at line 54 of file TrackFilterBFCalibND.cxx.

00055 {
00056     TracerSA trace("TrackFilterBFCalibND::~TrackFilterBFCalibND()");
00057 }


Member Function Documentation

void TrackFilterBFCalibND::Config ( const AlgConfig ac  )  [virtual]

read configuration parameters from AlgConfig

Implements TrackFilter.

Definition at line 140 of file TrackFilterBFCalibND.cxx.

References fEdgeDistanceMin, fEndPlaneMax, fNHitsInViewMin, fNPlanesMin, Registry::GetDouble(), Registry::GetInt(), and Registry::KeyExists().

00141 {
00142     TracerSA trace("TrackFilterBFCalibND::Config(const AlgConfig&)");
00143     
00144     if ( ac.KeyExists("NHitsInViewMin") ) {
00145         fNHitsInViewMin = ac.GetInt("NHitsInViewMin");
00146     }
00147     
00148     if ( ac.KeyExists("FilterBFCalibNDEndPlaneMax") ) {
00149         fEndPlaneMax = ac.GetInt("FilterBFCalibNDEndPlaneMax");
00150     }
00151     
00152     if ( ac.KeyExists("FilterBFCalibNDNPlanesMin") ) {
00153         fNPlanesMin = ac.GetInt("FilterBFCalibNDNPlanesMin");
00154     }
00155     
00156     if ( ac.KeyExists("FilterBFCalibNDEdgeDistanceMin") ) {
00157         fEdgeDistanceMin = ac.GetDouble("FilterBFCalibNDEdgeDistanceMin");
00158     }
00159 }

Bool_t TrackFilterBFCalibND::IsInCoverage ( const TrackContext trackContext  )  const [private]

part of TrackFilterBFCalibND::Pass implementation

check if a given track goes through "partial coverage area" in the ND and that in every plane distance to the edge is greater than fEdgeDistanceMin

Definition at line 96 of file TrackFilterBFCalibND.cxx.

References PlaneOutline::DistanceToEdge(), fEdgeDistanceMin, fOutline, TrackContext::GetBegPlane(), VldContext::GetDetector(), TrackContext::GetEndPlane(), PlexPlaneId::GetPlaneCoverage(), PlexPlaneId::GetPlaneView(), TrackContext::GetU(), TrackContext::GetV(), TrackContext::GetVldContext(), PlaneOutline::IsInside(), PlaneCoverage::kNearPartial, and UgliGeomHandle::uv2xy().

Referenced by Pass().

00097 {
00098     TracerSA trace("TrackFilterBFCalibND::IsInCoverage(const TrackContext&)");
00099     
00100     Int_t beg = trackContext.GetBegPlane();
00101     Int_t end = trackContext.GetEndPlane();
00102 
00103     VldContext vldc = trackContext.GetVldContext();
00104     Detector::Detector_t detector = vldc.GetDetector();
00105          
00106     UgliGeomHandle ugh(vldc);
00107     
00108     Float_t x(0.), y(0.);
00109     Float_t u(0.), v(0.);
00110     Float_t distance(0.), xdistance(0.), ydistance(0.);
00111             
00112     for ( Int_t i = beg; i <= end; ++i) {
00113         PlexPlaneId planeId(detector, i);
00114         
00115         u = trackContext.GetU(i);
00116         v = trackContext.GetV(i);
00117 
00118         // skip test if u or v have not been set by the tracker/fitter
00119         // (their default values then are -99999) or if look obviously
00120         // wrong
00121         if ( fabs(u) > 10. || fabs(v) > 10. ) continue;
00122         
00123         ugh.uv2xy(u, v, x, y);
00124         // fail if track position is outside of "PartialCoverage" area
00125         if ( ! fOutline.IsInside(x, y, planeId.GetPlaneView(), 
00126                         PlaneCoverage::kNearPartial) ) return kFALSE;
00127         // fail if distance to edge is less than allowed
00128         fOutline.DistanceToEdge(x, y, planeId.GetPlaneView(), 
00129                                      planeId.GetPlaneCoverage(),
00130                                      distance, xdistance, ydistance);
00131         if ( distance < fEdgeDistanceMin ) return kFALSE;
00132     }
00133     
00134     return kTRUE;
00135 }                   

Bool_t TrackFilterBFCalibND::Pass ( const TrackContext trackContext  )  const [virtual]

Pass method checks if the track passes cuts used to select good stopping tracks to claibrate ND B-field. If any of the cuts fail this method "short circuits" and returns false

Implements TrackFilter.

Definition at line 64 of file TrackFilterBFCalibND.cxx.

References fEndPlaneMax, fNHitsInViewMin, fNPlanesMin, TrackContext::GetBegPlane(), TrackContext::GetEndPlane(), TrackContext::GetNTrackPlaneU(), TrackContext::GetNTrackPlaneV(), and IsInCoverage().

00065 {
00066     TracerSA trace("TrackFilterBFCalibND::Pass(const TrackContext&)");
00067     
00068     // check if passes #hits cut in both views
00069     if ( trackContext.GetNTrackPlaneU() < fNHitsInViewMin ) return kFALSE;
00070     if ( trackContext.GetNTrackPlaneV() < fNHitsInViewMin ) return kFALSE;
00071     
00072     Int_t beg = trackContext.GetBegPlane();
00073     Int_t end = trackContext.GetEndPlane();
00074     
00075     // beam track cut
00076     if ( beg > end ) return kFALSE;
00077     
00078     // EndPlane cut
00079     if ( end > fEndPlaneMax ) return kFALSE;
00080     
00081     // track length cut
00082     if ( (end-beg+1) < fNPlanesMin ) return kFALSE;
00083                                                              
00084     // track is within partial coverage area in the ND
00085     // (over its whole length)
00086     if ( ! IsInCoverage(trackContext) ) return kFALSE;
00087  
00088     return kTRUE;   
00089 }        


Member Data Documentation

min distance to the edge of ND partial coverage area (as given by PlaneOutline)

Definition at line 61 of file TrackFilterBFCalibND.h.

Referenced by Config(), and IsInCoverage().

max end plane (to select stopping tracks)

Definition at line 50 of file TrackFilterBFCalibND.h.

Referenced by Config(), and Pass().

min # of hit planes per view

Definition at line 45 of file TrackFilterBFCalibND.h.

Referenced by Config(), and Pass().

min acceptable track length in planes

Definition at line 55 of file TrackFilterBFCalibND.h.

Referenced by Config(), and Pass().

PlaneOutline calculates distance from a given point to the detector edges

Definition at line 67 of file TrackFilterBFCalibND.h.

Referenced by IsInCoverage().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1