CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Attributes | Private Attributes
DisplacedVertexCluster Class Reference

#include <DisplacedVertexCluster.h>

Classes

struct  Distance
 

Public Types

typedef std::list< Distance >::iterator DistanceItr
 

Public Member Functions

const math::XYZVectorcenterOfMass () const
 
const reco::VertexCompositeCandidateconstituent (const unsigned i) const
 
const std::vector< const reco::VertexCompositeCandidate * > & constituents () const
 
 DisplacedVertexCluster ()
 
 DisplacedVertexCluster (const reco::VertexCompositeCandidate *const, const double)
 
void merge (const DisplacedVertexCluster &other)
 
unsigned nConstituents () const
 
double rParam () const
 
double rParam2 () const
 
void setInvalid ()
 
const math::XYZVectorsumOfCenters () const
 
bool valid () const
 
double vx () const
 
double vy () const
 
double vz () const
 
 ~DisplacedVertexCluster ()=default
 

Static Public Attributes

static constexpr double kInvalidDouble = std::numeric_limits<double>::quiet_NaN()
 

Private Attributes

math::XYZVector centerOfMass_
 
std::vector< const reco::VertexCompositeCandidate * > constituents_
 
double rParam2_
 
math::XYZVector sumOfCenters_
 
bool valid_
 

Detailed Description

Definition at line 16 of file DisplacedVertexCluster.h.

Member Typedef Documentation

◆ DistanceItr

typedef std::list<Distance>::iterator DisplacedVertexCluster::DistanceItr

Definition at line 56 of file DisplacedVertexCluster.h.

Constructor & Destructor Documentation

◆ DisplacedVertexCluster() [1/2]

DisplacedVertexCluster::DisplacedVertexCluster ( )
inline

Definition at line 20 of file DisplacedVertexCluster.h.

21  : valid_(false), rParam2_(kInvalidDouble), sumOfCenters_(0.0, 0.0, 0.0), centerOfMass_(0.0, 0.0, 0.0) {}
static constexpr double kInvalidDouble

◆ DisplacedVertexCluster() [2/2]

DisplacedVertexCluster::DisplacedVertexCluster ( const reco::VertexCompositeCandidate * const  trackClusterPtr,
const double  rParam 
)

Definition at line 3 of file DisplacedVertexCluster.cc.

References constituents_.

5  : valid_(true),
7  sumOfCenters_(trackClusterPtr->vertex()),
8  centerOfMass_(trackClusterPtr->vertex()) {
9  constituents_.push_back(trackClusterPtr);
10 }
std::vector< const reco::VertexCompositeCandidate * > constituents_
const Point & vertex() const override
vertex position (overwritten by PF...)

◆ ~DisplacedVertexCluster()

DisplacedVertexCluster::~DisplacedVertexCluster ( )
default

Member Function Documentation

◆ centerOfMass()

const math::XYZVector& DisplacedVertexCluster::centerOfMass ( ) const
inline

Definition at line 34 of file DisplacedVertexCluster.h.

References centerOfMass_.

Referenced by vx(), vy(), and vz().

34 { return centerOfMass_; }

◆ constituent()

const reco::VertexCompositeCandidate* DisplacedVertexCluster::constituent ( const unsigned  i) const
inline

Definition at line 31 of file DisplacedVertexCluster.h.

References constituents_, and mps_fire::i.

Referenced by DisplacedRegionSeedingVertexProducer::getDiscriminatorValue().

31 { return constituents_.at(i); }
std::vector< const reco::VertexCompositeCandidate * > constituents_

◆ constituents()

const std::vector<const reco::VertexCompositeCandidate *>& DisplacedVertexCluster::constituents ( ) const
inline

Definition at line 30 of file DisplacedVertexCluster.h.

References constituents_.

30 { return constituents_; }
std::vector< const reco::VertexCompositeCandidate * > constituents_

◆ merge()

void DisplacedVertexCluster::merge ( const DisplacedVertexCluster other)

Definition at line 12 of file DisplacedVertexCluster.cc.

References centerOfMass_, constituents_, trackingPlots::other, and sumOfCenters_.

12  {
13  for (const auto &trackCluster : other.constituents())
14  constituents_.push_back(trackCluster);
15  sumOfCenters_ += other.sumOfCenters();
16  centerOfMass_ = sumOfCenters_ * (1.0 / constituents_.size());
17 }
std::vector< const reco::VertexCompositeCandidate * > constituents_

◆ nConstituents()

unsigned DisplacedVertexCluster::nConstituents ( ) const
inline

Definition at line 32 of file DisplacedVertexCluster.h.

References constituents_.

Referenced by DisplacedRegionSeedingVertexProducer::getDiscriminatorValue().

32 { return constituents_.size(); }
std::vector< const reco::VertexCompositeCandidate * > constituents_

◆ rParam()

double DisplacedVertexCluster::rParam ( ) const
inline

Definition at line 29 of file DisplacedVertexCluster.h.

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

29 { return sqrt(rParam2()); }
T sqrt(T t)
Definition: SSEVec.h:19

◆ rParam2()

double DisplacedVertexCluster::rParam2 ( ) const
inline

Definition at line 28 of file DisplacedVertexCluster.h.

References rParam2_.

Referenced by rParam().

28 { return rParam2_; }

◆ setInvalid()

void DisplacedVertexCluster::setInvalid ( void  )
inline

Definition at line 41 of file DisplacedVertexCluster.h.

References valid_.

41 { valid_ = false; }

◆ sumOfCenters()

const math::XYZVector& DisplacedVertexCluster::sumOfCenters ( ) const
inline

Definition at line 33 of file DisplacedVertexCluster.h.

References sumOfCenters_.

33 { return sumOfCenters_; }

◆ valid()

bool DisplacedVertexCluster::valid ( ) const
inline

Definition at line 27 of file DisplacedVertexCluster.h.

References valid_.

◆ vx()

double DisplacedVertexCluster::vx ( ) const
inline

Definition at line 36 of file DisplacedVertexCluster.h.

References centerOfMass().

36 { return centerOfMass().x(); }
const math::XYZVector & centerOfMass() const

◆ vy()

double DisplacedVertexCluster::vy ( ) const
inline

Definition at line 37 of file DisplacedVertexCluster.h.

References centerOfMass().

37 { return centerOfMass().y(); }
const math::XYZVector & centerOfMass() const

◆ vz()

double DisplacedVertexCluster::vz ( ) const
inline

Definition at line 38 of file DisplacedVertexCluster.h.

References centerOfMass().

38 { return centerOfMass().z(); }
const math::XYZVector & centerOfMass() const

Member Data Documentation

◆ centerOfMass_

math::XYZVector DisplacedVertexCluster::centerOfMass_
private

Definition at line 63 of file DisplacedVertexCluster.h.

Referenced by centerOfMass(), and merge().

◆ constituents_

std::vector<const reco::VertexCompositeCandidate *> DisplacedVertexCluster::constituents_
private

◆ kInvalidDouble

constexpr double DisplacedVertexCluster::kInvalidDouble = std::numeric_limits<double>::quiet_NaN()
static

Definition at line 18 of file DisplacedVertexCluster.h.

◆ rParam2_

double DisplacedVertexCluster::rParam2_
private

Definition at line 60 of file DisplacedVertexCluster.h.

Referenced by rParam2().

◆ sumOfCenters_

math::XYZVector DisplacedVertexCluster::sumOfCenters_
private

Definition at line 62 of file DisplacedVertexCluster.h.

Referenced by merge(), and sumOfCenters().

◆ valid_

bool DisplacedVertexCluster::valid_
private

Definition at line 59 of file DisplacedVertexCluster.h.

Referenced by setInvalid(), and valid().