62 vectorial_ = iConfig.
getParameter<
bool>(
"VectorialCorrection");
69 produces<reco::JPTJetCollection>().setBranchAlias(
alias);
71 input_jets_token_ = consumes<edm::View<reco::CaloJet> >(
src);
72 input_vertex_token_ = consumes<reco::VertexCollection>(srcPVs_);
92 iEvent.getByToken(input_jets_token_, jets_h);
95 auto pOut = std::make_unique<reco::JPTJetCollection>();
97 for (
unsigned i = 0;
i < jets_h->size(); ++
i) {
104 double factorZSP = 1.;
106 factorZSP = mZSPalgo->correction(corrected,
iEvent, iSetup);
112 double scaleJPT = 1.;
122 scaleJPT = mJPTalgo->correction(corrected, *oldjet,
iEvent, iSetup, pions,
muons,
elecs,
ok);
124 corrected.
py() * scaleJPT,
125 corrected.
pz() * scaleJPT,
126 corrected.
energy() * scaleJPT);
128 scaleJPT = mJPTalgo->correction(corrected, *oldjet,
iEvent, iSetup,
p4, pions,
muons,
elecs,
ok);
149 specific.mResponseOfChargedWithEff = (
float)mJPTalgo->getResponseOfChargedWithEff();
150 specific.mResponseOfChargedWithoutEff = (
float)mJPTalgo->getResponseOfChargedWithoutEff();
151 specific.mSumPtOfChargedWithEff = (
float)mJPTalgo->getSumPtWithEff();
152 specific.mSumPtOfChargedWithoutEff = (
float)mJPTalgo->getSumPtWithoutEff();
153 specific.mSumEnergyOfChargedWithEff = (
float)mJPTalgo->getSumEnergyWithEff();
154 specific.mSumEnergyOfChargedWithoutEff = (
float)mJPTalgo->getSumEnergyWithoutEff();
155 specific.mChargedHadronEnergy = (
float)mJPTalgo->getSumEnergyWithoutEff();
159 double deEta2Tr = 0.;
160 double dePhi2Tr = 0.;
164 double denominator_tracks = 0.;
169 double deR =
deltaR((*it)->eta(), (*it)->phi(),
p4.eta(),
p4.phi());
170 double deEta = (*it)->eta() -
p4.eta();
171 double dePhi =
deltaPhi((*it)->phi(),
p4.phi());
172 if ((**it).ptError() / (**it).pt() < 0.1) {
173 deR2Tr = deR2Tr + deR * deR * (*it)->pt();
174 deEta2Tr = deEta2Tr + deEta * deEta * (*it)->pt();
175 dePhi2Tr = dePhi2Tr + dePhi * dePhi * (*it)->pt();
176 denominator_tracks = denominator_tracks + (*it)->pt();
177 Zch = Zch + (*it)->pt();
179 Pout2 = Pout2 + (**it).p() * (**it).p() - (Zch *
p4.P()) * (Zch *
p4.P());
186 double deR =
deltaR((*it)->eta(), (*it)->phi(),
p4.eta(),
p4.phi());
187 double deEta = (*it)->eta() -
p4.eta();
188 double dePhi =
deltaPhi((*it)->phi(),
p4.phi());
189 if ((**it).ptError() / (**it).pt() < 0.1) {
190 deR2Tr = deR2Tr + deR * deR * (*it)->pt();
191 deEta2Tr = deEta2Tr + deEta * deEta * (*it)->pt();
192 dePhi2Tr = dePhi2Tr + dePhi * dePhi * (*it)->pt();
193 denominator_tracks = denominator_tracks + (*it)->pt();
194 Zch = Zch + (*it)->pt();
196 Pout2 = Pout2 + (**it).p() * (**it).p() - (Zch *
p4.P()) * (Zch *
p4.P());
202 double deR =
deltaR((*it)->eta(), (*it)->phi(),
p4.eta(),
p4.phi());
203 double deEta = (*it)->eta() -
p4.eta();
204 double dePhi =
deltaPhi((*it)->phi(),
p4.phi());
205 if ((**it).ptError() / (**it).pt() < 0.1) {
206 deR2Tr = deR2Tr + deR * deR * (*it)->pt();
207 deEta2Tr = deEta2Tr + deEta * deEta * (*it)->pt();
208 dePhi2Tr = dePhi2Tr + dePhi * dePhi * (*it)->pt();
209 denominator_tracks = denominator_tracks + (*it)->pt();
210 Zch = Zch + (*it)->pt();
212 Pout2 = Pout2 + (**it).p() * (**it).p() - (Zch *
p4.P()) * (Zch *
p4.P());
219 Zch = Zch + (*it)->pt();
222 it !=
muons.inVertexOutOfCalo_.end();
224 Zch = Zch + (*it)->pt();
227 it !=
elecs.inVertexOutOfCalo_.end();
229 Zch = Zch + (*it)->pt();
232 if (mJPTalgo->getSumPtForBeta() > 0.)
233 Zch = Zch / mJPTalgo->getSumPtForBeta();
238 Pout =
sqrt(fabs(Pout2)) / ntracks;
240 if (denominator_tracks != 0) {
241 deR2Tr = deR2Tr / denominator_tracks;
242 deEta2Tr = deEta2Tr / denominator_tracks;
243 dePhi2Tr = dePhi2Tr / denominator_tracks;
269 if (fJet.pt() >
ptCUT)
270 pOut->push_back(fJet);