TrackCam Class Reference

#include <TrackCam.h>

List of all members.

Public Member Functions

 TrackCam (CandSliceHandle *slice)
virtual ~TrackCam ()
CandSliceHandleGetCandSliceHandle () const
int GetBegPlane () const
int GetEndPlane () const
void AddHit (HitCam *hit)
bool ContainsHit (HitCam *hit) const
HitCamGetHit (unsigned int i) const
double GetBegTPos ()
double GetEndTPos ()
double GetDir (int Plane1, int Plane2)
double GetBegDir ()
double GetEndDir ()
double GetBegZPos () const
double GetEndZPos () const
int GetPlaneView () const
unsigned int GetEntries () const
int GetUID () const
void SetUID (int UIDNum)
void SetPartner (TrackCam *objtrk)
TrackCamGetPartner () const

Private Attributes

CandSliceHandlefSlice
int fBegPlane
int fEndPlane
double fBegZ
double fEndZ
int fUID
TrackCamfPartner
int fPlaneView
vector< HitCam * > HitsInTrack

Detailed Description

Definition at line 19 of file TrackCam.h.


Constructor & Destructor Documentation

TrackCam::TrackCam ( CandSliceHandle slice  ) 

Definition at line 19 of file TrackCam.cxx.

00019                                          :
00020   fSlice(0), fBegPlane(999), fEndPlane(-999), fBegZ(999.), fEndZ(-999.),
00021   fUID(0), fPartner(0), fPlaneView(-1)
00022 {
00023   fSlice = slice;
00024 }

TrackCam::~TrackCam (  )  [virtual]

Definition at line 29 of file TrackCam.cxx.

References HitsInTrack.

00030 {
00031   HitsInTrack.clear();
00032 }


Member Function Documentation

void TrackCam::AddHit ( HitCam hit  ) 

Definition at line 37 of file TrackCam.cxx.

References ContainsHit(), fBegPlane, fBegZ, fEndPlane, fEndZ, fPlaneView, GetEntries(), VHS::GetPlane(), HitCam::GetPlane(), HitCam::GetPlaneView(), HitCam::GetZPos(), and HitsInTrack.

Referenced by AlgTrackCamList::ExtendTrack(), AlgTrackCamList::FillGapsInTrack(), AlgTrackCamList::Form3DTracks(), AlgTrackCamList::LookForHitsAcrossGap(), and AlgTrackCamList::MatchUV().

00038 {
00039   if(this->GetEntries()==0) { fPlaneView=hit->GetPlaneView(); }
00040 
00041   if(this->ContainsHit(hit)==true) {return;}
00042   HitsInTrack.push_back(hit);   
00043 
00044   if( fBegPlane > hit->GetPlane()){ fBegPlane = hit->GetPlane(); fBegZ = hit->GetZPos();}
00045   if( fEndPlane < hit->GetPlane()){ fEndPlane = hit->GetPlane(); fEndZ = hit->GetZPos();}
00046 
00047   return;
00048 }

bool TrackCam::ContainsHit ( HitCam hit  )  const

Definition at line 53 of file TrackCam.cxx.

References HitsInTrack.

Referenced by AddHit().

00054 {
00055   for(unsigned int i=0; i<HitsInTrack.size(); ++i) {
00056     if(hit==HitsInTrack[i]) {return true;}
00057   }
00058 
00059   return false;
00060 }

double TrackCam::GetBegDir (  ) 

Definition at line 192 of file TrackCam.cxx.

References fBegPlane, and GetDir().

Referenced by AlgTrackCamList::ExtendTrack(), and AlgTrackCamList::MatchUV().

00193 {
00194   return this->GetDir(fBegPlane,fBegPlane+10);
00195 }

int TrackCam::GetBegPlane (  )  const [inline]
double TrackCam::GetBegTPos (  ) 

Definition at line 74 of file TrackCam.cxx.

References fBegPlane, HitCam::GetPlane(), HitCam::GetTPos(), and HitsInTrack.

Referenced by AlgTrackCamList::ExtendTrack(), AlgTrackCam::ExtractHitProperties(), AlgTrackCamList::LookForHitsAcrossGap(), and AlgTrackCamList::MatchUV().

00075 {
00076   double tot=0.0,begt=0.0;
00077   unsigned int nhits = HitsInTrack.size();
00078 
00079   for(unsigned int i=0; i<nhits; ++i) {
00080     //find the hits on the first plane in the track
00081     HitCam* hit = HitsInTrack[i];
00082 
00083     if(hit->GetPlane()==fBegPlane) {
00084       begt+=hit->GetTPos();
00085       tot+=1.0;
00086     }
00087   }
00088   if(tot>0) return (begt/tot); 
00089   else return 0;
00090 }

double TrackCam::GetBegZPos (  )  const [inline]

Definition at line 38 of file TrackCam.h.

References fBegZ.

Referenced by AlgTrackCamList::ExtendTrack(), AlgTrackCamList::LookForHitsAcrossGap(), and AlgTrackCamList::MatchUV().

00038 {return fBegZ;};

CandSliceHandle* TrackCam::GetCandSliceHandle (  )  const [inline]

Definition at line 25 of file TrackCam.h.

References fSlice.

00025 {return fSlice;};

double TrackCam::GetDir ( int  Plane1,
int  Plane2 
)

Definition at line 116 of file TrackCam.cxx.

References MuELoss::e, HitCam::GetPlane(), HitCam::GetTPos(), HitCam::GetZPos(), and HitsInTrack.

Referenced by GetBegDir(), and GetEndDir().

00117 {
00118   double z=0.0,t=0.0;
00119   double sw=0.0,swx=0.0,swx2=0.0;
00120   double swy=0.0,swyx=0.0;
00121   unsigned int nhits = HitsInTrack.size();
00122 
00123   int Counter=0; int ThisPlane; int LastPlaneAdded=-999;
00124 
00125   for(unsigned int i=0; i<nhits; ++i) {
00126     HitCam* hit = HitsInTrack[i];
00127 
00128     ThisPlane=hit->GetPlane();
00129 
00130     //find the hits in the correct region of the track
00131     if(ThisPlane>=Plane1 && ThisPlane<=Plane2) {
00132       z=hit->GetZPos(); 
00133       t=hit->GetTPos();
00134       sw+=1.0; 
00135       swx+=z; 
00136       swx2+=z*z; 
00137       swy+=t; 
00138       swyx+=t*z;
00139 
00140       Counter++; LastPlaneAdded=ThisPlane;
00141     }
00142   }
00143   
00144 
00145   // If we haven't added enough hits to the straight-line fit.
00146   // Only likely to affect ND track extrapolation.
00148   if(Counter==1) {
00149     HitCam* NextHit = 0;
00150     int MaxPlane=-20; int MinPlane=500;
00151 
00152     if(LastPlaneAdded==Plane1) {
00153       for(unsigned int i=0; i<nhits; ++i) {
00154         HitCam* hit = HitsInTrack[i];
00155         ThisPlane=hit->GetPlane();
00156 
00157         if(ThisPlane>Plane1 && ThisPlane<MinPlane) {MinPlane=ThisPlane; NextHit=hit;}
00158       }
00159     }
00160 
00161     else if(LastPlaneAdded==Plane2) {
00162       for(unsigned int i=0; i<nhits; ++i) {
00163         HitCam* hit = HitsInTrack[i];
00164         ThisPlane=hit->GetPlane();
00165 
00166         if(ThisPlane<Plane2 && ThisPlane>MaxPlane) {MaxPlane=ThisPlane; NextHit=hit;}
00167       }
00168     }
00169 
00170     // Add extra hit to the fit.
00171     if(NextHit) {
00172       z=NextHit->GetZPos(); 
00173       t=NextHit->GetTPos();
00174       sw+=1.0; 
00175       swx+=z; 
00176       swx2+=z*z; 
00177       swy+=t; 
00178       swyx+=t*z;
00179     }
00180   }
00182 
00183   double denom=swx*swx-sw*swx2;
00184   if(fabs(denom)>1.e-10) {return (swx*swy-sw*swyx)/denom;}
00185 
00186   else return 0;
00187 }

double TrackCam::GetEndDir (  ) 

Definition at line 200 of file TrackCam.cxx.

References fEndPlane, and GetDir().

Referenced by AlgTrackCamList::ExtendTrack(), and AlgTrackCamList::MatchUV().

00201 {
00202   return this->GetDir(fEndPlane-10,fEndPlane);
00203 }

int TrackCam::GetEndPlane (  )  const [inline]
double TrackCam::GetEndTPos (  ) 

Definition at line 95 of file TrackCam.cxx.

References fEndPlane, HitCam::GetPlane(), HitCam::GetTPos(), and HitsInTrack.

Referenced by AlgTrackCamList::ExtendTrack(), AlgTrackCam::ExtractHitProperties(), AlgTrackCamList::LookForHitsAcrossGap(), and AlgTrackCamList::MatchUV().

00096 {
00097   double tot=0.0,endt=0.0;
00098   unsigned int nhits = HitsInTrack.size();
00099 
00100   for(unsigned int i=0; i<nhits; ++i) {
00101     //find the hits on the first plane in the track
00102     HitCam* hit = HitsInTrack[i];
00103 
00104     if(hit->GetPlane()==fEndPlane) {
00105       endt+=hit->GetTPos();
00106       tot+=1.0;
00107     }
00108   }
00109   if(tot>0) return (endt/tot); 
00110   else return 0;
00111 }

double TrackCam::GetEndZPos (  )  const [inline]

Definition at line 39 of file TrackCam.h.

References fEndZ.

Referenced by AlgTrackCamList::ExtendTrack(), AlgTrackCamList::LookForHitsAcrossGap(), and AlgTrackCamList::MatchUV().

00039 {return fEndZ;};

unsigned int TrackCam::GetEntries (  )  const [inline]
HitCam * TrackCam::GetHit ( unsigned int  i  )  const

Definition at line 65 of file TrackCam.cxx.

References HitsInTrack.

Referenced by AlgTrackCam::ExtractHitProperties(), AlgTrackCamList::FillGapsInTrack(), AlgTrackCamList::Form3DTracks(), AlgTrackCamList::LookForHitsAcrossGap(), and AlgTrackCamList::MatchUV().

00066 {
00067   if(i<HitsInTrack.size()) {return HitsInTrack[i];}
00068   else {return 0;}
00069 }

TrackCam* TrackCam::GetPartner (  )  const [inline]

Definition at line 47 of file TrackCam.h.

References fPartner.

Referenced by AlgTrackCam::ExtractHitProperties().

00047 {return fPartner;};

int TrackCam::GetPlaneView (  )  const [inline]
int TrackCam::GetUID (  )  const [inline]

Definition at line 43 of file TrackCam.h.

References fUID.

00043 {return fUID;};

void TrackCam::SetPartner ( TrackCam objtrk  )  [inline]

Definition at line 46 of file TrackCam.h.

References fPartner.

Referenced by AlgTrackCamList::Form3DTracks().

00046 {fPartner=objtrk;};

void TrackCam::SetUID ( int  UIDNum  )  [inline]

Definition at line 44 of file TrackCam.h.

References fUID.

00044 {fUID=UIDNum;};


Member Data Documentation

int TrackCam::fBegPlane [private]

Definition at line 52 of file TrackCam.h.

Referenced by AddHit(), GetBegDir(), GetBegPlane(), and GetBegTPos().

double TrackCam::fBegZ [private]

Definition at line 54 of file TrackCam.h.

Referenced by AddHit(), and GetBegZPos().

int TrackCam::fEndPlane [private]

Definition at line 53 of file TrackCam.h.

Referenced by AddHit(), GetEndDir(), GetEndPlane(), and GetEndTPos().

double TrackCam::fEndZ [private]

Definition at line 55 of file TrackCam.h.

Referenced by AddHit(), and GetEndZPos().

Definition at line 57 of file TrackCam.h.

Referenced by GetPartner(), and SetPartner().

int TrackCam::fPlaneView [private]

Definition at line 58 of file TrackCam.h.

Referenced by AddHit(), and GetPlaneView().

Definition at line 47 of file TrackCam.h.

Referenced by GetCandSliceHandle().

int TrackCam::fUID [private]

Definition at line 56 of file TrackCam.h.

Referenced by GetUID(), and SetUID().

vector<HitCam*> TrackCam::HitsInTrack [private]

Definition at line 60 of file TrackCam.h.

Referenced by AddHit(), ContainsHit(), GetBegTPos(), GetDir(), GetEndTPos(), GetEntries(), GetHit(), and ~TrackCam().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1