Track2DSR Class Reference

#include <Track2DSR.h>

List of all members.

Public Member Functions

 Track2DSR ()
 Track2DSR (TrackClusterSR *)
 Track2DSR (const Track2DSR &rhs)
virtual ~Track2DSR ()
Bool_t operator== (const Track2DSR &rhs) const
void Add (TrackClusterSR *tcluster, Double_t slope)
void Clear (Option_t *option="")
void Compress ()
Track2DSRDup ()
Bool_t IsBad () const
Bool_t IsEquivalent (const TObject *rhs) const
void RemoveAt (Int_t)
Double_t GetBackwardSlope (Int_t i)
Int_t GetBegPlane () const
Double_t GetChi2 ()
TrackClusterSRGetCluster (Int_t i) const
Int_t GetDirection () const
Int_t GetEndPlane () const
Double_t GetForwardSlope (Int_t i) const
Bool_t GetHoughExist () const
Double_t GetHoughIntercept () const
Double_t GetHoughSlope () const
Int_t GetLast () const
PlaneView::PlaneView_t GetPlaneView () const
Double_t GetSlope (Int_t i)
Double_t GetT0 () const
Double_t GetTPos0 () const
Double_t GetZ0 () const
Bool_t IsFocussed () const
void SetCluster (TrackClusterSR *tcluster, Double_t slope, Int_t indx)
void SetDirection (Int_t idir)
void SetHoughIntercept (Double_t inter)
void SetHoughSlope (Double_t slope)
void SetIsBad (Bool_t isBad)

Public Attributes

Int_t fIterate

Private Member Functions

void CalculateBackwardSlope ()

Private Attributes

Bool_t fIsBad
TObjArray fTrkClsSlp
Double_t fChi2
Double_t fZ0
Double_t fTPos0
Double_t fT0
Double_t fCharge
Bool_t fModified
Double_t fParmTrack2DSlopeWeight
Double_t fParmTrk2DAlpha
Int_t fDir
Double_t fHoughSlope
Double_t fHoughInter
Bool_t fHoughExist

Detailed Description

Definition at line 20 of file Track2DSR.h.


Constructor & Destructor Documentation

Track2DSR::Track2DSR (  ) 

Definition at line 30 of file Track2DSR.cxx.

Referenced by Dup().

00031 {
00032   fIterate = 0;
00033   fZ0 = 0.;
00034   fTPos0 = 0.;
00035   fT0 = 0.;
00036   fCharge = 0.;
00037   fModified = 0;
00038   fParmTrack2DSlopeWeight = -0.25;
00039   fParmTrk2DAlpha = .4;               // cosmics, use .8 for non cosmics
00040   fDir = 1;
00041   fHoughExist = kFALSE;
00042   fHoughSlope = 0.;
00043   fHoughInter = 0.;
00044   fIsBad = false;
00045   fChi2 = -1;
00046 }

Track2DSR::Track2DSR ( TrackClusterSR tcluster  ) 

Definition at line 49 of file Track2DSR.cxx.

References Add(), fCharge, fChi2, fDir, fHoughExist, fHoughInter, fHoughSlope, fIsBad, fIterate, fParmTrack2DSlopeWeight, fParmTrk2DAlpha, fT0, fTPos0, fTrkClsSlp, and fZ0.

00050 {
00051   fTrkClsSlp.Clear();
00052   fIterate = 0;
00053   fZ0 = 0.;
00054   fTPos0 = 0.;
00055   fT0 = 0.;
00056   fCharge = 0.;
00057   Add(tcluster,0.);
00058   fParmTrack2DSlopeWeight = -0.25;
00059   fParmTrk2DAlpha = .4;               // cosmics, use .8 for non cosmics
00060   fDir = 1;
00061   fHoughExist = kFALSE;
00062   fHoughSlope = 0.;
00063   fHoughInter = 0.;
00064   fIsBad = false;
00065   fChi2 = -1;
00066 }

Track2DSR::Track2DSR ( const Track2DSR rhs  ) 

Definition at line 69 of file Track2DSR.cxx.

References fTrkClsSlp.

00069                                          :    // Real copy-constructor
00070   TObject(rhs)
00071 , fIterate(rhs.fIterate)
00072 , fIsBad(rhs.fIsBad)
00073 , fChi2(rhs.fChi2)
00074 , fZ0(rhs.fZ0)
00075 , fTPos0(rhs.fTPos0)
00076 , fT0(rhs.fT0)
00077 , fCharge(rhs.fCharge)
00078 , fModified(rhs.fModified)
00079 , fParmTrack2DSlopeWeight(rhs.fParmTrack2DSlopeWeight)
00080 , fParmTrk2DAlpha(rhs.fParmTrk2DAlpha)
00081 , fDir(rhs.fDir)
00082 , fHoughSlope(rhs.fHoughSlope)
00083 , fHoughInter(rhs.fHoughInter)
00084 , fHoughExist(rhs.fHoughExist)
00085 {
00086 
00087 // Copy TObjArray's contents
00088   TIter rhsIter(&rhs.fTrkClsSlp);
00089   TObject *rhsObj;
00090   while ((rhsObj = rhsIter())) {
00091     TrkClsSlpSR *tcsObj;
00092     if ((tcsObj = dynamic_cast<TrkClsSlpSR*>(rhsObj))) {
00093       TrkClsSlpSR *newObj = new TrkClsSlpSR(*tcsObj);
00094       fTrkClsSlp.Add(newObj);
00095     }
00096   }
00097 }

Track2DSR::~Track2DSR (  )  [virtual]

Definition at line 100 of file Track2DSR.cxx.

References fTrkClsSlp.

00101 {
00102   for (Int_t i=0; i<=fTrkClsSlp.GetLast(); i++) {
00103     TrkClsSlpSR *tcs = dynamic_cast<TrkClsSlpSR*>(fTrkClsSlp.At(i));
00104     if (tcs) {
00105       delete tcs;
00106     }
00107   }
00108 }


Member Function Documentation

void Track2DSR::Add ( TrackClusterSR tcluster,
Double_t  slope 
)

Definition at line 152 of file Track2DSR.cxx.

References Mphysical::c_light, fCharge, fDir, fModified, fT0, fTPos0, TrkClsSlpSR::fTrackCluster, fTrkClsSlp, fZ0, TrackClusterSR::GetBegTime(), TrackClusterSR::GetCharge(), CandStripHandle::GetStripEndId(), TrackClusterSR::GetStripList(), CandStripHandle::GetTPos(), TrackClusterSR::GetTPos(), CandHandle::GetVldContext(), UgliPlnHandle::GetZ0(), TrackClusterSR::GetZPos(), TrkClsSlpSR::SetBackwardSlope(), TrkClsSlpSR::SetForwardSlope(), and TrkClsSlpSR::SetIndex().

Referenced by AlgTrackSRList::AddBestPlaneClusterToTrack(), AlgTrackSRList::FillInGaps(), AlgTrackSRList::FillTrackList(), AlgTrackSRList::MergeTracks(), AlgTrackSRList::SpectrometerTracking(), and Track2DSR().

00153 {
00154 
00155   fModified = 1;
00156   CandStripHandle *strip = dynamic_cast<CandStripHandle*>
00157     (tcluster->GetStripList()->First());
00158   UgliGeomHandle ugh(*strip->GetVldContext());
00159   PlexStripEndId stripid = strip->GetStripEndId();
00160   UgliScintPlnHandle planehandle = ugh.GetScintPlnHandle(stripid);
00161   Bool_t found(0);
00162   if (fTrkClsSlp.GetLast()<0) {
00163     fZ0 = planehandle.GetZ0();
00164     fTPos0 = strip->GetTPos();
00165   }
00166   else {
00167     for (Int_t i=0; i<=fTrkClsSlp.GetLast(); i++) {
00168       TrkClsSlpSR *tcs = dynamic_cast<TrkClsSlpSR*>(fTrkClsSlp.At(i));
00169       if (fDir*tcs->fTrackCluster->GetZPos()<fDir*fZ0) {
00170         fZ0 = planehandle.GetZ0();
00171         fTPos0 = tcs->fTrackCluster->GetTPos();
00172         found = 1;
00173       }
00174     }
00175     if (fDir*planehandle.GetZ0()<fDir*fZ0) {
00176       fZ0 = planehandle.GetZ0();
00177       fTPos0 = strip->GetTPos();
00178       found = 1;
00179     }
00180   }
00181   Bool_t foundbef(1);
00182   Int_t ibef=0;
00183   for (Int_t i=0; i<=fTrkClsSlp.GetLast() && foundbef; i++) {
00184     TrkClsSlpSR *tcs = dynamic_cast<TrkClsSlpSR*>(fTrkClsSlp.At(i));
00185     if (fDir*tcs->fTrackCluster->GetZPos()>fDir*planehandle.GetZ0()) {
00186       foundbef = 0;
00187     }
00188     ibef = i;
00189   }
00190   TrkClsSlpSR *tcsnew = new TrkClsSlpSR(tcluster);
00191   tcsnew->SetForwardSlope(slope);
00192   tcsnew->SetBackwardSlope(0.);
00193   tcsnew->SetIndex(1);
00194   if (!foundbef) {
00195     TrkClsSlpSR *lasttc =
00196         dynamic_cast<TrkClsSlpSR*>(fTrkClsSlp.At(fTrkClsSlp.GetLast()));
00197     fTrkClsSlp.Add(lasttc);
00198     for (int i=fTrkClsSlp.GetLast()-1; i>ibef; i--) {
00199       fTrkClsSlp[i] = fTrkClsSlp[i-1];
00200     }
00201     fTrkClsSlp[ibef] = tcsnew;
00202   } else {
00203     fTrkClsSlp.Add(tcsnew);
00204   }
00205   if (!found) {
00206     fT0 += (tcluster->GetBegTime()-(planehandle.GetZ0()-fZ0) /
00207                               Mphysical::c_light)*tcluster->GetCharge();
00208   }
00209   else {
00210 // vertex changed, need to recalculate
00211     fT0 = 0.;
00212     for (Int_t i=0; i<=fTrkClsSlp.GetLast(); i++) {
00213       TrkClsSlpSR *tcs = dynamic_cast<TrkClsSlpSR*>(fTrkClsSlp.At(i));
00214       strip = dynamic_cast<CandStripHandle*>
00215         (tcs->fTrackCluster->GetStripList()->First());
00216       stripid = strip->GetStripEndId();
00217       planehandle = ugh.GetScintPlnHandle(stripid);
00218       fT0 +=
00219            (tcs->fTrackCluster->GetBegTime()-(planehandle.GetZ0()-fZ0) /
00220                     Mphysical::c_light)*tcs->fTrackCluster->GetCharge();
00221     }
00222   }
00223   fCharge += tcluster->GetCharge();
00224 }

void Track2DSR::CalculateBackwardSlope (  )  [private]

Definition at line 227 of file Track2DSR.cxx.

References fModified, fParmTrk2DAlpha, TrkClsSlpSR::fTrackCluster, fTrkClsSlp, TrkClsSlpSR::GetBackwardSlope(), GetEndPlane(), TrackClusterSR::GetPlane(), TrackClusterSR::GetTPos(), TrackClusterSR::GetZPos(), and TrkClsSlpSR::SetBackwardSlope().

Referenced by GetBackwardSlope(), and GetChi2().

00228 {
00229   fModified = 0;
00230   Int_t endplane = GetEndPlane();
00231   for (Int_t i=fTrkClsSlp.GetLast(); i>=0; i--) {
00232     TrkClsSlpSR *tcs = dynamic_cast<TrkClsSlpSR*>(fTrkClsSlp.At(i));
00233     if (tcs->fTrackCluster->GetPlane()==endplane) {
00234       tcs->SetBackwardSlope(0.);
00235     }
00236     else {
00237       Double_t slope=0.;
00238       TrkClsSlpSR *tcs0 =
00239                          dynamic_cast<TrkClsSlpSR*>(fTrkClsSlp.At(i+1));
00240       slope =
00241         (tcs->fTrackCluster->GetTPos()-tcs0->fTrackCluster->GetTPos()) /
00242         (tcs->fTrackCluster->GetZPos()-tcs0->fTrackCluster->GetZPos());
00243       if (i<fTrkClsSlp.GetLast()-1) {
00244         slope =
00245         (1.-fParmTrk2DAlpha)*slope+fParmTrk2DAlpha*tcs0->GetBackwardSlope();
00246       }
00247       tcs->SetBackwardSlope(slope);
00248     }
00249   }
00250 }

void Track2DSR::Clear ( Option_t *  option = ""  ) 

Definition at line 253 of file Track2DSR.cxx.

References fCharge, fModified, fT0, fTPos0, fTrkClsSlp, and fZ0.

00254 {
00255   for (Int_t i=0; i<=fTrkClsSlp.GetLast(); i++) {
00256     TrkClsSlpSR *tcs = dynamic_cast<TrkClsSlpSR*>(fTrkClsSlp.At(i));
00257     delete tcs;
00258   }
00259   fTrkClsSlp.Clear();
00260   fZ0 = 0.;
00261   fTPos0 = 0.;
00262   fT0 = 0.;
00263   fCharge = 0.;
00264   fModified = 0;
00265 }

void Track2DSR::Compress (  ) 
Track2DSR * Track2DSR::Dup (  ) 

Definition at line 274 of file Track2DSR.cxx.

References Track2DSR().

Referenced by AlgTrackSR::RunAlg().

00275 {
00276   Track2DSR *newtrack = new Track2DSR(*this);
00277   return newtrack;
00278 }

Double_t Track2DSR::GetBackwardSlope ( Int_t  i  ) 

Definition at line 350 of file Track2DSR.cxx.

References CalculateBackwardSlope(), fModified, fTrkClsSlp, and TrkClsSlpSR::GetBackwardSlope().

Referenced by GetSlope().

00351 {
00352   if (fModified) {
00353     CalculateBackwardSlope();
00354   }
00355   TrkClsSlpSR *tcs = dynamic_cast<TrkClsSlpSR*>(fTrkClsSlp.At(i));
00356   return tcs->GetBackwardSlope();
00357   
00358 }

Int_t Track2DSR::GetBegPlane (  )  const
Double_t Track2DSR::GetChi2 (  ) 

Definition at line 374 of file Track2DSR.cxx.

References CalculateBackwardSlope(), fChi2, fModified, TrkClsSlpSR::fTrackCluster, fTrkClsSlp, GetSlope(), TrackClusterSR::GetTPos(), TrackClusterSR::GetTPosError(), and TrackClusterSR::GetZPos().

Referenced by AlgTrackSRList::DeleteTwinTracks(), and AlgTrackSRList::RemoveTrackSubsets().

00375 {
00376   fChi2 = 0.;
00377   if (fModified) {
00378     CalculateBackwardSlope();
00379   }
00380   for (Int_t i=0; i<fTrkClsSlp.GetLast(); i++) {
00381     TrkClsSlpSR *tcs0 = dynamic_cast<TrkClsSlpSR*>(fTrkClsSlp.At(i));
00382     TrkClsSlpSR *tcs1 = dynamic_cast<TrkClsSlpSR*>(fTrkClsSlp.At(i+1));
00383     if(tcs1->fTrackCluster->GetTPosError()!=0){
00384      Double_t slope = GetSlope(i);
00385      Double_t dzpos = tcs1->fTrackCluster->GetZPos()-
00386                       tcs0->fTrackCluster->GetZPos();
00387      Double_t tpos = tcs0->fTrackCluster->GetTPos()+dzpos*slope;
00388      Double_t dtpos = tpos-tcs1->fTrackCluster->GetTPos();
00389      fChi2 += (dtpos*dtpos)/(tcs1->fTrackCluster->GetTPosError()*tcs1->fTrackCluster->GetTPosError());
00390     }
00391   }
00392   
00393   //  cout << " track chi2 " << fChi2/(fTrkClsSlp.GetLast()+1) << endl;
00394   return fChi2;
00395 }

TrackClusterSR * Track2DSR::GetCluster ( Int_t  i  )  const
Int_t Track2DSR::GetDirection (  )  const

Definition at line 406 of file Track2DSR.cxx.

References fDir.

Referenced by AlgTrackSR::RunAlg().

00407 {
00408   return fDir;
00409 }

Int_t Track2DSR::GetEndPlane (  )  const

Definition at line 412 of file Track2DSR.cxx.

References fDir, TrkClsSlpSR::fTrackCluster, fTrkClsSlp, and TrackClusterSR::GetPlane().

Referenced by CalculateBackwardSlope(), AlgTrackSRList::FillInGaps(), AlgTrackSR::FindTimingDirection(), AlgTrackSRList::FormCandTrackSR(), AlgTrackSRList::IdentifyBadTracks(), AlgTrackSRList::RemoveTrackSubsets(), and AlgTrackSRList::SpectrometerTracking().

00413 {
00414   Int_t plane=0;
00415   for (Int_t i=0; i<=fTrkClsSlp.GetLast(); i++) {
00416     TrkClsSlpSR *tcs = dynamic_cast<TrkClsSlpSR*>(fTrkClsSlp.At(i));
00417     if (!i || fDir*tcs->fTrackCluster->GetPlane()>fDir*plane) {
00418       plane = tcs->fTrackCluster->GetPlane();
00419     }
00420   }
00421   return plane;
00422 }

Double_t Track2DSR::GetForwardSlope ( Int_t  i  )  const
Bool_t Track2DSR::GetHoughExist (  )  const
Double_t Track2DSR::GetHoughIntercept (  )  const

Definition at line 438 of file Track2DSR.cxx.

References fHoughExist, and fHoughInter.

Referenced by CandTrackSRHandle::GetHoughResid2().

00439 {
00440   if (!fHoughExist) {
00441     return -9999999.;
00442   }
00443   return fHoughInter;
00444 }

Double_t Track2DSR::GetHoughSlope (  )  const
Int_t Track2DSR::GetLast (  )  const
PlaneView::PlaneView_t Track2DSR::GetPlaneView (  )  const

Definition at line 462 of file Track2DSR.cxx.

References TrkClsSlpSR::fTrackCluster, fTrkClsSlp, TrackClusterSR::GetPlaneView(), and PlaneView::kUnknown.

Referenced by AlgTrackSRList::FillInGaps(), KeyOnUViewTracks(), KeyOnVViewTracks(), AlgTrackSRList::MergeTracks(), AlgTrackSR::RunAlg(), and AlgTrackSRList::RunAlg().

00463 {
00464   if (fTrkClsSlp.GetLast()<0) {
00465     return PlaneView::kUnknown;
00466   }
00467   TrkClsSlpSR *firstcluster =
00468                          dynamic_cast<TrkClsSlpSR*>(fTrkClsSlp.First());
00469   return firstcluster->fTrackCluster->GetPlaneView();
00470 }

Double_t Track2DSR::GetSlope ( Int_t  i  ) 

Definition at line 473 of file Track2DSR.cxx.

References fParmTrack2DSlopeWeight, GetBackwardSlope(), GetForwardSlope(), and GetLast().

Referenced by AlgTrackSR::FindNeighborIndex(), AlgTrackSR::FindStripsInTrack(), and GetChi2().

00474 {
00475 
00476 //  TrkClsSlpSR *tcs = dynamic_cast<TrkClsSlpSR*>(fTrkClsSlp.At(i));
00477 //  Double_t slopef = tcs->GetForwardSlope();
00478 //  Double_t slopeb = tcs->fBackwardSlope;
00479   Double_t slopef = GetForwardSlope(i);
00480   Double_t slopeb = GetBackwardSlope(i);
00481   Double_t slopefw = 1.-exp(fParmTrack2DSlopeWeight*(Double_t)(i));
00482   Double_t slopebw =
00483                 1.-exp(fParmTrack2DSlopeWeight*(Double_t)(GetLast()-i));
00484   if (i==0 && GetLast()==0) {
00485     return slopef;
00486   } else {
00487     return (slopef*slopefw+slopeb*slopebw)/(slopefw+slopebw);
00488   }
00489 }

Double_t Track2DSR::GetT0 (  )  const

Definition at line 492 of file Track2DSR.cxx.

References fCharge, and fT0.

Referenced by AlgTrackSRList::FormCandTrackSR(), and AlgTrackSRList::IsBestClusterInPlane().

00493 {
00494   return fT0/fCharge;
00495 }

Double_t Track2DSR::GetTPos0 (  )  const

Definition at line 498 of file Track2DSR.cxx.

References fTPos0.

00499 {
00500   return fTPos0;
00501 }

Double_t Track2DSR::GetZ0 (  )  const

Definition at line 504 of file Track2DSR.cxx.

References fZ0.

Referenced by AlgTrackSRList::IsBestClusterInPlane().

00505 {
00506   return fZ0;
00507 }

Bool_t Track2DSR::IsBad (  )  const
Bool_t Track2DSR::IsEquivalent ( const TObject *  rhs  )  const

Definition at line 287 of file Track2DSR.cxx.

00288 {
00289   const Track2DSR *rTrack = dynamic_cast<const Track2DSR*>(rhs);
00290   return (*this) == (*rTrack);
00291 }

Bool_t Track2DSR::IsFocussed (  )  const

Definition at line 588 of file Track2DSR.cxx.

References TrkClsSlpSR::fTrackCluster, fTrkClsSlp, TrackClusterSR::GetTPos(), and TrackClusterSR::GetZPos().

00589 {
00590   TrkClsSlpSR *tcs0 = dynamic_cast<TrkClsSlpSR*>(fTrkClsSlp.At(0));
00591   TrkClsSlpSR *tcs1 = dynamic_cast<TrkClsSlpSR*>(fTrkClsSlp.At(fTrkClsSlp.GetLast()));
00592   Int_t idir=1;
00593   if(tcs0->fTrackCluster->GetZPos()>tcs1->fTrackCluster->GetZPos())idir=-1;
00594   Int_t nfocus=0;
00595   for (Int_t i=0; i<fTrkClsSlp.GetLast()-1; i++) {
00596     tcs0 = dynamic_cast<TrkClsSlpSR*>(fTrkClsSlp.At(i));
00597     tcs1 = dynamic_cast<TrkClsSlpSR*>(fTrkClsSlp.At(i+1));
00598     TrkClsSlpSR *tcs2 =dynamic_cast<TrkClsSlpSR*>(fTrkClsSlp.At(i+2));
00599     if(idir==-1){
00600       tcs0 = dynamic_cast<TrkClsSlpSR*>(fTrkClsSlp.At(i+2));
00601       tcs2 =dynamic_cast<TrkClsSlpSR*>(fTrkClsSlp.At(i));
00602     }
00603     Double_t tslope =  (tcs1->fTrackCluster->GetTPos()-tcs0->fTrackCluster->GetTPos())/(tcs1->fTrackCluster->GetZPos()-tcs0->fTrackCluster->GetZPos());
00604     Double_t textrap = tcs1->fTrackCluster->GetTPos() + tslope*(tcs2->fTrackCluster->GetZPos()-tcs1->fTrackCluster->GetZPos());
00605     if(TMath::Abs(textrap) - TMath::Abs(tcs2->fTrackCluster->GetTPos())>=0){
00606       nfocus++;
00607     }
00608     else{
00609       nfocus--;
00610     } 
00611   }
00612   if(nfocus>=0) return true;
00613   return false;
00614 }

Bool_t Track2DSR::operator== ( const Track2DSR rhs  )  const

Definition at line 111 of file Track2DSR.cxx.

References fCharge, fChi2, fDir, fHoughExist, fHoughInter, fHoughSlope, fIsBad, fIterate, fModified, fParmTrack2DSlopeWeight, fParmTrk2DAlpha, fTPos0, fTrkClsSlp, fZ0, and TrkClsSlpSR::IsEquivalent().

00112 {
00113 
00114 // compare simple members
00115   if ( !(this->fIterate    == rhs.fIterate    &&
00116          this->fIsBad      == rhs.fIsBad      &&
00117          this->fChi2       == rhs.fChi2       &&
00118          this->fZ0         == rhs.fZ0         &&
00119          this->fTPos0      == rhs.fTPos0      &&
00120          this->fCharge     == rhs.fCharge     &&
00121          this->fModified   == rhs.fModified   &&
00122          this->fParmTrack2DSlopeWeight == rhs.fParmTrack2DSlopeWeight &&
00123          this->fParmTrk2DAlpha         == rhs.fParmTrk2DAlpha         &&
00124          this->fDir        == rhs.fDir        &&
00125          this->fHoughSlope == rhs.fHoughSlope &&
00126          this->fHoughInter == rhs.fHoughInter &&
00127          this->fHoughExist == rhs.fHoughExist )) {
00128     return false;
00129   }
00130 
00131 // compare TObjArray
00132   if (this->fTrkClsSlp.GetEntries() != rhs.fTrkClsSlp.GetEntries()) {
00133     return false;
00134   }
00135   else {
00136     TIter thisIter(&this->fTrkClsSlp);
00137     TIter rhsIter(&rhs.fTrkClsSlp);
00138     TObject *thisObj, *rhsObj;
00139     while ( ( (thisObj = thisIter.Next() ) != NULL) &&
00140             ( (rhsObj  = rhsIter.Next()  ) != NULL)    ) {
00141       TrkClsSlpSR *thisTCS = dynamic_cast<TrkClsSlpSR*>(thisObj); 
00142       TrkClsSlpSR *rhsTCS  = dynamic_cast<TrkClsSlpSR*>(rhsObj);
00143       if (!thisTCS->IsEquivalent(rhsTCS)) {
00144         return false;
00145       }
00146     }
00147   }
00148   return true;
00149 }

void Track2DSR::RemoveAt ( Int_t  indx  ) 

Definition at line 294 of file Track2DSR.cxx.

References Mphysical::c_light, fCharge, fDir, fModified, fT0, fTPos0, TrkClsSlpSR::fTrackCluster, fTrkClsSlp, fZ0, TrackClusterSR::GetBegTime(), TrackClusterSR::GetCharge(), CandStripHandle::GetStripEndId(), TrackClusterSR::GetStripList(), TrackClusterSR::GetTPos(), CandHandle::GetVldContext(), UgliPlnHandle::GetZ0(), and TrackClusterSR::GetZPos().

Referenced by AlgTrackSRList::AddClustersToTracks(), AlgTrackSRList::CheckForBadClusters(), AlgTrackSRList::CleanUp(), AlgTrackSRList::FillInGaps(), AlgTrackSRList::FillTrackList(), AlgTrackSRList::IdentifyBadTracks(), AlgTrackSRList::MergeTracks(), and AlgTrackSRList::SpectrometerTracking().

00295 {
00296   fModified = 1;
00297   TrkClsSlpSR *tcsold = dynamic_cast<TrkClsSlpSR*>(fTrkClsSlp.At(indx));
00298   CandStripHandle *strip = dynamic_cast<CandStripHandle*>
00299     (tcsold->fTrackCluster->GetStripList()->First());
00300   UgliGeomHandle ugh(*strip->GetVldContext());
00301   PlexStripEndId stripid = strip->GetStripEndId();
00302   UgliScintPlnHandle planehandle = ugh.GetScintPlnHandle(stripid);
00303   Bool_t found(0);
00304   if (planehandle.GetZ0()==fZ0) {
00305     found = 1;
00306   }
00307 
00308   fTrkClsSlp.RemoveAt(indx);
00309   fTrkClsSlp.Compress();
00310   if (!found) {
00311     fT0 -=
00312         (tcsold->fTrackCluster->GetBegTime()-(planehandle.GetZ0()-fZ0) /
00313                  Mphysical::c_light)*tcsold->fTrackCluster->GetCharge();
00314   }
00315   else {
00316 
00317 // vertex changed, need to recalculate
00318     fT0 = 0.;
00319     fZ0 = 0.;
00320     fTPos0 = 0.;
00321     Bool_t first(1);
00322     for (Int_t i=0; i<=fTrkClsSlp.GetLast(); i++) {
00323       TrkClsSlpSR *tcs = dynamic_cast<TrkClsSlpSR*>(fTrkClsSlp.At(i));
00324       if (tcsold !=
00325         tcs && (first || fDir*tcs->fTrackCluster->GetZPos()<fDir*fZ0)) {
00326         first = 0;
00327         fZ0 = tcs->fTrackCluster->GetZPos();
00328         fTPos0 = tcs->fTrackCluster->GetTPos();
00329       }
00330     }
00331     for (Int_t i=0; i<=fTrkClsSlp.GetLast(); i++) {
00332       TrkClsSlpSR *tcs = dynamic_cast<TrkClsSlpSR*>(fTrkClsSlp.At(i));
00333       if (tcsold != tcs) {
00334         strip = dynamic_cast<CandStripHandle*>
00335           (tcs->fTrackCluster->GetStripList()->First());
00336         stripid = strip->GetStripEndId();
00337         planehandle = ugh.GetScintPlnHandle(stripid);
00338         fT0 +=
00339            (tcs->fTrackCluster->GetBegTime()-(planehandle.GetZ0()-fZ0) /
00340                     Mphysical::c_light)*tcs->fTrackCluster->GetCharge();
00341       }
00342     }
00343   }
00344   fCharge -= tcsold->fTrackCluster->GetCharge();
00345   delete tcsold;
00346 
00347 }

void Track2DSR::SetCluster ( TrackClusterSR tcluster,
Double_t  slope,
Int_t  indx 
)

Definition at line 510 of file Track2DSR.cxx.

References Mphysical::c_light, fCharge, fDir, fModified, fT0, fTPos0, TrkClsSlpSR::fTrackCluster, fTrkClsSlp, fZ0, TrackClusterSR::GetBegTime(), TrackClusterSR::GetCharge(), CandStripHandle::GetStripEndId(), TrackClusterSR::GetStripList(), CandStripHandle::GetTPos(), TrackClusterSR::GetTPos(), CandHandle::GetVldContext(), UgliPlnHandle::GetZ0(), TrackClusterSR::GetZPos(), TrkClsSlpSR::SetBackwardSlope(), TrkClsSlpSR::SetForwardSlope(), and TrkClsSlpSR::SetIndex().

00512 {
00513   fModified = 1;
00514   CandStripHandle *strip = dynamic_cast<CandStripHandle*>
00515     (tcluster->GetStripList()->First());
00516   UgliGeomHandle ugh(*strip->GetVldContext());
00517   PlexStripEndId stripid = strip->GetStripEndId();
00518   UgliScintPlnHandle planehandle = ugh.GetScintPlnHandle(stripid);
00519   Bool_t found(0);
00520   if (fTrkClsSlp.GetLast()<0) {
00521     fZ0 = planehandle.GetZ0();
00522     fTPos0 = strip->GetTPos();
00523   }
00524   else {
00525     for (Int_t i=0; i<=fTrkClsSlp.GetLast(); i++) {
00526       TrkClsSlpSR *tcs = dynamic_cast<TrkClsSlpSR*>(fTrkClsSlp.At(i));
00527       if (fDir*tcs->fTrackCluster->GetZPos()<fDir*fZ0) {
00528         fZ0 = planehandle.GetZ0();
00529         fTPos0 = tcs->fTrackCluster->GetTPos();
00530         found = 1;
00531       }
00532     }
00533   }
00534   TrkClsSlpSR *tcsnew = new TrkClsSlpSR(tcluster);
00535   tcsnew->SetForwardSlope(slope);
00536   tcsnew->SetBackwardSlope(0.);
00537   tcsnew->SetIndex(1);
00538   fTrkClsSlp.AddAt(tcsnew,indx);
00539   if (!found) {
00540     fT0 += (tcluster->GetBegTime()-(planehandle.GetZ0()-fZ0) /
00541            Mphysical::c_light)*tcluster->GetCharge();
00542   }
00543   else {
00544 
00545 // vertex changed, need to recalculate
00546     fT0 = 0.;
00547     for (Int_t i=0; i<=fTrkClsSlp.GetLast(); i++) {
00548       TrkClsSlpSR *tcs = dynamic_cast<TrkClsSlpSR*>(fTrkClsSlp.At(i));
00549       strip = dynamic_cast<CandStripHandle*>
00550         (tcs->fTrackCluster->GetStripList()->First());
00551       stripid = strip->GetStripEndId();
00552       planehandle = ugh.GetScintPlnHandle(stripid);
00553       fT0 +=
00554            (tcs->fTrackCluster->GetBegTime()-(planehandle.GetZ0()-fZ0) /
00555                     Mphysical::c_light)*tcs->fTrackCluster->GetCharge();
00556     }
00557   }
00558   fCharge += tcluster->GetCharge();
00559 }

void Track2DSR::SetDirection ( Int_t  idir  ) 

Definition at line 562 of file Track2DSR.cxx.

References fDir.

Referenced by AlgTrackSRList::FillTrackList().

00563 {
00564   fDir = idir;
00565 }

void Track2DSR::SetHoughIntercept ( Double_t  inter  ) 

Definition at line 568 of file Track2DSR.cxx.

References fHoughExist, and fHoughInter.

Referenced by AlgTrackSRList::FillTrackList().

00569 {
00570   fHoughInter = inter;
00571   fHoughExist = kTRUE;
00572 }

void Track2DSR::SetHoughSlope ( Double_t  slope  ) 

Definition at line 575 of file Track2DSR.cxx.

References fHoughExist, and fHoughSlope.

Referenced by AlgTrackSRList::FillTrackList().

00576 {
00577   fHoughSlope = slope;
00578   fHoughExist = kTRUE;
00579 }

void Track2DSR::SetIsBad ( Bool_t  isBad  ) 

Definition at line 582 of file Track2DSR.cxx.

References fIsBad.

Referenced by AlgTrackSRList::IdentifyBadTracks(), AlgTrackSRList::MergeTracks(), and AlgTrackSRList::RemoveTrackSubsets().

00583 {
00584   fIsBad = isBad;
00585   return;
00586 }


Member Data Documentation

Double_t Track2DSR::fCharge [private]

Definition at line 74 of file Track2DSR.h.

Referenced by Add(), Clear(), GetT0(), operator==(), RemoveAt(), SetCluster(), and Track2DSR().

Double_t Track2DSR::fChi2 [private]

Definition at line 69 of file Track2DSR.h.

Referenced by GetChi2(), operator==(), and Track2DSR().

Int_t Track2DSR::fDir [private]
Bool_t Track2DSR::fHoughExist [private]
Double_t Track2DSR::fHoughInter [private]

Definition at line 84 of file Track2DSR.h.

Referenced by GetHoughIntercept(), operator==(), SetHoughIntercept(), and Track2DSR().

Double_t Track2DSR::fHoughSlope [private]

Definition at line 83 of file Track2DSR.h.

Referenced by GetHoughSlope(), operator==(), SetHoughSlope(), and Track2DSR().

Bool_t Track2DSR::fIsBad [private]

Definition at line 67 of file Track2DSR.h.

Referenced by IsBad(), operator==(), SetIsBad(), and Track2DSR().

Bool_t Track2DSR::fModified [private]

Definition at line 78 of file Track2DSR.h.

Referenced by GetSlope(), operator==(), and Track2DSR().

Double_t Track2DSR::fParmTrk2DAlpha [private]

Definition at line 79 of file Track2DSR.h.

Referenced by CalculateBackwardSlope(), operator==(), and Track2DSR().

Double_t Track2DSR::fT0 [private]

Definition at line 73 of file Track2DSR.h.

Referenced by Add(), Clear(), GetT0(), RemoveAt(), SetCluster(), and Track2DSR().

Double_t Track2DSR::fTPos0 [private]

Definition at line 72 of file Track2DSR.h.

Referenced by Add(), Clear(), GetTPos0(), operator==(), RemoveAt(), SetCluster(), and Track2DSR().

TObjArray Track2DSR::fTrkClsSlp [private]
Double_t Track2DSR::fZ0 [private]

Definition at line 71 of file Track2DSR.h.

Referenced by Add(), Clear(), GetZ0(), operator==(), RemoveAt(), SetCluster(), and Track2DSR().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1