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.";
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::auto_ptr< JetValueMap > jetValueMap (
new JetValueMap() );
140 iEvent.
put(jetValueMap);
146 std::auto_ptr< JetValueMap > jetValueMap (
new JetValueMap() );
166 std::map<std::string, std::unique_ptr<const StringObjectFunction<T> > >
evaluationMap_;
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, std::unique_ptr< const StringObjectFunction< T > > > evaluationMap_
JetDeltaRValueMapProducer< reco::Jet > RecoJetDeltaRValueMapProducer
volatile std::atomic< bool > shutdown_flag false
virtual ~JetDeltaRValueMapProducer()
JetDeltaRValueMapProducer(edm::ParameterSet const ¶ms)