TrackContext Class Reference

#include <TrackContext.h>

List of all members.

Public Member Functions

 TrackContext (CandContext &trackCandContext)
 ~TrackContext ()
PlexPlaneId GetBegPlaneId () const
Int_t GetBegPlane () const
PlexPlaneId GetEndPlaneId () const
Int_t GetEndPlane () const
Int_t GetNPlanes () const
Int_t GetNTrackPlaneU () const
Int_t GetNTrackPlaneV () const
Int_t GetNTrackPlane () const
VldContext GetVldContext () const
Float_t GetU (Int_t i) const
Float_t GetV (Int_t i) const
Float_t GetPrange () const
Short_t GetDir () const
const CandTrackHandleGetTrackHandle () const
Int_t GetPassSR () const
Double_t GetQPSR () const
Double_t GetEQPSR () const
Double_t GetChi2SR () const
Double_t GetRChi2SR () const
Double_t GetCpuSR () const
Double_t GetUSR () const
Double_t GetUErrorSR () const
Double_t GetVSR () const
Double_t GetVErrorSR () const
Double_t GetDirCosUSR () const
Double_t GetEDirCosUSR () const
Double_t GetDirCosVSR () const
Double_t GetEDirCosVSR () const
Double_t GetDirCosZSR () const
Double_t GetMomentumSR () const
Double_t GetMomentumRangeSR () const
Int_t GetIterationsSR () const
Int_t GetNdofSR () const
Int_t GetEMChargeSR () const
void FillTrackStrips ()
Reco::StripVec_t GetStripVec () const

Private Attributes

const CandTrackHandlefCandTrackHandle
VldContext fVldc
PlexPlaneId fBegPlaneId
PlexPlaneId fEndPlaneId
Short_t fDir
Float_t fPrange
Reco::StripVec_t fStrips

Detailed Description

TrackContext - encapsulates CandTrack context for the fitter.

Author:
Sergei avva@fnal.gov

Definition at line 24 of file TrackContext.h.


Constructor & Destructor Documentation

TrackContext::TrackContext ( CandContext trackCandContext  ) 

default ctor ctor

Definition at line 42 of file TrackContext.cxx.

References fBegPlaneId, fCandTrackHandle, fDir, fEndPlaneId, FillTrackStrips(), fPrange, fVldc, CandRecoHandle::GetBegPlane(), CandContext::GetDataIn(), VldContext::GetDetector(), CandRecoHandle::GetEndPlane(), CandTrackHandle::GetRange(), and CandHandle::GetVldContext().

00042                                                         :
00043     fCandTrackHandle(0), fVldc(), 
00044     fBegPlaneId(), fEndPlaneId(),  
00045     fDir(0), fPrange(0.),
00046     fStrips()
00047 {
00048     TracerSA trace("TrackContext::TrackContext(CandContext&)");
00049     
00050     fCandTrackHandle = dynamic_cast<const CandTrackHandle*> 
00051                                                 (trackCandContext.GetDataIn());
00052     assert(fCandTrackHandle && 
00053             "CandContext is either NULL or not castable to CandTrackHandle!");
00054     
00055     fVldc = *fCandTrackHandle->GetVldContext();
00056     
00057     fBegPlaneId = PlexPlaneId(fVldc.GetDetector(), 
00058                                 fCandTrackHandle->GetBegPlane());
00059     fEndPlaneId = PlexPlaneId(fVldc.GetDetector(), 
00060                                 fCandTrackHandle->GetEndPlane());
00061 
00062     fDir = fEndPlaneId > fBegPlaneId ? 1 : -1;    
00063 
00064     Float_t range = fCandTrackHandle->GetRange();
00065     
00066     // need to ask Alysia where the real range->prange
00067     // conersion function lives and call it here instead
00068     // of doing copy/paste
00069     fPrange = 0.048 + 1.660e-3*range + 3.057e-8*range*range;
00070 
00071     FillTrackStrips();
00072 }

TrackContext::~TrackContext (  ) 

dtor

Definition at line 77 of file TrackContext.cxx.

00078 {
00079     TracerSA trace("TrackContext::~TrackContext()");
00080 }


Member Function Documentation

void TrackContext::FillTrackStrips (  ) 

Definition at line 86 of file TrackContext.cxx.

References fCandTrackHandle, fStrips, and it.

Referenced by TrackContext().

00087 {
00088     typedef const CandStripHandle CSH;
00089     typedef CSH* CSHPtr;
00090     typedef std::vector<CSHPtr>::iterator CSHItr;
00091 
00092     TracerSA trace("TrackContext::FillTrackStrips()");
00093     // convert daughter list to STL vector
00094     std::vector<CSHPtr> stripList(DataUtil::CDL2STLvector<CSH>(*fCandTrackHandle));
00095     for (CSHItr it = stripList.begin(); it != stripList.end(); ++it) {
00096         fStrips.push_back(
00097               Reco::Strip_t(
00098                   new Reco::Strip(  (*it)->GetStrip(),
00099                                     (*it)->GetPlane(),
00100                                     (*it)->GetDemuxVetoFlag(),
00101                                     (*it)->GetPlaneView(),
00102                                     (*it)->GetTPos(),
00103                                     (*it)->GetZPos(),
00104                                     (*it)->GetCharge(),
00105                                     (*it)->GetStripEndId()
00106                                   )
00107                             )
00108                 );
00109     }
00110 }

Int_t TrackContext::GetBegPlane (  )  const [inline]
PlexPlaneId TrackContext::GetBegPlaneId (  )  const [inline]

Definition at line 34 of file TrackContext.h.

References fBegPlaneId.

00034 { return fBegPlaneId; };

Double_t TrackContext::GetChi2SR (  )  const

Definition at line 200 of file TrackContext.cxx.

References fCandTrackHandle, and CandFitTrackHandle::GetChi2().

Referenced by FitContext::FillNtpFitSR().

00201 {
00202     const CandFitTrackHandle* pcfth =
00203         dynamic_cast<const CandFitTrackHandle*> (fCandTrackHandle);
00204     
00205     if ( pcfth ) {
00206         return pcfth->GetChi2();
00207     }
00208     
00209     return 0.0;
00210 }

Double_t TrackContext::GetCpuSR (  )  const

Definition at line 238 of file TrackContext.cxx.

References fCandTrackHandle, and CandFitTrackHandle::GetCPUTime().

Referenced by FitContext::FillNtpFitSR().

00239 {
00240     const CandFitTrackHandle* pcfth =
00241         dynamic_cast<const CandFitTrackHandle*> (fCandTrackHandle);
00242     
00243     if ( pcfth ) {
00244         return pcfth->GetCPUTime();
00245     }
00246     
00247     return 0.0;
00248 }

Short_t TrackContext::GetDir (  )  const [inline]

Definition at line 54 of file TrackContext.h.

References fDir.

Referenced by FitContext::FillNtpFitSA(), and FitContext::MakeNtpFitSA().

00054 { return fDir; };

Double_t TrackContext::GetDirCosUSR (  )  const

Definition at line 318 of file TrackContext.cxx.

References fCandTrackHandle, and CandRecoHandle::GetVtxDirCosU().

Referenced by FitContext::FillNtpFitSR().

00319 {
00320     const CandFitTrackHandle* pcfth =
00321         dynamic_cast<const CandFitTrackHandle*> (fCandTrackHandle);
00322     
00323     if ( pcfth ) {
00324         return pcfth->GetVtxDirCosU();
00325     }
00326     
00327     return 0.0;
00328 }

Double_t TrackContext::GetDirCosVSR (  )  const

Definition at line 350 of file TrackContext.cxx.

References fCandTrackHandle, and CandRecoHandle::GetVtxDirCosV().

Referenced by FitContext::FillNtpFitSR().

00351 {
00352     const CandFitTrackHandle* pcfth =
00353         dynamic_cast<const CandFitTrackHandle*> (fCandTrackHandle);
00354     
00355     if ( pcfth ) {
00356         return pcfth->GetVtxDirCosV();
00357     }
00358     
00359     return 0.0;
00360 }

Double_t TrackContext::GetDirCosZSR (  )  const

Definition at line 382 of file TrackContext.cxx.

References fCandTrackHandle, and CandRecoHandle::GetVtxDirCosZ().

Referenced by FitContext::FillNtpFitSR().

00383 {
00384     const CandFitTrackHandle* pcfth =
00385         dynamic_cast<const CandFitTrackHandle*> (fCandTrackHandle);
00386     
00387     if ( pcfth ) {
00388         return pcfth->GetVtxDirCosZ();
00389     }
00390     
00391     return 0.0;
00392 }

Double_t TrackContext::GetEDirCosUSR (  )  const

Definition at line 334 of file TrackContext.cxx.

References fCandTrackHandle, and CandFitTrackHandle::GetVtxdUError().

Referenced by FitContext::FillNtpFitSR().

00335 {
00336     const CandFitTrackHandle* pcfth =
00337         dynamic_cast<const CandFitTrackHandle*> (fCandTrackHandle);
00338     
00339     if ( pcfth ) {
00340         return pcfth->GetVtxdUError();
00341     }
00342     
00343     return 0.0;
00344 }

Double_t TrackContext::GetEDirCosVSR (  )  const

Definition at line 366 of file TrackContext.cxx.

References fCandTrackHandle, and CandFitTrackHandle::GetVtxdVError().

Referenced by FitContext::FillNtpFitSR().

00367 {
00368     const CandFitTrackHandle* pcfth =
00369         dynamic_cast<const CandFitTrackHandle*> (fCandTrackHandle);
00370     
00371     if ( pcfth ) {
00372         return pcfth->GetVtxdVError();
00373     }
00374     
00375     return 0.0;
00376 }

Int_t TrackContext::GetEMChargeSR (  )  const

Definition at line 462 of file TrackContext.cxx.

References fCandTrackHandle, and CandFitTrackHandle::GetEMCharge().

Referenced by FitContext::FillNtpFitSR().

00463 {
00464     const CandFitTrackHandle* pcfth =
00465         dynamic_cast<const CandFitTrackHandle*> (fCandTrackHandle);
00466     
00467     if ( pcfth ) {
00468         return static_cast<Int_t> (pcfth->GetEMCharge());
00469     }
00470     
00471     return 0;
00472 }

Int_t TrackContext::GetEndPlane (  )  const [inline]
PlexPlaneId TrackContext::GetEndPlaneId (  )  const [inline]

Definition at line 37 of file TrackContext.h.

References fEndPlaneId.

00037 { return fEndPlaneId; };

Double_t TrackContext::GetEQPSR (  )  const

Definition at line 184 of file TrackContext.cxx.

References fCandTrackHandle, and CandFitTrackHandle::GetVtxQPError().

Referenced by FitContext::FillNtpFitSR().

00185 {
00186     const CandFitTrackHandle* pcfth =
00187         dynamic_cast<const CandFitTrackHandle*> (fCandTrackHandle);
00188     
00189     if ( pcfth ) {
00190         return pcfth->GetVtxQPError();
00191     }
00192     
00193     return 0.0;
00194 }

Int_t TrackContext::GetIterationsSR (  )  const

Definition at line 430 of file TrackContext.cxx.

References fCandTrackHandle, and CandFitTrackHandle::GetNIterate().

Referenced by FitContext::FillNtpFitSR().

00431 {
00432     const CandFitTrackHandle* pcfth =
00433         dynamic_cast<const CandFitTrackHandle*> (fCandTrackHandle);
00434     
00435     if ( pcfth ) {
00436         return pcfth->GetNIterate();
00437     }
00438     
00439     return 0;
00440 }

Double_t TrackContext::GetMomentumRangeSR (  )  const

Definition at line 414 of file TrackContext.cxx.

References fCandTrackHandle, and CandFitTrackHandle::GetMomentumRange().

Referenced by FitContext::FillNtpFitSR().

00415 {
00416     const CandFitTrackHandle* pcfth =
00417         dynamic_cast<const CandFitTrackHandle*> (fCandTrackHandle);
00418     
00419     if ( pcfth ) {
00420         return pcfth->GetMomentumRange();
00421     }
00422     
00423     return 0.0;
00424 }

Double_t TrackContext::GetMomentumSR (  )  const

Definition at line 398 of file TrackContext.cxx.

References fCandTrackHandle, and CandFitTrackHandle::GetMomentumCurve().

Referenced by FitContext::FillNtpFitSR().

00399 {
00400     const CandFitTrackHandle* pcfth =
00401         dynamic_cast<const CandFitTrackHandle*> (fCandTrackHandle);
00402     
00403     if ( pcfth ) {
00404         return pcfth->GetMomentumCurve();
00405     }
00406     
00407     return 0.0;
00408 }

Int_t TrackContext::GetNdofSR (  )  const

Definition at line 446 of file TrackContext.cxx.

References fCandTrackHandle, and CandFitTrackHandle::GetNDOF().

Referenced by FitContext::FillNtpFitSR().

00447 {
00448     const CandFitTrackHandle* pcfth =
00449         dynamic_cast<const CandFitTrackHandle*> (fCandTrackHandle);
00450     
00451     if ( pcfth ) {
00452         return pcfth->GetNDOF();
00453     }
00454     
00455     return 0;
00456 }

Int_t TrackContext::GetNPlanes (  )  const [inline]

Definition at line 40 of file TrackContext.h.

References GetBegPlane(), and GetEndPlane().

00041                     { return abs(GetBegPlane() - GetEndPlane()) + 1; };

Int_t TrackContext::GetNTrackPlane (  )  const

Definition at line 135 of file TrackContext.cxx.

References fCandTrackHandle, CandTrackHandle::GetNTrackPlane(), and PlaneView::kUnknown.

00136 {
00137     TracerSA trace("TrackContext::GetNTrackPlane()");    
00138     return fCandTrackHandle->GetNTrackPlane(PlaneView::kUnknown);
00139 }

Int_t TrackContext::GetNTrackPlaneU (  )  const

Definition at line 115 of file TrackContext.cxx.

References fCandTrackHandle, CandTrackHandle::GetNTrackPlane(), and PlaneView::kU.

Referenced by TrackFilterBFCalibFD::Pass(), and TrackFilterBFCalibND::Pass().

00116 {
00117     TracerSA trace("TrackContext::GetNTrackPlaneU()");
00118     return fCandTrackHandle->GetNTrackPlane(PlaneView::kU);
00119 }

Int_t TrackContext::GetNTrackPlaneV (  )  const

Definition at line 125 of file TrackContext.cxx.

References fCandTrackHandle, CandTrackHandle::GetNTrackPlane(), and PlaneView::kV.

Referenced by TrackFilterBFCalibFD::Pass(), and TrackFilterBFCalibND::Pass().

00126 {
00127     TracerSA trace("TrackContext::GetNTrackPlaneV()");
00128     return fCandTrackHandle->GetNTrackPlane(PlaneView::kV);
00129 }

Int_t TrackContext::GetPassSR (  )  const

Definition at line 145 of file TrackContext.cxx.

References fCandTrackHandle, and CandFitTrackHandle::GetPass().

Referenced by FitContext::FillNtpFitSR().

00146 {
00147     const CandFitTrackHandle* pcfth =
00148         dynamic_cast<const CandFitTrackHandle*> (fCandTrackHandle);
00149     
00150     if ( pcfth ) {
00151         return pcfth->GetPass();
00152     }
00153     
00154     return 0;
00155 }

Float_t TrackContext::GetPrange (  )  const [inline]

Definition at line 52 of file TrackContext.h.

References fPrange.

Referenced by FitContext::FillNtpBFieldCalib(), and FitContext::GetPrange().

00052 { return fPrange; };

Double_t TrackContext::GetQPSR (  )  const

Definition at line 161 of file TrackContext.cxx.

References fCandTrackHandle, CandFitTrackHandle::GetEMCharge(), CandFitTrackHandle::GetMomentumCurve(), and ConstFT::TinyNumber.

Referenced by FitContext::FillNtpFitSR().

00162 {
00163     const CandFitTrackHandle* pcfth =
00164         dynamic_cast<const CandFitTrackHandle*> (fCandTrackHandle);
00165     
00166     if ( pcfth ) {
00167         Double_t p  = pcfth->GetMomentumCurve();
00168         Int_t    q  = static_cast<Int_t> (pcfth->GetEMCharge());
00169         
00170         if ( TMath::Abs(p) > TinyNumber ) {
00171             return q/p;
00172         } else {
00173             return -5.;
00174         }
00175     }
00176     
00177     return -5.0;
00178 }

Double_t TrackContext::GetRChi2SR (  )  const

Definition at line 216 of file TrackContext.cxx.

References fCandTrackHandle, CandFitTrackHandle::GetChi2(), CandFitTrackHandle::GetNDOF(), and ConstFT::TinyNumber.

Referenced by FitContext::FillNtpFitSR().

00217 {
00218     const CandFitTrackHandle* pcfth =
00219         dynamic_cast<const CandFitTrackHandle*> (fCandTrackHandle);
00220     
00221     if ( pcfth ) {
00222         Double_t chi2 = pcfth->GetChi2();
00223         Int_t    ndf  = pcfth->GetNDOF();
00224         
00225         if ( TMath::Abs(ndf) > TinyNumber ) {
00226             return chi2/ndf;
00227         } else {
00228             return -1.;
00229         }
00230     }
00231     return -1.0;
00232 }

Reco::StripVec_t TrackContext::GetStripVec (  )  const [inline]

return a copy of the strip list

Definition at line 83 of file TrackContext.h.

References fStrips.

Referenced by DataFT::Fill().

00083 { return fStrips; };

const CandTrackHandle* TrackContext::GetTrackHandle (  )  const [inline]

Definition at line 56 of file TrackContext.h.

References fCandTrackHandle.

Referenced by DataFT::Fill(), and TrackFilterBFCalibFD::Pass().

00056 { return fCandTrackHandle;};

Float_t TrackContext::GetU ( Int_t  i  )  const [inline]

Definition at line 49 of file TrackContext.h.

References fCandTrackHandle, and CandTrackHandle::GetU().

Referenced by TrackFilterBFCalibND::IsInCoverage().

00049 { return fCandTrackHandle->GetU(i); };    

Double_t TrackContext::GetUErrorSR (  )  const

Definition at line 270 of file TrackContext.cxx.

References fCandTrackHandle, and CandFitTrackHandle::GetVtxUError().

Referenced by FitContext::FillNtpFitSR().

00271 {
00272     const CandFitTrackHandle* pcfth =
00273         dynamic_cast<const CandFitTrackHandle*> (fCandTrackHandle);
00274     
00275     if ( pcfth ) {
00276         return pcfth->GetVtxUError();
00277     }
00278     
00279     return 0.0;
00280 }

Double_t TrackContext::GetUSR (  )  const

Definition at line 254 of file TrackContext.cxx.

References fCandTrackHandle, and CandRecoHandle::GetVtxU().

Referenced by FitContext::FillNtpFitSR().

00255 {
00256     const CandFitTrackHandle* pcfth =
00257         dynamic_cast<const CandFitTrackHandle*> (fCandTrackHandle);
00258     
00259     if ( pcfth ) {
00260         return pcfth->GetVtxU();
00261     }
00262     
00263     return 0.0;
00264 }

Float_t TrackContext::GetV ( Int_t  i  )  const [inline]

Definition at line 50 of file TrackContext.h.

References fCandTrackHandle, and CandTrackHandle::GetV().

Referenced by TrackFilterBFCalibND::IsInCoverage().

00050 { return fCandTrackHandle->GetV(i); };    

Double_t TrackContext::GetVErrorSR (  )  const

Definition at line 302 of file TrackContext.cxx.

References fCandTrackHandle, and CandFitTrackHandle::GetVtxVError().

Referenced by FitContext::FillNtpFitSR().

00303 {
00304     const CandFitTrackHandle* pcfth =
00305         dynamic_cast<const CandFitTrackHandle*> (fCandTrackHandle);
00306     
00307     if ( pcfth ) {
00308         return pcfth->GetVtxVError();
00309     }
00310     
00311     return 0.0;
00312 }

VldContext TrackContext::GetVldContext (  )  const [inline]

Definition at line 47 of file TrackContext.h.

References fVldc.

Referenced by DataFT::Init(), TrackFilterBFCalibND::IsInCoverage(), TrackFilterBFCalibFD::Pass(), and AlgFitTrackSA::RunAlg().

00047 { return fVldc; };

Double_t TrackContext::GetVSR (  )  const

Definition at line 286 of file TrackContext.cxx.

References fCandTrackHandle, and CandRecoHandle::GetVtxV().

Referenced by FitContext::FillNtpFitSR().

00287 {
00288     const CandFitTrackHandle* pcfth =
00289         dynamic_cast<const CandFitTrackHandle*> (fCandTrackHandle);
00290     
00291     if ( pcfth ) {
00292         return pcfth->GetVtxV();
00293     }
00294     
00295     return 0.0;
00296 }


Member Data Documentation

first plane of the track

Definition at line 100 of file TrackContext.h.

Referenced by GetBegPlane(), GetBegPlaneId(), and TrackContext().

Short_t TrackContext::fDir [private]

track direction either 1 - along z axis (begplane < endplane) or -1 - against z axis (begplane > endplane)

Definition at line 110 of file TrackContext.h.

Referenced by GetDir(), and TrackContext().

last plane of the track

Definition at line 104 of file TrackContext.h.

Referenced by GetEndPlane(), GetEndPlaneId(), and TrackContext().

Float_t TrackContext::fPrange [private]

track momentum from range

Definition at line 115 of file TrackContext.h.

Referenced by GetPrange(), and TrackContext().

vector of strips (to make it easier to convert to use ntuples)

Definition at line 120 of file TrackContext.h.

Referenced by FillTrackStrips(), and GetStripVec().

pointer to validity context of the track

Definition at line 95 of file TrackContext.h.

Referenced by GetVldContext(), and TrackContext().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1