16 jetsInput_ = iConfig.template getParameter<edm::InputTag>(
"jetsInput");
17 L1Jets_ = iConfig.template getParameter<edm::InputTag>(
"L1Jets");
18 DeltaR_ = iConfig.template getParameter<double>(
"DeltaR");
20 typedef std::vector<T> TCollection;
21 m_theJetToken = consumes<TCollection>(jetsInput_);
22 m_theL1JetToken = consumes<l1t::JetBxCollection>(L1Jets_);
23 produces<TCollection> ();
41 desc.
add<
double>(
"DeltaR",0.5);
49 typedef std::vector<T> TCollection;
54 std::unique_ptr<TCollection>
result (
new TCollection);
59 bool trigger_bx_only =
true;
62 typename TCollection::const_iterator jet_iter;
63 for (jet_iter = jets->begin(); jet_iter != jets->end(); ++jet_iter) {
66 if (trigger_bx_only && (ibx != 0))
continue;
67 for (
auto it=l1Jets->
begin(ibx); it!=l1Jets->
end(ibx); it++){
68 if (it->et() == 0)
continue;
69 const double deltaeta=jet_iter->eta()-it->eta();
70 const double deltaphi=
deltaPhi(jet_iter->phi(),it->phi());
71 if (
sqrt(deltaeta*deltaeta+deltaphi*deltaphi) < DeltaR_) isMatched=
true;
75 if (isMatched==
true) result->push_back(*jet_iter);
78 edm::LogWarning(
"MissingProduct") <<
"L1Upgrade l1Jets bx collection not found." << std::endl;
const_iterator end(int bx) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::string defaultModuleLabel()
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
bool isMatched(TrackingRecHit const &hit)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void produce(edm::Event &, const edm::EventSetup &) override
~HLTJetL1TMatchProducer() override
HLTJetL1TMatchProducer(const edm::ParameterSet &)
const_iterator begin(int bx) const