ATLAS Offline Software
Loading...
Searching...
No Matches
ToolHandleHistoHelper::HistoRetriever Struct Reference

#include <ToolHandleHistoHelper.h>

Collaboration diagram for ToolHandleHistoHelper::HistoRetriever:

Public Member Functions

std::string afterlastdot (const std::string &s)
 HistoRetriever (ToolHandleArray< HistoDefinitionTool > &h)
HistoDefinitionToolretrieveTool (const std::string &n)
template<typename T>
T * build (const std::string &n)

Public Attributes

ToolHandleArray< HistoDefinitionTool > & histos

Detailed Description

Definition at line 26 of file ToolHandleHistoHelper.h.

Constructor & Destructor Documentation

◆ HistoRetriever()

ToolHandleHistoHelper::HistoRetriever::HistoRetriever ( ToolHandleArray< HistoDefinitionTool > & h)
inline

Definition at line 33 of file ToolHandleHistoHelper.h.

33: histos(h) {}
ToolHandleArray< HistoDefinitionTool > & histos

Member Function Documentation

◆ afterlastdot()

std::string ToolHandleHistoHelper::HistoRetriever::afterlastdot ( const std::string & s)
inline

Definition at line 28 of file ToolHandleHistoHelper.h.

28 {
29 size_t i = s.find_last_of(".");
30 return s.substr( i+1, s.size() );
31 }

◆ build()

template<typename T>
T * ToolHandleHistoHelper::HistoRetriever::build ( const std::string & n)
inline

Definition at line 44 of file ToolHandleHistoHelper.h.

44 {
45 std::string name = "hdef_"; name+=n;
46 HistoDefinitionTool* tool = retrieveTool(name);
47 if (!tool ) return NULL;
48 return tool->build<T>();
49 }
unsigned long long T
HistoDefinitionTool * retrieveTool(const std::string &n)

◆ retrieveTool()

HistoDefinitionTool * ToolHandleHistoHelper::HistoRetriever::retrieveTool ( const std::string & n)
inline

Definition at line 35 of file ToolHandleHistoHelper.h.

35 {
36 for( auto toolH : histos){
37 //std::cout << " xxxx compare "<< afterlastdot( toolH->name() ) << " to "<< n <<std::endl;
38 if( afterlastdot(toolH->name()) == n ) return toolH.operator->();
39 }
40 return NULL;
41 }
std::string afterlastdot(const std::string &s)

Member Data Documentation

◆ histos

ToolHandleArray<HistoDefinitionTool>& ToolHandleHistoHelper::HistoRetriever::histos

Definition at line 52 of file ToolHandleHistoHelper.h.


The documentation for this struct was generated from the following file: