FitShowerEMListModule Class Reference

#include <FitShowerEMListModule.h>

Inheritance diagram for FitShowerEMListModule:

JobCModule List of all members.

Public Member Functions

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

Detailed Description

Definition at line 12 of file FitShowerEMListModule.h.


Constructor & Destructor Documentation

FitShowerEMListModule::FitShowerEMListModule (  ) 

Definition at line 45 of file FitShowerEMListModule.cxx.

00046 {
00047   
00048 }

FitShowerEMListModule::~FitShowerEMListModule (  ) 

Definition at line 51 of file FitShowerEMListModule.cxx.

00052 {
00053 
00054 }


Member Function Documentation

void FitShowerEMListModule::BeginJob (  )  [virtual]

Implement for notification of begin of job

Reimplemented from JobCModule.

Definition at line 57 of file FitShowerEMListModule.cxx.

00058 {
00059 
00060 }

const Registry & FitShowerEMListModule::DefaultConfig (  )  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 64 of file FitShowerEMListModule.cxx.

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

00065 {
00066     
00067   static Registry def_cfg;
00068   static bool been_here = false;
00069   if(been_here) return def_cfg;
00070   been_here=true;
00071   
00072   std::string name = this->JobCModule::GetName();
00073   name += ".config.default";
00074   def_cfg.SetName(name.c_str());
00075   
00076   def_cfg.Set("FitShowerEMListAlgorithm","AlgFitShowerEMList");
00077   def_cfg.Set("FitShowerEMListAlgConfig","default");
00078   def_cfg.Set("ListIn","CandShowerEMList");
00079   def_cfg.Set("ListOut","CandFitShowerEMList");
00080   def_cfg.Set("LogLevel","Fatal");
00081   return def_cfg;
00082 
00083 }

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

Implement this for read-write access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 86 of file FitShowerEMListModule.cxx.

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

00087 {
00088 
00089    JobCResult result(JobCResult::kPassed); // The default result
00090 
00091    MSG("FitShowerEM", Msg::kVerbose) << "FitShowerEMListModule::Reco\n";
00092 
00093    // load configuration 
00094    const char* tmps = 0;
00095    const char* alg_name = 0;
00096    const char* alg_config_name = 0;
00097    const char* list_in = 0;
00098    const char* list_out = 0;
00099    
00100    Registry& cfg = this->GetConfig();
00101    if (cfg.Get("FitShowerEMListAlgorithm",tmps)) alg_name = tmps;
00102    if (cfg.Get("FitShowerEMListAlgConfig",tmps)) alg_config_name = tmps;
00103    if (cfg.Get("ListIn",tmps)) list_in = tmps;
00104    if (cfg.Get("ListOut",tmps)) list_out = tmps;   
00105 
00106    // Find PrimaryCandidateRecord fragment in MOM.
00107    CandRecord *candrec = dynamic_cast<CandRecord *>
00108      (mom->GetFragment("CandRecord", "PrimaryCandidateRecord"));
00109    if (candrec == 0) {
00110      MSG("FitShowerEM", Msg::kWarning) << "No PrimaryCandidateRecord in MOM."
00111                                        << endl;
00112      result.SetWarning().SetFailed();
00113      return result;
00114    }
00115    
00116    // Find CandSliceList fragment in PrimaryCandidateRecord.
00117    CandSliceListHandle *cslh = dynamic_cast<CandSliceListHandle *>
00118      (candrec->FindCandHandle("CandSliceListHandle"));
00119    if (!cslh || cslh->GetNDaughters() < 1) {
00120      MSG("FitShowerEM", Msg::kDebug)
00121        << "Null CandSlice list.  Bail out of event." << endl;
00122      result.SetFailed();
00123      return result;
00124    }
00125    
00126    CandShowerEMListHandle *csemlh = dynamic_cast<CandShowerEMListHandle *>
00127      (candrec->FindCandHandle("CandShowerEMListHandle"));
00128    if (!csemlh || csemlh->GetNDaughters() < 1) {
00129      MSG("FitShowerEM", Msg::kDebug)
00130        << "Null CandShowerEM list.  Bail out of event." << endl;
00131      return result;
00132    }
00133    
00134    TObjArray cxin;
00135    cxin.Add(cslh);
00136    cxin.Add(csemlh);
00137    
00138    AlgFactory &af = AlgFactory::GetInstance();
00139    AlgHandle adlh = af.GetAlgHandle(alg_name,alg_config_name);
00140    CandContext cx(this, mom);
00141    cx.SetDataIn(&cxin);
00142    cx.SetCandRecord(candrec);
00143    CandFitShowerEMListHandle cfsemlh = 
00144      CandFitShowerEMList::MakeCandidate(adlh, cx);
00145    cfsemlh.SetName(list_out);
00146    cfsemlh.SetTitle(TString("Created by FitShowerEMListModule from ").
00147                     Append(csemlh->GetName()));
00148    candrec->SecureCandHandle(cfsemlh);
00149 
00150    return result;
00151 }


The documentation for this class was generated from the following files:
Generated on Thu Jul 10 22:52:45 2014 for loon by  doxygen 1.4.7