CandFitTrackSR Class Reference

#include <CandFitTrackSR.h>

Inheritance diagram for CandFitTrackSR:

CandFitTrack CandTrack CandReco CandBase CandRefCounted List of all members.

Public Member Functions

 CandFitTrackSR ()
virtual std::ostream & FormatToOStream (std::ostream &os, Option_t *option="") const

Static Public Member Functions

static CandFitTrackSRHandle MakeCandidate (AlgHandle &ah, CandContext &cx)

Protected Member Functions

 CandFitTrackSR (AlgHandle &ah)
 CandFitTrackSR (AlgHandle &ah, CandHandle &ch, CandContext &cx)
 CandFitTrackSR (const CandFitTrackSR &rhs)
virtual ~CandFitTrackSR ()
virtual void CreateLocalHandle ()
virtual CandFitTrackSRDup () const
void Init ()
virtual Bool_t IsEquivalent (const TObject *rhs) const

Protected Attributes

TObjArray * fPlaneList
TObjArray * fTrackClusterList
KalmanPlaneSRfCurrent
KalmanPlaneSRfCurrentU
KalmanPlaneSRfCurrentV
Double_t fInitialQP
Int_t fNChangedFitPoint
Int_t fVtxExtrapolate [2]
Int_t fEndExtrapolate [2]
map< TrackClusterSR *, Bool_t > fBadFit
map< Int_t, Float_t > fPlanePreChi2
map< Int_t, Float_t > fdUdZ
map< Int_t, Float_t > fdVdZ

Friends

class CandFitTrackSRHandle

Detailed Description

Definition at line 29 of file CandFitTrackSR.h.


Constructor & Destructor Documentation

CandFitTrackSR::CandFitTrackSR (  ) 

Definition at line 30 of file CandFitTrackSR.cxx.

References Init().

Referenced by Dup(), and MakeCandidate().

00030                                :
00031   fInitialQP(0.),
00032   fNChangedFitPoint(0)
00033 {
00034   Init();
00035 }

CandFitTrackSR::CandFitTrackSR ( AlgHandle ah  )  [protected]

Definition at line 38 of file CandFitTrackSR.cxx.

References Init().

00038                                             :
00039   CandFitTrack(ah),  // Should be the next class up on inheritance chain
00040   fInitialQP(0.),
00041   fNChangedFitPoint(0)
00042 {
00043   Init();
00044 }

CandFitTrackSR::CandFitTrackSR ( AlgHandle ah,
CandHandle ch,
CandContext cx 
) [protected]

Definition at line 47 of file CandFitTrackSR.cxx.

References CreateLocalHandle(), Init(), and AlgHandle::RunAlg().

00048                                                                        :
00049   CandFitTrack(ah),  // Should be the next class up on inheritance chain
00050   fInitialQP(0.),
00051   fNChangedFitPoint(0)
00052 {
00053   CreateLocalHandle();
00054  
00055   Init();
00056 // Run Algorithm to construct Candidate
00057   {                                                    // Start of scope
00058     CandFitTrackSRHandle csh(this);          // csh will go out of scope
00059     ch = csh;                                       // after setting ch.
00060   }                                                      // End of scope
00061   ah.RunAlg(ch, cx);
00062 }

CandFitTrackSR::CandFitTrackSR ( const CandFitTrackSR rhs  )  [protected]

Definition at line 65 of file CandFitTrackSR.cxx.

References fBadFit, fdUdZ, fdVdZ, fEndExtrapolate, fPlaneList, fPlanePreChi2, fTrackClusterList, fVtxExtrapolate, Init(), and tc.

00065                                                         :
00066   CandFitTrack(rhs), // Should be the next class up on inheritance chain
00067   fInitialQP(rhs.fInitialQP),
00068   fNChangedFitPoint(rhs.fNChangedFitPoint)
00069 {
00070 
00071   Init();
00072   fVtxExtrapolate[0] = rhs.fVtxExtrapolate[0];
00073   fVtxExtrapolate[1] = rhs.fVtxExtrapolate[1];
00074   fEndExtrapolate[0] = rhs.fEndExtrapolate[0];
00075   fEndExtrapolate[1] = rhs.fEndExtrapolate[1];
00076   for (int i=0; i<=rhs.fTrackClusterList->GetLast(); i++) {
00077     TrackClusterSR *tc =
00078             dynamic_cast<TrackClusterSR*>(rhs.fTrackClusterList->At(i));
00079     TrackClusterSR *newtc = new TrackClusterSR(*tc);
00080     fTrackClusterList->Add(newtc);
00081   }
00082   for (int i=0; i<=rhs.fPlaneList->GetLast(); i++) {
00083     KalmanPlaneSR *kp =
00084                     dynamic_cast<KalmanPlaneSR*>(rhs.fPlaneList->At(i));
00085     KalmanPlaneSR *newkp = new KalmanPlaneSR(kp);
00086     fPlaneList->Add(newkp);
00087   }
00088 
00089   map<TrackClusterSR *,Bool_t>::iterator fBadFitIter;
00090   map<Int_t,Float_t>::iterator fPlanePreChi2Iter;
00091 
00092   for (fBadFitIter = rhs.fBadFit.begin();
00093                         fBadFitIter!=rhs.fBadFit.end(); fBadFitIter++) {
00094     fBadFit[fBadFitIter->first] = fBadFitIter->second;
00095   }
00096 
00097   for (fPlanePreChi2Iter = rhs.fPlanePreChi2.begin();
00098       fPlanePreChi2Iter!=rhs.fPlanePreChi2.end(); fPlanePreChi2Iter++) {
00099     fPlanePreChi2[fPlanePreChi2Iter->first] = fPlanePreChi2Iter->second;
00100   }
00101 
00102 
00103   fdUdZ.erase(fdUdZ.begin(),fdUdZ.end());
00104   map<Int_t,Float_t>::iterator fdUdZIter;
00105   for (fdUdZIter = rhs.fdUdZ.begin(); fdUdZIter!=rhs.fdUdZ.end();
00106                                                           fdUdZIter++) {
00107     fdUdZ[fdUdZIter->first] = fdUdZIter->second;
00108   }
00109 
00110   fdVdZ.erase(fdVdZ.begin(),fdVdZ.end());
00111   map<Int_t,Float_t>::iterator fdVdZIter;
00112   for (fdVdZIter = rhs.fdVdZ.begin(); fdVdZIter!=rhs.fdVdZ.end();
00113                                                           fdVdZIter++) {
00114     fdVdZ[fdVdZIter->first] = fdVdZIter->second;
00115   }
00116 }

CandFitTrackSR::~CandFitTrackSR (  )  [protected, virtual]

Definition at line 119 of file CandFitTrackSR.cxx.

References fPlaneList, fTrackClusterList, and tc.

00120 {
00121   if (fPlaneList) {
00122     for (Int_t i=0; i<=fPlaneList->GetLast(); i++) {
00123       KalmanPlaneSR *kp =
00124                         dynamic_cast<KalmanPlaneSR*>(fPlaneList->At(i));
00125       delete kp;
00126     }
00127     delete fPlaneList;
00128   }
00129   if (fTrackClusterList) {
00130     for (Int_t i=0; i<=fTrackClusterList->GetLast(); i++) {
00131       TrackClusterSR *tc =
00132                 dynamic_cast<TrackClusterSR*>(fTrackClusterList->At(i));
00133       delete tc;
00134     }
00135     delete fTrackClusterList;
00136   }
00137 }


Member Function Documentation

void CandFitTrackSR::CreateLocalHandle (  )  [protected, virtual]

Reimplemented from CandFitTrack.

Definition at line 140 of file CandFitTrackSR.cxx.

References CandFitTrackSRHandle, and CandBase::SetLocalHandle().

Referenced by CandFitTrackSR(), and Dup().

00141 {
00142   SetLocalHandle(new CandFitTrackSRHandle(this));
00143 }

CandFitTrackSR * CandFitTrackSR::Dup (  )  const [protected, virtual]

Reimplemented from CandFitTrack.

Definition at line 146 of file CandFitTrackSR.cxx.

References CandBase::AddDaughterLink(), CandFitTrackSR(), CreateLocalHandle(), and CandBase::GetDaughterIterator().

00147 {
00148   CandFitTrackSR *cb = new CandFitTrackSR(*this); // Copy-ctor dups ptrs
00149   cb->CreateLocalHandle();   // Initializes fLocalHandle after copy-ctor
00150   TIter iterdau = GetDaughterIterator();
00151   CandHandle *dau;
00152   while ((dau=(CandHandle *) iterdau())) cb->AddDaughterLink(*dau);
00153   return cb;
00154 }

std::ostream & CandFitTrackSR::FormatToOStream ( std::ostream &  os,
Option_t *  option = "" 
) const [virtual]

Reimplemented from CandFitTrack.

Definition at line 234 of file CandFitTrackSR.cxx.

References fInitialQP, fNChangedFitPoint, CandFitTrack::FormatToOStream(), CandBase::GetDataIndent(), and CandBase::GetIndentString().

00236 {
00237   CandFitTrack::FormatToOStream(os,option);
00238 
00239   TString opt(option);
00240   if (!opt.Contains("v0")) { // v0 means suppress the data values
00241     const TString& indent = GetIndentString();
00242 
00243     os << indent << GetDataIndent()
00244        << "QP Initial " << fInitialQP
00245        << " NChangedFitPoint " << fNChangedFitPoint
00246        << endl;
00247 
00248     os << indent << "...should have print routines for KalmanPlaneSR" << endl;
00249   }
00250   return os;
00251   
00252 }

void CandFitTrackSR::Init (  )  [protected]

Definition at line 157 of file CandFitTrackSR.cxx.

References fCurrent, fCurrentU, fCurrentV, fEndExtrapolate, fPlaneList, fTrackClusterList, and fVtxExtrapolate.

Referenced by CandFitTrackSR().

00158 {
00159   fPlaneList = new TObjArray;
00160   fPlaneList->Clear();
00161   fPlaneList->Compress();
00162   fTrackClusterList = new TObjArray;
00163   fTrackClusterList->Clear();
00164   fTrackClusterList->Compress();
00165   fCurrent = 0;
00166   fCurrentU = 0;
00167   fCurrentV = 0;
00168   fVtxExtrapolate[0] = 0;
00169   fVtxExtrapolate[1] = 0;
00170   fEndExtrapolate[0] = 0;
00171   fEndExtrapolate[1] = 0;
00172 }

Bool_t CandFitTrackSR::IsEquivalent ( const TObject *  rhs  )  const [protected, virtual]

Reimplemented from CandFitTrack.

Definition at line 175 of file CandFitTrackSR.cxx.

References fBadFit, fCurrent, fCurrentU, fCurrentV, fdUdZ, fdVdZ, fEndExtrapolate, fInitialQP, fNChangedFitPoint, fPlaneList, fPlanePreChi2, fTrackClusterList, fVtxExtrapolate, CandFitTrack::IsEquivalent(), CandBase::TestArrayEquality(), CandBase::TestDisplayCandBanner(), CandBase::TestEquality(), and CandBase::TestPtrEquivalence().

00176 {
00177   Bool_t result = true;
00178   if (!CandFitTrack::IsEquivalent(rhs)) result = false;    // superclass
00179   TestDisplayCandBanner("CandFitTrackSR");
00180   const CandFitTrackSR* rCnd = dynamic_cast<const CandFitTrackSR*>(rhs);
00181   if (rCnd == NULL) return false;
00182 
00183   result = TestGenericElemPtrTObjArrayPtrEquivalence<KalmanPlaneSR>(
00184                             "fPlaneList",
00185                             this->fPlaneList,
00186                             rCnd->fPlaneList, kTRUE)          && result;
00187   result = TestGenericElemPtrTObjArrayPtrEquivalence<TrackClusterSR>(
00188                             "fTrackClusterList",
00189                             this->fTrackClusterList,
00190                             rCnd->fTrackClusterList, kTRUE)   && result;
00191   result = TestPtrEquivalence("fCurrent",
00192                             this->fCurrent, 
00193                             rCnd->fCurrent)                   && result;
00194   result = TestPtrEquivalence("fCurrentU",
00195                             this->fCurrentU, 
00196                             rCnd->fCurrentU)                  && result;
00197   result = TestPtrEquivalence("fCurrentV",
00198                             this->fCurrentV, 
00199                             rCnd->fCurrentV)                  && result;
00200   result = TestEquality("fInitialQP",
00201                             this->fInitialQP,
00202                             rCnd->fInitialQP)                 && result;
00203   result = TestEquality("fNChangedFitPoint",
00204                             this->fNChangedFitPoint,
00205                             rCnd->fNChangedFitPoint)          && result;
00206   result = TestArrayEquality("fVtxExtrapolate", 2,
00207                             this->fVtxExtrapolate,
00208                             rCnd->fVtxExtrapolate)            && result;
00209   result = TestArrayEquality("fEndExtrapolate", 2,
00210                             this->fEndExtrapolate,
00211                             rCnd->fEndExtrapolate)            && result;
00212   result = TestEquality("fBadFit",       this->fBadFit, 
00213                                          rCnd->fBadFit)       && result;
00214   result = TestEquality("fPlanePreChi2", this->fPlanePreChi2, 
00215                                          rCnd->fPlanePreChi2) && result;
00216   result = TestEquality("fdUdZ",         this->fdUdZ, 
00217                                          rCnd->fdUdZ)         && result;
00218   result = TestEquality("fdVdZ",         this->fdVdZ, 
00219                                          rCnd->fdVdZ)         && result;
00220 
00221   return result;  
00222 }

CandFitTrackSRHandle CandFitTrackSR::MakeCandidate ( AlgHandle ah,
CandContext cx 
) [static]

Reimplemented from CandFitTrack.

Definition at line 225 of file CandFitTrackSR.cxx.

References CandFitTrackSR().

Referenced by AlgFitTrackSRList::RunAlg().

00227 {
00228   CandFitTrackSRHandle csh;
00229   new CandFitTrackSR(ah, csh, cx);    // csh owns the new CandFitTrackSR
00230   return csh;
00231 }


Friends And Related Function Documentation

friend class CandFitTrackSRHandle [friend]

Definition at line 31 of file CandFitTrackSR.h.

Referenced by CreateLocalHandle().


Member Data Documentation

map<TrackClusterSR *,Bool_t> CandFitTrackSR::fBadFit [mutable, protected]

Definition at line 65 of file CandFitTrackSR.h.

Referenced by CandFitTrackSR(), and IsEquivalent().

KalmanPlaneSR* CandFitTrackSR::fCurrent [protected]

Definition at line 56 of file CandFitTrackSR.h.

Referenced by Init(), and IsEquivalent().

KalmanPlaneSR* CandFitTrackSR::fCurrentU [protected]

Definition at line 57 of file CandFitTrackSR.h.

Referenced by Init(), and IsEquivalent().

KalmanPlaneSR* CandFitTrackSR::fCurrentV [protected]

Definition at line 58 of file CandFitTrackSR.h.

Referenced by Init(), and IsEquivalent().

map<Int_t,Float_t> CandFitTrackSR::fdUdZ [mutable, protected]

Definition at line 67 of file CandFitTrackSR.h.

Referenced by CandFitTrackSR(), CandFitTrackSRHandle::ClearMaps(), CandFitTrackSRHandle::GetdUdZ(), IsEquivalent(), and CandFitTrackSRHandle::SetdUdZ().

map<Int_t,Float_t> CandFitTrackSR::fdVdZ [mutable, protected]

Definition at line 68 of file CandFitTrackSR.h.

Referenced by CandFitTrackSR(), CandFitTrackSRHandle::ClearMaps(), CandFitTrackSRHandle::GetdVdZ(), IsEquivalent(), and CandFitTrackSRHandle::SetdVdZ().

Int_t CandFitTrackSR::fEndExtrapolate[2] [protected]

Definition at line 63 of file CandFitTrackSR.h.

Referenced by CandFitTrackSR(), CandFitTrackSRHandle::GetEndExtrapolate(), Init(), and IsEquivalent().

Double_t CandFitTrackSR::fInitialQP [protected]

Definition at line 60 of file CandFitTrackSR.h.

Referenced by FormatToOStream(), and IsEquivalent().

Int_t CandFitTrackSR::fNChangedFitPoint [protected]

Definition at line 61 of file CandFitTrackSR.h.

Referenced by FormatToOStream(), and IsEquivalent().

TObjArray* CandFitTrackSR::fPlaneList [protected]

Definition at line 53 of file CandFitTrackSR.h.

Referenced by CandFitTrackSR(), Init(), IsEquivalent(), and ~CandFitTrackSR().

map<Int_t,Float_t> CandFitTrackSR::fPlanePreChi2 [mutable, protected]

Definition at line 66 of file CandFitTrackSR.h.

Referenced by CandFitTrackSR(), CandFitTrackSRHandle::ClearMaps(), and IsEquivalent().

TObjArray* CandFitTrackSR::fTrackClusterList [protected]

Definition at line 54 of file CandFitTrackSR.h.

Referenced by CandFitTrackSRHandle::AddTrackCluster(), CandFitTrackSR(), Init(), IsEquivalent(), and ~CandFitTrackSR().

Int_t CandFitTrackSR::fVtxExtrapolate[2] [protected]

Definition at line 62 of file CandFitTrackSR.h.

Referenced by CandFitTrackSR(), CandFitTrackSRHandle::GetVtxExtrapolate(), Init(), and IsEquivalent().


The documentation for this class was generated from the following files:
Generated on Mon Aug 11 01:05:35 2014 for loon by  doxygen 1.4.7