108 auto pOut = std::make_unique<reco::JPTJetCollection>();
110 for (
unsigned i = 0;
i < jets_h->size(); ++
i) {
118 double factorZSP = 1.;
125 double scaleJPT = 1.;
136 scaleJPT =
mJPTalgo->
correction ( corrected, *oldjet, iEvent, iSetup, pions, muons, elecs,ok );
138 corrected.
py()*scaleJPT,
139 corrected.
pz()*scaleJPT,
140 corrected.
energy()*scaleJPT );
142 scaleJPT =
mJPTalgo->
correction( corrected, *oldjet, iEvent, iSetup, p4, pions, muons, elecs,ok );
174 double deEta2Tr = 0.;
175 double dePhi2Tr = 0.;
179 double denominator_tracks = 0.;
183 double deR =
deltaR((*it)->eta(), (*it)->phi(), p4.eta(), p4.phi());
184 double deEta = (*it)->eta() - p4.eta();
185 double dePhi =
deltaPhi((*it)->phi(), p4.phi());
186 if((**it).ptError()/(**it).pt() < 0.1) {
187 deR2Tr = deR2Tr + deR*deR*(*it)->pt();
188 deEta2Tr = deEta2Tr + deEta*deEta*(*it)->pt();
189 dePhi2Tr = dePhi2Tr + dePhi*dePhi*(*it)->pt();
190 denominator_tracks = denominator_tracks + (*it)->pt();
191 Zch = Zch + (*it)->pt();
193 Pout2 = Pout2 + (**it).p()*(**it).p() - (Zch*p4.P())*(Zch*p4.P());
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());
216 double deR =
deltaR((*it)->eta(), (*it)->phi(), p4.eta(), p4.phi());
217 double deEta = (*it)->eta() - p4.eta();
218 double dePhi =
deltaPhi((*it)->phi(), p4.phi());
219 if((**it).ptError()/(**it).pt() < 0.1) {
220 deR2Tr = deR2Tr + deR*deR*(*it)->pt();
221 deEta2Tr = deEta2Tr + deEta*deEta*(*it)->pt();
222 dePhi2Tr = dePhi2Tr + dePhi*dePhi*(*it)->pt();
223 denominator_tracks = denominator_tracks + (*it)->pt();
224 Zch = Zch + (*it)->pt();
226 Pout2 = Pout2 + (**it).p()*(**it).p() - (Zch*p4.P())*(Zch*p4.P());
231 Zch = Zch + (*it)->pt();
234 Zch = Zch + (*it)->pt();
237 Zch = Zch + (*it)->pt();
245 Pout =
sqrt(fabs(Pout2))/ntracks;
247 if (denominator_tracks!=0){
248 deR2Tr = deR2Tr/denominator_tracks;
249 deEta2Tr= deEta2Tr/denominator_tracks;
250 dePhi2Tr= dePhi2Tr/denominator_tracks;
256 specific.
Pout = Pout;
270 if ( pvCollection.
isValid() && !pvCollection->empty() ) vertex_=pvCollection->begin()->position();
277 if(fJet.pt()>
ptCUT) 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