DummyModule Class Reference

#include <DummyModule.h>

Inheritance diagram for DummyModule:
JobCModule

List of all members.

Public Member Functions

 DummyModule ()
virtual ~DummyModule ()
virtual void BeginJob ()
virtual void Config (const Registry &r)
virtual const RegistryDefaultConfig () const
virtual void EndJob ()
virtual JobCResult Ana (const MomNavigator *mom)

Detailed Description

Definition at line 20 of file DummyModule.h.


Constructor & Destructor Documentation

DummyModule::DummyModule (  ) 

Definition at line 30 of file DummyModule.cxx.

References Msg::kDebug, and MSG.

00031 {
00032   MSG("DummyModule", Msg::kDebug) 
00033    <<"Running DummyModule constructor..."<<endl;
00034 
00035 }

DummyModule::~DummyModule (  )  [virtual]

Definition at line 39 of file DummyModule.cxx.

References Msg::kDebug, and MSG.

00040 {
00041   MSG("DummyModule", Msg::kDebug) 
00042    <<"Running destructor..."<<endl;
00043 
00044 }


Member Function Documentation

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

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 48 of file DummyModule.cxx.

References MomNavigator::GetFragment(), RecRecordImp< T >::GetHeader(), RecDataHeader::GetRun(), Msg::kInfo, JobCResult::kPassed, Msg::kWarning, MAXMSG, and MSG.

00049 {
00050   //to test number of entries
00051   static Int_t counter=0;
00052   counter++;
00053 
00054   //set default result to kPassed
00055   JobCResult result(JobCResult::kPassed);
00056   
00057   //check that mom exists.
00058   assert(mom);
00059   
00060   const NtpStRecord* pntp=dynamic_cast<NtpStRecord*>
00061     (mom->GetFragment("NtpStRecord"));
00062   if (!pntp){
00063     MSG("DummyModule",Msg::kWarning) 
00064       << "No NtpStRecord in Mom" << endl;
00065   }
00066   
00067   const NtpBDLiteRecord* pntpBD=dynamic_cast<NtpBDLiteRecord*>
00068     (mom->GetFragment("NtpBDLiteRecord"));
00069   if (!pntpBD){
00070     MAXMSG("DummyModule",Msg::kInfo,1)
00071       <<"No NtpBDLiteRecord in Mom (note: not present for MC)"<<endl;
00072   }
00073 
00074   //NtpFitSARecord
00075   const NtpFitSARecord* pntpSA=dynamic_cast<NtpFitSARecord*>
00076     (mom->GetFragment("NtpFitSARecord"));
00077   if (!pntpSA){
00078     MAXMSG("DummyModule",Msg::kInfo,1) 
00079       <<"No NtpFitSARecord in Mom (pntpSA="<<pntpSA<<")"<<endl;
00080     //mom->Print();
00081   }
00082   else {
00083     MAXMSG("DummyModule",Msg::kInfo,1)
00084       << "Found NtpFitSARecord in Mom" << endl;
00085   }
00086 
00087   cout << "run: " << pntp->GetHeader().GetRun() 
00088        << ", BNTP entry: " << counter
00089        << endl;
00090 
00091   return result;
00092 }

void DummyModule::BeginJob ( void   )  [virtual]

Implement for notification of begin of job

Reimplemented from JobCModule.

Definition at line 96 of file DummyModule.cxx.

References Msg::kInfo, and MSG.

00097 {
00098   MSG("DummyModule",Msg::kInfo)
00099     <<"Running DummyModule::BeginJob()..."<<endl;
00100 
00101 }

void DummyModule::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.

Purpose: Configure the module given a registry.

Reimplemented from JobCModule.

Definition at line 133 of file DummyModule.cxx.

References Msg::kDebug, and MSG.

00134 {
00136 
00137   MSG("DummyModule",Msg::kDebug)<<"DummyModule::Config"<<endl;
00138 
00139 }

const Registry & DummyModule::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 114 of file DummyModule.cxx.

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

00115 { 
00116   MSG("DummyModule", Msg::kDebug)
00117     << "Running DummyModule::DefaultConfig..." << endl;
00118   
00119   static Registry r;
00120   
00121   string name=this->JobCModule::GetName();
00122   name+=".config.default";
00123   r.SetName(name.c_str());
00124   r.UnLockValues();
00125  
00126   r.LockValues();
00127   
00128   return r;
00129 }

void DummyModule::EndJob (  )  [virtual]

Implement for notification of end of job

Reimplemented from JobCModule.

Definition at line 105 of file DummyModule.cxx.

References Msg::kInfo, and MSG.

00106 {  
00107   MSG("DummyModule",Msg::kInfo)
00108     <<"Running DummyModule::EndJob()..."<<endl;
00109 
00110 }


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1