All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LArMvaHelper.cc
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/include/LArHelpers/LArMvaHelper.cc
3  *
4  * @brief Implementation for the lar mva helper class.
5  *
6  * $Log: $
7  */
8 
10 
11 using namespace pandora;
12 
13 namespace lar_content
14 {
15 
16 StatusCode LArMvaHelper::ProcessAlgorithmToolListToMap(const Algorithm &algorithm, const TiXmlHandle &xmlHandle,
17  const std::string &listName, StringVector &algorithmToolNameVector, AlgorithmToolMap &algorithmToolMap)
18 {
19  // Fill a vector with names in the desired run order as well as the map
20 
21  if ("algorithm" != xmlHandle.ToNode()->ValueStr())
22  return STATUS_CODE_NOT_ALLOWED;
23 
24  const TiXmlHandle algorithmListHandle = TiXmlHandle(xmlHandle.FirstChild(listName).Element());
25 
26  for (TiXmlElement *pXmlElement = algorithmListHandle.FirstChild("tool").Element(); nullptr != pXmlElement;
27  pXmlElement = pXmlElement->NextSiblingElement("tool"))
28  {
29  AlgorithmTool *pAlgorithmTool(nullptr);
30  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::CreateAlgorithmTool(algorithm, pXmlElement, pAlgorithmTool));
31  std::string toolName = pXmlElement->Attribute("type");
32  // If already exists, then make the second have the instance name attached
33  if (algorithmToolMap.find(toolName) != algorithmToolMap.end())
34  toolName += "_" + pAlgorithmTool->GetInstanceName();
35  algorithmToolMap[toolName] = pAlgorithmTool;
36  algorithmToolNameVector.push_back(toolName);
37  }
38 
39  return STATUS_CODE_SUCCESS;
40 }
41 
42 } // namespace lar_content
std::map< std::string, pandora::AlgorithmTool * > AlgorithmToolMap
Definition: LArMvaHelper.h:76
required by fuzzyCluster table::sbnd_g4_services gaushitTruthMatch pandora
Definition: reco_sbnd.fcl:182