ATLAS Offline Software
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
Trk::ClusterSplitProbabilityContainer Class Reference

Container to associate Cluster with cluster splitting probabilities. More...

#include <ClusterSplitProbabilityContainer.h>

Collaboration diagram for Trk::ClusterSplitProbabilityContainer:

Classes

struct  ProbabilityInfo
 

Public Types

using ClusterIdentifier = unsigned int
 

Public Member Functions

const ProbabilityInfosplitProbability (const PrepRawData *cluster) const
 
ProbabilityInfogetSplitProbability (const PrepRawData *cluster)
 
ProbabilityInfosetSplitInformation (const PrepRawData *cluster, float prob1, float prob2)
 
void setTooBigToBeSplit (const PrepRawData *cluster)
 
const std::unordered_map< ClusterIdentifier, ProbabilityInfo > & splitProbMap () const
 

Static Public Member Functions

static const ProbabilityInfogetNoSplitProbability ()
 

Protected Attributes

std::unordered_map< ClusterIdentifier, ProbabilityInfom_splitProbMap
 

Static Protected Attributes

static const ProbabilityInfo s_unset
 

Friends

class ClusterSplitProbabilityContainerCnv_p1
 

Detailed Description

Container to associate Cluster with cluster splitting probabilities.

Definition at line 16 of file ClusterSplitProbabilityContainer.h.

Member Typedef Documentation

◆ ClusterIdentifier

Definition at line 20 of file ClusterSplitProbabilityContainer.h.

Member Function Documentation

◆ getNoSplitProbability()

static const ProbabilityInfo& Trk::ClusterSplitProbabilityContainer::getNoSplitProbability ( )
inlinestatic

Definition at line 33 of file ClusterSplitProbabilityContainer.h.

33 {return s_unset; }

◆ getSplitProbability()

ProbabilityInfo* Trk::ClusterSplitProbabilityContainer::getSplitProbability ( const PrepRawData cluster)
inline

Definition at line 40 of file ClusterSplitProbabilityContainer.h.

40  {
41  assert(cluster);
42  std::unordered_map<ClusterIdentifier, ProbabilityInfo>::iterator iter = m_splitProbMap.find(cluster->getHashAndIndex().hashAndIndex());
43  return (iter != m_splitProbMap.end()) ? &iter->second : nullptr;
44  }

◆ setSplitInformation()

ProbabilityInfo& Trk::ClusterSplitProbabilityContainer::setSplitInformation ( const PrepRawData cluster,
float  prob1,
float  prob2 
)
inline

Definition at line 45 of file ClusterSplitProbabilityContainer.h.

45  {
46  assert(cluster);
47  // @TODO remove the precision clipping, which is currently implemented here to produce identical results wrt. the current version.
48  constexpr int splitmask = 0x7fff;
49  prob1 = int(prob1 * splitmask)/(1.*splitmask);
50  prob2 = int(prob2 * splitmask)/(1.*splitmask);
52  ret = m_splitProbMap.insert( std::make_pair( cluster->getHashAndIndex().hashAndIndex(), ProbabilityInfo(prob1, prob2) ) );
53  if (!ret.second) {
54  std::unordered_map<ClusterIdentifier, ProbabilityInfo>::iterator iter = m_splitProbMap.find(cluster->getHashAndIndex().hashAndIndex());
55  if (iter == m_splitProbMap.end()) {
56  throw std::runtime_error("Failed to set cluster splitting probability.");
57  }
58  iter->second.updateSplitProbabilities(prob1,prob2);
59  return iter->second;
60  }
61  else {
62  return ret.first->second;
63  }
64  }

◆ setTooBigToBeSplit()

void Trk::ClusterSplitProbabilityContainer::setTooBigToBeSplit ( const PrepRawData cluster)
inline

Definition at line 65 of file ClusterSplitProbabilityContainer.h.

65  {
66  assert(cluster);
67  m_splitProbMap.insert( std::make_pair( cluster->getHashAndIndex().hashAndIndex(), ProbabilityInfo(-1.,-1.) ) );
68  }

◆ splitProbability()

const ProbabilityInfo& Trk::ClusterSplitProbabilityContainer::splitProbability ( const PrepRawData cluster) const
inline

Definition at line 35 of file ClusterSplitProbabilityContainer.h.

35  {
36  assert(cluster);
37  std::unordered_map<ClusterIdentifier, ProbabilityInfo>::const_iterator iter = m_splitProbMap.find(cluster->getHashAndIndex().hashAndIndex());
38  return (iter != m_splitProbMap.end()) ? iter->second : s_unset;
39  }

◆ splitProbMap()

const std::unordered_map<ClusterIdentifier, ProbabilityInfo>& Trk::ClusterSplitProbabilityContainer::splitProbMap ( ) const
inline

Definition at line 71 of file ClusterSplitProbabilityContainer.h.

72  {
73  return m_splitProbMap;
74  }

Friends And Related Function Documentation

◆ ClusterSplitProbabilityContainerCnv_p1

Definition at line 18 of file ClusterSplitProbabilityContainer.h.

Member Data Documentation

◆ m_splitProbMap

std::unordered_map<ClusterIdentifier, ProbabilityInfo> Trk::ClusterSplitProbabilityContainer::m_splitProbMap
protected

Definition at line 77 of file ClusterSplitProbabilityContainer.h.

◆ s_unset

const Trk::ClusterSplitProbabilityContainer::ProbabilityInfo Trk::ClusterSplitProbabilityContainer::s_unset
staticprotected

Definition at line 78 of file ClusterSplitProbabilityContainer.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
Trk::ClusterSplitProbabilityContainer::s_unset
static const ProbabilityInfo s_unset
Definition: ClusterSplitProbabilityContainer.h:78
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
Trk::ClusterSplitProbabilityContainer::m_splitProbMap
std::unordered_map< ClusterIdentifier, ProbabilityInfo > m_splitProbMap
Definition: ClusterSplitProbabilityContainer.h:77