00001 #include "AlgShowerAtNuList.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 "CandShowerAtNuHandle.h" 00014 #include "CandShowerAtNuListHandle.h" 00015 00016 // 00017 // $Log $ 00018 // 00019 00020 ClassImp(AlgShowerAtNuList) 00021 00022 CVSID("$Id: AlgShowerAtNuList.cxx,v 1.8 2005/02/04 21:07:53 blake Exp $"); 00023 00024 AlgShowerAtNuList::AlgShowerAtNuList() 00025 { 00026 00027 } 00028 00029 AlgShowerAtNuList::~AlgShowerAtNuList() 00030 { 00031 00032 } 00033 00034 void AlgShowerAtNuList::RunAlg(AlgConfig & /*ac*/, CandHandle &ch, CandContext &cx) 00035 { 00036 00037 MSG("AlgShowerAtNuList", Msg::kDebug) << "AlgShowerAtNuList::RunAlg(...)" << endl; 00038 00039 // set name of candhandle 00040 CandShowerAtNuListHandle& showerlist = dynamic_cast<CandShowerAtNuListHandle&>(ch); 00041 00042 // create alghandle + candcontext 00043 AlgFactory &af = AlgFactory::GetInstance(); 00044 AlgHandle ah_shw = af.GetAlgHandle("AlgShowerAtNu", "default"); 00045 CandRecord* candrec = (CandRecord*)(cx.GetCandRecord()); 00046 CandContext cx_shw(this, cx.GetMom()); 00047 cx_shw.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 // access showers 00054 TObjArray* arr = (TObjArray*)(cx_in->At(i)); 00055 00056 // create candidate shower 00057 cx_shw.SetDataIn(arr); 00058 CandShowerAtNuHandle cshwh = CandShowerAtNu::MakeCandidate(ah_shw, cx_shw); 00059 cshwh.SetName(TString("CandShowerAtNuHandle")); 00060 cshwh.SetTitle(TString("Created by AlgShowerAtNu")); 00061 00062 // add shower to shower list 00063 showerlist.AddDaughterLink(cshwh); 00064 } 00065 00066 } 00067 00068 void AlgShowerAtNuList::Trace(const char * /* c */) const 00069 { 00070 00071 }
1.3.9.1