41 distMax_( params.getParameter<double>(
"distMax" ) ),
42 value_( params.existsAs<std::
string>(
"value") ? params.getParameter<std::
string>(
"value") :
"" ),
43 values_( params.existsAs<std::vector<std::
string> >(
"values") ? params.getParameter<std::vector<std::
string> >(
"values") : std::vector<std::
string>() ),
44 valueLabels_( params.existsAs<std::vector<std::
string> >(
"valueLabels") ? params.getParameter<std::vector<std::
string> >(
"valueLabels") : std::vector<std::
string>() ),
45 lazyParser_( params.existsAs<bool>(
"lazyParser") ? params.getParameter<bool>(
"lazyParser") :
false ),
51 produces< JetValueMap >();
66 edm::LogWarning(
"ValueLabelMismatch") <<
"The number of value labels does not match the number of values. Values will not be evaluated.";
84 std::vector<float>
values( h_jets1->size(), -99999 );
85 std::map<std::string, std::vector<float> > valuesMap;
89 valuesMap.insert( std::make_pair(
valueLabels_[
i], std::vector<float>( h_jets1->size(), -99999 ) ) );
91 std::vector<bool> jets1_locks( h_jets1->size(),
false );
94 iend = h_jets2->end(), ijet = ibegin;
95 ijet != iend; ++ijet )
97 float matched_dR2 = 1e9;
98 int matched_index = -1;
101 jend = h_jets1->end(), jjet = jbegin;
102 jjet != jend; ++jjet )
104 int index=jjet - jbegin;
106 if( jets1_locks.at(index) )
continue;
108 float temp_dR2 =
reco::deltaR2(ijet->eta(),ijet->phi(),jjet->eta(),jjet->phi());
109 if ( temp_dR2 < matched_dR2 )
111 matched_dR2 = temp_dR2;
112 matched_index =
index;
116 if( matched_index>=0 )
122 jets1_locks.at(matched_index) =
true;
136 std::auto_ptr< JetValueMap > jetValueMap (
new JetValueMap() );
143 iEvent.
put(jetValueMap);
149 std::auto_ptr< JetValueMap > jetValueMap (
new JetValueMap() );
virtual void endJob() override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const std::vector< std::string > values_
#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
const edm::EDGetTokenT< typename edm::View< T > > srcToken_
const std::vector< std::string > valueLabels_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const edm::EDGetTokenT< typename edm::View< T > > matchedToken_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
double deltaR2(const T1 &t1, const T2 &t2)
std::map< std::string, StringObjectFunction< T > > evaluationMap_
virtual void beginJob() override
JetDeltaRValueMapProducer< reco::Jet > RecoJetDeltaRValueMapProducer
volatile std::atomic< bool > shutdown_flag false
virtual ~JetDeltaRValueMapProducer()
JetDeltaRValueMapProducer(edm::ParameterSet const ¶ms)