00001
00002
00003
00004
00005
00007
00008 #include "TClass.h"
00009
00010 #include "Algorithm/AlgHandle.h"
00011 #include "MessageService/MsgService.h"
00012 #include "CandShowerSR/CandShowerSR.h"
00013 #include "CandShowerSR/CandShowerSRHandle.h"
00014
00015 ClassImp(CandShowerSR)
00016
00017
00018 CVSID("$Id: CandShowerSR.cxx,v 1.11 2005/08/28 00:17:19 gmieg Exp $");
00019
00020
00021 CandShowerSR::CandShowerSR() :
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 }
00031
00032
00033 CandShowerSR::CandShowerSR(AlgHandle &ah) :
00034 CandShower(ah),
00035 nUSubShowers(0), nVSubShowers(0)
00036 {
00037
00038
00039
00040
00041
00042
00043 }
00044
00045
00046 CandShowerSR::CandShowerSR(AlgHandle &ah, CandHandle &ch, CandContext &cx) :
00047 CandShower(ah),
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
00061 {
00062 CandShowerSRHandle csh(this);
00063 ch = csh;
00064 }
00065 ah.RunAlg(ch, cx);
00066 }
00067
00068
00069 CandShowerSR::CandShowerSR(const CandShowerSR &rhs) :
00070 CandShower(rhs),
00071 nUSubShowers(rhs.nUSubShowers), nVSubShowers(rhs.nVSubShowers)
00072 {
00073
00074
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
00083 CandHandle *ch;
00084 TIter ssiter(&rhs.fSubShowerList);
00085 while ((ch = dynamic_cast<CandHandle *>(ssiter())))
00086 fSubShowerList.Add(ch->DupHandle());
00087 }
00088
00089
00090 CandShowerSR::~CandShowerSR()
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();
00100 }
00101
00102
00103 void CandShowerSR::CreateLocalHandle()
00104 {
00105 SetLocalHandle(new CandShowerSRHandle(this));
00106 }
00107
00108
00109 CandShowerSR *CandShowerSR::Dup() const
00110 {
00111
00112
00113
00114
00115
00116 CandShowerSR *cb = new CandShowerSR(*this);
00117 cb->CreateLocalHandle();
00118 TIter iterdau = GetDaughterIterator();
00119 CandHandle *dau;
00120 while ((dau=(CandHandle *) iterdau())) cb->AddDaughterLink(*dau);
00121 return cb;
00122 }
00123
00124
00125 Bool_t CandShowerSR::IsEquivalent(const TObject *rhs) const
00126 {
00127 Bool_t result = true;
00128 if (!CandShower::IsEquivalent(rhs)) result = false;
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 }
00141
00142
00143 CandShowerSRHandle CandShowerSR::MakeCandidate(AlgHandle &ah,
00144 CandContext &cx)
00145 {
00146 CandShowerSRHandle csh;
00147 new CandShowerSR(ah, csh, cx);
00148 return csh;
00149 }
00150
00151
00152 std::ostream& CandShowerSR::FormatToOStream(std::ostream& os,
00153 Option_t *option) const
00154 {
00155 CandShower::FormatToOStream(os,option);
00156
00157 TString opt(option);
00158 if (!opt.Contains("v0")) {
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 }