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

float degreesOfFreedom () const
 
bool hasPrior () const
 
bool hasRefittedTracks () const
 
bool hasTrackWeight () const
 
bool isValid () const
 
float normalisedChiSquared () 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 totalChiSquared () const
 
float trackWeight (const reco::TransientTrack &track) const
 
 TransientVertex ()
 
 TransientVertex (const GlobalPoint &pos, 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)
 
 TransientVertex (const GlobalPoint &pos, const GlobalError &posError, const std::vector< reco::TransientTrack > &tracks, float chi2, float ndf)
 
 TransientVertex (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 GlobalPoint &pos, 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)
 
 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 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 VertexState &state, const std::vector< reco::TransientTrack > &tracks, float chi2)
 
 TransientVertex (const VertexState &state, 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)
 
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

Definition at line 22 of file TransientVertex.h.

Constructor & Destructor Documentation

TransientVertex::TransientVertex ( )

Empty constructor, produces invalid vertex

Definition at line 11 of file TransientVertex.cc.

12  theChi2(0), theNDF(0), vertexValid(false), withPrior(false),
14  withRefittedTracks(false)
15 {}
std::vector< reco::TransientTrack > theOriginalTracks
VertexState theVertexState
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 18 of file TransientVertex.cc.

References theNDF, and theOriginalTracks.

19  :
20  theVertexState(pos, posError), theOriginalTracks(tracks),
21  theChi2(chi2), theNDF(0), vertexValid(true), withPrior(false),
23  withRefittedTracks(false)
24 {
25  theNDF = 2.*theOriginalTracks.size() - 3.;
26 }
std::vector< reco::TransientTrack > theOriginalTracks
VertexState theVertexState
TransientVertex::TransientVertex ( const GlobalPoint pos,
const double  time,
const GlobalError posError,
const std::vector< reco::TransientTrack > &  tracks,
float  chi2 
)

Definition at line 28 of file TransientVertex.cc.

References theNDF, and theOriginalTracks.

30  :
31  theVertexState(pos, time, posTimeError), theOriginalTracks(tracks),
32  theChi2(chi2), theNDF(0), vertexValid(true), withPrior(false),
34  withRefittedTracks(false)
35 {
36  theNDF = 2.*theOriginalTracks.size() - 3.;
37 }
std::vector< reco::TransientTrack > theOriginalTracks
double time() const
VertexState theVertexState
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 40 of file TransientVertex.cc.

41  :
42  theVertexState(pos, posError), theOriginalTracks(tracks),
43  theChi2(chi2), theNDF(ndf), vertexValid(true), withPrior(false),
45  withRefittedTracks(false)
46 {
47 }
std::vector< reco::TransientTrack > theOriginalTracks
VertexState theVertexState
TransientVertex::TransientVertex ( const GlobalPoint pos,
const double  time,
const GlobalError posError,
const std::vector< reco::TransientTrack > &  tracks,
float  chi2,
float  ndf 
)

Definition at line 49 of file TransientVertex.cc.

51  :
52  theVertexState(pos, time, posTimeError), theOriginalTracks(tracks),
53  theChi2(chi2), theNDF(ndf), vertexValid(true), withPrior(false),
55  withRefittedTracks(false)
56 {
57 }
std::vector< reco::TransientTrack > theOriginalTracks
double time() const
VertexState theVertexState
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 60 of file TransientVertex.cc.

References theNDF, and theOriginalTracks.

62  :
63  thePriorVertexState(priorPos, priorErr), theVertexState(pos, posError),
66  withRefittedTracks(false)
67 {
68  theNDF = 2.*theOriginalTracks.size();
69 }
VertexState thePriorVertexState
std::vector< reco::TransientTrack > theOriginalTracks
VertexState theVertexState
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 71 of file TransientVertex.cc.

References theNDF, and theOriginalTracks.

73  :
74  thePriorVertexState(priorPos, priorTime, priorErr), theVertexState(pos, time, posError),
77  withRefittedTracks(false)
78 {
79  theNDF = 2.*theOriginalTracks.size();
80 }
double priorTime() const
VertexState thePriorVertexState
std::vector< reco::TransientTrack > theOriginalTracks
double time() const
VertexState theVertexState
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 83 of file TransientVertex.cc.

85  :
86  thePriorVertexState(priorPos, priorErr), theVertexState(pos, posError),
89  withRefittedTracks(false)
90 {
91 }
VertexState thePriorVertexState
std::vector< reco::TransientTrack > theOriginalTracks
VertexState theVertexState
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 93 of file TransientVertex.cc.

95  :
96  thePriorVertexState(priorPos, priorTime, priorErr), theVertexState(pos, time, posError),
99  withRefittedTracks(false)
100 {
101 }
double priorTime() const
VertexState thePriorVertexState
std::vector< reco::TransientTrack > theOriginalTracks
double time() const
VertexState theVertexState
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::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 104 of file TransientVertex.cc.

References theNDF, and theOriginalTracks.

105  :
107  theChi2(chi2), theNDF(0), vertexValid(true), withPrior(false),
109  withRefittedTracks(false)
110 {
111  theNDF = 2.*theOriginalTracks.size() - 3.;
112 }
std::vector< reco::TransientTrack > theOriginalTracks
VertexState theVertexState
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 115 of file TransientVertex.cc.

116  :
118  theChi2(chi2), theNDF(ndf), vertexValid(true), withPrior(false),
120  withRefittedTracks(false)
121 {
122 }
std::vector< reco::TransientTrack > theOriginalTracks
VertexState theVertexState
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 125 of file TransientVertex.cc.

References theNDF, and theOriginalTracks.

128  :
129  thePriorVertexState(prior), theVertexState(state),
132  withRefittedTracks(false)
133 {
134  theNDF = 2.*theOriginalTracks.size();
135 }
VertexState thePriorVertexState
std::vector< reco::TransientTrack > theOriginalTracks
VertexState theVertexState
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 138 of file TransientVertex.cc.

141  :
142  thePriorVertexState(prior), theVertexState(state),
144  withPrior(true), theWeightMapIsAvailable(false),
146 {
147 }
VertexState thePriorVertexState
std::vector< reco::TransientTrack > theOriginalTracks
VertexState theVertexState

Member Function Documentation

float TransientVertex::degreesOfFreedom ( ) const
inline
bool TransientVertex::hasPrior ( ) const
inline

Definition at line 144 of file TransientVertex.h.

References withPrior.

Referenced by AdaptiveVertexReconstructor::cleanUp().

144 { return withPrior; }
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 176 of file TransientVertex.h.

References withRefittedTracks.

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

176 { return withRefittedTracks; }
bool TransientVertex::hasTrackWeight ( ) const
inline

Returns true if the track-weights are available.

Definition at line 207 of file TransientVertex.h.

References theWeightMapIsAvailable, and trackWeight().

Referenced by PrimaryVertexValidation::analyze().

207 { return theWeightMapIsAvailable; }
bool TransientVertex::isValid ( void  ) const
inline
float TransientVertex::normalisedChiSquared ( ) const
inline

Definition at line 152 of file TransientVertex.h.

References degreesOfFreedom(), and totalChiSquared().

Referenced by PrimaryVertexValidation::analyze(), HLTmmkkFilter::hltFilter(), and HLTmmkFilter::hltFilter().

152  {
153  return totalChiSquared() / degreesOfFreedom();
154  }
float totalChiSquared() const
float degreesOfFreedom() const
TransientVertex::operator reco::Vertex ( ) const

Definition at line 241 of file TransientVertex.cc.

References reco::Vertex::add(), degreesOfFreedom(), VertexState::error4D(), mps_fire::i, isValid(), GlobalErrorBase< T, ErrorWeightType >::matrix4D(), VertexState::position(), refittedTrack(), theOriginalTracks, theVertexState, VertexState::time(), totalChiSquared(), reco::TransientTrack::track(), trackWeight(), and withRefittedTracks.

242 {
243  //If the vertex is invalid, return an invalid TV !
244  if (!isValid()) return Vertex();
245 
247  // RecoVertex::convertError(theVertexState.error()),
251  for (std::vector<TransientTrack>::const_iterator i = theOriginalTracks.begin();
252  i != theOriginalTracks.end(); ++i) {
253 // const TrackTransientTrack* ttt = dynamic_cast<const TrackTransientTrack*>((*i).basicTransientTrack());
254 // if ((ttt!=0) && (ttt->persistentTrackRef().isNonnull()))
255 // {
256 // TrackRef tr = ttt->persistentTrackRef();
257 // TrackBaseRef tbr(tr);
258  if (withRefittedTracks) {
259 
260  vertex.add((*i).trackBaseRef(), refittedTrack(*i).track(), trackWeight ( *i ) );
261  } else {
262  vertex.add((*i).trackBaseRef(), trackWeight ( *i ) );
263  }
264  //}
265  }
266  return vertex;
267 }
float totalChiSquared() const
GlobalPoint position() const
Definition: VertexState.h:69
const AlgebraicSymMatrix44 & matrix4D() const
reco::TransientTrack refittedTrack(const reco::TransientTrack &track) const
float degreesOfFreedom() const
double time() const
Definition: VertexState.h:95
math::XYZPoint Point
point in the space
Definition: Vertex.h:39
std::vector< reco::TransientTrack > theOriginalTracks
float trackWeight(const reco::TransientTrack &track) const
void add(const TrackBaseRef &r, float w=1.0)
add a reference to a Track
GlobalError error4D() const
Definition: VertexState.h:80
const Track & track() const
VertexState theVertexState
bool isValid() const
TransientVertex::operator reco::VertexCompositePtrCandidate ( ) const

Definition at line 269 of file TransientVertex.cc.

References reco::CompositePtrCandidate::addDaughter(), reco::CandidatePtrTransientTrack::candidate(), degreesOfFreedom(), relativeConstraints::error, isValid(), makeMuonMisalignmentScenario::matrix, reco::Candidate::p4(), p4, position(), reco::VertexCompositePtrCandidate::setChi2AndNdof(), reco::VertexCompositePtrCandidate::setCovariance(), reco::LeafCandidate::setP4(), reco::LeafCandidate::setVertex(), theOriginalTracks, totalChiSquared(), trackWeight(), groupFilesInBlocks::tt, vertexState(), x, y, and z.

270 {
271 using namespace reco;
272  if (!isValid()) return VertexCompositePtrCandidate();
273 
274  VertexCompositePtrCandidate vtxCompPtrCand;
275 
276  vtxCompPtrCand.setCovariance(vertexState().error().matrix());
277  vtxCompPtrCand.setChi2AndNdof(totalChiSquared(), degreesOfFreedom());
278  vtxCompPtrCand.setVertex(Candidate::Point(position().x(),position().y(),position().z()));
279 
281  for(std::vector<reco::TransientTrack>::const_iterator tt = theOriginalTracks.begin(); tt != theOriginalTracks.end(); ++tt)
282  {
283  if (trackWeight(*tt) < 0.5)
284  continue;
285 
286  const CandidatePtrTransientTrack* cptt = dynamic_cast<const CandidatePtrTransientTrack*>(tt->basicTransientTrack());
287  if ( cptt==0 )
288  edm::LogError("DynamicCastingFailed") << "Casting of TransientTrack to CandidatePtrTransientTrack failed!";
289  else
290  {
291  p4 += cptt->candidate()->p4();
292  vtxCompPtrCand.addDaughter(cptt->candidate());
293  }
294  }
295 
296  //TODO: if has refitted tracks we should scale the candidate p4 to the refitted one
297  vtxCompPtrCand.setP4(p4);
298  return vtxCompPtrCand;
299 }
float totalChiSquared() const
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
float degreesOfFreedom() const
double p4[4]
Definition: TauolaWrapper.h:92
GlobalPoint position() const
std::vector< reco::TransientTrack > theOriginalTracks
float trackWeight(const reco::TransientTrack &track) const
virtual void setVertex(const Point &vertex)
set vertex
virtual void setP4(const LorentzVector &p4) final
set 4-momentum
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
fixed size matrix
void setCovariance(const CovarianceMatrix &m)
set covariance matrix
void addDaughter(const CandidatePtr &)
add a daughter via a reference
math::XYZPoint Point
point in the space
Definition: Candidate.h:41
void setChi2AndNdof(double chi2, double ndof)
set chi2 and ndof
VertexState const & vertexState() const
bool isValid() const
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 217 of file TransientVertex.cc.

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

Referenced by refittedTracks().

218 {
219  if (theRefittedTracks.empty())
220  throw VertexException("No refitted tracks stored in vertex");
221  std::vector<TransientTrack>::const_iterator it =
222  find(theRefittedTracks.begin(), theRefittedTracks.end(), refTrack);
223  if (it==theRefittedTracks.end())
224  throw VertexException("Refitted track not found in list");
225  size_t pos = it - theRefittedTracks.begin();
226  return theOriginalTracks[pos];
227 }
Common base class.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
std::vector< reco::TransientTrack > theOriginalTracks
std::vector< reco::TransientTrack > theRefittedTracks
std::vector<reco::TransientTrack> const& TransientVertex::originalTracks ( ) const
inline
GlobalPoint TransientVertex::position ( ) const
inline
GlobalError TransientVertex::positionError ( ) const
inline
GlobalError TransientVertex::priorError ( ) const
inline

Definition at line 139 of file TransientVertex.h.

References VertexState::error(), VertexState::error4D(), VertexState::is4D(), and thePriorVertexState.

Referenced by AdaptiveVertexReconstructor::cleanUp().

VertexState thePriorVertexState
GlobalError error4D() const
Definition: VertexState.h:80
bool is4D() const
Definition: VertexState.h:133
GlobalError error() const
Definition: VertexState.h:74
GlobalPoint TransientVertex::priorPosition ( ) const
inline

Definition at line 138 of file TransientVertex.h.

References VertexState::position(), and thePriorVertexState.

Referenced by AdaptiveVertexReconstructor::cleanUp().

138 { return thePriorVertexState.position(); }
GlobalPoint position() const
Definition: VertexState.h:69
VertexState thePriorVertexState
double TransientVertex::priorTime ( ) const
inline

Definition at line 142 of file TransientVertex.h.

References thePriorVertexState, and VertexState::time().

142 { return thePriorVertexState.time(); }
VertexState thePriorVertexState
double time() const
Definition: VertexState.h:95
double TransientVertex::priorTimeError ( ) const
inline

Definition at line 143 of file TransientVertex.h.

References thePriorVertexState, and VertexState::timeError().

143 { return thePriorVertexState.timeError(); }
VertexState thePriorVertexState
double timeError() const
Definition: VertexState.h:99
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 229 of file TransientVertex.cc.

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

Referenced by PFDisplacedVertexFinder::fitVertexFromSeed(), operator reco::Vertex(), and refittedTracks().

230 {
231  if (theRefittedTracks.empty())
232  throw VertexException("No refitted tracks stored in vertex");
233  std::vector<TransientTrack>::const_iterator it =
235  if (it==theOriginalTracks.end())
236  throw VertexException("Track not found in list");
237  size_t pos = it - theOriginalTracks.begin();
238  return theRefittedTracks[pos];
239 }
Common base class.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
std::vector< reco::TransientTrack > theOriginalTracks
std::vector< reco::TransientTrack > theRefittedTracks
std::vector<reco::TransientTrack> const& TransientVertex::refittedTracks ( ) const
inline
void TransientVertex::refittedTracks ( const std::vector< reco::TransientTrack > &  refittedTracks)

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

Definition at line 155 of file TransientVertex.cc.

References refittedTracks(), theRefittedTracks, and withRefittedTracks.

157 {
158  if (refittedTracks.empty())
159  throw VertexException("TransientVertex::refittedTracks: No refitted tracks stored in input container");
161  withRefittedTracks = true;
162 }
Common base class.
std::vector< reco::TransientTrack > const & refittedTracks() const
std::vector< reco::TransientTrack > theRefittedTracks
double TransientVertex::time ( ) const
inline

Definition at line 140 of file TransientVertex.h.

References theVertexState, and VertexState::time().

Referenced by PrimaryVertexProducer::produce().

140 { return theVertexState.time(); }
double time() const
Definition: VertexState.h:95
VertexState theVertexState
double TransientVertex::timeError ( ) const
inline

Definition at line 141 of file TransientVertex.h.

References theVertexState, and VertexState::timeError().

141 { return theVertexState.timeError(); }
double timeError() const
Definition: VertexState.h:99
VertexState theVertexState
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 186 of file TransientVertex.cc.

References reco::t2, theCovMap, and theCovMapAvailable.

Referenced by CachingVertex< N >::operator TransientVertex(), and tkToTkCovarianceIsAvailable().

187 {
188  if (!theCovMapAvailable) {
189  throw VertexException("TransientVertex::Track-to-track covariance matrices not available");
190  }
191  const TransientTrack* tr1;
192  const TransientTrack* tr2;
193  if (t1<t2) {
194  tr1 = &t1;
195  tr2 = &t2;
196  } else {
197  tr1 = &t2;
198  tr2 = &t1;
199  }
200  TTtoTTmap::const_iterator it = theCovMap.find(*tr1);
201  if (it != theCovMap.end()) {
202  const TTmap & tm = it->second;
203  TTmap::const_iterator nit = tm.find(*tr2);
204  if (nit != tm.end()) {
205  return( nit->second);
206  }
207  else {
208  throw VertexException("TransientVertex::requested Track-to-track covariance matrix does not exist");
209  }
210  }
211  else {
212  throw VertexException("TransientVertex::requested Track-to-track covariance matrix does not exist");
213  }
214 }
Common base class.
std::map< reco::TransientTrack, AlgebraicMatrix33 > TTmap
Definition: TTtoTTmap.h:11
auto const T2 &decltype(t1.eta()) t2
Definition: deltaR.h:16
void TransientVertex::tkToTkCovariance ( const TTtoTTmap covMap)

Definition at line 165 of file TransientVertex.cc.

References theCovMap, and theCovMapAvailable.

166 {
167  theCovMap = covMap;
168  theCovMapAvailable = true;
169 }
bool TransientVertex::tkToTkCovarianceIsAvailable ( ) const
inline

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

Definition at line 226 of file TransientVertex.h.

References reco::t2, theCovMapAvailable, and tkToTkCovariance().

226 { return theCovMapAvailable; }
float TransientVertex::totalChiSquared ( ) const
inline
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 171 of file TransientVertex.cc.

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

Referenced by PrimaryVertexValidation::analyze(), AdaptiveVertexReconstructor::cleanUp(), AdaptiveVertexReconstructor::erase(), PFDisplacedVertexFinder::fitVertexFromSeed(), hasTrackWeight(), operator reco::Vertex(), operator reco::VertexCompositePtrCandidate(), and TemplatedSecondaryVertexProducer< IPTI, VTX >::SVBuilder::operator()().

171  {
173  std::vector<TransientTrack>::const_iterator foundTrack = find(theOriginalTracks.begin(),
174  theOriginalTracks.end(), track);
175  return ((foundTrack != theOriginalTracks.end()) ? 1. : 0.);
176  }
177  TransientTrackToFloatMap::const_iterator it = theWeightMap.find(track);
178  if (it != theWeightMap.end()) {
179  return(it->second);
180  }
181  return 0.;
182 
183 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
TransientTrackToFloatMap theWeightMap
std::vector< reco::TransientTrack > theOriginalTracks
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.Access methods

Definition at line 135 of file TransientVertex.h.

References theVertexState.

Referenced by AdaptiveVertexReconstructor::cleanUp(), operator reco::VertexCompositePtrCandidate(), and TemplatedSecondaryVertexProducer< IPTI, VTX >::SVBuilder::operator()().

135 { return theVertexState; }
VertexState theVertexState
TransientTrackToFloatMap TransientVertex::weightMap ( ) const
inline

Definition at line 219 of file TransientVertex.h.

References theWeightMap.

Referenced by AdaptiveVertexReconstructor::cleanUp(), and CachingVertex< N >::operator TransientVertex().

219 { return theWeightMap; }
TransientTrackToFloatMap theWeightMap
void TransientVertex::weightMap ( const TransientTrackToFloatMap theMap)

Definition at line 149 of file TransientVertex.cc.

References theWeightMap, and theWeightMapIsAvailable.

150 {
151  theWeightMap = theMap;
153 }
TransientTrackToFloatMap theWeightMap

Member Data Documentation

float TransientVertex::theChi2
private

Definition at line 252 of file TransientVertex.h.

Referenced by totalChiSquared().

TTtoTTmap TransientVertex::theCovMap
private

Definition at line 257 of file TransientVertex.h.

Referenced by tkToTkCovariance().

bool TransientVertex::theCovMapAvailable
private

Definition at line 255 of file TransientVertex.h.

Referenced by tkToTkCovariance(), and tkToTkCovarianceIsAvailable().

float TransientVertex::theNDF
private

Definition at line 253 of file TransientVertex.h.

Referenced by degreesOfFreedom(), and TransientVertex().

std::vector<reco::TransientTrack> TransientVertex::theOriginalTracks
private
VertexState TransientVertex::thePriorVertexState
mutableprivate

Definition at line 243 of file TransientVertex.h.

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

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

Definition at line 249 of file TransientVertex.h.

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

VertexState TransientVertex::theVertexState
mutableprivate
TransientTrackToFloatMap TransientVertex::theWeightMap
private

Definition at line 258 of file TransientVertex.h.

Referenced by trackWeight(), and weightMap().

bool TransientVertex::theWeightMapIsAvailable
private

Definition at line 255 of file TransientVertex.h.

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

bool TransientVertex::vertexValid
private

Definition at line 254 of file TransientVertex.h.

Referenced by isValid().

bool TransientVertex::withPrior
private

Definition at line 255 of file TransientVertex.h.

Referenced by hasPrior().

bool TransientVertex::withRefittedTracks
private

Definition at line 256 of file TransientVertex.h.

Referenced by hasRefittedTracks(), operator reco::Vertex(), and refittedTracks().