#include <NtpSRFilterModule.h>
Inheritance diagram for NtpSRFilterModule:

Public Member Functions | |
| NtpSRFilterModule () | |
| ~NtpSRFilterModule () | |
| const Registry & | DefaultConfig () const |
| void | Config (const Registry &r) |
| JobCResult | Reco (MomNavigator *mom) |
Private Attributes | |
| Int_t | fNReco |
| Int_t | fPreScale |
| std::string | fRecordName |
|
|
Definition at line 21 of file NtpSRFilterModule.h. References fNReco, fPreScale, and fRecordName. 00021 : fNReco(0),fPreScale(0),fRecordName("") {}
|
|
|
Definition at line 22 of file NtpSRFilterModule.h. 00022 {}
|
|
|
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 NtpSRFilterModule.cxx. References fPreScale, fRecordName, Registry::Get(), 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("NtpSR",Msg::kDebug) << "NtpSRFilterModule::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 }
|
|
|
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 NtpSRFilterModule.cxx. References JobCModule::GetName(), Registry::LockValues(), MSG, name, 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("NtpSR",Msg::kDebug) <<
00046 "NtpSRFilterModule::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 }
|
|
|
Implement this for read-write access to the MomNavigator Reimplemented from JobCModule. Definition at line 85 of file NtpSRFilterModule.cxx. References fNReco, fPreScale, fRecordName, MomNavigator::GetFragment(), 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("NtpSR",Msg::kDebug) << "NtpSRFilterModule::Reco" << endl;
00096
00097 // Check that mom exists.
00098 assert(mom);
00099
00100 NtpSRRecord* ntprec = dynamic_cast<NtpSRRecord*>
00101 (mom->GetFragment("NtpSRRecord",fRecordName.c_str()));
00102 if (!ntprec) {
00103 MSG("NtpSR",Msg::kWarning) << "No NtpSRRecord 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 }
|
|
|
Definition at line 32 of file NtpSRFilterModule.h. Referenced by NtpSRFilterModule(), and Reco(). |
|
|
Definition at line 33 of file NtpSRFilterModule.h. Referenced by Config(), NtpSRFilterModule(), and Reco(). |
|
|
Definition at line 34 of file NtpSRFilterModule.h. Referenced by Config(), NtpSRFilterModule(), and Reco(). |
1.3.9.1