107 auto pOut = std::make_unique<reco::JPTJetCollection>();
108 auto pOut1 = std::make_unique<reco::CaloJetCollection>();
113 for (
auto const& oldjet : addjets_h) {
122 auto const& mycalo = addjets_h[icalo];
123 std::vector<edm::Ptr<reco::Track> > tracksinjet =
jet.tracks();
126 for (
auto const& itrack : tracksinjet) {
127 for (
auto const& ixtrp : iExtrapolations) {
128 if (ixtrp.positions().empty())
131 double mydphi =
deltaPhi(ixtrp.track()->phi(), itrack->phi());
132 if (fabs(ixtrp.track()->pt() - itrack->pt()) > 0.001 || fabs(ixtrp.track()->eta() - itrack->eta()) > 0.001 ||
136 if (itrack.id() != ixtrp.track().id() || itrack.key() != ixtrp.track().key())
169 reco::JPTJet fJet(p4,
jet.primaryVertex()->position(), jptspe, mycalo.getJetConstituents());
170 pOut->push_back(fJet);
171 pOut1->push_back(mycalo);
176 for (
auto const& oldjet : jets_h) {
180 double factorZSP = 1.;
190 bool validMatches =
false;
195 corrected.
py() * scaleJPT,
196 corrected.
pz() * scaleJPT,
197 corrected.
energy() * scaleJPT);
229 double deEta2Tr = 0.;
230 double dePhi2Tr = 0.;
234 double denominator_tracks = 0.;
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());
255 double deR =
deltaR((*it)->eta(), (*it)->phi(), p4.eta(), p4.phi());
256 double deEta = (*it)->eta() - p4.eta();
257 double dePhi =
deltaPhi((*it)->phi(), p4.phi());
258 if ((**it).ptError() / (**it).pt() < 0.1) {
259 deR2Tr = deR2Tr + deR * deR * (*it)->pt();
260 deEta2Tr = deEta2Tr + deEta * deEta * (*it)->pt();
261 dePhi2Tr = dePhi2Tr + dePhi * dePhi * (*it)->pt();
262 denominator_tracks = denominator_tracks + (*it)->pt();
263 Zch = Zch + (*it)->pt();
265 Pout2 = Pout2 + (**it).p() * (**it).p() - (Zch * p4.P()) * (Zch * p4.P());
271 double deR =
deltaR((*it)->eta(), (*it)->phi(), p4.eta(), p4.phi());
272 double deEta = (*it)->eta() - p4.eta();
273 double dePhi =
deltaPhi((*it)->phi(), p4.phi());
274 if ((**it).ptError() / (**it).pt() < 0.1) {
275 deR2Tr = deR2Tr + deR * deR * (*it)->pt();
276 deEta2Tr = deEta2Tr + deEta * deEta * (*it)->pt();
277 dePhi2Tr = dePhi2Tr + dePhi * dePhi * (*it)->pt();
278 denominator_tracks = denominator_tracks + (*it)->pt();
279 Zch = Zch + (*it)->pt();
281 Pout2 = Pout2 + (**it).p() * (**it).p() - (Zch * p4.P()) * (Zch * p4.P());
289 Zch = Zch + (*it)->pt();
292 it !=
muons.inVertexOutOfCalo_.end();
294 Zch = Zch + (*it)->pt();
297 it !=
elecs.inVertexOutOfCalo_.end();
299 Zch = Zch + (*it)->pt();
308 if (denominator_tracks != 0) {
309 deR2Tr = deR2Tr / denominator_tracks;
310 deEta2Tr = deEta2Tr / denominator_tracks;
311 dePhi2Tr = dePhi2Tr / denominator_tracks;
334 pOut->push_back(fJet);
reco::TrackRefVector muonsInVertexOutCalo
std::remove_cv< typename std::remove_reference< argument_type >::type >::type key_type
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 inVertexInCalo_
reco::TrackRefVector muonsOutVertexInCalo
reco::TrackRefVector inVertexOutOfCalo_
double getResponseOfChargedWithoutEff()
edm::EDGetTokenT< edm::View< reco::CaloJet > > input_jets_token_
reco::TrackRefVector elecsOutVertexInCalo
reco::TrackRefVector pionsInVertexOutCalo
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
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
ZSPJPTJetCorrector * mZSPalgo
edm::EDGetTokenT< edm::View< reco::CaloJet > > input_addjets_token_
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
math::XYZPoint Point
point in the space
bool sort_by_pt(const reco::JPTJet &a, const reco::JPTJet &b)
reco::TrackRefVector outOfVertexInCalo_
reco::TrackRefVector elecsInVertexInCalo
math::XYZPoint Point
point in the space
edm::EDGetTokenT< std::vector< reco::TrackExtrapolation > > mExtrapolations_
double py() const final
y coordinate of momentum vector
double getSumPtWithoutEff()
edm::RefToBase< reco::Jet > theCaloJetRef
reco::TrackRefVector pionsInVertexInCalo
const_iterator end() const
Termination of iteration.
reco::TrackRefVector elecsInVertexOutCalo
Particles matched to tracks that are in/in, in/out, out/in at Vertex and CaloFace.
JetPlusTrackCorrector * mJPTalgo
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
double getSumEnergyWithoutEff()
edm::EDGetTokenT< reco::VertexCollection > input_vertex_token_
const_iterator begin() const
Initialize an iterator over the RefVector.
double getSumEnergyWithEff()
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
edm::EDGetTokenT< edm::View< reco::TrackJet > > input_trackjets_token_
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects
math::XYZPoint Point
point in the space
double energy() const final
energy