|
|
Go to the documentation of this file.
45 auto vetosH =
e.getHandle(
veto_);
46 const auto&
vetos = *vetosH;
47 std::unordered_set<unsigned> vetoed;
48 for (
unsigned i = 0;
i <
vetos.size(); ++
i) {
52 elems.reserve(elems.size() +
tracks->size());
53 std::vector<bool> mask(
tracks->size(),
true);
59 auto itr = elems.begin();
60 while (
itr != elems.end()) {
84 auto TKs_end = std::partition(
86 auto btk_elems = elems.begin();
87 auto btrack =
tracks->cbegin();
88 auto etrack =
tracks->cend();
91 std::find_if(btk_elems, TKs_end, [&](
const ElementType&
a) {
return (
a->trackRef() ==
track->trackRef()); });
92 if (tk_elem != TKs_end) {
99 static_cast<reco::PFBlockElementTrack*>(tk_elem->get())->setMuonRef(muonref);
117 bool thisIsAPotentialMuon =
false;
120 thisIsAPotentialMuon =
127 if (thisIsAPotentialMuon) {
128 LogDebug(
"GeneralTracksImporterWithVeto")
129 <<
"Potential Muon P " << pftrackref->trackRef()->p() <<
" pt " << pftrackref->trackRef()->p() << std::endl;
133 if (vetoed.count(pftrackref->trackRef().
key()) == 0 || muonref.isNonnull()) {
134 elems.emplace_back(trkElem);
139 elems.shrink_to_fit();
144 auto muon = std::find_if(muonh->cbegin(), muonh->cend(), [&](
const reco::Muon&
m) {
145 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_
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_
static bool hasValidTrack(const reco::MuonRef &muonRef, bool loose, double maxDPtOPt)
Container::value_type value_type
std::vector< std::pair< float, float > >::iterator itr
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.
const double muonMaxDPtOPt_
static bool isLooseMuon(const reco::PFBlockElement &elt)
const ConversionRefVector & convRefs() const override