31 template <
class T,
class C=T >
41 distMax_( params.getParameter<double>(
"distMax" ) ),
51 produces< JetValueMap >();
66 edm::LogWarning(
"ValueLabelMismatch") <<
"The number of value labels does not match the number of values. Values will not be evaluated.";
81 std::vector<float>
values( h_jets1->size(), -99999 );
82 std::map<std::string, std::vector<float> > valuesMap;
86 valuesMap.insert( std::make_pair(
valueLabels_[
i], std::vector<float>( h_jets1->size(), -99999 ) ) );
88 std::vector<bool> jets1_locks( h_jets1->size(),
false );
91 iend = h_jets2->end(), ijet = ibegin;
92 ijet != iend; ++ijet )
94 float matched_dR2 = 1e9;
95 int matched_index = -1;
98 jend = h_jets1->end(), jjet = jbegin;
99 jjet != jend; ++jjet )
101 int index=jjet - jbegin;
103 if( jets1_locks.at(index) )
continue;
105 float temp_dR2 =
reco::deltaR2(ijet->eta(),ijet->phi(),jjet->eta(),jjet->phi());
106 if ( temp_dR2 < matched_dR2 )
108 matched_dR2 = temp_dR2;
109 matched_index =
index;
113 if( matched_index>=0 )
116 edm::LogInfo(
"MatchedJetsFarApart") <<
"Matched jets separated by dR greater than distMax=" <<
distMax_;
119 jets1_locks.at(matched_index) =
true;
133 std::unique_ptr< JetValueMap > jetValueMap (
new JetValueMap() );
146 std::unique_ptr< JetValueMap > jetValueMap (
new JetValueMap() );
166 std::map<std::string, std::unique_ptr<const StringObjectFunction<C> > >
evaluationMap_;
edm::ValueMap< float > JetValueMap
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
JetDeltaRValueMapProducer(edm::ParameterSet const ¶ms)
const std::vector< std::string > valueLabels_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
JetDeltaRValueMapProducer< reco::Jet, pat::Jet > RecoJetToPatJetDeltaRValueMapProducer
void insert(const H &h, I begin, I end)
std::map< std::string, std::unique_ptr< const StringObjectFunction< C > > > evaluationMap_
JetDeltaRValueMapProducer< pat::Jet > PatJetDeltaRValueMapProducer
const edm::EDGetTokenT< typename edm::View< C > > matchedToken_
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
const edm::EDGetTokenT< typename edm::View< T > > srcToken_
~JetDeltaRValueMapProducer() override
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
JetDeltaRValueMapProducer< reco::Jet > RecoJetDeltaRValueMapProducer
const std::vector< std::string > values_