29 bool passesQuality(
const reco::Track& trk,
const std::vector<reco::TrackBase::TrackQuality>& allowedQuals){
30 for(
const auto& qual : allowedQuals){
31 if(trk.
quality(qual))
return true;
90 minPt_(iConfig.getParameter<double>(
"minPt")),
91 minHits_(iConfig.getParameter<uint32_t>(
"minHits")),
92 minPixelHits_(iConfig.getParameter<uint32_t>(
"minPixelHits")) ,
98 std::vector<std::string> trkQuals(iConfig.
getParameter<std::vector<std::string> >(
"qualsToAutoAccept"));
102 std::ostringstream
msg;
103 msg<<
" PATLostTracks has a quality requirement which resolves to undefQuality. This usually means a typo and is therefore treated a config error\nquality requirements:\n ";
104 for(
const auto& trkQual : trkQuals) msg <<trkQual<<
" ";
108 produces< std::vector<reco::Track> > ();
109 produces< std::vector<pat::PackedCandidate> > (); produces< std::vector<pat::PackedCandidate> > (
"eleTracks");
110 produces< edm::Association<pat::PackedCandidateCollection> > ();
119 std::vector<reco::Candidate>::const_iterator
cand;
146 auto outPtrTrks = std::make_unique<std::vector<reco::Track>>();
147 auto outPtrTrksAsCands = std::make_unique<std::vector<pat::PackedCandidate>>();
148 auto outPtrEleTrksAsCands = std::make_unique<std::vector<pat::PackedCandidate>>();
155 for(
unsigned int ic=0, nc = cands->size(); ic < nc; ++ic) {
168 for(
const auto& secVert : *vertices){
169 for(
auto trkIt = secVert.tracks_begin();trkIt!=secVert.tracks_end();trkIt++){
173 for(
const auto& v0 : *kshorts){
174 for(
size_t dIdx=0;dIdx<v0.numberOfDaughters(); dIdx++){
179 for(
const auto& v0 : *lambdas){
180 for(
size_t dIdx=0;dIdx<v0.numberOfDaughters(); dIdx++){
185 std::vector<int>
mapping(tracks->size(),-1);
187 for(
unsigned int trkIndx=0; trkIndx < tracks->size(); trkIndx++){
192 outPtrTrks->emplace_back(*trk);
208 iEvent.
put(
std::move(outPtrEleTrksAsCands),
"eleTracks");
210 auto tk2pc = std::make_unique<edm::Association<pat::PackedCandidateCollection>>(oh);
219 const bool passTrkHits = tr.
pt() >
minPt_ &&
224 return passTrkHits || passTrkQual;
234 const float mass = 0.13957018;
236 int id=211*trk->charge();
242 trk->pt(),trk->eta(),trk->phi(),
243 id,pvSlimmedColl,pvSlimmed.
key()));
T getParameter(std::string const &) const
int pdgId() const final
PDG identifier.
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
std::vector< VertexCompositeCandidate > VertexCompositeCandidateCollection
collection of Candidate objects
bool isNonnull() const
Checks for non-null.
const double minPtToStoreProps_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
std::vector< pat::PackedCandidate > PackedCandidateCollection
std::vector< Track > TrackCollection
collection of Tracks
const int covarianceSchema_
std::vector< Vertex > VertexCollection
collection of Vertex objects
int charge() const final
electric charge
key_type key() const
Accessor for product key.
PATLostTracks(const edm::ParameterSet &)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const int covarianceVersion_
ProductID id() const
Accessor for product ID.
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
reco::TrackRef trackRef() const
const edm::EDGetTokenT< reco::PFCandidateCollection > cands_
double pt() const
track transverse momentum
const edm::EDGetTokenT< reco::VertexCompositeCandidateCollection > lambdas_
virtual void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
unsigned short numberOfValidHits() const
number of valid hits found
float trackWeight(const TREF &r) const
returns the weight with which a Track has contributed to the vertex-fit.
edm::Ref< VertexCollection > VertexRef
persistent reference to a Vertex
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
void addPackedCandidate(std::vector< pat::PackedCandidate > &cands, const reco::TrackRef &trk, const reco::VertexRef &pvSlimmed, const reco::VertexRefProd &pvSlimmedColl, const reco::Vertex &pvOrig, const TrkStatus trkStatus) const
static TrackQuality qualityByName(const std::string &name)
const edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > map_
bool passTrkCuts(const reco::Track &tr) const
const edm::EDGetTokenT< reco::TrackCollection > tracks_
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
const edm::EDGetTokenT< reco::VertexCollection > vertices_
bool quality(const TrackQuality) const
Track quality.
const edm::EDGetTokenT< reco::VertexCompositeCandidateCollection > kshorts_
std::vector< reco::TrackBase::TrackQuality > qualsToAutoAccept_
Particle reconstructed by the particle flow algorithm.
int numberOfValidPixelHits() const
const double minPixelHits_
const edm::EDGetTokenT< reco::VertexCollection > pv_
const edm::EDGetTokenT< reco::VertexCollection > pvOrigs_
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.