ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
AFPSiClusterBasicNearestNeighbour Class Reference

#include <AFPSiClusterBasicNearestNeighbour.h>

Inheritance diagram for AFPSiClusterBasicNearestNeighbour:
Collaboration diagram for AFPSiClusterBasicNearestNeighbour:

Public Member Functions

 AFPSiClusterBasicNearestNeighbour (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~AFPSiClusterBasicNearestNeighbour () override
 
virtual StatusCode initialize () override
 does nothing More...
 
virtual StatusCode finalize () override
 does nothing More...
 
virtual StatusCode doClustering (const std::list< const xAOD::AFPSiHit * > &hits, std::list< AFPSiClusterBasicObj > &outputClusters) const override
 Creates a cluster from the neighbouring pixels, joining only two pixels with charge above m_chargeThreshold. More...
 
float chargeThreshold () const
 

Private Attributes

Gaudi::Property< float > m_chargeThreshold {this, "chargeThreshold", 1000., "charge above which hits are used for clustering"}
 

Detailed Description

Definition at line 30 of file AFPSiClusterBasicNearestNeighbour.h.

Constructor & Destructor Documentation

◆ AFPSiClusterBasicNearestNeighbour()

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

Definition at line 25 of file AFPSiClusterBasicNearestNeighbour.cxx.

28  : base_class(type, name, parent) {
29 }

◆ ~AFPSiClusterBasicNearestNeighbour()

virtual AFPSiClusterBasicNearestNeighbour::~AFPSiClusterBasicNearestNeighbour ( )
inlineoverridevirtual

Definition at line 38 of file AFPSiClusterBasicNearestNeighbour.h.

38 {}

Member Function Documentation

◆ chargeThreshold()

float AFPSiClusterBasicNearestNeighbour::chargeThreshold ( ) const
inline

Definition at line 50 of file AFPSiClusterBasicNearestNeighbour.h.

50 {return m_chargeThreshold;}

◆ doClustering()

StatusCode AFPSiClusterBasicNearestNeighbour::doClustering ( const std::list< const xAOD::AFPSiHit * > &  hits,
std::list< AFPSiClusterBasicObj > &  outputClusters 
) const
overridevirtual

Creates a cluster from the neighbouring pixels, joining only two pixels with charge above m_chargeThreshold.

Definition at line 39 of file AFPSiClusterBasicNearestNeighbour.cxx.

40 {
41  std::list<const xAOD::AFPSiHit*> hitsAboveThreshold;
42 
43  // select only hits above charge threshold
44  for (const xAOD::AFPSiHit* theHit : hits)
45  if (theHit->depositedCharge() > m_chargeThreshold)
46  hitsAboveThreshold.push_back(theHit);
47 
48  while (!hitsAboveThreshold.empty()) {
49  const xAOD::AFPSiHit* theHit = hitsAboveThreshold.front();
50  hitsAboveThreshold.pop_front(); // remove current hit from the list
51 
52  const int pixelHorizID = theHit->pixelHorizID();
53  float horizID = pixelHorizID; // value used to make cluster may be not integer
54  float vertID = theHit->pixelVertID(); // value used to make cluster may be not integer
55  float charge = theHit->depositedCharge();
56  outputClusters.emplace_back(theHit, xAOD::AFPClusterAlgID::nearestNeighbour);
57 
58  const std::list<const xAOD::AFPSiHit*>::iterator neighbourEnd = hitsAboveThreshold.end();
59  std::list<const xAOD::AFPSiHit*>::iterator neighbourIter = hitsAboveThreshold.begin();
60  while (neighbourIter != neighbourEnd) {
61  const xAOD::AFPSiHit* neighbour = *neighbourIter;
62  // check if pixels are next to each other
63  if (abs(neighbour->pixelHorizID()-pixelHorizID) == 1) {
64  const float neighbourCharge = neighbour->depositedCharge();
65  // charge weighted mean position
66  horizID = (horizID*charge + neighbour->pixelHorizID()*neighbourCharge)/(charge + neighbourCharge);
67  vertID = (vertID*charge + neighbour->pixelVertID()*neighbourCharge)/(charge + neighbourCharge);
68 
69  charge += neighbourCharge;
70 
71  hitsAboveThreshold.erase(neighbourIter);
72 
73  // update cluster before finishing the loop
74  AFPSiClusterBasicObj& theCluster = outputClusters.back();
75  theCluster.setHorizID(horizID);
76  theCluster.setVertID(vertID);
77  theCluster.setCharge(charge);
78  theCluster.hits().push_back(neighbour);
79  break;
80  }
81  ++neighbourIter;
82  }
83 
84  }
85 
86 
87  return StatusCode::SUCCESS;
88 }

◆ finalize()

StatusCode AFPSiClusterBasicNearestNeighbour::finalize ( )
overridevirtual

does nothing

Definition at line 35 of file AFPSiClusterBasicNearestNeighbour.cxx.

35  {
36  return StatusCode::SUCCESS;
37 }

◆ initialize()

StatusCode AFPSiClusterBasicNearestNeighbour::initialize ( )
overridevirtual

does nothing

Definition at line 31 of file AFPSiClusterBasicNearestNeighbour.cxx.

31  {
32  return StatusCode::SUCCESS;
33 }

Member Data Documentation

◆ m_chargeThreshold

Gaudi::Property<float> AFPSiClusterBasicNearestNeighbour::m_chargeThreshold {this, "chargeThreshold", 1000., "charge above which hits are used for clustering"}
private

Definition at line 53 of file AFPSiClusterBasicNearestNeighbour.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
AFPSiClusterBasicObj::setCharge
void setCharge(const double charge)
Definition: AFPSiClusterBasicObj.h:64
xAOD::AFPSiHit_v2
Class representing a hit in silicon detector.
Definition: AFPSiHit_v2.h:30
xAOD::AFPSiHit_v2::pixelHorizID
int pixelHorizID() const
Index of the pixel along X axis in LHC coordinate system.
Definition: AFPSiHit_v2.cxx:37
AFPSiClusterBasicObj
Class representing basic silicon pixels cluster, designed to be used for creating the clusters.
Definition: AFPSiClusterBasicObj.h:28
xAOD::AFPSiHit_v2::pixelVertID
int pixelVertID() const
Index of the pixel along Y axis in LHC coordinate system.
Definition: AFPSiHit_v2.cxx:52
xAOD::AFPSiHit_v2::depositedCharge
float depositedCharge() const
Charge deposited in the pixel.
test_pyathena.parent
parent
Definition: test_pyathena.py:15
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
charge
double charge(const T &p)
Definition: AtlasPID.h:538
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AFPSiClusterBasicObj::setVertID
void setVertID(const float vertID)
Definition: AFPSiClusterBasicObj.h:54
AFPSiClusterBasicNearestNeighbour::m_chargeThreshold
Gaudi::Property< float > m_chargeThreshold
Definition: AFPSiClusterBasicNearestNeighbour.h:53
AFPSiClusterBasicObj::setHorizID
void setHorizID(const float horizID)
Definition: AFPSiClusterBasicObj.h:44
xAOD::AFPClusterAlgID::nearestNeighbour
static const int nearestNeighbour
Nearest neighbour algorithm.
Definition: AFPClusterAlgID.h:49
AFPSiClusterBasicObj::hits
std::list< const xAOD::AFPSiHit * > & hits()
list of pixels used to form the cluster
Definition: AFPSiClusterBasicObj.h:72