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

CandShowerEMList.cxx

Go to the documentation of this file.
00001 
00002 // $Id: CandShowerEMList.cxx,v 1.1 2004/07/14 20:10:25 cbs Exp $
00003 //
00004 // CandShowerEMList
00005 //
00006 // This is a concrete Event Candidate (Reconstruction) object.
00007 // CandShowerEMList is descended from CandShowerList.
00008 //
00009 // Each concrete CandBase must define a Dup function.
00010 // CandBase must grant friendship to class CandRefer.
00011 //
00012 // Author:  R. Lee 2001.02.21
00014 
00015 #include "Algorithm/AlgHandle.h"
00016 #include "CandShowerEM/CandShowerEMList.h"
00017 #include "CandShowerEM/CandShowerEMListHandle.h"
00018 #include "MessageService/MsgService.h"
00019 
00020 ClassImp(CandShowerEMList)
00021 
00022 //______________________________________________________________________
00023 CVSID("$Id: CandShowerEMList.cxx,v 1.1 2004/07/14 20:10:25 cbs Exp $");
00024 
00025 //______________________________________________________________________
00026 CandShowerEMList::CandShowerEMList()
00027 {
00028   MSG("Cand", Msg::kDebug)
00029           << "Begin CandShowerEMList::CandShowerEMList() ctor: " << endl
00030                                            << "UidInt = " << GetUidInt()
00031                            << ", ArchUidInt " << GetArchUidInt() << endl
00032                              << "No. of links = " << GetNLinks() << endl
00033             << "End CandShowerEMList::CandShowerEMList() ctor." << endl;
00034 }
00035 
00036 //______________________________________________________________________
00037 CandShowerEMList::CandShowerEMList(AlgHandle &ah) :
00038   CandShowerList(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 CandShowerEMList::CandShowerEMList(AlgHandle &ah, CandHandle &ch,
00050                                                       CandContext &cx) :
00051   CandShowerList(ah) // Should be the next class up on inheritance chain
00052 {
00053   CreateLocalHandle();
00054   MSG("Cand", Msg::kDebug)
00055                            << "Begin CandShowerEMList::CandShowerEMList"
00056     << "(AlgHandle &, CandHandle &, " << "CandContext &) ctor: " << endl
00057                                            << "UidInt = " << GetUidInt()
00058                            << ", ArchUidInt " << GetArchUidInt() << endl
00059                              << "No. of links = " << GetNLinks() << endl
00060                              << "End CandShowerEMList::CandShowerEMList"
00061     << "(AlgHandle &, CandHandle &, " << "CandContext &) ctor." << endl;
00062 
00063 // Run Algorithm to construct Candidate
00064    {                                                   // Start of scope
00065      CandShowerEMListHandle 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 CandShowerEMList::CandShowerEMList(const CandShowerEMList &rhs) :
00073   CandShowerList(rhs) //Should be the next class up on inheritance chain
00074 {
00075 
00076 //CreateLocalHandle(); // Moved to Dup function following copy-ctor call
00077   MSG("Cand", Msg::kDebug)
00078                            << "Begin CandShowerEMList::CandShowerEMList"
00079                        << "(const CandShowerEMList &rhs) ctor: " << endl
00080                                            << "UidInt = " << GetUidInt()
00081                            << ", ArchUidInt " << GetArchUidInt() << endl
00082                              << "No. of links = " << GetNLinks() << endl
00083                              << "End CandShowerEMList::CandShowerEMList"
00084                        << "(const CandShowerEMList &rhs) ctor." << endl;
00085 }
00086 
00087 //______________________________________________________________________
00088 CandShowerEMList::~CandShowerEMList()
00089 {
00090   MSG("Cand", Msg::kDebug)
00091          << "Begin CandShowerEMList::~CandShowerEMList() dtor: " << endl
00092                                            << "UidInt = " << GetUidInt()
00093                            << ", ArchUidInt " << GetArchUidInt() << endl
00094                              << "No. of links = " << GetNLinks() << endl
00095            << "End CandShowerEMList::~CandShowerEMList() dtor." << endl;
00096 }
00097 
00098 //______________________________________________________________________
00099 void CandShowerEMList::CreateLocalHandle()
00100 {
00101   SetLocalHandle(new CandShowerEMListHandle(this));
00102 }
00103 
00104 //______________________________________________________________________
00105 CandShowerEMList *CandShowerEMList::Dup() const
00106 {
00107 
00108 // Base copy ctor dups owned pointers, but defers copying Daughter List.
00109 // Daughter List copy is made in the derived class Dup() function.
00110 // This is because base class copy constructor hasn't yet created
00111 // fLocalHandle with a CandHandle* of the full derived type.
00112   CandShowerEMList *cb = new CandShowerEMList(*this);       // Copy-ctor
00113   cb->CreateLocalHandle();   // Initializes fLocalHandle after copy-ctor
00114   TIter iterdau = GetDaughterIterator();
00115   CandHandle *dau;
00116   while ((dau=(CandHandle *) iterdau())) cb->AddDaughterLink(*dau);
00117   return cb;
00118 }
00119 
00120 //______________________________________________________________________
00121 Bool_t CandShowerEMList::IsEquivalent(const TObject *rhs) const
00122 {
00123   Bool_t result = true;
00124   if (!CandShowerList::IsEquivalent(rhs)) result = false;  // superclass
00125   TestDisplayCandBanner("CandShowerEMList");
00126   const CandShowerEMList* rCnd =
00127                              dynamic_cast<const CandShowerEMList*>(rhs);
00128   if (rCnd == NULL) return false;
00129 
00130   TestNothing("CandShowerEMList");
00131   
00132   return result;  
00133 }
00134 
00135 //______________________________________________________________________
00136 CandShowerEMListHandle CandShowerEMList::MakeCandidate(AlgHandle &ah,
00137                                                         CandContext &cx)
00138 {
00139   CandShowerEMListHandle cshl;
00140   new CandShowerEMList(ah, cshl, cx);  // cshl owns new CandShowerEMList
00141   return cshl;
00142 }

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