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

CandFitTrackMSList.cxx

Go to the documentation of this file.
00001 
00002 // $Id: CandFitTrackMSList.cxx,v 1.1 2001/11/16 21:35:12 rhbob Exp $
00003 //
00004 // This is a concrete Event Candidate (Reconstruction) object.
00005 // CandFitTrackMSList is descended from CandFitTrackList.
00006 //
00007 // Each concrete CandBase must define a Dup function.
00008 // CandBase must grant friendship to class CandRefer.
00009 //
00010 // Tom Bringley
00011 // ttb2@duke.edu
00012 // 6/13/2001
00014 
00015 #include "Algorithm/AlgHandle.h"
00016 #include "CandFitTrackMS/CandFitTrackMSList.h"
00017 #include "CandFitTrackMS/CandFitTrackMSListHandle.h"
00018 #include "MessageService/MsgService.h"
00019 
00020 ClassImp(CandFitTrackMSList)
00021 
00022 //______________________________________________________________________
00023 CVSID("$Id: CandFitTrackMSList.cxx,v 1.1 2001/11/16 21:35:12 rhbob Exp $");
00024 
00025 //______________________________________________________________________
00026 CandFitTrackMSList::CandFitTrackMSList()
00027 {
00028   MSG("Cand", Msg::kDebug)
00029                         << "Begin CandFitTrackMSList::CandFitTrackMSList() ctor: " << endl
00030                                            << "UidInt = " << GetUidInt()
00031                            << ", ArchUidInt " << GetArchUidInt() << endl
00032                              << "No. of links = " << GetNLinks() << endl
00033                           << "End CandFitTrackMSList::CandFitTrackMSList() ctor." << endl;
00034 }
00035 
00036 //______________________________________________________________________
00037 CandFitTrackMSList::CandFitTrackMSList(AlgHandle &ah) :
00038   CandFitTrackList(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 //______________________________________________________________________
00050 CandFitTrackMSList::CandFitTrackMSList(AlgHandle &ah, CandHandle &ch, CandContext &cx) :
00051   CandFitTrackList(ah)  // Should be the next class up on inheritance chain
00052 {
00053   CreateLocalHandle();
00054   MSG("Cand", Msg::kDebug)
00055              << "Begin CandFitTrackMSList::CandFitTrackMSList(AlgHandle &, CandHandle &, "
00056                                       << "CandContext &) ctor: " << endl
00057                                            << "UidInt = " << GetUidInt()
00058                            << ", ArchUidInt " << GetArchUidInt() << endl
00059                              << "No. of links = " << GetNLinks() << endl
00060                << "End CandFitTrackMSList::CandFitTrackMSList(AlgHandle &, CandHandle &, "
00061                                       << "CandContext &) ctor." << endl;
00062 
00063 // Run Algorithm to construct Candidate
00064    {                                         // Start of scope.
00065      CandFitTrackMSListHandle cshl(this);              // cshl will go out of scope
00066      ch = cshl;                               // after setting ch.
00067    }                                         // End of scope.
00068    ah.RunAlg(ch, cx);
00069 }
00070 
00071 //______________________________________________________________________
00072 CandFitTrackMSList::CandFitTrackMSList(const CandFitTrackMSList &rhs) :
00073   CandFitTrackList(rhs) // Should be the next class up on inheritance chain
00074 {
00075 //CreateLocalHandle(); // Moved to Dup function following copy-ctor call
00076   MSG("Cand", Msg::kDebug)
00077     << "Begin CandFitTrackMSList::CandFitTrackMSList(const CandFitTrackMSList &rhs) ctor: " << endl
00078                                            << "UidInt = " << GetUidInt()
00079                            << ", ArchUidInt " << GetArchUidInt() << endl
00080                              << "No. of links = " << GetNLinks() << endl
00081       << "End CandFitTrackMSList::CandFitTrackMSList(const CandFitTrackMSList &rhs) ctor." << endl;
00082 }
00083 
00084 //______________________________________________________________________
00085 CandFitTrackMSList::~CandFitTrackMSList()
00086 {
00087   MSG("Cand", Msg::kDebug)
00088                        << "Begin CandFitTrackMSList::~CandFitTrackMSList() dtor: " << endl
00089                                            << "UidInt = " << GetUidInt()
00090                            << ", ArchUidInt " << GetArchUidInt() << endl
00091                              << "No. of links = " << GetNLinks() << endl
00092                          << "End CandFitTrackMSList::~CandFitTrackMSList() dtor." << endl;
00093 }
00094 
00095 //______________________________________________________________________
00096 void CandFitTrackMSList::CreateLocalHandle()
00097 {
00098   SetLocalHandle(new CandFitTrackMSListHandle(this));
00099 }
00100 
00101 //______________________________________________________________________
00102 CandFitTrackMSList *CandFitTrackMSList::Dup() const
00103 {
00104 
00105 // Base copy ctor dups owned pointers, but defers copying Daughter List.
00106 // Daughter List copy is made in the derived class Dup() function.
00107 // This is because base class copy constructor hasn't yet created
00108 // fLocalHandle with a CandHandle* of the full derived type.
00109   CandFitTrackMSList *cb = new CandFitTrackMSList(*this);         // Copy-ctor
00110   cb->CreateLocalHandle();   // Initializes fLocalHandle after copy-ctor
00111   TIter iterdau = GetDaughterIterator();
00112   CandHandle *dau;
00113   while ((dau=(CandHandle *) iterdau())) cb->AddDaughterLink(*dau);
00114   return cb;
00115 }
00116 
00117 //______________________________________________________________________
00118 CandFitTrackMSListHandle CandFitTrackMSList::MakeCandidate(AlgHandle &ah, CandContext &cx)
00119 {
00120   CandFitTrackMSListHandle cshl;
00121   new CandFitTrackMSList(ah, cshl, cx); //cshl owns the new CandFitTrackMSList
00122   return cshl;
00123 }

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