Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CandBase Class Reference

#include <CandBase.h>

Inheritance diagram for CandBase:

CandRefCounted AltCandStpProb AltCandStpProbList 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

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
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
CandRecordfCandRecord
TObjArray fDaughters
CandHandlefLocalHandle

Private Member Functions

CandBaseoperator= (const CandBase &)

Static Private Member Functions

Int_t ResizeIndent ()

Private Attributes

UInt_t fArchUidInt
CandUidfCandUid
 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

Constructor & Destructor Documentation

CandBase::CandBase  ) 
 

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 }

CandBase::CandBase const AlgHandle ah  )  [protected]
 

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 }

CandBase::CandBase const CandBase cb  )  [protected]
 

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 }

CandBase::~CandBase  )  [protected, virtual]
 

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 }


Member Function Documentation

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

Definition at line 103 of file CandBase.cxx.

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

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

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

virtual void CandBase::CreateLocalHandle  )  [protected, pure virtual]
 

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

Int_t CandBase::DecIndent  )  [inline, static, protected]
 

Definition at line 150 of file CandBase.h.

References ResizeIndent().

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

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

virtual CandBase* CandBase::Dup  )  const [protected, pure virtual]
 

Implements CandRefCounted.

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

Referenced by CandRefer::OwnRef().

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

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 }

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 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 }

AlgConfig * CandBase::GetAlgConfig  )  const [protected]
 

Definition at line 115 of file CandBase.cxx.

References fAlgConfigRef.

Referenced by CandHandle::GetAlgConfig().

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

UInt_t CandBase::GetArchUidInt  )  const [protected]
 

Definition at line 121 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(), CandFitTrack3::CandFitTrack3(), CandFitTrack3List::CandFitTrack3List(), 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(), CandFitTrack3::~CandFitTrack3(), CandFitTrack3List::~CandFitTrack3List(), 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().

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

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

Definition at line 67 of file CandBase.h.

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

00067 {return *fCandUid;}

const TString& CandBase::GetDataIndent  )  [inline, static, protected]
 

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; }

const CandHandle * CandBase::GetDaughter Int_t  ndau  )  const [protected]
 

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 }

TIter CandBase::GetDaughterIterator  )  const [protected]
 

Definition at line 136 of file CandBase.cxx.

References fDaughters.

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

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

const TString& CandBase::GetIndentString  )  [inline, static, protected]
 

Definition at line 146 of file CandBase.h.

Referenced by FormatDaughtersToOStream(), 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(), CandCluster::FormatToOStream(), and FormatToOStream().

00146 { return fgIndentString; } 

const CandHandle* CandBase::GetLocalHandle  )  const [inline, protected]
 

Definition at line 70 of file CandBase.h.

Referenced by CandHandle::GetLocalHandle().

00070 {return fLocalHandle;}

Int_t CandBase::GetNAlloc  )  [inline, static]
 

Definition at line 42 of file CandBase.h.

Referenced by Trace().

00042 {return fsNAlloc;}

Int_t CandBase::GetNDaughters  )  const [protected]
 

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 }

UInt_t CandBase::GetUidInt  )  const [protected]
 

Definition at line 148 of file CandBase.cxx.

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

Referenced by AltCandStpProb::AltCandStpProb(), AltCandStpProbList::AltCandStpProbList(), CandCalDetSI::CandCalDetSI(), CandChopList::CandChopList(), CandCluster::CandCluster(), CandClusterList::CandClusterList(), CandDeMuxDigit::CandDeMuxDigit(), CandDeMuxDigitList::CandDeMuxDigitList(), CandDigit::CandDigit(), CandDigitList::CandDigitList(), CandEventList::CandEventList(), CandFitShowerEM::CandFitShowerEM(), CandFitShowerEMList::CandFitShowerEMList(), CandFitTrack::CandFitTrack(), CandFitTrack3::CandFitTrack3(), CandFitTrack3List::CandFitTrack3List(), 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(), AltCandStpProb::~AltCandStpProb(), AltCandStpProbList::~AltCandStpProbList(), CandChopList::~CandChopList(), CandCluster::~CandCluster(), CandClusterList::~CandClusterList(), CandDeMuxDigit::~CandDeMuxDigit(), CandDeMuxDigitList::~CandDeMuxDigitList(), CandDigit::~CandDigit(), CandDigitList::~CandDigitList(), CandEventList::~CandEventList(), CandFitShowerEM::~CandFitShowerEM(), CandFitShowerEMList::~CandFitShowerEMList(), CandFitTrack::~CandFitTrack(), CandFitTrack3::~CandFitTrack3(), CandFitTrack3List::~CandFitTrack3List(), 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().

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

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

Definition at line 154 of file CandBase.cxx.

Referenced by CandHandle::HasOverlapWith().

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

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

Definition at line 152 of file CandBase.h.

References ResizeIndent().

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

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

Bool_t CandBase::IsComposite  )  const [protected]
 

Definition at line 160 of file CandBase.cxx.

References GetNDaughters().

Referenced by CandHandle::IsComposite().

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

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 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 }

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

Definition at line 87 of file CandBase.cxx.

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

Bool_t CandBase::RemoveDaughter CandHandle ch  )  [protected]
 

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 }

Int_t CandBase::ResizeIndent  )  [static, private]
 

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 }

void CandBase::SetCandRecord CandRecord cr  )  [protected]
 

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 }

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

Definition at line 148 of file CandBase.h.

References fgDataIndentString.

00149    { fgDataIndentString=distr;}

void CandBase::SetLocalHandle CandHandle ch  )  [protected]
 

Definition at line 294 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(), FarDetStripList::CreateLocalHandle(), FarDetStrip::CreateLocalHandle(), FarDetSliceList::CreateLocalHandle(), FarDetSlice::CreateLocalHandle(), FarDetShieldPlankList::CreateLocalHandle(), FarDetShieldPlank::CreateLocalHandle(), FarDetEventList::CreateLocalHandle(), FarDetEvent::CreateLocalHandle(), FarDetDeadChip::CreateLocalHandle(), FarDetDataQuality::CreateLocalHandle(), CandTrackSRList::CreateLocalHandle(), CandTrackSR::CreateLocalHandle(), CandTrackList::CreateLocalHandle(), CandTrackCamList::CreateLocalHandle(), CandTrackCam::CreateLocalHandle(), CandTrackAtNu::CreateLocalHandle(), CandTrack::CreateLocalHandle(), CandSubShowerSRList::CreateLocalHandle(), CandSubShowerSR::CreateLocalHandle(), CandStripList::CreateLocalHandle(), CandStrip::CreateLocalHandle(), CandSliceList::CreateLocalHandle(), CandSlice::CreateLocalHandle(), CandShowerSRList::CreateLocalHandle(), CandShowerSR::CreateLocalHandle(), CandShowerList::CreateLocalHandle(), CandShowerEMList::CreateLocalHandle(), CandShowerEM::CreateLocalHandle(), CandShowerAtNu::CreateLocalHandle(), CandShower::CreateLocalHandle(), CandShieldPlankList::CreateLocalHandle(), CandShieldPlank::CreateLocalHandle(), CandRmMuList::CreateLocalHandle(), CandRmMu::CreateLocalHandle(), CandRecoList::CreateLocalHandle(), CandFitTrackSRList::CreateLocalHandle(), CandFitTrackSR::CreateLocalHandle(), CandFitTrackSA::CreateLocalHandle(), CandFitTrackMSList::CreateLocalHandle(), CandFitTrackMS::CreateLocalHandle(), CandFitTrackList::CreateLocalHandle(), CandFitTrackCamList::CreateLocalHandle(), CandFitTrackCam::CreateLocalHandle(), CandFitTrackAtNu::CreateLocalHandle(), CandFitTrack3List::CreateLocalHandle(), CandFitTrack3::CreateLocalHandle(), CandFitTrack::CreateLocalHandle(), CandFitShowerEMList::CreateLocalHandle(), CandFitShowerEM::CreateLocalHandle(), CandEventList::CreateLocalHandle(), CandEvent::CreateLocalHandle(), CandDigitList::CreateLocalHandle(), CandDigit::CreateLocalHandle(), CandDeMuxDigitList::CreateLocalHandle(), CandDeMuxDigit::CreateLocalHandle(), CandDeadChip::CreateLocalHandle(), CandDataQuality::CreateLocalHandle(), CandClusterList::CreateLocalHandle(), CandCluster3DList::CreateLocalHandle(), CandCluster3D::CreateLocalHandle(), CandCluster::CreateLocalHandle(), CandChopList::CreateLocalHandle(), CandCalDetSI::CreateLocalHandle(), CandCalDetPID::CreateLocalHandle(), CandAtNuReco::CreateLocalHandle(), AltCandStpProbList::CreateLocalHandle(), AltCandStpProb::CreateLocalHandle(), FarDetDataQuality::FarDetDataQuality(), FarDetDeadChip::FarDetDeadChip(), FarDetEvent::FarDetEvent(), FarDetShieldPlank::FarDetShieldPlank(), FarDetSlice::FarDetSlice(), FarDetSliceList::FarDetSliceList(), FarDetStrip::FarDetStrip(), and FarDetStripList::FarDetStripList().

00295 {
00296   assert (fLocalHandle == 0);
00297   fLocalHandle = ch;             // Handle supplied by derived Candidate
00298   assert (fLocalHandle != 0);
00299 }

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

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 }

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

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 }                                                                

template<class _char>
void CandBase::TestDisplayCandBanner _char *  mName  )  const [protected]
 

Definition at line 71 of file CandBase.tpl.

References MSG.

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

00072 {
00073 
00074 // Displays a debugging banner
00075   MSG("VCand", Msg::kDebug) << "\n____________"
00076      << mName << "::IsEquivalent "
00077      << "______________________________\n";
00078 }

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

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 }

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

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 }

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

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 }

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

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 }

template<class _char>
void CandBase::TestNothing _char *  mName = "Candidate"  )  const [protected]
 

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 }

template<class mType>
Bool_t CandBase::TestPtrEquivalence const char *  mName,
const mType *  thisMbr,
const mType *  rhsMbr
const [protected]
 

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 }

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

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 }

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

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 }

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

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 }

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

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 }

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

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 }


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 157 of file CandBase.h.

CandRecord* CandBase::fCandRecord [protected]
 

Definition at line 54 of file CandBase.h.

Referenced by AddDaughterLink(), CandHandle::GetCandRecord(), CandHandle::GetOwnedCandBase(), CandHandle::GetVldContext(), and SetCandRecord().

CandUid* CandBase::fCandUid [private]
 

Immediate Ancestor Cand UIDInt.

Definition at line 158 of file CandBase.h.

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

TObjArray CandBase::fDaughters [protected]
 

Definition at line 55 of file CandBase.h.

Referenced by CandHandle::DropMotherLink(), GetDaughter(), GetDaughterIterator(), GetNDaughters(), RemoveDaughter(), CandHandle::SetMotherLink(), and ~CandBase().

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

Definition at line 36 of file CandBase.cxx.

Referenced by SetDataIndent().

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

Definition at line 34 of file CandBase.cxx.

Referenced by ResizeIndent().

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

Definition at line 35 of file CandBase.cxx.

Referenced by ResizeIndent().

CandHandle* CandBase::fLocalHandle [protected]
 

Definition at line 56 of file CandBase.h.

Referenced by AddDaughterLink(), IsEquivalent(), RemoveDaughter(), SetLocalHandle(), and ~CandBase().

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

Unique Cand ID object.

Definition at line 32 of file CandBase.cxx.

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


The documentation for this class was generated from the following files:
Generated on Mon Nov 23 05:30:35 2009 for loon by  doxygen 1.3.9.1