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> ();
44 desc.
add<
double>(
"DeltaR",0.5);
52 typedef std::vector<T> TCollection;
57 std::unique_ptr<TCollection>
result (
new TCollection);
62 bool trigger_bx_only =
true;
65 typename TCollection::const_iterator jet_iter;
66 for (jet_iter = jets->begin(); jet_iter != jets->end(); ++jet_iter) {
68 for (
int ibx = l1Jets->getFirstBX(); ibx <= l1Jets->getLastBX(); ++ibx) {
69 if (trigger_bx_only && (ibx != 0))
continue;
70 for (
auto it=l1Jets->begin(ibx); it!=l1Jets->end(ibx); it++){
71 if (it->et() == 0)
continue;
72 const double deltaeta=jet_iter->eta()-it->eta();
73 const double deltaphi=
deltaPhi(jet_iter->phi(),it->phi());
74 if (
sqrt(deltaeta*deltaeta+deltaphi*deltaphi) < DeltaR_) isMatched=
true;
78 if (isMatched==
true) result->push_back(*jet_iter);
81 edm::LogWarning(
"MissingProduct") <<
"L1Upgrade l1Jets bx collection not found." << std::endl;
std::string defaultModuleLabel()
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
~HLTJetL1TMatchProducer()
virtual void produce(edm::Event &, const edm::EventSetup &)
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)
HLTJetL1TMatchProducer(const edm::ParameterSet &)