13 #ifndef TauAnalysis_MCEmbeddingTools_CaloCleaner_H 14 #define TauAnalysis_MCEmbeddingTools_CaloCleaner_H 50 std::map<std::string, edm::EDGetTokenT<RecHitCollection > >
inputs_;
64 std::vector<edm::InputTag> inCollections = iConfig.
getParameter<std::vector<edm::InputTag> >(
"oldCollection");
65 for (
auto inCollection : inCollections){
66 inputs_[inCollection.instance()] = consumes<RecHitCollection >(inCollection);
67 produces<RecHitCollection>(inCollection.instance());
96 std::map<uint32_t, float> correction_map;
103 if ( iMuon->track().isNonnull() ) track = iMuon->track().get();
104 else if ( iMuon->standAloneMuon().isNonnull() ) track = iMuon->
standAloneMuon().get();
105 else throw cms::Exception(
"FatalError") <<
"Failed to fill muon id information for a muon with undefined references to tracks";
112 std::unique_ptr<RecHitCollection> recHitCollection_output(
new RecHitCollection());
115 iEvent.
getByToken(input_.second, recHitCollection);
117 if (correction_map[
recHit->detid().rawId()] > 0){
118 float new_energy =
recHit->energy() - correction_map[
recHit->detid().rawId()];
119 if (new_energy <= 0)
continue;
121 newRecHit.setEnergy(new_energy);
122 recHitCollection_output->push_back(newRecHit);
125 recHitCollection_output->push_back(*
recHit);
141 recHitCollection_output->sort();
142 iEvent.
put(
std::move(recHitCollection_output),input_.first);
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void fill_correction_map(TrackDetMatchInfo *, std::map< uint32_t, float > *)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< T >::const_iterator const_iterator
void loadParameters(const edm::ParameterSet &, edm::ConsumesCollector &)
const edm::EDGetTokenT< edm::View< pat::Muon > > mu_input_
std::map< std::string, edm::EDGetTokenT< RecHitCollection > > inputs_
void produce(edm::Event &, const edm::EventSetup &) override
edm::SortedCollection< T > RecHitCollection
const_iterator begin() const
void setPropagator(const Propagator *)
use a user configured propagator
const_iterator end() const
TrackDetectorAssociator trackAssociator_
CaloCleaner(const edm::ParameterSet &)
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
TrackAssociatorParameters parameters_
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
const_iterator end() const
T const * product() const
const_iterator begin() const