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> > ();
145 auto outPtrTrks = std::make_unique<std::vector<reco::Track>>();
146 auto outPtrTrksAsCands = std::make_unique<std::vector<pat::PackedCandidate>>();
147 auto outPtrEleTrksAsCands = std::make_unique<std::vector<pat::PackedCandidate>>();
154 for(
unsigned int ic=0, nc = cands->size(); ic < nc; ++ic) {
167 for(
const auto& secVert : *vertices){
168 for(
auto trkIt = secVert.tracks_begin();trkIt!=secVert.tracks_end();trkIt++){
172 for(
const auto& v0 : *kshorts){
173 for(
size_t dIdx=0;dIdx<v0.numberOfDaughters(); dIdx++){
178 for(
const auto& v0 : *lambdas){
179 for(
size_t dIdx=0;dIdx<v0.numberOfDaughters(); dIdx++){
184 std::vector<int>
mapping(tracks->size(),-1);
186 for(
unsigned int trkIndx=0; trkIndx < tracks->size(); trkIndx++){
191 outPtrTrks->emplace_back(*trk);
207 iEvent.
put(
std::move(outPtrEleTrksAsCands),
"eleTracks");
209 auto tk2pc = std::make_unique<edm::Association<pat::PackedCandidateCollection>>(oh);
218 const bool passTrkHits = tr.
pt() >
minPt_ &&
223 return passTrkHits || passTrkQual;
233 const float mass = 0.13957018;
235 int id=211*trk->charge();
241 trk->pt(),trk->eta(),trk->phi(),
242 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
~PATLostTracks() override
#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_
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.