CMS 3D CMS Logo

Classes | Public Types | Public Member Functions | Private Attributes | Friends

reco::PFDisplacedVertexSeed Class Reference

Block of elements. More...

#include <PFDisplacedVertexSeed.h>

List of all members.

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 GlobalPointseedPoint () const
const double totalWeight () const
void updateSeedPoint (const GlobalPoint &dcaPoint, const TrackBaseRef, const TrackBaseRef, double weight=1)

Private Attributes

std::set< TrackBaseRef, Compareelements_
 --------- 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)

Detailed Description

Block of elements.

Author:
Gouzevitch Maxime
Date:
November 2009

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.


Member Typedef Documentation

-------- Useful Types -------- ///

Definition at line 34 of file PFDisplacedVertexSeed.h.


Constructor & Destructor Documentation

PFDisplacedVertexSeed::PFDisplacedVertexSeed ( )

Default constructor.

Definition at line 10 of file PFDisplacedVertexSeed.cc.


Member Function Documentation

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]
Returns:
set of references to tracks

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]
Returns:
the seedPoint for the vertex fitting

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]
Returns:
the total weight

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);

}

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const PFDisplacedVertexSeed co 
) [friend]

Member Data Documentation

--------- 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().

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().