Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ClusterSBPoints.cc File Reference

Implementation of the ClusterSBPoints class. More...

#include "ClusterSBPoints.hh"
#include "G4SystemOfUnits.hh"
#include <iostream>
Include dependency graph for ClusterSBPoints.cc:

Go to the source code of this file.

Functions

bool AreOnTheSameCluster (const SBPoint *pPt1, const SBPoint *pPt2, G4double pMinDist)
 

Detailed Description

Implementation of the ClusterSBPoints class.

Definition in file ClusterSBPoints.cc.

Function Documentation

bool AreOnTheSameCluster ( const SBPoint pPt1,
const SBPoint pPt2,
G4double  pMinDist 
)

Definition at line 165 of file ClusterSBPoints.cc.

167 {
168  assert(pPt1);
169  assert(pPt2);
170 
171  G4double x1=pPt1->GetPosition().x()/nm;
172  G4double y1=pPt1->GetPosition().y()/nm;
173  G4double z1=pPt1->GetPosition().z()/nm;
174 
175  G4double x2=pPt2->GetPosition().x()/nm;
176  G4double y2=pPt2->GetPosition().y()/nm;
177  G4double z2=pPt2->GetPosition().z()/nm;
178 
179  // if the two points are closed enough
180  if(((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)+(z1-z2)*(z1-z2))<=
181  (pMinDist/nm*pMinDist/nm))
182  {
183  return true;
184  }else
185  {
186  return false;
187  }
188 }
double x() const
double z() const
static constexpr double nm
Definition: G4SIunits.hh:112
double y() const
double G4double
Definition: G4Types.hh:76
G4ThreeVector GetPosition() const
Definition: SBPoint.hh:60

Here is the call graph for this function:

Here is the caller graph for this function: