00001 #include "AlgTrackAtNuList.h" 00002 #include "TObjArray.h" 00003 00004 #include "MessageService/MsgService.h" 00005 #include "JobControl/JobCModuleRegistry.h" 00006 00007 #include "Algorithm/AlgFactory.h" 00008 00009 #include "Candidate/CandContext.h" 00010 #include "RecoBase/CandStripHandle.h" 00011 #include "RecoBase/CandStripListHandle.h" 00012 00013 #include "CandTrackAtNuHandle.h" 00014 #include "CandTrackAtNuListHandle.h" 00015 00016 // 00017 // $Log $ 00018 // 00019 00020 ClassImp(AlgTrackAtNuList) 00021 00022 CVSID("$Id: AlgTrackAtNuList.cxx,v 1.8 2005/02/04 21:07:53 blake Exp $"); 00023 00024 AlgTrackAtNuList::AlgTrackAtNuList() 00025 { 00026 00027 } 00028 00029 AlgTrackAtNuList::~AlgTrackAtNuList() 00030 { 00031 00032 } 00033 00034 void AlgTrackAtNuList::RunAlg(AlgConfig & /*ac*/, CandHandle &ch, CandContext &cx) 00035 { 00036 00037 MSG("AlgTrackAtNuList", Msg::kDebug) << "AlgTrackAtNuList::RunAlg(...)" << endl; 00038 00039 // set name of candhandle 00040 CandTrackAtNuListHandle& tracklist = dynamic_cast<CandTrackAtNuListHandle&>(ch); 00041 00042 // create alghandle + candcontext 00043 AlgFactory &af = AlgFactory::GetInstance(); 00044 AlgHandle ah_trk = af.GetAlgHandle("AlgTrackAtNu", "default"); 00045 CandRecord* candrec = (CandRecord*)(cx.GetCandRecord()); 00046 CandContext cx_trk(this, cx.GetMom()); 00047 cx_trk.SetCandRecord(candrec); 00048 00049 // accessing CandContext 00050 const TObjArray *cx_in = dynamic_cast<const TObjArray*>(cx.GetDataIn()); 00051 for(Int_t i=0;i<1+cx_in->GetLast();i++){ 00052 00053 // unpack tracks 00054 TObjArray* arr = (TObjArray*)(cx_in->At(i)); 00055 00056 // create candidate track 00057 cx_trk.SetDataIn(arr); 00058 CandTrackAtNuHandle cth = CandTrackAtNu::MakeCandidate(ah_trk, cx_trk); 00059 cth.SetName(TString("CandTrackAtNuHandle")); 00060 cth.SetTitle(TString("Created by AlgTrackAtNu")); 00061 00062 // add candtrack to candtracklist 00063 tracklist.AddDaughterLink(cth); 00064 00065 } 00066 00067 } 00068 00069 void AlgTrackAtNuList::Trace(const char * /* c */) const 00070 { 00071 00072 }
1.3.9.1