19 DPtovPtCut_(conf.getParameter<
std::vector<double> >(
"DPtOverPtCuts_byTrackAlgo")),
20 NHitCut_(conf.getParameter<
std::vector<unsigned> >(
"NHitCuts_byTrackAlgo")),
42 std::unique_ptr<PFMuonAlgo>
pfmu_;
48 "GeneralTracksImporter");
56 elems.reserve(elems.size() +
tracks->size());
63 auto itr = elems.begin();
64 while( itr != elems.end() ) {
79 itr = elems.erase(itr);
90 auto TKs_end = std::partition(elems.begin(),elems.end(),
91 [](
const ElementType&
a){
94 auto btk_elems = elems.begin();
95 auto btrack =
tracks->cbegin();
96 auto etrack =
tracks->cend();
98 auto tk_elem = std::find_if(btk_elems,TKs_end,
99 [&](
const ElementType&
a){
100 return ( a->trackRef() ==
103 if( tk_elem != TKs_end ) {
122 if( !
mask[idx] )
continue;
127 bool thisIsAPotentialMuon =
false;
135 if (thisIsAPotentialMuon &&
debug_) {
136 std::cout <<
"Potential Muon P " << pftrackref->trackRef()->p()
137 <<
" pt " << pftrackref->trackRef()->p() << std::endl;
139 if( muId != -1 ) trkElem->
setMuonRef(muonref);
140 elems.emplace_back(trkElem);
143 elems.shrink_to_fit();
149 auto muon = std::find_if(muonh->cbegin(),muonh->cend(),
151 return (
m.track().isNonnull() &&
152 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)
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
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
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