AlgFitTrackSRList Class Reference

#include <AlgFitTrackSRList.h>

Inheritance diagram for AlgFitTrackSRList:
AlgBase

List of all members.

Public Member Functions

 AlgFitTrackSRList ()
virtual ~AlgFitTrackSRList ()
virtual void RunAlg (AlgConfig &ac, CandHandle &ch, CandContext &cx)
virtual void Trace (const char *c) const

Detailed Description

Definition at line 17 of file AlgFitTrackSRList.h.


Constructor & Destructor Documentation

AlgFitTrackSRList::AlgFitTrackSRList (  ) 

Definition at line 59 of file AlgFitTrackSRList.cxx.

00060 {
00061 }

AlgFitTrackSRList::~AlgFitTrackSRList (  )  [virtual]

Definition at line 64 of file AlgFitTrackSRList.cxx.

00065 {
00066 }


Member Function Documentation

void AlgFitTrackSRList::RunAlg ( AlgConfig ac,
CandHandle ch,
CandContext cx 
) [virtual]

Implements AlgBase.

Definition at line 69 of file AlgFitTrackSRList.cxx.

References CandHandle::AddDaughterLink(), Registry::Get(), CandContext::GetDataIn(), CandHandle::GetDaughterIterator(), AlgFactory::GetInstance(), TrackClusterSR::GetMaxStrip(), TrackClusterSR::GetMinStrip(), CandContext::GetMom(), TrackClusterSR::GetPlane(), CandTrackSRListHandle::GetTrackClusterList(), Msg::kDebug, Msg::kError, CandFitTrackSR::MakeCandidate(), MSG, CandFitTrackHandle::SetCPUTime(), and tc.

00070 {
00071   MSG("Alg", Msg::kDebug)
00072                            << "Starting AlgFitTrackSRList::RunAlg()" << endl;
00073 
00074   assert(cx.GetDataIn());
00075 
00076   if (!(cx.GetDataIn()->InheritsFrom("TObjArray"))) {
00077     return;
00078   }
00079 
00080   const char *pTrackAlgConfig = 0;
00081   ac.Get("FitTrackAlgConfig",pTrackAlgConfig);
00082 
00083   const CandSliceListHandle *slicelist = 0;
00084   const CandTrackListHandle *tracklist = 0;
00085   const CandTrackSRListHandle *tracksrlist = 0;
00086   const TObjArray *cxin = dynamic_cast<const TObjArray *>(cx.GetDataIn());
00087   for (Int_t i=0; i<=cxin->GetLast(); i++) {
00088     TObject *tobj = cxin->At(i);
00089     if (tobj->InheritsFrom("CandSliceListHandle")) {
00090       slicelist = dynamic_cast<CandSliceListHandle*>(tobj);
00091     }
00092     if (tobj->InheritsFrom("CandTrackListHandle")) {
00093       tracklist = dynamic_cast<CandTrackListHandle*>(tobj);
00094       if (tobj->InheritsFrom("CandTrackSRListHandle")) {
00095         tracksrlist = dynamic_cast<CandTrackSRListHandle*>(tobj);
00096       }
00097     }
00098   }
00099   if (!slicelist || !tracklist) {
00100     MSG("error",Msg::kError) <<
00101       "CandSliceListHandle or CandTrackListHandle missing\n";
00102   }
00103 
00104 // Create Candcontext
00105   CandContext cxx(this,cx.GetMom());
00106 
00107 // Get singleton instance of AlgFactory
00108   AlgFactory &af = AlgFactory::GetInstance();
00109 
00110 // Get an AlgHandle to AlgSliceSR with default AlgConfig
00111   AlgHandle ah = af.GetAlgHandle("AlgFitTrackSR",pTrackAlgConfig);
00112 
00113   TIter trackItr(tracklist->GetDaughterIterator());
00114 
00115   clock_t dummyt;
00116   struct tms t1;
00117   struct tms t2;
00118   static double ticksPerSecond = sysconf(_SC_CLK_TCK);
00119 
00120   while (CandTrackHandle *track = dynamic_cast<CandTrackHandle*>(trackItr())) {
00121     TObjArray cxin;
00122     cxin.Add(track);
00123     if (tracksrlist) {
00124       TObjArray *tclist = tracksrlist->GetTrackClusterList();
00125       assert(tclist);
00126       for (int i=0; i<=tclist->GetLast(); i++) {
00127         TrackClusterSR *tc = dynamic_cast<TrackClusterSR*>(tclist->At(i));
00128         assert(tc);
00129         MSG("FitTrackSR",Msg::kDebug) << "Input TC " << tc->GetPlane() << " " << tc->GetMinStrip() << "/" << tc->GetMaxStrip() << endl;
00130       }
00131       cxin.Add(tclist);
00132     }
00133     cxx.SetDataIn(&cxin);
00134     dummyt = times(&t1);
00135     CandFitTrackSRHandle fittrack = CandFitTrackSR::MakeCandidate(ah,cxx);
00136     dummyt = times(&t2);
00137     fittrack.SetCPUTime((Double_t)(t2.tms_utime+t2.tms_stime-t1.tms_utime-t1.tms_stime)/ticksPerSecond);
00138     ch.AddDaughterLink(fittrack);
00139   }
00140 
00141 }

void AlgFitTrackSRList::Trace ( const char *  c  )  const [virtual]

Reimplemented from AlgBase.

Definition at line 145 of file AlgFitTrackSRList.cxx.

00146 {
00147 }


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1