#include <CandBase.h>
Inheritance diagram for CandBase:

Public Member Functions | |
| CandBase () | |
| virtual void | Trace (const char *c="") const |
| virtual std::ostream & | FormatToOStream (std::ostream &os, Option_t *option="") const |
| virtual std::ostream & | FormatDaughtersToOStream (std::ostream &os, Option_t *option="") const |
Static Public Member Functions | |
| Int_t | GetNAlloc () |
Protected Member Functions | |
| CandBase (const AlgHandle &ah) | |
| CandBase (const CandBase &cb) | |
| virtual | ~CandBase () |
| const CandHandle * | AddDaughterLink (const CandHandle &ch) |
| virtual void | CreateLocalHandle ()=0 |
| virtual CandBase * | Dup () const =0 |
| AlgConfig * | GetAlgConfig () const |
| UInt_t | GetArchUidInt () const |
| const CandUid & | GetCandUid () const |
| const CandHandle * | GetDaughter (Int_t ndau) const |
| TIter | GetDaughterIterator () const |
| const CandHandle * | GetLocalHandle () const |
| Int_t | GetNDaughters () const |
| UInt_t | GetUidInt () const |
| Bool_t | HasOverlapWith (const CandBase &cb) const |
| Bool_t | IsComposite () const |
| virtual Bool_t | IsEquivalent (const TObject *rhs) const |
| Bool_t | RemoveDaughter (CandHandle *ch) |
| void | SetCandRecord (CandRecord *cr) |
| void | SetLocalHandle (CandHandle *ch) |
| template<class mType> | |
| Bool_t | TestArrayEquality (const char *mbrName, int arrLen, const mType &thisMbr, const mType &rhsMbr) const |
| template<class chType> | |
| Bool_t | TestCandHandleDup (const char *chName, const chType *thisCH, const chType *rCndCH) const |
| template<class _char> | |
| void | TestDisplayCandBanner (_char *mName) const |
| template<class mType> | |
| Bool_t | TestEquality (const char *mbrName, const mType &thisMbr, const mType &rhsMbr) const |
| template<class mType> | |
| Bool_t | TestEquivalence (const char *mName, const mType &thisMbr, const mType &rhsMbr) const |
| template<class elemType> | |
| Bool_t | TestGenericElemPtrTObjArrayPtrEquality (const char *arrName, const TObjArray *thisTOA, const TObjArray *rCndTOA) const |
| template<class elemType> | |
| Bool_t | TestGenericElemPtrTObjArrayPtrEquivalence (const char *arrName, const TObjArray *thisTOA, const TObjArray *rCndTOA, Bool_t testEquivalence=true) const |
| template<class _char> | |
| void | TestNothing (_char *mName="Candidate") const |
| template<class mType> | |
| Bool_t | TestPtrEquivalence (const char *mName, const mType *thisMbr, const mType *rhsMbr) const |
| template<class toaType> | |
| Bool_t | TestTObjArrayCandHandleDup (const char *arrName, const toaType &thisTOA, const toaType &rCndTOA) const |
| template<class toaType> | |
| Bool_t | TestTObjArrayEquality (const char *arrName, const toaType &thisTOA, const toaType &rCndTOA) const |
| template<class toaType> | |
| Bool_t | TestTObjArrayPtrEquality (const char *arrName, const toaType *thisTOA, const toaType *rCndTOA) const |
| template<class toaType> | |
| Bool_t | TestTObjArrayPtrEquivalence (const char *arrName, const toaType *thisTOA, const toaType *rCndTOA, Bool_t testEquivalence=true) const |
Static Protected Member Functions | |
| const TString & | GetIndentString () |
| const TString & | GetDataIndent () |
| void | SetDataIndent (const TString &distr) |
| Int_t | DecIndent () |
| Int_t | IncIndent () |
Protected Attributes | |
| TRef | fAlgConfigRef |
| CandRecord * | fCandRecord |
| TObjArray | fDaughters |
| CandHandle * | fLocalHandle |
Private Member Functions | |
| CandBase & | operator= (const CandBase &) |
Static Private Member Functions | |
| Int_t | ResizeIndent () |
Private Attributes | |
| UInt_t | fArchUidInt |
| CandUid * | fCandUid |
| Immediate Ancestor Cand UIDInt. | |
Static Private Attributes | |
| Int_t | fsNAlloc = 0 |
| Unique Cand ID object. | |
| Int_t | fgIndentLevel = 0 |
| TString | fgIndentString = "" |
| TString | fgDataIndentString = "| " |
Friends | |
| class | CandHandle |
| class | CandRefer |
| class | CandUid |
|
|
Definition at line 44 of file CandBase.cxx. 00044 : 00045 fAlgConfigRef(0) 00046 , fCandRecord(0) 00047 , fLocalHandle(0) 00048 , fCandUid(0) 00049 { 00050 fsNAlloc++; 00051 fCandUid = new CandUid(*this); 00052 }
|
|
|
Definition at line 55 of file CandBase.cxx. References CandUid, fCandUid, and fsNAlloc. 00055 : 00056 fAlgConfigRef(ah.GetAlgConfigRef()) 00057 , fCandRecord(0) 00058 , fLocalHandle(0) 00059 , fCandUid(0) 00060 { 00061 fsNAlloc++; 00062 fCandUid = new CandUid(*this); 00063 }
|
|
|
Definition at line 66 of file CandBase.cxx. References CandUid, fCandUid, and fsNAlloc. 00066 : 00067 00068 // NO, DON'T DO THIS!!! (gmieg 021025) TNamed(cb), CandRefCounted(cb) 00069 TNamed() 00070 , CandRefCounted() 00071 , fAlgConfigRef(cb.fAlgConfigRef) 00072 , fCandRecord(cb.fCandRecord) 00073 , fLocalHandle(0) 00074 , fCandUid(0) 00075 { 00076 00077 // Base copy ctor dups owned pointers, but defers copying Daughter List. 00078 // Daughter List copy is made in the derived class Dup() function. 00079 // This is because base class copy constructor hasn't yet created 00080 // fLocalHandle with a CandHandle* of the full derived type. 00081 fsNAlloc++; 00082 assert (&cb != 0); 00083 fCandUid = new CandUid(*this, cb); 00084 }
|
|
|
Definition at line 94 of file CandBase.cxx. References fCandUid, fDaughters, fLocalHandle, and fsNAlloc. 00095 {
00096 fDaughters.Delete(); // Delete all CandHandles in fDaughters
00097 delete fLocalHandle; fLocalHandle = 0;
00098 delete fCandUid; fCandUid = 0;
00099 fsNAlloc--;
00100 }
|
|
|
|
|
Definition at line 150 of file CandBase.h. References ResizeIndent(). Referenced by FormatDaughtersToOStream(), and CandEvent::FormatToOStream(). 00151 { --fgIndentLevel; return ResizeIndent(); }
|
|
|
||||||||||||
|
Definition at line 360 of file CandBase.cxx. References DecIndent(), CandHandle::FormatToOStream(), GetDaughterIterator(), GetIndentString(), GetNDaughters(), IncIndent(), and option. Referenced by CandHandle::FormatToOStream(). 00362 {
00363 TString opt(option);
00364 bool nodaughters = opt.Contains("d0") || (GetNDaughters() == 0);
00365 if (!nodaughters) {
00366 TString optsub(opt);
00367
00368 // here's where d[n] should be modified to d[n-1]
00369 // using wildcard would assume ^$
00370 static const TRegexp regexp("d*[0-9]",false);
00371 TSubString dn = opt(regexp); // just finds the start of d[0-9]!!!
00372 int nlevels = -1;
00373 sscanf(dn.Data(),"d%d",&nlevels);
00374 if (nlevels>0) {
00375 TString oldn, newn;
00376 oldn += nlevels;
00377 newn += (nlevels-1);
00378 optsub.ReplaceAll(oldn,newn);
00379 }
00380
00381 const TString& indent = GetIndentString();
00382 os << indent << "Daughter List:" << endl;
00383 IncIndent();
00384 TIter itr = GetDaughterIterator();
00385 const TObject *obj;
00386 while ( ( obj = itr() ) ) {
00387 const CandHandle *cand = dynamic_cast<const CandHandle*>(obj);
00388 if (cand) cand->FormatToOStream(os,optsub);
00389 }
00390 DecIndent();
00391 }
00392 return os;
00393 }
|
|
||||||||||||
|
Reimplemented in CandDeMuxDigit, CandDeMuxDigitList, CandDigit, CandDigitList, CandFitShowerEM, CandFitTrackSR, CandShowerSR, CandCluster, CandEvent, CandFitTrack, CandReco, CandShower, CandSlice, CandStrip, and CandTrack. Definition at line 316 of file CandBase.cxx. References GetArchUidInt(), GetIndentString(), Nav::GetName(), GetNDaughters(), CandRefCounted::GetNLinks(), GetUidInt(), and option. Referenced by CandStrip::FormatToOStream(), CandSlice::FormatToOStream(), CandReco::FormatToOStream(), CandHandle::FormatToOStream(), CandEvent::FormatToOStream(), CandDigitList::FormatToOStream(), CandDigit::FormatToOStream(), and CandCluster::FormatToOStream(). 00318 {
00319 // Format the Candidate (and Daughters) to a ostream
00320 // if option string contains:
00321 // n = include name
00322 // t = include title
00323 // i = include Uid's
00324 // v[n] = verbosity level, v0 to suppresss data values
00325 // d[n] = include daughters to depth of [n] (infinite if no n)
00326 // d0 means don't print daughters
00327
00328 TString opt(option);
00329 bool doName = opt.Contains("n");
00330 bool doTitle = opt.Contains("t");
00331 bool doUid = opt.Contains("i");
00332
00333 const TString& indent = GetIndentString();
00334
00335 os << indent
00336 << this->ClassName() << " ";
00337 if (doName) {
00338 const TString name(this->GetName());
00339 if (name != "") os << " Name: '" << this->GetName() << "'";
00340 }
00341 os << " Ndaughters " << this->GetNDaughters()
00342 << " NLinks " << this->GetNLinks(); // nlinks = nrefers + 1
00343 if (doTitle ) {
00344 const TString title(this->GetTitle());
00345 if (title != "") os << endl << indent
00346 << " Title: '" << title << "'";
00347 }
00348 os << endl;
00349 if (doUid) {
00350 os << indent
00351 << " Uid " << this->GetUidInt()
00352 << " ArchUid (ancestor) " << this->GetArchUidInt()
00353 << endl;
00354 }
00355
00356 return os;
00357 }
|
|
|
Definition at line 115 of file CandBase.cxx. References fAlgConfigRef. Referenced by CandHandle::GetAlgConfig(). 00116 {
00117 return (AlgConfig *) (fAlgConfigRef.GetObject());
00118 }
|
|
|
|
Definition at line 67 of file CandBase.h. Referenced by GetArchUidInt(), CandHandle::GetCandUid(), and GetUidInt(). 00067 {return *fCandUid;}
|
|
|
Definition at line 147 of file CandBase.h. Referenced by CandTrack::FormatToOStream(), CandStrip::FormatToOStream(), CandShowerSR::FormatToOStream(), CandShower::FormatToOStream(), CandReco::FormatToOStream(), CandFitTrackSR::FormatToOStream(), CandFitTrack::FormatToOStream(), CandFitShowerEM::FormatToOStream(), CandEvent::FormatToOStream(), CandDigitList::FormatToOStream(), CandDigit::FormatToOStream(), CandDeMuxDigitList::FormatToOStream(), CandDeMuxDigit::FormatToOStream(), and CandCluster::FormatToOStream(). 00147 { return fgDataIndentString; }
|
|
|
Definition at line 127 of file CandBase.cxx. References fDaughters. Referenced by CandHandle::GetDaughter(). 00128 {
00129 if ((ndau > -1) && (ndau < (fDaughters.GetLast()+1)))
00130 return (CandHandle *) fDaughters.At(ndau);
00131 else
00132 return 0;
00133 }
|
|
|
|
|
Definition at line 70 of file CandBase.h. Referenced by CandHandle::GetLocalHandle(). 00070 {return fLocalHandle;}
|
|
|
Definition at line 42 of file CandBase.h. Referenced by Trace(). 00042 {return fsNAlloc;}
|
|
|
Definition at line 142 of file CandBase.cxx. References fDaughters. Referenced by FormatDaughtersToOStream(), FormatToOStream(), CandHandle::GetNDaughters(), IsComposite(), and Trace(). 00143 {
00144 return fDaughters.GetEntries(); // Counts occupied cells, not holes
00145 }
|
|
|
|
Definition at line 154 of file CandBase.cxx. Referenced by CandHandle::HasOverlapWith(). 00155 {
00156 return kFALSE; // Needs to be filled in
00157 }
|
|
|
Definition at line 152 of file CandBase.h. References ResizeIndent(). Referenced by FormatDaughtersToOStream(), and CandEvent::FormatToOStream(). 00153 { ++fgIndentLevel; return ResizeIndent(); }
|
|
|
Definition at line 160 of file CandBase.cxx. References GetNDaughters(). Referenced by CandHandle::IsComposite(). 00161 {
00162 return (GetNDaughters() > 1);
00163 }
|
|
|
Reimplemented in FarDetEventList, CandChopList, CandDeMuxDigit, CandDeMuxDigitList, CandDigit, CandDigitList, CandFitShowerEM, CandFitShowerEMList, CandFitTrackSR, CandFitTrackSRList, CandShowerEM, CandShowerEMList, CandShowerSR, CandShowerSRList, CandSubShowerSR, CandSubShowerSRList, CandTrackSR, CandTrackSRList, CandCluster3D, CandCluster3DList, CandRmMu, CandRmMuList, CandCluster, CandClusterList, CandEvent, CandEventList, CandFitTrack, CandFitTrackList, CandReco, CandRecoList, CandShower, CandShowerList, CandSlice, CandSliceList, CandStrip, CandStripList, CandTrack, and CandTrackList. Definition at line 166 of file CandBase.cxx. References fAlgConfigRef, fLocalHandle, GetDaughterIterator(), CandHandle::GetMother(), CandHandle::GetName(), MSG, TestDisplayCandBanner(), and TestEquality(). Referenced by FarDetEventList::IsEquivalent(), CandStripList::IsEquivalent(), CandStrip::IsEquivalent(), CandSliceList::IsEquivalent(), CandSlice::IsEquivalent(), CandRmMuList::IsEquivalent(), CandRmMu::IsEquivalent(), CandRecoList::IsEquivalent(), CandReco::IsEquivalent(), CandHandle::IsEquivalent(), CandEventList::IsEquivalent(), CandEvent::IsEquivalent(), CandDigitList::IsEquivalent(), CandDigit::IsEquivalent(), CandClusterList::IsEquivalent(), CandCluster::IsEquivalent(), CandChopList::IsEquivalent(), and TestTObjArrayPtrEquivalence(). 00167 {
00168
00169 // IsEquivalent does deep comparison for templated Test... methods
00170 TestDisplayCandBanner("CandBase");
00171 if (this->IsEqual(rhs)) return true; // CandBases have same address
00172 Bool_t result = true;
00173 const CandBase* rCnd = dynamic_cast<const CandBase*>(rhs);
00174 if (rCnd == NULL) {
00175 MSG("VCand", Msg::kDebug)
00176 << "CandBase::IsEquivalent(): Comparison object not a CandBase."
00177 << " rhs->ClassName() = " << rhs->ClassName() << endl;
00178 return false;
00179 }
00180
00181 result = TestEquality("fAlgConfigRef", this->fAlgConfigRef,
00182 rCnd->fAlgConfigRef) && result;
00183
00184 // Compare fDaughters
00185 Bool_t all_daughters_ok = true;
00186 TIter thisIter = this->GetDaughterIterator();
00187 TIter rhsIter = rCnd->GetDaughterIterator();
00188
00189 TObject *thisObj;
00190 TObject *rhsObj;
00191
00192 while ((thisObj = thisIter()) && (rhsObj = rhsIter())) {
00193 CandHandle *thisCdh = dynamic_cast<CandHandle *>(thisObj);
00194 CandHandle *rhsCdh = dynamic_cast<CandHandle *>(rhsObj);
00195 if (thisCdh == 0 || rhsCdh == 0) {
00196 MSG("VCand", Msg::kDebug)
00197 << "CandBase::IsEquivalent(): Bad daughter CandHandle found."
00198 << " thisObj->ClassName() = " << thisObj->ClassName()
00199 << ". rhsObj->ClassName() = " << rhsObj->ClassName()
00200 << endl;
00201 all_daughters_ok = false;
00202 continue;
00203 }
00204
00205 if (thisCdh->GetMother() != this->fLocalHandle) {
00206 MSG("VCand", Msg::kError) << endl
00207 << "Bad CandHandle found in LHS Daughter List." << endl
00208 << "CandHandle Mother pointer is not to LocalHandle of CandBase."
00209 << endl << "Mother ClassName() = "
00210 << thisCdh->GetMother()->ClassName() << endl
00211 << "Mother GetName() = " << thisCdh->GetMother()->GetName()
00212 << endl << "LocalHandle ClassName() = "
00213 << this->fLocalHandle->ClassName()
00214 << endl << "LocalHandle GetName() = "
00215 << this->fLocalHandle->GetName()
00216 << endl << "Needs to be understood!" << endl;
00217 all_daughters_ok = false;
00218 }
00219
00220 if (*thisCdh != *rhsCdh) { // Compares Candidate Object addresses
00221 MSG("VCand", Msg::kDebug) << "\tDaughter [not ok]" << endl;
00222 all_daughters_ok = false;
00223 }
00224 }
00225
00226 if (!all_daughters_ok) {
00227 MSG("VCand", Msg::kSynopsis) << "Daughters \t[not all ok]" << endl;
00228 return false;
00229 }
00230
00231 MSG("VCand", Msg::kDebug) << "All daughters \t[ok]" << endl;
00232
00233 return result;
00234 }
|
|
|
Definition at line 87 of file CandBase.cxx. 00088 {
00089 abort(); // This method should not be used
00090 return *this;
00091 }
|
|
|
Definition at line 237 of file CandBase.cxx. References fDaughters, fLocalHandle, CandHandle::GetMother(), CandHandle::GetName(), and MSG. Referenced by CandHandle::RemoveDaughter(). 00238 {
00239
00240 // Removes the first daughter encountered with the same CandHandle ref'd
00241 // object. CandHandle caller is expected to have found the exact ch.
00242 if ((ch == 0)) {
00243 MSG("Cand", Msg::kError) << endl
00244 << "Failed attempt to remove null CandHandle from Daughter List."
00245 << endl << "LocalHandle ClassName() = " << fLocalHandle->ClassName()
00246 << endl << "LocalHandle GetName() = " << fLocalHandle->GetName()
00247 << endl << "CandHandle not deleted." << endl;
00248 return kFALSE; // Failure return
00249 }
00250 if (CandHandle* newh = // Guarantee Mother link pointer if cloned
00251 dynamic_cast<CandHandle*>(fDaughters.FindObject(ch))) {
00252 if (newh->GetMother() != fLocalHandle) {
00253 MSG("Cand", Msg::kError) << endl
00254 << "Request to Remove bad CandHandle from Daughter List." << endl
00255 << "CandHandle mother pointer is not to LocalHandle of CandBase."
00256 << endl
00257 << "Mother ClassName() = " << newh->GetMother()->ClassName()
00258 << endl << "Mother GetName() = " << newh->GetMother()->GetName()
00259 << endl
00260 << "LocalHandle ClassName() = " << fLocalHandle->ClassName()
00261 << endl << "LocalHandle GetName() = " << fLocalHandle->GetName()
00262 << endl << "CandHandle Removed anyway. Should be investigated!"
00263 << endl;
00264 }
00265 if (fDaughters.Remove(newh)) { // Remove CandHandle from fDaughters
00266 delete newh; // Delete CandHandle ch object
00267 fDaughters.Compress(); // Squeeze out holes in Daughter list
00268 return kTRUE; // Success return
00269 }
00270 }
00271 else {
00272 MSG("Cand", Msg::kError) << endl
00273 << "Failed to find and remove CandHandle from Daughter List."
00274 << endl << " CandHandle not deleted." << endl;
00275 return kFALSE; // Failure return
00276 }
00277 return kFALSE; // Did nothing
00278 }
|
|
|
Definition at line 397 of file CandBase.cxx. References fgIndentLevel, and fgIndentString. Referenced by DecIndent(), and IncIndent(). 00398 {
00399 fgIndentString.Resize(3*fgIndentLevel);
00400 return fgIndentLevel;
00401 }
|
|
|
Definition at line 281 of file CandBase.cxx. References fCandRecord, GetDaughterIterator(), and CandHandle::SetCandRecord(). Referenced by CandTrackList::Dup(), CandTrack::Dup(), CandStripList::Dup(), CandStrip::Dup(), CandShowerList::Dup(), CandShower::Dup(), CandClusterList::Dup(), CandCluster::Dup(), CandHandle::GetOwnedCandBase(), and CandHandle::SetCandRecord(). 00282 {
00283 if (cr == fCandRecord) return; // New fCandRecord is same as old one
00284
00285 fCandRecord = cr;
00286 TIter iterdau = GetDaughterIterator();
00287 CandHandle *dau;
00288 while ((dau = dynamic_cast<CandHandle *>(iterdau()))) {
00289 dau->SetCandRecord(cr);
00290 }
00291 }
|
|
|
Definition at line 148 of file CandBase.h. References fgDataIndentString. 00149 { fgDataIndentString=distr;}
|
|
|
||||||||||||||||||||||||
|
Definition at line 17 of file CandBase.tpl. References MSG. Referenced by CandTrack::IsEquivalent(), CandShower::IsEquivalent(), and CandFitTrackSR::IsEquivalent(). 00020 {
00021
00022 // Tests the equality of a member array
00023 Bool_t isEquivalent = true;
00024 for (int i=0; i < arrLen; i++) {
00025 if (!(thisMbr[i] == rhsMbr[i])) {
00026 isEquivalent = false;
00027 }
00028 }
00029 if (isEquivalent) {
00030 MSG("VCand", Msg::kDebug) << mbrName << " \t[ok]\n";
00031 }
00032 else {
00033 MSG("VCand", Msg::kDebug) << mbrName << " \t[not ok]\n";
00034 return false;
00035 }
00036 return true;
00037 }
|
|
||||||||||||||||||||
|
Definition at line 41 of file CandBase.tpl. References MSG. Referenced by CandReco::IsEquivalent(), CandEvent::IsEquivalent(), and CandCluster::IsEquivalent(). 00044 {
00045
00046 // Tests if the CandHandle pointer was DupHandle()
00047 if (!thisCH && !rCndCH) {
00048 MSG("VCand", Msg::kDebug) << chName << " \t[ok]\n";
00049 return true;
00050 }
00051 else {
00052 if (thisCH == rCndCH) {
00053 MSG("VCand", Msg::kDebug) << chName << " \t[is a shallow copy]\n";
00054 return false;
00055 }
00056 else {
00057 if ( *thisCH == *rCndCH) {
00058 MSG("VCand", Msg::kDebug) << chName << " \t[ok]\n";
00059 }
00060 else {
00061 MSG("VCand", Msg::kDebug) << chName << " \t[not ok]\n";
00062 return false;
00063 }
00064 }
00065 }
00066 return true;
00067 }
|
|
||||||||||
|
||||||||||||||||||||
|
Definition at line 82 of file CandBase.tpl. References MSG. Referenced by CandTrackSRList::IsEquivalent(), CandTrackSR::IsEquivalent(), CandTrack::IsEquivalent(), CandStrip::IsEquivalent(), CandShowerSR::IsEquivalent(), CandShower::IsEquivalent(), CandRmMu::IsEquivalent(), CandReco::IsEquivalent(), CandFitTrackSR::IsEquivalent(), CandFitTrack::IsEquivalent(), CandFitShowerEM::IsEquivalent(), CandEvent::IsEquivalent(), CandDigitList::IsEquivalent(), CandDigit::IsEquivalent(), CandDeMuxDigitList::IsEquivalent(), CandDeMuxDigit::IsEquivalent(), CandCluster3D::IsEquivalent(), CandCluster::IsEquivalent(), and IsEquivalent(). 00085 {
00086
00087 // Tests the equality of a simple member
00088 if (thisMbr == rhsMbr){
00089 MSG("VCand", Msg::kDebug) << mbrName << " \t[ok]\n";
00090 }
00091 else {
00092 MSG("VCand", Msg::kDebug) << mbrName << " \t[not ok]\n";
00093 return false;
00094 }
00095 return true;
00096 }
|
|
||||||||||||||||||||
|
Definition at line 100 of file CandBase.tpl. References MSG. 00103 {
00104
00105 // Tests the equivalence of two objects
00106 // (uses the IsEquivalent method)
00107 if (&thisMbr == &rhsMbr) {
00108 MSG("VCand", Msg::kDebug) << mName << " \t[is a shallow copy]\n";
00109 return false;
00110 }
00111 else {
00112 if (thisMbr.IsEquivalent(&rhsMbr)) {
00113 MSG("VCand", Msg::kDebug) << mName << " \t[ok]\n";
00114 }
00115 else {
00116 MSG("VCand", Msg::kDebug) << mName << " \t[not ok]\n";
00117 return false;
00118 }
00119 }
00120 return true;
00121 }
|
|
||||||||||||||||||||
|
Definition at line 125 of file CandBase.tpl. 00129 {
00130
00131 // Tests the equality of the elements of a TObjArray* member
00132 // uses == operator to compare the TObject* elements of the TObjArray
00133 return TestGenericElemPtrTObjArrayPtrEquivalence<elemType>(arrName,
00134 thisTOA, rCndTOA, false);
00135 }
|
|
||||||||||||||||||||||||
|
Definition at line 139 of file CandBase.tpl. References MSG. 00144 {
00145
00146 // Tests the equivalence of the elements of a TObjArray* member
00147 // Uses the IsEquivalent() to compare the elements of the TObjArray
00148 // for the testEquivalence test
00149 // Note: Uses IsEqual() instead of the == operator, for equality test.
00150 if (thisTOA == rCndTOA) {
00151 MSG("VCand", Msg::kDebug) << arrName << " \t[is a shallow copy]\n";
00152 return false;
00153 }
00154 else {
00155 Bool_t isEquivalent = true;
00156 Bool_t isShallow = false;
00157 Bool_t dcastFailed = false;
00158 if (thisTOA->GetEntries() != thisTOA->GetEntries()) {
00159 isEquivalent = false;
00160 }
00161 else {
00162 TIterator* thisIter = thisTOA->MakeIterator();
00163 TIterator* rCndIter = rCndTOA->MakeIterator();
00164 TObject *thisObj, *rCndObj;
00165 while ((thisObj = thisIter->Next()) &&
00166 (rCndObj = rCndIter->Next())) {
00167
00168 if (thisObj == rCndObj) {
00169 isShallow = true;
00170 }
00171 else {
00172 elemType *thisCB = dynamic_cast<elemType*>(thisObj);
00173 elemType *rCndCB = dynamic_cast<elemType*>(rCndObj);
00174 if (thisCB == NULL || rCndCB == NULL) {
00175 isEquivalent = false;
00176 dcastFailed = true;
00177 break;
00178 }
00179 if (testEquivalence) { // use object's IsEquivalent() method
00180 if (!thisCB || !rCndCB || !(thisCB->IsEquivalent(rCndCB))) {
00181 isEquivalent = false;
00182 }
00183 }
00184 else { // use the object's IsEqual() method
00185 if ( !(thisObj->IsEqual(rCndObj)) ) {
00186 isEquivalent = false;
00187 }
00188 }
00189 }
00190 }
00191 }
00192 if (isEquivalent) {
00193 if (isShallow) {
00194 MSG("VCand", Msg::kDebug)
00195 << arrName << " \t[shallow copy of TObjArray elements]\n";
00196 }
00197 else {
00198 MSG("VCand", Msg::kDebug) << arrName << " \t[ok]\n";
00199 }
00200 }
00201 else {
00202 if (dcastFailed) {
00203 MSG("VCand", Msg::kDebug)
00204 << arrName << " \t[dynamic cast of elements failed--not ok]\n";
00205 }
00206 else {
00207 MSG("VCand", Msg::kDebug) << arrName << " \t[not ok]\n";
00208 }
00209 return false;
00210 }
00211 }
00212 return true;
00213 }
|
|
||||||||||
|
Definition at line 217 of file CandBase.tpl. References MSG. Referenced by FarDetEventList::IsEquivalent(), CandTrackList::IsEquivalent(), CandSubShowerSRList::IsEquivalent(), CandStripList::IsEquivalent(), CandSliceList::IsEquivalent(), CandShowerSRList::IsEquivalent(), CandShowerList::IsEquivalent(), CandShowerEMList::IsEquivalent(), CandRmMuList::IsEquivalent(), CandRecoList::IsEquivalent(), CandFitTrackSRList::IsEquivalent(), CandFitTrackList::IsEquivalent(), CandFitShowerEMList::IsEquivalent(), CandEventList::IsEquivalent(), CandClusterList::IsEquivalent(), CandCluster3DList::IsEquivalent(), and CandChopList::IsEquivalent(). 00218 {
00219
00220 // Shows that testing wasn't just looked over
00221 MSG("VCand", Msg::kDebug) << mName << " class: Nothing to test.\n";
00222 }
|
|
||||||||||||||||||||
|
Definition at line 226 of file CandBase.tpl. References MSG. Referenced by CandTrackSR::IsEquivalent(), and CandFitTrackSR::IsEquivalent(). 00229 {
00230
00231 // Tests the equivalence of two object pointers
00232 // (uses the IsEquivalent method)
00233 if (thisMbr == rhsMbr) {
00234 MSG("VCand", Msg::kDebug) << mName << " \t[is a shallow copy]\n";
00235 return false;
00236 }
00237 else {
00238 if (thisMbr->IsEquivalent(rhsMbr)) {
00239 MSG("VCand", Msg::kDebug) << mName << " \t[ok]\n";
00240 }
00241 else {
00242 MSG("VCand", Msg::kDebug) << mName << " \t[not ok]\n";
00243 return false;
00244 }
00245 }
00246 return true;
00247 }
|
|
||||||||||||||||||||
|
Definition at line 251 of file CandBase.tpl. References MSG. Referenced by CandShowerSR::IsEquivalent(), CandShower::IsEquivalent(), and CandEvent::IsEquivalent(). 00254 {
00255
00256 // Tests if the CandHandles in the TObjArray were DupHandle()d
00257 // toaType is always a TObjArray, but it's templatized so the
00258 Bool_t isEquivalent = true;
00259 Bool_t hasShallowCopies = false;
00260 if (thisTOA.GetEntries() != rCndTOA.GetEntries() ){
00261 isEquivalent = false;
00262 }
00263 else {
00264 TIterator* thisIter = thisTOA.MakeIterator();
00265 TIterator* rCndIter = rCndTOA.MakeIterator();
00266
00267 // loop over the CandHandle elements
00268 TObject *thisTObj, *rCndTObj;
00269 while ( ((thisTObj=thisIter->Next()) != NULL) &&
00270 ((rCndTObj=rCndIter->Next()) != NULL) ) {
00271 if (thisTObj == rCndTObj) {
00272 hasShallowCopies = true;
00273 isEquivalent = false;
00274 }
00275 else {
00276 const CandHandle* thisCH =
00277 dynamic_cast<const CandHandle*>(thisTObj);
00278 const CandHandle* rCndCH =
00279 dynamic_cast<const CandHandle*>(rCndTObj);
00280 if(!(*thisCH == *rCndCH)) {
00281 isEquivalent = false;
00282 }
00283 }
00284 }
00285 }
00286
00287 if (hasShallowCopies) {
00288 MSG("VCand", Msg::kDebug) << arrName
00289 << " \t[has shallow copies]\n";
00290 }
00291 else if (isEquivalent) {
00292 MSG("VCand", Msg::kDebug) << arrName << " \t[ok]\n";
00293 }
00294 else {
00295 MSG("VCand", Msg::kDebug) << arrName << " \t[not ok]\n";
00296 return false;
00297 }
00298 return true;
00299 }
|
|
||||||||||||||||||||
|
Definition at line 303 of file CandBase.tpl. References TestTObjArrayPtrEquality(). 00306 {
00307
00308 // Tests the equality of a TObjArray member
00309 // array elements are compared by checking if they point to same object
00310 // (TObject* == TObject*)?
00311 return TestTObjArrayPtrEquality(arrName, &thisTOA, &rCndTOA);
00312 }
|
|
||||||||||||||||||||
|
Definition at line 316 of file CandBase.tpl. References TestTObjArrayPtrEquivalence(). Referenced by TestTObjArrayEquality(). 00319 {
00320
00321 // Tests the equality of the elements of a TObjArray* member
00322 // uses == operator to compare the TObject* elements of the TObjArray
00323 return TestTObjArrayPtrEquivalence(arrName, thisTOA, rCndTOA, false);
00324 }
|
|
||||||||||||||||||||||||
|
Definition at line 328 of file CandBase.tpl. References IsEquivalent(), and MSG. Referenced by TestTObjArrayPtrEquality(). 00332 {
00333
00334 // Tests the equivalence of the elements of a TObjArray* member
00335 // Uses the IsEquivalent() to compare the elements of the TObjArray
00336 // for the testEquivalence test
00337 if (thisTOA == rCndTOA) {
00338 MSG("VCand", Msg::kDebug) << arrName << " \t[is a shallow copy]\n";
00339 return false;
00340 }
00341 else {
00342 Bool_t isEquivalent = true;
00343 if (thisTOA->GetEntries() != thisTOA->GetEntries()) {
00344 isEquivalent = false;
00345 }
00346 else {
00347 TIterator* thisIter = thisTOA->MakeIterator();
00348 TIterator* rCndIter = rCndTOA->MakeIterator();
00349 TObject *thisObj, *rCndObj;
00350 while ( (thisObj = thisIter->Next()) &&
00351 (rCndObj = rCndIter->Next()) ) {
00352
00353 if (testEquivalence) { // use the object's IsEquivalent() method
00354 CandBase *thisCB = dynamic_cast<CandBase*>(thisObj);
00355 CandBase *rCndCB = dynamic_cast<CandBase*>(rCndObj);
00356 if (!thisCB || !rCndCB || !(thisCB->IsEquivalent(rCndCB)) ) {
00357 isEquivalent = false;
00358 }
00359 }
00360 else { // use the == operator
00361 if ( !(thisObj == rCndObj) ) {
00362 isEquivalent = false;
00363 }
00364 }
00365 }
00366 }
00367
00368 if (isEquivalent) {
00369 MSG("VCand", Msg::kDebug) << arrName << " \t[ok]\n";
00370 }
00371 else {
00372 MSG("VCand", Msg::kDebug) << arrName << " \t[not ok]\n";
00373 return false;
00374 }
00375 }
00376 return true;
00377 }
|
|
|
Definition at line 302 of file CandBase.cxx. References GetArchUidInt(), GetNAlloc(), GetNDaughters(), CandRefCounted::GetNLinks(), GetUidInt(), and MSG. Referenced by CandHandle::Trace(). 00303 {
00304 MSG("Cand", Msg::kDebug)
00305 << "**********Begin CandBase::Trace(\"" << c << "\")" << endl
00306 << CandBase::GetNAlloc() << " CandBase objects allocated." << endl
00307 << "UidInt = " << GetUidInt() << ", ArchUidInt = "
00308 << GetArchUidInt() << endl
00309 << "No. of ref-counted CandHandles = " << GetNLinks()
00310 << " (LocalHandle not counted)" << endl
00311 << "NDaughters = " << GetNDaughters() << endl << endl
00312 << "**********End CandBase::Trace(\"" << c << "\")" << endl;
00313 }
|
|
|
Definition at line 37 of file CandBase.h. |
|
|
Definition at line 38 of file CandBase.h. |
|
|
Definition at line 39 of file CandBase.h. Referenced by CandBase(). |
|
|
Definition at line 53 of file CandBase.h. Referenced by GetAlgConfig(), and IsEquivalent(). |
|
|
Definition at line 157 of file CandBase.h. |
|
|
Definition at line 54 of file CandBase.h. Referenced by AddDaughterLink(), CandHandle::GetCandRecord(), CandHandle::GetOwnedCandBase(), CandHandle::GetVldContext(), and SetCandRecord(). |
|
|
Immediate Ancestor Cand UIDInt.
Definition at line 158 of file CandBase.h. Referenced by CandBase(), and ~CandBase(). |
|
|
Definition at line 55 of file CandBase.h. Referenced by CandHandle::DropMotherLink(), GetDaughter(), GetDaughterIterator(), GetNDaughters(), RemoveDaughter(), CandHandle::SetMotherLink(), and ~CandBase(). |
|
|
Definition at line 36 of file CandBase.cxx. Referenced by SetDataIndent(). |
|
|
Definition at line 34 of file CandBase.cxx. Referenced by ResizeIndent(). |
|
|
Definition at line 35 of file CandBase.cxx. Referenced by ResizeIndent(). |
|
|
Definition at line 56 of file CandBase.h. Referenced by AddDaughterLink(), IsEquivalent(), RemoveDaughter(), SetLocalHandle(), and ~CandBase(). |
|
|
Unique Cand ID object.
Definition at line 32 of file CandBase.cxx. Referenced by CandBase(), and ~CandBase(). |
1.3.9.1