00001
00002
00003
00004
00005
00006
00007
00009
00010 #include "Cluster3D/CandCluster3D.h"
00011 #include "Cluster3D/CandCluster3DHandle.h"
00012 #include "MessageService/MsgService.h"
00013 #include "Algorithm/AlgHandle.h"
00014 #include "Candidate/CandHandle.h"
00015 #include "Candidate/CandContext.h"
00016
00017 ClassImp(CandCluster3D)
00018
00019 CVSID("$Id: CandCluster3D.cxx,v 1.4 2007/03/01 17:24:59 rhatcher Exp $");
00020
00021
00022 CandCluster3D::CandCluster3D() :
00023 fTrackLike(0),
00024 fShowerLike(0)
00025 {
00026 MSG("Cluster3D", Msg::kDebug)
00027 << "Standard constructor " << endl;
00028 }
00029
00030
00031 CandCluster3D::CandCluster3D(AlgHandle &ah) :
00032 CandReco(ah),
00033 fTrackLike(0),
00034 fShowerLike(0)
00035 {
00036
00037
00038
00039
00040
00041
00042 }
00043
00044
00045 CandCluster3D::CandCluster3D(AlgHandle &ah, CandHandle &ch,
00046 CandContext &cx) :
00047 CandReco(ah),
00048 fTrackLike(0),
00049 fShowerLike(0)
00050 {
00051 CreateLocalHandle();
00052
00053
00054 {
00055 CandCluster3DHandle csh(this);
00056 ch = csh;
00057 }
00058
00059 ah.RunAlg(ch, cx);
00060 }
00061
00062
00063 CandCluster3D::CandCluster3D(const CandCluster3D &rhs) :
00064 CandReco(rhs),
00065 fTrackLike(0),
00066 fShowerLike(0)
00067 {
00068
00069
00070
00071 }
00072
00073
00074 CandCluster3D::~CandCluster3D()
00075 {
00076 MSG("Cluster3D", Msg::kDebug)
00077 << "Destructor " << endl;
00078 }
00079
00080
00081 void CandCluster3D::CreateLocalHandle()
00082 {
00083 SetLocalHandle(new CandCluster3DHandle(this));
00084 }
00085
00086
00087 CandCluster3D *CandCluster3D::Dup() const
00088 {
00089
00090
00091
00092
00093
00094 CandCluster3D *cb = new CandCluster3D(*this);
00095 cb->CreateLocalHandle();
00096 TIter iterdau = GetDaughterIterator();
00097 CandHandle *dau;
00098 while ((dau=(CandHandle *) iterdau())) cb->AddDaughterLink(*dau);
00099 return cb;
00100 }
00101
00102
00103 Bool_t CandCluster3D::IsEquivalent(const TObject *rhs) const
00104 {
00105 Bool_t result = true;
00106
00107 if (!CandReco::IsEquivalent(rhs)) result = false;
00108 TestDisplayCandBanner("CandCluster3D");
00109 const CandCluster3D* rCnd = dynamic_cast<const CandCluster3D*>(rhs);
00110 if (rCnd == NULL) return false;
00111
00112 result = TestEquality("fTrackLike", this->fTrackLike,
00113 rCnd->fTrackLike) && result;
00114
00115 result = TestEquality("fShowerLike", this->fShowerLike,
00116 rCnd->fShowerLike) && result;
00117 return result;
00118 }
00119
00120
00121 CandCluster3DHandle CandCluster3D::MakeCandidate(AlgHandle &ah,
00122 CandContext &cx)
00123 {
00124
00125 CandCluster3DHandle csh;
00126
00127
00128 new CandCluster3D(ah, csh, cx);
00129
00130 return csh;
00131 }