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

#include <NnPixelClusterSplitter.h>

Inheritance diagram for InDet::NnPixelClusterSplitter:
Collaboration diagram for InDet::NnPixelClusterSplitter:

Public Member Functions

 NnPixelClusterSplitter (const std::string &type, const std::string &name, const IInterface *parent)
 Constructor. More...
 
 ~NnPixelClusterSplitter ()=default
 Destructor. More...
 
virtual StatusCode initialize () override
 AthAlgTool interface methods. More...
 
virtual StatusCode finalize () override
 
virtual std::vector< InDet::PixelClusterPartssplitCluster (const InDet::PixelCluster &origCluster) const override
 take one, give zero or many More...
 
virtual std::vector< InDet::PixelClusterPartssplitCluster (const InDet::PixelCluster &origCluster, const InDet::PixelClusterSplitProb &spo) const override
 take one, give zero or many - with split probability object More...
 

Private Attributes

ToolHandle< NnClusterizationFactorym_NnClusterizationFactory { this, "NnClusterizationFactory", "InDet::NnClusterizationFactory/NnClusterizationFactory" }
 
SG::ReadCondHandleKey< InDet::BeamSpotDatam_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }
 
DoubleProperty m_thresholdSplittingIntoTwoClusters { this, "ThresholdSplittingIntoTwoClusters", 0.95 }
 
DoubleProperty m_thresholdSplittingIntoThreeClusters { this, "ThresholdSplittingIntoThreeClusters", 0.90 }
 
BooleanProperty m_splitOnlyOnBLayer { this, "SplitOnlyOnBLayer", true }
 
BooleanProperty m_useBeamSpotInfo { this, "useBeamSpotInfo", true }
 

Detailed Description

Author
Andre.nosp@m.as.S.nosp@m.alzbu.nosp@m.rger.nosp@m.@cern.nosp@m..ch

Definition at line 30 of file NnPixelClusterSplitter.h.

Constructor & Destructor Documentation

◆ NnPixelClusterSplitter()

InDet::NnPixelClusterSplitter::NnPixelClusterSplitter ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Constructor.

Name : NnClusterizationFactory.cxx Package : SiClusterizationTool Author : Andi Salzburger (CERN PH-ADP) Giacinto Piacquadio (PH-ADE-ID) Created : January 2011.

DESCRIPTION: Split cluster in sub-clusters, given a certain PixelClusterSplitProb If no PixelClusterSplitProb is given split cluster in 1,2 and 3 sub-clusters and store all results.

Definition at line 32 of file NnPixelClusterSplitter.cxx.

34  :
35  base_class(type,name,parent)
36 {
37 }

◆ ~NnPixelClusterSplitter()

InDet::NnPixelClusterSplitter::~NnPixelClusterSplitter ( )
default

Destructor.

Member Function Documentation

◆ finalize()

StatusCode InDet::NnPixelClusterSplitter::finalize ( )
overridevirtual

Definition at line 53 of file NnPixelClusterSplitter.cxx.

53  {
54  return StatusCode::SUCCESS;
55 }

◆ initialize()

StatusCode InDet::NnPixelClusterSplitter::initialize ( )
overridevirtual

AthAlgTool interface methods.

Definition at line 39 of file NnPixelClusterSplitter.cxx.

39  {
40 
41  if (m_NnClusterizationFactory.retrieve().isFailure())
42  {
43  ATH_MSG_ERROR(" Unable to retrieve "<< m_NnClusterizationFactory );
44  return StatusCode::FAILURE;
45  }
46 
48 
49  ATH_MSG_DEBUG(" Cluster splitter initialized successfully "<< m_NnClusterizationFactory );
50  return StatusCode::SUCCESS;
51 }

◆ splitCluster() [1/2]

std::vector< InDet::PixelClusterParts > InDet::NnPixelClusterSplitter::splitCluster ( const InDet::PixelCluster origCluster) const
overridevirtual

take one, give zero or many

Definition at line 58 of file NnPixelClusterSplitter.cxx.

59 {
60 
61  //add treatment for b-layer only HERE
62 
63 
64  const std::vector<Identifier>& rdos = origCluster.rdoList();
65  const std::vector<int>& totList = origCluster.totList();
66 
67  //fill lvl1group all with the same value... (not best way but ...)
68  std::vector<int> lvl1group(rdos.size(),origCluster.LVL1A());
69 
70 
71 
72  std::vector<Amg::Vector2D> allLocalPositions;
73  std::vector<Amg::MatrixX> allErrorMatrix;
74 
75 
76  std::vector<Amg::MatrixX> errorMatrix;
77 
78  Amg::Vector3D beamSpotPosition(0,0,0);
81  beamSpotPosition = beamSpotHandle->beamPos();
82  }
83 
84  std::vector<Amg::Vector2D> localPosition=m_NnClusterizationFactory->estimatePositions(origCluster,
85  beamSpotPosition,
86  errorMatrix,
87  2);
88 
89 
90 
91  if (errorMatrix.size()!=2 || localPosition.size()!=2)
92  {
93  ATH_MSG_WARNING("Error matrix or local position vector size is not 2, it is:" << errorMatrix.size() << " or " << localPosition.size() << ".");
94  }
95 
96  std::vector<InDet::PixelClusterParts> allMultiPClusters;
97 
98 
99  allMultiPClusters.emplace_back(rdos,totList,lvl1group,localPosition[0],errorMatrix[0]);
100  allMultiPClusters.emplace_back(rdos,totList,lvl1group,localPosition[1],errorMatrix[1]);
101 
102 
103  return allMultiPClusters;
104 
105 }

◆ splitCluster() [2/2]

std::vector< InDet::PixelClusterParts > InDet::NnPixelClusterSplitter::splitCluster ( const InDet::PixelCluster origCluster,
const InDet::PixelClusterSplitProb spo 
) const
overridevirtual

take one, give zero or many - with split probability object

Definition at line 107 of file NnPixelClusterSplitter.cxx.

109 {
110 
111 
113  {
114  const InDetDD::SiDetectorElement* element=origCluster.detectorElement();
115  if (element==nullptr) {
116  ATH_MSG_WARNING("Could not get detector element");
117  return {};
118  }
119  const AtlasDetectorID* aid = element->getIdHelper();
120  if (aid==nullptr)
121  {
122  ATH_MSG_WARNING("Could not get ATLASDetectorID");
123  return {};
124  }
125 
127  {
128  ATH_MSG_WARNING("Not a PixelID helper");
129  return {};
130  }
131  const PixelID* pixelIDp=static_cast<const PixelID*>(aid);
132  //check if original pixel is on b-layer and if yes continue, otherwise interrupt...
133  Identifier pixelId = origCluster.identify();
134  if (!pixelIDp->is_blayer(pixelId))
135  {
136  //return empty object...
137  ATH_MSG_VERBOSE(" Cluster not on b-layer. Return empty object-->back to default clustering." );
138 
139  return {};
140  }
141  }
142 
143  //add treatment for b-layer only HERE
144 
145  const std::vector<Identifier>& rdos = origCluster.rdoList();
146  const std::vector<int>& totList = origCluster.totList();
147 
148  //fill lvl1group all with the same value... (not best way but ...)
149  std::vector<int> lvl1group(rdos.size(), origCluster.LVL1A());
150 
151 
152 
153  if (splitProb.getHighestSplitMultiplicityStored()<3) return {};
154 
155  double splitProb2=splitProb.splitProbability(2);
156  double splitProb3rel=splitProb.splitProbability(3);
157 
158  double splitProb3=splitProb3rel/(splitProb3rel+splitProb2);
159 
160  ATH_MSG_VERBOSE( " SplitProb -->2 " << splitProb2 << " SplitProb -->3 " << splitProb3 );
161 
162  int nParticles=1;
163 
165  {
167  {
168  nParticles=3;
169  }
170  else
171  {
172  nParticles=2;
173  }
174  }
175 
176 
177  ATH_MSG_VERBOSE( " Decided for n. particles: " << nParticles << "." );
178 
179  std::vector<Amg::Vector2D> allLocalPositions;
180  std::vector<Amg::MatrixX> allErrorMatrix;
181 
182  Amg::Vector3D beamSpotPosition(0,0,0);
183  if(m_useBeamSpotInfo){
185  beamSpotPosition = beamSpotHandle->beamPos();
186  }
187 
188  std::vector<InDet::PixelClusterParts> allMultiPClusters;
189 
190  if (nParticles==1)
191  {
192  std::vector<Amg::MatrixX> errorMatrix;
193  std::vector<Amg::Vector2D> localPosition=m_NnClusterizationFactory->estimatePositions(origCluster,
194  beamSpotPosition,
195  errorMatrix,
196  1);
197 
198  if (errorMatrix.size()!=1 || localPosition.size()!=1)
199  {
200  ATH_MSG_ERROR("Error matrix or local position vector size is not 1, it is:" << errorMatrix.size() << " or " << localPosition.size() << ".");
201  }
202 
203  allMultiPClusters.emplace_back(rdos,totList,lvl1group,localPosition[0],errorMatrix[0]);
204  }
205  else if (nParticles==2)
206  {
207 
208  std::vector<Amg::MatrixX> errorMatrix;
209  std::vector<Amg::Vector2D> localPosition=m_NnClusterizationFactory->estimatePositions(origCluster,
210  beamSpotPosition,
211  errorMatrix,
212  2);
213 
214  if (errorMatrix.size()!=2 || localPosition.size()!=2)
215  {
216  ATH_MSG_ERROR("Error matrix or local position vector size is not 2, it is:" << errorMatrix.size() << " or " << localPosition.size() << ".");
217  }
218 
219  allMultiPClusters.emplace_back(rdos,totList,lvl1group,localPosition[0],errorMatrix[0]);
220  allMultiPClusters.emplace_back(rdos,totList,lvl1group,localPosition[1],errorMatrix[1]);
221  }
222  else if (nParticles==3)
223  {
224 
225  std::vector<Amg::MatrixX> errorMatrix;
226  std::vector<Amg::Vector2D> localPosition=m_NnClusterizationFactory->estimatePositions(origCluster,
227  beamSpotPosition,
228  errorMatrix,
229  3);
230 
231  if (errorMatrix.size()!=3 || localPosition.size()!=3)
232  {
233  ATH_MSG_ERROR("Error matrix or local position vector size is not 2, it is:" << errorMatrix.size() << " or " << localPosition.size() << ".");
234  }
235 
236 
237  allMultiPClusters.emplace_back(rdos,totList,lvl1group,localPosition[0],errorMatrix[0]);
238  allMultiPClusters.emplace_back(rdos,totList,lvl1group,localPosition[1],errorMatrix[1]);
239  allMultiPClusters.emplace_back(rdos,totList,lvl1group,localPosition[2],errorMatrix[2]);
240  }
241 
242  return allMultiPClusters;
243 
244 }

Member Data Documentation

◆ m_beamSpotKey

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

Definition at line 55 of file NnPixelClusterSplitter.h.

◆ m_NnClusterizationFactory

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

Definition at line 54 of file NnPixelClusterSplitter.h.

◆ m_splitOnlyOnBLayer

BooleanProperty InDet::NnPixelClusterSplitter::m_splitOnlyOnBLayer { this, "SplitOnlyOnBLayer", true }
private

Definition at line 58 of file NnPixelClusterSplitter.h.

◆ m_thresholdSplittingIntoThreeClusters

DoubleProperty InDet::NnPixelClusterSplitter::m_thresholdSplittingIntoThreeClusters { this, "ThresholdSplittingIntoThreeClusters", 0.90 }
private

Definition at line 57 of file NnPixelClusterSplitter.h.

◆ m_thresholdSplittingIntoTwoClusters

DoubleProperty InDet::NnPixelClusterSplitter::m_thresholdSplittingIntoTwoClusters { this, "ThresholdSplittingIntoTwoClusters", 0.95 }
private

Definition at line 56 of file NnPixelClusterSplitter.h.

◆ m_useBeamSpotInfo

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

Definition at line 59 of file NnPixelClusterSplitter.h.


The documentation for this class was generated from the following files:
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
AtlasDetectorID::HelperType::Pixel
@ Pixel
Trk::PrepRawData::rdoList
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
InDet::NnPixelClusterSplitter::m_thresholdSplittingIntoTwoClusters
DoubleProperty m_thresholdSplittingIntoTwoClusters
Definition: NnPixelClusterSplitter.h:56
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
InDet::PixelCluster::totList
const std::vector< int > & totList() const
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:201
PixelID::is_blayer
bool is_blayer(const Identifier &id) const
Test for b-layer - WARNING: id MUST be pixel id, otherwise answer is not accurate....
Definition: PixelID.h:633
InDetDD::SolidStateDetectorElementBase::getIdHelper
const AtlasDetectorID * getIdHelper() const
Returns the id helper (inline)
InDet::NnPixelClusterSplitter::m_useBeamSpotInfo
BooleanProperty m_useBeamSpotInfo
Definition: NnPixelClusterSplitter.h:59
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
InDet::NnPixelClusterSplitter::m_NnClusterizationFactory
ToolHandle< NnClusterizationFactory > m_NnClusterizationFactory
Definition: NnPixelClusterSplitter.h:54
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
InDet::PixelCluster::LVL1A
int LVL1A() const
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:269
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
InDet::SiCluster::detectorElement
virtual const InDetDD::SiDetectorElement * detectorElement() const override final
return the detector element corresponding to this PRD The pointer will be zero if the det el is not d...
InDet::NnPixelClusterSplitter::m_beamSpotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Definition: NnPixelClusterSplitter.h:55
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
AtlasDetectorID::helper
virtual HelperType helper() const
Type of helper, defaulted to 'Unimplemented'.
Definition: AtlasDetectorID.h:95
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
InDet::NnPixelClusterSplitter::m_splitOnlyOnBLayer
BooleanProperty m_splitOnlyOnBLayer
Definition: NnPixelClusterSplitter.h:58
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
InDet::NnPixelClusterSplitter::m_thresholdSplittingIntoThreeClusters
DoubleProperty m_thresholdSplittingIntoThreeClusters
Definition: NnPixelClusterSplitter.h:57
PixelID
Definition: PixelID.h:67
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:57