10 double puCent[11] = {-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5};
21 : jetType_(iConfig.getParameter<
std::
string>(
"jetType")),
22 rhoTagString_(iConfig.getParameter<
std::
string>(
"rhoTag"))
28 produces<reco::CaloJetCollection>();
31 produces<reco::PFJetCollection>();
34 produces<reco::GenJetCollection>();
38 throw cms::Exception(
"InvalidInput") <<
"invalid jet type in HiL1Subtractor\n";
54 auto jets = std::make_unique<reco::GenJetCollection>();
62 int rsize = rs->size();
64 for (
int j = 0;
j < rsize;
j++) {
65 double medianpt = rs->at(
j);
70 int jetsize = h_jets->size();
71 for (
int ijet = 0; ijet < jetsize; ++ijet) {
74 double jet_eta =
jet.eta();
75 double jet_et =
jet.et();
79 if (fabs(jet_eta) <= 3) {
82 if (jet_eta < -2.5 && jet_eta > -3.5)
84 if (jet_eta < -1.5 && jet_eta > -2.5)
86 if (jet_eta < -0.5 && jet_eta > -1.5)
88 if (jet_eta < 0.5 && jet_eta > -0.5)
90 if (jet_eta < 1.5 && jet_eta > 0.5)
92 if (jet_eta < 2.5 && jet_eta > 1.5)
94 if (jet_eta < 3.5 && jet_eta > 2.5)
97 double jet_area =
jet.jetArea();
99 double CorrFactor = 0.;
100 if (
rho * jet_area < jet_et)
101 CorrFactor = 1.0 -
rho * jet_area / jet_et;
102 jet.scaleEnergy(CorrFactor);
103 jet.setPileup(
rho * jet_area);
114 auto jets = std::make_unique<reco::CaloJetCollection>();
122 int rsize = rs->size();
124 for (
int j = 0;
j < rsize;
j++) {
125 double medianpt = rs->at(
j);
131 int jetsize = h_jets->size();
133 for (
int ijet = 0; ijet < jetsize; ++ijet) {
136 double jet_eta =
jet.eta();
137 double jet_et =
jet.et();
141 if (fabs(jet_eta) <= 3) {
144 if (jet_eta < -2.5 && jet_eta > -3.5)
146 if (jet_eta < -1.5 && jet_eta > -2.5)
148 if (jet_eta < -0.5 && jet_eta > -1.5)
150 if (jet_eta < 0.5 && jet_eta > -0.5)
152 if (jet_eta < 1.5 && jet_eta > 0.5)
154 if (jet_eta < 2.5 && jet_eta > 1.5)
156 if (jet_eta < 3.5 && jet_eta > 2.5)
159 double jet_area =
jet.jetArea();
161 double CorrFactor = 0.;
162 if (
rho * jet_area < jet_et)
163 CorrFactor = 1.0 -
rho * jet_area / jet_et;
164 jet.scaleEnergy(CorrFactor);
165 jet.setPileup(
rho * jet_area);
177 auto jets = std::make_unique<reco::PFJetCollection>();
185 int rsize = rs->size();
187 for (
int j = 0;
j < rsize;
j++) {
188 double medianpt = rs->at(
j);
194 int jetsize = h_jets->size();
196 for (
int ijet = 0; ijet < jetsize; ++ijet) {
199 double jet_eta =
jet.eta();
200 double jet_et =
jet.et();
204 if (fabs(jet_eta) <= 3) {
207 if (jet_eta < -2.5 && jet_eta > -3.5)
209 if (jet_eta < -1.5 && jet_eta > -2.5)
211 if (jet_eta < -0.5 && jet_eta > -1.5)
213 if (jet_eta < 0.5 && jet_eta > -0.5)
215 if (jet_eta < 1.5 && jet_eta > 0.5)
217 if (jet_eta < 2.5 && jet_eta > 1.5)
219 if (jet_eta < 3.5 && jet_eta > 2.5)
222 double jet_area =
jet.jetArea();
224 double CorrFactor = 0.;
225 if (
rho * jet_area < jet_et)
226 CorrFactor = 1.0 -
rho * jet_area / jet_et;
227 jet.scaleEnergy(CorrFactor);
228 jet.setPileup(
rho * jet_area);