FilterLIModule Class Reference

#include <FilterLIModule.h>

Inheritance diagram for FilterLIModule:
JobCModule

List of all members.

Public Member Functions

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

Detailed Description

Definition at line 27 of file FilterLIModule.h.


Constructor & Destructor Documentation

FilterLIModule::FilterLIModule (  ) 

Definition at line 46 of file FilterLIModule.cxx.

References Msg::kVerbose, and MSG.

00047 {
00048   MSG("LIFilter", Msg::kVerbose) << "FilterLIModule::Constructor\n";
00049 }

FilterLIModule::~FilterLIModule (  ) 

Definition at line 51 of file FilterLIModule.cxx.

References Msg::kVerbose, and MSG.

00052 {
00053   MSG("LIFilter", Msg::kVerbose) << "FilterLIModule::Destructor\n";
00054 }


Member Function Documentation

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

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 98 of file FilterLIModule.cxx.

References LIPatternFinder::Configure(), CandRecord::FindCandHandle(), Registry::Get(), JobCModule::GetConfig(), MomNavigator::GetFragment(), LIFinderFactory::GetInstance(), RawRecord::GetRawHeader(), RawDaqSnarlHeader::GetSnarl(), LIPatternFinder::IsLightInjectionTrash(), Msg::kDebug, JobCResult::kFailed, Msg::kInfo, JobCResult::kPassed, Msg::kVerbose, Msg::kWarning, LIFinderFactory::LIFinder(), MAXMSG, MSG, JobCResult::SetFailed(), and JobCResult::SetWarning().

00099 {
00100   JobCResult result(JobCResult::kPassed);
00101 
00102   MSG("LIFilter", Msg::kVerbose) << "FilterLIModule::Reco" << endl;
00103 
00104 // Cache JobModule Registry values for Reco method
00105   const char * tmps = 0;
00106 
00107   const char * namelistin  = 0;
00108   const char * namelistout = 0;
00109   const char * algname     = 0;
00110   
00111   Registry &r = GetConfig();     // Get this JobModule's Registry object
00112   if (r.Get("NameListIn",       tmps)) namelistin       = tmps;
00113   if (r.Get("NameListOut",      tmps)) namelistout      = tmps;
00114   if (r.Get("LIFinderName",     tmps)) algname          = tmps;
00115 
00116   //-- Get PrimaryCandidateRecord fragment from MOM.
00117   CandRecord *candrec = dynamic_cast<CandRecord *>
00118              (mom->GetFragment("CandRecord", "PrimaryCandidateRecord"));
00119   if (candrec == 0) {
00120     MSG("LIFilter", Msg::kWarning)
00121                           << "No PrimaryCandidateRecord in MOM" << endl;
00122     result.SetWarning().SetFailed();
00123     return result;
00124   }
00125 
00126   CandDigitListHandle *cdlh = dynamic_cast<CandDigitListHandle *>
00127     (candrec->FindCandHandle("CandDigitListHandle",namelistin));
00128 
00129   if (cdlh == 0) {
00130     MSG("LIFilter", Msg::kWarning)
00131                 << "No CandDigitListHandle named " << namelistin
00132                                            << " in CandRecord." << endl;
00133     result.SetWarning().SetFailed();
00134     return result;
00135   }
00136 
00137   //-- Getting an instance to a factory of LIPatternFinder algorithms
00138 
00139   MSG("LIFilter", Msg::kDebug)
00140                         << "Getting a LIFinderFactory instance" << endl;
00141                         
00142   LIFinderFactory * factory = LIFinderFactory::GetInstance();
00143 
00144   //-- Get the algorithm by name
00145     
00146   MSG("LIFilter", Msg::kDebug)
00147            << "Asking LIFinderFactory for ["
00148                                   << algname << "] algorithm " << endl;
00149 
00150   LIPatternFinder * li_finder = factory->LIFinder(algname);
00151 
00152   //-- Ask the algorithm object if we should pass this event
00153   
00154   if(!li_finder) {
00155     
00156       MSG("LIFilter", Msg::kWarning)
00157            << " ** Unspecified LIPatternFinder ** "
00158            << " Skipping Pattern Finding & passing event to next module"
00159            << endl;
00160             
00161       return JobCResult::kPassed;
00162 
00163   } else {
00164 
00165       li_finder->Configure(r);
00166 
00167       if ( li_finder->IsLightInjectionTrash(cdlh) ) {
00168 
00169          //-- print the rejected snarl number
00170 
00171          RawRecord * rawrec = dynamic_cast<RawRecord *>
00172                                         (mom->GetFragment("RawRecord"));
00173          if (rawrec != 0) {
00174 
00175            const RawDaqSnarlHeader * snrlHdr = 
00176                         dynamic_cast<const RawDaqSnarlHeader *> 
00177                                                (rawrec->GetRawHeader());
00178            if(snrlHdr != 0) {
00179               MAXMSG("LIFilter",Msg::kInfo, 200)
00180                  << "REJECTING SNARL = " << snrlHdr->GetSnarl() << endl;
00181            }
00182          }
00183 
00184          return JobCResult::kFailed;
00185       }
00186   }                  
00187 
00188   return JobCResult::kPassed;
00189 }

void FilterLIModule::BeginJob ( void   )  [virtual]

Implement for notification of begin of job

Reimplemented from JobCModule.

Definition at line 56 of file FilterLIModule.cxx.

References Msg::kVerbose, and MSG.

00057 {
00058   MSG("LIFilter", Msg::kVerbose) << "FilterLIModule::BeginJob\n";
00059 }

void FilterLIModule::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 61 of file FilterLIModule.cxx.

References Msg::kDebug, and MSG.

00062 {
00063   MSG("LIFilter", Msg::kDebug) << "FilterLIModule::Config" << endl;
00064 }

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

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

00067 {
00068   MSG("LIFilter", Msg::kDebug)
00069                              << "FilterLIModule::DefaultConfig" << endl;
00070   static Registry r;
00071 
00072   std::string name = this->JobCModule::GetName();
00073   name += ".config.default";
00074   r.SetName(name.c_str());
00075 
00076   r.UnLockValues();
00077   
00078   r.Set("NameListIn",                    "canddigitlist");
00079   r.Set("NameListOut",                   "canddigitlist");
00080   r.Set("LIFinderName",                  "SimpleLIPatternFinder");
00081 
00082   //-- inputs relevant to [SimpleLIPatternFinder] only
00083   r.Set("MaxEWAsymmetry",                 4.e+5);
00084   r.Set("MaxNDigits",                     1400);
00085   r.Set("MaxCharge",                      5.e+5);
00086   r.Set("PulseHeightThreshold",           200);
00087   r.Set("HighActivityThreshold",          0.94);
00088   r.Set("LowActivityThreshold",           0.07);
00089 
00090   //-- inputs relevant to [FancyLIPatternFinder] only
00091   r.Set("FractionalChargeThreshold",      0.8);
00092    
00093   r.LockValues();
00094 
00095   return r;
00096 }


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1