RecRecordImp< T > Class Template Reference

#include <RecRecordImp.h>

Inheritance diagram for RecRecordImp< T >:
RecRecord RecDataRecord< T >

List of all members.

Public Member Functions

 RecRecordImp ()
 RecRecordImp (const T &header)
virtual ~RecRecordImp ()
virtual const T & GetHeader () const
virtual RegistryGetTempTags ()
virtual const RegistryGetTempTags () const
virtual const VldContextGetVldContext () const
virtual bool IsPersistedToOutputStream (const char *stream="", const char *file="", const char *tree="", int index=-1) const
virtual bool IsClearable () const
virtual bool IsPerOwned () const
virtual bool IsTransient () const
virtual const RecJobHistoryGetJobHistory () const
virtual std::ostream & Print (std::ostream &os) const
virtual void Print (Option_t *option="") const
virtual void HasBeenModified ()
virtual void PersistedToOutputStream (const char *stream, const char *file, const char *tree, int index)
virtual void SetClearable (bool isClearable=true)
virtual void SetTransient (bool isTransient=true)
virtual void SetPerOwned (bool isPerOwned=false)

Private Attributes

fHeader
Bool_t fIsClearable
RecJobHistory fJobHistory
Registry fTempTags

Detailed Description

template<class T>
class RecRecordImp< T >

Definition at line 19 of file RecRecordImp.h.


Constructor & Destructor Documentation

template<class T>
RecRecordImp< T >::RecRecordImp (  )  [inline]

Definition at line 23 of file RecRecordImp.h.

00023 : fHeader(),fIsClearable(false),fTempTags() {}      

template<class T>
RecRecordImp< T >::RecRecordImp ( const T &  header  )  [inline]

Definition at line 25 of file RecRecordImp.h.

00025                                 : fHeader(header),fIsClearable(false),
00026                                   fTempTags() {} // normal constructor

template<class T>
virtual RecRecordImp< T >::~RecRecordImp (  )  [inline, virtual]

Definition at line 27 of file RecRecordImp.h.

00027 {}


Member Function Documentation

template<class T>
virtual const T& RecRecordImp< T >::GetHeader (  )  const [inline, virtual]

Implements RecRecord.

Definition at line 30 of file RecRecordImp.h.

Referenced by NueExtrapolationJB::AddChain(), NueData::AddEvent(), NtpTimingFit::AddEvent(), ScintCalModule::Ana(), TruthCompareAna::ana(), CalDet2003PlotsModule::Ana(), NueHandScan::Ana(), MNtpModule::Ana(), NueDisplayModule::Ana(), NuDemoModule::Ana(), NueSensitivity::Ana(), ParticleBeamMonAna::ana(), ParticleDisplay::Ana(), MSTTemplate::Ana(), ClockCalibrationModule::Ana(), CompareMD::Ana(), MakeAlignmentModule::Ana(), NuePrint::Ana(), TrackDirectionModule::Ana(), CompareMST::Ana(), DummyModule::Ana(), MCTrueAna::ana(), CompareAll::Ana(), NueReadwPID::Ana(), NueModule::Analyze(), ANtpAnalysisInfoAna::Analyze(), BeamMonAna::Analyze(), ANtpShowerInfoAna::Analyze(), VtxRecordAna::Analyze(), MuonRemovalInfoAna::Analyze(), ShwfitAna::Analyze(), CalDetInfoAna::Analyze(), ShieldRejVarAna::Analyze(), AnalysisInfoAna::Analyze(), AngClusterFitAna::Analyze(), ANtpInfoObjectFillerNue::Analyze(), NueRecordAna::Analyze(), ANtpEventInfoAna::Analyze(), ANtpTruthInfoBeamAna::Analyze(), HitCalcAna::Analyze(), TreePIDAna::Analyze(), ANtpTrackInfoAna::Analyze(), VtxFinderAna::Analyze(), TimingVarsAna::Analyze(), EventQualAna::Analyze(), AngClusterAna::Analyze(), SetKNNModule::AnalyzeRecord(), ANtpRecoNtpManipulator::ANtpRecoNtpManipulator(), MeuAnalysis::BasicReco(), NueDisplayModule::BuildDisplay(), ParticleDisplay::BuildDisplay(), MadChain::BuildLookup(), NuAnalysis::ChargeSeparationOneSnarl(), NuAnalysis::ChargeSignCut(), ParticleFinder::CheckContainment(), HitCalcAna::ComputeHits(), NuAnalysis::DemoInfidSRInterface(), NtpEventViewer::Display(), NueSystematic::DoCalibShift(), NtpStEventGrabber::DoGather(), NueSystematic::DoNormCalc(), NueSystematic::DoOscCalc(), NueSystematic::DoShwDevCalc(), NueSystematic::DoSKZPCalc(), ShwfitAna::doSlopes(), XTalkFilter::DoTrueFilter(), HitView::DrawBasicInfo(), ChainView::DrawBasicInfo(), FitView::DrawEvent(), HitView::DrawEvent(), HoughView::DrawEvent(), ChainView::DrawEvent(), NuAnalysis::Efficiencies(), NuAnalysis::EnergySpect(), NuAnalysis::EnergySpectMC(), NuAnalysis::ExtractConfig(), NuExtraction::ExtractGeneralInfo(), Anp::FillBasic::Fill(), NtpTimingNtuple::Fill(), ANtpInfoObjectFillerBeam::FillBeamInformation(), ANtpInfoObjectFillerMRCC::FillEventInformationHelper(), CompareMD::FillFromList(), ANtpShowerInfoAna::FillGapInformation(), MeuHistos::FillGeneralHistos(), NuPlots::FillGeneralHistos(), ExtrapHistsGen::FillHistograms(), MSTCalcAna::FillHitSets(), NueMiniAnaPID::FillMini(), NueMiniAna::FillMini(), ParticleAna::FillPot(), ParticleFinder::FillPot(), NtpTools::FillRecoEInfo(), NueMiniAnaPID::FillRecord(), NueData::FillRecord(), NueMiniAna::FillRecord(), ANtpEventInfoAna::FillStripVariables(), MeuCuts::FillSTSumDetails(), NueRecordAna::FillTrue(), VtxRecordAna::FillTrue(), NtpEventViewer::Find(), NtpVtxFinder::FindVertex(), Anp::FillBasic::Get(), MadChain::Get(), MeuCuts::GetBDSelectSpillInfo(), DataUtil::GetDetector(), NtpTools::GetDetector(), NuReco::GetEdgeRegion(), MadBase::GetEntry(), NueDisplayModule::GetEvent(), NueStandard::GetIntensityBeamWeight(), NueStandard::GetMCWeights(), SntpHelpers::GetMRTruth(), NueUtilities::AnaNueProcessor::GetNDDataWeightedPOT(), NueStandard::GetNDDataWeights(), NueStandard::GetPredWeights(), NueStandard::GetPredWeights_DO_NOT_USE(), NuReco::GetRegion(), NueStandard::GetRPWBeamWeight(), DataUtil::GetRunSnarlEvent(), NuReco::GetShowerEnergyNearTrack(), NueStandard::GetSKZPBeamWeight(), GetVldContext(), infid(), NueUtilities::AnaNueProcessor::isData(), NueUtilities::AnaNueProcessor::isFar(), DataUtil::IsGoodData(), MeuCuts::IsGoodDataQuality(), NueStandard::IsGoodFarRun(), NueStandard::IsGoodNearRun(), NueStandard::IsGoodRun(), NuBeam::IsGoodSpillAndFillPot(), NueStandard::IsInFid(), NueStandard::IsLargestEvent(), LISieve::IsLI(), LISieve::IsLIforNC(), ParticlePIDSaver::isMatched(), NueUtilities::AnaNueProcessor::isMC(), NueUtilities::AnaNueProcessor::isNear(), NueStandard::IsRun1(), NueStandard::IsRun10(), NueStandard::IsRun11(), NueStandard::IsRun12(), NueStandard::IsRun13(), NueStandard::IsRun2(), NueStandard::IsRun3NotPrime(), NueStandard::IsRun3Prime(), NueStandard::IsRun4(), NueStandard::IsRun4RHC(), NueStandard::IsRun5(), NueStandard::IsRun6(), NueStandard::IsRun7RHC(), NueStandard::IsRun8(), NueStandard::IsRun9RHC(), NueStandard::IsSpecialRun(), NuAnalysis::LIRejectionTest(), NtpTrackAD::LoadEvent(), NuAnalysis::MakeFullDST(), ValVtxModule::MakeIdString(), CompareAll::MakeIdString(), CompareMD::MakeIdString(), NtpEventDisplayTiming::MakePicture(), MadAbID::MakePidVariables(), MadAbID::MakeRecoVariables(), MeuAnalysis::MakeSummaryTreeWithNtpStOneSnarl(), NNTrain::MakeTrainTree(), Finder::MergeChains(), MeuAnalysis::MeuAnalysis(), MinosCompactEvent::MinosCompactEvent(), NueConvention::MINOSPLUSNueEnergyCorrection(), NuAnalysis::N_1(), CompareAll::NeedsSpecialAttention(), MdaDiscrimAna::NeedsSpecialAttention(), NtpVtxFinder::NtpVtxFinder(), NuBase::NuBase(), NueConvention::NueEnergyCorrection(), NueConvention::NueEnergyCorrectionNeverUseThisFunction(), NuAnalysis::NuMuBarAppearance(), NueExtrapHelper::PassBasicCuts(), NtpTools::PassBeamCuts(), CompareAll::PassesBeamCuts(), TrimModule::PassesBeamCuts(), CompareMD::PassesBeamCuts(), NueStandard::PassesCosmicCut(), CompareAll::PassesCuts(), CompareMD::PassesCuts(), NueStandard::PassesDataQuality(), NueStandard::PassesFarDataTiming(), NueAnalysisCuts::PassesFileCut(), MCNNRunner::PassesMCNNPrecuts(), NueStandard::PassesMRCCFiducial(), NueStandard::PassesParticlePIDPreselectionCut(), NueStandard::PassesPOTStandards(), NueStandard::PassesSelection(), Finder::Process(), MCNNMergeModule::Reco(), NueModule::Reco(), FixModule::Reco(), NtpStTrimmer::Reco(), ParticleFinder::Reco(), SpillTypeFilter::Reco(), ParticlePIDSaver::Reco(), VtxModule::Reco(), NueReweight::Reco(), ParticleAna::Reco(), FillPIDFromText::Reco(), SetKNNModule::Reco(), TrimModule::Reco(), FilterPID::Reco(), NueBeamMonModule::Reco(), NueConvention::RHCNueEnergyCorrection(), DetailedParticle::Run(), ParticleCheck::Run(), MiniMaker::RunMiniMaker(), MiniMakerPID::RunMiniMakerPID(), SRMom::RunNumber(), Trimmer::RunTrimmer(), NuMadAnalysis::SetEntry(), NueAnalysisCuts::SetInfoObject(), BMSpillAna::SetSpill(), NtpVtxFinder::SetTargetEvent(), AttenCorr::Setup(), VHS::Skim(), MeuAnalysis::SnarlList(), SRMom::SnarlNumber(), MeuAnalysis::SpillPlots(), ScintCalEvent::Trigger(), PETrimmer::TrimRecord(), NueDisplayModule::UpdateDisplay(), ParticleDisplay::UpdateDisplay(), AngClusterAna::WeightedEnergy(), and MCNNRunner::WriteResults().

00030 { return fHeader; }

template<class T>
virtual const RecJobHistory& RecRecordImp< T >::GetJobHistory (  )  const [inline, virtual]
template<class T>
virtual const Registry& RecRecordImp< T >::GetTempTags (  )  const [inline, virtual]

Implements RecRecord.

Definition at line 32 of file RecRecordImp.h.

00032 { return fTempTags; }

template<class T>
virtual Registry& RecRecordImp< T >::GetTempTags (  )  [inline, virtual]
template<class T>
virtual const VldContext* RecRecordImp< T >::GetVldContext (  )  const [virtual]
template<class T >
void RecRecordImp< T >::HasBeenModified (  )  [inline, virtual]

Implements RecRecord.

Definition at line 43 of file RecRecordImp.cxx.

References RecRecordImp< T >::fTempTags, and Registry::RemoveKey().

Referenced by AlgFactory::GetOwnedConfigRecord().

00043                                       {
00044   //
00045   //  Purpose:  Handle generic record tasks appropriate for when record
00046   //            has been newly modified.
00047   //
00048   //  Arguments: none.
00049   //
00050   //  Return:  none.
00051   //
00052   //  Contact:   S. Kasahara
00053   // 
00054   //  Notes:  The default behavior provided by this method is to clear
00055   //          the Registry value associated with the key "outstream" in
00056   //          the Registry fTempTags data member.  This indicates to
00057   //          any output module(s) in the user's job path(s) that the modified
00058   //          record should be re-persisted.
00059   // 
00060 
00061   fTempTags.RemoveKey("outstream");
00062   return;
00063 
00064 }

template<class T>
virtual bool RecRecordImp< T >::IsClearable (  )  const [inline, virtual]

Implements RecRecord.

Definition at line 36 of file RecRecordImp.h.

00036 { return fIsClearable; }

template<class T >
bool RecRecordImp< T >::IsPerOwned (  )  const [inline, virtual]

Implements RecRecord.

Definition at line 193 of file RecRecordImp.cxx.

References RecRecordImp< T >::fTempTags, and Registry::Get().

00193                                        {
00194   //
00195   //  Purpose:  If IsPerOwned (def=false), record is owned by Persistency
00196   //            Mom should only Remove the record from its array of
00197   //            fragments, but not delete it.
00198   //
00199   //  Arguments: none.
00200   //
00201   //  Return:  true or false. 
00202   //
00203   //  Contact:   S. Kasahara
00204   // 
00205 
00206   int isPerOwned = 0;
00207   if ( !fTempTags.Get("isPerOwned",isPerOwned) ) return false;
00208   return ( isPerOwned ) ? true : false;
00209 
00210 }

template<class T >
bool RecRecordImp< T >::IsPersistedToOutputStream ( const char *  stream = "",
const char *  file = "",
const char *  tree = "",
int  index = -1 
) const [inline, virtual]

Implements RecRecord.

Definition at line 130 of file RecRecordImp.cxx.

References RecRecordImp< T >::fTempTags, Registry::Get(), and s().

Referenced by RecValidate::TestRecordTempTags().

00131                                                                              {
00132   //
00133   //  Purpose:  Check to see if record has been persisted to the output
00134   //            stream/file/tree/tree index of interest. 
00135   //
00136   //  Arguments: stream/tree/file/tree index of interest.  If a value is
00137   //             left at default ("" for stream/tree/file, or -1 for index),
00138   //             that argument will not be checked. 
00139   //
00140   //  Return:  true or false. Result will be true if all non-default arguments 
00141   //           match those of one of the output streams to which this record
00142   //           has been persisted.
00143   //
00144   //  Contact:   S. Kasahara
00145   // 
00146 
00147   std::string s(stream);
00148   std::string f(file);
00149   std::string t(tree);
00150 
00151   Registry outStreamRegistry;
00152   int nout = 0;
00153   if ( fTempTags.Get("outstream",outStreamRegistry) ) {
00154     outStreamRegistry.Get("nout",nout);
00155     for ( int iout = 0; iout < nout; iout++) {
00156       char cioutkey[20];
00157       sprintf(cioutkey,"%i",iout);
00158       Registry outStream;
00159       outStreamRegistry.Get(cioutkey,outStream);
00160       bool isMatch = true;
00161       if ( !s.empty() ) {
00162         const char* cstream = 0;
00163         outStream.Get("stream",cstream);
00164         if ( std::string(cstream) != s ) isMatch = false;
00165       }        
00166       if ( !f.empty() ) {
00167         const char* cfile = 0;
00168         outStream.Get("file",cfile);
00169         if ( std::string(cfile) != f ) isMatch = false;
00170       }
00171 
00172       if ( !t.empty() ) {
00173         const char* ctree = 0;
00174         outStream.Get("tree",ctree);
00175         if ( std::string(ctree) != t ) isMatch = false;
00176       }
00177       if ( index > -1 ) {
00178         int storedindex = -1;
00179         outStream.Get("index",storedindex);
00180         if ( storedindex != index ) isMatch = false;
00181       }
00182       if ( isMatch ) {
00183         return true;  // found match in registry
00184       }
00185     } 
00186   }
00187 
00188   return false; // failed to find match in registry
00189 
00190 }

template<class T >
bool RecRecordImp< T >::IsTransient (  )  const [inline, virtual]

Implements RecRecord.

Definition at line 213 of file RecRecordImp.cxx.

References RecRecordImp< T >::fTempTags, and Registry::Get().

Referenced by RecValidate::TestRecordTempTags().

00213                                         {
00214   //
00215   //  Purpose:  If IsTransient (def=true), record will exist in memory for one
00216   //            job cycle only. 
00217   //
00218   //  Arguments: none.
00219   //
00220   //  Return:  true or false. 
00221   //
00222   //  Contact:   S. Kasahara
00223   // 
00224 
00225   int isTransient = 1;
00226   if ( !fTempTags.Get("isTransient",isTransient) ) return true;
00227   return ( isTransient ) ? true : false;
00228 
00229 }

template<class T >
void RecRecordImp< T >::PersistedToOutputStream ( const char *  stream,
const char *  file,
const char *  tree,
int  index 
) [inline, virtual]

Implements RecRecord.

Definition at line 67 of file RecRecordImp.cxx.

References RecRecordImp< T >::fTempTags, Registry::Get(), Registry::LockValues(), Registry::Set(), and Registry::UnLockValues().

00068                                                                      {
00069   //
00070   //  Purpose:  Mark the record as having been stored in the named stream,file,
00071   //            tree, tree index location.
00072   //
00073   //  Arguments: stream name, file name, tree name, tree index to which record 
00074   //             was stored.  
00075   //
00076   //  Return:  none.
00077   //
00078   //  Contact:   S. Kasahara
00079   // 
00080   //  Notes:  The output stream,file,tree,treeindex will be stored in
00081   //          Registry fTempTags in the following manner:
00082   //          key         type/value
00083   //          ===         ==========
00084   //          "outstream" Registry/see below:
00085   //                      key     type/value
00086   //                      ===     ==========
00087   //                      "nout"  int/# times this record has been persisted
00088   //                       "0"    Registry/see below:
00089   //                       "1"    Registry/   "
00090   //                       ...    Registry/   "
00091   //                     "nout-1" Registry/   "
00092   //                              key      type/value
00093   //                              ===      ==========
00094   //                              "stream" const char*/output stream name
00095   //                              "file"   const char*/output file name
00096   //                              "tree"   const char*/output tree name
00097   //                              "index"  int        /output tree index
00098   //          
00099 
00100   Registry outStreamRegistry;
00101   int nout = 0;
00102   if ( fTempTags.Get("outstream",outStreamRegistry) ) {
00103     outStreamRegistry.Get("nout",nout); 
00104   }
00105   outStreamRegistry.UnLockValues();
00106 
00107   // New output stream registry
00108   Registry newOutStream;
00109   newOutStream.Set("stream",stream);
00110   newOutStream.Set("file",file);
00111   newOutStream.Set("tree",tree);
00112   newOutStream.Set("index",index);
00113 
00114   // Insert new output stream registry at key nout of "outstream" registry
00115   char cnoutkey[20];
00116   sprintf(cnoutkey,"%i",nout);
00117   outStreamRegistry.Set(cnoutkey,newOutStream);
00118   nout++;
00119   outStreamRegistry.Set("nout",nout); 
00120   outStreamRegistry.LockValues();
00121   
00122   // Store revised "outstream" registry
00123   fTempTags.UnLockValues();
00124   fTempTags.Set("outstream",outStreamRegistry);
00125   fTempTags.LockValues();
00126 
00127 }

template<class T >
void RecRecordImp< T >::Print ( Option_t *  option = ""  )  const [inline, virtual]

Implements RecRecord.

Reimplemented in VHSevent, UberRecord, UberRecordLite, NtpEMRecord, NtpSRRecord, NtpMRRecord, NtpCandRecord, RecDataRecord< T >, NtpStRecord, RecDataRecord< RecHeader >, and RecDataRecord< SimSnarlHeader >.

Definition at line 293 of file RecRecordImp.cxx.

References RecRecordImp< T >::Print().

00293                                                          {
00294   //
00295   //  Purpose:  Print header in form supported by TObject::Print.
00296   //
00297   //  Arguments: option (not used)
00298   //
00299   //  Return:  none.
00300   //
00301   //  Contact:   S. Kasahara
00302   // 
00303 
00304   Print(std::cout);
00305 
00306   return;
00307 
00308 }

template<class T >
std::ostream & RecRecordImp< T >::Print ( std::ostream &  os  )  const [inline, virtual]

Implements RecRecord.

Reimplemented in NtpAlignmentRecord, VHSevent, UberRecord, UberRecordLite, NtpFitSARecord, NtpEMRecord, NtpSRRecord, NtpCluster3DRecord, NtpMCRecord, NtpMRRecord, NtpCandRecord, CandRecordSRNtuple, DemoNtupleRecord, RecDataRecord< T >, SimSnarlRecord, NtpStRecord, NtpTHRecord, RecDataRecord< RecHeader >, and RecDataRecord< SimSnarlHeader >.

Definition at line 274 of file RecRecordImp.cxx.

References RecRecordImp< T >::fHeader, RecRecordImp< T >::fJobHistory, and RecJobHistory::Print().

Referenced by RecRecordImp< T >::Print().

00274                                                        {
00275   //
00276   //  Purpose:  Print status of record on ostream.
00277   //
00278   //  Arguments: os ostream to display on.
00279   //
00280   //  Return:  ostream reference.
00281   //
00282   //  Contact:   S. Kasahara
00283   // 
00284 
00285   os << "RecRecordImp::Print:\n" <<  fHeader << std::endl;
00286   fJobHistory.Print();
00287   
00288   return os;
00289 
00290 }

template<class T>
virtual void RecRecordImp< T >::SetClearable ( bool  isClearable = true  )  [inline, virtual]

Definition at line 48 of file RecRecordImp.h.

00049                              { fIsClearable = isClearable; }

template<class T >
void RecRecordImp< T >::SetPerOwned ( bool  isPerOwned = false  )  [inline, virtual]

Implements RecRecord.

Definition at line 253 of file RecRecordImp.cxx.

References RecRecordImp< T >::fTempTags, Registry::LockValues(), Registry::Set(), and Registry::UnLockValues().

00253                                                  {
00254   //
00255   //  Purpose:  Set ownership status of record.  If set true(def), record is
00256   //            owned by Persistency and the user should not delete.
00257   //
00258   //  Arguments: true or false.
00259   //
00260   //  Return:  none.
00261   //
00262   //  Contact:   S. Kasahara
00263   // 
00264 
00265   fTempTags.UnLockValues();
00266   if ( isPerOwned ) fTempTags.Set("isPerOwned",1);
00267   else fTempTags.Set("isPerOwned",0);
00268   fTempTags.LockValues();
00269   return;
00270 
00271 }

template<class T >
void RecRecordImp< T >::SetTransient ( bool  isTransient = true  )  [inline, virtual]

Implements RecRecord.

Definition at line 232 of file RecRecordImp.cxx.

References RecRecordImp< T >::fTempTags, Registry::LockValues(), Registry::Set(), and Registry::UnLockValues().

Referenced by AlgFactory::GetOwnedConfigRecord().

00232                                                    {
00233   //
00234   //  Purpose:  Set transient state of record.  If set true(def), record will
00235   //            exist in memory for one job cycle only.
00236   //
00237   //  Arguments: true or false.
00238   //
00239   //  Return:  none.
00240   //
00241   //  Contact:   S. Kasahara
00242   // 
00243 
00244   fTempTags.UnLockValues();
00245   if ( isTransient ) fTempTags.Set("isTransient",1);
00246   else fTempTags.Set("isTransient",0);
00247   fTempTags.LockValues();
00248   return;
00249 
00250 }


Member Data Documentation

template<class T>
T RecRecordImp< T >::fHeader [private]
template<class T>
Bool_t RecRecordImp< T >::fIsClearable [private]
template<class T>
RecJobHistory RecRecordImp< T >::fJobHistory [private]
template<class T>
Registry RecRecordImp< T >::fTempTags [private]

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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1