1 #ifndef HLTrigger_JetMET_plugins_HLTJetHFCleaner_h 2 #define HLTrigger_JetMET_plugins_HLTJetHFCleaner_h 51 template <
typename JetType>
88 template <
typename JetType>
90 : jetToken_(consumes(iConfig.getParameter<
edm::
InputTag>(
"jets"))),
91 metToken_(consumes(iConfig.getParameter<
edm::
InputTag>(
"mets"))),
92 sigmaEtaEtaToken_(consumes(iConfig.getParameter<
edm::
InputTag>(
"sigmaEtaEta"))),
93 sigmaPhiPhiToken_(consumes(iConfig.getParameter<
edm::
InputTag>(
"sigmaPhiPhi"))),
94 centralEtaStripSizeToken_(consumes(iConfig.getParameter<
edm::
InputTag>(
"centralEtaStripSize"))),
95 jetPtMin_(iConfig.getParameter<double>(
"jetPtMin")),
96 dphiJetMetMin_(iConfig.getParameter<double>(
"dphiJetMetMin")),
97 jetEtaMin_(iConfig.getParameter<double>(
"jetEtaMin")),
98 jetEtaMax_(iConfig.getParameter<double>(
"jetEtaMax")),
99 sigmaEtaPhiDiffMax_(iConfig.getParameter<double>(
"sigmaEtaPhiDiffMax")),
100 centralEtaStripSizeMax_(iConfig.getParameter<
int>(
"centralEtaStripSizeMax")),
101 cornerCutSigmaEtaEta_(iConfig.getParameter<double>(
"cornerCutSigmaEtaEta")),
102 cornerCutSigmaPhiPhi_(iConfig.getParameter<double>(
"cornerCutSigmaPhiPhi")),
103 applySigmaEtaPhiCornerCut_(iConfig.getParameter<
bool>(
"applySigmaEtaPhiCornerCut")),
104 applySigmaEtaPhiCut_(iConfig.getParameter<
bool>(
"applySigmaEtaPhiCut")),
105 applyStripSizeCut_(iConfig.getParameter<
bool>(
"applyStripSizeCut")) {
106 produces<JetCollection>();
109 template <
typename JetType>
111 auto const jets =
iEvent.getHandle(jetToken_);
115 auto cleaned_jets = std::make_unique<JetCollection>();
116 cleaned_jets->reserve(
jets->size());
119 if (
mets.size() != 1) {
120 throw cms::Exception(
"ComparisonFailure") <<
"Size of reco::MET collection is different from 1";
122 auto const met_phi =
mets.front().phi();
127 auto const& sigmaEtaEtas =
iEvent.get(sigmaEtaEtaToken_);
128 auto const& sigmaPhiPhis =
iEvent.get(sigmaPhiPhiToken_);
129 auto const& centralEtaStripSizes =
iEvent.get(centralEtaStripSizeToken_);
132 for (
uint ijet = 0; ijet <
jets->size(); ijet++) {
133 auto const jet = (*jets)[ijet];
137 cleaned_jets->emplace_back(
jet);
142 if ((
jet.pt() < jetPtMin_)
or (!withinEtaRange)) {
143 cleaned_jets->emplace_back(
jet);
152 if (applySigmaEtaPhiCut_) {
160 cleaned_jets->emplace_back(
jet);
166 if (applySigmaEtaPhiCornerCut_) {
168 passSigmaEtaPhiCut &= !inCorner;
170 if (!passSigmaEtaPhiCut) {
176 if (applyStripSizeCut_ and (centralEtaStripSizes[jetRef] > centralEtaStripSizeMax_)) {
180 cleaned_jets->emplace_back(
jet);
187 template <
typename JetType>
193 ->setComment(
"Input collection which stores the sigmaEtaEta values per jet.");
195 ->setComment(
"Input collection which stores the sigmaPhiPhis values per jet.");
197 ->setComment(
"Input collection which stores the central strip size values per jet.");
198 desc.add<
double>(
"jetPtMin", 100)->setComment(
"The minimum pt value for a jet such that the cuts will be applied.");
199 desc.add<
double>(
"dphiJetMetMin", 2.5)
201 "The minimum value for deltaPhi between jet and MET, such that the cuts will be applied to a given jet.");
202 desc.add<
double>(
"jetEtaMin", 2.9)->setComment(
"Minimum value of jet |eta| for which the cuts will be applied.");
203 desc.add<
double>(
"jetEtaMax", 5.0)->setComment(
"Maximum value of jet |eta| for which the cuts will be applied.");
204 desc.add<
double>(
"sigmaEtaPhiDiffMax", 0.05)
205 ->setComment(
"Determines the threshold in the following cut: sigmaEtaEta-sigmaPhiPhi <= X");
206 desc.add<
double>(
"cornerCutSigmaEtaEta", 0.02)
208 "Corner cut value for sigmaEtaEta. Jets will be cut if both sigmaEtaEta and sigmaPhiPhi are lower than the " 210 desc.add<
double>(
"cornerCutSigmaPhiPhi", 0.02)
212 "Corner cut value for sigmaPhiPhi. Jets will be cut if both sigmaEtaEta and sigmaPhiPhi are lower than the " 214 desc.add<
int>(
"centralEtaStripSizeMax", 2)
215 ->setComment(
"Determines the threshold in the following cut: centralEtaStripSize <= X");
216 desc.add<
bool>(
"applySigmaEtaPhiCornerCut",
true)->setComment(
"Boolean specifying whether to apply the corner cut.");
217 desc.add<
bool>(
"applySigmaEtaPhiCut",
true)
218 ->setComment(
"Boolean specifying whether to apply the sigmaEtaEta-sigmaPhiPhi cut.");
219 desc.add<
bool>(
"applyStripSizeCut",
true)
220 ->setComment(
"Boolean specifying whether to apply the centralEtaStripSize cut.");
constexpr double deltaPhi(double phi1, double phi2)
edm::Ref< JetCollection > JetRef
const float cornerCutSigmaPhiPhi_
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
const edm::EDGetTokenT< edm::View< reco::MET > > metToken_
HLTJetHFCleaner(const edm::ParameterSet &)
const float dphiJetMetMin_
const float sigmaEtaPhiDiffMax_
const float centralEtaStripSizeMax_
const edm::EDGetTokenT< edm::ValueMap< int > > centralEtaStripSizeToken_
const float cornerCutSigmaEtaEta_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
~HLTJetHFCleaner() override=default
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Abs< T >::type abs(const T &t)
const edm::EDGetTokenT< std::vector< JetType > > jetToken_
const edm::EDGetTokenT< edm::ValueMap< float > > sigmaPhiPhiToken_
const bool applySigmaEtaPhiCut_
const bool applyStripSizeCut_
std::vector< JetType > JetCollection
const bool applySigmaEtaPhiCornerCut_
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
const edm::EDGetTokenT< edm::ValueMap< float > > sigmaEtaEtaToken_