FitTrackSAListModule Class Reference

#include <FitTrackSAListModule.h>

Inheritance diagram for FitTrackSAListModule:
JobCModule

List of all members.

Public Member Functions

 FitTrackSAListModule ()
 ~FitTrackSAListModule ()
void BeginJob ()
void EndJob ()
JobCResult Ana (const MomNavigator *mom)
JobCResult Reco (MomNavigator *mom)
const RegistryDefaultConfig () const

Detailed Description

Job module that runs AlgFitTrackSA track fitter.

Author:
Sergei avva@fnal.gov

Definition at line 18 of file FitTrackSAListModule.h.


Constructor & Destructor Documentation

FitTrackSAListModule::FitTrackSAListModule (  ) 

ctor

Definition at line 44 of file FitTrackSAListModule.cxx.

00045 {
00046     TracerSA trace("FitTrackSAListModule::FitTrackSAListModule()");
00047 }

FitTrackSAListModule::~FitTrackSAListModule (  ) 

dtor

Definition at line 52 of file FitTrackSAListModule.cxx.

00053 {
00054     TracerSA trace("FitTrackSAListModule::~FitTrackSAListModule()");
00055 }


Member Function Documentation

JobCResult FitTrackSAListModule::Ana ( const MomNavigator mom  )  [virtual]

Analysis method

Reimplemented from JobCModule.

Definition at line 75 of file FitTrackSAListModule.cxx.

References JobCResult::kPassed.

00076 {
00077     TracerSA trace("FitTrackSAListModule::Ana(const MomNavigator*)");
00078     
00079     JobCResult result(JobCResult::kPassed);
00080     return result;
00081 }

void FitTrackSAListModule::BeginJob ( void   )  [virtual]

BeginJob

Reimplemented from JobCModule.

Definition at line 61 of file FitTrackSAListModule.cxx.

00062 {}

const Registry & FitTrackSAListModule::DefaultConfig ( void   )  const [virtual]

DefaultConfig - creates Registry object that contains default configuration for FitTrackSAListModule

Reimplemented from JobCModule.

Definition at line 148 of file FitTrackSAListModule.cxx.

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

00149 {
00150     static bool been_here = false;
00151     static Registry def_cfg;
00152     if (been_here) return def_cfg;
00153     
00154     been_here = true;
00155 
00156     string name = this->JobCModule::GetName();
00157     name += ".config.default";
00158     def_cfg.SetName(name.c_str());
00159 
00160     // Set defaults
00161     def_cfg.Set("FitTrackSAListAlgorithm","AlgFitTrackSAList");
00162     def_cfg.Set("FitTrackSAListAlgConfig","default");
00163     def_cfg.Set("ListIn","CandTrackSRList");
00164     def_cfg.Set("ListOut","CandFitTrackSAList");
00165 
00166     return def_cfg;
00167 }

void FitTrackSAListModule::EndJob (  )  [virtual]

EndJob

Reimplemented from JobCModule.

Definition at line 68 of file FitTrackSAListModule.cxx.

00069 {}

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

Reco method - calls track fitting algorithm

Reimplemented from JobCModule.

Definition at line 86 of file FitTrackSAListModule.cxx.

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

00087 {
00088     TracerSA trace("FitTrackSAListModule::Reco(MomNavigator*)");    
00089 
00090     //JobCResult result(JobCResult::kPassed);
00091    
00092     CandRecord* cndrec = dynamic_cast<CandRecord*>
00093         (mom->GetFragment("CandRecord","PrimaryCandidateRecord"));
00094     if (!cndrec) {
00095         MSG("FitTrackSA",Msg::kWarning) 
00096             << "No PrimaryCandidateRecord in Mom" << endl;
00097         //result.SetWarning().SetFailed();
00098         return JobCResult::kPassed;
00099     }
00100 
00101     CandTrackListHandle* ctlh = dynamic_cast<CandTrackListHandle *>
00102         (cndrec->FindCandHandle("",GetConfig().GetCharString("ListIn")));
00103     if ( !ctlh ) {
00104         MSG("FitTrackSA", Msg::kWarning) << "CandTrackList " 
00105             << GetConfig().GetCharString("ListIn") 
00106             << " not found in the candidate record!" << endl;
00107         //result.SetWarning().SetFailed();
00108         //return result;
00109         return JobCResult::kPassed;
00110     }
00111 
00112     // Require number of CandTracks to be non-zero.
00113     if ( ctlh->GetNDaughters() < 1) {
00114         MSG("FitTrackSA", Msg::kDebug) << "List " 
00115             << GetConfig().GetCharString("ListIn") 
00116             << " does not contain any tracks!" << endl;
00117         return JobCResult::kPassed;
00118     }
00119 
00120     // create CandContext
00121     CandContext trackListContext(this, mom);
00122     // set CandTrackListHandle* as the "context data"
00123     trackListContext.SetDataIn(ctlh);
00124     // set context CandRecord
00125     trackListContext.SetCandRecord(cndrec);
00126 
00127     AlgFactory &af = AlgFactory::GetInstance();
00128     AlgHandle aftlh = af.GetAlgHandle(
00129                         GetConfig().GetCharString("FitTrackSAListAlgorithm"), 
00130                         GetConfig().GetCharString("FitTrackSAListAlgConfig"));
00131 
00132     CandFitTrackListHandle cftlh = 
00133                     CandFitTrackList::MakeCandidate(aftlh, trackListContext);
00134 
00135     cftlh.SetName(GetConfig().GetCharString("ListOut"));
00136     cftlh.SetTitle( TString("Created by FitTrackSAListModule from ").
00137                                                     Append(ctlh->GetName()));
00138 
00139     cndrec->SecureCandHandle(cftlh);
00140     
00141     return JobCResult::kPassed;
00142 }


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1