SliceSRListModule Class Reference

#include <SliceSRListModule.h>

Inheritance diagram for SliceSRListModule:
JobCModule

List of all members.

Public Member Functions

 SliceSRListModule ()
 ~SliceSRListModule ()
void BeginJob ()
JobCResult Reco (MomNavigator *mom)
const RegistryDefaultConfig () const

Detailed Description

Definition at line 23 of file SliceSRListModule.h.


Constructor & Destructor Documentation

SliceSRListModule::SliceSRListModule (  ) 

Definition at line 48 of file SliceSRListModule.cxx.

00049 {
00050 }

SliceSRListModule::~SliceSRListModule (  ) 

Definition at line 53 of file SliceSRListModule.cxx.

00054 {
00055 }


Member Function Documentation

void SliceSRListModule::BeginJob ( void   )  [virtual]

Implement for notification of begin of job

Reimplemented from JobCModule.

Definition at line 58 of file SliceSRListModule.cxx.

00059 {
00060 }

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

References JobCModule::GetName(), Registry::Set(), and Registry::Size().

00063 {
00064 //  
00065 //  Purpose:    Method to return default configuration.
00066 //  
00067 //  Arguments:  n/a
00068 //  
00069 //  Return:     Registry item containing default configuration.
00070 //
00071    
00072   static Registry def_cfg;
00073   if (def_cfg.Size()) return def_cfg;
00074 
00075   string name = this->JobCModule::GetName();
00076   name += ".config.default";
00077   def_cfg.SetName(name.c_str());
00078 
00079   // Set default
00080   def_cfg.Set("SliceListAlgorithm","AlgSliceSRList");
00081   def_cfg.Set("SliceListAlgConfig","default");
00082   def_cfg.Set("ListIn","CandStripList");
00083   def_cfg.Set("ListOut","CandSliceList");
00084   def_cfg.Set("LogLevel","Fatal");
00085   return def_cfg;
00086 }

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

Implement this for read-write access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 90 of file SliceSRListModule.cxx.

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

00091 {
00092   JobCResult result(JobCResult::kPassed);
00093 
00094   // load configuration 
00095   const char* tmps = 0;
00096   const char* alg_name = 0;
00097   const char* alg_config_name = 0;
00098   const char* list_in = 0;
00099   const char* list_out = 0;
00100 
00101   Registry& cfg = this->GetConfig();
00102   if (cfg.Get("SliceListAlgorithm",tmps)) alg_name = tmps;
00103   if (cfg.Get("SliceListAlgConfig",tmps)) alg_config_name = tmps;
00104   if (cfg.Get("ListIn",tmps)) list_in = tmps;
00105   if (cfg.Get("ListOut",tmps)) list_out = tmps;
00106 
00107 // Find PrimaryCandidateRecord fragment in MOM.
00108    CandRecord *candrec = dynamic_cast<CandRecord *>
00109              (mom->GetFragment("CandRecord", "PrimaryCandidateRecord"));
00110    if (candrec == 0) {
00111      MSG("SliceSR", Msg::kWarning) << "No PrimaryCandidateRecord in MOM."
00112                                                                 << endl;
00113      result.SetWarning().SetFailed();
00114      return result;
00115    }
00116 
00117 // Find CandStripList fragment in PrimaryCandidateRecord.
00118    CandStripListHandle *cslh = dynamic_cast<CandStripListHandle *>
00119       (candrec->FindCandHandle("", list_in));
00120 
00121 // Require number of CandStrips to be non-zero.
00122    if (!cslh || cslh->GetNDaughters() < 1) {
00123      result.SetFailed();
00124      return result;
00125    }
00126 
00127    AlgFactory &af = AlgFactory::GetInstance();
00128 
00129 // Build a CandSliceList containing all CandSlice's in Frame.
00130    AlgHandle adlh = af.GetAlgHandle(alg_name,alg_config_name);
00131    CandContext cx(this, mom);
00132    cx.SetDataIn(cslh);
00133    cx.SetCandRecord(candrec);
00134    CandSliceListHandle csllh = CandSliceList::MakeCandidate(adlh, cx);
00135    csllh.SetName(list_out);
00136    csllh.SetTitle(TString("Created by SliceListModule from ").
00137                  Append(cslh->GetName()));
00138    candrec->SecureCandHandle(csllh);
00139 
00140    return result;
00141 }


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1