FilterStream Class Reference

#include <FilterStream.h>

Inheritance diagram for FilterStream:
JobCModule

List of all members.

Public Member Functions

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

Private Attributes

bool fPassMonitor
bool fPassSnarl
bool fPassCand
bool fPassLI

Detailed Description

Definition at line 15 of file FilterStream.h.


Constructor & Destructor Documentation

FilterStream::FilterStream (  ) 

Definition at line 25 of file FilterStream.cxx.

References RSMSyn.

00025                            {
00026   RSMSyn << "FilterStream::FilterStream" << endl;
00027   fPassMonitor = true;
00028   fPassSnarl = true;
00029   fPassCand = true;
00030   fPassLI = true;
00031 }

FilterStream::~FilterStream (  ) 

Definition at line 33 of file FilterStream.cxx.

References RSMSyn.

00033                             {
00034   RSMSyn << "FilterStream::~FilterStream" << endl;
00035 }


Member Function Documentation

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

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 37 of file FilterStream.cxx.

References fPassCand, fPassLI, fPassMonitor, fPassSnarl, Registry::Get(), RecMinos::GetTempTags(), JobCResult::kFailed, JobCResult::kPassed, and RSMVer.

00037                                                     {
00038   RSMVer << "FilterStream::Ana" << endl;
00039   bool HasMonitor = false;
00040   bool HasSnarl = false;
00041   bool HasCand = false;
00042   bool HasLI = false;
00043 
00044   const char* rcInStr = 0;
00045   RawRecord* record = 0;
00046   CandRecord* candrec = 0;
00047 
00048   TIter itr = const_cast<MomNavigator*>(mom)->FragmentIter();
00049 
00050   TObject *obj = 0;
00051   while ((obj=itr())) {
00052     if ((record=dynamic_cast<RawRecord*>(obj))) {
00053       if(!record->GetTempTags().Get("stream",rcInStr)) continue;
00054 
00055       if(!strcmp("DaqMonitor",rcInStr)) HasMonitor = true;
00056       if(!strcmp("DaqSnarl",rcInStr)) HasSnarl = true;
00057       if(!strcmp("LightInjection",rcInStr)) HasLI = true;
00058     }
00059     if((candrec=dynamic_cast<CandRecord*>(obj))) HasCand = true;
00060   }
00061 
00062   if(HasMonitor && fPassMonitor) return JobCResult::kPassed;
00063   if(HasSnarl && fPassSnarl) return JobCResult::kPassed;
00064   if(HasLI && fPassLI) return JobCResult::kPassed;
00065   if(HasCand && fPassCand) return JobCResult::kPassed;
00066 
00067   return JobCResult::kFailed;
00068 }

void FilterStream::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 89 of file FilterStream.cxx.

References fPassCand, fPassLI, fPassMonitor, fPassSnarl, Registry::Get(), and RSMSyn.

00089                                            {
00090   RSMSyn << "FilterStream::Config" << endl;
00091   int tmpi=0;
00092   if(r.Get("PassMonitor",tmpi)) fPassMonitor = static_cast<bool>(tmpi);
00093   if(r.Get("PassSnarl",tmpi)) fPassSnarl = static_cast<bool>(tmpi);
00094   if(r.Get("PassCand",tmpi)) fPassCand = static_cast<bool>(tmpi);
00095   if(r.Get("PassLI",tmpi)) fPassLI = static_cast<bool>(tmpi);
00096 }

const Registry & FilterStream::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 FilterStream.cxx.

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

00070                                                   {
00071   RSMSyn << "FilterStream::DefaultConfig" << endl;
00072   static Registry r;
00073 
00074   string name = this->JobCModule::GetName();
00075   r.SetName((name+".config.default").c_str());
00076 
00077   r.UnLockValues();
00078 
00079   r.Set("PassMonitor",1);
00080   r.Set("PassSnarl",1);
00081   r.Set("PassCand",1);
00082   r.Set("PassLI",1);
00083 
00084   r.LockValues();
00085 
00086   return r;
00087 }


Member Data Documentation

bool FilterStream::fPassCand [private]

Definition at line 28 of file FilterStream.h.

Referenced by Ana(), and Config().

bool FilterStream::fPassLI [private]

Definition at line 29 of file FilterStream.h.

Referenced by Ana(), and Config().

Definition at line 26 of file FilterStream.h.

Referenced by Ana(), and Config().

bool FilterStream::fPassSnarl [private]

Definition at line 27 of file FilterStream.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