42 distMax_( params.getParameter<double>(
"distMax" ) ),
46 produces< JetValueMap >();
58 std::auto_ptr< JetValueMap > jetValueMap (
new JetValueMap() );
67 std::vector<float>
values( h_jets1->size(), -99999 );
68 std::vector<bool> jets1_locks( h_jets1->size(),
false );
71 iend = h_jets2->end(), ijet = ibegin;
72 ijet != iend; ++ijet )
74 float matched_dR2 = 1e9;
75 int matched_index = -1;
78 jend = h_jets1->end(), jjet = jbegin;
79 jjet != jend; ++jjet )
81 int index=jjet - jbegin;
83 if( jets1_locks.at(index) )
continue;
85 float temp_dR2 =
reco::deltaR2(ijet->eta(),ijet->phi(),jjet->eta(),jjet->phi());
86 if ( temp_dR2 < matched_dR2 )
88 matched_dR2 = temp_dR2;
89 matched_index =
index;
93 if( matched_index>=0 )
99 jets1_locks.at(matched_index) =
true;
109 iEvent.
put(jetValueMap);
virtual void endJob() override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
StringObjectFunction< T > evaluation_
#define DEFINE_FWK_MODULE(type)
edm::ValueMap< float > JetValueMap
void insert(const H &h, I begin, I end)
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
double deltaR2(const T1 &t1, const T2 &t2)
std::vector< T > JetsInput
edm::EDGetTokenT< typename edm::View< T > > matchedToken_
virtual void beginJob() override
JetDeltaRValueMapProducer< reco::Jet > RecoJetDeltaRValueMapProducer
edm::EDGetTokenT< typename edm::View< T > > srcToken_
volatile std::atomic< bool > shutdown_flag false
virtual ~JetDeltaRValueMapProducer()
JetDeltaRValueMapProducer(edm::ParameterSet const ¶ms)