ShowerEMListModule Class Reference

#include <ShowerEMListModule.h>

Inheritance diagram for ShowerEMListModule:
JobCModule

List of all members.

Public Member Functions

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

Detailed Description

Definition at line 12 of file ShowerEMListModule.h.


Constructor & Destructor Documentation

ShowerEMListModule::ShowerEMListModule (  ) 

Definition at line 54 of file ShowerEMListModule.cxx.

00055 {
00056 
00057 }

ShowerEMListModule::~ShowerEMListModule (  ) 

Definition at line 60 of file ShowerEMListModule.cxx.

00061 {
00062 
00063 }


Member Function Documentation

void ShowerEMListModule::BeginJob ( void   )  [virtual]

Implement for notification of begin of job

Reimplemented from JobCModule.

Definition at line 66 of file ShowerEMListModule.cxx.

00067 {
00068 
00069 }

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

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

00072 { 
00073     
00074   static Registry def_cfg;
00075   static bool been_here = false;
00076   if(been_here) return def_cfg;
00077   been_here=true;
00078   
00079   std::string name = this->JobCModule::GetName();
00080   name += ".config.default";
00081   def_cfg.SetName(name.c_str());
00082   
00083   def_cfg.Set("ShowerEMListAlgorithm","AlgShowerEMList");
00084   def_cfg.Set("ShowerEMListAlgConfig","default");
00085   def_cfg.Set("ListIn","CandSliceList");
00086   def_cfg.Set("ClusterListIn","CandClusterList");
00087   def_cfg.Set("ListOut","CandShowerEMList");
00088   def_cfg.Set("LogLevel","Fatal");
00089   return def_cfg;
00090   
00091 }

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

Implement this for read-write access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 94 of file ShowerEMListModule.cxx.

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

00095 {
00096    JobCResult result(JobCResult::kPassed);
00097 
00098    MSG("ShowerEM", Msg::kVerbose) << "ShowerEMListModule::Reco\n";
00099 
00100    // load configuration 
00101    const char* tmps = 0;
00102    const char* alg_name = 0;
00103    const char* alg_config_name = 0;
00104    const char* list_in = 0;
00105    const char* cluster_list=0;
00106    const char* list_out = 0;
00107 
00108    Registry& cfg = this->GetConfig();
00109    if (cfg.Get("ShowerEMListAlgorithm",tmps)) alg_name = tmps;
00110    if (cfg.Get("ShowerEMListAlgConfig",tmps)) alg_config_name = tmps;
00111    if (cfg.Get("ListIn",tmps)) list_in = tmps;
00112    if (cfg.Get("ClusterListIn",tmps)) cluster_list = tmps;
00113    if (cfg.Get("ListOut",tmps)) list_out = tmps;   
00114 
00115    /*
00116    RawRecord *rr=dynamic_cast<RawRecord *> (mom->GetFragment("RawRecord",0,"DaqSnarl"));
00117    if (rr==0) { result.SetFailed(); return result; }
00118    
00119    const RawDaqSnarlHeader* snarlHdr =
00120      dynamic_cast<const RawDaqSnarlHeader*>(rr->GetRawHeader());
00121    if(snarlHdr){
00122      MSG("ShowerEM", Msg::kInfo) << "ShowerEMListModule::Reco Snarl "
00123                                  << snarlHdr->GetSnarl() << endl;
00124    }
00125    */
00126 
00127    // Find PrimaryCandidateRecord fragment in MOM.
00128    CandRecord *candrec = dynamic_cast<CandRecord *>
00129      (mom->GetFragment("CandRecord", "PrimaryCandidateRecord"));
00130    if (candrec == 0) {
00131      MSG("ShowerEM", Msg::kWarning) << "No PrimaryCandidateRecord in MOM."
00132                                     << endl;
00133      result.SetWarning().SetFailed();
00134      return result;
00135    }
00136 
00137    //(Re)Initialize VldContext in Calibrator   
00138    Calibrator::Instance().Reset(*candrec->GetVldContext());
00139 
00140    // Find CandSliceList fragment in PrimaryCandidateRecord.
00141    CandSliceListHandle *cslh = dynamic_cast<CandSliceListHandle *>
00142      (candrec->FindCandHandle("CandSliceListHandle")); 
00143    if(!cslh){
00144      MSG("ShowerEM", Msg::kDebug)
00145        << "Null CandSlice list.  Bail out of event." << endl;
00146      result.SetFailed();
00147      return result;
00148    }
00149 
00150    // Find CandClusterList fragment in PrimaryCandidateRecord.   
00151    CandClusterListHandle *cclh = dynamic_cast<CandClusterListHandle *>
00152      (candrec->FindCandHandle("CandClusterListHandle"));
00153    if(!cclh){
00154      MSG("ShowerEM", Msg::kDebug)
00155        << "Null CandCluster list.  Bail out of event." << endl;
00156      return result;
00157    }
00158 
00159    TObjArray cxin;
00160    cxin.Add(cslh);
00161    cxin.Add(cclh);
00162    
00163    AlgFactory &af = AlgFactory::GetInstance();
00164    AlgHandle adlh = af.GetAlgHandle(alg_name,alg_config_name);
00165    CandContext cx(this, mom);
00166    cx.SetDataIn(&cxin);
00167    cx.SetCandRecord(candrec);
00168    CandShowerEMListHandle csllh = CandShowerEMList::MakeCandidate(adlh, cx);
00169    csllh.SetName(list_out);
00170    csllh.SetTitle(TString("Created by ShowerEMListModule from ").
00171                   Append(cslh->GetName()));
00172    candrec->SecureCandHandle(csllh);
00173 
00174    return result;
00175 }


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1