16 #include <unordered_set> 43 ptMin_(iConfig.getParameter<double>(
"correctedPtMin"))
45 produces<reco::TrackRefVector> ();
53 desc.
add<
double>(
"correctedPtMin", 0);
54 descriptions.
add(
"jetTracksAssociationToTrackRefs", desc);
70 auto ret = std::make_unique<reco::TrackRefVector>();
71 std::unordered_set<reco::TrackRefVector::key_type> alreadyAdded;
75 for(
size_t i=0;
i<jets.
size(); ++
i) {
99 for(
const auto& trackRef: association[jetRef]) {
100 if(alreadyAdded.find(trackRef.key()) == alreadyAdded.end()) {
101 ret->push_back(trackRef);
102 alreadyAdded.insert(trackRef.key());
edm::EDGetTokenT< edm::View< reco::Jet > > jetToken_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
Base class for all types of Jets.
bool refRequired() const
if correction needs the jet reference
double correction(const LorentzVector &fJet) const
get correction using Jet information only
JetTracksAssociationToTrackRefs(const edm::ParameterSet &iConfig)
edm::EDGetTokenT< reco::JetCorrector > correctorToken_
virtual void produce(edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
RefToBase< value_type > refAt(size_type i) const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::EDGetTokenT< reco::JetTracksAssociation::Container > associationToken_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Association between jets and float value.
bool vectorialCorrection() const
if vectorial correction is provided
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
virtual const LorentzVector & p4() const final
four-momentum Lorentz vector
edm::AssociationVector< reco::JetRefBaseProd, Values > Container