McNormalizationFinder Class Reference
[DataUtil]

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

#include <McNormalizationFinder.h>

List of all members.

Classes

struct  Cleaner

Public Member Functions

virtual ~McNormalizationFinder ()
Float_t GetNearDetEvPerPOT (string &beam_config, string &mc_version, string &modifier) const
 Return the events per POT in the near detector for a given beam and MC.
Float_t GetRockEvPerPOT (string &beam_config, string &mc_version, string &modifier) const
 Return the events per POT in the rock for a given beam and MC.
const MC_NormalizationGetEntry (string &beam_config, string &mc_version, string &modifier) const
 Return MC_Normalization row for a given beam and MC (useful to check that such a row exists).
void Print (std::string option="") const
 Print the entire MC_NORMALIZATION table.

Static Public Member Functions

static McNormalizationFinderInstance ()
 Singleton access.

Private Member Functions

 McNormalizationFinder ()

Private Attributes

DbiResultPtr< MC_NormalizationfMcNormalizationTable
 Access to entire MC_NORMALIZATION table.

Static Private Attributes

static McNormalizationFinderfgInstance = 0

Detailed Description

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

Author:
(last to touch it)
Author
nwest
Version:
Revision
1.1
Date:
Date
2009/07/23 09:17:23

Contact: n.west1@physics.ox.ac.uk

Definition at line 9 of file McNormalizationFinder.h.


Constructor & Destructor Documentation

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

Definition at line 31 of file McNormalizationFinder.h.

00031 {}

McNormalizationFinder::McNormalizationFinder (  )  [private]

Definition at line 14 of file McNormalizationFinder.cxx.

References fMcNormalizationTable, SimFlag::kData, Detector::kNear, and DbiResultPtr< T >::NewQuery().

00015 { 
00016   // ctor
00017 
00018   // Use an arbitrary context (any should do) to query MC_NORMALIZATION table.
00019   VldTimeStamp ts(2009,1,1,1,0,0);
00020   VldContext context(Detector::kNear,SimFlag::kData,ts);
00021   fMcNormalizationTable.NewQuery(context);
00022 
00023 }


Member Function Documentation

const MC_Normalization * McNormalizationFinder::GetEntry ( string &  beam_config,
string &  mc_version,
string &  modifier 
) const

Return MC_Normalization row for a given beam and MC (useful to check that such a row exists).

Definition at line 53 of file McNormalizationFinder.cxx.

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

Referenced by GetNearDetEvPerPOT(), and GetRockEvPerPOT().

00053                                                                                                                        {
00054   for ( unsigned int i_row = 0; i_row < fMcNormalizationTable.GetNumRows(); ++i_row ) {
00055     const MC_Normalization* row(fMcNormalizationTable.GetRow(i_row));
00056     if (    beam_config == row->GetBeamConfig()
00057          && mc_version  == row->GetMCVersion() 
00058          && modifier    == row->GetModifier() ) return row;
00059   }
00060   return NULL;
00061 }

Float_t McNormalizationFinder::GetNearDetEvPerPOT ( string &  beam_config,
string &  mc_version,
string &  modifier 
) const

Return the events per POT in the near detector for a given beam and MC.

Definition at line 39 of file McNormalizationFinder.cxx.

References GetEntry(), and MC_Normalization::GetNearDetEvPerPot().

00039                                                                                                                 {
00040   const MC_Normalization* row(this->GetEntry(beam_config,mc_version,modifier));
00041   return row ? row->GetNearDetEvPerPot() : -999.;
00042 }

Float_t McNormalizationFinder::GetRockEvPerPOT ( string &  beam_config,
string &  mc_version,
string &  modifier 
) const

Return the events per POT in the rock for a given beam and MC.

Definition at line 46 of file McNormalizationFinder.cxx.

References GetEntry(), and MC_Normalization::GetRockEvPerPot().

00046                                                                                                              {
00047   const MC_Normalization* row(this->GetEntry(beam_config,mc_version,modifier));
00048   return row ? row->GetRockEvPerPot() : -999.;
00049 }

McNormalizationFinder & McNormalizationFinder::Instance (  )  [static]

Singleton access.

Definition at line 27 of file McNormalizationFinder.cxx.

References fgInstance, and McNormalizationFinder::Cleaner::UseMe().

00028 {
00029   static Cleaner cleaner;  // cleaner dtor calls McNormalizationFinder dtor
00030   if ( ! fgInstance ) {
00031     fgInstance = new McNormalizationFinder;
00032     cleaner.UseMe();
00033   }
00034   return *fgInstance;
00035 }

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

Print the entire MC_NORMALIZATION table.


Member Data Documentation

Definition at line 46 of file McNormalizationFinder.h.

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

Access to entire MC_NORMALIZATION table.

Definition at line 49 of file McNormalizationFinder.h.

Referenced by GetEntry(), and McNormalizationFinder().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1