|
|
Go to the documentation of this file.
19 ?
reco::TrackBase::qualityByName(conf.getParameter<
std::
string>(
"trackQuality"))
21 DPtovPtCut_(conf.getParameter<
std::vector<double> >(
"DPtOverPtCuts_byTrackAlgo")),
22 NHitCut_(conf.getParameter<
std::vector<unsigned> >(
"NHitCuts_byTrackAlgo")),
25 conf.existsAs<
bool>(
"cleanBadConvertedBrems") ? conf.getParameter<
bool>(
"cleanBadConvertedBrems") :
false) {
43 std::unique_ptr<PFMuonAlgo>
pfmu_;
52 auto vetosH =
e.getHandle(
veto_);
53 const auto&
vetos = *vetosH;
54 std::unordered_set<unsigned> vetoed;
55 for (
unsigned i = 0;
i <
vetos.size(); ++
i) {
59 elems.reserve(elems.size() +
tracks->size());
60 std::vector<bool> mask(
tracks->size(),
true);
66 auto itr = elems.begin();
67 while (
itr != elems.end()) {
91 auto TKs_end = std::partition(
93 auto btk_elems = elems.begin();
94 auto btrack =
tracks->cbegin();
95 auto etrack =
tracks->cend();
98 std::find_if(btk_elems, TKs_end, [&](
const ElementType&
a) {
return (
a->trackRef() ==
track->trackRef()); });
99 if (tk_elem != TKs_end) {
106 static_cast<reco::PFBlockElementTrack*>(tk_elem->get())->setMuonRef(muonref);
124 bool thisIsAPotentialMuon =
false;
133 if (thisIsAPotentialMuon) {
134 LogDebug(
"GeneralTracksImporterWithVeto")
135 <<
"Potential Muon P " << pftrackref->trackRef()->p() <<
" pt " << pftrackref->trackRef()->p() << std::endl;
139 if (vetoed.count(pftrackref->trackRef().
key()) == 0 || muonref.isNonnull()) {
140 elems.emplace_back(trkElem);
145 elems.shrink_to_fit();
150 auto muon = std::find_if(muonh->cbegin(), muonh->cend(), [&](
const reco::Muon&
m) {
151 return (
m.track().isNonnull() &&
m.track() == trackref);
const reco::TrackBase::TrackQuality trackQuality_
bool trackType(TrackType trType) const override
const std::vector< double > DPtovPtCut_
const VertexCompositeCandidateRef & V0Ref() const override
bool isNull() const
Checks for null.
const reco::TrackRef & trackRef() const override
edm::EDGetTokenT< reco::PFRecTrackCollection > veto_
TrackQuality
track quality
const bool cleanBadConvBrems_
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
edm::EDGetTokenT< reco::MuonCollection > muons_
const PFDisplacedTrackerVertexRef & displacedVertexRef(TrackType trType) const override
void setMuonRef(const MuonRef &muref) override
\set reference to the Muon
std::vector< Muon > MuonCollection
collection of Muon objects
edm::Ref< MuonCollection > MuonRef
presistent reference to a Muon
edm::Ref< PFRecTrackCollection > PFRecTrackRef
persistent reference to PFRecTrack objects
const bool useIterTracking_
#define DEFINE_EDM_PLUGIN(factory, type, name)
void importToBlock(const edm::Event &, ElementList &) const override
std::vector< std::unique_ptr< reco::PFBlockElement > > ElementList
edm::EDGetTokenT< reco::PFRecTrackCollection > src_
Container::value_type value_type
std::vector< std::pair< float, float > >::iterator itr
T getParameter(std::string const &) const
int muAssocToTrack(const reco::TrackRef &trackref, const edm::Handle< reco::MuonCollection > &muonh) const
static bool isMuon(const reco::PFBlockElement &elt)
const std::vector< unsigned > NHitCut_
GeneralTracksImporterWithVeto(const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
std::vector< PFRecTrack > PFRecTrackCollection
collection of PFRecTrack objects
key_type key() const
Accessor for product key.
static bool isLooseMuon(const reco::PFBlockElement &elt)
const ConversionRefVector & convRefs() const override
std::unique_ptr< PFMuonAlgo > pfmu_