122 std::vector<reco::TrackRef> fTracks;
123 fTracks.reserve(tracks_h->size());
124 for (
unsigned i = 0;
i < tracks_h->size(); ++
i) {
131 auto pOut = std::make_unique<reco::JPTJetCollection>();
136 for (
auto const& oldjet : jets_h) {
141 double factorZSP = 1.;
153 bool validMatches =
false;
158 corrected.
py() * scaleJPT,
159 corrected.
pz() * scaleJPT,
160 corrected.
energy() * scaleJPT);
191 double deEta2Tr = 0.;
192 double dePhi2Tr = 0.;
196 double denominator_tracks = 0.;
201 double deR =
deltaR((*it)->eta(), (*it)->phi(), p4.eta(), p4.phi());
202 double deEta = (*it)->eta() - p4.eta();
203 double dePhi =
deltaPhi((*it)->phi(), p4.phi());
204 if ((**it).ptError() / (**it).pt() < 0.1) {
205 deR2Tr = deR2Tr + deR * deR * (*it)->pt();
206 deEta2Tr = deEta2Tr + deEta * deEta * (*it)->pt();
207 dePhi2Tr = dePhi2Tr + dePhi * dePhi * (*it)->pt();
208 denominator_tracks = denominator_tracks + (*it)->pt();
209 Zch = Zch + (*it)->pt();
211 Pout2 = Pout2 + (**it).p() * (**it).p() - (Zch * p4.P()) * (Zch * p4.P());
217 double deR =
deltaR((*it)->eta(), (*it)->phi(), p4.eta(), p4.phi());
218 double deEta = (*it)->eta() - p4.eta();
219 double dePhi =
deltaPhi((*it)->phi(), p4.phi());
220 if ((**it).ptError() / (**it).pt() < 0.1) {
221 deR2Tr = deR2Tr + deR * deR * (*it)->pt();
222 deEta2Tr = deEta2Tr + deEta * deEta * (*it)->pt();
223 dePhi2Tr = dePhi2Tr + dePhi * dePhi * (*it)->pt();
224 denominator_tracks = denominator_tracks + (*it)->pt();
225 Zch = Zch + (*it)->pt();
227 Pout2 = Pout2 + (**it).p() * (**it).p() - (Zch * p4.P()) * (Zch * p4.P());
233 double deR =
deltaR((*it)->eta(), (*it)->phi(), p4.eta(), p4.phi());
234 double deEta = (*it)->eta() - p4.eta();
235 double dePhi =
deltaPhi((*it)->phi(), p4.phi());
236 if ((**it).ptError() / (**it).pt() < 0.1) {
237 deR2Tr = deR2Tr + deR * deR * (*it)->pt();
238 deEta2Tr = deEta2Tr + deEta * deEta * (*it)->pt();
239 dePhi2Tr = dePhi2Tr + dePhi * dePhi * (*it)->pt();
240 denominator_tracks = denominator_tracks + (*it)->pt();
241 Zch = Zch + (*it)->pt();
243 Pout2 = Pout2 + (**it).p() * (**it).p() - (Zch * p4.P()) * (Zch * p4.P());
250 Zch = Zch + (*it)->pt();
253 it !=
muons.inVertexOutOfCalo_.end();
255 Zch = Zch + (*it)->pt();
258 it !=
elecs.inVertexOutOfCalo_.end();
260 Zch = Zch + (*it)->pt();
270 if (denominator_tracks != 0) {
271 deR2Tr = deR2Tr / denominator_tracks;
272 deEta2Tr = deEta2Tr / denominator_tracks;
273 dePhi2Tr = dePhi2Tr / denominator_tracks;
296 tmpColl.push_back(fJet);
306 std::map<reco::JPTJetCollection::iterator, double> AreaNonJet;
308 for (reco::JPTJetCollection::iterator ij1 = tmpColl.begin(); ij1 != tmpColl.end(); ij1++) {
310 for (reco::JPTJetCollection::iterator ij2 = tmpColl.begin(); ij2 != tmpColl.end(); ij2++) {
313 if (fabs((*ij1).eta() - (*ij2).eta()) > 0.5)
323 for (reco::JPTJetCollection::iterator ij = tmpColl.begin(); ij != tmpColl.end(); ij++) {
329 double ja = (AreaNonJet.find(ij))->
second;
333 (*ij).scaleEnergy(factorPU);
336 pOut->push_back(*ij);
double pz() const final
z coordinate of momentum vector
Jets made from CaloTowers.
virtual void scaleEnergy(double fScale)
scale energy of the jet
reco::TrackRefVector calculateBGtracksJet(reco::JPTJetCollection &, std::vector< reco::TrackRef > &, edm::Handle< std::vector< reco::TrackExtrapolation > > &, reco::TrackRefVector &)
ZSPJPTJetCorrector * mZSPalgo
std::vector< JPTJet > JPTJetCollection
collection of CaloJet objects
reco::TrackRefVector inVertexInCalo_
reco::TrackRefVector inVertexOutOfCalo_
double getResponseOfChargedWithoutEff()
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
edm::EDGetTokenT< edm::View< reco::CaloJet > > input_jets_token_
U second(std::pair< T, U > const &p)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
virtual double correction(const reco::Jet &, const edm::Event &, const edm::EventSetup &) const
apply correction using Event information
virtual Constituents getJetConstituents() const
list of constituents
double px() const final
x coordinate of momentum vector
Jets made from CaloJets corrected for ZSP and tracks.
double correction(const reco::Jet &, const reco::Jet &, const edm::Event &, const edm::EventSetup &, P4 &, jpt::MatchedTracks &pions, jpt::MatchedTracks &muons, jpt::MatchedTracks &elecs, bool &validMatches)
Vectorial correction method (corrected 4-momentum passed by reference)
JetPlusTrackCorrector * mJPTalgo
double getResponseOfChargedWithEff()
Get responses/sumPT/SumEnergy with and without Efficiency correction.
math::XYZPoint Point
point in the space
reco::TrackRefVector outOfVertexInCalo_
edm::EDGetTokenT< reco::TrackCollection > input_tracks_token_
double py() const final
y coordinate of momentum vector
double getSumPtWithoutEff()
edm::EDGetTokenT< reco::VertexCollection > input_vertex_token_
const_iterator end() const
Termination of iteration.
Particles matched to tracks that are in/in, in/out, out/in at Vertex and CaloFace.
edm::EDGetTokenT< std::vector< reco::TrackExtrapolation > > input_extrapolations_token_
double getSumEnergyWithoutEff()
const_iterator begin() const
Initialize an iterator over the RefVector.
double correctAA(const reco::Jet &, const reco::TrackRefVector &, double &, const reco::TrackRefVector &, const reco::TrackRefVector &, double, const reco::TrackRefVector &) const
For AA - correct in tracker.
double getSumEnergyWithEff()
math::XYZPoint Point
point in the space
double energy() const final
energy