Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

AlgFitTrackMSList.cxx

Go to the documentation of this file.
00001 
00002 // $Id: AlgFitTrackMSList.cxx,v 1.5 2003/09/29 21:52:59 rhatcher Exp $
00003 //
00004 // AlgFitTrackMSList is a concrete FitTrackMSList Algorithm class.
00005 //
00006 // Tom Bringley
00007 // ttb2@duke.edu
00008 // 6/13/2001
00010 
00011 #include <cassert>
00012 #include <vector>
00013 
00014 #include "Algorithm/AlgFactory.h"
00015 #include "Algorithm/AlgHandle.h"
00016 #include "Algorithm/AlgConfig.h"
00017 #include "Candidate/CandContext.h"
00018 #include "CandFitTrackMS/AlgFitTrackMSList.h"
00019 #include "CandFitTrackMS/CandFitTrackMS.h"
00020 #include "CandFitTrackMS/CandFitTrackMS.h"
00021 #include "CandFitTrackMS/CandFitTrackMSHandle.h"
00022 #include "CandFitTrackMS/CandFitTrackMSList.h"
00023 #include "CandFitTrackMS/CandFitTrackMSListHandle.h"
00024 #include "Conventions/Mphysical.h"
00025 #include "Conventions/Munits.h"
00026 #include "Conventions/PlaneView.h"
00027 #include "MessageService/MsgService.h"
00028 #include "MinosObjectMap/MomNavigator.h"
00029 #include "Navigation/NavKey.h"
00030 #include "Navigation/NavSet.h"
00031 #include "RecoBase/CandTrackHandle.h"
00032 #include "RecoBase/CandTrackListHandle.h"
00033 #include "RecoBase/CandSliceHandle.h"
00034 #include "RecoBase/CandSliceListHandle.h"
00035 #include "RecoBase/LinearFit.h"
00036 #include "UgliGeometry/UgliGeomHandle.h"
00037 #include "Validity/VldContext.h"
00038 
00039 
00040 ClassImp(AlgFitTrackMSList)
00041 
00042 
00043 //______________________________________________________________________
00044 CVSID("$Id: AlgFitTrackMSList.cxx,v 1.5 2003/09/29 21:52:59 rhatcher Exp $");
00045 
00046 //______________________________________________________________________
00047 AlgFitTrackMSList::AlgFitTrackMSList()
00048 {
00049 }
00050 
00051 //______________________________________________________________________
00052 AlgFitTrackMSList::~AlgFitTrackMSList()
00053 {
00054 }
00055 
00056 //______________________________________________________________________
00057 void AlgFitTrackMSList::RunAlg(AlgConfig & /* ac */, 
00058                                CandHandle &ch,CandContext &cx)
00059 {
00060   MSG("Alg", Msg::kDebug)
00061                            << "Starting AlgFitTrackMSList::RunAlg()" << endl;
00062 
00063   assert(cx.GetDataIn());
00064 
00065   if (!(cx.GetDataIn()->InheritsFrom("TObjArray"))) {
00066     return;
00067   }
00068 
00069   const CandSliceListHandle *slicelist = 0;
00070   const CandTrackListHandle *tracklist = 0;
00071   const TObjArray *cxin = dynamic_cast<const TObjArray *>(cx.GetDataIn());
00072   for (Int_t i=0; i<=cxin->GetLast(); i++) {
00073     TObject *tobj = cxin->At(i);
00074     if (tobj->InheritsFrom("CandSliceListHandle")) {
00075       slicelist = dynamic_cast<CandSliceListHandle*>(tobj);
00076     }
00077     if (tobj->InheritsFrom("CandTrackListHandle")) {
00078       tracklist = dynamic_cast<CandTrackListHandle*>(tobj);
00079     }
00080   }
00081   if (!slicelist || !tracklist) {
00082     MSG("FitTrackMS",Msg::kError) <<
00083       "CandSliceListHandle or CandTrackListHandle missing\n";
00084   }
00085 
00086 // Create Candcontext
00087   CandContext cxx(this,cx.GetMom());
00088 
00089 // Get singleton instance of AlgFactory
00090   AlgFactory &af = AlgFactory::GetInstance();
00091 
00092 // Get an AlgHandle to AlgSliceMS with default AlgConfig
00093   AlgHandle ah = af.GetAlgHandle("AlgFitTrackMS","default");
00094 
00095   TIter trackItr(tracklist->GetDaughterIterator());
00096 
00097   Int_t t=0;
00098 
00099   while (CandTrackHandle *track =
00100     dynamic_cast<CandTrackHandle*>(trackItr.Next())) {
00101 
00102     t++;
00103     MSG("FitTrackMS",Msg::kDebug) << "track number " << t << endl;
00104     
00105     cxx.SetDataIn(track);
00106     CandFitTrackMSHandle fittrack = CandFitTrackMS::MakeCandidate(ah,cxx);
00107     ch.AddDaughterLink(fittrack);
00108   }
00109 
00110 }
00111 
00112 
00113 //______________________________________________________________________
00114 void AlgFitTrackMSList::Trace(const char * /* c */) const
00115 {
00116 }
00117 

Generated on Mon Feb 15 11:06:18 2010 for loon by  doxygen 1.3.9.1