19 DPtovPtCut_(conf.getParameter<
std::vector<double> >(
"DPtOverPtCuts_byTrackAlgo")),
20 NHitCut_(conf.getParameter<
std::vector<unsigned> >(
"NHitCuts_byTrackAlgo")),
26 pfmu_->setParameters(conf);
43 std::unique_ptr<PFMuonAlgo>
pfmu_;
49 "GeneralTracksImporter");
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() ) {
82 itr = elems.erase(itr);
93 auto TKs_end = std::partition(elems.begin(),elems.end(),
94 [](
const ElementType&
a){
97 auto btk_elems = elems.begin();
98 auto btrack = tracks->cbegin();
99 auto etrack = tracks->cend();
101 auto tk_elem = std::find_if(btk_elems,TKs_end,
102 [&](
const ElementType&
a){
103 return ( a->trackRef() ==
106 if( tk_elem != TKs_end ) {
125 if( !
mask[idx] )
continue;
130 bool thisIsAPotentialMuon =
false;
138 if (thisIsAPotentialMuon &&
debug_) {
139 std::cout <<
"Potential Muon P " << pftrackref->trackRef()->p()
140 <<
" pt " << pftrackref->trackRef()->p() << std::endl;
142 if( muId != -1 ) trkElem->
setMuonRef(muonref);
143 elems.emplace_back(trkElem);
146 elems.shrink_to_fit();
152 auto muon = std::find_if(muonh->cbegin(),muonh->cend(),
154 return (
m.track().isNonnull() &&
155 m.track() == trackref );
void importToBlock(const edm::Event &, ElementList &) const override
GeneralTracksImporter(const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
const bool useIterTracking_
const std::vector< double > DPtovPtCut_
edm::EDGetTokenT< reco::MuonCollection > muons_
static bool isMuon(const reco::PFBlockElement &elt)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const reco::TrackRef & trackRef() const override
std::unique_ptr< PFMuonAlgo > pfmu_
const ConversionRefVector & convRefs() const override
bool trackType(TrackType trType) const override
int muAssocToTrack(const reco::TrackRef &trackref, const edm::Handle< reco::MuonCollection > &muonh) const
bool empty() const
Is the RefVector empty.
edm::EDGetTokenT< reco::PFRecTrackCollection > src_
std::vector< Muon > MuonCollection
collection of Muon objects
Container::value_type value_type
edm::Ref< PFRecTrackCollection > PFRecTrackRef
persistent reference to PFRecTrack objects
const VertexCompositeCandidateRef & V0Ref() const override
edm::Ref< MuonCollection > MuonRef
presistent reference to a Muon
const std::vector< unsigned > NHitCut_
bool isNull() const
Checks for null.
const PFDisplacedTrackerVertexRef & displacedVertexRef(TrackType trType) const override
static bool isLooseMuon(const reco::PFBlockElement &elt)
const bool cleanBadConvBrems_
void setMuonRef(const MuonRef &muref) override
reference to the Muon
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::vector< std::unique_ptr< reco::PFBlockElement > > ElementList
std::vector< PFRecTrack > PFRecTrackCollection
collection of PFRecTrack objects