00001 00002 // $Id: AltAlgSlice.cxx,v 1.6 2004/07/26 12:22:51 west Exp $ 00003 // 00004 // AltAlgSlice.h 00005 // 00006 // -- NEAR Detector Event Slicing Algorithm 00007 // 00008 // Costas Andreopoulos <C.V.Andreopoulos@rl.ac.uk> 00009 // CCLRC, Rutherford Appleton Laboratory 00010 // July 01, 2003 00012 00013 #include <cassert> 00014 #include <map> 00015 00016 #include "AltAlgSlice.h" 00017 #include "AltWrapperStlVecStripHandle.h" 00018 00019 #include "RecoBase/CandSliceHandle.h" 00020 00021 #include "Candidate/CandContext.h" 00022 #include "LeakChecker/Lea.h" 00023 #include "MessageService/MsgService.h" 00024 #include "MinosObjectMap/MomNavigator.h" 00025 #include "RecoBase/CandStripHandle.h" 00026 #include "Validity/VldContext.h" 00027 00028 ClassImp(AltAlgSlice) 00029 00030 //______________________________________________________________________ 00031 CVSID("$Id: AltAlgSlice.cxx,v 1.6 2004/07/26 12:22:51 west Exp $"); 00032 //______________________________________________________________________ 00033 AltAlgSlice::AltAlgSlice() 00034 { 00035 LEA_CTOR; 00036 } 00037 //______________________________________________________________________ 00038 AltAlgSlice::~AltAlgSlice() 00039 { 00040 LEA_DTOR; 00041 } 00042 //______________________________________________________________________ 00043 void AltAlgSlice::Trace(const char * /* c */) const 00044 { 00045 00046 } 00047 //______________________________________________________________________ 00048 void AltAlgSlice::RunAlg( 00049 AlgConfig & /* ac */, CandHandle &ch, CandContext &cx) 00050 { 00051 MSG("AltAlg",Msg::kDebug) << "Begin Of AltAlgSlice::RunAlg()" << endl; 00052 00053 assert(ch.InheritsFrom("CandSliceHandle")); 00054 00055 try { 00056 CandSliceHandle & csh = dynamic_cast<CandSliceHandle &>(ch); 00057 00058 assert(cx.GetDataIn()); 00059 assert(cx.GetDataIn()->InheritsFrom("TObject")); 00060 00061 const std::vector<CandStripHandle *> & slice_strips = 00062 ((AltWrapperStlVecStripHandle *) cx.GetDataIn())->GetVec(); 00063 assert(slice_strips.size() > 0); 00064 00065 std::vector<CandStripHandle *>::const_iterator strip_iter; 00066 00067 for(strip_iter = slice_strips.begin(); 00068 strip_iter != slice_strips.end(); ++strip_iter) { 00069 00070 assert( (*strip_iter)->InheritsFrom("CandStripHandle") ); 00071 csh.AddDaughterLink( * (*strip_iter) ); 00072 } 00073 00074 } catch( std::bad_cast ) { 00075 MSG("AltAlg",Msg::kWarning) 00076 << "CandSliceHandle &csh = dynamic_cast<CandSliceHandle &>(ch)" 00077 << " failed" << endl; 00078 } 00079 00080 } 00081 //______________________________________________________________________
1.3.9.1