DatabaseToucher Class Reference
[DataUtil]

Module that does nothing but load databases. More...

#include <DatabaseToucher.h>

Inheritance diagram for DatabaseToucher:
JobCModule

List of all members.

Public Member Functions

 DatabaseToucher ()
 ~DatabaseToucher ()
JobCResult Ana (const MomNavigator *mom)

Detailed Description

Module that does nothing but load databases.

Useful because it centralizes the processor load in one module, so that runtime statistics will not reflect DB access resources as well as processing.

Author:
(last to touch it)
Author
bv
Version:
Revision
1.2
Date:
Date
2005/04/15 14:50:02

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

Id
DatabaseToucher.h,v 1.2 2005/04/15 14:50:02 bv Exp

Definition at line 28 of file DatabaseToucher.h.


Constructor & Destructor Documentation

DatabaseToucher::DatabaseToucher (  ) 

Definition at line 29 of file DatabaseToucher.cxx.

00030 {
00031 }

DatabaseToucher::~DatabaseToucher (  ) 

Definition at line 35 of file DatabaseToucher.cxx.

00036 {
00037 }


Member Function Documentation

JobCResult DatabaseToucher::Ana ( const MomNavigator mom  )  [virtual]

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 41 of file DatabaseToucher.cxx.

References VldContext::AsString(), MomNavigator::GetFragment(), RawRecord::GetRawHeader(), SimSnarlRecord::GetSimSnarlHeader(), RecHeader::GetVldContext(), RecMinosHdr::GetVldContext(), RecMinos::GetVldContext(), Calibrator::Instance(), VldContext::IsValid(), Msg::kInfo, JobCResult::kPassed, MSG, and CalScheme::Reset().

00042 {
00043   // Find something with a vld context.
00044   VldContext context;
00045 
00046   const SimSnarlRecord* simsnarl = 
00047     dynamic_cast<const SimSnarlRecord*>(mom->GetFragment("SimSnarlRecord"));
00048   if(simsnarl) context = simsnarl->GetSimSnarlHeader()->GetVldContext();
00049 
00050   const RawRecord* rawrec = 
00051     dynamic_cast<const RawRecord*>(mom->GetFragment("RawRecord"));
00052   if(rawrec) context = rawrec->GetRawHeader()->GetVldContext();
00053 
00054   CandRecord *candrec = dynamic_cast<CandRecord *>
00055     (mom->GetFragment("CandRecord", "PrimaryCandidateRecord"));
00056   if(candrec) context = *candrec->GetVldContext();
00057 
00058   if(context.IsValid()) {
00059     // Touch everything that uses a DB:
00060     MSG("Calib",Msg::kInfo) << "Touching all databases with context" << context.AsString() << endl;
00061     PlexHandle plex(context);
00062     UgliGeomHandle ugli(context);
00063     Calibrator::Instance().Reset(context);    
00064   }
00065 
00066   return JobCResult::kPassed; // kNoDecision, kFailed, etc.
00067 }


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1