DDSPaceModule Class Reference

#include <DDSPaceModule.h>

Inheritance diagram for DDSPaceModule:
JobCModule

List of all members.

Public Member Functions

 DDSPaceModule ()
 ~DDSPaceModule ()
const RegistryDefaultConfig () const
void Config (const Registry &r)
JobCResult Ana (const MomNavigator *mom)

Private Attributes

VldTimeStamp fVldStartTime
TStopwatch fStopwatch

Detailed Description

Definition at line 19 of file DDSPaceModule.h.


Constructor & Destructor Documentation

DDSPaceModule::DDSPaceModule (  ) 

Definition at line 40 of file DDSPaceModule.cxx.

00040                              : fVldStartTime(0,0) {
00041   // Default constructor
00042 
00043   fStopwatch.Reset();
00044   fStopwatch.Stop();
00045   
00046 }

DDSPaceModule::~DDSPaceModule (  )  [inline]

Definition at line 23 of file DDSPaceModule.h.

00023 {}


Member Function Documentation

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

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 93 of file DDSPaceModule.cxx.

References MomNavigator::FragmentIter(), fStopwatch, fVldStartTime, VldTimeStamp::GetSec(), VldContext::GetTimeStamp(), RecMinos::GetVldContext(), gSystem(), Msg::kDebug, JobCResult::kPassed, Msg::kWarning, MSG, JobCResult::SetFailed(), and JobCResult::SetWarning().

00093                                                      {
00094   //
00095   //  Purpose:  Create and fill ntuple record.
00096   //
00097   //  Arguments: mom.
00098   //  
00099   //  Return: status.
00100   // 
00101 
00102   JobCResult result(JobCResult::kPassed);  
00103   MSG("DDSPace",Msg::kDebug) << "DDSPaceModule::Ana" << endl;
00104 
00105   // Check that mom exists.
00106   assert(mom);
00107 
00108   // Blindly look at first record, this module is very simple
00109   // Assumption is that its only of interest to RawRecords with RecMinos base
00110   TIter fiter = mom->FragmentIter();
00111   RecMinos* record = dynamic_cast<RecMinos*>(fiter());
00112   if ( !record ) {
00113     MSG("DDS",Msg::kWarning) << "First record not RecMinos record" << endl;
00114     result.SetWarning().SetFailed();
00115     return result;
00116   }
00117   VldTimeStamp vldCurrentTime = record->GetVldContext()->GetTimeStamp();
00118   
00119   if ( fVldStartTime.GetSec() == 0 ) {
00120     // first call
00121     fVldStartTime = vldCurrentTime;
00122     fStopwatch.Start();  // start timer
00123   }
00124   
00125   Double_t vldtimediff = vldCurrentTime-fVldStartTime;  // seconds
00126   Double_t realtime = fStopwatch.RealTime();  // seconds
00127   // RealTime will stop it, need to restart w/o resetting
00128   fStopwatch.Start(false); 
00129 
00130   Double_t timediff = vldtimediff - realtime;
00131   MSG("DDS",Msg::kDebug) << "Delta VldTime " << vldtimediff 
00132                          << " RealTime " << realtime << " => sleep for " 
00133                          << timediff << " seconds." << endl;
00134 
00135   if ( timediff > 0 ) {
00136     // Sleep for specified length of time in msec
00137     gSystem->Sleep((Int_t)(timediff*1000));
00138   }
00139   
00140   
00141   return result;
00142 
00143 }

void DDSPaceModule::Config ( const Registry r  )  [virtual]

Return the actual configuration. If your module directly pulls its configuration from the fConfig Registry, you don't need to override this. Override if you have local config variables.

Reimplemented from JobCModule.

Definition at line 74 of file DDSPaceModule.cxx.

References Msg::kDebug, and MSG.

00074                                                   {
00075   //
00076   // Purpose: Configure the module given a registry.
00077   //
00078   // Arguments: Registry to use to configure the module.
00079   //
00080   // Return: none.
00081   //
00082 
00083   MSG("DDSPace",Msg::kDebug) << "DDSPaceModule::Config" << endl;
00084   
00085   //Int_t tmpi;
00086   //  Double_t tmpd;
00087   //  const Char_t* tmps;
00088 
00089 }

const Registry & DDSPaceModule::DefaultConfig ( void   )  const [virtual]

Get the default configuration registry. This should normally be overridden. One useful idiom is to implement it like:

const Registry& MyModule::DefaultConfig() const { static Registry cfg; // never is destroyed if (cfg.Size()) return cfg; // already filled it // set defaults: cfg.Set("TheAnswer",42); cfg.Set("Units","unknown"); return cfg; }

Reimplemented from JobCModule.

Definition at line 49 of file DDSPaceModule.cxx.

References JobCModule::GetName(), Msg::kDebug, Registry::LockValues(), MSG, and Registry::UnLockValues().

00049                                                    {
00050   //
00051   // Purpose: Method to return default configuration.
00052   // 
00053   // Arguments: none.
00054   //
00055   // Return: Registry containing default configuration
00056   //
00057 
00058   MSG("DDSPace",Msg::kDebug) << 
00059     "DDSPaceModule::DefaultConfig" << endl;
00060 
00061   static Registry r; 
00062   std::string name = this->JobCModule::GetName();
00063   name += ".config.default";
00064   r.SetName(name.c_str());
00065 
00066   r.UnLockValues();
00067   r.LockValues();
00068 
00069   return r;
00070 }


Member Data Documentation

TStopwatch DDSPaceModule::fStopwatch [private]

Definition at line 35 of file DDSPaceModule.h.

Referenced by Ana().

Definition at line 34 of file DDSPaceModule.h.

Referenced by Ana().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1