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

Public Member Functions | |
| CandHandle () | |
| CandHandle (const CandHandle &ch) | |
| CandHandle (CandBase *cb) | |
| virtual | ~CandHandle () |
| CandHandle & | operator= (const CandHandle &ch) |
| Bool_t | operator== (const CandHandle &ch) const |
| Bool_t | operator!= (const CandHandle &ch) const |
| const CandHandle * | AddDaughterLink (CandHandle &ch, Bool_t check=kTRUE) |
| const CandHandle * | CloneInTree (const CandHandle &ch) const |
| virtual CandHandle * | DupHandle () const |
| CandHandle * | FindDaughter (const CandHandle *ch) const |
| const CandHandle * | FindDaughter (const char *classname=0, const char *objname=0) const |
| const AlgConfig * | GetAlgConfig () const |
| UInt_t | GetArchUidInt () const |
| const CandBase * | GetCandBase () const |
| CandBase * | GetCandBase () |
| CandRecord * | GetCandRecord () const |
| const CandHandle * | GetDaughter (Int_t ndau) const |
| TIter | GetDaughterIterator () const |
| const CandHandle * | GetLocalHandle () const |
| const CandHandle * | GetMother () const |
| const char * | GetName () const |
| Int_t | GetNDaughters () const |
| Int_t | GetNRefers () const |
| const char * | GetTitle () const |
| UInt_t | GetUidInt () const |
| ViewableNotifier * | GetViewableNotifier () |
| const VldContext * | GetVldContext () const |
| Bool_t | HasOverlapWith (const CandHandle &ch) const |
| Bool_t | IsCloneOf (const CandHandle &ch) const |
| Bool_t | IsComposite () const |
| virtual Bool_t | IsEqual (const TObject *rhs) const |
| virtual Bool_t | IsEquivalent (const TObject *rhs) const |
| Bool_t | IsLocal () const |
| Bool_t | IsLocked () const |
| Bool_t | RemoveDaughter (CandHandle *ch) |
| void | SetCandRecord (CandRecord *cr) |
| void | SetName (const char *name) |
| void | SetLock () |
| void | SetTitle (const char *title) |
| void | SetViewableNotifier (ViewableNotifier *vn=0) |
| virtual void | Trace (const char *c="") const |
| virtual void | Print (Option_t *option="nid3") const |
| virtual std::ostream & | FormatToOStream (std::ostream &os, Option_t *option="nid3") const |
Static Public Member Functions | |
| Int_t | GetNAlloc () |
| Bool_t | IsSlushyEnabled () |
| void | SetSlushyEnabled (Bool_t tf=kTRUE) |
Protected Member Functions | |
| CandBase * | GetOwnedCandBase () |
| const CandRefer & | GetCandRefer () const |
| const CandUid & | GetCandUid () const |
Private Member Functions | |
| void | DropMotherLink () |
| Dont write out. | |
| CandRefer & | GetCandRefer () |
| void | SetMotherLink (CandHandle *ch) |
Private Attributes | |
| CandRefer | fCandRefer |
| CandHandle * | fMother |
| Bool_t | fLocked |
| ViewableNotifier * | fViewableNotifier |
Static Private Attributes | |
| Int_t | fsNAlloc = 0 |
| Bool_t | fsSlushyEnabled = kFALSE |
Friends | |
| class | CandBase |
|
|
Definition at line 41 of file CandHandle.cxx. References fsNAlloc. Referenced by DupHandle(). 00041 : 00042 fCandRefer(0) 00043 , fMother(0) 00044 , fLocked(kFALSE) 00045 , fViewableNotifier(0) 00046 { 00047 fsNAlloc++; 00048 }
|
|
|
Definition at line 51 of file CandHandle.cxx. References fsNAlloc. 00051 : 00052 TObject(ch) 00053 , fCandRefer(ch.fCandRefer) 00054 , fMother(0) 00055 , fLocked(kFALSE) 00056 , fViewableNotifier(0) 00057 { 00058 fsNAlloc++; 00059 }
|
|
|
Definition at line 62 of file CandHandle.cxx. References fsNAlloc. 00062 : 00063 fCandRefer(cb) 00064 , fMother(0) 00065 , fLocked(kFALSE) 00066 , fViewableNotifier(0) 00067 { 00068 fsNAlloc++; 00069 }
|
|
|
Definition at line 72 of file CandHandle.cxx. References DropMotherLink(), and fsNAlloc. 00073 {
00074 DropMotherLink();
00075 fsNAlloc--;
00076 }
|
|
||||||||||||
|
|
Definition at line 139 of file CandHandle.cxx. References GetDaughterIterator(), and IsCloneOf(). 00140 {
00141 if (IsCloneOf(ch)) return this;
00142 TIter iterdau = GetDaughterIterator();
00143 CandHandle *dau;
00144 while ((dau=(CandHandle *) iterdau())) {
00145 const CandHandle *chh = dau->CloneInTree(ch);
00146 if (chh != 0) return chh;
00147 }
00148 return 0;
00149 }
|
|
|
Dont write out.
Definition at line 152 of file CandHandle.cxx. References CandBase::fDaughters, fMother, GetCandBase(), and IsLocal(). Referenced by ~CandHandle(). 00153 {
00154 if (fMother == 0) return; // No mother to drop
00155
00156 // Remove mother's daughter link to this
00157 if (!IsLocal()) fMother->GetCandBase()->fDaughters.Remove(this);
00158
00159 fMother = (CandHandle *) 0; // Set this mother link to zero
00160 }
|
|
|
||||||||||||
|
Definition at line 188 of file CandHandle.cxx. References GetCandBase(), and GetName(). 00190 {
00191
00192 // Returns const ptr to first selected CandHandle in daughter list.
00193 // If classname is a null ptr or blank string, no class selection is
00194 // done. If classname is provided, the qualifying object must
00195 // InheritFrom() or be a classname. The objname is optional, but,
00196 // if filled, will further qualify the selection by requiring
00197 // agreement with the GetName() method of the selected object.
00198
00199 TString classtr("");
00200 if (classname)
00201 classtr.Append(TString(classname).Strip(TString::kBoth));
00202 TString objstr("");
00203 if (objname)
00204 objstr.Append(TString(objname).Strip(TString::kBoth));
00205
00206 TIter chli(&GetCandBase()->fDaughters);
00207 CandHandle *ch;
00208
00209 while ((ch = dynamic_cast<CandHandle *>(chli()))) {
00210
00211 // First check whether ch InheritsFrom "classname"
00212 if (classtr.IsNull() || ch->InheritsFrom(classtr)) {
00213
00214 // Then check whether ch name equals "objname"
00215 if (objstr.IsNull() || (objstr == ch->GetName()))
00216 return ch;
00217 }
00218 }
00219 return 0;
00220 }
|
|
|
||||||||||||
|
Definition at line 524 of file CandHandle.cxx. References CandBase::FormatDaughtersToOStream(), CandBase::FormatToOStream(), GetCandBase(), and option. Referenced by CandBase::FormatDaughtersToOStream(), and Print(). 00526 {
00527 // Format the Candidate (and Daughters) to a ostream
00528 // if option string contains:
00529 // n = include name
00530 // t = include title
00531 // i = include Uid's
00532 // v[n] = verbosity level, v0 to suppresss data values
00533 // d[n] = include daughters to depth of [n] (infinite if no n)
00534 // d0 means don't print daughters
00535
00536 GetCandBase()->FormatToOStream(os,option);
00537 return GetCandBase()->FormatDaughtersToOStream(os,option);
00538 }
|
|
|
Definition at line 223 of file CandHandle.cxx. References CandBase::GetAlgConfig(), and GetCandBase(). 00224 {
00225 return GetCandBase()->GetAlgConfig();
00226 }
|
|
|
Definition at line 229 of file CandHandle.cxx. References CandBase::GetArchUidInt(), and GetCandBase(). Referenced by CandFitTrack3::CandFitTrack3(), and CandStripList::CandStripList(). 00230 {
00231 return GetCandBase()->GetArchUidInt();
00232 }
|
|
|
Definition at line 235 of file CandHandle.cxx. References fCandRefer. 00236 {
00237 return fCandRefer();
00238 }
|
|
|
|
|
Definition at line 110 of file CandHandle.h. 00110 {return fCandRefer;}
|
|
|
Definition at line 98 of file CandHandle.h. Referenced by GetNRefers(), GetOwnedCandBase(), and operator=(). 00098 {return fCandRefer;}
|
|
|
Definition at line 253 of file CandHandle.cxx. References GetCandBase(), and CandBase::GetCandUid(). Referenced by IsCloneOf(). 00254 {
00255 return GetCandBase()->GetCandUid();
00256 }
|
|
|
Definition at line 259 of file CandHandle.cxx. References GetCandBase(), and CandBase::GetDaughter(). Referenced by NtpMaker::FillEventInfo(), and AlgTrack::SetUVZ(). 00260 {
00261 return GetCandBase()->GetDaughter(ndau);
00262 }
|
|
|
|
Definition at line 271 of file CandHandle.cxx. References GetCandBase(), and CandBase::GetLocalHandle(). Referenced by GetMother(), GetOwnedCandBase(), and IsLocal(). 00272 {
00273 return GetCandBase()->GetLocalHandle();
00274 }
|
|
|
Definition at line 277 of file CandHandle.cxx. References fMother, GetLocalHandle(), and IsLocal(). Referenced by DigitText::AddCandDigitText(), MCAnalysis::Ana(), GetOwnedCandBase(), CandDigitHandle::GetSubtractedTime(), CandBase::IsEquivalent(), CandBase::RemoveDaughter(), AlgShieldPlank::RunAlg(), and Trace(). 00278 {
00279 if ((fMother == 0) && (GetLocalHandle() != 0) && !IsLocal()) {
00280 return GetLocalHandle()->GetMother();
00281 }
00282 return fMother;
00283 }
|
|
|
Definition at line 67 of file CandHandle.h. 00067 {return fsNAlloc;}
|
|
|
|
|
Definition at line 298 of file CandHandle.cxx. References GetCandRefer(), and CandRefer::GetNRefers(). 00299 {
00300 return GetCandRefer().GetNRefers();
00301 }
|
|
|
|
Definition at line 334 of file CandHandle.cxx. References GetCandBase(). Referenced by FCPCFilterModule::Ana(), DataUtil::dump_cand(), and DetectorAlignment::GetTrackStrips(). 00335 {
00336 return GetCandBase()->GetTitle();
00337 }
|
|
|
|
Definition at line 72 of file CandHandle.h. 00072 {return fViewableNotifier;}
|
|
|
|
Definition at line 355 of file CandHandle.cxx. References GetCandBase(), and CandBase::HasOverlapWith(). 00356 {
00357 return GetCandBase()->HasOverlapWith(*(ch.GetCandBase()));
00358 }
|
|
|
Definition at line 361 of file CandHandle.cxx. References GetCandUid(), and CandUid::IsCloneOf(). Referenced by GfxTrack::BuildDiscreteImp(), GfxShower::BuildDiscreteImp(), GfxTrack::BuildRealImp(), GfxShower::BuildRealImp(), CloneInTree(), GfxTrackList::Configure(), GfxShowerList::Configure(), AlgEventSSList::FillRecoList(), AlgEventSRList::FillRecoList(), AlgEventSSList::FindUnassociated(), AlgEventSRList::FindUnassociated(), AlgEventSSList::ReConstructShowers(), AlgEventSRList::ReConstructShowers(), AlgEventSSList::RunAlg(), AlgEventSRList::RunAlg(), GfxStrip::SetColor(), EVD::UpdateChargeHists(), and EVD::UpdateSummary(). 00362 {
00363 return GetCandUid().IsCloneOf(ch.GetCandUid());
00364 }
|
|
|
Definition at line 367 of file CandHandle.cxx. References GetCandBase(), and CandBase::IsComposite(). 00368 {
00369 return GetCandBase()->IsComposite();
00370 }
|
|
|
Definition at line 373 of file CandHandle.cxx. References GetCandBase(). Referenced by AlgFitTrackCam::CleanNDLists(), AlgFitTrackCamList::CleanNDSlices(), AlgAtmosShowerList::FormDummyTracks(), GetRemovableTrack(), IsEquivalent(), AlgEventSRList::MergeShowers(), EventSRListModule::Reco(), AlgEventSSList::ReConstructShowers(), AlgEventSRList::ReConstructShowers(), AlgTrackSRList::RemoveStripsInSlice(), and AlgTrackSRList::RemoveUnusedSpectStrips(). 00374 {
00375
00376 // Overloads TObject::IsEqual method.
00377 if (TObject::IsEqual(rhs)) return true; // Tests for same address
00378
00379 // CandHandles refer to same CandBase address.
00380 const CandHandle *rch = dynamic_cast<const CandHandle*>(rhs);
00381 if (rch == 0) return false;
00382 if (this->GetCandBase() == rch->GetCandBase()) return true;
00383
00384 return false;
00385 }
|
|
|
Definition at line 388 of file CandHandle.cxx. References GetCandBase(), IsEqual(), CandBase::IsEquivalent(), and MSG. Referenced by AlgEventSSList::AddStripToEvent(), AlgEventSRList::AddStripToEvent(), NtpSRModule::FillNtpStrip(), NtpSRModule::FillNtpSubShowerSummary(), NtpMRModule::FillNtpSummary(), MergeEvent::Reco(), and AlgRmMu::RunAlg(). 00389 {
00390
00391 // IsEquivalent does deep comparison for templated Test... methods
00392
00393 // Check for equivalent CandBases.
00394 const CandHandle *rch = dynamic_cast<const CandHandle*>(rhs);
00395 if (rch == NULL) {
00396 MSG("VCand", Msg::kDebug)
00397 << "CandHandle::IsEquivalent(): Comparison object not CandHandle."
00398 << " rhs->ClassName() = " << rhs->ClassName() << endl;
00399 return false;
00400 }
00401 if (this->IsEqual(rhs)) return true; // Same address or CandBase
00402 if (this->GetCandBase()->IsEquivalent(rch->GetCandBase())) {
00403 return true;
00404 }
00405
00406 return false;
00407 }
|
|
|
Definition at line 410 of file CandHandle.cxx. References GetLocalHandle(). Referenced by DropMotherLink(), GetMother(), and SetMotherLink(). 00411 {
00412 return (this == GetLocalHandle());
00413 }
|
|
|
Definition at line 80 of file CandHandle.h. Referenced by GetOwnedCandBase(), and operator=(). 00080 {return fLocked;}
|
|
|
Definition at line 81 of file CandHandle.h. Referenced by AlgFitTrackCam::CleanNDLists(), AlgFitTrackCamList::CleanNDSlices(), GetOwnedCandBase(), and AlgFitTrackCam::SpectrometerSwim(). 00081 {return fsSlushyEnabled;}
|
|
|
Definition at line 115 of file CandHandle.cxx. 00116 {
00117
00118 // CandHandle object != operator compares Candidate addresses.
00119 // Pointer != just compares CandHandle addresses
00120 return !(*this == ch);
00121 }
|
|
|
Reimplemented in CH< CandType >. Definition at line 79 of file CandHandle.cxx. References fCandRefer, GetCandRefer(), GetName(), IsLocked(), and MSG. 00080 {
00081 if (IsLocked()) {
00082 MSG("Cand", Msg::kWarning) << endl
00083 << "Attempt to reset Candidate reference in a locked CandHandle:"
00084 << endl << "Class = " << ClassName() << " Name = " << GetName()
00085 << endl << "This CandHandle is owned by the I/O system."
00086 << endl << "Please create your own CandHandle first."
00087 << endl << "Then reset the Candidate reference in the new one."
00088 << endl << "This attempt ignored."
00089 << endl << endl;
00090 return *this;
00091 }
00092
00093 if (this != &ch) {
00094
00095 // Assign CandRefer
00096 if (fCandRefer != ch.GetCandRefer()) fCandRefer=ch.GetCandRefer();
00097
00098 //gmi The following statement from original Babar code looks like a bug.
00099 //gmi Why should the mother link get zeroed if the CandBase is changed?
00100 //gmi fMother = (CandHandle *) 0; // Mother link not copied
00101 }
00102 return *this;
00103 }
|
|
|
Definition at line 106 of file CandHandle.cxx. References GetCandBase(). 00107 {
00108
00109 // CandHandle object == operator compares Candidate addresses.
00110 // Pointer == just compares CandHandle addresses.
00111 return (GetCandBase() == ch.GetCandBase());
00112 }
|
|
|
Definition at line 519 of file CandHandle.cxx. References FormatToOStream(), and option. Referenced by MCAnalysis::Ana(), AlgSubShowerSRList::BestHough(), CandEvent::FormatToOStream(), AlgSubShowerSRList::FormHalo(), EVD::PrintCanvas(), AlgShowerSSList::RunAlg(), and AlgSubShowerSR::SubShowerID(). 00520 {
00521 FormatToOStream(cout,option);
00522 }
|
|
|
|
Definition at line 427 of file CandHandle.cxx. References GetCandBase(), GetCandRecord(), GetOwnedCandBase(), and CandBase::SetCandRecord(). Referenced by CandBase::AddDaughterLink(), AlgEventSSList::BuildEventFromUnassoc(), AlgEventSRList::BuildEventFromUnassoc(), AlgFitTrackCam::GenerateNDSpectStrips(), AlgFitTrackMS::InitFitHandle(), SliceFromChopModule::Reco(), AlgFilterDigitListSR::RunAlg(), AlgFilterDigitList::RunAlg(), AlgFilterChannels::RunAlg(), AlgDeMuxDigitList::RunAlg(), CandRecord::SecureCandHandle(), CandBase::SetCandRecord(), and AlgTrackSRList::SpectrometerTracking(). 00428 {
00429 if (cr) { // Don't reset a CandRecord to zero
00430 if (cr != GetCandRecord()) { // Change of value
00431 if (GetCandRecord()) GetOwnedCandBase()->SetCandRecord(cr);//Reset
00432 else GetCandBase()->SetCandRecord(cr); // Init non-zero for free
00433 }
00434 }
00435 }
|
|
|
Definition at line 458 of file CandHandle.cxx. References fLocked. Referenced by CandRecord::SecureCandHandle(). 00459 {
00460 fLocked = kTRUE;
00461 }
|
|
|
Definition at line 464 of file CandHandle.cxx. References CandBase::fDaughters, fMother, GetCandBase(), and IsLocal(). Referenced by CandBase::AddDaughterLink(). 00465 {
00466 assert(ch != 0); // Can't set null mother link
00467 assert(fMother == 0); // Can't already have a mother
00468 assert(!IsLocal()); // Can't set mother for LocalHandle
00469 fMother = ch; // Set the mother link
00470 fMother->GetCandBase()->fDaughters.Add(this); // Add to ma's dghters
00471 }
|
|
|
|
Definition at line 438 of file CandHandle.cxx. References fsSlushyEnabled, and MSG. Referenced by AlgFitTrackCam::CleanNDLists(), AlgFitTrackCamList::CleanNDSlices(), and AlgFitTrackCam::SpectrometerSwim(). 00439 {
00440 if (tf == CandHandle::fsSlushyEnabled) {
00441 MSG("Cand", Msg::kSynopsis)
00442 << "CandHandle::fsSlushyEnabled unchanged from "
00443 << CandHandle::fsSlushyEnabled << endl
00444 << "by call to CandHandle::SetSlushyEnabled(" << tf << ")."
00445 << endl;
00446 }
00447 else {
00448 MSG("Cand", Msg::kSynopsis)
00449 << "CandHandle::fsSlushyEnabled changed from "
00450 << CandHandle::fsSlushyEnabled << " to " << tf
00451 << endl << "by call to CandHandle::SetSlushyEnabled(Bool_t)."
00452 << endl;
00453 CandHandle::fsSlushyEnabled = tf;
00454 }
00455 }
|
|
|
|
Definition at line 88 of file CandHandle.h. References fViewableNotifier. 00089 {fViewableNotifier = vn;}
|
|
|
|
Definition at line 38 of file CandHandle.h. |
|
|
Definition at line 102 of file CandHandle.h. Referenced by GetCandBase(), GetOwnedCandBase(), and operator=(). |
|
|
Definition at line 104 of file CandHandle.h. Referenced by SetLock(). |
|
|
Definition at line 103 of file CandHandle.h. Referenced by DropMotherLink(), GetMother(), and SetMotherLink(). |
|
|
Definition at line 31 of file CandHandle.cxx. Referenced by CandHandle(), and ~CandHandle(). |
|
|
Definition at line 32 of file CandHandle.cxx. Referenced by SetSlushyEnabled(). |
|
|
Definition at line 107 of file CandHandle.h. Referenced by SetViewableNotifier(). |
1.3.9.1