95 auto pOut = std::make_unique<reco::JPTJetCollection>();
97 for (
unsigned i = 0;
i < jets_h->size(); ++
i) {
104 double factorZSP = 1.;
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);
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();
224 Zch = Zch + (*it)->pt();
229 Zch = Zch + (*it)->pt();
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;
249 specific.
Pout = Pout;
261 if (pvCollection.
isValid() && !pvCollection->empty())
262 vertex_ = pvCollection->begin()->position();
269 if (fJet.pt() >
ptCUT)
270 pOut->push_back(fJet);
reco::TrackRefVector muonsInVertexOutCalo
float mSumEnergyOfChargedWithoutEff
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Jets made from CaloTowers.
reco::TrackRefVector muonsInVertexInCalo
virtual void scaleEnergy(double fScale)
scale energy of the jet
bool getByToken(EDGetToken token, Handle< PROD > &result) const
double px() const final
x coordinate of momentum vector
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
edm::EDGetTokenT< edm::View< reco::CaloJet > > input_jets_token_
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.
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
ZSPJPTJetCorrector * mZSPalgo
double pz() const final
z 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)
double getResponseOfChargedWithEff()
Get responses/sumPT/SumEnergy with and without Efficiency correction.
reco::TrackRefVector pionsOutVertexInCalo
double energy() const final
energy
float mSumEnergyOfChargedWithEff
math::XYZPoint Point
point in the space
reco::TrackRefVector outOfVertexInCalo_
reco::TrackRefVector elecsInVertexInCalo
double getSumPtWithoutEff()
edm::RefToBase< reco::Jet > theCaloJetRef
float mResponseOfChargedWithoutEff
reco::TrackRefVector pionsInVertexInCalo
float mSumPtOfChargedWithoutEff
double py() const final
y coordinate of momentum vector
reco::TrackRefVector elecsInVertexOutCalo
Particles matched to tracks that are in/in, in/out, out/in at Vertex and CaloFace.
JetPlusTrackCorrector * mJPTalgo
double getSumEnergyWithoutEff()
edm::EDGetTokenT< reco::VertexCollection > input_vertex_token_
double getSumEnergyWithEff()
math::XYZPoint Point
point in the space