00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00014
00015 #include <cassert>
00016
00017 #include "AltAlgStpPatternRecList.h"
00018 #include "AltAlgStpPatternRec.h"
00019 #include "AltCandStpProb.h"
00020 #include "AltCandStpProbHandle.h"
00021 #include "AltCandStpProbListHandle.h"
00022
00023 #include "Algorithm/AlgFactory.h"
00024 #include "Algorithm/AlgHandle.h"
00025 #include "Algorithm/AlgConfig.h"
00026 #include "Candidate/CandContext.h"
00027 #include "CandDigit/CandDigitHandle.h"
00028 #include "Conventions/Detector.h"
00029 #include "LeakChecker/Lea.h"
00030 #include "MessageService/MsgService.h"
00031 #include "MinosObjectMap/MomNavigator.h"
00032 #include "Navigation/NavKey.h"
00033 #include "Navigation/NavSet.h"
00034 #include "RawData/RawDigit.h"
00035 #include "RawData/RawHeader.h"
00036 #include "RawData/RawRecord.h"
00037 #include "RawData/RawChannelId.h"
00038 #include "RawData/RawDigitDataBlock.h"
00039 #include "RecoBase/CandSliceHandle.h"
00040 #include "RecoBase/CandSliceListHandle.h"
00041 #include "UgliGeometry/UgliGeomHandle.h"
00042 #include "Validity/VldContext.h"
00043
00044
00045 CVSID("$Id: AltAlgStpPatternRecList.cxx,v 1.2 2007/11/11 08:07:50 rhatcher Exp $");
00046
00047 AltAlgStpPatternRecList::AltAlgStpPatternRecList()
00048 {
00049 LEA_CTOR;
00050 }
00051
00052 AltAlgStpPatternRecList::~AltAlgStpPatternRecList()
00053 {
00054 LEA_DTOR;
00055 }
00056
00057 void AltAlgStpPatternRecList::Trace(const char * ) const
00058 {
00059
00060 }
00061
00062 void AltAlgStpPatternRecList::RunAlg(
00063 AlgConfig & ac, CandHandle & ch,CandContext & cx)
00064 {
00065 MSG("AltAlg",Msg::kInfo)
00066 << "[-] Begin of AltAlgStpPatternRecList::RunAlg() with parameters"
00067 << endl;
00068 ac.Print();
00069
00070
00071
00072 AlgFactory & af = AlgFactory::GetInstance();
00073 AlgHandle ah = af.GetAlgHandle("AltAlgStpPatternRec","default");
00074
00075 CandContext ccx(this, cx.GetMom());
00076
00077
00078 assert(cx.GetDataIn());
00079 const CandSliceListHandle * slices =
00080 dynamic_cast<const CandSliceListHandle *> (cx.GetDataIn());
00081
00082 CandSliceHandleItr sliceItr( slices->GetDaughterIterator() );
00083
00084 try {
00085 AltCandStpProbListHandle & likelihood_list =
00086 dynamic_cast<AltCandStpProbListHandle &>(ch);
00087
00088
00089 while (CandSliceHandle * slch = sliceItr()) {
00090
00091 MSG("AltAlg", Msg::kDebug)
00092 << " Slice: " << slch->GetUidInt()
00093 << " / Running AltCandStpProb::MakeCandidate" << endl;
00094
00095 ccx.SetDataIn(slch);
00096 AltCandStpProbHandle prob = AltCandStpProb::MakeCandidate(ah,ccx);
00097
00098 likelihood_list.SetLikelihoods(slch->DupHandle(), &prob);
00099 }
00100
00101 MSG("AltAlg", Msg::kInfo) << "* all AltCandStpProbs created!" << endl;
00102 }
00103
00104 catch( std::bad_cast ) {
00105
00106 MSG("AltAlg",Msg::kWarning)
00107 << "AltCandStpProbListHandle & likelihood_list = "
00108 << "dynamic_cast<AltCandStpProbListHandle &>(ch) failed"<< endl;
00109 }
00110 }
00111