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

CandSubShowerSRList.cxx

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

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