19 DPtovPtCut_(conf.getParameter<
std::vector<double> >(
"DPtOverPtCuts_byTrackAlgo")),
20 NHitCut_(conf.getParameter<
std::vector<unsigned> >(
"NHitCuts_byTrackAlgo")),
25 cleanBadConvBrems_(conf.existsAs<bool>(
"cleanBadConvertedBrems") ? conf.getParameter<bool>(
"cleanBadConvertedBrems") :
false),
26 debug_(conf.getUntrackedParameter<bool>(
"debug",
false)) {
29 pfmu_->setParameters(conf);
48 std::unique_ptr<PFMuonAlgo>
pfmu_;
54 "GeneralTracksImporter");
64 elems.reserve(elems.size() + tracks->size());
65 std::vector<bool>
mask(tracks->size(),
true);
75 auto itr = elems.begin();
76 while( itr != elems.end() ) {
91 itr = elems.erase(itr);
102 auto TKs_end = std::partition(elems.begin(),elems.end(),
103 [](
const ElementType&
a){
106 auto btk_elems = elems.begin();
107 auto btrack = tracks->cbegin();
108 auto etrack = tracks->cend();
110 auto tk_elem = std::find_if(btk_elems,TKs_end,
111 [&](
const ElementType&
a){
112 return ( a->trackRef() ==
115 if( tk_elem != TKs_end ) {
134 if( !
mask[idx] )
continue;
139 bool thisIsAPotentialMuon =
false;
147 if (thisIsAPotentialMuon &&
debug_) {
148 std::cout <<
"Potential Muon P " << pftrackref->trackRef()->p()
149 <<
" pt " << pftrackref->trackRef()->p() << std::endl;
151 if( muId != -1 ) trkElem->
setMuonRef(muonref);
153 trkElem->
setTime( (*timeH)[pftrackref->trackRef()], (*timeErrH)[pftrackref->trackRef()] );
155 elems.emplace_back(trkElem);
158 elems.shrink_to_fit();
164 auto muon = std::find_if(muonh->cbegin(),muonh->cend(),
166 return (
m.track().isNonnull() &&
167 m.track() == trackref );
const VertexCompositeCandidateRef & V0Ref() const
void importToBlock(const edm::Event &, ElementList &) const override
const reco::TrackRef & trackRef() const
GeneralTracksImporter(const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
edm::EDGetTokenT< edm::ValueMap< float > > srcTime_
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
std::unique_ptr< PFMuonAlgo > pfmu_
int muAssocToTrack(const reco::TrackRef &trackref, const edm::Handle< reco::MuonCollection > &muonh) const
edm::EDGetTokenT< reco::PFRecTrackCollection > src_
std::vector< Muon > MuonCollection
collection of Muon objects
Container::value_type value_type
const ConversionRefVector & convRefs() 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.
virtual bool trackType(TrackType trType) const
void setMuonRef(const MuonRef &muref)
reference to the Muon
static bool isLooseMuon(const reco::PFBlockElement &elt)
const bool cleanBadConvBrems_
const PFDisplacedTrackerVertexRef & displacedVertexRef(TrackType trType) const
size_type size() const
Size of the RefVector.
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::vector< std::unique_ptr< reco::PFBlockElement > > ElementList
edm::EDGetTokenT< edm::ValueMap< float > > srcTimeError_
std::vector< PFRecTrack > PFRecTrackCollection
collection of PFRecTrack objects
void setTime(float time, float timeError=0.f)
the timing information