DeMuxDigitListModule Class Reference

#include <DeMuxDigitListModule.h>

Inheritance diagram for DeMuxDigitListModule:
JobCModule

List of all members.

Public Member Functions

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

Detailed Description

Definition at line 19 of file DeMuxDigitListModule.h.


Constructor & Destructor Documentation

DeMuxDigitListModule::DeMuxDigitListModule (  ) 

Definition at line 43 of file DeMuxDigitListModule.cxx.

References Msg::kVerbose, and MSG.

00044 {
00045   MSG("Digit", Msg::kVerbose) << "DeMuxDigitListModule::Constructor\n";
00046 }

DeMuxDigitListModule::~DeMuxDigitListModule (  ) 

Definition at line 49 of file DeMuxDigitListModule.cxx.

References Msg::kVerbose, and MSG.

00050 {
00051   MSG("Digit", Msg::kVerbose) << "DeMuxDigitListModule::Destructor\n";
00052 }


Member Function Documentation

void DeMuxDigitListModule::BeginJob ( void   )  [virtual]

Implement for notification of begin of job

Reimplemented from JobCModule.

Definition at line 55 of file DeMuxDigitListModule.cxx.

References Msg::kVerbose, and MSG.

00056 {
00057   MSG("Digit", Msg::kVerbose) << "DeMuxDigitListModule::BeginJob\n";
00058  }

void DeMuxDigitListModule::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 DeMuxDigitListModule.cxx.

References Msg::kDebug, and MSG.

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

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

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

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

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

Implement this for read-write access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 92 of file DeMuxDigitListModule.cxx.

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

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