21 NHitCut_(conf.getParameter<std::
vector<unsigned>>(
"NHitCuts_byTrackAlgo")),
67 typedef std::pair<edm::ProductID, unsigned> TrackProdIDKey;
68 std::vector<TrackProdIDKey> vetoed;
73 for (
const auto&
veto : vetoes)
74 vetoed.emplace_back(
veto.trackRef().id(),
veto.trackRef().key());
80 for (
const auto&
veto : vetoes) {
83 vetoed.emplace_back(tracksH.id(),
veto.index);
89 for (
const auto&
veto : vetoes) {
90 if (
veto.trackRef().isNull())
92 vetoed.emplace_back(
veto.trackRef().id(),
veto.trackRef().key());
97 std::sort(vetoed.begin(), vetoed.end());
100 const auto muons = *muonH;
101 elems.reserve(elems.size() +
tracks->size());
102 std::vector<bool> mask(
tracks->size(),
true);
108 auto itr = elems.begin();
109 while (itr != elems.end()) {
122 itr = elems.erase(itr);
133 auto TKs_end = std::partition(
135 auto btk_elems = elems.begin();
136 auto btrack =
tracks->cbegin();
137 auto etrack =
tracks->cend();
140 std::find_if(btk_elems, TKs_end, [&](
const ElementType&
a) {
return (a->trackRef() ==
track->trackRef()); });
141 if (tk_elem != TKs_end) {
166 bool thisIsAPotentialMuon =
false;
169 thisIsAPotentialMuon =
176 if (thisIsAPotentialMuon) {
178 <<
"Potential Muon P " << pftrackref->trackRef()->p() <<
" pt " << pftrackref->trackRef()->p() << std::endl;
188 elems.emplace_back(trkElem);
190 TrackProdIDKey trk = std::make_pair(pftrackref->trackRef().
id(), pftrackref->trackRef().
key());
192 bool inVetoList = (lower != vetoed.end() && *lower == trk);
194 elems.emplace_back(trkElem);
200 elems.shrink_to_fit();
GeneralTracksImporter(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
static int muAssocToTrack(const reco::TrackRef &trackref, const reco::MuonCollection &muons)
const ConversionRefVector & convRefs() const override
const PFDisplacedTrackerVertexRef & displacedVertexRef(TrackType trType) const override
const bool useIterTracking_
const std::vector< double > DPtovPtCut_
const double muonMaxDPtOPt_
Quality qualityByName(std::string const &name)
static bool isMuon(const reco::PFBlockElement &elt)
TrackQuality
track quality
std::vector< Track > TrackCollection
collection of Tracks
edm::EDGetTokenT< reco::TrackCollection > tracksSrc_
auto const & tracks
cannot be loose
key_type key() const
Accessor for product key.
edm::EDGetTokenT< std::vector< TICLSeedingRegion > > vetoTICLSeedingSrc_
bool empty() const
Is the RefVector empty.
ProductID id() const
Accessor for product ID.
std::vector< Muon > MuonCollection
collection of Muon objects
const VertexCompositeCandidateRef & V0Ref() const override
void importToBlock(const edm::Event &, ElementList &) const override
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
Container::value_type value_type
const edm::EDGetTokenT< reco::MuonCollection > muons_
bool trackType(TrackType trType) const override
bool get(ProductID const &oid, Handle< PROD > &result) const
edm::Ref< PFRecTrackCollection > PFRecTrackRef
persistent reference to PFRecTrack objects
edm::Ref< MuonCollection > MuonRef
presistent reference to a Muon
const std::vector< unsigned > NHitCut_
bool isNull() const
Checks for null.
const reco::TrackBase::TrackQuality trackQuality_
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
edm::EDGetTokenT< reco::PFRecTrackCollection > vetoPFTracksSrc_
edm::EDGetTokenT< reco::PFCandidateCollection > vetoPFCandidatesSrc_
static bool isLooseMuon(const reco::PFBlockElement &elt)
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
T getParameter(std::string const &) const
const reco::TrackRef & trackRef() const override
const bool cleanBadConvBrems_
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
void setMuonRef(const MuonRef &muref) override
reference to the Muon
static bool hasValidTrack(const reco::MuonRef &muonRef, bool loose, double maxDPtOPt)
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::vector< std::unique_ptr< reco::PFBlockElement > > ElementList
const edm::EDGetTokenT< reco::PFRecTrackCollection > src_
std::vector< PFRecTrack > PFRecTrackCollection
collection of PFRecTrack objects