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

CandTrackList.cxx

Go to the documentation of this file.
00001 
00002 // $Id: CandTrackList.cxx,v 1.7 2005/02/02 11:38:35 tagg Exp $
00003 //
00004 // CandTrackList.cxx
00005 //
00006 // This is an abstract Event Candidate (Reconstruction) object.
00007 // CandTrackList is descended from CandRecoList.
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/CandTrackList.h"
00018 #include "RecoBase/CandTrackListHandle.h"
00019 
00020 ClassImp(CandTrackList)
00021 
00022 //______________________________________________________________________
00023 CVSID("$Id: CandTrackList.cxx,v 1.7 2005/02/02 11:38:35 tagg Exp $");
00024 
00025 #include "Candidate/CandBase.tpl"
00026 
00027 //______________________________________________________________________
00028 CandTrackList::CandTrackList()
00029 {
00030   MSG("Cand", Msg::kDebug)
00031                 << "Begin CandTrackList::CandTrackList() ctor: " << endl
00032                                            << "UidInt = " << GetUidInt()
00033                            << ", ArchUidInt " << GetArchUidInt() << endl
00034                              << "No. of links = " << GetNLinks() << endl
00035                   << "End CandTrackList::CandTrackList() ctor." << endl;
00036 }
00037 
00038 //______________________________________________________________________
00039 CandTrackList::CandTrackList(AlgHandle &ah) :
00040   CandRecoList(ah)   // Should be the next class up on inheritance chain
00041 {
00042 
00043 // The sole purpose of this constructor is to transmit the AlgHandle
00044 // up the inheritance chain to CandBase without having to invoke the
00045 // full constructor of an intermediate Candidate type which the highest
00046 // level Candidate might inherit from.  One only wants to create the
00047 // LocalHandle and invoke the RunAlg() method in the lowest level class.
00048 }
00049 
00050 //______________________________________________________________________
00051 CandTrackList::CandTrackList(AlgHandle &ah, CandHandle &ch,
00052                                                       CandContext &cx) :
00053   CandRecoList(ah)   // Should be the next class up on inheritance chain
00054 {
00055   CreateLocalHandle();
00056   MSG("Cand", Msg::kDebug)
00057      << "Begin CandTrackList::CandTrackList(AlgHandle &, CandHandle &, "
00058                                       << "CandContext &) ctor: " << endl
00059                                            << "UidInt = " << GetUidInt()
00060                            << ", ArchUidInt " << GetArchUidInt() << endl
00061                              << "No. of links = " << GetNLinks() << endl
00062        << "End CandTrackList::CandTrackList(AlgHandle &, CandHandle &, "
00063                                       << "CandContext &) ctor." << endl;
00064 
00065 // Run Algorithm to construct Candidate
00066   {                                                   // Start of scope.
00067     CandTrackListHandle cdh(this);           // cdh will go out of scope
00068     ch = cdh;                                       // after setting ch.
00069   }                                                     // End of scope.
00070   ah.RunAlg(ch, cx);
00071 
00072 }
00073 
00074 //______________________________________________________________________
00075 CandTrackList::CandTrackList(const CandTrackList &rhs) :
00076   CandRecoList(rhs)  // Should be the next class up on inheritance chain
00077 {
00078 
00079 //CreateLocalHandle(); // Moved to Dup function following copy-ctor call
00080   MSG("Cand", Msg::kDebug)
00081                                  << "Begin CandTrackList::CandTrackList"
00082                           << "(const CandTrackList &rhs) ctor: " << endl
00083                                            << "UidInt = " << GetUidInt()
00084                            << ", ArchUidInt " << GetArchUidInt() << endl
00085                              << "No. of links = " << GetNLinks() << endl
00086                                    << "End CandTrackList::CandTrackList"
00087                           << "(const CandTrackList &rhs) ctor." << endl;
00088 }
00089 
00090 //______________________________________________________________________
00091 CandTrackList::~CandTrackList()
00092 {
00093   MSG("Cand", Msg::kDebug)
00094                << "Begin CandTrackList::~CandTrackList() dtor: " << endl
00095                                            << "UidInt = " << GetUidInt()
00096                            << ", ArchUidInt " << GetArchUidInt() << endl
00097                              << "No. of links = " << GetNLinks() << endl
00098                  << "End CandTrackList::~CandTrackList() dtor." << endl;
00099 }
00100 
00101 //______________________________________________________________________
00102 void CandTrackList::CreateLocalHandle()
00103 {
00104   SetLocalHandle(new CandTrackListHandle(this));
00105 }
00106 
00107 //______________________________________________________________________
00108 CandTrackList *CandTrackList::Dup() const
00109 {
00110 
00111 // Base copy ctor dups owned pointers, but defers copying Daughter List.
00112 // Daughter List copy is made in the derived class Dup() function.
00113 // This is because base class copy constructor hasn't yet created
00114 // fLocalHandle with a CandHandle* of the full derived type.
00115   CandTrackList *cb = new CandTrackList(*this);   // Copy-ctor dups ptrs
00116   cb->CreateLocalHandle();   // Initializes fLocalHandle after copy-ctor
00117   cb->SetCandRecord(fCandRecord);
00118   TIter iterdau = GetDaughterIterator();
00119   CandHandle *dau;
00120   while ((dau=(CandHandle *) iterdau())) cb->AddDaughterLink(*dau);
00121   return cb;
00122 }
00123 
00124 //______________________________________________________________________
00125 Bool_t CandTrackList::IsEquivalent(const TObject *rhs) const
00126 {
00127   Bool_t result = true;
00128   if (!CandRecoList::IsEquivalent(rhs)) result = false;    // superclass
00129   TestDisplayCandBanner("CandTrackList");
00130   const CandTrackList* rCnd = dynamic_cast<const CandTrackList*>(rhs);
00131   if (rCnd == NULL) return false;
00132 
00133   TestNothing("CandTrackList");
00134 
00135   return result;
00136 }
00137 
00138 //______________________________________________________________________
00139 CandTrackListHandle CandTrackList::MakeCandidate(AlgHandle &ah,
00140                                                         CandContext &cx)
00141 {
00142   CandTrackListHandle cdh;
00143   new CandTrackList(ah, cdh, cx);      // cdh owns the new CandTrackList
00144   return cdh;
00145 }

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