CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
l1tVertexFinder::RecoVertex< T > Class Template Reference

#include <RecoVertex.h>

Public Member Functions

void clear ()
 Clear track vector. More...
 
bool hasHighPt () const
 Compute vertex parameters. More...
 
double highestPt () const
 highest track pT in the vertex More...
 
void insert (const T *fitTrack)
 Assign fitted track to this vertex. More...
 
void isPrimary (bool is)
 Set primary vertex tag. More...
 
unsigned int numHighPtTracks () const
 Number of high-pT tracks (pT > 10 GeV) More...
 
unsigned int numTracks () const
 Number of tracks originating from this vertex. More...
 
unsigned int numTrueTracks () const
 Number of true particles assigned to this vertex. More...
 
RecoVertexoperator+= (const RecoVertex &rhs)
 Operators. More...
 
bool primaryVertex () const
 True if primary vertex. More...
 
double pt () const
 Sum of fitted tracks transverse momentum [GeV]. More...
 
 RecoVertex (const double z0=-999.)
 Basic constructor. More...
 
 RecoVertex (RecoVertex< L1Track > &vertex, std::map< const edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ >>, const T *> trackAssociationMap)
 Conversion from RecoVertex<L1Track> RecoVertex<T> More...
 
 RecoVertex (const l1t::Vertex &vertex, std::map< const edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ >>, const T *> trackAssociationMap)
 Conversion from l1t::Vertex to l1tVertexFinder::RecoVertex. More...
 
void setParameters (double pt, double z0, double width=-999., bool highPt=false, unsigned int nHighPt=-999, double highestPt=-999., bool pv=false)
 Set the vertex parameters. More...
 
void setPt (double pt)
 set the pT [GeV] of the vertex More...
 
void setZ0 (double z)
 Set z0 position [cm]. More...
 
const std::vector< const T * > & tracks () const
 Tracks in the vertex. More...
 
const std::set< const TP * > & trueTracks () const
 Tracking particles asociated to the vertex. More...
 
l1t::Vertex vertex () const
 Get the equivalent l1t::Vertex. More...
 
double z0 () const
 Vertex z0 position [cm]. More...
 
double z0width () const
 Vertex z0 width [cm]. More...
 
 ~RecoVertex ()
 Basic destructor. More...
 

Private Attributes

double highestPt_
 
bool highPt_
 
unsigned int numHighPtTracks_
 
double pT_
 
bool pv_
 
std::vector< const T * > tracks_
 
std::set< const TP * > trueTracks_
 
double z0_
 
double z0width_
 

Detailed Description

template<typename T = L1Track>
class l1tVertexFinder::RecoVertex< T >

Definition at line 15 of file RecoVertex.h.

Constructor & Destructor Documentation

◆ RecoVertex() [1/3]

template<typename T >
l1tVertexFinder::RecoVertex< T >::RecoVertex ( const double  z0 = -999.)

◆ RecoVertex() [2/3]

template<typename T >
l1tVertexFinder::RecoVertex< T >::RecoVertex ( RecoVertex< L1Track > &  vertex,
std::map< const edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ >>, const T *>  trackAssociationMap 
)

Conversion from RecoVertex<L1Track> RecoVertex<T>

Definition at line 105 of file RecoVertex.h.

References l1ct::clear(), edm::eventsetup::heterocontainer::insert(), and bphysicsOniaDQM_cfi::vertex.

106  {
107  z0_ = vertex.z0();
108  z0width_ = vertex.z0width();
109  pT_ = vertex.pt();
110  highestPt_ = vertex.highestPt();
111  pv_ = vertex.primaryVertex();
112  highPt_ = vertex.hasHighPt();
113  numHighPtTracks_ = vertex.numHighPtTracks();
114  clear();
115 
116  // loop over base fitted tracks in reco vertex and find the corresponding TP
117  // track using the TTTrack - L1TrackTruthMatched map from above
118  for (const auto& trackIt : vertex.tracks()) {
119  // using insert ensures that true tracks are also stored in vertex object
120  insert(trackAssociationMap[trackIt->getTTTrackPtr()]);
121  }
122  }
unsigned int numHighPtTracks_
Definition: RecoVertex.h:88
const std::vector< edm::Ptr< Track_t > > & tracks() const
Definition: Vertex.h:23
l1t::Vertex vertex() const
Get the equivalent l1t::Vertex.
Definition: RecoVertex.h:157
float pt() const
Definition: Vertex.h:20
void clear()
Clear track vector.
Definition: RecoVertex.h:35
float z0() const
Definition: Vertex.h:21
void insert(const T *fitTrack)
Assign fitted track to this vertex.
Definition: RecoVertex.h:43

◆ RecoVertex() [3/3]

template<typename T >
l1tVertexFinder::RecoVertex< T >::RecoVertex ( const l1t::Vertex vertex,
std::map< const edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ >>, const T *>  trackAssociationMap 
)

Conversion from l1t::Vertex to l1tVertexFinder::RecoVertex.

Definition at line 125 of file RecoVertex.h.

References l1ct::clear(), edm::eventsetup::heterocontainer::insert(), HLT_2024v11_cff::track, and bphysicsOniaDQM_cfi::vertex.

126  {
127  z0_ = vertex.z0();
128  z0width_ = -999.;
129  pT_ = vertex.pt();
130  highestPt_ = -999.;
131  pv_ = false;
132  highPt_ = false;
133  numHighPtTracks_ = 0;
134  clear();
135 
136  // populate vertex with tracks and TP track using the
137  // TTTrack - L1TrackTruthMatched map from above
138  for (const auto& track : vertex.tracks()) {
139  // using insert ensures that true tracks are also stored in vertex object
140  insert(trackAssociationMap.at(track));
141  }
142  }
unsigned int numHighPtTracks_
Definition: RecoVertex.h:88
const std::vector< edm::Ptr< Track_t > > & tracks() const
Definition: Vertex.h:23
l1t::Vertex vertex() const
Get the equivalent l1t::Vertex.
Definition: RecoVertex.h:157
float pt() const
Definition: Vertex.h:20
void clear()
Clear track vector.
Definition: RecoVertex.h:35
float z0() const
Definition: Vertex.h:21
void insert(const T *fitTrack)
Assign fitted track to this vertex.
Definition: RecoVertex.h:43

◆ ~RecoVertex()

template<typename T = L1Track>
l1tVertexFinder::RecoVertex< T >::~RecoVertex ( )
inline

Basic destructor.

Definition at line 26 of file RecoVertex.h.

26 {}

Member Function Documentation

◆ clear()

void l1tVertexFinder::RecoVertexWithTP::clear ( void  )
inline

Clear track vector.

Definition at line 35 of file RecoVertex.h.

References l1tVertexFinder::RecoVertex< T >::tracks_.

Referenced by l1tVertexFinder::RecoVertex< T >::RecoVertex().

35 { tracks_.clear(); }
std::vector< const T * > tracks_
Definition: RecoVertex.h:84

◆ hasHighPt()

template<typename T = L1Track>
bool l1tVertexFinder::RecoVertex< T >::hasHighPt ( ) const
inline

Compute vertex parameters.

Contain high-pT track?

Definition at line 39 of file RecoVertex.h.

References l1tVertexFinder::RecoVertex< T >::highPt_.

39 { return highPt_; }

◆ highestPt()

template<typename T = L1Track>
double l1tVertexFinder::RecoVertex< T >::highestPt ( ) const
inline

highest track pT in the vertex

Definition at line 41 of file RecoVertex.h.

References l1tVertexFinder::RecoVertex< T >::highestPt_.

41 { return highestPt_; }

◆ insert()

template<typename T = L1Track>
void l1tVertexFinder::RecoVertex< T >::insert ( const T fitTrack)
inline

Assign fitted track to this vertex.

Definition at line 43 of file RecoVertex.h.

References l1tVertexFinder::RecoVertex< T >::tracks_.

43 { tracks_.push_back(fitTrack); }
std::vector< const T * > tracks_
Definition: RecoVertex.h:84

◆ isPrimary()

template<typename T = L1Track>
void l1tVertexFinder::RecoVertex< T >::isPrimary ( bool  is)
inline

Set primary vertex tag.

Definition at line 45 of file RecoVertex.h.

References l1tVertexFinder::RecoVertex< T >::pv_.

45 { pv_ = is; }

◆ numHighPtTracks()

template<typename T = L1Track>
unsigned int l1tVertexFinder::RecoVertex< T >::numHighPtTracks ( ) const
inline

Number of high-pT tracks (pT > 10 GeV)

Definition at line 47 of file RecoVertex.h.

References l1tVertexFinder::RecoVertex< T >::numHighPtTracks_.

47 { return numHighPtTracks_; }
unsigned int numHighPtTracks_
Definition: RecoVertex.h:88

◆ numTracks()

template<typename T = L1Track>
unsigned int l1tVertexFinder::RecoVertex< T >::numTracks ( ) const
inline

Number of tracks originating from this vertex.

Definition at line 49 of file RecoVertex.h.

References l1tVertexFinder::RecoVertex< T >::tracks_.

Referenced by l1tVertexFinder::VertexFinder::meanDistance().

49 { return tracks_.size(); }
std::vector< const T * > tracks_
Definition: RecoVertex.h:84

◆ numTrueTracks()

template<typename T = L1Track>
unsigned int l1tVertexFinder::RecoVertex< T >::numTrueTracks ( ) const
inline

Number of true particles assigned to this vertex.

Definition at line 51 of file RecoVertex.h.

References l1tVertexFinder::RecoVertex< T >::trueTracks_.

51 { return trueTracks_.size(); }
std::set< const TP * > trueTracks_
Definition: RecoVertex.h:85

◆ operator+=()

RecoVertexWithTP & l1tVertexFinder::RecoVertexWithTP::operator+= ( const RecoVertex< T > &  rhs)
inline

Operators.

Definition at line 29 of file RecoVertex.h.

References l1tVertexFinder::RecoVertex< T >::tracks(), and l1tVertexFinder::RecoVertex< T >::tracks_.

29  {
30  this->tracks_.insert(std::end(this->tracks_), std::begin(rhs.tracks()), std::end(rhs.tracks()));
31  return *this;
32  }
std::vector< const T * > tracks_
Definition: RecoVertex.h:84

◆ primaryVertex()

template<typename T = L1Track>
bool l1tVertexFinder::RecoVertex< T >::primaryVertex ( ) const
inline

True if primary vertex.

Definition at line 53 of file RecoVertex.h.

References l1tVertexFinder::RecoVertex< T >::pv_.

53 { return pv_; }

◆ pt()

template<typename T = L1Track>
double l1tVertexFinder::RecoVertex< T >::pt ( ) const
inline

◆ setParameters()

template<typename T >
void l1tVertexFinder::RecoVertex< T >::setParameters ( double  pt,
double  z0,
double  width = -999.,
bool  highPt = false,
unsigned int  nHighPt = -999,
double  highestPt = -999.,
bool  pv = false 
)

Set the vertex parameters.

Definition at line 145 of file RecoVertex.h.

References DiDispStaMuonMonitor_cfi::pt, MetAnalyzer::pv(), and ApeEstimator_cff::width.

146  {
147  pT_ = pt;
148  z0_ = z0;
149  z0width_ = width;
150  highPt_ = highPt;
151  numHighPtTracks_ = nHighPt;
153  pv_ = pv;
154  }
double pt() const
Sum of fitted tracks transverse momentum [GeV].
Definition: RecoVertex.h:55
unsigned int numHighPtTracks_
Definition: RecoVertex.h:88
double highestPt() const
highest track pT in the vertex
Definition: RecoVertex.h:41
double z0() const
Vertex z0 position [cm].
Definition: RecoVertex.h:75
def pv(vc)
Definition: MetAnalyzer.py:7

◆ setPt()

template<typename T = L1Track>
void l1tVertexFinder::RecoVertex< T >::setPt ( double  pt)
inline

set the pT [GeV] of the vertex

Definition at line 61 of file RecoVertex.h.

References l1tVertexFinder::RecoVertex< T >::pt(), and l1tVertexFinder::RecoVertex< T >::pT_.

61 { pT_ = pt; }
double pt() const
Sum of fitted tracks transverse momentum [GeV].
Definition: RecoVertex.h:55

◆ setZ0()

template<typename T = L1Track>
void l1tVertexFinder::RecoVertex< T >::setZ0 ( double  z)
inline

Set z0 position [cm].

Definition at line 63 of file RecoVertex.h.

References l1tVertexFinder::RecoVertex< T >::z0_.

◆ tracks()

template<typename T = L1Track>
const std::vector<const T*>& l1tVertexFinder::RecoVertex< T >::tracks ( void  ) const
inline

◆ trueTracks()

template<typename T = L1Track>
const std::set<const TP*>& l1tVertexFinder::RecoVertex< T >::trueTracks ( ) const
inline

Tracking particles asociated to the vertex.

Definition at line 59 of file RecoVertex.h.

References l1tVertexFinder::RecoVertex< T >::trueTracks_.

59 { return trueTracks_; }
std::set< const TP * > trueTracks_
Definition: RecoVertex.h:85

◆ vertex()

template<typename T >
l1t::Vertex l1tVertexFinder::RecoVertex< T >::vertex ( ) const

Get the equivalent l1t::Vertex.

Definition at line 157 of file RecoVertex.h.

References submitPVValidationJobs::t, DiMuonV_cfg::tracks, and HltBtagValidation_cff::Vertex.

Referenced by Tau.Tau::dxy().

157  {
158  std::vector<edm::Ptr<l1t::Vertex::Track_t>> tracks;
159  tracks.reserve(tracks_.size());
160  for (const auto& t : tracks_) {
161  tracks.push_back(t->getTTTrackPtr());
162  }
163  return l1t::Vertex(pT_, z0_, tracks);
164  }
const std::vector< const T * > & tracks() const
Tracks in the vertex.
Definition: RecoVertex.h:57
std::vector< const T * > tracks_
Definition: RecoVertex.h:84

◆ z0()

template<typename T = L1Track>
double l1tVertexFinder::RecoVertex< T >::z0 ( ) const
inline

◆ z0width()

template<typename T = L1Track>
double l1tVertexFinder::RecoVertex< T >::z0width ( ) const
inline

Vertex z0 width [cm].

Definition at line 77 of file RecoVertex.h.

References l1tVertexFinder::RecoVertex< T >::z0width_.

77 { return z0width_; }

Member Data Documentation

◆ highestPt_

template<typename T = L1Track>
double l1tVertexFinder::RecoVertex< T >::highestPt_
private

◆ highPt_

template<typename T = L1Track>
bool l1tVertexFinder::RecoVertex< T >::highPt_
private

◆ numHighPtTracks_

template<typename T = L1Track>
unsigned int l1tVertexFinder::RecoVertex< T >::numHighPtTracks_
private

◆ pT_

template<typename T = L1Track>
double l1tVertexFinder::RecoVertex< T >::pT_
private

◆ pv_

template<typename T = L1Track>
bool l1tVertexFinder::RecoVertex< T >::pv_
private

◆ tracks_

template<typename T = L1Track>
std::vector<const T*> l1tVertexFinder::RecoVertex< T >::tracks_
private

◆ trueTracks_

template<typename T = L1Track>
std::set<const TP*> l1tVertexFinder::RecoVertex< T >::trueTracks_
private

◆ z0_

template<typename T = L1Track>
double l1tVertexFinder::RecoVertex< T >::z0_
private

◆ z0width_

template<typename T = L1Track>
double l1tVertexFinder::RecoVertex< T >::z0width_
private