PulserDDSCheck Class Reference

#include <PulserDDSCheck.h>

Inheritance diagram for PulserDDSCheck:
JobCModule

List of all members.

Public Member Functions

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

Private Attributes

std::string fData

Detailed Description

Definition at line 16 of file PulserDDSCheck.h.


Constructor & Destructor Documentation

PulserDDSCheck::PulserDDSCheck (  ) 

Definition at line 24 of file PulserDDSCheck.cxx.

00025 {
00026 //======================================================================
00027 // FILL_IN: [Document your code!!]
00028 //======================================================================
00029 }

PulserDDSCheck::~PulserDDSCheck (  ) 

Definition at line 33 of file PulserDDSCheck.cxx.

00034 {
00035 //======================================================================
00036 // FILL_IN: [Document your code!!]
00037 //======================================================================
00038 }


Member Function Documentation

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

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 42 of file PulserDDSCheck.cxx.

References fData, MomNavigator::FragmentIter(), RawDataBlock::GetBlockId(), RawRecord::GetRawBlockIter(), RawRecord::GetRawHeader(), GetVldContext(), JobCResult::kPassed, Msg::kVerbose, and MSG.

00043 {
00044   std::ofstream out(fData.c_str(),ios::app);
00045  // Find RawRecord fragment in MOM.
00046   TIter iter = mom->FragmentIter();
00047   while (TObject *obj = iter.Next()) {
00048     RawRecord *rawrec = dynamic_cast<RawRecord *>(obj);
00049     if (rawrec) {
00050       MSG("PulserDDS",Msg::kVerbose) << "DDSCheck: " <<(rawrec->GetRawHeader())->GetVldContext() <<endl;
00051       out<<"------------------------------New Record-----------------------\n";
00052       //      const char *c = rawrec->Class_Name();
00053       TIter recit = rawrec->GetRawBlockIter();
00054       while (TObject *obj = recit.Next()) {
00055         RawDataBlock *rawdata = dynamic_cast<RawDataBlock *>(obj);
00056         if (rawdata) {
00057           out<<(rawrec->GetRawHeader())->GetVldContext()
00058              <<" "<<rawdata->GetBlockId()<<endl;
00059         } else { 
00060           out<<(rawrec->GetRawHeader())->GetVldContext()<<" Not RawData\n";
00061         }
00062       }
00063     }
00064   }
00065   return JobCResult::kPassed; // kNoDecision, kFailed, etc.
00066 }

void PulserDDSCheck::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 92 of file PulserDDSCheck.cxx.

References fData, and Registry::Get().

00093 {
00094 //======================================================================
00095 // Configure the module given the Registry r
00096 //======================================================================
00097   const char* tmps;
00098 
00099   if (r.Get("Logfile",tmps)) { fData = std::string(tmps); }
00100 }

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

References JobCModule::GetName(), Registry::LockValues(), Registry::Set(), and Registry::UnLockValues().

00071 {
00072 //======================================================================
00073 // Supply the default configuration for the module
00074 //======================================================================
00075   static Registry r; // Default configuration for module
00076 
00077   // Set name of config
00078   std::string name = this->GetName();
00079   name += ".config.default";
00080   r.SetName(name.c_str());
00081 
00082   // Set values in configuration
00083   r.UnLockValues();
00084   r.Set("Logfile","/home/pa/ddslog");
00085   r.LockValues();
00086 
00087   return r;
00088 }


Member Data Documentation

std::string PulserDDSCheck::fData [private]

Definition at line 33 of file PulserDDSCheck.h.

Referenced by Ana(), and Config().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1