00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00014
00015 #include "Algorithm/AlgHandle.h"
00016 #include "CandDigit/CandDigitList.h"
00017 #include "CandDigit/CandDigitListHandle.h"
00018 #include "MessageService/MsgService.h"
00019 #include "MessageService/MsgFormat.h"
00020
00021 ClassImp(CandDigitList)
00022
00023
00024 CVSID("$Id: CandDigitList.cxx,v 1.11 2009/08/06 19:24:02 gmieg Exp $");
00025
00026
00027 CandDigitList::CandDigitList() :
00028 fAbsTime(0),
00029 fIsSparse(true)
00030 {
00031
00032 MSG("Cand", Msg::kDebug)
00033 << "Begin CandDigitList::CandDigitList() ctor: " << endl
00034 << "UidInt = " << GetUidInt()
00035 << ", ArchUidInt " << GetArchUidInt() << endl
00036 << "No. of links = " << GetNLinks() << endl
00037 << "End CandDigitList::CandDigitList() ctor." << endl;
00038 }
00039
00040
00041 CandDigitList::CandDigitList(AlgHandle &ah) :
00042 CandBase(ah),
00043 fAbsTime(0),
00044 fIsSparse(true)
00045 {
00046
00047
00048
00049
00050
00051
00052
00053 }
00054
00055
00056 CandDigitList::CandDigitList(AlgHandle &ah, CandHandle &ch,
00057 CandContext &cx) :
00058 CandBase(ah),
00059 fAbsTime(0),
00060 fIsSparse(true)
00061 {
00062 CreateLocalHandle();
00063 #ifdef ENABLE_DEBUG_MSG
00064 MSG("Cand", Msg::kDebug)
00065 << "Begin CandDigitList::CandDigitList(AlgHandle &, CandHandle &, "
00066 << "CandContext& ) ctor: " << endl
00067 << "UidInt = " << GetUidInt()
00068 << ", ArchUidInt " << GetArchUidInt() << endl
00069 << "No. of links = " << GetNLinks() << endl
00070 << "End CandDigitList::CandDigitList(AlgHandle &, CandHandle &, "
00071 << "CandContext& ) ctor: " << endl;
00072 #endif
00073
00074
00075 {
00076 CandDigitListHandle cdlh(this);
00077 ch = cdlh;
00078 }
00079 ah.RunAlg(ch, cx);
00080 }
00081
00082
00083 CandDigitList::CandDigitList(const CandDigitList &rhs) :
00084 CandBase(rhs)
00085 , fAbsTime(rhs.fAbsTime)
00086 , fIsSparse(rhs.fIsSparse)
00087 {
00088
00089 MSG("Cand", Msg::kDebug)
00090 << "Begin CandDigitList::CandDigitList(const CandDigitList &) "
00091 << "ctor: " << endl
00092 << "UidInt = " << GetUidInt()
00093 << ", ArchUidInt " << GetArchUidInt() << endl
00094 << "No. of links = " << GetNLinks() << endl
00095 << "End CandDigitList::CandDigitList(const CandDigitList &) ctor."
00096 << endl;
00097 }
00098
00099
00100 CandDigitList::~CandDigitList()
00101 {
00102 MSG("Cand", Msg::kDebug)
00103 << "Begin CandDigitList::~CandDigitList() " << "dtor: " << endl
00104 << "UidInt = " << GetUidInt()
00105 << ", ArchUidInt " << GetArchUidInt() << endl
00106 << "No. of links = " << GetNLinks() << endl
00107 << "End CandDigitList::~CandDigitList() dtor." << endl;
00108 }
00109
00110
00111 void CandDigitList::CreateLocalHandle()
00112 {
00113 SetLocalHandle(new CandDigitListHandle(this));
00114 }
00115
00116
00117 CandDigitList *CandDigitList::Dup() const
00118 {
00119
00120
00121
00122
00123
00124 CandDigitList *cb = new CandDigitList(*this);
00125 cb->CreateLocalHandle();
00126 TIter iterdau = GetDaughterIterator();
00127 CandHandle *dau;
00128 while ((dau=(CandHandle *) iterdau())) cb->AddDaughterLink(*dau);
00129 return cb;
00130 }
00131
00132
00133 Bool_t CandDigitList::IsEquivalent(const TObject *rhs) const
00134 {
00135 Bool_t result = true;
00136 if (!CandBase::IsEquivalent(rhs)) result = false;
00137 TestDisplayCandBanner("CandDigitList");
00138 const CandDigitList* rCnd = dynamic_cast<const CandDigitList*>(rhs);
00139 if (rCnd == NULL) return false;
00140
00141 result = TestEquality("fAbsTime", this->fAbsTime,
00142 rCnd->fAbsTime) && result;
00143 result = TestEquality("fIsSparse", this->fIsSparse,
00144 rCnd->fIsSparse) && result;
00145
00146 return result;
00147 }
00148
00149
00150 CandDigitListHandle CandDigitList::MakeCandidate(AlgHandle &ah,
00151 CandContext &cx)
00152 {
00153 CandDigitListHandle cdlh;
00154 new CandDigitList(ah, cdlh, cx);
00155 return cdlh;
00156 }
00157
00158
00159 std::ostream& CandDigitList::FormatToOStream(std::ostream& os,
00160 Option_t *option) const
00161 {
00162 CandBase::FormatToOStream(os,option);
00163
00164 TString opt(option);
00165 if (!opt.Contains("v0")) {
00166 const TString& indent = GetIndentString();
00167
00168 static MsgFormat timefmt("f18.9");
00169 os << indent << GetDataIndent()
00170 << "AbsTime " << timefmt(fAbsTime)
00171 << " " << (fIsSparse?"Is":"IsNot") << "Sparse"
00172 << endl;
00173 }
00174 return os;
00175
00176 }
00177
00178