This producer is intended to take packedCandidates with tracks associated to the PV and refit the PV (applying or not) BeamSpot constraint
Michal Bluj, NCBJ Warsaw (and then others)
Definition at line 29 of file PATRefitVertexProducer.cc.
Definition at line 63 of file PATRefitVertexProducer.cc.
References funct::abs(), pwdgSkimBPark_cfi::beamSpot, TransientTrackBuilder::build(), HLT_2023v12_cff::cands, edm::Event::getByToken(), edm::EventSetup::getData(), TransientVertex::isValid(), submitPVResolutionJobs::key, eostools::move(), TransientVertex::position(), edm::Event::put(), quality, AdaptiveVertexFitter::setWeightThreshold(), srcBeamSpot_, srcCands_, srcEleKfTracks_, srcLostTracks_, srcVertices_, transTrackBuilderToken_, useBeamSpot_, pat::PackedCandidate::UsedInFitLoose, pat::PackedCandidate::UsedInFitTight, useEleKfTracks_, useLostTracks_, AdaptiveVertexFitter::vertex(), AlignmentTracksFromVertexSelector_cfi::vertices, and PV3DBase< T, PVType, FrameType >::z().
89 auto outputVertices = std::make_unique<reco::VertexCollection>();
90 outputVertices->reserve(1);
93 std::vector<reco::TransientTrack> transTracks;
97 if (
cand.charge() == 0 ||
cand.vertexRef().isNull())
99 if (
cand.bestTrack() ==
nullptr)
101 auto key =
cand.vertexRef().key();
108 transTracks.push_back(transTrackBuilder.
build(
cand.bestTrack()));
113 for (
const auto&
cand : (*lostTrackCands)) {
114 if (
cand.charge() == 0 ||
cand.vertexRef().isNull())
116 if (
cand.bestTrack() ==
nullptr)
118 auto key =
cand.vertexRef().key();
123 transTracks.push_back(transTrackBuilder.
build(
cand.bestTrack()));
129 for (
const auto&
cand : (*eleKfTrackCands)) {
130 if (
cand.charge() == 0 ||
cand.vertexRef().isNull())
132 if (
cand.bestTrack() ==
nullptr)
134 auto key =
cand.vertexRef().key();
139 transTracks.push_back(transTrackBuilder.
build(
cand.bestTrack()));
148 if (transTracks.size() >= 3) {
152 transVtx = avf.
vertex(transTracks);
160 if (!std::isfinite(transVtx.
position().
z()))
169 outputVertices->push_back(refitPV);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
GlobalPoint position() const
edm::EDGetTokenT< reco::BeamSpot > srcBeamSpot_
edm::EDGetTokenT< std::vector< pat::PackedCandidate > > srcLostTracks_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &) const override
reco::TransientTrack build(const reco::Track *p) const
void setWeightThreshold(float w)
Abs< T >::type abs(const T &t)
key
prepare the HTCondor submission files and eventually submit them
edm::EDGetTokenT< std::vector< pat::PackedCandidate > > srcCands_
edm::EDGetTokenT< reco::VertexCollection > srcVertices_
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > transTrackBuilderToken_
edm::EDGetTokenT< std::vector< pat::PackedCandidate > > srcEleKfTracks_