ATLAS Offline Software
Public Member Functions | List of all members
top::TopEventReconstructionToolsLoader Class Reference

Load a ttbar event reconstruction code based on the same. More...

#include <TopEventReconstructionToolsLoader.h>

Inheritance diagram for top::TopEventReconstructionToolsLoader:
Collaboration diagram for top::TopEventReconstructionToolsLoader:

Public Member Functions

top::EventSelectorBaseinitTool (const std::string &name, const std::string &line, TFile *outputFile, std::shared_ptr< top::TopConfig > config, EL::Worker *wk=nullptr)
 Some sort of factory that can create the tool you need given a string. More...
 
 ClassDef (top::ToolLoaderBase, 0)
 

Detailed Description

Load a ttbar event reconstruction code based on the same.

Names for reconstruction (rather than selection) should start with "RECO:" so that we can tell them apart.

Why is this a class? So that ROOT can load it at run-time! The only important function is the initTool one, after that has been called then this class can be safely disposed of.

Note that the name of this tool is the name of the package with the word Loader after it. That's important so the main code can find the tools that this package provides! For the same reason it inherits from top::ToolLoaderBase.

Definition at line 27 of file TopEventReconstructionToolsLoader.h.

Member Function Documentation

◆ ClassDef()

top::ToolLoaderBase::ClassDef ( top::ToolLoaderBase  ,
 
)
inherited

◆ initTool()

top::EventSelectorBase * top::TopEventReconstructionToolsLoader::initTool ( const std::string &  name,
const std::string &  line,
TFile *  outputFile,
std::shared_ptr< top::TopConfig config,
EL::Worker wk = nullptr 
)
virtual

Some sort of factory that can create the tool you need given a string.

Parameters
nameThe name of the tool to load, e.g. RECO:KLFITTERLJETS.
lineNot used here yet, but could be used to send configuration options to the tool.
configThe TopConfig object, which is needed by the KLFitterTool
outputFileNot used here, but could be used so the tool has direct access to the output file.
wkNot used, but needed by EventLoop for some of the selection tools.
Returns
A pointer to a fully initialised and ready to use tool.

Implements top::ToolLoaderBase.

Definition at line 14 of file TopEventReconstructionToolsLoader.cxx.

17  {
18  //get the first bit of the string and store it in toolname
19  std::istringstream iss(line);
20  std::string toolname;
21  getline(iss, toolname, ' ');
22 
23  //any parameters?
24  std::string param;
25  if (line.size() > toolname.size()) param = line.substr(toolname.size() + 1);
26 
27  if (toolname == "RECO::SONNENSCHEIN") return new top::Sonnenschein();
28 
29  else if (toolname == "RECO::KLFITTERRUN") {
30  loadLibraries("libKLFitter");
31  return new top::KLFitterRun(name, param, config);
32  } else if (toolname == "RECO::PSEUDOTOP") {
33  return new top::PseudoTopRecoRun(param, config);
34  }
35 
36 
37  return nullptr;
38  }

The documentation for this class was generated from the following files:
checkFileSG.line
line
Definition: checkFileSG.py:75
top::loadLibraries
void loadLibraries(const std::string &libraryNames)
So that we can load external libraries with (1) extra event selection tools in, (2) user defined obje...
Definition: Tools.cxx:275
top::Sonnenschein
An AnalysisTop friendly wrapper for the Sonnenschein reconstruction that is implemented in Sonnensche...
Definition: Sonnenschein.h:20
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
top::KLFitterRun
Definition: KLFitterRun.h:16
python.hypoToolDisplay.toolname
def toolname(tool)
Definition: hypoToolDisplay.py:13
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
top::PseudoTopRecoRun
Definition: PseudoTopRecoRun.h:15