RandomClusteringAlgorithm class.
More...
#include "RandomClusteringAlgorithm.h"
|
pandora::StatusCode | Run () |
|
pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle) |
|
lar_content::RandomClusteringAlgorithm::RandomClusteringAlgorithm |
( |
| ) |
|
|
default |
lar_content::RandomClusteringAlgorithm::~RandomClusteringAlgorithm |
( |
| ) |
|
|
default |
StatusCode lar_content::RandomClusteringAlgorithm::ReadSettings |
( |
const pandora::TiXmlHandle |
xmlHandle | ) |
|
|
private |
Definition at line 62 of file RandomClusteringAlgorithm.cc.
64 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle,
"NumNewClusters",
m_numNewClusters));
66 return STATUS_CODE_INVALID_PARAMETER;
68 return STATUS_CODE_SUCCESS;
unsigned int m_numNewClusters
Number of new random clusters to generate from original cluster list.
StatusCode lar_content::RandomClusteringAlgorithm::Run |
( |
| ) |
|
|
private |
Definition at line 24 of file RandomClusteringAlgorithm.cc.
26 const CaloHitList *pCaloHits{
nullptr};
27 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetCurrentList(*
this, pCaloHits));
30 return STATUS_CODE_SUCCESS;
32 std::vector<unsigned int> idxs, splitIdxs;
33 for (
unsigned int i = 0; i < pCaloHits->size(); i++)
35 std::shuffle(idxs.begin(), idxs.end(), std::default_random_engine(0));
37 splitIdxs.emplace_back(idxs.at(i));
38 std::sort(splitIdxs.begin(), splitIdxs.end());
41 PandoraContentApi::Cluster::Parameters params;
43 for (
const CaloHit *
const pCaloHit : *pCaloHits)
45 if (splitItr != splitIdxs.cend() && cntr++ > *splitItr)
47 const Cluster *pCluster{
nullptr};
48 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::Cluster::Create(*
this, params, pCluster));
49 params.m_caloHitList.clear();
52 params.m_caloHitList.emplace_back(pCaloHit);
54 const Cluster *pCluster{
nullptr};
55 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::Cluster::Create(*
this, params, pCluster));
57 return STATUS_CODE_SUCCESS;
unsigned int m_numNewClusters
Number of new random clusters to generate from original cluster list.
unsigned int lar_content::RandomClusteringAlgorithm::m_numNewClusters |
|
private |
The documentation for this class was generated from the following files: