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 179 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 970 of file TemplatedSecondaryVertexProducer.cc.

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

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 981 of file TemplatedSecondaryVertexProducer.cc.

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

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 189 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:186
TemplatedSecondaryVertexProducer::SecondaryVertex
TemplatedSecondaryVertex< VTX > SecondaryVertex
Definition: TemplatedSecondaryVertexProducer.cc:107
reco::CandidatePtrTransientTrack
Definition: CandidatePtrTransientTrack.h:19
reco::VertexCompositePtrCandidate
Definition: VertexCompositePtrCandidate.h:16
TemplatedSecondaryVertexProducer::SVBuilder::minTrackWeight
double minTrackWeight
Definition: TemplatedSecondaryVertexProducer.cc:189
pfDeepBoostedJetPreprocessParams_cfi.sv
sv
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:226
reco::LeafCandidate::setVertex
void setVertex(const Point &vertex) override
set vertex
Definition: LeafCandidate.h:173
edm::LogError
Definition: MessageLogger.h:183
TemplatedSecondaryVertexProducer::SVBuilder::withPVError
bool withPVError
Definition: TemplatedSecondaryVertexProducer.cc:188
TemplatedSecondaryVertexProducer::SVBuilder::direction
const GlobalVector & direction
Definition: TemplatedSecondaryVertexProducer.cc:187
p4
double p4[4]
Definition: TauolaWrapper.h:92
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:79