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

CandFitTrack3List.cxx

Go to the documentation of this file.
00001 
00002 // $Id: CandFitTrack3List.cxx,v 1.1 2003/06/05 16:24:55 rjn Exp $
00003 //
00004 // CandFitTrack3List
00005 //
00006 // This is a concrete Event Candidate (Reconstruction) object.
00007 // CandFitTrack3List is descended from CandFitTrackList.
00008 //
00009 // Each concrete CandBase must define a Dup function.
00010 // CandBase must grant friendship to class CandRefer.
00011 //
00012 // Author:  R. Lee 2001.03.30
00013 //
00014 // Also see <a href="../../root_crib/index.html">The ROOT Crib</a> and 
00015 // <a href="../CandFitTrack3List.html"> CandFitTrack3List Classes</a> (part of
00016 // <a href="../index.html">The MINOS Class User Guide</a>)End_Html
00018 
00019 #include "Algorithm/AlgHandle.h"
00020 #include "CandFitTrack3/CandFitTrack3List.h"
00021 #include "CandFitTrack3/CandFitTrack3ListHandle.h"
00022 #include "MessageService/MsgService.h"
00023 
00024 ClassImp(CandFitTrack3List)
00025 
00026 //______________________________________________________________________
00027 CVSID("$Id: CandFitTrack3List.cxx,v 1.1 2003/06/05 16:24:55 rjn Exp $");
00028 
00029 //______________________________________________________________________
00030 CandFitTrack3List::CandFitTrack3List()
00031 {
00032   MSG("Cand", Msg::kDebug)
00033       << "Begin CandFitTrack3List::CandFitTrack3List() ctor: " << endl
00034       << "UidInt = " << GetUidInt()
00035       << ", ArchUidInt " << GetArchUidInt() << endl
00036       << "No. of links = " << GetNLinks() << endl
00037       << "End CandFitTrack3List::CandFitTrack3List() ctor." << endl;
00038 }
00039 
00040 //______________________________________________________________________
00041 CandFitTrack3List::CandFitTrack3List(AlgHandle &ah) :
00042   CandFitTrackList(ah)  // Should be the next class up on inheritance chain
00043 {
00044 
00045 // The sole purpose of this constructor is to transmit the AlgHandle
00046 // up the inheritance chain to CandBase without having to invoke the
00047 // full constructor of an intermediate Candidate type which the highest
00048 // level Candidate might inherit from.  One only wants to create the
00049 // LocalHandle and invoke the RunAlg() method in the lowest level class.
00050 
00051 }
00052 
00053 //______________________________________________________________________
00054 CandFitTrack3List::CandFitTrack3List(AlgHandle &ah, CandHandle &ch, CandContext &cx) :
00055   CandFitTrackList(ah)  // Should be the next class up on inheritance chain
00056 {
00057   CreateLocalHandle();
00058   MSG("Cand", Msg::kDebug)
00059       << "Begin CandFitTrack3List::CandFitTrack3List(AlgHandle &, CandHandle &, "
00060       << "CandContext &) ctor: " << endl
00061       << "UidInt = " << GetUidInt()
00062       << ", ArchUidInt " << GetArchUidInt() << endl
00063       << "No. of links = " << GetNLinks() << endl
00064       << "End CandFitTrack3List::CandFitTrack3List(AlgHandle &, CandHandle &, "
00065       << "CandContext &) ctor." << endl;
00066 
00067 // Run Algorithm to construct Candidate
00068    {                                         // Start of scope.
00069        CandFitTrack3ListHandle cftlh(this);              // cshl will go out of scope
00070        ch = cftlh;                               // after setting ch.
00071    }                                         // End of scope.
00072    ah.RunAlg(ch, cx);
00073 }
00074 
00075 //______________________________________________________________________
00076 CandFitTrack3List::CandFitTrack3List(const CandFitTrack3List &rhs) :
00077   CandFitTrackList(rhs) // Should be the next class up on inheritance chain
00078 {
00079 //CreateLocalHandle(); // Moved to Dup function following copy-ctor call
00080   MSG("Cand", Msg::kDebug)
00081       << "Begin CandFitTrack3List::CandFitTrack3List(const CandFitTrack3List &rhs) ctor: " << endl
00082       << "UidInt = " << GetUidInt()
00083       << ", ArchUidInt " << GetArchUidInt() << endl
00084       << "No. of links = " << GetNLinks() << endl
00085       << "End CandFitTrack3List::CandFitTrack3List(const CandFitTrack3List &rhs) ctor." << endl;
00086 }
00087 
00088 //______________________________________________________________________
00089 CandFitTrack3List::~CandFitTrack3List()
00090 {
00091   MSG("Cand", Msg::kDebug)
00092       << "Begin CandFitTrack3List::~CandFitTrack3List() dtor: " << endl
00093       << "UidInt = " << GetUidInt()
00094       << ", ArchUidInt " << GetArchUidInt() << endl
00095       << "No. of links = " << GetNLinks() << endl
00096       << "End CandFitTrack3List::~CandFitTrack3List() dtor." << endl;
00097 }
00098 
00099 //______________________________________________________________________
00100 void CandFitTrack3List::CreateLocalHandle()
00101 {
00102   SetLocalHandle(new CandFitTrack3ListHandle(this));
00103 }
00104 
00105 //______________________________________________________________________
00106 CandFitTrack3List *CandFitTrack3List::Dup() const
00107 {
00108 
00109 // Base copy ctor dups owned pointers, but defers copying Daughter List.
00110 // Daughter List copy is made in the derived class Dup() function.
00111 // This is because base class copy constructor hasn't yet created
00112 // fLocalHandle with a CandHandle* of the full derived type.
00113   CandFitTrack3List *cb = new CandFitTrack3List(*this);         // Copy-ctor
00114   cb->CreateLocalHandle();   // Initializes fLocalHandle after copy-ctor
00115   TIter iterdau = GetDaughterIterator();
00116   CandHandle *dau;
00117   while ((dau=(CandHandle *) iterdau())) cb->AddDaughterLink(*dau);
00118   return cb;
00119 }
00120 
00121 //______________________________________________________________________
00122 CandFitTrack3ListHandle CandFitTrack3List::MakeCandidate(AlgHandle &ah, CandContext &cx)
00123 {
00124     CandFitTrack3ListHandle cftlh;
00125     new CandFitTrack3List(ah, cftlh, cx);//cftlh owns the new CandFitTrack3List
00126     return cftlh;
00127 }

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