00001
00002
00003
00004
00005
00007
00008 #include "TClass.h"
00009
00010 #include "Algorithm/AlgHandle.h"
00011 #include "CandShowerEM/CandShowerEM.h"
00012 #include "CandShowerEM/CandShowerEMHandle.h"
00013 #include "MessageService/MsgService.h"
00014
00015 ClassImp(CandShowerEM)
00016
00017
00018 CVSID("$Id: CandShowerEM.cxx,v 1.4 2005/09/26 09:24:26 cbs Exp $");
00019
00020
00021 CandShowerEM::CandShowerEM()
00022 : ShwStatus(-1)
00023 {
00024 MSG("Cand", Msg::kDebug)
00025 << "Begin CandShowerEM::CandShowerEM() ctor: " << endl
00026 << "UidInt = " << GetUidInt()
00027 << ", ArchUidInt " << GetArchUidInt() << endl
00028 << "No. of links = " << GetNLinks() << endl
00029 << "End CandShowerEM::CandShowerEM() ctor." << endl;
00030
00031 for(int i=0;i<8;i++) {
00032 EigenVector[i]=0;
00033 if(i<5) {
00034 OutPH[i]=0;
00035 if(i<4) {
00036 EigenValue[i]=0;
00037 AvgDev[i]=0;
00038 }
00039 }
00040 }
00041
00042 }
00043
00044
00045 CandShowerEM::CandShowerEM(AlgHandle &ah) :
00046 CandShower(ah)
00047 ,ShwStatus(-1)
00048 {
00049
00050
00051
00052
00053
00054
00055
00056 for(int i=0;i<8;i++) {
00057 EigenVector[i]=0;
00058 if(i<5) {
00059 OutPH[i]=0;
00060 if(i<4) {
00061 EigenValue[i]=0;
00062 AvgDev[i]=0;
00063 }
00064 }
00065 }
00066
00067 }
00068
00069
00070 CandShowerEM::CandShowerEM(AlgHandle &ah, CandHandle &ch,
00071 CandContext &cx) :
00072 CandShower(ah)
00073 ,ShwStatus(-1)
00074 {
00075 CreateLocalHandle();
00076 MSG("Cand", Msg::kDebug)
00077 << "Begin CandShowerEM::CandShowerEM(AlgHandle &, CandHandle &, "
00078 << "CandContext &) ctor: " << endl
00079 << "UidInt = " << GetUidInt()
00080 << ", ArchUidInt " << GetArchUidInt() << endl
00081 << "No. of links = " << GetNLinks() << endl
00082 << "End CandShowerEM::CandShowerEM(AlgHandle &, CandHandle &, "
00083 << "CandContext &) ctor." << endl;
00084
00085 for(int i=0;i<8;i++) {
00086 EigenVector[i]=0;
00087 if(i<5) {
00088 OutPH[i]=0;
00089 if(i<4) {
00090 EigenValue[i]=0;
00091 AvgDev[i]=0;
00092 }
00093 }
00094 }
00095
00096
00097 {
00098 CandShowerEMHandle csh(this);
00099 ch = csh;
00100 }
00101 ah.RunAlg(ch, cx);
00102
00103 }
00104
00105
00106 CandShowerEM::CandShowerEM(const CandShowerEM &rhs) :
00107 CandShower(rhs)
00108 ,ShwStatus(-1)
00109 {
00110
00111 MSG("Cand", Msg::kDebug)
00112 << "Begin CandShowerEM::CandShowerEM(const CandShowerEM &rhs) ctor:"
00113 << endl << "UidInt = " << GetUidInt()
00114 << ", ArchUidInt " << GetArchUidInt() << endl
00115 << "No. of links = " << GetNLinks() << endl
00116 << "End CandShowerEM::CandShowerEM(const CandShowerEM &rhs) ctor."
00117 << endl;
00118
00119 for(int i=0;i<8;i++) {
00120 EigenVector[i] = rhs.EigenVector[i];
00121 if(i<5) {
00122 OutPH[i] = rhs.OutPH[i];
00123 if(i<4){
00124 EigenValue[i] = rhs.EigenValue[i];
00125 AvgDev[i] = rhs.AvgDev[i];
00126 }
00127 }
00128 }
00129 ShwStatus = rhs.ShwStatus;
00130
00131 }
00132
00133
00134 CandShowerEM::~CandShowerEM()
00135 {
00136 MSG("Cand", Msg::kDebug)
00137 << "Begin CandShowerEM::~CandShowerEM() dtor: " << endl
00138 << "UidInt = " << GetUidInt()
00139 << ", ArchUidInt " << GetArchUidInt() << endl
00140 << "No. of links = " << GetNLinks() << endl
00141 << "End CandShowerEM::~CandShowerEM() dtor." << endl;
00142
00143 }
00144
00145
00146 void CandShowerEM::CreateLocalHandle()
00147 {
00148 SetLocalHandle(new CandShowerEMHandle(this));
00149 }
00150
00151
00152 CandShowerEM *CandShowerEM::Dup() const
00153 {
00154
00155
00156
00157
00158
00159 CandShowerEM *cb = new CandShowerEM(*this);
00160 cb->CreateLocalHandle();
00161 TIter iterdau = GetDaughterIterator();
00162 CandHandle *dau;
00163 while ((dau=(CandHandle *) iterdau())) cb->AddDaughterLink(*dau);
00164 return cb;
00165 }
00166
00167
00168 Bool_t CandShowerEM::IsEquivalent(const TObject *rhs) const
00169 {
00170 Bool_t result = true;
00171 if (!CandShower::IsEquivalent(rhs)) result = false;
00172 TestDisplayCandBanner("CandShowerEM");
00173 const CandShowerEM* rCnd = dynamic_cast<const CandShowerEM*>(rhs);
00174 if (rCnd == NULL) return false;
00175
00176 if(dynamic_cast<const CandShowerEM*>(rhs)->ShwStatus!=ShwStatus)
00177 return false;
00178
00179 for(int i=0;i<8;i++){
00180
00181 if(dynamic_cast<const CandShowerEM*>(rhs)->EigenVector[i]!=EigenVector[i])
00182 return false;
00183
00184 if(i<5) {
00185
00186 if(dynamic_cast<const CandShowerEM*>(rhs)->EigenValue[i]!=EigenValue[i])
00187 return false;
00188
00189 if(i<4) {
00190
00191 if(dynamic_cast<const CandShowerEM*>(rhs)->AvgDev[i]!=AvgDev[i])
00192 return false;
00193
00194 if(dynamic_cast<const CandShowerEM*>(rhs)->OutPH[i]!=OutPH[i])
00195 return false;
00196
00197 }
00198 }
00199 }
00200
00201 return result;
00202 }
00203
00204
00205 CandShowerEMHandle CandShowerEM::MakeCandidate(AlgHandle &ah,
00206 CandContext &cx)
00207 {
00208 CandShowerEMHandle csh;
00209 new CandShowerEM(ah, csh, cx);
00210 return csh;
00211 }
00212