CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DisplacedVertexCluster::Distance Struct Reference

#include <DisplacedVertexCluster.h>

Public Member Functions

 Distance (DisplacedVertexClusterItr entity0, DisplacedVertexClusterItr entity1)
 
double distance () const
 
double distance2 () const
 
std::pair< DisplacedVertexClusterItr, DisplacedVertexClusterItr > & entities ()
 
const std::pair< DisplacedVertexClusterItr, DisplacedVertexClusterItr > & entities () const
 

Private Attributes

std::pair< DisplacedVertexClusterItr, DisplacedVertexClusterItrentities_
 

Detailed Description

Definition at line 44 of file DisplacedVertexCluster.h.

Constructor & Destructor Documentation

◆ Distance()

DisplacedVertexCluster::Distance::Distance ( DisplacedVertexClusterItr  entity0,
DisplacedVertexClusterItr  entity1 
)
inline

Definition at line 46 of file DisplacedVertexCluster.h.

46 : entities_(entity0, entity1) {}
std::pair< DisplacedVertexClusterItr, DisplacedVertexClusterItr > entities_

Member Function Documentation

◆ distance()

double DisplacedVertexCluster::Distance::distance ( ) const
inline

Definition at line 48 of file DisplacedVertexCluster.h.

References distance2(), and mathSSE::sqrt().

48 { return sqrt(distance2()); }
T sqrt(T t)
Definition: SSEVec.h:23

◆ distance2()

double DisplacedVertexCluster::Distance::distance2 ( ) const

Definition at line 19 of file DisplacedVertexCluster.cc.

References entities_, mag2(), and WZElectronSkims53X_cff::max.

Referenced by distance().

19  {
20  if (entities_.first->valid() && entities_.second->valid())
21  return (entities_.first->centerOfMass() - entities_.second->centerOfMass()).mag2();
23 }
std::pair< DisplacedVertexClusterItr, DisplacedVertexClusterItr > entities_
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)

◆ entities() [1/2]

std::pair<DisplacedVertexClusterItr, DisplacedVertexClusterItr>& DisplacedVertexCluster::Distance::entities ( )
inline

Definition at line 49 of file DisplacedVertexCluster.h.

References entities_.

49 { return entities_; }
std::pair< DisplacedVertexClusterItr, DisplacedVertexClusterItr > entities_

◆ entities() [2/2]

const std::pair<DisplacedVertexClusterItr, DisplacedVertexClusterItr>& DisplacedVertexCluster::Distance::entities ( ) const
inline

Definition at line 50 of file DisplacedVertexCluster.h.

References entities_.

50 { return entities_; }
std::pair< DisplacedVertexClusterItr, DisplacedVertexClusterItr > entities_

Member Data Documentation

◆ entities_

std::pair<DisplacedVertexClusterItr, DisplacedVertexClusterItr> DisplacedVertexCluster::Distance::entities_
private

Definition at line 53 of file DisplacedVertexCluster.h.

Referenced by distance2(), and entities().