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

CandFitShowerEMList.cxx

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

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