MCFilePOTInfoFinder Class Reference
[DataUtil]

A class to provide look-up services on the MCFilePOTInfo table. More...

#include <MCFilePOTInfoFinder.h>

List of all members.

Classes

struct  Cleaner

Public Member Functions

virtual ~MCFilePOTInfoFinder ()
Float_t GetFoo (const MCFilePOTInfoKey &key) const
 Return stuff.
const MCFilePOTInfoGetEntry (const MCFilePOTInfoKey &key) const
void Print (std::string option="") const
 Print the entire MCFilePOTInfo table.
DbiResultPtr< MCFilePOTInfo > & GetDbiResultSet ()
 Access to DbiResultSet.

Static Public Member Functions

static MCFilePOTInfoFinderInstance (Dbi::Task task=Dbi::kDefaultTask)
 Singleton access.

Private Member Functions

 MCFilePOTInfoFinder ()
 signal unset
void UpdateTask (Dbi::Task task=Dbi::kDefaultTask)

Private Attributes

DbiResultPtr< MCFilePOTInfofMCFilePOTInfoTable
 Access to entire MCFilePOTInfo table.

Static Private Attributes

static MCFilePOTInfoFinderfgInstance = 0
static Dbi::Task fgTask = 0xDEADDEAD
 allow alternative versions

Detailed Description

A class to provide look-up services on the MCFilePOTInfo table.

Author:
(last to touch it)
Author
rhatcher
Version:
Revision
1.2
Date:
Date
2013/09/25 17:54:31

Contact: rhatcher@fnal.gov

Definition at line 12 of file MCFilePOTInfoFinder.h.


Constructor & Destructor Documentation

virtual MCFilePOTInfoFinder::~MCFilePOTInfoFinder (  )  [inline, virtual]

Definition at line 34 of file MCFilePOTInfoFinder.h.

00034 {}

MCFilePOTInfoFinder::MCFilePOTInfoFinder (  )  [private]

signal unset

Definition at line 17 of file MCFilePOTInfoFinder.cxx.

Referenced by Instance().

00018 { 
00019   // ctor
00020 }


Member Function Documentation

DbiResultPtr<MCFilePOTInfo>& MCFilePOTInfoFinder::GetDbiResultSet (  )  [inline]

Access to DbiResultSet.

Definition at line 47 of file MCFilePOTInfoFinder.h.

References fMCFilePOTInfoTable.

00047 { return fMCFilePOTInfoTable; }

const MCFilePOTInfo * MCFilePOTInfoFinder::GetEntry ( const MCFilePOTInfoKey key  )  const

Return matching row (useful to check that such a row exists). NULL pointer if no match

Definition at line 57 of file MCFilePOTInfoFinder.cxx.

References fMCFilePOTInfoTable, DbiResultPtr< T >::GetNumRows(), and DbiResultPtr< T >::GetRow().

Referenced by GetFoo().

00058 {
00059   // find an entry that matches the "key" criteria
00060   // leverage the matching criteria that we already have in
00061   // MCFilePOTInfoKKey::IsSameKey() by constructing a temporary row-like object
00062 
00063   size_t nrows = fMCFilePOTInfoTable.GetNumRows();
00064   for ( size_t irow = 0; irow < nrows; ++irow ) {
00065     const MCFilePOTInfo* row(fMCFilePOTInfoTable.GetRow(irow));
00066     if ( row->fKey.IsSameKey(key) ) return row;
00067   }
00068   return NULL;
00069 }

Float_t MCFilePOTInfoFinder::GetFoo ( const MCFilePOTInfoKey key  )  const

Return stuff.

Definition at line 48 of file MCFilePOTInfoFinder.cxx.

References MCFilePOTInfo::fFoo, and GetEntry().

00049 {
00050   // helper function if one wants to hide the details of data members
00051   const MCFilePOTInfo* row(this->GetEntry(key));
00052   // if we got a row, return the desired value; otherwise flag value
00053   return ( ( row ) ? row->fFoo : -1.0e30 );
00054 }

MCFilePOTInfoFinder & MCFilePOTInfoFinder::Instance ( Dbi::Task  task = Dbi::kDefaultTask  )  [static]

Singleton access.

Definition at line 36 of file MCFilePOTInfoFinder.cxx.

References fgInstance, MCFilePOTInfoFinder(), UpdateTask(), and MCFilePOTInfoFinder::Cleaner::UseMe().

00037 {
00038   static Cleaner cleaner;  // cleaner dtor calls MCFilePOTInfoFinder dtor
00039   if ( ! fgInstance ) {
00040     fgInstance = new MCFilePOTInfoFinder();
00041     cleaner.UseMe();
00042   }
00043   fgInstance->UpdateTask(task);
00044   return *fgInstance;
00045 }

void MCFilePOTInfoFinder::Print ( std::string  option = ""  )  const

Print the entire MCFilePOTInfo table.

void MCFilePOTInfoFinder::UpdateTask ( Dbi::Task  task = Dbi::kDefaultTask  )  [private]

Definition at line 23 of file MCFilePOTInfoFinder.cxx.

References fgTask, fMCFilePOTInfoTable, SimFlag::kMC, Detector::kNear, and DbiResultPtr< T >::NewQuery().

Referenced by Instance().

00024 {
00025   if ( task != fgTask ) {
00026     // task # has changed, need to reprime the pump
00027     fgTask = task;
00028     // Use an arbitrary context (any should do) to query MCFilePOTInfo table.
00029     VldTimeStamp ts(2013,9,1,1,0,0);
00030     VldContext context(Detector::kNear,SimFlag::kMC,ts);
00031     fMCFilePOTInfoTable.NewQuery(context,fgTask);
00032   }
00033 }


Member Data Documentation

Definition at line 54 of file MCFilePOTInfoFinder.h.

Referenced by Instance(), and MCFilePOTInfoFinder::Cleaner::~Cleaner().

Dbi::Task MCFilePOTInfoFinder::fgTask = 0xDEADDEAD [static, private]

allow alternative versions

Definition at line 55 of file MCFilePOTInfoFinder.h.

Referenced by UpdateTask().

Access to entire MCFilePOTInfo table.

Definition at line 58 of file MCFilePOTInfoFinder.h.

Referenced by GetDbiResultSet(), GetEntry(), and UpdateTask().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1