CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
TransientVertex Class Reference

#include <TransientVertex.h>

Public Types

typedef std::map< reco::TransientTrack, float > TransientTrackToFloatMap
 

Public Member Functions

bool hasPrior () const
 
bool hasRefittedTracks () const
 
bool hasTrackWeight () const
 
bool isValid () const
 
 operator reco::Vertex () const
 
 operator reco::VertexCompositePtrCandidate () const
 
reco::TransientTrack originalTrack (const reco::TransientTrack &refTrack) const
 
std::vector< reco::TransientTrack > const & originalTracks () const
 
GlobalPoint position () const
 
GlobalError positionError () const
 
GlobalError priorError () const
 
GlobalPoint priorPosition () const
 
double priorTime () const
 
double priorTimeError () const
 
reco::TransientTrack refittedTrack (const reco::TransientTrack &track) const
 
std::vector< reco::TransientTrack > const & refittedTracks () const
 
void refittedTracks (const std::vector< reco::TransientTrack > &refittedTracks)
 
double time () const
 
double timeError () const
 
AlgebraicMatrix33 tkToTkCovariance (const reco::TransientTrack &t1, const reco::TransientTrack &t2) const
 
void tkToTkCovariance (const TTtoTTmap &covMap)
 
bool tkToTkCovarianceIsAvailable () const
 
float trackWeight (const reco::TransientTrack &track) const
 
 TransientVertex ()
 
 TransientVertex (const GlobalPoint &pos, const double time, const GlobalError &posError, const std::vector< reco::TransientTrack > &tracks, float chi2)
 
 TransientVertex (const GlobalPoint &pos, const double time, const GlobalError &posError, const std::vector< reco::TransientTrack > &tracks, float chi2, float ndf)
 
 TransientVertex (const GlobalPoint &pos, const GlobalError &posError, const std::vector< reco::TransientTrack > &tracks, float chi2)
 
 TransientVertex (const GlobalPoint &pos, const GlobalError &posError, const std::vector< reco::TransientTrack > &tracks, float chi2, float ndf)
 
 TransientVertex (const GlobalPoint &priorPos, const double priorTime, const GlobalError &priorErr, const GlobalPoint &pos, const double time, const GlobalError &posError, const std::vector< reco::TransientTrack > &tracks, float chi2)
 
 TransientVertex (const GlobalPoint &priorPos, const double priorTime, const GlobalError &priorErr, const GlobalPoint &pos, const double time, const GlobalError &posError, const std::vector< reco::TransientTrack > &tracks, float chi2, float ndf)
 
 TransientVertex (const GlobalPoint &priorPos, const GlobalError &priorErr, const double priorTime, const double priorTimeErr, const GlobalPoint &pos, const GlobalError &posError, const double time, const double timeErr, const std::vector< reco::TransientTrack > &tracks, float chi2, float ndf)
 
 TransientVertex (const GlobalPoint &priorPos, const GlobalError &priorErr, const GlobalPoint &pos, const GlobalError &posError, const std::vector< reco::TransientTrack > &tracks, float chi2)
 
 TransientVertex (const GlobalPoint &priorPos, const GlobalError &priorErr, const GlobalPoint &pos, const GlobalError &posError, const std::vector< reco::TransientTrack > &tracks, float chi2, float ndf)
 
 TransientVertex (const VertexState &prior, const VertexState &state, const std::vector< reco::TransientTrack > &tracks, float chi2)
 
 TransientVertex (const VertexState &prior, const VertexState &state, const std::vector< reco::TransientTrack > &tracks, float chi2, float ndf)
 
 TransientVertex (const VertexState &state, const std::vector< reco::TransientTrack > &tracks, float chi2)
 
 TransientVertex (const VertexState &state, const std::vector< reco::TransientTrack > &tracks, float chi2, float ndf)
 
VertexState const & vertexState () const
 
TransientTrackToFloatMap weightMap () const
 
void weightMap (const TransientTrackToFloatMap &theMap)
 

Private Attributes

float theChi2
 
TTtoTTmap theCovMap
 
bool theCovMapAvailable
 
float theNDF
 
std::vector< reco::TransientTracktheOriginalTracks
 
VertexState thePriorVertexState
 
std::vector< reco::TransientTracktheRefittedTracks
 
VertexState theVertexState
 
TransientTrackToFloatMap theWeightMap
 
bool theWeightMapIsAvailable
 
bool vertexValid
 
bool withPrior
 
bool withRefittedTracks
 

Detailed Description

Definition at line 18 of file TransientVertex.h.

Member Typedef Documentation

◆ TransientTrackToFloatMap

Definition at line 21 of file TransientVertex.h.

Constructor & Destructor Documentation

◆ TransientVertex() [1/14]

TransientVertex::TransientVertex ( )

Empty constructor, produces invalid vertex

Definition at line 11 of file TransientVertex.cc.

12  : theVertexState(),
14  theChi2(0),
15  theNDF(0),
16  vertexValid(false),
17  withPrior(false),
19  theCovMapAvailable(false),
20  withRefittedTracks(false) {}

◆ TransientVertex() [2/14]

TransientVertex::TransientVertex ( const GlobalPoint pos,
const GlobalError posError,
const std::vector< reco::TransientTrack > &  tracks,
float  chi2 
)

Constructor defining the RecVertex by its 3D position and position uncertainty, its associated tracks and its chi-squared. The number of degrees of freedom is equal to 2*nb of tracks - 3.

Definition at line 22 of file TransientVertex.cc.

28  theChi2(chi2),
29  theNDF(0),
30  vertexValid(true),
31  withPrior(false),
33  theCovMapAvailable(false),
34  withRefittedTracks(false) {
35  theNDF = 2. * theOriginalTracks.size() - 3.;
36 }

References theNDF, and theOriginalTracks.

◆ TransientVertex() [3/14]

TransientVertex::TransientVertex ( const GlobalPoint pos,
const double  time,
const GlobalError posError,
const std::vector< reco::TransientTrack > &  tracks,
float  chi2 
)

Definition at line 38 of file TransientVertex.cc.

43  : theVertexState(pos, time, posTimeError),
45  theChi2(chi2),
46  theNDF(0),
47  vertexValid(true),
48  withPrior(false),
50  theCovMapAvailable(false),
51  withRefittedTracks(false) {
52  theNDF = 2. * theOriginalTracks.size() - 3.;
53 }

References theNDF, and theOriginalTracks.

◆ TransientVertex() [4/14]

TransientVertex::TransientVertex ( const GlobalPoint pos,
const GlobalError posError,
const std::vector< reco::TransientTrack > &  tracks,
float  chi2,
float  ndf 
)

Constructor defining the RecVertex by its 3D position and position uncertainty, its associated tracks, its chi-squared and its number of degrees of freedom. The ndf can be a float.

Definition at line 55 of file TransientVertex.cc.

62  theChi2(chi2),
63  theNDF(ndf),
64  vertexValid(true),
65  withPrior(false),
67  theCovMapAvailable(false),
68  withRefittedTracks(false) {}

◆ TransientVertex() [5/14]

TransientVertex::TransientVertex ( const GlobalPoint pos,
const double  time,
const GlobalError posError,
const std::vector< reco::TransientTrack > &  tracks,
float  chi2,
float  ndf 
)

Definition at line 70 of file TransientVertex.cc.

76  : theVertexState(pos, time, posTimeError),
78  theChi2(chi2),
79  theNDF(ndf),
80  vertexValid(true),
81  withPrior(false),
83  theCovMapAvailable(false),
84  withRefittedTracks(false) {}

◆ TransientVertex() [6/14]

TransientVertex::TransientVertex ( const GlobalPoint priorPos,
const GlobalError priorErr,
const GlobalPoint pos,
const GlobalError posError,
const std::vector< reco::TransientTrack > &  tracks,
float  chi2 
)

Constructor defining the RecVertex by the prior, the vertex 3D position and uncertainty, the associated tracks and the chi-squared. Since the prior brings information on 3 coordinates, the number of degrees of freedom is equal to 2*nb of tracks.

Definition at line 86 of file TransientVertex.cc.

92  : thePriorVertexState(priorPos, priorErr),
95  theChi2(chi2),
96  theNDF(0),
97  vertexValid(true),
98  withPrior(true),
100  theCovMapAvailable(false),
101  withRefittedTracks(false) {
102  theNDF = 2. * theOriginalTracks.size();
103 }

References theNDF, and theOriginalTracks.

◆ TransientVertex() [7/14]

TransientVertex::TransientVertex ( const GlobalPoint priorPos,
const double  priorTime,
const GlobalError priorErr,
const GlobalPoint pos,
const double  time,
const GlobalError posError,
const std::vector< reco::TransientTrack > &  tracks,
float  chi2 
)

Definition at line 105 of file TransientVertex.cc.

113  : thePriorVertexState(priorPos, priorTime, priorErr),
116  theChi2(chi2),
117  theNDF(0),
118  vertexValid(true),
119  withPrior(true),
121  theCovMapAvailable(false),
122  withRefittedTracks(false) {
123  theNDF = 2. * theOriginalTracks.size();
124 }

References theNDF, and theOriginalTracks.

◆ TransientVertex() [8/14]

TransientVertex::TransientVertex ( const GlobalPoint priorPos,
const GlobalError priorErr,
const GlobalPoint pos,
const GlobalError posError,
const std::vector< reco::TransientTrack > &  tracks,
float  chi2,
float  ndf 
)

Constructor defining the RecVertex by the prior, the vertex 3D position and uncertainty, the associated tracks, the chi-squared and the number of degrees of freedom. The ndf can be a float.

Definition at line 126 of file TransientVertex.cc.

133  : thePriorVertexState(priorPos, priorErr),
136  theChi2(chi2),
137  theNDF(ndf),
138  vertexValid(true),
139  withPrior(true),
141  theCovMapAvailable(false),
142  withRefittedTracks(false) {}

◆ TransientVertex() [9/14]

TransientVertex::TransientVertex ( const GlobalPoint priorPos,
const double  priorTime,
const GlobalError priorErr,
const GlobalPoint pos,
const double  time,
const GlobalError posError,
const std::vector< reco::TransientTrack > &  tracks,
float  chi2,
float  ndf 
)

Definition at line 144 of file TransientVertex.cc.

153  : thePriorVertexState(priorPos, priorTime, priorErr),
156  theChi2(chi2),
157  theNDF(ndf),
158  vertexValid(true),
159  withPrior(true),
161  theCovMapAvailable(false),
162  withRefittedTracks(false) {}

◆ TransientVertex() [10/14]

TransientVertex::TransientVertex ( const GlobalPoint priorPos,
const GlobalError priorErr,
const double  priorTime,
const double  priorTimeErr,
const GlobalPoint pos,
const GlobalError posError,
const double  time,
const double  timeErr,
const std::vector< reco::TransientTrack > &  tracks,
float  chi2,
float  ndf 
)

Constructor defining the RecVertex by the prior, the vertex 3D position and uncertainty, time and uncertainty, the associated tracks, the chi-squared and the number of degrees of freedom. The ndf can be a float.

◆ TransientVertex() [11/14]

TransientVertex::TransientVertex ( const VertexState state,
const std::vector< reco::TransientTrack > &  tracks,
float  chi2 
)

Constructor defining the RecVertex by its 3D position and position uncertainty, its associated tracks and its chi-squared. The number of degrees of freedom is equal to 2*nb of tracks - 3.

Definition at line 164 of file TransientVertex.cc.

167  theChi2(chi2),
168  theNDF(0),
169  vertexValid(true),
170  withPrior(false),
172  theCovMapAvailable(false),
173  withRefittedTracks(false) {
174  theNDF = 2. * theOriginalTracks.size() - 3.;
175 }

References theNDF, and theOriginalTracks.

◆ TransientVertex() [12/14]

TransientVertex::TransientVertex ( const VertexState state,
const std::vector< reco::TransientTrack > &  tracks,
float  chi2,
float  ndf 
)

Constructor defining the RecVertex by its 3D position and position uncertainty, its associated tracks, its chi-squared and its number of degrees of freedom. The ndf can be a float.

Definition at line 177 of file TransientVertex.cc.

183  theChi2(chi2),
184  theNDF(ndf),
185  vertexValid(true),
186  withPrior(false),
188  theCovMapAvailable(false),
189  withRefittedTracks(false) {}

◆ TransientVertex() [13/14]

TransientVertex::TransientVertex ( const VertexState prior,
const VertexState state,
const std::vector< reco::TransientTrack > &  tracks,
float  chi2 
)

Constructor defining the RecVertex by the prior, the vertex 3D position and uncertainty, the associated tracks and the chi-squared. Since the prior brings information on 3 coordinates, the number of degrees of freedom is equal to 2*nb of tracks.

Definition at line 191 of file TransientVertex.cc.

198  theChi2(chi2),
199  theNDF(0),
200  vertexValid(true),
201  withPrior(true),
203  theCovMapAvailable(false),
204  withRefittedTracks(false) {
205  theNDF = 2. * theOriginalTracks.size();
206 }

References theNDF, and theOriginalTracks.

◆ TransientVertex() [14/14]

TransientVertex::TransientVertex ( const VertexState prior,
const VertexState state,
const std::vector< reco::TransientTrack > &  tracks,
float  chi2,
float  ndf 
)

Constructor defining the RecVertex by the prior, the vertex 3D position and uncertainty, the associated tracks, the chi-squared and the number of degrees of freedom. The ndf can be a float.

Definition at line 208 of file TransientVertex.cc.

216  theChi2(chi2),
217  theNDF(ndf),
218  vertexValid(true),
219  withPrior(true),
221  theCovMapAvailable(false),
222  withRefittedTracks(false) {}

Member Function Documentation

◆ hasPrior()

bool TransientVertex::hasPrior ( ) const
inline

Definition at line 181 of file TransientVertex.h.

181 { return withPrior; }

References withPrior.

Referenced by AdaptiveVertexReconstructor::cleanUp().

◆ hasRefittedTracks()

bool TransientVertex::hasRefittedTracks ( ) const
inline

Returns true if at for at least one of the original tracks, the refitted track is available

Definition at line 206 of file TransientVertex.h.

206 { return withRefittedTracks; }

References withRefittedTracks.

Referenced by AdaptiveVertexReconstructor::cleanUp(), V0Fitter::fitAll(), and PFTauSecondaryVertexProducer::produce().

◆ hasTrackWeight()

bool TransientVertex::hasTrackWeight ( ) const
inline

Returns true if the track-weights are available.

Definition at line 233 of file TransientVertex.h.

233 { return theWeightMapIsAvailable; }

References theWeightMapIsAvailable.

◆ isValid()

bool TransientVertex::isValid ( void  ) const
inline

Implements method of abstract Vertex. Returns track pointer container by value ‍/ Vertex::TrackPtrContainer tracks() const;

float totalChiSquared() const { return theChi2; } float normalisedChiSquared() const { return totalChiSquared() / degreesOfFreedom(); } float degreesOfFreedom() const { return theNDF; }

/** Returns true if vertex is valid. An invalid RecVertex is created e.g. when vertex fitting fails.

Definition at line 195 of file TransientVertex.h.

195 { return vertexValid; }

References vertexValid.

Referenced by ntupleDataFormat._Object::_checkIsValid(), KineExample::analyze(), BPHMonitor::analyze(), DiMuonVertexValidation::analyze(), DiElectronVertexValidation::analyze(), SplitVertexResolution::analyze(), PrimaryVertexResolution::Plots::calculateAndFillResolution(), VertexFitterResult::fill(), LeptonSkimming::filter(), AlignmentTrackFromVertexSelector::findClosestVertex(), V0Fitter::fitAll(), HIPTwoBodyDecayAnalyzer::fitDimuonVertex(), PFDisplacedVertexFinder::fitVertexFromSeed(), HLTmmkFilter::hltFilter(), HLTmmkkFilter::hltFilter(), HLTDisplacedmumumuVtxProducer::produce(), HLTDisplacedmumuVtxProducer::produce(), HLTDisplacedtktktkVtxProducer::produce(), HLTDisplacedtktkVtxProducer::produce(), HLTmumutktkVtxProducer::produce(), Onia2MuMuPAT::produce(), HLTmumutkVtxProducer::produce(), PFTauPrimaryVertexProducerBase::produce(), TemplatedInclusiveVertexFinder< InputContainer, VTX >::produce(), core.AutoHandle.AutoHandle::ReallyLoad(), and TrackVertexArbitration< VTX >::trackVertexArbitrator().

◆ operator reco::Vertex()

TransientVertex::operator reco::Vertex ( ) const

Definition at line 301 of file TransientVertex.cc.

301  {
302  //If the vertex is invalid, return an invalid TV !
303  if (!isValid())
304  return Vertex();
305 
307  // RecoVertex::convertError(theVertexState.error()),
310  totalChiSquared(),
311  degreesOfFreedom(),
312  theOriginalTracks.size());
313  for (std::vector<TransientTrack>::const_iterator i = theOriginalTracks.begin(); i != theOriginalTracks.end(); ++i) {
314  // const TrackTransientTrack* ttt = dynamic_cast<const TrackTransientTrack*>((*i).basicTransientTrack());
315  // if ((ttt!=0) && (ttt->persistentTrackRef().isNonnull()))
316  // {
317  // TrackRef tr = ttt->persistentTrackRef();
318  // TrackBaseRef tbr(tr);
319  if (withRefittedTracks) {
320  vertex.add((*i).trackBaseRef(), refittedTrack(*i).track(), trackWeight(*i));
321  } else {
322  vertex.add((*i).trackBaseRef(), trackWeight(*i));
323  }
324  //}
325  }
326  return vertex;
327 }

References mps_fire::i, sistrip::SpyUtilities::isValid(), trackWeight(), bphysicsOniaDQM_cfi::vertex, and HltBtagValidation_cff::Vertex.

◆ operator reco::VertexCompositePtrCandidate()

TransientVertex::operator reco::VertexCompositePtrCandidate ( ) const

Definition at line 329 of file TransientVertex.cc.

329  {
330  using namespace reco;
331  if (!isValid())
333 
334  VertexCompositePtrCandidate vtxCompPtrCand;
335 
336  vtxCompPtrCand.setTime(vertexState().time());
337  vtxCompPtrCand.setCovariance(vertexState().error4D().matrix4D());
338  vtxCompPtrCand.setChi2AndNdof(totalChiSquared(), degreesOfFreedom());
339  vtxCompPtrCand.setVertex(Candidate::Point(position().x(), position().y(), position().z()));
340 
342  for (std::vector<reco::TransientTrack>::const_iterator tt = theOriginalTracks.begin(); tt != theOriginalTracks.end();
343  ++tt) {
344  if (trackWeight(*tt) < 0.5)
345  continue;
346 
347  const CandidatePtrTransientTrack* cptt = dynamic_cast<const CandidatePtrTransientTrack*>(tt->basicTransientTrack());
348  if (cptt == nullptr)
349  edm::LogError("DynamicCastingFailed") << "Casting of TransientTrack to CandidatePtrTransientTrack failed!";
350  else {
351  p4 += cptt->candidate()->p4();
352  vtxCompPtrCand.addDaughter(cptt->candidate());
353  }
354  }
355 
356  //TODO: if has refitted tracks we should scale the candidate p4 to the refitted one
357  vtxCompPtrCand.setP4(p4);
358  return vtxCompPtrCand;
359 }

References reco::CompositePtrCandidate::addDaughter(), reco::CandidatePtrTransientTrack::candidate(), sistrip::SpyUtilities::isValid(), reco::Candidate::p4(), p4, position, reco::VertexCompositePtrCandidate::setChi2AndNdof(), reco::VertexCompositePtrCandidate::setCovariance(), reco::LeafCandidate::setP4(), reco::VertexCompositePtrCandidate::setTime(), reco::LeafCandidate::setVertex(), protons_cff::time, trackWeight(), and groupFilesInBlocks::tt.

◆ originalTrack()

TransientTrack TransientVertex::originalTrack ( const reco::TransientTrack refTrack) const

Returns the original track which corresponds to a particular refitted Track Throws an exception if now refitted tracks are stored ot the track is not found in the list

Definition at line 281 of file TransientVertex.cc.

281  {
282  if (theRefittedTracks.empty())
283  throw VertexException("No refitted tracks stored in vertex");
284  std::vector<TransientTrack>::const_iterator it = find(theRefittedTracks.begin(), theRefittedTracks.end(), refTrack);
285  if (it == theRefittedTracks.end())
286  throw VertexException("Refitted track not found in list");
287  size_t pos = it - theRefittedTracks.begin();
288  return theOriginalTracks[pos];
289 }

References spr::find(), theOriginalTracks, and theRefittedTracks.

◆ originalTracks()

std::vector<reco::TransientTrack> const& TransientVertex::originalTracks ( ) const
inline

◆ position()

GlobalPoint TransientVertex::position ( ) const
inline

◆ positionError()

GlobalError TransientVertex::positionError ( ) const
inline

◆ priorError()

GlobalError TransientVertex::priorError ( ) const
inline

◆ priorPosition()

GlobalPoint TransientVertex::priorPosition ( ) const
inline

Definition at line 173 of file TransientVertex.h.

173 { return thePriorVertexState.position(); }

References VertexState::position(), and thePriorVertexState.

Referenced by AdaptiveVertexReconstructor::cleanUp().

◆ priorTime()

double TransientVertex::priorTime ( ) const
inline

Definition at line 179 of file TransientVertex.h.

179 { return thePriorVertexState.time(); }

References thePriorVertexState, and VertexState::time().

◆ priorTimeError()

double TransientVertex::priorTimeError ( ) const
inline

Definition at line 180 of file TransientVertex.h.

180 { return thePriorVertexState.timeError(); }

References thePriorVertexState, and VertexState::timeError().

◆ refittedTrack()

TransientTrack TransientVertex::refittedTrack ( const reco::TransientTrack track) const

Returns the refitted track which corresponds to a particular original Track Throws an exception if now refitted tracks are stored ot the track is not found in the list

Definition at line 291 of file TransientVertex.cc.

291  {
292  if (theRefittedTracks.empty())
293  throw VertexException("No refitted tracks stored in vertex");
294  std::vector<TransientTrack>::const_iterator it = find(theOriginalTracks.begin(), theOriginalTracks.end(), track);
295  if (it == theOriginalTracks.end())
296  throw VertexException("Track not found in list");
297  size_t pos = it - theOriginalTracks.begin();
298  return theRefittedTracks[pos];
299 }

References spr::find(), theOriginalTracks, theRefittedTracks, and HLT_FULL_cff::track.

Referenced by PFDisplacedVertexFinder::fitVertexFromSeed().

◆ refittedTracks() [1/2]

std::vector<reco::TransientTrack> const& TransientVertex::refittedTracks ( ) const
inline

Access to the refitted tracks used to make the vertex. Returns track container by value.

Definition at line 211 of file TransientVertex.h.

211 { return theRefittedTracks; }

References theRefittedTracks.

Referenced by AdaptiveVertexReconstructor::cleanUp(), V0Fitter::fitAll(), CachingVertex< 5 >::operator TransientVertex(), PFTauSecondaryVertexProducer::produce(), and refittedTracks().

◆ refittedTracks() [2/2]

void TransientVertex::refittedTracks ( const std::vector< reco::TransientTrack > &  refittedTracks)

Method to set the refitted tracks used to make the vertex.

Definition at line 229 of file TransientVertex.cc.

229  {
230  if (refittedTracks.empty())
231  throw VertexException("TransientVertex::refittedTracks: No refitted tracks stored in input container");
233  withRefittedTracks = true;
234 }

References refittedTracks(), theRefittedTracks, and withRefittedTracks.

◆ time()

double TransientVertex::time ( ) const
inline

Definition at line 177 of file TransientVertex.h.

177 { return theVertexState.time(); }

References theVertexState, and VertexState::time().

◆ timeError()

double TransientVertex::timeError ( ) const
inline

Definition at line 178 of file TransientVertex.h.

178 { return theVertexState.timeError(); }

References theVertexState, and VertexState::timeError().

◆ tkToTkCovariance() [1/2]

AlgebraicMatrix33 TransientVertex::tkToTkCovariance ( const reco::TransientTrack t1,
const reco::TransientTrack t2 
) const

Returns the Track-to-track covariance matrix for two specified tracks. In case these do not exist, or one of the tracks does not belong to the vertex, an exception is thrown.

Definition at line 254 of file TransientVertex.cc.

254  {
255  if (!theCovMapAvailable) {
256  throw VertexException("TransientVertex::Track-to-track covariance matrices not available");
257  }
258  const TransientTrack* tr1;
259  const TransientTrack* tr2;
260  if (t1 < t2) {
261  tr1 = &t1;
262  tr2 = &t2;
263  } else {
264  tr1 = &t2;
265  tr2 = &t1;
266  }
267  TTtoTTmap::const_iterator it = theCovMap.find(*tr1);
268  if (it != theCovMap.end()) {
269  const TTmap& tm = it->second;
270  TTmap::const_iterator nit = tm.find(*tr2);
271  if (nit != tm.end()) {
272  return (nit->second);
273  } else {
274  throw VertexException("TransientVertex::requested Track-to-track covariance matrix does not exist");
275  }
276  } else {
277  throw VertexException("TransientVertex::requested Track-to-track covariance matrix does not exist");
278  }
279 }

References RandomServiceHelper::t1, RandomServiceHelper::t2, theCovMap, and theCovMapAvailable.

Referenced by CachingVertex< 5 >::operator TransientVertex().

◆ tkToTkCovariance() [2/2]

void TransientVertex::tkToTkCovariance ( const TTtoTTmap covMap)

Definition at line 236 of file TransientVertex.cc.

236  {
237  theCovMap = covMap;
238  theCovMapAvailable = true;
239 }

References theCovMap, and theCovMapAvailable.

◆ tkToTkCovarianceIsAvailable()

bool TransientVertex::tkToTkCovarianceIsAvailable ( ) const
inline

Returns true if the Track-to-track covariance matrices have been calculated.

Definition at line 251 of file TransientVertex.h.

251 { return theCovMapAvailable; }

References theCovMapAvailable.

◆ trackWeight()

float TransientVertex::trackWeight ( const reco::TransientTrack track) const

Returns the weight with which a track has been used in the fit. If the track is not present in the list, it is obviously not used, and this method returns a weight of 0. If this information has not been provided at construction, a weight of 1.0 is assumed for all tracks used and present in the originalTracks() std::vector.

Definition at line 241 of file TransientVertex.cc.

241  {
243  std::vector<TransientTrack>::const_iterator foundTrack =
245  return ((foundTrack != theOriginalTracks.end()) ? 1. : 0.);
246  }
247  TransientTrackToFloatMap::const_iterator it = theWeightMap.find(track);
248  if (it != theWeightMap.end()) {
249  return (it->second);
250  }
251  return 0.;
252 }

References spr::find(), theOriginalTracks, theWeightMap, theWeightMapIsAvailable, and HLT_FULL_cff::track.

Referenced by SplitVertexResolution::analyze(), AdaptiveVertexReconstructor::cleanUp(), AdaptiveVertexReconstructor::erase(), and PFDisplacedVertexFinder::fitVertexFromSeed().

◆ vertexState()

VertexState const& TransientVertex::vertexState ( ) const
inline

Constructor defining the RecVertex by its 3D position and position uncertainty, its associated tracks, its chi-squared and its number of degrees of freedom, and the track weights. The ndf can be a float. ‍/ TransientVertex(const VertexState & state, const std::vector<reco::TransientTrack> & tracks, float chi2, float ndf, const reco::TransientTrackToFloatMap & weightMap);

/** Access methods

Definition at line 168 of file TransientVertex.h.

168 { return theVertexState; }

References theVertexState.

Referenced by AdaptiveVertexReconstructor::cleanUp().

◆ weightMap() [1/2]

TransientTrackToFloatMap TransientVertex::weightMap ( ) const
inline

Definition at line 244 of file TransientVertex.h.

244 { return theWeightMap; }

References theWeightMap.

Referenced by CachingVertex< 5 >::operator TransientVertex().

◆ weightMap() [2/2]

void TransientVertex::weightMap ( const TransientTrackToFloatMap theMap)

Definition at line 224 of file TransientVertex.cc.

224  {
225  theWeightMap = theMap;
227 }

References theWeightMap, and theWeightMapIsAvailable.

Member Data Documentation

◆ theChi2

float TransientVertex::theChi2
private

Definition at line 273 of file TransientVertex.h.

◆ theCovMap

TTtoTTmap TransientVertex::theCovMap
private

Definition at line 278 of file TransientVertex.h.

Referenced by tkToTkCovariance().

◆ theCovMapAvailable

bool TransientVertex::theCovMapAvailable
private

Definition at line 276 of file TransientVertex.h.

Referenced by tkToTkCovariance(), and tkToTkCovarianceIsAvailable().

◆ theNDF

float TransientVertex::theNDF
private

Definition at line 274 of file TransientVertex.h.

Referenced by TransientVertex().

◆ theOriginalTracks

std::vector<reco::TransientTrack> TransientVertex::theOriginalTracks
private

◆ thePriorVertexState

VertexState TransientVertex::thePriorVertexState
mutableprivate

Definition at line 265 of file TransientVertex.h.

Referenced by priorError(), priorPosition(), priorTime(), and priorTimeError().

◆ theRefittedTracks

std::vector<reco::TransientTrack> TransientVertex::theRefittedTracks
private

Definition at line 271 of file TransientVertex.h.

Referenced by originalTrack(), refittedTrack(), and refittedTracks().

◆ theVertexState

VertexState TransientVertex::theVertexState
mutableprivate

Definition at line 266 of file TransientVertex.h.

Referenced by position(), positionError(), time(), timeError(), and vertexState().

◆ theWeightMap

TransientTrackToFloatMap TransientVertex::theWeightMap
private

Definition at line 279 of file TransientVertex.h.

Referenced by trackWeight(), and weightMap().

◆ theWeightMapIsAvailable

bool TransientVertex::theWeightMapIsAvailable
private

Definition at line 276 of file TransientVertex.h.

Referenced by hasTrackWeight(), trackWeight(), and weightMap().

◆ vertexValid

bool TransientVertex::vertexValid
private

Definition at line 275 of file TransientVertex.h.

Referenced by isValid().

◆ withPrior

bool TransientVertex::withPrior
private

Definition at line 276 of file TransientVertex.h.

Referenced by hasPrior().

◆ withRefittedTracks

bool TransientVertex::withRefittedTracks
private

Definition at line 277 of file TransientVertex.h.

Referenced by hasRefittedTracks(), and refittedTracks().

RandomServiceHelper.t2
t2
Definition: RandomServiceHelper.py:257
DDAxes::y
reco::VertexCompositePtrCandidate::setChi2AndNdof
void setChi2AndNdof(double chi2, double ndof)
set chi2 and ndof
Definition: VertexCompositePtrCandidate.h:94
mps_fire.i
i
Definition: mps_fire.py:428
TransientVertex::priorTime
double priorTime() const
Definition: TransientVertex.h:179
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11724
TransientVertex::refittedTracks
std::vector< reco::TransientTrack > const & refittedTracks() const
Definition: TransientVertex.h:211
groupFilesInBlocks.tt
int tt
Definition: groupFilesInBlocks.py:144
VertexException
Common base class.
Definition: VertexException.h:12
TransientVertex::isValid
bool isValid() const
Definition: TransientVertex.h:195
TransientVertex::refittedTrack
reco::TransientTrack refittedTrack(const reco::TransientTrack &track) const
Definition: TransientVertex.cc:291
reco::VertexCompositePtrCandidate::setTime
void setTime(double time)
Definition: VertexCompositePtrCandidate.h:104
pos
Definition: PixelAliasList.h:18
TransientVertex::position
GlobalPoint position() const
Definition: TransientVertex.h:169
reco::CandidatePtrTransientTrack
Definition: CandidatePtrTransientTrack.h:19
DDAxes::x
TransientVertex::theOriginalTracks
std::vector< reco::TransientTrack > theOriginalTracks
Definition: TransientVertex.h:270
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
hltPixelTracks_cff.chi2
chi2
Definition: hltPixelTracks_cff.py:25
TTmap
std::map< reco::TransientTrack, AlgebraicMatrix33 > TTmap
Definition: TTtoTTmap.h:11
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
reco::VertexCompositePtrCandidate
Definition: VertexCompositePtrCandidate.h:16
RandomServiceHelper.t1
t1
Definition: RandomServiceHelper.py:256
TransientVertex::theWeightMapIsAvailable
bool theWeightMapIsAvailable
Definition: TransientVertex.h:276
TransientVertex::theWeightMap
TransientTrackToFloatMap theWeightMap
Definition: TransientVertex.h:279
TransientVertex::theCovMap
TTtoTTmap theCovMap
Definition: TransientVertex.h:278
TransientVertex::vertexState
VertexState const & vertexState() const
Definition: TransientVertex.h:168
TransientVertex::theRefittedTracks
std::vector< reco::TransientTrack > theRefittedTracks
Definition: TransientVertex.h:271
DDAxes::z
VertexState::error
GlobalError error() const
Definition: VertexState.h:64
reco::LeafCandidate::setVertex
void setVertex(const Point &vertex) override
set vertex
Definition: LeafCandidate.h:173
TransientVertex::thePriorVertexState
VertexState thePriorVertexState
Definition: TransientVertex.h:265
GlobalErrorBase::matrix4D
const AlgebraicSymMatrix44 & matrix4D() const
Definition: GlobalErrorBase.h:136
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:176
VertexState::timeError
double timeError() const
Definition: VertexState.h:75
VertexState::is4D
bool is4D() const
Definition: VertexState.h:95
p4
double p4[4]
Definition: TauolaWrapper.h:92
TransientVertex::withPrior
bool withPrior
Definition: TransientVertex.h:276
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
reco::VertexCompositePtrCandidate::setCovariance
void setCovariance(const CovarianceMatrix &m)
set covariance matrix
Definition: VertexCompositePtrCandidate.cc:51
TransientVertex::theNDF
float theNDF
Definition: TransientVertex.h:274
reco::LeafCandidate::setP4
void setP4(const LorentzVector &p4) final
set 4-momentum
Definition: LeafCandidate.h:158
reco::Vertex::Point
math::XYZPoint Point
point in the space
Definition: Vertex.h:40
HltBtagValidation_cff.Vertex
Vertex
Definition: HltBtagValidation_cff.py:32
reco::TransientTrack
Definition: TransientTrack.h:19
reco::TransientTrack::track
const Track & track() const
Definition: TransientTrack.h:115
RunInfoPI::state
state
Definition: RunInfoPayloadInspectoHelper.h:16
TransientVertex::theCovMapAvailable
bool theCovMapAvailable
Definition: TransientVertex.h:276
TransientVertex::vertexValid
bool vertexValid
Definition: TransientVertex.h:275
TransientVertex::trackWeight
float trackWeight(const reco::TransientTrack &track) const
Definition: TransientVertex.cc:241
TransientVertex::time
double time() const
Definition: TransientVertex.h:177
VertexState::position
GlobalPoint position() const
Definition: VertexState.h:62
reco::Candidate::p4
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
bookConverter.prior
prior
Definition: bookConverter.py:146
TransientVertex::theVertexState
VertexState theVertexState
Definition: TransientVertex.h:266
VertexState::time
double time() const
Definition: VertexState.h:73
reco::CompositePtrCandidate::addDaughter
void addDaughter(const CandidatePtr &)
add a daughter via a reference
Definition: CompositePtrCandidate.h:84
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
reco::Candidate::Point
math::XYZPoint Point
point in the space
Definition: Candidate.h:40
ntuplemaker.posError
posError
Definition: ntuplemaker.py:300
TransientVertex::withRefittedTracks
bool withRefittedTracks
Definition: TransientVertex.h:277
reco::Vertex
Definition: Vertex.h:35
TransientVertex::theChi2
float theChi2
Definition: TransientVertex.h:273
VertexState::error4D
GlobalError error4D() const
Definition: VertexState.h:67
reco::CandidatePtrTransientTrack::candidate
CandidatePtr candidate() const override
Definition: CandidatePtrTransientTrack.h:77