CandBase Class Reference

#include <CandBase.h>

Inheritance diagram for CandBase:
CandRefCounted CandCalDetPID CandCalDetSI CandChopList CandCluster CandClusterList CandDataQuality CandDeadChip CandDigit CandDigitList CandEventList CandReco CandRecoList CandRmMu CandRmMuList CandShieldPlank CandShieldPlankList CandSlice CandSliceList CandStrip CandStripList FarDetDataQuality FarDetDeadChip FarDetShieldPlank FarDetShieldPlankList

List of all members.

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

static Int_t GetNAlloc ()

Protected Member Functions

 CandBase (const AlgHandle &ah)
 CandBase (const CandBase &cb)
virtual ~CandBase ()
const CandHandleAddDaughterLink (const CandHandle &ch)
virtual void CreateLocalHandle ()=0
virtual CandBaseDup () const =0
AlgConfigGetAlgConfig () const
UInt_t GetArchUidInt () const
const CandUidGetCandUid () const
const CandHandleGetDaughter (Int_t ndau) const
TIter GetDaughterIterator () const
const CandHandleGetLocalHandle () 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
void TestDisplayCandBanner (const char *mName="Candidate") 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
void TestNothing (const 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

static const TString & GetIndentString ()
static const TString & GetDataIndent ()
static void SetDataIndent (const TString &distr)
static Int_t DecIndent ()
static Int_t IncIndent ()

Protected Attributes

TRef fAlgConfigRef
CandRecordfCandRecord
TObjArray fDaughters
CandHandlefLocalHandle

Private Member Functions

CandBaseoperator= (const CandBase &)

Static Private Member Functions

static Int_t ResizeIndent ()

Private Attributes

UInt_t fArchUidInt
CandUidfCandUid
 Immediate Ancestor Cand UIDInt.

Static Private Attributes

static Int_t fsNAlloc = 0
 Unique Cand ID object.
static Int_t fgIndentLevel = 0
static TString fgIndentString = ""
static TString fgDataIndentString = "| "

Friends

class CandHandle
class CandRefer
class CandUid

Detailed Description

Definition at line 34 of file CandBase.h.


Constructor & Destructor Documentation

CandBase::CandBase (  ) 

Definition at line 45 of file CandBase.cxx.

References CandUid, and fCandUid.

00045                    :
00046   fAlgConfigRef(0)
00047 , fCandRecord(0)
00048 , fLocalHandle(0)
00049 , fCandUid(0)
00050 {
00051   fsNAlloc++;
00052   fCandUid = new CandUid(*this);
00053 }

CandBase::CandBase ( const AlgHandle ah  )  [protected]

Definition at line 56 of file CandBase.cxx.

References CandUid, and fCandUid.

00056                                       :
00057   fAlgConfigRef(ah.GetAlgConfigRef())
00058 , fCandRecord(0)
00059 , fLocalHandle(0)
00060 , fCandUid(0)
00061 {
00062   fsNAlloc++;
00063   fCandUid = new CandUid(*this);
00064 }

CandBase::CandBase ( const CandBase cb  )  [protected]

Definition at line 67 of file CandBase.cxx.

References CandUid, and fCandUid.

00067                                      :
00068 
00069 // NO, DON'T DO THIS!!! (gmieg 021025) TNamed(cb), CandRefCounted(cb)
00070   TNamed()
00071 , CandRefCounted()
00072 , fAlgConfigRef(cb.fAlgConfigRef)
00073 , fCandRecord(cb.fCandRecord)
00074 , fLocalHandle(0)
00075 , fCandUid(0)
00076 {
00077 
00078 // Base copy ctor dups owned pointers, but defers copying Daughter List.
00079 // Daughter List copy is made in the derived class Dup() function.
00080 // This is because base class copy constructor hasn't yet created
00081 // fLocalHandle with a CandHandle* of the full derived type.
00082   fsNAlloc++;
00083   assert (&cb != 0);
00084   fCandUid = new CandUid(*this, cb);
00085 }

CandBase::~CandBase (  )  [protected, virtual]

Definition at line 95 of file CandBase.cxx.

References fCandUid, fDaughters, and fLocalHandle.

00096 {
00097   fDaughters.Delete();           // Delete all CandHandles in fDaughters
00098   delete fLocalHandle;  fLocalHandle = 0;
00099   delete fCandUid;      fCandUid = 0;
00100   fsNAlloc--;
00101 }


Member Function Documentation

const CandHandle * CandBase::AddDaughterLink ( const CandHandle ch  )  [protected]

Definition at line 104 of file CandBase.cxx.

References CandHandle::DupHandle(), fCandRecord, fLocalHandle, CandHandle::SetCandRecord(), and CandHandle::SetMotherLink().

Referenced by CandHandle::AddDaughterLink(), CandDeadChip::Dup(), CandChopList::Dup(), CandFitTrack::Dup(), CandFitTrackList::Dup(), CandShowerEM::Dup(), CandDigit::Dup(), CandFitShowerEM::Dup(), CandFitTrackCam::Dup(), CandRmMuList::Dup(), CandShowerEMList::Dup(), CandTrackAtNuList::Dup(), CandCalDetPID::Dup(), CandShieldPlank::Dup(), CandShowerSR::Dup(), CandCluster::Dup(), CandDeMuxDigitList::Dup(), CandDigitList::Dup(), CandEventList::Dup(), CandFitTrackMS::Dup(), CandTrack::Dup(), CandTrackAtNu::Dup(), CandFitShowerEMList::Dup(), CandRecoList::Dup(), CandTrackCam::Dup(), CandCluster3DList::Dup(), CandFitTrackSRList::Dup(), CandShowerList::Dup(), CandSubShowerSRList::Dup(), CandClusterList::Dup(), CandDeMuxDigit::Dup(), CandFitTrackAtNu::Dup(), CandFitTrackCamList::Dup(), CandShieldPlankList::Dup(), CandShowerAtNuList::Dup(), CandSlice::Dup(), FarDetShieldPlankList::Dup(), FarDetSliceList::Dup(), FarDetStrip::Dup(), CandCluster3D::Dup(), CandDataQuality::Dup(), CandFitTrackAtNuList::Dup(), CandFitTrackMSList::Dup(), CandFitTrackSR::Dup(), CandStrip::Dup(), CandStripList::Dup(), CandSubShowerSR::Dup(), CandRmMu::Dup(), CandShower::Dup(), CandSliceList::Dup(), CandTrackList::Dup(), CandFitTrackSA::Dup(), CandTrackSR::Dup(), CandCalDetSI::Dup(), FarDetDataQuality::Dup(), FarDetDeadChip::Dup(), FarDetEventList::Dup(), FarDetStripList::Dup(), CandTrackCamList::Dup(), FarDetEvent::Dup(), FarDetSlice::Dup(), CandShowerAtNu::Dup(), CandAtNuReco::Dup(), CandTrackSRList::Dup(), CandEvent::Dup(), CandShowerSRList::Dup(), FarDetShieldPlank::Dup(), and CandDeMuxDigitHandle::DupCandFromBase().

00105 {
00106 
00107 // Assume pre-existing daughter check is already done.
00108   assert(&ch != 0);
00109   CandHandle *chnew = ch.DupHandle();
00110   chnew->SetMotherLink(fLocalHandle);  // Set the daughter's mother link
00111   chnew->SetCandRecord(fCandRecord);
00112   return chnew;
00113 }

virtual void CandBase::CreateLocalHandle (  )  [protected, pure virtual]
static Int_t CandBase::DecIndent (  )  [inline, static, protected]

Definition at line 148 of file CandBase.h.

References fgIndentLevel, and ResizeIndent().

Referenced by FormatDaughtersToOStream(), and CandEvent::FormatToOStream().

00149    { --fgIndentLevel; return ResizeIndent(); }

virtual CandBase* CandBase::Dup (  )  const [protected, pure virtual]
std::ostream & CandBase::FormatDaughtersToOStream ( std::ostream &  os,
Option_t *  option = "" 
) const [virtual]

Definition at line 383 of file CandBase.cxx.

References DecIndent(), CandHandle::FormatToOStream(), GetDaughterIterator(), GetIndentString(), GetNDaughters(), and IncIndent().

Referenced by CandHandle::FormatToOStream().

00385 {
00386   TString opt(option);
00387   bool nodaughters = opt.Contains("d0") || (GetNDaughters() == 0);
00388   if (!nodaughters) {
00389     TString optsub(opt);
00390 
00391 // here's where d[n] should be modified to d[n-1]
00392 // using wildcard would assume ^$
00393     static const TRegexp regexp("d*[0-9]",false);
00394     TSubString dn = opt(regexp);    // just finds the start of d[0-9]!!!
00395     int nlevels = -1;
00396     sscanf(dn.Data(),"d%d",&nlevels);
00397     if (nlevels>0) {
00398       TString oldn, newn;
00399       oldn += nlevels; 
00400       newn += (nlevels-1);
00401       optsub.ReplaceAll(oldn,newn);
00402     }
00403 
00404     const TString& indent = GetIndentString();
00405     os << indent << "Daughter List:" << endl;
00406     IncIndent();
00407     TIter itr = GetDaughterIterator();
00408     const TObject *obj;
00409     while ( ( obj = itr() ) ) {
00410       const CandHandle *cand = dynamic_cast<const CandHandle*>(obj);
00411       if (cand) cand->FormatToOStream(os,optsub);
00412     }
00413     DecIndent();
00414   }
00415   return os;
00416 }

std::ostream & CandBase::FormatToOStream ( std::ostream &  os,
Option_t *  option = "" 
) const [virtual]

Reimplemented in CandDeMuxDigit, CandDeMuxDigitList, CandDigit, CandDigitList, CandFitShowerEM, CandFitTrackSR, CandShowerSR, CandCluster, CandEvent, CandFitTrack, CandReco, CandShower, CandSlice, CandStrip, and CandTrack.

Definition at line 339 of file CandBase.cxx.

References GetArchUidInt(), GetIndentString(), Nav::GetName(), GetNDaughters(), CandRefCounted::GetNLinks(), and GetUidInt().

Referenced by CandHandle::FormatToOStream().

00341 {
00342   // Format the Candidate (and Daughters) to a ostream
00343   // if option string contains:
00344   //    n    = include name
00345   //    t    = include title
00346   //    i    = include Uid's
00347   //    v[n] = verbosity level, v0 to suppresss data values 
00348   //    d[n] = include daughters to depth of [n] (infinite if no n)
00349   //           d0 means don't print daughters
00350 
00351   TString opt(option);
00352   bool doName  = opt.Contains("n");
00353   bool doTitle = opt.Contains("t");
00354   bool doUid   = opt.Contains("i");
00355 
00356   const TString& indent = GetIndentString();
00357 
00358   os << indent
00359      << this->ClassName() << " ";
00360   if (doName) {
00361     const TString name(this->GetName());
00362     if (name  != "") os << " Name: '" << this->GetName() << "'";
00363   }
00364   os << " Ndaughters " << this->GetNDaughters()
00365      << " NLinks " << this->GetNLinks(); // nlinks = nrefers + 1
00366   if (doTitle ) {
00367     const TString title(this->GetTitle());
00368     if (title != "") os << endl << indent 
00369                         << "   Title: '" << title << "'";
00370   }
00371   os << endl;
00372   if (doUid) {
00373     os << indent 
00374        << "   Uid " << this->GetUidInt() 
00375        << " ArchUid (ancestor) " << this->GetArchUidInt()
00376        << endl;
00377   }
00378   
00379   return os;
00380 }

AlgConfig * CandBase::GetAlgConfig (  )  const [protected]

Definition at line 116 of file CandBase.cxx.

References fAlgConfigRef.

Referenced by CandHandle::GetAlgConfig().

00117 {
00118    return (AlgConfig *) (fAlgConfigRef.GetObject());
00119 }

UInt_t CandBase::GetArchUidInt (  )  const [protected]

Definition at line 122 of file CandBase.cxx.

References CandUid::GetArchUidInt(), and GetCandUid().

Referenced by CandCalDetSI::CandCalDetSI(), CandChopList::CandChopList(), CandCluster::CandCluster(), CandClusterList::CandClusterList(), CandDeMuxDigit::CandDeMuxDigit(), CandDeMuxDigitList::CandDeMuxDigitList(), CandDigit::CandDigit(), CandDigitList::CandDigitList(), CandEventList::CandEventList(), CandFitShowerEM::CandFitShowerEM(), CandFitShowerEMList::CandFitShowerEMList(), CandFitTrack::CandFitTrack(), CandFitTrackList::CandFitTrackList(), CandFitTrackMS::CandFitTrackMS(), CandFitTrackMSList::CandFitTrackMSList(), CandFitTrackSRList::CandFitTrackSRList(), CandReco::CandReco(), CandRecoList::CandRecoList(), CandRmMu::CandRmMu(), CandRmMuList::CandRmMuList(), CandShower::CandShower(), CandShowerEM::CandShowerEM(), CandShowerEMList::CandShowerEMList(), CandShowerList::CandShowerList(), CandShowerSR::CandShowerSR(), CandShowerSRList::CandShowerSRList(), CandSlice::CandSlice(), CandSliceList::CandSliceList(), CandStripList::CandStripList(), CandSubShowerSR::CandSubShowerSR(), CandSubShowerSRList::CandSubShowerSRList(), CandTrack::CandTrack(), CandTrackList::CandTrackList(), CandTrackSR::CandTrackSR(), CandTrackSRList::CandTrackSRList(), CandUid::CandUid(), FarDetEventList::FarDetEventList(), FormatToOStream(), CandHandle::GetArchUidInt(), Trace(), CandChopList::~CandChopList(), CandCluster::~CandCluster(), CandClusterList::~CandClusterList(), CandDeMuxDigit::~CandDeMuxDigit(), CandDeMuxDigitList::~CandDeMuxDigitList(), CandDigit::~CandDigit(), CandDigitList::~CandDigitList(), CandEventList::~CandEventList(), CandFitShowerEM::~CandFitShowerEM(), CandFitShowerEMList::~CandFitShowerEMList(), CandFitTrack::~CandFitTrack(), CandFitTrackList::~CandFitTrackList(), CandFitTrackMS::~CandFitTrackMS(), CandFitTrackMSList::~CandFitTrackMSList(), CandFitTrackSRList::~CandFitTrackSRList(), CandReco::~CandReco(), CandRecoList::~CandRecoList(), CandRmMu::~CandRmMu(), CandRmMuList::~CandRmMuList(), CandShower::~CandShower(), CandShowerEM::~CandShowerEM(), CandShowerEMList::~CandShowerEMList(), CandShowerList::~CandShowerList(), CandShowerSR::~CandShowerSR(), CandShowerSRList::~CandShowerSRList(), CandSlice::~CandSlice(), CandSliceList::~CandSliceList(), CandStripList::~CandStripList(), CandSubShowerSR::~CandSubShowerSR(), CandSubShowerSRList::~CandSubShowerSRList(), CandTrack::~CandTrack(), CandTrackList::~CandTrackList(), CandTrackSR::~CandTrackSR(), CandTrackSRList::~CandTrackSRList(), and FarDetEventList::~FarDetEventList().

00123 {
00124    return GetCandUid().GetArchUidInt();
00125 }

const CandUid& CandBase::GetCandUid (  )  const [inline, protected]

Definition at line 67 of file CandBase.h.

References fCandUid.

Referenced by GetArchUidInt(), CandHandle::GetCandUid(), and GetUidInt().

00067 {return *fCandUid;}

static const TString& CandBase::GetDataIndent (  )  [inline, static, protected]
const CandHandle * CandBase::GetDaughter ( Int_t  ndau  )  const [protected]

Definition at line 128 of file CandBase.cxx.

References fDaughters.

Referenced by CandHandle::GetDaughter().

00129 {
00130   if ((ndau > -1) && (ndau < (fDaughters.GetLast()+1)))
00131     return (CandHandle *) fDaughters.At(ndau);
00132   else
00133     return 0;
00134 }

TIter CandBase::GetDaughterIterator (  )  const [protected]

Definition at line 137 of file CandBase.cxx.

References fDaughters.

Referenced by CandReco::CandReco(), CandRmMu::CandRmMu(), CandShower::CandShower(), CandTrack::CandTrack(), CandDeadChip::Dup(), CandShowerEM::Dup(), CandFitTrackList::Dup(), CandFitTrack::Dup(), CandChopList::Dup(), CandTrackAtNuList::Dup(), CandShowerEMList::Dup(), CandRmMuList::Dup(), CandFitTrackCam::Dup(), CandFitShowerEM::Dup(), CandDigit::Dup(), CandShowerSR::Dup(), CandShieldPlank::Dup(), CandCalDetPID::Dup(), CandTrackAtNu::Dup(), CandTrack::Dup(), CandFitTrackMS::Dup(), CandEventList::Dup(), CandDigitList::Dup(), CandDeMuxDigitList::Dup(), CandCluster::Dup(), CandTrackCam::Dup(), CandRecoList::Dup(), CandFitShowerEMList::Dup(), CandSubShowerSRList::Dup(), CandShowerList::Dup(), CandFitTrackSRList::Dup(), CandCluster3DList::Dup(), FarDetStrip::Dup(), FarDetSliceList::Dup(), FarDetShieldPlankList::Dup(), CandSlice::Dup(), CandShowerAtNuList::Dup(), CandShieldPlankList::Dup(), CandFitTrackCamList::Dup(), CandFitTrackAtNu::Dup(), CandDeMuxDigit::Dup(), CandClusterList::Dup(), CandSubShowerSR::Dup(), CandStripList::Dup(), CandStrip::Dup(), CandFitTrackSR::Dup(), CandFitTrackMSList::Dup(), CandFitTrackAtNuList::Dup(), CandDataQuality::Dup(), CandCluster3D::Dup(), CandTrackList::Dup(), CandSliceList::Dup(), CandShower::Dup(), CandRmMu::Dup(), CandTrackSR::Dup(), CandFitTrackSA::Dup(), FarDetStripList::Dup(), FarDetEventList::Dup(), FarDetDeadChip::Dup(), FarDetDataQuality::Dup(), CandCalDetSI::Dup(), FarDetSlice::Dup(), FarDetEvent::Dup(), CandTrackCamList::Dup(), CandShowerAtNu::Dup(), CandTrackSRList::Dup(), CandAtNuReco::Dup(), CandShowerSRList::Dup(), CandEvent::Dup(), FarDetShieldPlank::Dup(), FormatDaughtersToOStream(), CandHandle::GetDaughterIterator(), IsEquivalent(), and SetCandRecord().

00138 {
00139   return TIter(&fDaughters);                   // Daughter list Iterator
00140 }

static const TString& CandBase::GetIndentString (  )  [inline, static, protected]
const CandHandle* CandBase::GetLocalHandle (  )  const [inline, protected]

Definition at line 70 of file CandBase.h.

References fLocalHandle.

Referenced by CandHandle::GetLocalHandle().

00070 {return fLocalHandle;}

static Int_t CandBase::GetNAlloc (  )  [inline, static]

Definition at line 42 of file CandBase.h.

References fsNAlloc.

Referenced by Trace().

00042 {return fsNAlloc;}

Int_t CandBase::GetNDaughters (  )  const [protected]

Definition at line 143 of file CandBase.cxx.

References fDaughters.

Referenced by FormatDaughtersToOStream(), FormatToOStream(), CandHandle::GetNDaughters(), IsComposite(), and Trace().

00144 {
00145   return fDaughters.GetEntries();    // Counts occupied cells, not holes
00146 }

UInt_t CandBase::GetUidInt (  )  const [protected]

Definition at line 149 of file CandBase.cxx.

References GetCandUid(), and CandUid::GetUidInt().

Referenced by CandCalDetSI::CandCalDetSI(), CandChopList::CandChopList(), CandCluster::CandCluster(), CandClusterList::CandClusterList(), CandDeMuxDigit::CandDeMuxDigit(), CandDeMuxDigitList::CandDeMuxDigitList(), CandDigit::CandDigit(), CandDigitList::CandDigitList(), CandEventList::CandEventList(), CandFitShowerEM::CandFitShowerEM(), CandFitShowerEMList::CandFitShowerEMList(), CandFitTrack::CandFitTrack(), CandFitTrackList::CandFitTrackList(), CandFitTrackMS::CandFitTrackMS(), CandFitTrackMSList::CandFitTrackMSList(), CandFitTrackSRList::CandFitTrackSRList(), CandReco::CandReco(), CandRecoList::CandRecoList(), CandRmMu::CandRmMu(), CandRmMuList::CandRmMuList(), CandShower::CandShower(), CandShowerEM::CandShowerEM(), CandShowerEMList::CandShowerEMList(), CandShowerList::CandShowerList(), CandShowerSR::CandShowerSR(), CandShowerSRList::CandShowerSRList(), CandSlice::CandSlice(), CandSliceList::CandSliceList(), CandStripList::CandStripList(), CandSubShowerSR::CandSubShowerSR(), CandSubShowerSRList::CandSubShowerSRList(), CandTrack::CandTrack(), CandTrackList::CandTrackList(), CandTrackSR::CandTrackSR(), CandTrackSRList::CandTrackSRList(), FarDetEventList::FarDetEventList(), FormatToOStream(), CandHandle::GetUidInt(), Trace(), CandChopList::~CandChopList(), CandCluster::~CandCluster(), CandClusterList::~CandClusterList(), CandDeMuxDigit::~CandDeMuxDigit(), CandDeMuxDigitList::~CandDeMuxDigitList(), CandDigit::~CandDigit(), CandDigitList::~CandDigitList(), CandEventList::~CandEventList(), CandFitShowerEM::~CandFitShowerEM(), CandFitShowerEMList::~CandFitShowerEMList(), CandFitTrack::~CandFitTrack(), CandFitTrackList::~CandFitTrackList(), CandFitTrackMS::~CandFitTrackMS(), CandFitTrackMSList::~CandFitTrackMSList(), CandFitTrackSRList::~CandFitTrackSRList(), CandReco::~CandReco(), CandRecoList::~CandRecoList(), CandRmMu::~CandRmMu(), CandRmMuList::~CandRmMuList(), CandShower::~CandShower(), CandShowerEM::~CandShowerEM(), CandShowerEMList::~CandShowerEMList(), CandShowerList::~CandShowerList(), CandShowerSR::~CandShowerSR(), CandShowerSRList::~CandShowerSRList(), CandSlice::~CandSlice(), CandSliceList::~CandSliceList(), CandStripList::~CandStripList(), CandSubShowerSR::~CandSubShowerSR(), CandSubShowerSRList::~CandSubShowerSRList(), CandTrack::~CandTrack(), CandTrackList::~CandTrackList(), CandTrackSR::~CandTrackSR(), CandTrackSRList::~CandTrackSRList(), and FarDetEventList::~FarDetEventList().

00150 {
00151    return GetCandUid().GetUidInt();
00152 }

Bool_t CandBase::HasOverlapWith ( const CandBase cb  )  const [protected]

Definition at line 155 of file CandBase.cxx.

Referenced by CandHandle::HasOverlapWith().

00156 {
00157   return kFALSE;                                // Needs to be filled in
00158 }

static Int_t CandBase::IncIndent (  )  [inline, static, protected]

Definition at line 150 of file CandBase.h.

References fgIndentLevel, and ResizeIndent().

Referenced by FormatDaughtersToOStream(), and CandEvent::FormatToOStream().

00151    { ++fgIndentLevel; return ResizeIndent(); }

Bool_t CandBase::IsComposite (  )  const [protected]

Definition at line 161 of file CandBase.cxx.

References GetNDaughters().

Referenced by CandHandle::IsComposite().

00162 {
00163   return (GetNDaughters() > 1);
00164 }

Bool_t CandBase::IsEquivalent ( const TObject *  rhs  )  const [protected, virtual]

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 167 of file CandBase.cxx.

References fAlgConfigRef, fLocalHandle, GetDaughterIterator(), CandHandle::GetMother(), CandHandle::GetName(), Msg::kDebug, Msg::kError, Msg::kSynopsis, MSG, TestDisplayCandBanner(), and TestEquality().

Referenced by CandRmMuList::IsEquivalent(), CandCluster::IsEquivalent(), CandReco::IsEquivalent(), CandEvent::IsEquivalent(), CandChopList::IsEquivalent(), CandDigit::IsEquivalent(), CandRecoList::IsEquivalent(), FarDetEventList::IsEquivalent(), CandRmMu::IsEquivalent(), CandStrip::IsEquivalent(), CandDigitList::IsEquivalent(), CandSliceList::IsEquivalent(), CandClusterList::IsEquivalent(), CandEventList::IsEquivalent(), CandSlice::IsEquivalent(), CandStripList::IsEquivalent(), and TestTObjArrayPtrEquivalence().

00168 {
00169 
00170 // IsEquivalent does deep comparison for templated Test... methods
00171   TestDisplayCandBanner("CandBase");
00172   if (this->IsEqual(rhs)) return true;    // CandBases have same address
00173   Bool_t result = true;
00174   const CandBase* rCnd = dynamic_cast<const CandBase*>(rhs);
00175   if (rCnd == NULL) {
00176     MSG("VCand", Msg::kDebug)
00177         << "CandBase::IsEquivalent(): Comparison object not a CandBase."
00178                  << "  rhs->ClassName() = " << rhs->ClassName() << endl;
00179     return false;
00180   }
00181   
00182   result = TestEquality("fAlgConfigRef", this->fAlgConfigRef,
00183                                          rCnd->fAlgConfigRef) && result;
00184 
00185 // Compare fDaughters
00186   Bool_t all_daughters_ok = true;
00187   TIter thisIter = this->GetDaughterIterator();
00188   TIter rhsIter  = rCnd->GetDaughterIterator();
00189 
00190   TObject *thisObj;
00191   TObject *rhsObj;
00192 
00193   while ((thisObj = thisIter()) && (rhsObj  = rhsIter())) {
00194     CandHandle *thisCdh = dynamic_cast<CandHandle *>(thisObj);
00195     CandHandle *rhsCdh  = dynamic_cast<CandHandle *>(rhsObj);
00196     if (thisCdh == 0 || rhsCdh == 0) {
00197       MSG("VCand", Msg::kDebug)
00198            << "CandBase::IsEquivalent(): Bad daughter CandHandle found."
00199                   << "  thisObj->ClassName() = " << thisObj->ClassName()
00200                   << ".  rhsObj->ClassName() = " <<  rhsObj->ClassName()
00201                                                                 << endl;
00202       all_daughters_ok = false;
00203       continue;
00204     }
00205 
00206     if (thisCdh->GetMother() != this->fLocalHandle) {
00207       MSG("VCand", Msg::kError) << endl
00208                  << "Bad CandHandle found in LHS Daughter List." << endl
00209        << "CandHandle Mother pointer is not to LocalHandle of CandBase."
00210                                       << endl << "Mother ClassName() = "
00211                             << thisCdh->GetMother()->ClassName() << endl
00212              << "Mother GetName() = " << thisCdh->GetMother()->GetName()
00213                                  << endl << "LocalHandle ClassName() = "
00214                                       << this->fLocalHandle->ClassName()
00215                                    << endl << "LocalHandle GetName() = "
00216                                         << this->fLocalHandle->GetName()
00217                            << endl << "Needs to be understood!" << endl;
00218       all_daughters_ok = false;
00219     }
00220 
00221     if (*thisCdh != *rhsCdh) {    // Compares Candidate Object addresses
00222       MSG("VCand", Msg::kDebug) << "\tDaughter     [not ok]" << endl;
00223       all_daughters_ok = false;
00224     }
00225   }
00226 
00227   if (!all_daughters_ok) {
00228     MSG("VCand", Msg::kSynopsis) << "Daughters \t[not all ok]" << endl;
00229     return false;
00230   }
00231 
00232   MSG("VCand", Msg::kDebug) << "All daughters \t[ok]" << endl;
00233 
00234   return result;
00235 }

CandBase & CandBase::operator= ( const CandBase  )  [private]

Definition at line 88 of file CandBase.cxx.

00089 {
00090   abort();                             // This method should not be used
00091   return *this;
00092 }

Bool_t CandBase::RemoveDaughter ( CandHandle ch  )  [protected]

Definition at line 260 of file CandBase.cxx.

References fDaughters, fLocalHandle, CandHandle::GetName(), Msg::kError, and MSG.

Referenced by CandHandle::RemoveDaughter().

00261 {
00262 
00263 // Removes the first daughter encountered with the same CandHandle ref'd
00264 // object.  CandHandle caller is expected to have found the exact ch.
00265   if ((ch == 0)) {
00266     MSG("Cand", Msg::kError) << endl
00267        << "Failed attempt to remove null CandHandle from Daughter List."
00268     << endl << "LocalHandle ClassName() = " << fLocalHandle->ClassName()
00269         << endl << "LocalHandle GetName() = " << fLocalHandle->GetName()
00270                           << endl << "CandHandle not deleted."  << endl;
00271     return kFALSE;                                     // Failure return
00272   }
00273   if (CandHandle* newh =      // Guarantee Mother link pointer if cloned
00274                  dynamic_cast<CandHandle*>(fDaughters.FindObject(ch))) {
00275     if (newh->GetMother() != fLocalHandle) {
00276       MSG("Cand", Msg::kError) << endl
00277        << "Request to Remove bad CandHandle from Daughter List." << endl
00278        << "CandHandle mother pointer is not to LocalHandle of CandBase."
00279                                                                  << endl
00280             << "Mother ClassName() = " << newh->GetMother()->ClassName()
00281         << endl << "Mother GetName() = " << newh->GetMother()->GetName()
00282                                                                  << endl
00283             << "LocalHandle ClassName() = " << fLocalHandle->ClassName()
00284         << endl << "LocalHandle GetName() = " << fLocalHandle->GetName()
00285         << endl << "CandHandle Removed anyway.  Should be investigated!"
00286                                                                 << endl;
00287     }
00288     if (fDaughters.Remove(newh)) {  // Remove CandHandle from fDaughters
00289       delete newh;                        // Delete CandHandle ch object
00290       fDaughters.Compress();       // Squeeze out holes in Daughter list
00291       return kTRUE;                                    // Success return
00292     }
00293   }
00294   else {
00295     MSG("Cand", Msg::kError) << endl
00296            << "Failed to find and remove CandHandle from Daughter List."
00297                          << endl << "  CandHandle not deleted." << endl;
00298     return kFALSE;                                     // Failure return 
00299   }
00300   return kFALSE;                                          // Did nothing
00301 }

Int_t CandBase::ResizeIndent (  )  [static, private]

Definition at line 420 of file CandBase.cxx.

Referenced by DecIndent(), and IncIndent().

00421 { 
00422   fgIndentString.Resize(3*fgIndentLevel);
00423   return fgIndentLevel;
00424 }

void CandBase::SetCandRecord ( CandRecord cr  )  [protected]

Definition at line 304 of file CandBase.cxx.

References fCandRecord, GetDaughterIterator(), and CandHandle::SetCandRecord().

Referenced by CandTrack::Dup(), CandCluster::Dup(), CandShowerList::Dup(), CandClusterList::Dup(), CandStripList::Dup(), CandStrip::Dup(), CandTrackList::Dup(), CandShower::Dup(), CandHandle::GetOwnedCandBase(), and CandHandle::SetCandRecord().

00305 {
00306   if (cr == fCandRecord) return;   // New fCandRecord is same as old one
00307 
00308   fCandRecord = cr;
00309   TIter iterdau = GetDaughterIterator();
00310   CandHandle *dau;
00311   while ((dau = dynamic_cast<CandHandle *>(iterdau()))) {
00312     dau->SetCandRecord(cr);
00313   }
00314 }

static void CandBase::SetDataIndent ( const TString &  distr  )  [inline, static, protected]

Definition at line 146 of file CandBase.h.

References fgDataIndentString.

00147    { fgDataIndentString=distr;}

void CandBase::SetLocalHandle ( CandHandle ch  )  [protected]

Definition at line 317 of file CandBase.cxx.

References fLocalHandle.

Referenced by CandAtNuReco::CandAtNuReco(), CandDataQuality::CandDataQuality(), CandDeadChip::CandDeadChip(), CandFitTrackAtNu::CandFitTrackAtNu(), CandFitTrackAtNuList::CandFitTrackAtNuList(), CandShowerAtNu::CandShowerAtNu(), CandShowerAtNuList::CandShowerAtNuList(), CandTrackAtNu::CandTrackAtNu(), CandTrackAtNuList::CandTrackAtNuList(), CandStripList::CreateLocalHandle(), CandSliceList::CreateLocalHandle(), CandShowerList::CreateLocalHandle(), CandShowerAtNu::CreateLocalHandle(), CandShieldPlankList::CreateLocalHandle(), CandFitTrackSR::CreateLocalHandle(), FarDetEvent::CreateLocalHandle(), CandShowerEMList::CreateLocalHandle(), CandShower::CreateLocalHandle(), CandFitTrackCam::CreateLocalHandle(), CandFitTrackAtNu::CreateLocalHandle(), CandDigit::CreateLocalHandle(), CandStrip::CreateLocalHandle(), CandRmMu::CreateLocalHandle(), CandDigitList::CreateLocalHandle(), CandRmMuList::CreateLocalHandle(), CandFitTrackList::CreateLocalHandle(), CandDeMuxDigitList::CreateLocalHandle(), CandClusterList::CreateLocalHandle(), CandSubShowerSR::CreateLocalHandle(), CandFitShowerEM::CreateLocalHandle(), CandDataQuality::CreateLocalHandle(), CandCluster3DList::CreateLocalHandle(), CandFitTrackSRList::CreateLocalHandle(), CandFitTrackSA::CreateLocalHandle(), FarDetStripList::CreateLocalHandle(), FarDetDataQuality::CreateLocalHandle(), CandShowerSR::CreateLocalHandle(), CandDeadChip::CreateLocalHandle(), FarDetStrip::CreateLocalHandle(), FarDetEventList::CreateLocalHandle(), CandCalDetPID::CreateLocalHandle(), CandAtNuReco::CreateLocalHandle(), CandCluster3D::CreateLocalHandle(), CandCluster::CreateLocalHandle(), CandFitTrackMSList::CreateLocalHandle(), CandFitTrack::CreateLocalHandle(), CandFitShowerEMList::CreateLocalHandle(), CandChopList::CreateLocalHandle(), CandCalDetSI::CreateLocalHandle(), FarDetSlice::CreateLocalHandle(), FarDetShieldPlankList::CreateLocalHandle(), CandEventList::CreateLocalHandle(), CandEvent::CreateLocalHandle(), CandTrackSR::CreateLocalHandle(), CandTrackCamList::CreateLocalHandle(), CandSubShowerSRList::CreateLocalHandle(), CandShowerEM::CreateLocalHandle(), FarDetSliceList::CreateLocalHandle(), CandTrackList::CreateLocalHandle(), CandTrackAtNu::CreateLocalHandle(), CandTrackSRList::CreateLocalHandle(), CandShowerSRList::CreateLocalHandle(), CandTrack::CreateLocalHandle(), CandFitTrackCamList::CreateLocalHandle(), FarDetShieldPlank::CreateLocalHandle(), FarDetDeadChip::CreateLocalHandle(), CandTrackCam::CreateLocalHandle(), CandSlice::CreateLocalHandle(), CandShieldPlank::CreateLocalHandle(), CandRecoList::CreateLocalHandle(), CandFitTrackMS::CreateLocalHandle(), CandDeMuxDigit::CreateLocalHandle(), FarDetDataQuality::FarDetDataQuality(), FarDetDeadChip::FarDetDeadChip(), FarDetEvent::FarDetEvent(), FarDetShieldPlank::FarDetShieldPlank(), FarDetSlice::FarDetSlice(), FarDetSliceList::FarDetSliceList(), FarDetStrip::FarDetStrip(), and FarDetStripList::FarDetStripList().

00318 {
00319   assert (fLocalHandle == 0);
00320   fLocalHandle = ch;             // Handle supplied by derived Candidate
00321   assert (fLocalHandle != 0);
00322 }

template<class mType >
Bool_t CandBase::TestArrayEquality ( const char *  mbrName,
int  arrLen,
const mType &  thisMbr,
const mType &  rhsMbr 
) const [inline, protected]

Definition at line 17 of file CandBase.tpl.

References Msg::kDebug, and MSG.

Referenced by CandTrack::IsEquivalent(), CandFitTrackSR::IsEquivalent(), and CandShower::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 }

template<class chType >
Bool_t CandBase::TestCandHandleDup ( const char *  chName,
const chType *  thisCH,
const chType *  rCndCH 
) const [inline, protected]

Definition at line 41 of file CandBase.tpl.

References Msg::kDebug, and MSG.

Referenced by CandReco::IsEquivalent(), CandCluster::IsEquivalent(), and CandEvent::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 }                                                                

void CandBase::TestDisplayCandBanner ( const char *  mName = "Candidate"  )  const [protected]

Definition at line 238 of file CandBase.cxx.

References Msg::kDebug, and MSG.

Referenced by CandTrackSRList::IsEquivalent(), CandShowerList::IsEquivalent(), CandFitTrackSRList::IsEquivalent(), CandTrackSR::IsEquivalent(), CandFitTrack::IsEquivalent(), CandTrack::IsEquivalent(), CandRmMuList::IsEquivalent(), CandReco::IsEquivalent(), CandCluster::IsEquivalent(), CandSubShowerSRList::IsEquivalent(), CandShowerSRList::IsEquivalent(), CandFitShowerEMList::IsEquivalent(), CandFitShowerEM::IsEquivalent(), CandEvent::IsEquivalent(), CandDeMuxDigitList::IsEquivalent(), CandShowerSR::IsEquivalent(), CandFitTrackList::IsEquivalent(), CandChopList::IsEquivalent(), FarDetEventList::IsEquivalent(), CandRecoList::IsEquivalent(), CandDigit::IsEquivalent(), CandTrackList::IsEquivalent(), CandStrip::IsEquivalent(), CandRmMu::IsEquivalent(), CandShowerEM::IsEquivalent(), CandDigitList::IsEquivalent(), CandFitTrackSR::IsEquivalent(), CandSliceList::IsEquivalent(), IsEquivalent(), CandClusterList::IsEquivalent(), CandSubShowerSR::IsEquivalent(), CandSlice::IsEquivalent(), CandShowerEMList::IsEquivalent(), CandEventList::IsEquivalent(), CandDeMuxDigit::IsEquivalent(), CandCluster3D::IsEquivalent(), CandStripList::IsEquivalent(), CandShower::IsEquivalent(), and CandCluster3DList::IsEquivalent().

00239 {
00240 
00241 // Displays a debugging banner
00242   MSG("VCand", Msg::kDebug) << "\n____________"
00243      << mName << "::IsEquivalent "
00244      << "______________________________\n";
00245 
00246   return;
00247 }

template<class mType >
Bool_t CandBase::TestEquality ( const char *  mbrName,
const mType &  thisMbr,
const mType &  rhsMbr 
) const [inline, protected]
template<class mType >
Bool_t CandBase::TestEquivalence ( const char *  mName,
const mType &  thisMbr,
const mType &  rhsMbr 
) const [inline, protected]

Definition at line 89 of file CandBase.tpl.

References Msg::kDebug, and MSG.

00092 {
00093 
00094 // Tests the equivalence of two objects
00095 // (uses the IsEquivalent method)
00096   if (&thisMbr == &rhsMbr) {
00097     MSG("VCand", Msg::kDebug) << mName << "  \t[is a shallow copy]\n";
00098     return false;
00099   }
00100   else {
00101     if (thisMbr.IsEquivalent(&rhsMbr)) {
00102       MSG("VCand", Msg::kDebug) << mName << "  \t[ok]\n";
00103     }
00104     else {
00105       MSG("VCand", Msg::kDebug) << mName << "  \t[not ok]\n";
00106       return false;
00107     }
00108   }
00109   return true;
00110 }

template<class elemType >
Bool_t CandBase::TestGenericElemPtrTObjArrayPtrEquality ( const char *  arrName,
const TObjArray *  thisTOA,
const TObjArray *  rCndTOA 
) const [inline, protected]

Definition at line 114 of file CandBase.tpl.

00118 {
00119 
00120 // Tests the equality of the elements of a TObjArray* member
00121 // uses == operator to compare the TObject* elements of the TObjArray
00122   return TestGenericElemPtrTObjArrayPtrEquivalence<elemType>(arrName,
00123                                                thisTOA, rCndTOA, false);
00124 }

template<class elemType >
Bool_t CandBase::TestGenericElemPtrTObjArrayPtrEquivalence ( const char *  arrName,
const TObjArray *  thisTOA,
const TObjArray *  rCndTOA,
Bool_t  testEquivalence = true 
) const [inline, protected]

Definition at line 128 of file CandBase.tpl.

References Msg::kDebug, and MSG.

00133 {
00134 
00135 // Tests the equivalence of the elements of a TObjArray* member
00136 // Uses the IsEquivalent() to compare the elements of the TObjArray
00137 // for the testEquivalence test
00138 // Note:  Uses IsEqual() instead of the == operator, for equality test.
00139   if (thisTOA == rCndTOA) {
00140     MSG("VCand", Msg::kDebug) << arrName << "  \t[is a shallow copy]\n";
00141     return false;
00142   }
00143   else {
00144     Bool_t isEquivalent = true;
00145     Bool_t isShallow    = false;
00146     Bool_t dcastFailed  = false;
00147     if (thisTOA->GetEntries() != thisTOA->GetEntries()) {
00148       isEquivalent = false;
00149     }
00150     else {
00151       TIterator* thisIter = thisTOA->MakeIterator();
00152       TIterator* rCndIter = rCndTOA->MakeIterator();
00153       TObject  *thisObj, *rCndObj;
00154       while ((thisObj = thisIter->Next()) &&
00155              (rCndObj = rCndIter->Next())) {
00156 
00157         if (thisObj == rCndObj) {
00158           isShallow = true;
00159         }
00160         else {
00161           elemType *thisCB = dynamic_cast<elemType*>(thisObj);
00162           elemType *rCndCB = dynamic_cast<elemType*>(rCndObj);
00163           if (thisCB == NULL || rCndCB == NULL) {
00164             isEquivalent = false;
00165             dcastFailed  = true;
00166             break;
00167           }
00168           if (testEquivalence) {   // use object's IsEquivalent() method
00169             if (!thisCB || !rCndCB || !(thisCB->IsEquivalent(rCndCB))) {
00170               isEquivalent = false;
00171             }
00172           }
00173           else {                    // use the object's IsEqual() method
00174             if ( !(thisObj->IsEqual(rCndObj)) ) {
00175               isEquivalent = false;
00176             }
00177           }
00178         }
00179       }
00180     }
00181     if (isEquivalent) {
00182       if (isShallow) {
00183         MSG("VCand", Msg::kDebug)
00184              << arrName << "  \t[shallow copy of TObjArray elements]\n";
00185       }
00186       else {
00187         MSG("VCand", Msg::kDebug) << arrName << "  \t[ok]\n";
00188       }
00189     }
00190     else {
00191       if (dcastFailed) {
00192         MSG("VCand", Msg::kDebug)
00193         << arrName << "  \t[dynamic cast of elements failed--not ok]\n";
00194       }
00195       else {
00196         MSG("VCand", Msg::kDebug) << arrName << "  \t[not ok]\n";
00197       }
00198       return false;
00199     }
00200   }
00201   return true;
00202 }

void CandBase::TestNothing ( const char *  mName = "Candidate"  )  const [protected]
template<class mType >
Bool_t CandBase::TestPtrEquivalence ( const char *  mName,
const mType *  thisMbr,
const mType *  rhsMbr 
) const [inline, protected]

Definition at line 206 of file CandBase.tpl.

References Msg::kDebug, and MSG.

Referenced by CandTrackSR::IsEquivalent(), and CandFitTrackSR::IsEquivalent().

00209 {
00210 
00211 // Tests the equivalence of two object pointers
00212 // (uses the IsEquivalent method)
00213   if (thisMbr == rhsMbr) {
00214     MSG("VCand", Msg::kDebug) << mName << "  \t[is a shallow copy]\n";
00215     return false;
00216   }
00217   else {
00218     if (thisMbr->IsEquivalent(rhsMbr)) {
00219       MSG("VCand", Msg::kDebug) << mName << "  \t[ok]\n";
00220     }
00221     else {
00222       MSG("VCand", Msg::kDebug) << mName << "  \t[not ok]\n";
00223       return false;
00224     }
00225   }
00226   return true;
00227 }

template<class toaType >
Bool_t CandBase::TestTObjArrayCandHandleDup ( const char *  arrName,
const toaType &  thisTOA,
const toaType &  rCndTOA 
) const [inline, protected]

Definition at line 231 of file CandBase.tpl.

References Msg::kDebug, and MSG.

Referenced by CandEvent::IsEquivalent(), CandShowerSR::IsEquivalent(), and CandShower::IsEquivalent().

00234 {
00235 
00236 // Tests if the CandHandles in the TObjArray were DupHandle()d
00237 // toaType is always a TObjArray, but it's templatized so the
00238   Bool_t isEquivalent = true;
00239   Bool_t hasShallowCopies = false;
00240   if (thisTOA.GetEntries() != rCndTOA.GetEntries() ){
00241     isEquivalent = false;
00242   }
00243   else {
00244     TIterator* thisIter = thisTOA.MakeIterator();
00245     TIterator* rCndIter = rCndTOA.MakeIterator();
00246 
00247 // loop over the CandHandle elements
00248     TObject *thisTObj, *rCndTObj;
00249     while ( ((thisTObj=thisIter->Next()) != NULL) &&
00250            ((rCndTObj=rCndIter->Next()) != NULL)   ) {
00251       if (thisTObj == rCndTObj) {
00252         hasShallowCopies = true;
00253         isEquivalent = false;
00254       }
00255       else {
00256         const CandHandle* thisCH =
00257               dynamic_cast<const CandHandle*>(thisTObj);
00258         const CandHandle* rCndCH =
00259               dynamic_cast<const CandHandle*>(rCndTObj);
00260         if(!(*thisCH == *rCndCH)) {
00261           isEquivalent = false;
00262         }
00263       }
00264     }
00265   }
00266 
00267   if (hasShallowCopies) {
00268     MSG("VCand", Msg::kDebug) << arrName
00269                               << "  \t[has shallow copies]\n";
00270   }
00271   else if (isEquivalent) {
00272     MSG("VCand", Msg::kDebug) << arrName << "  \t[ok]\n";
00273   }
00274   else {
00275     MSG("VCand", Msg::kDebug) << arrName << "  \t[not ok]\n";
00276     return false;
00277   }
00278   return true;
00279 }

template<class toaType >
Bool_t CandBase::TestTObjArrayEquality ( const char *  arrName,
const toaType &  thisTOA,
const toaType &  rCndTOA 
) const [inline, protected]

Definition at line 283 of file CandBase.tpl.

References TestTObjArrayPtrEquality().

00286 {
00287 
00288 // Tests the equality of a TObjArray member
00289 // array elements are compared by checking if they point to same object
00290 // (TObject* == TObject*)?
00291   return TestTObjArrayPtrEquality(arrName, &thisTOA, &rCndTOA);
00292 }

template<class toaType >
Bool_t CandBase::TestTObjArrayPtrEquality ( const char *  arrName,
const toaType *  thisTOA,
const toaType *  rCndTOA 
) const [inline, protected]

Definition at line 296 of file CandBase.tpl.

References TestTObjArrayPtrEquivalence().

Referenced by TestTObjArrayEquality().

00299 {
00300 
00301 // Tests the equality of the elements of a TObjArray* member
00302 // uses == operator to compare the TObject* elements of the TObjArray
00303   return TestTObjArrayPtrEquivalence(arrName, thisTOA, rCndTOA, false);
00304 }

template<class toaType >
Bool_t CandBase::TestTObjArrayPtrEquivalence ( const char *  arrName,
const toaType *  thisTOA,
const toaType *  rCndTOA,
Bool_t  testEquivalence = true 
) const [inline, protected]

Definition at line 308 of file CandBase.tpl.

References IsEquivalent(), Msg::kDebug, and MSG.

Referenced by TestTObjArrayPtrEquality().

00312 {
00313 
00314 // Tests the equivalence of the elements of a TObjArray* member
00315 // Uses the IsEquivalent() to compare the elements of the TObjArray
00316 // for the testEquivalence test
00317   if (thisTOA == rCndTOA) {
00318     MSG("VCand", Msg::kDebug) << arrName << "  \t[is a shallow copy]\n";
00319     return false;
00320   }
00321   else {
00322     Bool_t isEquivalent = true;
00323     if (thisTOA->GetEntries() != thisTOA->GetEntries()) {
00324       isEquivalent = false;
00325     }
00326     else {
00327       TIterator* thisIter = thisTOA->MakeIterator();
00328       TIterator* rCndIter = rCndTOA->MakeIterator();
00329       TObject  *thisObj, *rCndObj;
00330       while ( (thisObj = thisIter->Next()) &&
00331               (rCndObj = rCndIter->Next())   ) {
00332 
00333         if (testEquivalence) { // use the object's IsEquivalent() method
00334           CandBase *thisCB = dynamic_cast<CandBase*>(thisObj);
00335           CandBase *rCndCB = dynamic_cast<CandBase*>(rCndObj);
00336           if (!thisCB || !rCndCB || !(thisCB->IsEquivalent(rCndCB)) ) {
00337             isEquivalent = false;
00338           }
00339         }
00340         else {                                    // use the == operator
00341           if ( !(thisObj == rCndObj) ) {
00342             isEquivalent = false;
00343           }
00344         }
00345       }
00346     }
00347 
00348     if (isEquivalent) {
00349       MSG("VCand", Msg::kDebug) << arrName << "  \t[ok]\n";
00350     }
00351     else {
00352       MSG("VCand", Msg::kDebug) << arrName << "  \t[not ok]\n";
00353       return false;
00354     }
00355   }
00356   return true;
00357 }

void CandBase::Trace ( const char *  c = ""  )  const [virtual]

Definition at line 325 of file CandBase.cxx.

References GetArchUidInt(), GetNAlloc(), GetNDaughters(), CandRefCounted::GetNLinks(), GetUidInt(), Msg::kDebug, and MSG.

Referenced by CandHandle::Trace().

00326 {
00327   MSG("Cand", Msg::kDebug)
00328            << "**********Begin CandBase::Trace(\"" << c << "\")" << endl
00329       << CandBase::GetNAlloc() << " CandBase objects allocated." << endl
00330                       << "UidInt = " << GetUidInt() << ", ArchUidInt = "
00331                                               << GetArchUidInt() << endl
00332                    << "No. of ref-counted CandHandles = " << GetNLinks()
00333                                  << " (LocalHandle not counted)" << endl
00334                    << "NDaughters = " << GetNDaughters() << endl << endl
00335             << "**********End CandBase::Trace(\"" << c << "\")" << endl;
00336 }


Friends And Related Function Documentation

friend class CandHandle [friend]

Definition at line 37 of file CandBase.h.

friend class CandRefer [friend]

Definition at line 38 of file CandBase.h.

friend class CandUid [friend]

Definition at line 39 of file CandBase.h.

Referenced by CandBase().


Member Data Documentation

TRef CandBase::fAlgConfigRef [protected]

Definition at line 53 of file CandBase.h.

Referenced by GetAlgConfig(), and IsEquivalent().

UInt_t CandBase::fArchUidInt [private]

Definition at line 155 of file CandBase.h.

Immediate Ancestor Cand UIDInt.

Definition at line 156 of file CandBase.h.

Referenced by CandBase(), GetCandUid(), and ~CandBase().

TObjArray CandBase::fDaughters [protected]
TString CandBase::fgDataIndentString = "| " [static, private]

Definition at line 163 of file CandBase.h.

Referenced by GetDataIndent(), and SetDataIndent().

Int_t CandBase::fgIndentLevel = 0 [static, private]

Definition at line 161 of file CandBase.h.

Referenced by DecIndent(), and IncIndent().

TString CandBase::fgIndentString = "" [static, private]

Definition at line 162 of file CandBase.h.

Referenced by GetIndentString().

Int_t CandBase::fsNAlloc = 0 [static, private]

Unique Cand ID object.

Definition at line 157 of file CandBase.h.

Referenced by GetNAlloc().


The documentation for this class was generated from the following files:

Generated on 21 Oct 2017 for loon by  doxygen 1.6.1