ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHSimpleVertexFinder Class Reference

#include <coresoftware/blob/master/offline/packages/trackreco/PHSimpleVertexFinder.h>

+ Inheritance diagram for PHSimpleVertexFinder:
+ Collaboration diagram for PHSimpleVertexFinder:

Public Member Functions

 PHSimpleVertexFinder (const std::string &name="PHSimpleVertexFinder")
 Tracking includes.
 
 ~PHSimpleVertexFinder () override
 
int InitRun (PHCompositeNode *topNode) override
 
int process_event (PHCompositeNode *topNode) override
 
int End (PHCompositeNode *topNode) override
 Called at the end of all processing.
 
void setBeamLineCut (const double cut)
 
void setDcaCut (const double cut)
 
void setTrackQualityCut (double cut)
 
void setRequireMVTX (bool set)
 
void setNmvtxRequired (unsigned int n)
 
void setOutlierPairCut (const double cut)
 
- Public Member Functions inherited from SubsysReco
 ~SubsysReco () override
 
virtual int EndRun (const int)
 Called at the end of each run.
 
virtual int Init (PHCompositeNode *)
 
virtual int Reset (PHCompositeNode *)
 Reset.
 
virtual int ResetEvent (PHCompositeNode *)
 Clean up after each event.
 
void Print (const std::string &="ALL") const override
 
- Public Member Functions inherited from Fun4AllBase
virtual ~Fun4AllBase ()
 
virtual const std::string Name () const
 Returns the name of this module.
 
virtual void Name (const std::string &name)
 Sets the name of this module.
 
virtual void Verbosity (const int ival)
 Sets the verbosity of this module (0 by default=quiet).
 
virtual void Verbosity (enu_Verbosity ival)
 Sets the verbosity of this module (0 by default=quiet).
 
virtual int Verbosity () const
 Gets the verbosity of this module.
 

Private Types

using matrix_t = Eigen::Matrix< double, 3, 3 >
 

Private Member Functions

int GetNodes (PHCompositeNode *topNode)
 
int CreateNodes (PHCompositeNode *topNode)
 
void checkDCAs ()
 
void findDcaTwoTracks (SvtxTrack *tr1, SvtxTrack *tr2)
 
double dcaTwoLines (const Eigen::Vector3d &p1, const Eigen::Vector3d &v1, const Eigen::Vector3d &p2, const Eigen::Vector3d &v2, Eigen::Vector3d &PCA1, Eigen::Vector3d &PCA2)
 
std::vector< std::set
< unsigned int > > 
findConnectedTracks ()
 
void removeOutlierTrackPairs ()
 
double getMedian (std::vector< double > &v)
 
double getAverage (std::vector< double > &v)
 

Private Attributes

SvtxTrackMap_track_map {nullptr}
 
SvtxTrack_track {nullptr}
 
SvtxVertexMap_svtx_vertex_map {nullptr}
 
double _dcacut = 0.0080
 
double _beamline_xy_cut = 0.2
 
double _qual_cut = 5.0
 
bool _require_mvtx = true
 
unsigned int _nmvtx_required = 3
 
double _track_pt_cut = 0.0
 
double _outlier_cut = 0.015
 
std::multimap< unsigned int,
unsigned int
_vertex_track_map
 
std::multimap< unsigned int,
std::pair< unsigned int,
double > > 
_track_pair_map
 
std::multimap< unsigned int,
std::pair< unsigned int,
std::pair< Eigen::Vector3d,
Eigen::Vector3d > > > 
_track_pair_pca_map
 
std::map< unsigned int,
Eigen::Vector3d > 
_vertex_position_map
 
std::map< unsigned int, matrix_t_vertex_covariance_map
 
std::set< unsigned int_vertex_set
 

Additional Inherited Members

- Public Types inherited from Fun4AllBase
enum  enu_Verbosity {
  VERBOSITY_QUIET = 0, VERBOSITY_SOME = 1, VERBOSITY_MORE = 2, VERBOSITY_EVEN_MORE = 3,
  VERBOSITY_A_LOT = 4, VERBOSITY_MAX = INT_MAX - 10
}
 
- Protected Member Functions inherited from SubsysReco
 SubsysReco (const std::string &name="NONAME")
 

Detailed Description

Definition at line 29 of file PHSimpleVertexFinder.h.

View newest version in sPHENIX GitHub at line 29 of file PHSimpleVertexFinder.h

Member Typedef Documentation

using PHSimpleVertexFinder::matrix_t = Eigen::Matrix<double,3,3>
private

Definition at line 77 of file PHSimpleVertexFinder.h.

View newest version in sPHENIX GitHub at line 77 of file PHSimpleVertexFinder.h

Constructor & Destructor Documentation

PHSimpleVertexFinder::PHSimpleVertexFinder ( const std::string &  name = "PHSimpleVertexFinder")

Tracking includes.

Definition at line 40 of file PHSimpleVertexFinder.cc.

View newest version in sPHENIX GitHub at line 40 of file PHSimpleVertexFinder.cc

PHSimpleVertexFinder::~PHSimpleVertexFinder ( )
override

Definition at line 47 of file PHSimpleVertexFinder.cc.

View newest version in sPHENIX GitHub at line 47 of file PHSimpleVertexFinder.cc

Member Function Documentation

void PHSimpleVertexFinder::checkDCAs ( )
private

Definition at line 275 of file PHSimpleVertexFinder.cc.

View newest version in sPHENIX GitHub at line 275 of file PHSimpleVertexFinder.cc

References _nmvtx_required, _qual_cut, _require_mvtx, _track_map, SvtxTrackMap::begin(), SvtxTrackMap::end(), findDcaTwoTracks(), TrkrDefs::getTrkrId(), TrkrDefs::mvtxId, and Fun4AllBase::Verbosity().

Referenced by process_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int PHSimpleVertexFinder::CreateNodes ( PHCompositeNode topNode)
private

Check that it is there

Get the tracking subnode

Definition at line 224 of file PHSimpleVertexFinder.cc.

View newest version in sPHENIX GitHub at line 224 of file PHSimpleVertexFinder.cc

References _svtx_vertex_map, PHCompositeNode::addNode(), Fun4AllReturnCodes::EVENT_OK, and PHNodeIterator::findFirst().

Referenced by InitRun().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double PHSimpleVertexFinder::dcaTwoLines ( const Eigen::Vector3d &  p1,
const Eigen::Vector3d &  v1,
const Eigen::Vector3d &  p2,
const Eigen::Vector3d &  v2,
Eigen::Vector3d &  PCA1,
Eigen::Vector3d &  PCA2 
)
private

Definition at line 370 of file PHSimpleVertexFinder.cc.

View newest version in sPHENIX GitHub at line 370 of file PHSimpleVertexFinder.cc

References c, d, F, G, X, and Y.

Referenced by findDcaTwoTracks().

+ Here is the caller graph for this function:

int PHSimpleVertexFinder::End ( PHCompositeNode )
overridevirtual

Called at the end of all processing.

Reimplemented from SubsysReco.

Definition at line 219 of file PHSimpleVertexFinder.cc.

View newest version in sPHENIX GitHub at line 219 of file PHSimpleVertexFinder.cc

References Fun4AllReturnCodes::EVENT_OK.

std::vector< std::set< unsigned int > > PHSimpleVertexFinder::findConnectedTracks ( )
private

Definition at line 428 of file PHSimpleVertexFinder.cc.

View newest version in sPHENIX GitHub at line 428 of file PHSimpleVertexFinder.cc

References _track_pair_map, it, and Fun4AllBase::Verbosity().

Referenced by process_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void PHSimpleVertexFinder::findDcaTwoTracks ( SvtxTrack tr1,
SvtxTrack tr2 
)
private

Definition at line 330 of file PHSimpleVertexFinder.cc.

View newest version in sPHENIX GitHub at line 330 of file PHSimpleVertexFinder.cc

References _beamline_xy_cut, _dcacut, _track_pair_map, _track_pair_pca_map, _track_pt_cut, dcaTwoLines(), SvtxTrack::get_id(), SvtxTrack::get_p(), SvtxTrack::get_pt(), SvtxTrack::get_px(), SvtxTrack::get_py(), SvtxTrack::get_pz(), SvtxTrack::get_x(), SvtxTrack::get_y(), SvtxTrack::get_z(), and Fun4AllBase::Verbosity().

Referenced by checkDCAs().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double PHSimpleVertexFinder::getAverage ( std::vector< double > &  v)
private

Definition at line 646 of file PHSimpleVertexFinder.cc.

View newest version in sPHENIX GitHub at line 646 of file PHSimpleVertexFinder.cc

References it, and Fun4AllBase::Verbosity().

Referenced by removeOutlierTrackPairs().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double PHSimpleVertexFinder::getMedian ( std::vector< double > &  v)
private

Definition at line 613 of file PHSimpleVertexFinder.cc.

View newest version in sPHENIX GitHub at line 613 of file PHSimpleVertexFinder.cc

References m, m2, and Fun4AllBase::Verbosity().

Referenced by removeOutlierTrackPairs().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int PHSimpleVertexFinder::GetNodes ( PHCompositeNode topNode)
private

Definition at line 260 of file PHSimpleVertexFinder.cc.

View newest version in sPHENIX GitHub at line 260 of file PHSimpleVertexFinder.cc

References _track_map, Fun4AllReturnCodes::ABORTEVENT, Fun4AllReturnCodes::EVENT_OK, and PHWHERE.

Referenced by InitRun().

+ Here is the caller graph for this function:

int PHSimpleVertexFinder::InitRun ( PHCompositeNode )
overridevirtual

Called for first event when run number is known. Typically this is where you may want to fetch data from database, because you know the run number.

Reimplemented from SubsysReco.

Definition at line 53 of file PHSimpleVertexFinder.cc.

View newest version in sPHENIX GitHub at line 53 of file PHSimpleVertexFinder.cc

References CreateNodes(), Fun4AllReturnCodes::EVENT_OK, and GetNodes().

+ Here is the call graph for this function:

int PHSimpleVertexFinder::process_event ( PHCompositeNode )
overridevirtual

Called for each event. This is where you do the real work.

If we didn't find any matches, try again with a slightly larger DCA cut

Iterate through the tracks and assign the closest vtx id to the track position for propagating back to the vtx. Catches any tracks that were missed or were not compatible with any of the identified vertices

If there is a vertex already assigned, keep going

Reimplemented from SubsysReco.

Definition at line 63 of file PHSimpleVertexFinder.cc.

View newest version in sPHENIX GitHub at line 63 of file PHSimpleVertexFinder.cc

References _dcacut, _svtx_vertex_map, _track_map, _track_pair_map, _track_pair_pca_map, _vertex_covariance_map, _vertex_position_map, _vertex_set, _vertex_track_map, checkDCAs(), SvtxVertexMap::clear(), dz, Fun4AllReturnCodes::EVENT_OK, findConnectedTracks(), SvtxVertexMap::get(), SvtxTrackMap::get(), SvtxVertexMap::insert(), it, max, PHWHERE, pos(), removeOutlierTrackPairs(), SvtxTrack::set_vertex_id(), SvtxTrackMap::size(), track, and Fun4AllBase::Verbosity().

+ Here is the call graph for this function:

void PHSimpleVertexFinder::removeOutlierTrackPairs ( )
private

Definition at line 488 of file PHSimpleVertexFinder.cc.

View newest version in sPHENIX GitHub at line 488 of file PHSimpleVertexFinder.cc

References _outlier_cut, _track_pair_pca_map, _vertex_position_map, _vertex_set, _vertex_track_map, getAverage(), getMedian(), it, and Fun4AllBase::Verbosity().

Referenced by process_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void PHSimpleVertexFinder::setBeamLineCut ( const double  cut)
inline

Definition at line 40 of file PHSimpleVertexFinder.h.

View newest version in sPHENIX GitHub at line 40 of file PHSimpleVertexFinder.h

References _beamline_xy_cut.

void PHSimpleVertexFinder::setDcaCut ( const double  cut)
inline

Definition at line 41 of file PHSimpleVertexFinder.h.

View newest version in sPHENIX GitHub at line 41 of file PHSimpleVertexFinder.h

References _dcacut.

void PHSimpleVertexFinder::setNmvtxRequired ( unsigned int  n)
inline

Definition at line 44 of file PHSimpleVertexFinder.h.

View newest version in sPHENIX GitHub at line 44 of file PHSimpleVertexFinder.h

References _nmvtx_required, and n.

void PHSimpleVertexFinder::setOutlierPairCut ( const double  cut)
inline

Definition at line 46 of file PHSimpleVertexFinder.h.

View newest version in sPHENIX GitHub at line 46 of file PHSimpleVertexFinder.h

References _outlier_cut.

void PHSimpleVertexFinder::setRequireMVTX ( bool  set)
inline

Definition at line 43 of file PHSimpleVertexFinder.h.

View newest version in sPHENIX GitHub at line 43 of file PHSimpleVertexFinder.h

References _require_mvtx.

void PHSimpleVertexFinder::setTrackQualityCut ( double  cut)
inline

Definition at line 42 of file PHSimpleVertexFinder.h.

View newest version in sPHENIX GitHub at line 42 of file PHSimpleVertexFinder.h

References _qual_cut.

Member Data Documentation

double PHSimpleVertexFinder::_beamline_xy_cut = 0.2
private

Definition at line 69 of file PHSimpleVertexFinder.h.

View newest version in sPHENIX GitHub at line 69 of file PHSimpleVertexFinder.h

Referenced by findDcaTwoTracks(), and setBeamLineCut().

double PHSimpleVertexFinder::_dcacut = 0.0080
private

Definition at line 68 of file PHSimpleVertexFinder.h.

View newest version in sPHENIX GitHub at line 68 of file PHSimpleVertexFinder.h

Referenced by findDcaTwoTracks(), process_event(), and setDcaCut().

unsigned int PHSimpleVertexFinder::_nmvtx_required = 3
private

Definition at line 72 of file PHSimpleVertexFinder.h.

View newest version in sPHENIX GitHub at line 72 of file PHSimpleVertexFinder.h

Referenced by checkDCAs(), and setNmvtxRequired().

double PHSimpleVertexFinder::_outlier_cut = 0.015
private

Definition at line 74 of file PHSimpleVertexFinder.h.

View newest version in sPHENIX GitHub at line 74 of file PHSimpleVertexFinder.h

Referenced by removeOutlierTrackPairs(), and setOutlierPairCut().

double PHSimpleVertexFinder::_qual_cut = 5.0
private

Definition at line 70 of file PHSimpleVertexFinder.h.

View newest version in sPHENIX GitHub at line 70 of file PHSimpleVertexFinder.h

Referenced by checkDCAs(), and setTrackQualityCut().

bool PHSimpleVertexFinder::_require_mvtx = true
private

Definition at line 71 of file PHSimpleVertexFinder.h.

View newest version in sPHENIX GitHub at line 71 of file PHSimpleVertexFinder.h

Referenced by checkDCAs(), and setRequireMVTX().

SvtxVertexMap* PHSimpleVertexFinder::_svtx_vertex_map {nullptr}
private

Definition at line 66 of file PHSimpleVertexFinder.h.

View newest version in sPHENIX GitHub at line 66 of file PHSimpleVertexFinder.h

Referenced by CreateNodes(), and process_event().

SvtxTrack* PHSimpleVertexFinder::_track {nullptr}
private

Definition at line 65 of file PHSimpleVertexFinder.h.

View newest version in sPHENIX GitHub at line 65 of file PHSimpleVertexFinder.h

SvtxTrackMap* PHSimpleVertexFinder::_track_map {nullptr}
private

Definition at line 64 of file PHSimpleVertexFinder.h.

View newest version in sPHENIX GitHub at line 64 of file PHSimpleVertexFinder.h

Referenced by checkDCAs(), GetNodes(), and process_event().

std::multimap<unsigned int, std::pair<unsigned int, double> > PHSimpleVertexFinder::_track_pair_map
private

Definition at line 78 of file PHSimpleVertexFinder.h.

View newest version in sPHENIX GitHub at line 78 of file PHSimpleVertexFinder.h

Referenced by findConnectedTracks(), findDcaTwoTracks(), and process_event().

std::multimap<unsigned int, std::pair<unsigned int, std::pair<Eigen::Vector3d, Eigen::Vector3d> > > PHSimpleVertexFinder::_track_pair_pca_map
private

Definition at line 81 of file PHSimpleVertexFinder.h.

View newest version in sPHENIX GitHub at line 81 of file PHSimpleVertexFinder.h

Referenced by findDcaTwoTracks(), process_event(), and removeOutlierTrackPairs().

double PHSimpleVertexFinder::_track_pt_cut = 0.0
private

Definition at line 73 of file PHSimpleVertexFinder.h.

View newest version in sPHENIX GitHub at line 73 of file PHSimpleVertexFinder.h

Referenced by findDcaTwoTracks().

std::map<unsigned int, matrix_t> PHSimpleVertexFinder::_vertex_covariance_map
private

Definition at line 83 of file PHSimpleVertexFinder.h.

View newest version in sPHENIX GitHub at line 83 of file PHSimpleVertexFinder.h

Referenced by process_event().

std::map<unsigned int, Eigen::Vector3d> PHSimpleVertexFinder::_vertex_position_map
private

Definition at line 82 of file PHSimpleVertexFinder.h.

View newest version in sPHENIX GitHub at line 82 of file PHSimpleVertexFinder.h

Referenced by process_event(), and removeOutlierTrackPairs().

std::set<unsigned int> PHSimpleVertexFinder::_vertex_set
private

Definition at line 84 of file PHSimpleVertexFinder.h.

View newest version in sPHENIX GitHub at line 84 of file PHSimpleVertexFinder.h

Referenced by process_event(), and removeOutlierTrackPairs().

std::multimap<unsigned int, unsigned int> PHSimpleVertexFinder::_vertex_track_map
private

Definition at line 76 of file PHSimpleVertexFinder.h.

View newest version in sPHENIX GitHub at line 76 of file PHSimpleVertexFinder.h

Referenced by process_event(), and removeOutlierTrackPairs().


The documentation for this class was generated from the following files: