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 )
50 produces< JetValueMap >();
65 edm::LogWarning(
"ValueLabelMismatch") <<
"The number of value labels does not match the number of values. Values will not be evaluated.";
83 std::vector<float>
values( h_jets1->size(), -99999 );
84 std::map<std::string, std::vector<float> > valuesMap;
88 valuesMap.insert( std::make_pair(
valueLabels_[
i], std::vector<float>( h_jets1->size(), -99999 ) ) );
90 std::vector<bool> jets1_locks( h_jets1->size(),
false );
93 iend = h_jets2->end(), ijet = ibegin;
94 ijet != iend; ++ijet )
96 float matched_dR2 = 1e9;
97 int matched_index = -1;
100 jend = h_jets1->end(), jjet = jbegin;
101 jjet != jend; ++jjet )
103 int index=jjet - jbegin;
105 if( jets1_locks.at(index) )
continue;
107 float temp_dR2 =
reco::deltaR2(ijet->eta(),ijet->phi(),jjet->eta(),jjet->phi());
108 if ( temp_dR2 < matched_dR2 )
110 matched_dR2 = temp_dR2;
111 matched_index =
index;
115 if( matched_index>=0 )
121 jets1_locks.at(matched_index) =
true;
135 std::auto_ptr< JetValueMap > jetValueMap (
new JetValueMap() );
142 iEvent.
put(jetValueMap);
148 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)