42 bool passPixelTrackSel)
const;
77 dzSigCut_(iConfig.getParameter<double>(
"dzSigCut")),
78 dxySigCut_(iConfig.getParameter<double>(
"dxySigCut")),
79 dzSigHP_(iConfig.getParameter<double>(
"dzSigHP")),
80 dxySigHP_(iConfig.getParameter<double>(
"dxySigHP")),
81 ptMax_(iConfig.getParameter<double>(
"ptMax")),
82 ptMin_(iConfig.getParameter<double>(
"ptMin")),
83 resetHP_(iConfig.getParameter<
bool>(
"resetHP")),
84 covarianceVersion_(iConfig.getParameter<
int>(
"covarianceVersion")),
85 covarianceSchema_(iConfig.getParameter<
int>(
"covarianceSchema")) {
86 produces<std::vector<pat::PackedCandidate>>();
87 produces<edm::Association<pat::PackedCandidateCollection>>();
102 auto outPtrTrksAsCands = std::make_unique<std::vector<pat::PackedCandidate>>();
116 bestvzError =
vtx.zError();
117 bestvtx =
vtx.position();
118 vtx_cov =
vtx.covariance();
121 bestvzError =
bs.z0Error();
122 bestvtx =
bs.position();
123 vtx_cov =
bs.covariance3D();
127 int savedCandIndx = 0;
129 for (
auto const& trk : *
tracks) {
131 double dzvtx =
std::abs(trk.dz(bestvtx));
132 double dxyvtx =
std::abs(trk.dxy(bestvtx));
133 double dzerror =
std::hypot(trk.dzError(), bestvzError);
134 double dxyerror = trk.dxyError(bestvtx, vtx_cov);
143 bool passSelection = (dzvtx <
dzSigHP_ * dzerror && dxyvtx <
dxySigHP_ * dxyerror);
148 mapping[trkIndx] = savedCandIndx;
152 auto tk2pc = std::make_unique<edm::Association<pat::PackedCandidateCollection>>(oh);
163 bool passPixelTrackSel)
const {
164 const float mass = 0.13957018;
166 int id = 211 * trk.
charge();
172 if (passPixelTrackSel)
173 cands.back().setTrackHighPurity(
true);
175 cands.back().setTrackHighPurity(
false);
178 cands.back().setTrackHighPurity(
true);
180 cands.back().setTrackHighPurity(
false);
192 desc.add<
edm::InputTag>(
"srcPrimaryVertices", {
"offlineSlimmedPrimaryVertices"});
194 ->setComment(
"use BeamSpot if empty vtx collection");
195 desc.add<
double>(
"dzSigCut", 10.0);
196 desc.add<
double>(
"dxySigCut", 25.0);
197 desc.add<
double>(
"dzSigHP", 7.0)->setComment(
"to set HighPurity flag for pixel tracks");
198 desc.add<
double>(
"dxySigHP", 20.0)->setComment(
"to set HighPurity flag for pixel tracks");
199 desc.add<
double>(
"ptMax", 1.0)->setComment(
"max pT for pixel tracks - above this will use general tracks");
200 desc.add<
double>(
"ptMin", 0.3)->setComment(
"min pT for pixel tracks");
201 desc.add<
bool>(
"resetHP",
true)
202 ->setComment(
"pixel tracks do not have HP flag set. Use False if does not want to reset HP flag");
203 desc.add<
int>(
"covarianceVersion", 0)->setComment(
"so far: 0 is Phase0, 1 is Phase1");
204 desc.add<
int>(
"covarianceSchema", 520)->setComment(
"use less accurate schema - reduce size of collection");
bool quality(const TrackQuality) const
Track quality.
void addPackedCandidate(std::vector< pat::PackedCandidate > &cands, const reco::Track trk, const reco::VertexRef &pvSlimmed, const reco::VertexRefProd &pvSlimmedColl, bool passPixelTrackSel) const
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
const edm::EDGetTokenT< reco::VertexCollection > srcPrimaryVertices_
MPlex< T, D1, D2, N > hypot(const MPlex< T, D1, D2, N > &a, const MPlex< T, D1, D2, N > &b)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const edm::EDGetTokenT< reco::TrackCollection > srcTracks_
std::vector< Track > TrackCollection
collection of Tracks
std::vector< Vertex > VertexCollection
key_type key() const
Accessor for product key.
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
double pt() const
track transverse momentum
int charge() const
track electric charge
Abs< T >::type abs(const T &t)
double phi() const
azimuthal angle of momentum vector
#define DEFINE_FWK_MODULE(type)
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
edm::Ref< VertexCollection > VertexRef
persistent reference to a Vertex
double eta() const
pseudorapidity of momentum vector
XYZPointD XYZPoint
point in space with cartesian internal representation
const int covarianceVersion_
PATTracksToPackedCandidates(const edm::ParameterSet &)
const int covarianceSchema_
const edm::EDGetTokenT< reco::BeamSpot > srcOfflineBeamSpot_
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.