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

#include <NnPixelClusterSplitProbTool.h>

Inheritance diagram for InDet::NnPixelClusterSplitProbTool:
Collaboration diagram for InDet::NnPixelClusterSplitProbTool:

Public Member Functions

 NnPixelClusterSplitProbTool (const std::string &t, const std::string &n, const IInterface *p)
 
virtual ~NnPixelClusterSplitProbTool ()=default
 
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< NnClusterizationFactorym_NnClusterizationFactory { this, "NnClusterizationFactory", "InDet::NnClusterizationFactory/NnClusterizationFactory" }
 
SG::ReadCondHandleKey< InDet::BeamSpotDatam_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }
 
DoubleArrayProperty m_priorMultiplicityContent { this, "PriorMultiplicityContent", {2793337, 82056, 19944} }
 
BooleanProperty m_useBeamSpotInfo { this, "useBeamSpotInfo", true }
 

Detailed Description

Definition at line 34 of file NnPixelClusterSplitProbTool.h.

Constructor & Destructor Documentation

◆ NnPixelClusterSplitProbTool()

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

Definition at line 28 of file NnPixelClusterSplitProbTool.cxx.

29  :base_class(t,n,p)
30  {
31  }

◆ ~NnPixelClusterSplitProbTool()

virtual InDet::NnPixelClusterSplitProbTool::~NnPixelClusterSplitProbTool ( )
virtualdefault

Member Function Documentation

◆ compileSplitProbability()

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

Definition at line 117 of file NnPixelClusterSplitProbTool.cxx.

118  {
119 
120 
121  double sum=0;
122 
123  std::vector<double>::iterator begin=vectorOfProbs.begin();
124  std::vector<double>::iterator end=vectorOfProbs.end();
125 
126  for (std::vector<double>::iterator iter=begin;iter!=end;++iter)
127  {
128  sum+=*iter;
129  }
130 
131 
132  ATH_MSG_VERBOSE(" Sum of cluster probabilities is: "<<sum);
133 
134  std::vector<double> vectorOfSplitProbs;
135 
136  for (std::vector<double>::iterator iter=begin;iter!=end;++iter)
137  {
138  (*iter)/=sum;
139  }
140 
141  if (m_priorMultiplicityContent.value().size()<vectorOfProbs.size())
142  {
143  ATH_MSG_ERROR("Prior compatibilities count " << m_priorMultiplicityContent.value().size() << " is too small: please correct through job properties.");
144  return InDet::PixelClusterSplitProb(std::vector<double>());
145  }
146 
147  double psum=0;
148  int count=0;
149  for (std::vector<double>::iterator iter=begin;iter!=end;++iter,++count)
150  {
151  psum+=(*iter)/m_priorMultiplicityContent.value()[count];
152  }
153 
154  count=0;
155  for (std::vector<double>::iterator iter=begin;iter!=end;++iter,++count)
156  {
157  (*iter)/=m_priorMultiplicityContent.value()[count];
158  (*iter)/=psum;
159  }
160 
161  double sumTest=0;
162 
163  for (std::vector<double>::iterator iter=begin;iter!=end;++iter)
164  {
165  ATH_MSG_VERBOSE("After update prob is: " << *iter);
166  sumTest+=*iter;
167  }
168 
169  ATH_MSG_VERBOSE(" Sum of cluster probabilities is: "<<sumTest);
170  for (std::vector<double>::iterator iter=begin;iter!=end;++iter)
171  {
172  if (iter!=begin)
173  {
174  vectorOfSplitProbs.push_back(*iter);
175  }
176  }
177 
178  ATH_MSG_VERBOSE(" normalized P(1->2): " << vectorOfSplitProbs[0] << " P(2->3): " << vectorOfSplitProbs[1] );
179 
180  PixelClusterSplitProb clusterSplitProb(vectorOfSplitProbs);
181 
182  ATH_MSG_VERBOSE("SplitProb: " << clusterSplitProb.splitProbability(2) << " -->3 " << clusterSplitProb.splitProbability(3) );
183 
184  return clusterSplitProb;
185  }

◆ initialize()

StatusCode InDet::NnPixelClusterSplitProbTool::initialize ( )
override

Definition at line 34 of file NnPixelClusterSplitProbTool.cxx.

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

◆ splitProbability() [1/2]

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

Definition at line 51 of file NnPixelClusterSplitProbTool.cxx.

52  {
53 
54  Amg::Vector3D beamSpotPosition(0,0,0);
57  beamSpotPosition = beamSpotHandle->beamPos();
58  }
59 
60  std::vector<double> vectorOfProbs=m_NnClusterizationFactory->estimateNumberOfParticles(origCluster,beamSpotPosition);
61 
62  ATH_MSG_VERBOSE(" Got splitProbability, size of vector: " << vectorOfProbs.size() );
63 
64  if (vectorOfProbs.empty())
65  {
66  std::vector<double> vectorOfSplitProbs;
67  vectorOfSplitProbs.push_back(-100);
68  PixelClusterSplitProb clusterSplitProb(vectorOfSplitProbs);
69  ATH_MSG_VERBOSE(" Returning single split prob equal to -100 " );
70  return clusterSplitProb;
71  }
72 
73 
75  " P(1): " << vectorOfProbs[0] <<
76  " P(2): " << vectorOfProbs[1] <<
77  " P(>=3): " << vectorOfProbs[2] );
78 
79 
80  return compileSplitProbability(vectorOfProbs);
81  }

◆ splitProbability() [2/2]

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

Definition at line 83 of file NnPixelClusterSplitProbTool.cxx.

84  {
85 
86  Amg::Vector3D beamSpotPosition(0,0,0);
89  beamSpotPosition = beamSpotHandle->beamPos();
90  }
91 
92  std::vector<double> vectorOfProbs=m_NnClusterizationFactory->estimateNumberOfParticles(origCluster, trackParameters.associatedSurface(), trackParameters);
93 
94  ATH_MSG_VERBOSE(" Got splitProbability, size of vector: " << vectorOfProbs.size() );
95 
96  if (vectorOfProbs.empty())
97  {
98  std::vector<double> vectorOfSplitProbs;
99  vectorOfSplitProbs.push_back(-100);
100  PixelClusterSplitProb clusterSplitProb(vectorOfSplitProbs);
101  ATH_MSG_VERBOSE(" Returning single split prob equal to -100 " );
102  return clusterSplitProb;
103  }
104 
105 
107  " P(1): " << vectorOfProbs[0] <<
108  " P(2): " << vectorOfProbs[1] <<
109  " P(>=3): " << vectorOfProbs[2] );
110 
111 
112  return compileSplitProbability(vectorOfProbs);
113  }

Member Data Documentation

◆ m_beamSpotKey

SG::ReadCondHandleKey<InDet::BeamSpotData> InDet::NnPixelClusterSplitProbTool::m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }
private

Definition at line 56 of file NnPixelClusterSplitProbTool.h.

◆ m_NnClusterizationFactory

ToolHandle<NnClusterizationFactory> InDet::NnPixelClusterSplitProbTool::m_NnClusterizationFactory { this, "NnClusterizationFactory", "InDet::NnClusterizationFactory/NnClusterizationFactory" }
private

Definition at line 55 of file NnPixelClusterSplitProbTool.h.

◆ m_priorMultiplicityContent

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

Definition at line 58 of file NnPixelClusterSplitProbTool.h.

◆ m_useBeamSpotInfo

BooleanProperty InDet::NnPixelClusterSplitProbTool::m_useBeamSpotInfo { this, "useBeamSpotInfo", true }
private

Definition at line 60 of file NnPixelClusterSplitProbTool.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
InDet::PixelClusterSplitProb
Definition: PixelClusterSplitProb.h:25
Trk::ParametersBase::associatedSurface
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
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
InDet::NnPixelClusterSplitProbTool::m_priorMultiplicityContent
DoubleArrayProperty m_priorMultiplicityContent
Definition: NnPixelClusterSplitProbTool.h:58
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::NnPixelClusterSplitProbTool::m_useBeamSpotInfo
BooleanProperty m_useBeamSpotInfo
Definition: NnPixelClusterSplitProbTool.h:60
InDet::NnPixelClusterSplitProbTool::m_beamSpotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Definition: NnPixelClusterSplitProbTool.h:56
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
InDet::NnPixelClusterSplitProbTool::compileSplitProbability
InDet::PixelClusterSplitProb compileSplitProbability(std::vector< double > &vectorOfProbs) const
Definition: NnPixelClusterSplitProbTool.cxx:117
InDet::NnPixelClusterSplitProbTool::m_NnClusterizationFactory
ToolHandle< NnClusterizationFactory > m_NnClusterizationFactory
Definition: NnPixelClusterSplitProbTool.h:55
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47