13 #ifndef TauAnalysis_MCEmbeddingTools_TrackerCleaner_H
14 #define TauAnalysis_MCEmbeddingTools_TrackerCleaner_H
49 std::map<std::string, edm::EDGetTokenT<TrackClusterCollection> >
inputs_;
56 : mu_input_(consumes<edm::
View<pat::
Muon> >(iConfig.getParameter<edm::
InputTag>(
"MuonCollection")))
59 std::vector<edm::InputTag> inCollections = iConfig.
getParameter<std::vector<edm::InputTag> >(
"oldCollection");
60 for (
const auto& inCollection : inCollections) {
61 inputs_[inCollection.instance()] = consumes<TrackClusterCollection>(inCollection);
62 produces<TrackClusterCollection>(inCollection.instance());
79 for (
auto input_ : inputs_) {
81 iEvent.
getByToken(input_.second, inputClusters);
83 std::vector<bool> vetodClusters;
85 vetodClusters.resize(inputClusters->dataSize(),
false);
88 if (!iMuon->isGlobalMuon())
90 const reco::Track* mutrack = iMuon->globalTrack().get();
94 if (!(murechit).isValid())
97 if (match_rechit_type(murechit)) {
99 auto const& cluster = thit.firstClusterRef();
100 vetodClusters[cluster.key()] =
true;
108 clustSet != inputClusters->end();
110 DetId detIdObject(clustSet->detId());
115 if (vetodClusters[idx - 1])
118 spc.push_back(*clustIt);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const edm::EDGetTokenT< edm::View< pat::Muon > > mu_input_
data_type const * const_iterator
TrackerCleaner(const edm::ParameterSet &)
void produce(edm::Event &, const edm::EventSetup &) override
~TrackerCleaner() override
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
std::map< std::string, edm::EDGetTokenT< TrackClusterCollection > > inputs_
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
T getParameter(std::string const &) const
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
bool match_rechit_type(const TrackingRecHit &murechit)
edmNew::DetSetVector< T > TrackClusterCollection
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.