21 ?
reco::TrackBase::qualityByName(conf.getParameter<
std::
string>(
"trackQuality"))
23 DPtovPtCut_(conf.getParameter<
std::vector<double> >(
"DPtOverPtCuts_byTrackAlgo")),
24 NHitCut_(conf.getParameter<
std::vector<unsigned> >(
"NHitCuts_byTrackAlgo")),
27 conf.existsAs<
bool>(
"cleanBadConvertedBrems") ? conf.getParameter<
bool>(
"cleanBadConvertedBrems") :
false) {
30 pfmu_ = std::unique_ptr<PFMuonAlgo>(
new PFMuonAlgo(conf, postMuonCleaning));
45 std::unique_ptr<PFMuonAlgo>
pfmu_;
55 const auto&
vetos = *vetosH;
56 std::unordered_set<unsigned> vetoed;
57 for (
unsigned i = 0;
i <
vetos.size(); ++
i) {
61 elems.reserve(elems.size() +
tracks->size());
62 std::vector<bool> mask(
tracks->size(),
true);
68 auto itr = elems.begin();
69 while (itr != elems.end()) {
82 itr = elems.erase(itr);
93 auto TKs_end = std::partition(
95 auto btk_elems = elems.begin();
96 auto btrack =
tracks->cbegin();
97 auto etrack =
tracks->cend();
100 std::find_if(btk_elems, TKs_end, [&](
const ElementType&
a) {
return (a->trackRef() ==
track->trackRef()); });
101 if (tk_elem != TKs_end) {
126 bool thisIsAPotentialMuon =
false;
135 if (thisIsAPotentialMuon) {
136 LogDebug(
"GeneralTracksImporterWithVeto")
137 <<
"Potential Muon P " << pftrackref->trackRef()->p() <<
" pt " << pftrackref->trackRef()->p() << std::endl;
141 if (vetoed.count(pftrackref->trackRef().
key()) == 0 || muonref.isNonnull()) {
142 elems.emplace_back(trkElem);
147 elems.shrink_to_fit();
152 auto muon = std::find_if(muonh->cbegin(), muonh->cend(), [&](
const reco::Muon&
m) {
153 return (
m.track().isNonnull() &&
m.track() == trackref);
T getParameter(std::string const &) const
int muAssocToTrack(const reco::TrackRef &trackref, const edm::Handle< reco::MuonCollection > &muonh) const
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
static bool isMuon(const reco::PFBlockElement &elt)
TrackQuality
track quality
const std::vector< double > DPtovPtCut_
edm::EDGetTokenT< reco::MuonCollection > muons_
const reco::TrackRef & trackRef() const override
const ConversionRefVector & convRefs() const override
bool trackType(TrackType trType) const override
edm::EDGetTokenT< reco::PFRecTrackCollection > veto_
const bool cleanBadConvBrems_
key_type key() const
Accessor for product key.
bool empty() const
Is the RefVector empty.
std::vector< Muon > MuonCollection
collection of Muon objects
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
Container::value_type value_type
edm::EDGetTokenT< reco::PFRecTrackCollection > src_
const bool useIterTracking_
edm::Ref< PFRecTrackCollection > PFRecTrackRef
persistent reference to PFRecTrack objects
const VertexCompositeCandidateRef & V0Ref() const override
edm::Ref< MuonCollection > MuonRef
presistent reference to a Muon
bool isNull() const
Checks for null.
const PFDisplacedTrackerVertexRef & displacedVertexRef(TrackType trType) const override
GeneralTracksImporterWithVeto(const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
void importToBlock(const edm::Event &, ElementList &) const override
static bool isLooseMuon(const reco::PFBlockElement &elt)
void setMuonRef(const MuonRef &muref) override
reference to the Muon
const reco::TrackBase::TrackQuality trackQuality_
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::vector< std::unique_ptr< reco::PFBlockElement > > ElementList
std::unique_ptr< PFMuonAlgo > pfmu_
std::vector< PFRecTrack > PFRecTrackCollection
collection of PFRecTrack objects
const std::vector< unsigned > NHitCut_