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

AltCandStpProbHandle.cxx

Go to the documentation of this file.
00001 
00002 // $Id: AltCandStpProbHandle.cxx,v 1.1 2003/12/22 18:08:50 costas Exp $
00003 //
00004 // AltCandStpProbHandle
00005 //
00006 //    -- A handle for a candidate object keeping "CandStripHandle" --> 
00007 //       "Neural Net Likelihood" associations
00008 //    -- It keeps this association for a collection of CandStripHandles
00009 //       belonging to a given "super"-set (eg. a slice, an event etc...)
00010 //
00011 // Costas Andreopoulos <C.V.Andreopoulos@rl.ac.uk>
00012 // CCLRC, Rutherford Appleton Laboratory
00013 // November 17, 2003
00015 
00016 #include <cassert>
00017 #include <iostream>
00018 
00019 #include "AltCandStpProbHandle.h"
00020 #include "AltCandStpProb.h"
00021 
00022 #include "LeakChecker/Lea.h"
00023 #include "MessageService/MsgService.h"
00024 
00025 ClassImp(AltCandStpProbHandle)
00026 //__________________________________________________________________________
00027 CVSID("$Id: AltCandStpProbHandle.cxx,v 1.1 2003/12/22 18:08:50 costas Exp $");
00028 //__________________________________________________________________________
00029 AltCandStpProbHandle::AltCandStpProbHandle()
00030 {
00031   MSG("AltCand",Msg::kVerbose)
00032      << "AltCandStpProbHandle::AltCandStpProbHandle"
00033                                 << " ctor: UidInt = "<< GetUidInt() << endl;
00034 
00035   LEA_CTOR;
00036 }
00037 //__________________________________________________________________________
00038 AltCandStpProbHandle::AltCandStpProbHandle(
00039                               const AltCandStpProbHandle & handle) :
00040 CandHandle(handle)
00041 {
00042   MSG("AltCand",Msg::kVerbose)
00043     << "AltCandStpProbHandle::AltCandStpProbHandle("
00044             << "const AltCandStpProbHandle & handle) ctor: UidInt = "
00045                                                      << GetUidInt() << endl;
00046   LEA_CTOR;
00047 }
00048 //__________________________________________________________________________
00049 AltCandStpProbHandle::AltCandStpProbHandle(AltCandStpProb * cand) :
00050 CandHandle(cand)
00051 {
00052   MSG("AltCand",Msg::kVerbose)
00053     << "AltCandStpProbHandle::AltCandStpProbHandle("
00054                   << "const AltCandStpProb * cand) ctor: UidInt = "
00055                                                      << GetUidInt() << endl;
00056   LEA_CTOR;
00057 }
00058 //__________________________________________________________________________
00059 AltCandStpProbHandle::~AltCandStpProbHandle()
00060 {
00061   MSG("AltCand",Msg::kVerbose)
00062                << "AltCandStpProbHandle::~AltCandStpProbHandle"
00063                                << " dtor: UidInt = " << GetUidInt() << endl;
00064   LEA_DTOR;
00065 }
00066 //__________________________________________________________________________
00067 AltCandStpProbHandle * AltCandStpProbHandle::DupHandle() const
00068 {
00069    return (new AltCandStpProbHandle(*this));
00070 }
00071 //__________________________________________________________________________
00072 void AltCandStpProbHandle::Trace(const char *c) const
00073 {
00074   MSG("AltCand", Msg::kVerbose)
00075     << "** Begin AltCandStpProbHandle::Trace(\"" << c << "\")" << endl
00076     << "Information from AltCandStpProbHandle's CandHandle: "  << endl;
00077 
00078   CandHandle::Trace(c);
00079   MSG("AltCand", Msg::kVerbose)
00080      << "** End AltCandStpProbHandle::Trace(\"" << c << "\")"  << endl;
00081 }
00082 //__________________________________________________________________________
00083 const map<CandStripHandle *, double> &
00084                                 AltCandStpProbHandle::GetLikelihoods() const
00085 {
00086   const AltCandStpProb * candidate =
00087                          static_cast<const AltCandStpProb *> (GetCandBase());
00088 
00089   return candidate->fLikelihoods;
00090 }
00091 //__________________________________________________________________________
00092 double AltCandStpProbHandle::GetStripLikelihood(CandStripHandle * stp) const
00093 {
00094   const map<CandStripHandle *, double> & slc_strips = GetLikelihoods();
00095 
00096   map<CandStripHandle *, double>::const_iterator it = slc_strips.find(stp);
00097 
00098   return it->second;
00099 }
00100 //__________________________________________________________________________
00101 void AltCandStpProbHandle::SetStripLikelihood(
00102                                   CandStripHandle * stph, double likelihood)
00103 {
00104   AltCandStpProb * candidate =
00105                      static_cast<AltCandStpProb *> (GetCandBase());
00106 
00107   (candidate->fLikelihoods).insert(
00108               map<CandStripHandle *, double>::value_type(stph, likelihood));
00109 }
00110 //__________________________________________________________________________
00111 XXXITRIMP(AltCandStpProbHandle)

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