CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
TemplatedSecondaryVertexProducer< IPTI, VTX >::SVBuilder Struct Reference

Public Member Functions

SecondaryVertex operator() (const TransientVertex &sv) const
 
template<>
TemplatedSecondaryVertexProducer< TrackIPTagInfo, reco::Vertex >::SecondaryVertex operator() (const TransientVertex &sv) const
 
template<>
TemplatedSecondaryVertexProducer< CandIPTagInfo, reco::VertexCompositePtrCandidate >::SecondaryVertex operator() (const TransientVertex &sv) const
 
SecondaryVertex operator() (const VTX &sv) const
 
 SVBuilder (const reco::Vertex &pv, const GlobalVector &direction, bool withPVError, double minTrackWeight)
 

Public Attributes

const GlobalVectordirection
 
double minTrackWeight
 
const Vertexpv
 
bool withPVError
 

Detailed Description

template<class IPTI, class VTX>
struct TemplatedSecondaryVertexProducer< IPTI, VTX >::SVBuilder

Definition at line 181 of file TemplatedSecondaryVertexProducer.cc.

Constructor & Destructor Documentation

◆ SVBuilder()

template<class IPTI, class VTX>
TemplatedSecondaryVertexProducer< IPTI, VTX >::SVBuilder::SVBuilder ( const reco::Vertex pv,
const GlobalVector direction,
bool  withPVError,
double  minTrackWeight 
)
inline

Member Function Documentation

◆ operator()() [1/4]

template<class IPTI, class VTX>
SecondaryVertex TemplatedSecondaryVertexProducer< IPTI, VTX >::SVBuilder::operator() ( const TransientVertex sv) const

◆ operator()() [2/4]

Definition at line 973 of file TemplatedSecondaryVertexProducer.cc.

973  {
974  if (!sv.originalTracks().empty() && sv.originalTracks()[0].trackBaseRef().isNonnull())
976  else {
977  edm::LogError("UnexpectedInputs") << "Building from Candidates, should not happen!";
979  }
980 }

References TemplatedSecondaryVertexProducer< IPTI, VTX >::SVBuilder::direction, TemplatedSecondaryVertexProducer< IPTI, VTX >::SVBuilder::pv, pfDeepBoostedJetPreprocessParams_cfi::sv, and TemplatedSecondaryVertexProducer< IPTI, VTX >::SVBuilder::withPVError.

◆ operator()() [3/4]

Definition at line 984 of file TemplatedSecondaryVertexProducer.cc.

985  {
986  if (!sv.originalTracks().empty() && sv.originalTracks()[0].trackBaseRef().isNonnull()) {
987  edm::LogError("UnexpectedInputs") << "Building from Tracks, should not happen!";
988  VertexCompositePtrCandidate vtxCompPtrCand;
989 
990  vtxCompPtrCand.setCovariance(sv.vertexState().error().matrix());
991  vtxCompPtrCand.setChi2AndNdof(sv.totalChiSquared(), sv.degreesOfFreedom());
992  vtxCompPtrCand.setVertex(Candidate::Point(sv.position().x(), sv.position().y(), sv.position().z()));
993 
994  return SecondaryVertex(pv, vtxCompPtrCand, direction, withPVError);
995  } else {
996  VertexCompositePtrCandidate vtxCompPtrCand;
997 
998  vtxCompPtrCand.setCovariance(sv.vertexState().error().matrix());
999  vtxCompPtrCand.setChi2AndNdof(sv.totalChiSquared(), sv.degreesOfFreedom());
1000  vtxCompPtrCand.setVertex(Candidate::Point(sv.position().x(), sv.position().y(), sv.position().z()));
1001 
1003  for (std::vector<reco::TransientTrack>::const_iterator tt = sv.originalTracks().begin();
1004  tt != sv.originalTracks().end();
1005  ++tt) {
1006  if (sv.trackWeight(*tt) < minTrackWeight)
1007  continue;
1008 
1009  const CandidatePtrTransientTrack *cptt =
1010  dynamic_cast<const CandidatePtrTransientTrack *>(tt->basicTransientTrack());
1011  if (cptt == nullptr)
1012  edm::LogError("DynamicCastingFailed") << "Casting of TransientTrack to CandidatePtrTransientTrack failed!";
1013  else {
1014  p4 += cptt->candidate()->p4();
1015  vtxCompPtrCand.addDaughter(cptt->candidate());
1016  }
1017  }
1018  vtxCompPtrCand.setP4(p4);
1019 
1020  return SecondaryVertex(pv, vtxCompPtrCand, direction, withPVError);
1021  }
1022 }

References reco::CompositePtrCandidate::addDaughter(), reco::CandidatePtrTransientTrack::candidate(), TemplatedSecondaryVertexProducer< IPTI, VTX >::minTrackWeight, reco::Candidate::p4(), p4, MetAnalyzer::pv(), reco::VertexCompositePtrCandidate::setChi2AndNdof(), reco::VertexCompositePtrCandidate::setCovariance(), reco::LeafCandidate::setP4(), reco::LeafCandidate::setVertex(), pfDeepBoostedJetPreprocessParams_cfi::sv, groupFilesInBlocks::tt, and TemplatedSecondaryVertexProducer< IPTI, VTX >::withPVError.

◆ operator()() [4/4]

template<class IPTI, class VTX>
SecondaryVertex TemplatedSecondaryVertexProducer< IPTI, VTX >::SVBuilder::operator() ( const VTX &  sv) const
inline

Member Data Documentation

◆ direction

template<class IPTI, class VTX>
const GlobalVector& TemplatedSecondaryVertexProducer< IPTI, VTX >::SVBuilder::direction

◆ minTrackWeight

template<class IPTI, class VTX>
double TemplatedSecondaryVertexProducer< IPTI, VTX >::SVBuilder::minTrackWeight

Definition at line 191 of file TemplatedSecondaryVertexProducer.cc.

◆ pv

template<class IPTI, class VTX>
const Vertex& TemplatedSecondaryVertexProducer< IPTI, VTX >::SVBuilder::pv

◆ withPVError

template<class IPTI, class VTX>
bool TemplatedSecondaryVertexProducer< IPTI, VTX >::SVBuilder::withPVError
reco::VertexCompositePtrCandidate::setChi2AndNdof
void setChi2AndNdof(double chi2, double ndof)
set chi2 and ndof
Definition: VertexCompositePtrCandidate.h:94
groupFilesInBlocks.tt
int tt
Definition: groupFilesInBlocks.py:144
TemplatedSecondaryVertexProducer::SVBuilder::pv
const Vertex & pv
Definition: TemplatedSecondaryVertexProducer.cc:188
TemplatedSecondaryVertexProducer::SecondaryVertex
TemplatedSecondaryVertex< VTX > SecondaryVertex
Definition: TemplatedSecondaryVertexProducer.cc:108
reco::CandidatePtrTransientTrack
Definition: CandidatePtrTransientTrack.h:19
reco::VertexCompositePtrCandidate
Definition: VertexCompositePtrCandidate.h:16
TemplatedSecondaryVertexProducer::SVBuilder::minTrackWeight
double minTrackWeight
Definition: TemplatedSecondaryVertexProducer.cc:191
pfDeepBoostedJetPreprocessParams_cfi.sv
sv
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:352
reco::LeafCandidate::setVertex
void setVertex(const Point &vertex) override
set vertex
Definition: LeafCandidate.h:173
TemplatedSecondaryVertexProducer::SVBuilder::withPVError
bool withPVError
Definition: TemplatedSecondaryVertexProducer.cc:190
TemplatedSecondaryVertexProducer::SVBuilder::direction
const GlobalVector & direction
Definition: TemplatedSecondaryVertexProducer.cc:189
p4
double p4[4]
Definition: TauolaWrapper.h:92
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
reco::LeafCandidate::setP4
void setP4(const LorentzVector &p4) final
set 4-momentum
Definition: LeafCandidate.h:158
reco::Candidate::p4
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
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
reco::CandidatePtrTransientTrack::candidate
CandidatePtr candidate() const override
Definition: CandidatePtrTransientTrack.h:77