NtpStFilterModule Class Reference

#include <NtpStFilterModule.h>

Inheritance diagram for NtpStFilterModule:
JobCModule

List of all members.

Public Member Functions

 NtpStFilterModule ()
 ~NtpStFilterModule ()
const RegistryDefaultConfig () const
void Config (const Registry &r)
JobCResult Reco (MomNavigator *mom)

Private Attributes

Int_t fNReco
Int_t fPreScale
std::string fRecordName

Detailed Description

Definition at line 18 of file NtpStFilterModule.h.


Constructor & Destructor Documentation

NtpStFilterModule::NtpStFilterModule (  )  [inline]

Definition at line 21 of file NtpStFilterModule.h.

00021 : fNReco(0),fPreScale(0),fRecordName("") {}

NtpStFilterModule::~NtpStFilterModule (  )  [inline]

Definition at line 22 of file NtpStFilterModule.h.

00022 {}


Member Function Documentation

void NtpStFilterModule::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 63 of file NtpStFilterModule.cxx.

References fPreScale, fRecordName, Registry::Get(), Msg::kDebug, and MSG.

00063                                                 {
00064   //
00065   // Purpose: Configure the module given a registry.
00066   //
00067   // Arguments: Registry to use to configure the module.
00068   //
00069   // Return: none.
00070   //
00071 
00072   MSG("NtpSt",Msg::kDebug) << "NtpStFilterModule::Config" << endl;
00073   
00074   Int_t tmpi;
00075   //  Double_t tmpd;
00076   const Char_t* tmps;
00077 
00078   if ( r.Get("PreScale",tmpi) ) fPreScale = tmpi;
00079   if ( r.Get("RecordName",tmps) ) fRecordName = tmps;
00080 
00081 }

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

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

00036                                                        {
00037   //
00038   // Purpose: Method to return default configuration.
00039   // 
00040   // Arguments: none.
00041   //
00042   // Return: Registry containing default configuration
00043   //
00044 
00045   MSG("NtpSt",Msg::kDebug) << 
00046     "NtpStFilterModule::DefaultConfig" << endl;
00047 
00048   static Registry r; 
00049   std::string name = this->JobCModule::GetName();
00050   name += ".config.default";
00051   r.SetName(name.c_str());
00052 
00053   r.UnLockValues();
00054   r.Set("PreScale",1000000000);
00055   r.Set("RecordName","Primary");
00056   r.LockValues();
00057 
00058   return r;
00059 }

JobCResult NtpStFilterModule::Reco ( MomNavigator mom  )  [virtual]

Implement this for read-write access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 85 of file NtpStFilterModule.cxx.

References fNReco, fPreScale, fRecordName, MomNavigator::GetFragment(), Msg::kDebug, JobCResult::kPassed, Msg::kWarning, MSG, JobCResult::SetFailed(), and JobCResult::SetWarning().

00085                                                     {
00086   //
00087   //  Purpose:  Filter contents of existing ntuple record.
00088   //
00089   //  Arguments: mom.
00090   //  
00091   //  Return: status.
00092   // 
00093 
00094   JobCResult result(JobCResult::kPassed);  
00095   MSG("NtpSt",Msg::kDebug) << "NtpStFilterModule::Reco" << endl;
00096 
00097   // Check that mom exists.
00098   assert(mom);
00099 
00100   NtpStRecord* ntprec = dynamic_cast<NtpStRecord*>
00101      (mom->GetFragment("NtpStRecord",fRecordName.c_str()));
00102   if (!ntprec) {
00103     MSG("NtpSt",Msg::kWarning) << "No NtpStRecord of name " 
00104                                << fRecordName.c_str() << " in Mom" << endl;
00105     result.SetWarning().SetFailed();
00106     return result;
00107   }
00108 
00109   fNReco++;
00110   if ( fNReco%fPreScale == 0 ) return result; // every nth record is skipped
00111 
00112   // Purge strip data from record
00113   ntprec -> ClearStrips();
00114 
00115   return result;
00116 
00117 }


Member Data Documentation

Int_t NtpStFilterModule::fNReco [private]

Definition at line 32 of file NtpStFilterModule.h.

Referenced by Reco().

Definition at line 33 of file NtpStFilterModule.h.

Referenced by Config(), and Reco().

std::string NtpStFilterModule::fRecordName [private]

Definition at line 34 of file NtpStFilterModule.h.

Referenced by Config(), and Reco().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1