|
|
Go to the documentation of this file. 1 #ifndef HLTJetsCleanedFromLeadingLeptons_h
2 #define HLTJetsCleanedFromLeadingLeptons_h
27 template <
typename JetType>
34 typedef std::vector<edm::RefVector<JetCollection, JetType, edm::refhelper::FindUsingAdvance<JetCollection, JetType>>>
112 template <
typename JetType>
114 : etaValue(
eta), phiValue(
phi), eValue(
e) {}
116 template <
typename JetType>
121 template <
typename JetType>
126 template <
typename JetType>
131 template <
typename JetType>
133 return (eValue < rhs.
eValue);
136 template <
typename JetType>
139 numLeptons(iConfig.getParameter<unsigned>(
"numLeptons")) {
143 produces<JetCollectionVector>();
146 template <
typename JetType>
151 ->setComment(
"A collection of leptons that pass an HLT filter");
153 desc.add<
double>(
"minDeltaR", 0.3)->setComment(
"Minimal allowed angular separation between a jet and a lepton");
154 desc.add<
unsigned>(
"numLeptons", 1)->setComment(
"Number of leading leptons against which the jets are cleaned");
159 template <
typename JetType>
163 iEvent.getByToken(leptonToken, filterOutput);
166 std::vector<EtaPhiE> leptonMomenta;
172 for (
auto const &muRef :
muons)
173 leptonMomenta.emplace_back(muRef->eta(), muRef->phi(), muRef->energy());
183 auto const &sc = eRef->superCluster();
184 leptonMomenta.emplace_back(sc->eta(), sc->phi(), sc->energy());
190 for (
auto const &eRef :
photons)
192 auto const &sc = eRef->superCluster();
193 leptonMomenta.emplace_back(sc->eta(), sc->phi(), sc->energy());
201 auto const &sc = eRef->superCluster();
202 leptonMomenta.emplace_back(sc->eta(), sc->phi(), sc->energy());
206 std::sort(leptonMomenta.rbegin(), leptonMomenta.rend());
215 unsigned const numLeptonsToLoop = std::min<unsigned>(leptonMomenta.size(),
numLeptons);
217 for (
unsigned iJet = 0; iJet <
jets.size(); ++iJet) {
220 for (
unsigned iLepton = 0; iLepton < numLeptonsToLoop; ++iLepton)
233 product->emplace_back(cleanedJetRefs);
237 #endif // HLTJetsCleanedFromLeadingLeptons_h
EtaPhiE(double eta, double phi, double e)
Constructor.
edm::EDGetTokenT< std::vector< JetType > > jetToken
Token to access a collection of jets.
double phi() const
Returns azimuthal angle.
HLTJetsCleanedFromLeadingLeptons(edm::ParameterSet const &iConfig)
Constructor.
std::vector< JetType > JetCollection
std::vector< reco::RecoEcalCandidateRef > VRphoton
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > leptonToken
Token to identify a collection of leptons that pass an HLT filter.
Produces a collection of jets cleaned against leading leptons.
std::vector< edm::RefVector< JetCollection, JetType, edm::refhelper::FindUsingAdvance< JetCollection, JetType > > > JetCollectionVector
An auxiliary class to store momentum parametrised in eta, phi, and energy.
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
void produce(edm::Event &iEvent, edm::EventSetup const &iSetup) override
Produces jets cleaned against leptons.
bool operator<(EtaPhiE const &rhs) const
A comparison operator to sort a collection of objects of this type.
double etaValue
Pseudorapidity and azimuthal angle.
double e() const
Returns energy.
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Describes configuration of the plugin.
double minDeltaR2
A square of the minimal allowed angular separation between a lepton and a jet.
std::string defaultModuleLabel()
edm::Ref< JetCollection > JetRef
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
bool overlap(const reco::Muon &muon1, const reco::Muon &muon2, double pullX=1.0, double pullY=1.0, bool checkAdjacentChambers=false)
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
edm::Ref< JetBxCollection > JetRef
std::vector< reco::ElectronRef > VRelectron
edm::RefVector< JetCollection > JetRefVector
std::vector< reco::RecoChargedCandidateRef > VRmuon
unsigned numLeptons
Number of leading leptons against which the jets are cleaned.
T getParameter(std::string const &) const
double eta() const
Returns pseudorapidity.
Power< A, B >::type pow(const A &a, const B &b)