Block of elements. More...
#include <PFDisplacedVertexSeed.h>
Classes | |
struct | Compare |
Public Types | |
typedef std::set < reco::TrackBaseRef > ::iterator | IEset |
-------- Useful Types -------- /// | |
Public Member Functions | |
void | addElement (TrackBaseRef) |
Add a track Reference to the current Seed. | |
void | Dump (std::ostream &out=std::cout) const |
cout function | |
const std::set< TrackBaseRef, Compare > & | elements () const |
bool | isEmpty () const |
Check if it is a new Seed. | |
void | mergeWith (const PFDisplacedVertexSeed &displacedVertex) |
Merge two Seeds if their seed Points are close enough. | |
const double | nTracks () const |
PFDisplacedVertexSeed () | |
Default constructor. | |
const GlobalPoint & | seedPoint () const |
const double | totalWeight () const |
void | updateSeedPoint (const GlobalPoint &dcaPoint, const TrackBaseRef, const TrackBaseRef, double weight=1) |
Private Attributes | |
std::set< TrackBaseRef, Compare > | elements_ |
--------- MEMBERS ---------- /// | |
GlobalPoint | seedPoint_ |
Seed point which indicated the approximative position of the vertex. | |
float | totalWeight_ |
Friends | |
std::ostream & | operator<< (std::ostream &out, const PFDisplacedVertexSeed &co) |
Block of elements.
A DisplacedVertexSeed is an intermediate format, usually not persistent, used by PFDisplacedVertexFinder to keep the information for vertex fit. This format is produced after parsing of PFDisplacedVertexCandidate which by construction may contain many seeds. This format contains:
Definition at line 28 of file PFDisplacedVertexSeed.h.
typedef std::set< reco::TrackBaseRef >::iterator reco::PFDisplacedVertexSeed::IEset |
-------- Useful Types -------- ///
Definition at line 34 of file PFDisplacedVertexSeed.h.
PFDisplacedVertexSeed::PFDisplacedVertexSeed | ( | ) |
Default constructor.
Definition at line 10 of file PFDisplacedVertexSeed.cc.
: seedPoint_(GlobalPoint(0,0,0)), totalWeight_(0) {}
void PFDisplacedVertexSeed::addElement | ( | TrackBaseRef | element | ) |
Add a track Reference to the current Seed.
Definition at line 16 of file PFDisplacedVertexSeed.cc.
References elements_.
Referenced by mergeWith(), and updateSeedPoint().
{ elements_.insert( element ); }
void reco::PFDisplacedVertexSeed::Dump | ( | std::ostream & | out = std::cout | ) | const |
cout function
Referenced by PFDisplacedVertexFinder::fitVertexFromSeed().
const std::set< TrackBaseRef, Compare >& reco::PFDisplacedVertexSeed::elements | ( | ) | const [inline] |
Definition at line 64 of file PFDisplacedVertexSeed.h.
References elements_.
Referenced by PFDisplacedVertexFinder::fitVertexFromSeed(), and mergeWith().
{return elements_;}
bool reco::PFDisplacedVertexSeed::isEmpty | ( | ) | const [inline] |
Check if it is a new Seed.
Definition at line 61 of file PFDisplacedVertexSeed.h.
References elements_.
Referenced by updateSeedPoint().
{return (elements_.size() == 0);}
void PFDisplacedVertexSeed::mergeWith | ( | const PFDisplacedVertexSeed & | displacedVertex | ) |
Merge two Seeds if their seed Points are close enough.
Definition at line 46 of file PFDisplacedVertexSeed.cc.
References addElement(), elements(), P, seedPoint(), seedPoint_, totalWeight(), totalWeight_, CommonMethods::weight(), Basic3DVector< T >::x(), Basic3DVector< T >::y(), and Basic3DVector< T >::z().
{ double weight = displacedVertex.totalWeight(); set<TrackBaseRef, Compare> newElements= displacedVertex.elements(); GlobalPoint dcaPoint = displacedVertex.seedPoint(); Basic3DVector<double>vertexSeedVector(seedPoint_); Basic3DVector<double>dcaVector(dcaPoint); dcaVector = (dcaVector*weight + vertexSeedVector*totalWeight_)/(totalWeight_+weight); GlobalPoint P(dcaVector.x(), dcaVector.y(), dcaVector.z()); totalWeight_ += weight; seedPoint_ = P; for ( set<TrackBaseRef, Compare>::const_iterator il = newElements.begin(); il != newElements.end(); il++) addElement(*il); }
const double reco::PFDisplacedVertexSeed::nTracks | ( | ) | const [inline] |
Definition at line 67 of file PFDisplacedVertexSeed.h.
References elements_.
{return elements_.size();}
const GlobalPoint& reco::PFDisplacedVertexSeed::seedPoint | ( | ) | const [inline] |
Definition at line 70 of file PFDisplacedVertexSeed.h.
References seedPoint_.
Referenced by PFDisplacedVertexFinder::fitVertexFromSeed(), PFDisplacedVertexFinder::isCloseTo(), and mergeWith().
{return seedPoint_;}
const double reco::PFDisplacedVertexSeed::totalWeight | ( | ) | const [inline] |
Definition at line 73 of file PFDisplacedVertexSeed.h.
References totalWeight_.
Referenced by mergeWith().
{return totalWeight_;}
void PFDisplacedVertexSeed::updateSeedPoint | ( | const GlobalPoint & | dcaPoint, |
const TrackBaseRef | r1, | ||
const TrackBaseRef | r2, | ||
double | weight = 1 |
||
) |
Add a track Ref to the Seed and recalculate the seedPoint with a new dcaPoint A weight different from 1 may be assign to the new DCA point
Definition at line 21 of file PFDisplacedVertexSeed.cc.
References addElement(), isEmpty(), P, seedPoint_, totalWeight_, CommonMethods::weight(), Basic3DVector< T >::x(), Basic3DVector< T >::y(), and Basic3DVector< T >::z().
{ if ( isEmpty() ) { seedPoint_ = dcaPoint; totalWeight_ = weight; } else { Basic3DVector<double>vertexSeedVector(seedPoint_); Basic3DVector<double>dcaVector(dcaPoint); dcaVector = (dcaVector*weight + vertexSeedVector*totalWeight_)/(totalWeight_+weight); GlobalPoint P(dcaVector.x(), dcaVector.y(), dcaVector.z()); totalWeight_ += weight; seedPoint_ = P; } addElement(r1); addElement(r2); }
std::ostream& operator<< | ( | std::ostream & | out, |
const PFDisplacedVertexSeed & | co | ||
) | [friend] |
std::set< TrackBaseRef , Compare > reco::PFDisplacedVertexSeed::elements_ [private] |
--------- MEMBERS ---------- ///
Set of tracks refs associated to the seed
Definition at line 87 of file PFDisplacedVertexSeed.h.
Referenced by addElement(), elements(), isEmpty(), and nTracks().
Seed point which indicated the approximative position of the vertex.
Definition at line 89 of file PFDisplacedVertexSeed.h.
Referenced by mergeWith(), seedPoint(), and updateSeedPoint().
float reco::PFDisplacedVertexSeed::totalWeight_ [private] |
Total weight of the points used to calculate the seed point. Necessary for UpdateSeed Point function
Definition at line 92 of file PFDisplacedVertexSeed.h.
Referenced by mergeWith(), totalWeight(), and updateSeedPoint().