CandRecord Class Reference

#include <CandRecord.h>

Inheritance diagram for CandRecord:
RecMinos

List of all members.

Public Member Functions

 CandRecord ()
 CandRecord (CandHeader *head)
virtual ~CandRecord ()
CandHandleFindCandHandle (const char *classname=0, const char *objname=0) const
TIter GetCandHandleIter (Bool_t dir=kIterForward)
const CandHeaderGetCandHeader () const
const TObjArray & GetCandHandleList () const
Bool_t RemoveCandHandle (CandHandle *ch)
void SecureCandHandle (CandHandle &ch)
void SwitchCandHandlePersToTemp (CandHandle *ch)
virtual void Print (Option_t *option="ntid99") const

Detailed Description

Definition at line 21 of file CandRecord.h.


Constructor & Destructor Documentation

CandRecord::CandRecord (  ) 

Definition at line 19 of file CandRecord.cxx.

00020 {
00021 }

CandRecord::CandRecord ( CandHeader head  ) 

Definition at line 24 of file CandRecord.cxx.

00024                                        :
00025   RecMinos(head)
00026 {
00027 
00028 // adopt the CandHeader for ownership
00029 }

CandRecord::~CandRecord (  )  [virtual]

Definition at line 32 of file CandRecord.cxx.

00033 {
00034 }


Member Function Documentation

CandHandle * CandRecord::FindCandHandle ( const char *  classname = 0,
const char *  objname = 0 
) const

Definition at line 37 of file CandRecord.cxx.

References RecMinos::FindComponent(), and RecMinos::FindTemporary().

Referenced by MCAnalysis::Ana(), FCPCFilterModule::Ana(), DmxDeMuxModule::Ana(), ShieldPlankListModule::Ana(), FarDetSliceListModule::Ana(), RemoveMuon::Ana(), FilterLIModule::Ana(), ChopModule::Ana(), FarDetDeadChipModule::Ana(), FarDetDataQualityModule::Ana(), AtNuDisplayModule::Ana(), ToyMCModule::Ana(), PreFilter::Ana(), FitTrackMSListModule::Ana(), DataQualityReader::Ana(), PlotMuonClusterModule::Ana(), FarDetShieldPlankListModule::Ana(), FarDetStripListModule::Ana(), DmxDeMuxCosmicsModule::Ana(), FiltCosmicModule::Ana(), CandDigitModule::Ana(), CDTrackerModule::Ana(), CheezyDisplayModule::Ana(), AlgFitTrackCamList::CheckWeights(), AlgFitTrackCam::CleanNDLists(), AlgFitTrackCamList::CleanNDSlices(), FitTrackCamAnalysisModule::EfficiencySection(), TruthHelper::EventCompletenessImp(), CDTruthifier::ExtractAllCandStripHandles(), NtpSRModule::FillNtpDataQuality(), NtpSRModule::FillNtpEventSummary(), NtpFitSAModule::FillNtpFitSA(), NtpCluster3DModule::FillNtpStrip(), NtpEMModule::FillNtpStrip(), NtpSRModule::FillNtpStrip(), NtpEMModule::FillNtpSummary(), NtpSRModule::FillNtpTrack(), UberModule::FillNtpTrack(), UberModuleLite::FillNtpTrack(), NtpSRModule::FillNtpWindow(), FitTrackCamAnalysisModule::FittedTrackSection(), UberDST::Get(), UberModule::Get(), Cutter::Get(), UberModuleLite::Get(), DataUtil::GetCandidate(), NtpSRBleachFiller::GetFixedWindowPH(), EVD::GetNumEvents(), EVD::GetNumSlices(), NtpSRBleachFiller::initStraightPHFraction(), EVD::ReadCandEvent(), EVD::ReadCandSlice(), DmxDeMuxCosmicsModule::Reco(), ClusterSRListModule::Reco(), AtNuFindModule::Reco(), TrackCamListModule::Reco(), FitShowerEMListModule::Reco(), ShowerSRListModule::Reco(), DeMuxDigitListModule::Reco(), FitTrackSRListModule::Reco(), FilterDigitListModule::Reco(), FarDetShieldPlankListModule::Reco(), RemoveMuon::Reco(), PurgeCandidateModule::Reco(), FarDetEventModule::Reco(), BiggestChopModule::Reco(), FitTrackMSListModule::Reco(), FitTrackCamListModule::Reco(), Cluster3DModule::Reco(), SliceFromChopModule::Reco(), FitTrackSAListModule::Reco(), FarDetStripListModule::Reco(), FarDetDataQualityModule::Reco(), StripSRListModule::Reco(), DmxDeMuxFilterModule::Reco(), ChopModule::Reco(), AltDeMuxModule::Reco(), TrackSRListModule::Reco(), AtmosShowerListModule::Reco(), ShowerEMListModule::Reco(), ShieldPlankListModule::Reco(), AtNuFitModule::Reco(), MergeEvent::Reco(), SubShowerSRListModule::Reco(), SliceSRListModule::Reco(), EventSRListModule::Reco(), FarDetSliceListModule::Reco(), DataQualityReader::Reco(), AlgMuonRemoval::RunAlg(), AlgCosmicMuonRemoval::RunAlg(), TruthHelper::ShowerCompletenessImp(), FitTrackCamAnalysisModule::ShowerSection(), TruthHelper::SliceCompleteness(), TruthHelper::SliceCompleteness_MaxTimeGap(), TruthHelper::SliceCompleteness_xtalk(), FitTrackCamAnalysisModule::SliceSection(), TruthHelper::SliceTrueStrip(), TruthHelper::SliceTrueStripxtalk(), AlgTrackSRList::SpectrometerTracking(), FitTrackCamAnalysisModule::TrackSection(), FitTrackCamAnalysisModule::TruthSection(), TruthHelper::TruthSliceNum(), FitTrackCamAnalysisModule::TruthSliceSection(), and EVD::UpdateSummary().

00039 {
00040 
00041 // Returns the *last* selected CandHandle.  If classname is a null ptr
00042 // or blank string, no class selection is done.  If classname is
00043 // provided, the qualifying object must InheritFrom() or be a classname.
00044 // The objname is optional, but, if filled, will further qualify the
00045 // selection by requiring agreement with the GetName() method of the
00046 // selected object.
00047 
00048 // RecMinos::FindComponent() returns a "const TObject *".  This gets
00049 // converted to a "CandHandle *" using dynamic_cast to make sure the
00050 // original is a "CandHandle *".  The "const" is removed by const_cast
00051 // because CandHandles are "ref-counted" pointers to "copy-on-write"
00052 // CandBase objects.  CandHandles allow controlled modification of
00053 // their CandBase objects and have their own const-like protection.
00054 // Look in persistent TObjArray first, then in temporary TObjArray.
00055 // Both searches are in reverse order of insertion.
00056 
00057   CandHandle *ch = 0;
00058 
00059 // Look in persistent TObjArray
00060   ch =  dynamic_cast<CandHandle *>
00061    (const_cast<TObject *>(RecMinos::FindComponent(classname, objname)));
00062 
00063 // Look in temporary TObjArray if not in persistent TObjArray
00064   if (ch == 0) ch =  dynamic_cast<CandHandle *>
00065    (const_cast<TObject *>(RecMinos::FindTemporary(classname, objname)));
00066 
00067   return ch;
00068 }

TIter CandRecord::GetCandHandleIter ( Bool_t  dir = kIterForward  ) 

Definition at line 71 of file CandRecord.cxx.

References RecMinos::GetComponents().

Referenced by AtNuTreeModule::Ana(), RecoTreeModule::Ana(), StripCands::Ana(), NtpMaker::FillCandInfo(), and StripCands::Reco().

00072 {
00073   return TIter(&RecMinos::GetComponents(),dir);
00074 }

const TObjArray& CandRecord::GetCandHandleList (  )  const [inline]

Definition at line 33 of file CandRecord.h.

References RecMinos::GetComponents().

Referenced by DataUtil::dump_mom(), and Mint::DumpMom().

00034                                      {return RecMinos::GetComponents();}

const CandHeader * CandRecord::GetCandHeader (  )  const
void CandRecord::Print ( Option_t *  option = "ntid99"  )  const [virtual]

Reimplemented from RecMinos.

Definition at line 125 of file CandRecord.cxx.

References RecMinos::fComponents, RecMinos::fHeader, RecMinos::fTemporaries, RecMinos::GetJobHistory(), RecMinosHdr::Print(), and RecJobHistory::Print().

Referenced by DemoEventDump::DumpCandRecords().

00126 {
00127    // Print header, loop over raw blocks, print those
00128    // unless passed "l" option, then just list the blocks.
00129 
00130    if (fHeader) fHeader->Print();
00131    else std::cout << "CandRecord: has no header" << std::endl;
00132    GetJobHistory().Print();
00133    
00134    std::string opt = option;
00135    bool doList = ( opt.find("l") != std::string::npos );
00136    bool doTemp = ( opt.find("T") != std::string::npos ) && fTemporaries.GetSize() != 0;
00137 
00138    const TObject *tobj = 0;
00139 
00140    if (doTemp)
00141      std::cout << "   --------- Components ---------" << std::endl;
00142    TIter iterComp(&fComponents);
00143    while ((tobj = iterComp())) {
00144      if (doList) tobj->Print("ntd0v0");
00145      else        tobj->Print(option);
00146    }
00147 
00148    if (doTemp) {
00149      std::cout << "   --------- Temporaries ---------" << std::endl;
00150      TIter iterTemp(&fTemporaries);
00151      while ((tobj = iterTemp())) {
00152        if (doList) tobj->Print("ntd0v0");
00153        else        tobj->Print(option);
00154      }
00155    }
00156 
00157 }

Bool_t CandRecord::RemoveCandHandle ( CandHandle ch  ) 

Definition at line 84 of file CandRecord.cxx.

References RecMinos::RemoveComponent(), and RecMinos::RemoveTemporary().

Referenced by PurgeCandidateModule::Reco(), and StripCands::Reco().

00085 {
00086 
00087 // Remove CandHandle from fComponents or fTemporaries and delete it.
00088 // Return true if successfully removed, false otherwise.
00089   CandHandle *chremove = 0;
00090   if ((chremove =
00091            dynamic_cast<CandHandle *>(RecMinos::RemoveComponent(ch)))) {
00092     delete chremove;
00093     return true;
00094   }
00095   else if ((chremove =
00096            dynamic_cast<CandHandle *>(RecMinos::RemoveTemporary(ch)))) {
00097     delete chremove;
00098     return true;
00099   }
00100   return false;
00101 }

void CandRecord::SecureCandHandle ( CandHandle ch  ) 

Definition at line 104 of file CandRecord.cxx.

References RecMinos::AdoptComponent(), CandHandle::DupHandle(), CandHandle::SetCandRecord(), and CandHandle::SetLock().

Referenced by AtNuFindModule::Reco(), ClusterSRListModule::Reco(), DigitListModule::Reco(), FitShowerEMListModule::Reco(), TrackCamListModule::Reco(), DeMuxDigitListModule::Reco(), ShowerSRListModule::Reco(), FarDetShieldPlankListModule::Reco(), FilterDigitListModule::Reco(), FitTrackSRListModule::Reco(), CalDetSIModule::Reco(), BiggestChopModule::Reco(), FarDetEventModule::Reco(), RemoveMuon::Reco(), Cluster3DModule::Reco(), FitTrackCamListModule::Reco(), FitTrackMSListModule::Reco(), FarDetDataQualityModule::Reco(), FarDetStripListModule::Reco(), FitTrackSAListModule::Reco(), SliceFromChopModule::Reco(), ChopModule::Reco(), StripSRListModule::Reco(), AtmosShowerListModule::Reco(), TrackSRListModule::Reco(), RealCalDetPIDModule::Reco(), AtNuFitModule::Reco(), ShieldPlankListModule::Reco(), ShowerEMListModule::Reco(), MergeEvent::Reco(), EventSRListModule::Reco(), SliceSRListModule::Reco(), SubShowerSRListModule::Reco(), DataQualityReader::Reco(), FarDetSliceListModule::Reco(), AlgAtNuRecoMCTruth::RunAlg(), AlgTrackSRList::RunAlg(), and AlgAtNuReco::RunAlg().

00105 {
00106 
00107 // Secure a CandHandle derived object.  It saves a cloned CandHandle.
00108   ch.SetCandRecord(this);
00109   CandHandle *chnew = ch.DupHandle();   // Create a new owned CandHandle
00110   chnew->SetLock();    // Cand mods can't be made through new CandHandle
00111   RecMinos::AdoptComponent(chnew);
00112 }

void CandRecord::SwitchCandHandlePersToTemp ( CandHandle ch  ) 

Definition at line 115 of file CandRecord.cxx.

References RecMinos::AdoptTemporary(), and RecMinos::RemoveComponent().

Referenced by DeMuxDigitListModule::Reco(), FilterDigitListModule::Reco(), and BiggestChopModule::Reco().

00116 {
00117 
00118 // Switch a CandHandle from "fComponents" to "fTemporaries"
00119   CandHandle *chswitch = dynamic_cast<CandHandle *>
00120                                         (RecMinos::RemoveComponent(ch));
00121   if (chswitch) RecMinos::AdoptTemporary(chswitch);
00122 }


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1