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

CandRecoList.cxx

Go to the documentation of this file.
00001 
00002 // $Id: CandRecoList.cxx,v 1.6 2003/10/12 21:17:03 gmieg Exp $
00003 //
00004 // CandRecoList.cxx
00005 //
00006 // This is an abstract Event Candidate (Reconstruction) object.
00007 // CandRecoList is descended from CandBase.
00008 //
00009 // Each concrete CandBase must define a Dup function.
00010 // CandBase must grant friendship to class CandRefer.
00011 //
00012 // Author:  R. Lee
00014 
00015 #include "Algorithm/AlgHandle.h"
00016 #include "MessageService/MsgService.h"
00017 #include "RecoBase/CandRecoList.h"
00018 #include "RecoBase/CandRecoListHandle.h"
00019 
00020 ClassImp(CandRecoList)
00021 
00022 //______________________________________________________________________
00023 CVSID("$Id: CandRecoList.cxx,v 1.6 2003/10/12 21:17:03 gmieg Exp $");
00024 
00025 //______________________________________________________________________
00026 CandRecoList::CandRecoList()
00027 {
00028   MSG("Cand", Msg::kDebug)
00029                   << "Begin CandRecoList::CandRecoList() ctor: " << endl
00030                                            << "UidInt = " << GetUidInt()
00031                            << ", ArchUidInt " << GetArchUidInt() << endl
00032                              << "No. of links = " << GetNLinks() << endl
00033                     << "End CandRecoList::CandRecoList() ctor." << endl;
00034 }
00035 
00036 //______________________________________________________________________
00037 CandRecoList::CandRecoList(AlgHandle &ah) :
00038   CandBase(ah)       // Should be the next class up on inheritance chain
00039 {
00040 
00041 // The sole purpose of this constructor is to transmit the AlgHandle
00042 // up the inheritance chain to CandBase without having to invoke the
00043 // full constructor of an intermediate Candidate type which the highest
00044 // level Candidate might inherit from.  One only wants to create the
00045 // LocalHandle and invoke the RunAlg() method in the lowest level class.
00046 }
00047 
00048 //______________________________________________________________________
00049 CandRecoList::CandRecoList(AlgHandle &ah, 
00050                         CandHandle & /* ch */, CandContext & /* cx */) :
00051   CandBase(ah)       // Should be the next class up on inheritance chain
00052 {
00053   CreateLocalHandle();
00054   MSG("Cand", Msg::kDebug)
00055        << "Begin CandRecoList::CandRecoList(AlgHandle &, CandHandle &, "
00056                                       << "CandContext &) ctor: " << endl
00057                                            << "UidInt = " << GetUidInt()
00058                            << ", ArchUidInt " << GetArchUidInt() << endl
00059                              << "No. of links = " << GetNLinks() << endl
00060          << "End CandRecoList::CandRecoList(AlgHandle &, CandHandle &, "
00061                                       << "CandContext &) ctor." << endl;
00062 }
00063 
00064 //______________________________________________________________________
00065 CandRecoList::CandRecoList(const CandRecoList &rhs) :
00066   CandBase(rhs)      // Should be the next class up on inheritance chain
00067 {
00068 
00069 //CreateLocalHandle(); // Moved to Dup function following copy-ctor call
00070   MSG("Cand", Msg::kDebug)
00071     << "Begin CandRecoList::CandRecoList(const CandRecoList &rhs) ctor:"
00072                                    << endl << "UidInt = " << GetUidInt()
00073                            << ", ArchUidInt " << GetArchUidInt() << endl
00074                              << "No. of links = " << GetNLinks() << endl
00075       << "End CandRecoList::CandRecoList(const CandRecoList &rhs) ctor."
00076                                                                 << endl;
00077 }
00078 
00079 //______________________________________________________________________
00080 CandRecoList::~CandRecoList()
00081 {
00082   MSG("Cand", Msg::kDebug)
00083                  << "Begin CandRecoList::~CandRecoList() dtor: " << endl
00084                                            << "UidInt = " << GetUidInt()
00085                            << ", ArchUidInt " << GetArchUidInt() << endl
00086                              << "No. of links = " << GetNLinks() << endl
00087                    << "End CandRecoList::~CandRecoList() dtor." << endl;
00088 }
00089 
00090 //______________________________________________________________________
00091 void CandRecoList::CreateLocalHandle()
00092 {
00093   SetLocalHandle(new CandRecoListHandle(this));
00094 }
00095 
00096 //______________________________________________________________________
00097 CandRecoList *CandRecoList::Dup() const
00098 {
00099 
00100 // Base copy ctor dups owned pointers, but defers copying Daughter List.
00101 // Daughter List copy is made in the derived class Dup() function.
00102 // This is because base class copy constructor hasn't yet created
00103 // fLocalHandle with a CandHandle* of the full derived type.
00104   CandRecoList *cb = new CandRecoList(*this);     // Copy-ctor dups ptrs
00105   cb->CreateLocalHandle();   // Initializes fLocalHandle after copy-ctor
00106   TIter iterdau = GetDaughterIterator();
00107   CandHandle *dau;
00108   while ((dau=(CandHandle *) iterdau())) cb->AddDaughterLink(*dau);
00109   return cb;
00110 }
00111 
00112 //______________________________________________________________________
00113 Bool_t CandRecoList::IsEquivalent(const TObject *rhs) const
00114 {
00115   Bool_t result = true;
00116   if (!CandBase::IsEquivalent(rhs)) result = false;   // superclass test
00117   TestDisplayCandBanner("CandRecoList");
00118   const CandRecoList* rCnd = dynamic_cast<const CandRecoList*>(rhs);
00119   if (rCnd == NULL) return false;
00120 
00121   TestNothing("CandRecoList");
00122 
00123   return result;
00124 }

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