TrackClusterSR Class Reference

#include <TrackClusterSR.h>

List of all members.

Public Member Functions

 TrackClusterSR ()
 TrackClusterSR (Double_t misalignmentError)
 TrackClusterSR (CandStripHandle *strip, Double_t misalignmentError)
 TrackClusterSR (const TrackClusterSR &rhs)
virtual ~TrackClusterSR ()
void AddStrip (CandStripHandle *strip)
Double_t DTPos (Double_t tpos) const
Double_t GetBegTime () const
Double_t GetCharge () const
Int_t GetMaxStrip () const
Double_t GetMaxTPos () const
Int_t GetMinStrip () const
Double_t GetMinTPos () const
Int_t GetNStrip () const
Int_t GetPlane () const
PlaneView::PlaneView_t GetPlaneView () const
const TObjArray * GetStripList () const
Double_t GetTime3D () const
Double_t GetTPos () const
Double_t GetTPosError () const
Double_t GetTPosRMS () const
Double_t GetZPos () const
Double_t GetMisalignmentError () const
Double_t GetLPos () const
Double_t GetRotationCorrectedTPos (const CandStripHandle *csh) const
Bool_t InShowerLikePlane () const
Bool_t IsContained (CandStripHandle *target) const
Bool_t IsDoubleEnded () const
virtual Bool_t IsEquivalent (const TObject *rhs) const
Bool_t IsValid () const
Bool_t IsWide () const
void SetInShowerLikePlane (Bool_t showerLike)
void SetIsValid (Bool_t isValid)
void SetIsWide (Bool_t iswide)
void SetTime3D (Double_t dvar)
void SetLPos (Double_t lpos)
void RecalculateTPos ()

Static Public Member Functions

static NavKey KeyFromPlane (const TrackClusterSR *tcluster)
static NavKey KeyFromPlaneTPosTime (const TrackClusterSR *tcluster)

Private Attributes

TObjArray fStripList
Int_t fNStrip
Int_t fMinStrip
Int_t fMaxStrip
Double_t fZPos
Double_t fCharge
Double_t fTime3D
Double_t fTPos
Double_t fTPosRMS
Double_t fLPos
Bool_t fIsWide
Bool_t fIsValid
Bool_t fInShowerLikePlane
Double_t fParmMisalignmentError

Detailed Description

Definition at line 20 of file TrackClusterSR.h.


Constructor & Destructor Documentation

TrackClusterSR::TrackClusterSR (  ) 

Definition at line 32 of file TrackClusterSR.cxx.

References Munits::mm.

00033 {
00034   fNStrip = 0;
00035   fMinStrip = 0;
00036   fMaxStrip = 0;
00037   fTPos = 0.;
00038   fTime3D = 0.;
00039   fTPosRMS = 0.;
00040   fZPos = 0.;
00041   fLPos = 0.;
00042   fCharge = 0.;
00043   fIsWide = false;
00044   fIsValid = true;
00045   fInShowerLikePlane = false;
00046   fParmMisalignmentError = 30*Munits::mm;
00047 }

TrackClusterSR::TrackClusterSR ( Double_t  misalignmentError  ) 

Definition at line 50 of file TrackClusterSR.cxx.

References fCharge, fInShowerLikePlane, fIsValid, fIsWide, fLPos, fMaxStrip, fMinStrip, fNStrip, fParmMisalignmentError, fTime3D, fTPos, fTPosRMS, and fZPos.

00051 {
00052   fNStrip = 0;
00053   fMinStrip = 0;
00054   fMaxStrip = 0;
00055   fTPos = 0.;
00056   fTime3D = 0.;
00057   fTPosRMS = 0.;
00058   fZPos = 0.;
00059   fLPos = 0.;
00060   fCharge = 0.;
00061   fIsWide = false;
00062   fIsValid = true;
00063   fInShowerLikePlane = false;
00064   fParmMisalignmentError = misalignmentError;          // 30*Munits::mm;
00065 }

TrackClusterSR::TrackClusterSR ( CandStripHandle strip,
Double_t  misalignmentError 
)

Definition at line 68 of file TrackClusterSR.cxx.

References AddStrip(), fCharge, fInShowerLikePlane, fIsValid, fIsWide, fLPos, fMaxStrip, fMinStrip, fNStrip, fParmMisalignmentError, fTime3D, fTPos, fTPosRMS, and fZPos.

00070 {
00071   fNStrip = 0;
00072   fMinStrip = 0;
00073   fMaxStrip = 0;
00074   fTPos = 0.;
00075   fTPosRMS = 0.;
00076   fZPos = 0.;
00077   fLPos = 0.;
00078   fCharge = 0.;
00079   fTime3D = 0.;
00080   fIsWide = false;
00081   fIsValid = true;
00082   fInShowerLikePlane = false;
00083   fParmMisalignmentError = misalignmentError;          // 30*Munits::mm;
00084 
00085   AddStrip(strip);
00086 }

TrackClusterSR::TrackClusterSR ( const TrackClusterSR rhs  ) 

Definition at line 89 of file TrackClusterSR.cxx.

References CandStripHandle::DupHandle(), and fStripList.

00089                                                         : // Copy-ctor
00090   TObject(rhs)
00091 , fNStrip(rhs.fNStrip)
00092 , fMinStrip(rhs.fMinStrip)
00093 , fMaxStrip(rhs.fMaxStrip)
00094 , fZPos(rhs.fZPos)
00095 , fCharge(rhs.fCharge)
00096 , fTime3D(rhs.fTime3D)
00097 , fTPos(rhs.fTPos)
00098 , fTPosRMS(rhs.fTPosRMS)
00099 , fLPos(rhs.fLPos)
00100 , fIsWide(rhs.fIsWide)
00101 , fIsValid(rhs.fIsValid)
00102 , fInShowerLikePlane(rhs.fInShowerLikePlane)
00103 , fParmMisalignmentError(rhs.fParmMisalignmentError)
00104 {
00105 
00106 // Copy TObjArray's contents
00107   TIter rhsIter(&rhs.fStripList);
00108   TObject *rhsObj;
00109   while ((rhsObj = rhsIter())) {
00110     CandStripHandle *cshObj;
00111     if ((cshObj = dynamic_cast<CandStripHandle*>(rhsObj))) {
00112       fStripList.Add(cshObj->DupHandle());
00113     }
00114   }
00115 }

TrackClusterSR::~TrackClusterSR (  )  [virtual]

Definition at line 118 of file TrackClusterSR.cxx.

References fStripList.

00119 {
00120   fStripList.Delete(); // Owned CandHandle*'s from TrackClusterSR vers 9
00121 }


Member Function Documentation

void TrackClusterSR::AddStrip ( CandStripHandle strip  ) 

Definition at line 124 of file TrackClusterSR.cxx.

References CandStripHandle::DupHandle(), fCharge, fMaxStrip, fMinStrip, fNStrip, fStripList, fTPos, fTPosRMS, fZPos, CandStripHandle::GetCharge(), PlexStripEndId::GetStrip(), CandStripHandle::GetStripEndId(), CandStripHandle::GetTime(), CandStripHandle::GetTPos(), CandStripHandle::GetZPos(), Msg::kWarning, and MSG.

Referenced by AlgFitTrackSR::MakeTrackClusterList(), AlgTrackSRList::MakeTrackClusters(), AlgTrackSRList::SpectrometerTracking(), and TrackClusterSR().

00125 {
00126   if (fStripList.GetLast()<0) {
00127     fZPos = strip->GetZPos();
00128   }
00129 
00130   PlexStripEndId strip_seid = strip->GetStripEndId();
00131   
00132   for (Int_t i=0; i<=fStripList.GetLast(); i++) {
00133     CandStripHandle *strip1 = 
00134       dynamic_cast<CandStripHandle*>(fStripList.At(i));
00135     PlexStripEndId strip1_seid = strip1->GetStripEndId();
00136     if ( strip_seid == strip1_seid  &&  (strip1->GetTime()==strip->GetTime())  ) return;
00137   }
00138 
00139   Int_t stripnum = strip_seid.GetStrip();
00140 
00141   fNStrip++;
00142   if (fNStrip==1 || stripnum<fMinStrip) {
00143     fMinStrip = stripnum;
00144   }
00145   if (fNStrip==1 || stripnum>fMaxStrip) {
00146     fMaxStrip = stripnum;
00147   }
00148   fStripList.Add(strip->DupHandle());
00149   if (fNStrip==1) {
00150     fCharge  = strip->GetCharge();
00151     fTPos    = strip->GetTPos();
00152     fTPosRMS = 0.;
00153   } else {
00154     fCharge  = 0.;
00155     fTPos    = 0.;
00156     fTPosRMS = 0.;
00157     for (Int_t i=0; i<=fStripList.GetLast(); i++) {
00158       CandStripHandle *strip1 = 
00159         dynamic_cast<CandStripHandle*>(fStripList.At(i));
00160       Double_t charge = strip1->GetCharge();
00161       if (charge <= 0.0) {
00162         MSG("TrackSR", Msg::kWarning)
00163           << "AddStrip() strip1 charge "
00164           << charge << ", avoid corrupting avg/RMS of TPos." << endl;
00165         continue;  // skip polluting <TPos>,RMS(TPos) w/ funky charge
00166       }
00167       Double_t tpos   = strip1->GetTPos();
00168       //    fTPos    += charge*tpos;
00169       //  fTPosRMS += charge*tpos*tpos;
00170       //  fCharge  += charge;
00171       fTPos    += tpos;
00172       fTPosRMS += tpos*tpos;
00173       fCharge  += charge;
00174     }
00175     if (fCharge<=0.0) {
00176       MSG("TrackSR", Msg::kWarning)
00177         << "AddStrip() fCharge "
00178         << fCharge << ", avoid division." << endl;
00179       fCharge  = 1.0e-6;
00180       fTPos    = 0.0;
00181       fTPosRMS = 1.0e+6;
00182     }
00183     
00184     //    fTPos /= fCharge;
00185     //  fTPosRMS /= fCharge;
00186     // fTPosRMS -= fTPos*fTPos;
00187     fTPos /= fNStrip;
00188     fTPosRMS /= fNStrip;
00189     fTPosRMS -= fTPos*fTPos;
00190     if (fTPosRMS>=0.) {
00191       fTPosRMS = sqrt(fTPosRMS);
00192     } else {
00193       fTPosRMS = 0.;
00194     }
00195   } // fNStrip > 1
00196 
00197 }

Double_t TrackClusterSR::DTPos ( Double_t  tpos  )  const

Definition at line 296 of file TrackClusterSR.cxx.

References fNStrip, fStripList, GetNStrip(), CandStripHandle::GetTPos(), and min.

00297 {
00298   if (fNStrip==0) {
00299     return -99999.;
00300   }
00301   CandStripHandle *strip =
00302                      dynamic_cast<CandStripHandle*>(fStripList.First());
00303   if (GetNStrip()==1) {
00304     return fabs(strip->GetTPos()-tpos); 
00305   }
00306   Double_t dtpos = 9999999.;
00307   Bool_t above(0);
00308   Bool_t below(0);
00309 
00310 // assume that trackcluster is contiguous set of strips
00311   for (Int_t i=0; i<=fStripList.GetLast(); i++) {
00312     strip = dynamic_cast<CandStripHandle*>(fStripList.At(i));
00313     if (strip->GetTPos()>tpos) {
00314       above = 1;
00315     }
00316     if (strip->GetTPos()<tpos) {
00317       below = 1;
00318     }
00319     dtpos = min(dtpos,fabs(strip->GetTPos()-tpos));
00320   }
00321   if (above && below) {
00322     dtpos = 0.;
00323   }
00324   return dtpos;
00325 }

Double_t TrackClusterSR::GetBegTime (  )  const

Definition at line 328 of file TrackClusterSR.cxx.

References fNStrip, fStripList, and CandStripHandle::GetBegTime().

Referenced by Track2DSR::Add(), AlgTrackSRList::FillTrackList(), AlgTrackSRList::FindTimingDirection(), AlgFitTrackSR::FindTimingDirection(), AlgTrackSRList::IsBestClusterInPlane(), KeyFromPlaneTPosTime(), AlgTrackSRList::MarkUsedClusters(), Track2DSR::RemoveAt(), AlgTrackSRList::RunAlg(), and Track2DSR::SetCluster().

00329 {
00330   if (fNStrip==0) {
00331     return 0.;
00332   }
00333   Double_t begtime=0.;
00334   for (Int_t i=0; i<=fStripList.GetLast(); i++) {
00335     CandStripHandle *strip =
00336                        dynamic_cast<CandStripHandle*>(fStripList.At(i));
00337     if (!i || strip->GetBegTime()<begtime) {
00338       begtime = strip->GetBegTime();
00339     }
00340   }
00341   return begtime;
00342 }

Double_t TrackClusterSR::GetCharge (  )  const
Double_t TrackClusterSR::GetLPos (  )  const [inline]

Definition at line 49 of file TrackClusterSR.h.

References fLPos.

00049 { return fLPos; };     // return longitudinal position

Int_t TrackClusterSR::GetMaxStrip (  )  const
Double_t TrackClusterSR::GetMaxTPos (  )  const

Definition at line 360 of file TrackClusterSR.cxx.

References fNStrip, fStripList, and CandStripHandle::GetTPos().

Referenced by GetTPosError(), AlgTrackSRList::IsBestClusterInPlane(), and AlgTrackSRList::RunAlg().

00361 {
00362   if (fNStrip==0) {
00363     return 0.;
00364   }
00365   Double_t tpos=-5.;
00366   for (Int_t i=0; i<=fStripList.GetLast(); i++) {
00367     CandStripHandle *strip =
00368                        dynamic_cast<CandStripHandle*>(fStripList.At(i));
00369     if (!i || strip->GetTPos()>tpos) {
00370       tpos = strip->GetTPos();
00371     }
00372   }
00373   return tpos+0.02054;
00374 }

Int_t TrackClusterSR::GetMinStrip (  )  const
Double_t TrackClusterSR::GetMinTPos (  )  const

Definition at line 383 of file TrackClusterSR.cxx.

References fNStrip, fStripList, and CandStripHandle::GetTPos().

Referenced by GetTPosError(), AlgTrackSRList::IsBestClusterInPlane(), KeyFromPlaneTPosTime(), and AlgTrackSRList::RunAlg().

00384 {
00385   if (fNStrip==0) {
00386     return 0.;
00387   }
00388   Double_t tpos=5.;
00389   for (Int_t i=0; i<=fStripList.GetLast(); i++) {
00390     CandStripHandle *strip =
00391                        dynamic_cast<CandStripHandle*>(fStripList.At(i));
00392     if (!i || strip->GetTPos()<tpos) {
00393       tpos = strip->GetTPos();
00394     }
00395   }
00396   return tpos-0.02054;
00397 }

Double_t TrackClusterSR::GetMisalignmentError (  )  const

Definition at line 487 of file TrackClusterSR.cxx.

References fParmMisalignmentError.

00488 {
00489   return fParmMisalignmentError;
00490 }

Int_t TrackClusterSR::GetNStrip (  )  const
Int_t TrackClusterSR::GetPlane (  )  const

Definition at line 406 of file TrackClusterSR.cxx.

References fStripList, and CandStripHandle::GetPlane().

Referenced by AlgFitTrackSR::AddClustersToFit(), AlgTrackSRList::AddClustersToTracks(), AlgFitTrackSR::AddForwardBestKPToFit(), AlgFitTrackSR::AddReverseBestKPToFit(), AlgFitTrackSR::AddToFit(), Track2DSR::CalculateBackwardSlope(), AlgFitTrackSR::CalculateNoise(), AlgTrackSRList::CheckForBadClusters(), AlgTrackSRList::CleanUp(), AlgTrackSRList::DeleteTwinTracks(), AlgFitTrackSR::DoKalmanFit(), AlgTrackSRList::FillInGaps(), AlgTrackSRList::FillTrackList(), AlgFitTrackSR::FindDownstreamPlanes(), AlgTrackSR::FindStripsInTrack(), AlgFitTrackSR::FindUpstreamPlanes(), AlgFitTrackSR::FitFrom(), AlgTrackSRList::FormCandTrackSR(), CandFitTrackSRHandle::GetBadFit(), Track2DSR::GetBegPlane(), Track2DSR::GetEndPlane(), AlgTrackSRList::IdentifyBadTracks(), AlgFitTrackSR::InitializeFit(), AlgTrackSRList::IsBestClusterInPlane(), KeyFromPlane(), KeyFromPlaneTPosTime(), KeyOnClusterPlane(), AlgFitTrackSR::MakeDaughterStripList(), AlgFitTrackSR::MakeSliceClusterList(), AlgFitTrackSR::MakeTrackClusterList(), AlgTrackSRList::MakeTrackClusters(), AlgFitTrackSR::MarkTrackClusters(), AlgTrackSRList::MarkUsedClusters(), AlgTrackSRList::MergeTracks(), AlgFitTrackSR::Predict(), AlgFitTrackSR::RemoveBadPointsFromFit(), AlgTrackSRList::RemoveStripsInSlice(), AlgTrackSRList::RemoveTrackSubsets(), AlgTrackSRList::RemoveUnusedSpectStrips(), AlgFitTrackSR::ResetTrackClusterList(), AlgFitTrackSR::ReverseFit(), AlgTrackSRList::RunAlg(), AlgFitTrackSRList::RunAlg(), AlgFitTrackSR::RunAlg(), HoughViewSR::SetClusterList(), CandFitTrackSRHandle::SetEnd(), AlgFitTrackSR::SetPlaneParameters(), CandFitTrackSRHandle::SetVtx(), AlgTrackSRList::SpectrometerTracking(), and AlgFitTrackSR::SwimVertexAndEndPoints().

00407 {
00408   if (fStripList.GetLast()>=0) {
00409     CandStripHandle *strip =
00410                      dynamic_cast<CandStripHandle*>(fStripList.First());
00411     return strip->GetPlane();
00412   }
00413   else {
00414     return 0;
00415   }
00416 }

PlaneView::PlaneView_t TrackClusterSR::GetPlaneView (  )  const
Double_t TrackClusterSR::GetRotationCorrectedTPos ( const CandStripHandle csh  )  const

Get rotation corrected tpos of the strip at position along the strip corresponding to fLPos of this track cluster.

Get rotation corrected tpos of the strip at position along the strip corresponding to fLPos of this track cluster. Cache last tpos value to avoid repeating calculations

Definition at line 215 of file TrackClusterSR.cxx.

References fLPos, CandStripHandle::GetStripEndId(), CandStripHandle::GetTPos(), UgliStripHandle::GetTPos(), CandHandle::GetVldContext(), Msg::kDebug, and MSG.

Referenced by RecalculateTPos().

00216 {
00217     MSG("TrackSR", Msg::kDebug)
00218           << "Double_t TrackClusterSR::GetRotationCorrectedTPos(const CandStripHandle* csh) const" << endl;
00219           
00220     assert( csh && "Do not pass NULL pointers!!!");
00221     
00222     static CandStripHandle* lastCsh = 0;
00223     static Double_t lastLpos = 0.;
00224     static Double_t lastTpos = 0.;
00225         
00226     if ( csh != lastCsh || fLPos != lastLpos ) {
00227         UgliGeomHandle ugh(*csh->GetVldContext());    
00228         PlexStripEndId strip_seid = csh->GetStripEndId();
00229         UgliStripHandle ush = ugh.GetStripHandle(strip_seid);
00230         lastTpos = ush.GetTPos(fLPos);
00231     }        
00232 
00233     MSG("TrackSR", Msg::kDebug) << "TPos = " << csh->GetTPos() 
00234         << "; RotationCorrectedTPos = " << lastTpos << "; LPos = " << fLPos << endl;
00235     return lastTpos;
00236 } // Double_t TrackClusterSR::GetRotationCorrectedTPos(const CandStripHandle*)

const TObjArray * TrackClusterSR::GetStripList (  )  const
Double_t TrackClusterSR::GetTime3D (  )  const

Definition at line 436 of file TrackClusterSR.cxx.

References fTime3D.

00437 {
00438   return fTime3D;
00439 }

Double_t TrackClusterSR::GetTPos (  )  const
Double_t TrackClusterSR::GetTPosError (  )  const

Definition at line 451 of file TrackClusterSR.cxx.

References err(), fNStrip, fParmMisalignmentError, GetMaxTPos(), GetMinTPos(), and max.

Referenced by AlgTrackSRList::FillInGaps(), AlgFitTrackSR::Filter(), AlgTrackSR::FindStripsInTrack(), Track2DSR::GetChi2(), AlgTrackSRList::IsBestClusterInPlane(), AlgTrackSRList::MergeTracks(), AlgFitTrackSR::Predict(), and AlgFitTrackSR::SetPlaneParameters().

00452 {
00453   Double_t err = 0.;
00454   if (fNStrip==0) {
00455     err = 0.;
00456   } else if (fNStrip==1) {
00457 
00458 // 4.108 cm / sqrt(12)
00459     err = 0.01185877;
00460   } else {
00461    
00462     err = max((GetMaxTPos()-GetMinTPos())*0.288,0.01185877);
00463                //    err = max(fTPosRMS,0.01185877);
00464   }
00465 
00466   // add value in quadrature to reflect misalignments
00467   err = sqrt(err*err+fParmMisalignmentError*fParmMisalignmentError);
00468   return err;
00469 }

Double_t TrackClusterSR::GetTPosRMS (  )  const

Definition at line 472 of file TrackClusterSR.cxx.

References fNStrip, and fTPosRMS.

00473 {
00474   if (fNStrip==0) {
00475     return 0.;
00476   }
00477   return fTPosRMS;
00478 }

Double_t TrackClusterSR::GetZPos (  )  const
Bool_t TrackClusterSR::InShowerLikePlane (  )  const

Definition at line 493 of file TrackClusterSR.cxx.

References fInShowerLikePlane.

Referenced by KeyOnUClusterNotSL(), KeyOnUClusterNotWideSL(), KeyOnVClusterNotSL(), KeyOnVClusterNotWideSL(), and AlgTrackSRList::MakeTrackClusters().

00494 {
00495 
00496 // returns true if cluster is in a showerlike plane - ie one with a wide
00497 // cluster
00498   return fInShowerLikePlane;
00499 }

Bool_t TrackClusterSR::IsContained ( CandStripHandle target  )  const

Definition at line 502 of file TrackClusterSR.cxx.

References fStripList.

Referenced by AlgFitTrackSR::MakeSliceClusterList(), and AlgFitTrackSR::MarkTrackClusters().

00503 { 
00504   for (Int_t i=0; i<=fStripList.GetLast(); i++) {
00505     CandStripHandle *strip =
00506                        dynamic_cast<CandStripHandle*>(fStripList.At(i));
00507 
00508 // check if object being pointed to is the same
00509     if (*strip == *target) {
00510       return 1;
00511     }
00512   }
00513   return 0;
00514 }

Bool_t TrackClusterSR::IsDoubleEnded (  )  const

Definition at line 517 of file TrackClusterSR.cxx.

References fStripList, VldContext::GetDetector(), CandHandle::GetNDaughters(), CandHandle::GetVldContext(), and Detector::kNear.

Referenced by AlgTrackSRList::SpectrometerTracking().

00518 {
00519   for (Int_t i=0; i<=fStripList.GetLast(); i++) {
00520     CandStripHandle *strip =
00521                        dynamic_cast<CandStripHandle*>(fStripList.At(i));
00522     if (!i &&
00523            strip->GetVldContext()->GetDetector()==Detector::kNear) {
00524       return kFALSE;
00525     }
00526     if (strip->GetNDaughters()==2) {
00527       return kTRUE;
00528     }
00529   }
00530   return kFALSE;
00531 }

Bool_t TrackClusterSR::IsEquivalent ( const TObject *  rhs  )  const [virtual]

Definition at line 534 of file TrackClusterSR.cxx.

References fInShowerLikePlane, fNStrip, and fStripList.

00535 {
00536   const TrackClusterSR *rcl = dynamic_cast<const TrackClusterSR*>(rhs);
00537 
00538 // compare simple members
00539   if ( !(this->fNStrip            == rcl->fNStrip            &&
00540          this->fInShowerLikePlane == rcl->fInShowerLikePlane )) {
00541     return false;
00542   }
00543 
00544 // compare TObjArray
00545   if (this->fStripList.GetEntries() != rcl->fStripList.GetEntries()) {
00546     return false;
00547   }
00548   else {
00549     TIter thisIter(&this->fStripList);
00550     TIter rhsIter(&rcl->fStripList);
00551     TObject *thisObj, *rhsObj;
00552     while ( ( (thisObj = thisIter.Next() ) != NULL) &&
00553             ( (rhsObj  = rhsIter.Next()  ) != NULL)    ) {
00554       CandStripHandle *thisStrip =
00555                                 dynamic_cast<CandStripHandle*>(thisObj);
00556       CandStripHandle *rhsStrip =
00557                                  dynamic_cast<CandStripHandle*>(rhsObj);
00558       if (!thisStrip || !rhsStrip) return false; // not CandStripHandle*
00559       if (*thisStrip != *rhsStrip) return false;  // Deep Handle compare
00560     }
00561   }
00562   return true;
00563 }

Bool_t TrackClusterSR::IsValid (  )  const
Bool_t TrackClusterSR::IsWide (  )  const

Definition at line 573 of file TrackClusterSR.cxx.

References fIsWide.

Referenced by AlgTrackSRList::FillTrackList(), KeyOnUClusterNotWide(), KeyOnUClusterNotWideSL(), KeyOnVClusterNotWide(), KeyOnVClusterNotWideSL(), AlgTrackSRList::MakeTrackClusters(), and AlgTrackSRList::RunAlg().

00574 {
00575 
00576 // returns true if cluster is a wide cluster
00577   return fIsWide;
00578 }

NavKey TrackClusterSR::KeyFromPlane ( const TrackClusterSR tcluster  )  [static]

Definition at line 614 of file TrackClusterSR.cxx.

References GetPlane().

Referenced by AlgTrackSRList::SpectrometerTracking().

00615 {
00616   return tcluster->GetPlane();
00617 }

NavKey TrackClusterSR::KeyFromPlaneTPosTime ( const TrackClusterSR tcluster  )  [static]

Definition at line 620 of file TrackClusterSR.cxx.

References GetBegTime(), GetMinTPos(), and GetPlane().

00622 {
00623    Int_t iplane = tcluster->GetPlane();
00624    Double_t tpos = tcluster->GetMinTPos();
00625    Int_t itpos = static_cast<Int_t>(tpos);
00626    Double_t time = tcluster->GetBegTime();
00627    Int_t itime = static_cast<Int_t>(time*.1/18.7);
00628 
00629    Int_t navkey = (iplane<<22) | (itpos<<11) | itime;
00630 
00631    return navkey;
00632 }

void TrackClusterSR::RecalculateTPos (  ) 

Recalculate transverse position - needs to be done when setting the "longitudinal" postion along the strip fLPos.

Definition at line 241 of file TrackClusterSR.cxx.

References fCharge, fNStrip, fStripList, fTPos, fTPosRMS, CandStripHandle::GetCharge(), GetRotationCorrectedTPos(), Msg::kWarning, and MSG.

Referenced by SetLPos().

00242 {    
00243   // return when the cluster has no strips
00244   if ( fNStrip == 0 ) return;
00245   
00246   // running sums
00247   Double_t chargesum = 0.;
00248   Double_t tpossum = 0.;
00249   Double_t tposrmssum = 0.;
00250   
00251   // loop over strips
00252   for (Int_t i=0; i<=fStripList.GetLast(); i++) {
00253     CandStripHandle *strip = 
00254       dynamic_cast<CandStripHandle*>(fStripList.At(i));
00255     
00256     // cache strip charge, tpos
00257     Double_t stripcharge = strip->GetCharge();
00258     Double_t striptpos = GetRotationCorrectedTPos(strip);
00259     
00260     // ignore strips with negative charge
00261     if (stripcharge <= 0.0) {
00262       MSG("TrackSR", Msg::kWarning)
00263         << "Strip charge is "
00264         << stripcharge << ", avoid corrupting avg/RMS of TPos." << endl;
00265       continue;  // skip polluting <TPos>,RMS(TPos) w/ funky charge
00266     }
00267     
00268     // increment running sums
00269     chargesum  += stripcharge;
00270     tpossum    += striptpos;
00271     tposrmssum += striptpos*striptpos;
00272   }    
00273 
00274   // set zero values and return if total charge is <=0.    
00275   if (chargesum <= 0.0) {
00276     MSG("TrackSR", Msg::kWarning)
00277         << "AddStrip() fCharge "
00278         << fCharge << ", avoid division." << endl;
00279     fCharge  = 1.0e-6;
00280     fTPos    = 0.0;
00281     fTPosRMS = 1.0e+6;
00282     return;
00283   }
00284   
00285   // update TrackCluster fTPos, fTPosRMS  
00286   fTPos = tpossum/fNStrip;
00287   fTPosRMS = tposrmssum/fNStrip - fTPos*fTPos;
00288   if ( fTPosRMS>=0.) {
00289       fTPosRMS = sqrt(fTPosRMS);
00290   } else {
00291       fTPosRMS = 0.;
00292   }
00293 } // void TrackClusterSR::RecalculateTPos()

void TrackClusterSR::SetInShowerLikePlane ( Bool_t  showerLike  ) 

Definition at line 581 of file TrackClusterSR.cxx.

References fInShowerLikePlane.

Referenced by AlgTrackSRList::MakeTrackClusters().

00582 {
00583 
00584 // set the flag for this being in a shower like plane - ie 
00585 // the plane contains at least one wide cluster
00586   fInShowerLikePlane = showerLike;
00587 }

void TrackClusterSR::SetIsValid ( Bool_t  isValid  ) 

Definition at line 590 of file TrackClusterSR.cxx.

References fIsValid.

Referenced by AlgFitTrackSR::DoKalmanFit(), AlgTrackSRList::FillTrackList(), AlgFitTrackSR::MakeSliceClusterList(), AlgFitTrackSR::MarkTrackClusters(), AlgTrackSRList::MarkUsedClusters(), AlgFitTrackSR::RemoveBadPointsFromFit(), and AlgFitTrackSR::ResetTrackClusterList().

00591 {
00592 
00593 // set the flag for this being a wide cluster - ie one with
00594 // more strips in it than expected based on slope
00595   fIsValid = isvalid;
00596 }

void TrackClusterSR::SetIsWide ( Bool_t  iswide  ) 

Definition at line 599 of file TrackClusterSR.cxx.

References fIsWide.

Referenced by AlgTrackSRList::MakeTrackClusters().

00600 {
00601 
00602 // set the flag for this being a wide cluster - ie one with
00603 // more strips in it than expected based on slope
00604   fIsWide = iswide;
00605 }

void TrackClusterSR::SetLPos ( Double_t  lpos  ) 

Assign "longitudinal" position of the cluster along the strip. Triggers recalculation of the transverse position.

Definition at line 201 of file TrackClusterSR.cxx.

References fLPos, Msg::kDebug, MSG, and RecalculateTPos().

00202 {
00203     MSG("TrackSR", Msg::kDebug)
00204           << "void TrackClusterSR::SetLPos(Double_t lpos)" << endl;
00205     MSG("TrackSR", Msg::kDebug)
00206           << "Setting fLPos = " << lpos << endl;
00207     fLPos = lpos;   
00208     RecalculateTPos();
00209 } // void TrackClusterSR::SetLPos(Double_t)

void TrackClusterSR::SetTime3D ( Double_t  dvar  ) 

Definition at line 608 of file TrackClusterSR.cxx.

References fTime3D.

00609 {
00610   fTime3D = dvar;
00611 }


Member Data Documentation

Double_t TrackClusterSR::fCharge [private]

Definition at line 79 of file TrackClusterSR.h.

Referenced by AddStrip(), GetCharge(), RecalculateTPos(), and TrackClusterSR().

Bool_t TrackClusterSR::fIsValid [private]

Definition at line 88 of file TrackClusterSR.h.

Referenced by IsValid(), SetIsValid(), and TrackClusterSR().

Bool_t TrackClusterSR::fIsWide [private]

Definition at line 85 of file TrackClusterSR.h.

Referenced by IsWide(), SetIsWide(), and TrackClusterSR().

Double_t TrackClusterSR::fLPos [private]

Definition at line 83 of file TrackClusterSR.h.

Referenced by GetLPos(), GetRotationCorrectedTPos(), SetLPos(), and TrackClusterSR().

Int_t TrackClusterSR::fMaxStrip [private]

Definition at line 76 of file TrackClusterSR.h.

Referenced by AddStrip(), GetMaxStrip(), and TrackClusterSR().

Int_t TrackClusterSR::fMinStrip [private]

Definition at line 75 of file TrackClusterSR.h.

Referenced by AddStrip(), GetMinStrip(), and TrackClusterSR().

Int_t TrackClusterSR::fNStrip [private]

Definition at line 93 of file TrackClusterSR.h.

Referenced by GetMisalignmentError(), GetTPosError(), and TrackClusterSR().

TObjArray TrackClusterSR::fStripList [private]
Double_t TrackClusterSR::fTime3D [private]

Definition at line 80 of file TrackClusterSR.h.

Referenced by GetTime3D(), SetTime3D(), and TrackClusterSR().

Double_t TrackClusterSR::fTPos [private]

Definition at line 81 of file TrackClusterSR.h.

Referenced by AddStrip(), GetTPos(), RecalculateTPos(), and TrackClusterSR().

Double_t TrackClusterSR::fTPosRMS [private]

Definition at line 82 of file TrackClusterSR.h.

Referenced by AddStrip(), GetTPosRMS(), RecalculateTPos(), and TrackClusterSR().

Double_t TrackClusterSR::fZPos [private]

Definition at line 78 of file TrackClusterSR.h.

Referenced by AddStrip(), GetZPos(), and TrackClusterSR().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1