All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
lar_dl_content::DlTrackShowerStreamSelectionAlgorithm Class Reference

DlTrackShowerStreamSelectionAlgorithm class. More...

#include <DlTrackShowerStreamSelectionAlgorithm.h>

Inheritance diagram for lar_dl_content::DlTrackShowerStreamSelectionAlgorithm:
lar_content::StreamSelectionAlgorithm

Public Member Functions

 DlTrackShowerStreamSelectionAlgorithm ()=default
 Default constructor. More...
 
virtual ~DlTrackShowerStreamSelectionAlgorithm ()=default
 
- Public Member Functions inherited from lar_content::StreamSelectionAlgorithm
 StreamSelectionAlgorithm ()
 Default constructor. More...
 
virtual ~StreamSelectionAlgorithm ()=default
 

Protected Member Functions

virtual pandora::StatusCode AllocateToStreams (const pandora::Cluster *const pCluster)
 Allocate a cluster to the appropriate streams. More...
 
- Protected Member Functions inherited from lar_content::StreamSelectionAlgorithm
pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 

Private Member Functions

pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 

Private Attributes

std::string m_trackListName
 The name of the track list. More...
 
std::string m_showerListName
 The name of the shower list. More...
 

Additional Inherited Members

- Protected Types inherited from lar_content::StreamSelectionAlgorithm
typedef std::map< std::string,
pandora::ClusterList > 
ClusterListMap
 
- Protected Attributes inherited from lar_content::StreamSelectionAlgorithm
std::string m_inputListName
 The input list name if not using the current list. More...
 
std::string m_listType
 The type of the input lists (currently only Cluster is supported) More...
 
pandora::StringVector m_listNames
 The name of the output lists. More...
 
ClusterListMap m_clusterListMap
 The map from cluster list names to cluster lists. More...
 

Detailed Description

DlTrackShowerStreamSelectionAlgorithm class.

Definition at line 21 of file DlTrackShowerStreamSelectionAlgorithm.h.

Constructor & Destructor Documentation

lar_dl_content::DlTrackShowerStreamSelectionAlgorithm::DlTrackShowerStreamSelectionAlgorithm ( )
default

Default constructor.

virtual lar_dl_content::DlTrackShowerStreamSelectionAlgorithm::~DlTrackShowerStreamSelectionAlgorithm ( )
virtualdefault

Member Function Documentation

StatusCode lar_dl_content::DlTrackShowerStreamSelectionAlgorithm::AllocateToStreams ( const pandora::Cluster *const  pCluster)
protectedvirtual

Allocate a cluster to the appropriate streams.

Parameters
pClusterThe cluster to allocate to a stream
Returns
The StatusCode

Implements lar_content::StreamSelectionAlgorithm.

Definition at line 26 of file DlTrackShowerStreamSelectionAlgorithm.cc.

27 {
28  const OrderedCaloHitList &orderedCaloHitList{pCluster->GetOrderedCaloHitList()};
29  CaloHitList caloHits;
30  orderedCaloHitList.FillCaloHitList(caloHits);
31  const CaloHitList &isolatedHits{pCluster->GetIsolatedCaloHitList()};
32  caloHits.insert(caloHits.end(), isolatedHits.begin(), isolatedHits.end());
33  FloatVector trackLikelihoods;
34  try
35  {
36  for (const CaloHit *pCaloHit : caloHits)
37  {
38  const LArCaloHit *pLArCaloHit{dynamic_cast<const LArCaloHit *>(pCaloHit)};
39  const float pTrack{pLArCaloHit->GetTrackProbability()};
40  const float pShower{pLArCaloHit->GetShowerProbability()};
41  if ((pTrack + pShower) > std::numeric_limits<float>::epsilon())
42  trackLikelihoods.emplace_back(pTrack / (pTrack + pShower));
43  }
44 
45  const unsigned long N{trackLikelihoods.size()};
46  if (N > 0)
47  {
48  float mean{std::accumulate(std::begin(trackLikelihoods), std::end(trackLikelihoods), 0.f) / N};
49  if (mean >= 0.5f)
50  m_clusterListMap.at(m_trackListName).emplace_back(pCluster);
51  else
52  m_clusterListMap.at(m_showerListName).emplace_back(pCluster);
53  }
54  }
55  catch (const StatusCodeException &)
56  {
57  }
58 
59  return STATUS_CODE_SUCCESS;
60 }
LAr calo hit class.
Definition: LArCaloHit.h:39
auto end(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:585
auto begin(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:573
double mean(const std::vector< short > &wf, size_t start, size_t nsample)
Definition: UtilFunc.cxx:13
process_name largeant stream1 can override from command line with o or output physics producers generator N
ClusterListMap m_clusterListMap
The map from cluster list names to cluster lists.
float GetTrackProbability() const
Get the probability that the hit is track-like.
Definition: LArCaloHit.h:210
StatusCode lar_dl_content::DlTrackShowerStreamSelectionAlgorithm::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
private

Definition at line 63 of file DlTrackShowerStreamSelectionAlgorithm.cc.

64 {
65  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, StreamSelectionAlgorithm::ReadSettings(xmlHandle));
66  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "TrackListName", m_trackListName));
67  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "ShowerListName", m_showerListName));
68 
69  m_listNames.emplace_back(m_trackListName);
70  m_listNames.emplace_back(m_showerListName);
71 
72  return STATUS_CODE_SUCCESS;
73 }
pandora::StringVector m_listNames
The name of the output lists.

Member Data Documentation

std::string lar_dl_content::DlTrackShowerStreamSelectionAlgorithm::m_showerListName
private

The name of the shower list.

Definition at line 45 of file DlTrackShowerStreamSelectionAlgorithm.h.

std::string lar_dl_content::DlTrackShowerStreamSelectionAlgorithm::m_trackListName
private

The name of the track list.

Definition at line 44 of file DlTrackShowerStreamSelectionAlgorithm.h.


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