CandShowerSR Class Reference

#include <CandShowerSR.h>

Inheritance diagram for CandShowerSR:
CandShower CandReco CandBase CandRefCounted

List of all members.

Public Member Functions

 CandShowerSR ()
virtual std::ostream & FormatToOStream (std::ostream &os, Option_t *option="") const

Static Public Member Functions

static CandShowerSRHandle MakeCandidate (AlgHandle &ah, CandContext &cx)

Protected Member Functions

 CandShowerSR (AlgHandle &ah)
 CandShowerSR (AlgHandle &ah, CandHandle &ch, CandContext &cx)
 CandShowerSR (const CandShowerSR &rhs)
virtual ~CandShowerSR ()
virtual void CreateLocalHandle ()
virtual CandShowerSRDup () const
virtual Bool_t IsEquivalent (const TObject *rhs) const

Protected Attributes

TObjArray fSubShowerList
Int_t nUSubShowers
Int_t nVSubShowers

Friends

class CandShowerSRHandle

Detailed Description

Definition at line 17 of file CandShowerSR.h.


Constructor & Destructor Documentation

CandShowerSR::CandShowerSR (  ) 

Definition at line 21 of file CandShowerSR.cxx.

References Msg::kDebug, and MSG.

Referenced by Dup(), and MakeCandidate().

00021                            :
00022   nUSubShowers(0), nVSubShowers(0)
00023 {
00024   MSG("Cand", Msg::kDebug)
00025     << "Begin CandShowerSR::CandShowerSR() ctor: " << endl
00026     << "UidInt = " << GetUidInt()
00027     << ", ArchUidInt " << GetArchUidInt() << endl
00028     << "No. of links = " << GetNLinks() << endl
00029     << "End CandShowerSR::CandShowerSR() ctor." << endl;
00030 }

CandShowerSR::CandShowerSR ( AlgHandle ah  )  [protected]

Definition at line 33 of file CandShowerSR.cxx.

00033                                         :
00034   CandShower(ah),      // Should be the next class up on inheritance chain
00035   nUSubShowers(0), nVSubShowers(0)
00036 {
00037 
00038 // The sole purpose of this constructor is to transmit the AlgHandle
00039 // up the inheritance chain to CandBase without having to invoke the
00040 // full constructor of an intermediate Candidate type which the highest
00041 // level Candidate might inherit from.  One only wants to create the
00042 // LocalHandle and invoke the RunAlg() method in the lowest level class.
00043 }

CandShowerSR::CandShowerSR ( AlgHandle ah,
CandHandle ch,
CandContext cx 
) [protected]

Definition at line 46 of file CandShowerSR.cxx.

References CreateLocalHandle(), CandBase::GetArchUidInt(), CandRefCounted::GetNLinks(), CandBase::GetUidInt(), Msg::kDebug, MSG, and AlgHandle::RunAlg().

00046                                                                          :
00047   CandShower(ah),      // Should be the next class up on inheritance chain
00048   nUSubShowers(0), nVSubShowers(0)
00049 {
00050   CreateLocalHandle();
00051   MSG("Cand", Msg::kDebug)
00052     << "Begin CandShowerSR::CandShowerSR(AlgHandle &, CandHandle &, "
00053     << "CandContext &) ctor: " << endl
00054     << "UidInt = " << GetUidInt()
00055     << ", ArchUidInt " << GetArchUidInt() << endl
00056     << "No. of links = " << GetNLinks() << endl
00057     << "End CandShowerSR::CandShowerSR(AlgHandle &, CandHandle &, "
00058     << "CandContext &) ctor." << endl;
00059   
00060   // Run Algorithm to construct Candidate
00061   {                                                   // Start of scope.
00062     CandShowerSRHandle csh(this);              // csh will go out of scope
00063     ch = csh;                                       // after setting ch.
00064   }                                                     // End of scope.
00065   ah.RunAlg(ch, cx);
00066 }

CandShowerSR::CandShowerSR ( const CandShowerSR rhs  )  [protected]

Definition at line 69 of file CandShowerSR.cxx.

References CandHandle::DupHandle(), fSubShowerList, CandBase::GetArchUidInt(), CandRefCounted::GetNLinks(), CandBase::GetUidInt(), Msg::kDebug, and MSG.

00069                                                   :
00070   CandShower(rhs),     // Should be the next class up on inheritance chain
00071   nUSubShowers(rhs.nUSubShowers), nVSubShowers(rhs.nVSubShowers)
00072 {
00073 
00074   //CreateLocalHandle(); // Moved to Dup function following copy-ctor call
00075   MSG("Cand", Msg::kDebug)
00076     << "Begin CandShowerSR::CandShowerSR(const CandShowerSR &rhs) ctor: " << endl
00077     << "UidInt = " << GetUidInt()
00078     << ", ArchUidInt " << GetArchUidInt() << endl
00079     << "No. of links = " << GetNLinks() << endl
00080     << "End CandShowerSR::CandShowerSR(const CandShowerSR &rhs) ctor." << endl;
00081   
00082   // fSubShowerList contents owned from CandShowerSR version 1
00083   CandHandle *ch;
00084   TIter ssiter(&rhs.fSubShowerList);
00085   while ((ch = dynamic_cast<CandHandle *>(ssiter())))
00086     fSubShowerList.Add(ch->DupHandle());
00087 }

CandShowerSR::~CandShowerSR (  )  [protected, virtual]

Definition at line 90 of file CandShowerSR.cxx.

References fSubShowerList, CandBase::GetArchUidInt(), CandRefCounted::GetNLinks(), CandBase::GetUidInt(), Msg::kDebug, and MSG.

00091 {
00092   MSG("Cand", Msg::kDebug)
00093     << "Begin CandShowerSR::~CandShowerSR() dtor: " << endl
00094     << "UidInt = " << GetUidInt()
00095     << ", ArchUidInt " << GetArchUidInt() << endl
00096     << "No. of links = " << GetNLinks() << endl
00097     << "End CandShowerSR::~CandShowerSR() dtor." << endl;
00098   
00099   fSubShowerList.Delete();   // Owned CandHandle*'s from CandShowerSR vers 1
00100 }


Member Function Documentation

void CandShowerSR::CreateLocalHandle (  )  [protected, virtual]

Reimplemented from CandShower.

Definition at line 103 of file CandShowerSR.cxx.

References CandShowerSRHandle, and CandBase::SetLocalHandle().

Referenced by CandShowerSR(), and Dup().

00104 {
00105   SetLocalHandle(new CandShowerSRHandle(this));
00106 }

CandShowerSR * CandShowerSR::Dup (  )  const [protected, virtual]

Reimplemented from CandShower.

Definition at line 109 of file CandShowerSR.cxx.

References CandBase::AddDaughterLink(), CandShowerSR(), CreateLocalHandle(), and CandBase::GetDaughterIterator().

00110 {
00111   
00112 // Base copy ctor dups owned pointers, but defers copying Daughter List.
00113 // Daughter List copy is made in the derived class Dup() function.
00114 // This is because base class copy constructor hasn't yet created
00115 // fLocalHandle with a CandHandle* of the full derived type.
00116   CandShowerSR *cb = new CandShowerSR(*this);         // Copy-ctor dups ptrs
00117   cb->CreateLocalHandle();   // Initializes fLocalHandle after copy-ctor
00118   TIter iterdau = GetDaughterIterator();
00119   CandHandle *dau;
00120   while ((dau=(CandHandle *) iterdau())) cb->AddDaughterLink(*dau);
00121   return cb;
00122 }

std::ostream & CandShowerSR::FormatToOStream ( std::ostream &  os,
Option_t *  option = "" 
) const [virtual]

Reimplemented from CandShower.

Definition at line 152 of file CandShowerSR.cxx.

References fSubShowerList, CandBase::GetDataIndent(), CandBase::GetIndentString(), nUSubShowers, and nVSubShowers.

00154 {
00155   CandShower::FormatToOStream(os,option);
00156 
00157   TString opt(option);
00158   if (!opt.Contains("v0")) { // v0 means suppress the data values
00159     const TString& indent = GetIndentString();
00160     
00161     os << indent << GetDataIndent()
00162        << "fSubShowerList.size " << fSubShowerList.GetSize()
00163        << " Num U SubShowers " << nUSubShowers
00164        << " Num V SubShowers " << nVSubShowers
00165        << endl;
00166   }
00167   return os; 
00168 }

Bool_t CandShowerSR::IsEquivalent ( const TObject *  rhs  )  const [protected, virtual]

Reimplemented from CandShower.

Definition at line 125 of file CandShowerSR.cxx.

References fSubShowerList, CandShower::IsEquivalent(), nUSubShowers, nVSubShowers, CandBase::TestDisplayCandBanner(), CandBase::TestEquality(), and CandBase::TestTObjArrayCandHandleDup().

00126 {
00127   Bool_t result = true;
00128   if (!CandShower::IsEquivalent(rhs)) result = false;   // superclass test
00129   TestDisplayCandBanner("CandShowerSR");
00130   const CandShowerSR* rCnd = dynamic_cast<const CandShowerSR*>(rhs);
00131   if (rCnd == NULL) return false;
00132   
00133   result = TestTObjArrayCandHandleDup("fSubShowerList", 
00134                                       this->fSubShowerList,
00135                                       rCnd->fSubShowerList) && result;
00136   result = TestEquality("nUSubShowers",this->nUSubShowers,rCnd->nUSubShowers) && result;
00137   result = TestEquality("nVSubShowers",this->nVSubShowers,rCnd->nVSubShowers) && result;
00138 
00139   return result;
00140 }

CandShowerSRHandle CandShowerSR::MakeCandidate ( AlgHandle ah,
CandContext cx 
) [static]

Reimplemented from CandShower.

Definition at line 143 of file CandShowerSR.cxx.

References CandShowerSR().

Referenced by AlgEventSSList::BuildEventFromUnassoc(), AlgEventSSList::CreatePrimaryShower(), and AlgShowerSSList::RunAlg().

00145 {
00146   CandShowerSRHandle csh;
00147   new CandShowerSR(ah, csh, cx);            // csh owns the new CandShowerSR
00148   return csh;
00149 }


Friends And Related Function Documentation

friend class CandShowerSRHandle [friend]

Reimplemented from CandShower.

Definition at line 19 of file CandShowerSR.h.

Referenced by CreateLocalHandle().


Member Data Documentation

TObjArray CandShowerSR::fSubShowerList [protected]

Definition at line 37 of file CandShowerSR.h.

Referenced by CandShowerSR(), FormatToOStream(), IsEquivalent(), and ~CandShowerSR().

Int_t CandShowerSR::nUSubShowers [protected]

Definition at line 39 of file CandShowerSR.h.

Referenced by FormatToOStream(), and IsEquivalent().

Int_t CandShowerSR::nVSubShowers [protected]

Definition at line 40 of file CandShowerSR.h.

Referenced by FormatToOStream(), and IsEquivalent().


The documentation for this class was generated from the following files:

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1