ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
InDet::TruthPixelClusterSplitProbTool Class Referencefinal

#include <TruthPixelClusterSplitProbTool.h>

Inheritance diagram for InDet::TruthPixelClusterSplitProbTool:
Collaboration diagram for InDet::TruthPixelClusterSplitProbTool:

Public Member Functions

 TruthPixelClusterSplitProbTool (const std::string &t, const std::string &n, const IInterface *p)
 
virtual ~TruthPixelClusterSplitProbTool ()=default
 
virtual StatusCode initialize () override
 
virtual InDet::PixelClusterSplitProb splitProbability (const InDet::PixelCluster &origCluster) const override
 
virtual InDet::PixelClusterSplitProb splitProbability (const InDet::PixelCluster &origCluster, const Trk::TrackParameters &trackParameters) const override
 

Private Member Functions

InDet::PixelClusterSplitProb compileSplitProbability (std::vector< double > &vectorOfProbs) const
 

Private Attributes

ToolHandle< TruthClusterizationFactorym_truthClusterizationFactory {this, "NnClusterizationFactory", "InDet::NnClusterizationFactory/TruthClusterizationFactory"}
 
DoubleArrayProperty m_priorMultiplicityContent {this, "PriorMultiplicityContent", {2793337, 82056, 19944}}
 

Detailed Description

Definition at line 32 of file TruthPixelClusterSplitProbTool.h.

Constructor & Destructor Documentation

◆ TruthPixelClusterSplitProbTool()

InDet::TruthPixelClusterSplitProbTool::TruthPixelClusterSplitProbTool ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 27 of file TruthPixelClusterSplitProbTool.cxx.

28  :base_class(t,n,p)
29  {
30  declareInterface<IPixelClusterSplitProbTool>(this);
31  }

◆ ~TruthPixelClusterSplitProbTool()

virtual InDet::TruthPixelClusterSplitProbTool::~TruthPixelClusterSplitProbTool ( )
virtualdefault

Member Function Documentation

◆ compileSplitProbability()

InDet::PixelClusterSplitProb InDet::TruthPixelClusterSplitProbTool::compileSplitProbability ( std::vector< double > &  vectorOfProbs) const
private

Definition at line 100 of file TruthPixelClusterSplitProbTool.cxx.

101  {
102 
103 
104  double sum=0;
105 
106  std::vector<double>::iterator begin=vectorOfProbs.begin();
107  std::vector<double>::iterator end=vectorOfProbs.end();
108 
109  for (std::vector<double>::iterator iter=begin;iter!=end;++iter)
110  {
111  sum+=*iter;
112  }
113 
114 
115  ATH_MSG_VERBOSE(" Sum of cluster probabilities is: "<<sum);
116 
117  std::vector<double> vectorOfSplitProbs;
118 
119  for (std::vector<double>::iterator iter=begin;iter!=end;++iter)
120  {
121  (*iter)/=sum;
122  }
123 
124  if (m_priorMultiplicityContent.size()<vectorOfProbs.size())
125  {
126  ATH_MSG_ERROR("Prior compatibilities count " << m_priorMultiplicityContent.size() << " is too small: please correct through job properties.");
127  return InDet::PixelClusterSplitProb(std::vector<double>());
128  }
129 
130  double psum=0;
131  int count=0;
132  for (std::vector<double>::iterator iter=begin;iter!=end;++iter,++count)
133  {
134  psum+=(*iter)/m_priorMultiplicityContent[count];
135  }
136 
137  count=0;
138  for (std::vector<double>::iterator iter=begin;iter!=end;++iter,++count)
139  {
141  (*iter)/=psum;
142  }
143 
144  double sumTest=0;
145 
146  for (std::vector<double>::iterator iter=begin;iter!=end;++iter)
147  {
148  ATH_MSG_VERBOSE("After update prob is: " << *iter);
149  sumTest+=*iter;
150  }
151 
152  ATH_MSG_VERBOSE(" Sum of cluster probabilities is: "<<sumTest);
153  for (std::vector<double>::iterator iter=begin;iter!=end;++iter)
154  {
155  if (iter!=begin)
156  {
157  vectorOfSplitProbs.push_back(*iter);
158  }
159  }
160 
161  ATH_MSG_VERBOSE(" normalized P(1->2): " << vectorOfSplitProbs[0] << " P(2->3): " << vectorOfSplitProbs[1] );
162 
163  PixelClusterSplitProb clusterSplitProb(vectorOfSplitProbs);
164 
165  ATH_MSG_VERBOSE("SplitProb: " << clusterSplitProb.splitProbability(2) << " -->3 " << clusterSplitProb.splitProbability(3) );
166 
167  return clusterSplitProb;
168  }

◆ initialize()

StatusCode InDet::TruthPixelClusterSplitProbTool::initialize ( )
overridevirtual

Definition at line 34 of file TruthPixelClusterSplitProbTool.cxx.

35  {
36 
37  if (m_truthClusterizationFactory.retrieve().isFailure())
38  {
39  ATH_MSG_ERROR(" Unable to retrieve "<< m_truthClusterizationFactory );
40  return StatusCode::FAILURE;
41  }
42 
43  ATH_MSG_DEBUG(" Cluster split prob tool initialized successfully "<< m_truthClusterizationFactory );
44  return StatusCode::SUCCESS;
45  }

◆ splitProbability() [1/2]

InDet::PixelClusterSplitProb InDet::TruthPixelClusterSplitProbTool::splitProbability ( const InDet::PixelCluster origCluster) const
overridevirtual

Definition at line 48 of file TruthPixelClusterSplitProbTool.cxx.

49  {
50  std::vector<double> vectorOfProbs=m_truthClusterizationFactory->estimateNumberOfParticles(origCluster);
51 
52  ATH_MSG_VERBOSE(" Got splitProbability, size of vector: " << vectorOfProbs.size() );
53 
54  if (vectorOfProbs.empty())
55  {
56  std::vector<double> vectorOfSplitProbs;
57  vectorOfSplitProbs.push_back(-100);
58  PixelClusterSplitProb clusterSplitProb(vectorOfSplitProbs);
59  ATH_MSG_VERBOSE(" Returning single split prob equal to -100 " );
60  return clusterSplitProb;
61  }
62 
63 
65  " P(1): " << vectorOfProbs[0] <<
66  " P(2): " << vectorOfProbs[1] <<
67  " P(>=3): " << vectorOfProbs[2] );
68 
69 
70  return compileSplitProbability(vectorOfProbs);
71  }

◆ splitProbability() [2/2]

InDet::PixelClusterSplitProb InDet::TruthPixelClusterSplitProbTool::splitProbability ( const InDet::PixelCluster origCluster,
const Trk::TrackParameters trackParameters 
) const
overridevirtual

Definition at line 73 of file TruthPixelClusterSplitProbTool.cxx.

74  {
75  std::vector<double> vectorOfProbs=m_truthClusterizationFactory->estimateNumberOfParticles(origCluster);
76 
77  ATH_MSG_VERBOSE(" Got splitProbability, size of vector: " << vectorOfProbs.size() );
78 
79  if (vectorOfProbs.empty())
80  {
81  std::vector<double> vectorOfSplitProbs;
82  vectorOfSplitProbs.push_back(-100);
83  PixelClusterSplitProb clusterSplitProb(vectorOfSplitProbs);
84  ATH_MSG_VERBOSE(" Returning single split prob equal to -100 " );
85  return clusterSplitProb;
86  }
87 
88 
90  " P(1): " << vectorOfProbs[0] <<
91  " P(2): " << vectorOfProbs[1] <<
92  " P(>=3): " << vectorOfProbs[2] );
93 
94 
95  return compileSplitProbability(vectorOfProbs);
96  }

Member Data Documentation

◆ m_priorMultiplicityContent

DoubleArrayProperty InDet::TruthPixelClusterSplitProbTool::m_priorMultiplicityContent {this, "PriorMultiplicityContent", {2793337, 82056, 19944}}
private

Definition at line 55 of file TruthPixelClusterSplitProbTool.h.

◆ m_truthClusterizationFactory

ToolHandle<TruthClusterizationFactory> InDet::TruthPixelClusterSplitProbTool::m_truthClusterizationFactory {this, "NnClusterizationFactory", "InDet::NnClusterizationFactory/TruthClusterizationFactory"}
private

Definition at line 53 of file TruthPixelClusterSplitProbTool.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
InDet::PixelClusterSplitProb
Definition: PixelClusterSplitProb.h:25
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
InDet::TruthPixelClusterSplitProbTool::m_priorMultiplicityContent
DoubleArrayProperty m_priorMultiplicityContent
Definition: TruthPixelClusterSplitProbTool.h:55
InDet::TruthPixelClusterSplitProbTool::compileSplitProbability
InDet::PixelClusterSplitProb compileSplitProbability(std::vector< double > &vectorOfProbs) const
Definition: TruthPixelClusterSplitProbTool.cxx:100
InDet::TruthPixelClusterSplitProbTool::m_truthClusterizationFactory
ToolHandle< TruthClusterizationFactory > m_truthClusterizationFactory
Definition: TruthPixelClusterSplitProbTool.h:53