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>();
135 for (
unsigned i = 0;
i < jets_h->size(); ++
i) {
142 double factorZSP = 1.;
150 double scaleJPT = 1.;
161 scaleJPT =
mJPTalgo->
correction(corrected, *oldjet, iEvent, iSetup, pions, muons, elecs, ok);
163 corrected.
py() * scaleJPT,
164 corrected.
pz() * scaleJPT,
165 corrected.
energy() * scaleJPT);
167 scaleJPT =
mJPTalgo->
correction(corrected, *oldjet, iEvent, iSetup, p4, pions, muons, elecs, ok);
197 double deEta2Tr = 0.;
198 double dePhi2Tr = 0.;
202 double denominator_tracks = 0.;
207 double deR =
deltaR((*it)->eta(), (*it)->phi(), p4.eta(), p4.phi());
208 double deEta = (*it)->eta() - p4.eta();
209 double dePhi =
deltaPhi((*it)->phi(), p4.phi());
210 if ((**it).ptError() / (**it).pt() < 0.1) {
211 deR2Tr = deR2Tr + deR * deR * (*it)->pt();
212 deEta2Tr = deEta2Tr + deEta * deEta * (*it)->pt();
213 dePhi2Tr = dePhi2Tr + dePhi * dePhi * (*it)->pt();
214 denominator_tracks = denominator_tracks + (*it)->pt();
215 Zch = Zch + (*it)->pt();
217 Pout2 = Pout2 + (**it).p() * (**it).p() - (Zch * p4.P()) * (Zch * p4.P());
223 double deR =
deltaR((*it)->eta(), (*it)->phi(), p4.eta(), p4.phi());
224 double deEta = (*it)->eta() - p4.eta();
225 double dePhi =
deltaPhi((*it)->phi(), p4.phi());
226 if ((**it).ptError() / (**it).pt() < 0.1) {
227 deR2Tr = deR2Tr + deR * deR * (*it)->pt();
228 deEta2Tr = deEta2Tr + deEta * deEta * (*it)->pt();
229 dePhi2Tr = dePhi2Tr + dePhi * dePhi * (*it)->pt();
230 denominator_tracks = denominator_tracks + (*it)->pt();
231 Zch = Zch + (*it)->pt();
233 Pout2 = Pout2 + (**it).p() * (**it).p() - (Zch * p4.P()) * (Zch * p4.P());
239 double deR =
deltaR((*it)->eta(), (*it)->phi(), p4.eta(), p4.phi());
240 double deEta = (*it)->eta() - p4.eta();
241 double dePhi =
deltaPhi((*it)->phi(), p4.phi());
242 if ((**it).ptError() / (**it).pt() < 0.1) {
243 deR2Tr = deR2Tr + deR * deR * (*it)->pt();
244 deEta2Tr = deEta2Tr + deEta * deEta * (*it)->pt();
245 dePhi2Tr = dePhi2Tr + dePhi * dePhi * (*it)->pt();
246 denominator_tracks = denominator_tracks + (*it)->pt();
247 Zch = Zch + (*it)->pt();
249 Pout2 = Pout2 + (**it).p() * (**it).p() - (Zch * p4.P()) * (Zch * p4.P());
256 Zch = Zch + (*it)->pt();
261 Zch = Zch + (*it)->pt();
266 Zch = Zch + (*it)->pt();
273 Pout =
sqrt(fabs(Pout2)) / ntracks;
276 if (denominator_tracks != 0) {
277 deR2Tr = deR2Tr / denominator_tracks;
278 deEta2Tr = deEta2Tr / denominator_tracks;
279 dePhi2Tr = dePhi2Tr / denominator_tracks;
285 specific.
Pout = Pout;
295 if (pvCollection.
isValid() && !pvCollection->empty())
296 vertex_ = pvCollection->begin()->position();
303 tmpColl.push_back(fJet);
313 std::map<reco::JPTJetCollection::iterator, double> AreaNonJet;
315 for (reco::JPTJetCollection::iterator ij1 = tmpColl.begin(); ij1 != tmpColl.end(); ij1++) {
317 for (reco::JPTJetCollection::iterator ij2 = tmpColl.begin(); ij2 != tmpColl.end(); ij2++) {
320 if (fabs((*ij1).eta() - (*ij2).eta()) > 0.5)
330 for (reco::JPTJetCollection::iterator ij = tmpColl.begin(); ij != tmpColl.end(); ij++) {
336 double ja = (AreaNonJet.find(ij))->
second;
340 (*ij).scaleEnergy(factorPU);
343 pOut->push_back(*ij);
reco::TrackRefVector muonsInVertexOutCalo
float mSumEnergyOfChargedWithoutEff
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
double pz() const final
z coordinate of momentum vector
Jets made from CaloTowers.
reco::TrackRefVector muonsInVertexInCalo
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
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< JPTJet > JPTJetCollection
collection of CaloJet objects
float mChargedHadronEnergy
float mSumPtOfChargedWithEff
reco::TrackRefVector inVertexInCalo_
reco::TrackRefVector muonsOutVertexInCalo
reco::TrackRefVector inVertexOutOfCalo_
virtual double correction(const reco::Jet &, const edm::Event &, const edm::EventSetup &) const
apply correction using Event information
double getResponseOfChargedWithoutEff()
float mResponseOfChargedWithEff
reco::TrackRefVector elecsOutVertexInCalo
virtual Constituents getJetConstituents() const
list of constituents
reco::TrackRefVector pionsInVertexOutCalo
const_iterator end() const
Termination of iteration.
const_iterator begin() const
Initialize an iterator over the RefVector.
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.
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.
reco::TrackRefVector pionsOutVertexInCalo
float mSumEnergyOfChargedWithEff
math::XYZPoint Point
point in the space
reco::TrackRefVector outOfVertexInCalo_
reco::TrackRefVector elecsInVertexInCalo
edm::EDGetTokenT< reco::TrackCollection > input_tracks_token_
double py() const final
y coordinate of momentum vector
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 getSumPtWithoutEff()
edm::RefToBase< reco::Jet > theCaloJetRef
float mResponseOfChargedWithoutEff
reco::TrackRefVector pionsInVertexInCalo
edm::EDGetTokenT< reco::VertexCollection > input_vertex_token_
float mSumPtOfChargedWithoutEff
reco::TrackRefVector elecsInVertexOutCalo
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()
double getSumEnergyWithEff()
math::XYZPoint Point
point in the space
double energy() const final
energy