14 jetsInput_ = iConfig.template getParameter<edm::InputTag>(
"jetsInput");
15 L1TauJets_ = iConfig.template getParameter<edm::InputTag>(
"L1TauJets");
16 L1CenJets_ = iConfig.template getParameter<edm::InputTag>(
"L1CenJets");
17 L1ForJets_ = iConfig.template getParameter<edm::InputTag>(
"L1ForJets");
18 DeltaR_ = iConfig.template getParameter<double>(
"DeltaR");
20 typedef std::vector<T> TCollection;
21 m_theJetToken = consumes<TCollection>(jetsInput_);
22 m_theL1TauJetToken = consumes<l1extra::L1JetParticleCollection>(L1TauJets_);
23 m_theL1CenJetToken = consumes<l1extra::L1JetParticleCollection>(L1CenJets_);
24 m_theL1ForJetToken = consumes<l1extra::L1JetParticleCollection>(L1ForJets_);
25 produces<TCollection>();
41 desc.
add<
double>(
"DeltaR", 0.5);
47 typedef std::vector<T> TCollection;
52 std::unique_ptr<TCollection>
result(
new TCollection);
55 iEvent.
getByToken(m_theL1TauJetToken, l1TauJets);
58 iEvent.
getByToken(m_theL1CenJetToken, l1CenJets);
61 iEvent.
getByToken(m_theL1ForJetToken, l1ForJets);
63 typename TCollection::const_iterator jet_iter;
64 for (jet_iter = jets->begin(); jet_iter != jets->end(); ++jet_iter) {
68 for (
unsigned int jetc = 0; jetc < l1TauJets->size(); ++jetc) {
69 const double deltaeta = jet_iter->eta() - (*l1TauJets)[jetc].eta();
70 const double deltaphi =
deltaPhi(jet_iter->phi(), (*l1TauJets)[jetc].phi());
72 if (
sqrt(deltaeta * deltaeta + deltaphi * deltaphi) < DeltaR_)
76 for (
unsigned int jetc = 0; jetc < l1CenJets->size(); ++jetc) {
77 const double deltaeta = jet_iter->eta() - (*l1CenJets)[jetc].eta();
78 const double deltaphi =
deltaPhi(jet_iter->phi(), (*l1CenJets)[jetc].phi());
79 if (
sqrt(deltaeta * deltaeta + deltaphi * deltaphi) < DeltaR_)
83 for (
unsigned int jetc = 0; jetc < l1ForJets->size(); ++jetc) {
84 const double deltaeta = jet_iter->eta() - (*l1ForJets)[jetc].eta();
85 const double deltaphi =
deltaPhi(jet_iter->phi(), (*l1ForJets)[jetc].phi());
86 if (
sqrt(deltaeta * deltaeta + deltaphi * deltaphi) < DeltaR_)
90 if (isMatched ==
true)
91 result->push_back(*jet_iter);
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)
~HLTJetL1MatchProducer() override
HLTJetL1MatchProducer(const edm::ParameterSet &)
void produce(edm::Event &, const edm::EventSetup &) override
bool isMatched(TrackingRecHit const &hit)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)