FilterDigitListModule Class Reference

#include <FilterDigitListModule.h>

Inheritance diagram for FilterDigitListModule:
JobCModule

List of all members.

Public Member Functions

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

Detailed Description

Definition at line 19 of file FilterDigitListModule.h.


Constructor & Destructor Documentation

FilterDigitListModule::FilterDigitListModule (  ) 

Definition at line 44 of file FilterDigitListModule.cxx.

References Msg::kVerbose, and MSG.

00045 {
00046   MSG("DFilt", Msg::kVerbose) << "FilterDigitListModule::Constructor\n";
00047 }

FilterDigitListModule::~FilterDigitListModule (  ) 

Definition at line 50 of file FilterDigitListModule.cxx.

References Msg::kVerbose, and MSG.

00051 {
00052   MSG("DFilt", Msg::kVerbose) << "FilterDigitListModule::Destructor\n";
00053 }


Member Function Documentation

void FilterDigitListModule::BeginJob ( void   )  [virtual]

Implement for notification of begin of job

Reimplemented from JobCModule.

Definition at line 56 of file FilterDigitListModule.cxx.

References Msg::kVerbose, and MSG.

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

void FilterDigitListModule::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 62 of file FilterDigitListModule.cxx.

References Msg::kDebug, and MSG.

00063 {
00064   MSG("DFilt", Msg::kDebug) << "FilterDigitListModule::Config" << endl;
00065 }

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

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

00069 {
00070   MSG("DFilt", Msg::kDebug)
00071     << "FilterDigitListModule::DefaultConfig" << endl;
00072 
00073   static Registry r;
00074   
00075   std::string name = this->JobCModule::GetName();
00076   name += ".config.default";
00077   r.SetName(name.c_str());
00078   
00079   r.UnLockValues();
00080   r.Set("NameListIn",  "canddigitlist");
00081   r.Set("NameListOut", "canddigitlist");
00082   r.Set("TitleListOut",
00083                  "Created by FilterDigitListModule from CandDigitList");
00084   r.Set("FilterDigitListAlgorithm", "AlgFilterDigitList");
00085   r.Set("FilterDigitListAlgConfig", "default");
00086   r.Set("SwitchPersToTemp", 0);
00087   r.LockValues();
00088 
00089   return r;
00090 }

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

Implement this for read-write access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 93 of file FilterDigitListModule.cxx.

References CandRecord::FindCandHandle(), Registry::Get(), AlgFactory::GetAlgHandle(), JobCModule::GetConfig(), MomNavigator::GetFragment(), AlgFactory::GetInstance(), Msg::kDebug, JobCResult::kPassed, Msg::kVerbose, Msg::kWarning, CandDigitList::MakeCandidate(), MSG, CandRecord::SecureCandHandle(), CandContext::SetDataIn(), JobCResult::SetFailed(), CandHandle::SetName(), CandHandle::SetTitle(), JobCResult::SetWarning(), and CandRecord::SwitchCandHandlePersToTemp().

00094 {
00095   JobCResult result(JobCResult::kPassed);
00096 
00097   MSG("DFilt", Msg::kVerbose) << "FilterDigitListModule::Reco" << endl;
00098 
00099 // Cache JobModule Registry values for Reco method
00100   const char *tmps = 0;
00101   Int_t       tmpi = 0;
00102 
00103   const char *namelistin = 0;
00104   const char *namelistout = 0;
00105   const char *titlelistout = 0;
00106   const char *filterdigitlistalgorithm = 0;
00107   const char *filterdigitlistalgconfig = 0;
00108   Int_t switchperstotemp = 0;
00109 
00110   Registry &r = GetConfig();     // Get this JobModule's Registry object
00111   if (r.Get("NameListIn",       tmps)) namelistin       = tmps;
00112   if (r.Get("NameListOut",      tmps)) namelistout      = tmps;
00113   if (r.Get("TitleListOut",     tmps)) titlelistout     = tmps;
00114   if (r.Get("FilterDigitListAlgorithm", tmps))
00115                                filterdigitlistalgorithm = tmps;
00116   if (r.Get("FilterDigitListAlgConfig", tmps))
00117                                filterdigitlistalgconfig = tmps;
00118   if (r.Get("SwitchPersToTemp", tmpi)) switchperstotemp = tmpi;
00119 
00120 // Find PrimaryCandidateRecord fragment in MOM.
00121   CandRecord *candrec = dynamic_cast<CandRecord *>
00122              (mom->GetFragment("CandRecord", "PrimaryCandidateRecord"));
00123   if (candrec == 0) {
00124     MSG("DFilt", Msg::kWarning) << "No PrimaryCandidateRecord in MOM."
00125                                                                 << endl;
00126     result.SetWarning().SetFailed();
00127     return result;
00128   }
00129 
00130 // Find CandDigitListHandle in CandRecord.
00131   MSG("DFilt", Msg::kVerbose)
00132     << "CandDigitListHandle *cdlh = dynamic_cast<CandDigitListHandle *>"
00133     << " (candrec->FindCandHandle(\"CandDigitListHandle\", "
00134     << namelistin << "));" << endl;
00135   
00136   CandDigitListHandle *cdlh = dynamic_cast<CandDigitListHandle *>
00137     (candrec->FindCandHandle("CandDigitListHandle",namelistin));
00138 
00139   if (cdlh == 0) {
00140     MSG("DFilt", Msg::kWarning)
00141                 << "No CandDigitListHandle named " << namelistin
00142                                            << " in CandRecord." << endl;
00143     result.SetWarning().SetFailed();
00144     return result;
00145   }
00146 
00147   MSG("DFilt", Msg::kDebug) << "CandContext cx(this);" << endl;
00148   CandContext cx(this, mom);
00149 
00150   MSG("DFilt", Msg::kDebug) << "cx.SetDataIn(cdlh);" << endl;
00151   cx.SetDataIn(cdlh);
00152 
00153 // Get Singleton instance of AlgFactory.
00154   MSG("DFilt", Msg::kDebug)
00155                       << "Get Singleton instance of AlgFactory." << endl
00156                << "AlgFactory &af = AlgFactory::GetInstance();" << endl;
00157   AlgFactory &af = AlgFactory::GetInstance();
00158 
00159 // Build a CandDigitList from CandDigitList.
00160   MSG("DFilt", Msg::kDebug)
00161   << "Get AlgHandle to FilterDigitList Algorithm and AlgConfig." << endl
00162    << "AlgHandle addlh = af.GetAlgHandle(" << filterdigitlistalgorithm
00163    << ", " << filterdigitlistalgconfig << ");" << endl;
00164   AlgHandle addlh = af.GetAlgHandle(filterdigitlistalgorithm,
00165                                     filterdigitlistalgconfig);
00166 
00167   MSG("DFilt", Msg::kDebug)
00168           << "cddlh = CandDigitList::MakeCandidate(addlh, cx);" << endl;
00169   CandDigitListHandle cddlh = CandDigitList::MakeCandidate(addlh, cx);
00170   cddlh.SetName(namelistout);
00171   cddlh.SetTitle(titlelistout);
00172 
00173 // Give the CandHandle to the CandRecord
00174   MSG("DFilt", Msg::kDebug) << "candrec->SecureCandHandle(cddlh);"
00175                                                                 << endl;
00176   candrec->SecureCandHandle(cddlh);
00177 
00178 // Reassign original CandDigitList from Persistent list to fTemporaries
00179   if (switchperstotemp) candrec->SwitchCandHandlePersToTemp(cdlh);
00180   
00181   return result;
00182 }


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1