66 vectorial_ = iConfig.
getParameter<
bool>(
"VectorialCorrection");
76 produces<reco::JPTJetCollection>().setBranchAlias(alias_);
77 produces<reco::CaloJetCollection>().setBranchAlias(
"ak4CaloJetsJPT");
79 input_jets_token_ = consumes<edm::View<reco::CaloJet> >(src_);
81 input_trackjets_token_ = consumes<edm::View<reco::TrackJet> >(srcTrackJets_);
82 input_vertex_token_ = consumes<reco::VertexCollection>(srcPVs_);
101 auto const& jets_h =
iEvent.get(input_jets_token_);
102 auto const& addjets_h =
iEvent.get(input_addjets_token_);
103 auto const& iExtrapolations =
iEvent.get(mExtrapolations_);
107 auto pOut = std::make_unique<reco::JPTJetCollection>();
108 auto pOut1 = std::make_unique<reco::CaloJetCollection>();
110 double scaleJPT = 1.;
111 for (
auto const&
jet :
iEvent.get(input_trackjets_token_)) {
114 for (
auto const& oldjet : addjets_h) {
116 if (dr2 <= dRcone_ * dRcone_) {
123 auto const& mycalo = addjets_h[icalo];
124 std::vector<edm::Ptr<reco::Track> > tracksinjet =
jet.tracks();
127 for (
auto const& itrack : tracksinjet) {
128 for (
auto const& ixtrp : iExtrapolations) {
129 if (ixtrp.positions().empty())
132 double mydphi =
deltaPhi(ixtrp.track()->phi(), itrack->phi());
133 if (fabs(ixtrp.track()->pt() - itrack->pt()) > 0.001 || fabs(ixtrp.track()->eta() - itrack->eta()) > 0.001 ||
137 if (itrack.id() != ixtrp.track().id() || itrack.key() != ixtrp.track().key())
143 if (dr2 <= dRcone_ * dRcone_) {
156 mJPTalgo->correction(corrected, mycalo,
iEvent, iSetup, tracksinvert, tracksincalo, p4, pions,
muons,
elecs);
157 if (p4.pt() > ptCUT_) {
171 reco::JPTJet fJet(p4,
jet.primaryVertex()->position(), jptspe, mycalo.getJetConstituents());
172 pOut->push_back(fJet);
173 pOut1->push_back(mycalo);
178 for (
auto const& oldjet : jets_h) {
182 double factorZSP = 1.;
184 factorZSP = mZSPalgo->correction(corrected,
iEvent, iSetup);
195 bool validMatches =
false;
198 scaleJPT = mJPTalgo->correction(corrected, oldjet,
iEvent, iSetup, pions,
muons,
elecs, validMatches);
200 corrected.
py() * scaleJPT,
201 corrected.
pz() * scaleJPT,
202 corrected.
energy() * scaleJPT);
204 scaleJPT = mJPTalgo->correction(corrected, oldjet,
iEvent, iSetup, p4, pions,
muons,
elecs, validMatches);
223 specific.mResponseOfChargedWithEff = (
float)mJPTalgo->getResponseOfChargedWithEff();
224 specific.mResponseOfChargedWithoutEff = (
float)mJPTalgo->getResponseOfChargedWithoutEff();
225 specific.mSumPtOfChargedWithEff = (
float)mJPTalgo->getSumPtWithEff();
226 specific.mSumPtOfChargedWithoutEff = (
float)mJPTalgo->getSumPtWithoutEff();
227 specific.mSumEnergyOfChargedWithEff = (
float)mJPTalgo->getSumEnergyWithEff();
228 specific.mSumEnergyOfChargedWithoutEff = (
float)mJPTalgo->getSumEnergyWithoutEff();
229 specific.mChargedHadronEnergy = (
float)mJPTalgo->getSumEnergyWithoutEff();
234 double deEta2Tr = 0.;
235 double dePhi2Tr = 0.;
239 double denominator_tracks = 0.;
244 double deR =
deltaR((*it)->eta(), (*it)->phi(), p4.eta(), p4.phi());
245 double deEta = (*it)->eta() - p4.eta();
246 double dePhi =
deltaPhi((*it)->phi(), p4.phi());
247 if ((**it).ptError() / (**it).pt() < 0.1) {
248 deR2Tr = deR2Tr + deR * deR * (*it)->pt();
249 deEta2Tr = deEta2Tr + deEta * deEta * (*it)->pt();
250 dePhi2Tr = dePhi2Tr + dePhi * dePhi * (*it)->pt();
251 denominator_tracks = denominator_tracks + (*it)->pt();
252 Zch = Zch + (*it)->pt();
254 Pout2 = Pout2 + (**it).p() * (**it).p() - (Zch * p4.P()) * (Zch * p4.P());
260 double deR =
deltaR((*it)->eta(), (*it)->phi(), p4.eta(), p4.phi());
261 double deEta = (*it)->eta() - p4.eta();
262 double dePhi =
deltaPhi((*it)->phi(), p4.phi());
263 if ((**it).ptError() / (**it).pt() < 0.1) {
264 deR2Tr = deR2Tr + deR * deR * (*it)->pt();
265 deEta2Tr = deEta2Tr + deEta * deEta * (*it)->pt();
266 dePhi2Tr = dePhi2Tr + dePhi * dePhi * (*it)->pt();
267 denominator_tracks = denominator_tracks + (*it)->pt();
268 Zch = Zch + (*it)->pt();
270 Pout2 = Pout2 + (**it).p() * (**it).p() - (Zch * p4.P()) * (Zch * p4.P());
276 double deR =
deltaR((*it)->eta(), (*it)->phi(), p4.eta(), p4.phi());
277 double deEta = (*it)->eta() - p4.eta();
278 double dePhi =
deltaPhi((*it)->phi(), p4.phi());
279 if ((**it).ptError() / (**it).pt() < 0.1) {
280 deR2Tr = deR2Tr + deR * deR * (*it)->pt();
281 deEta2Tr = deEta2Tr + deEta * deEta * (*it)->pt();
282 dePhi2Tr = dePhi2Tr + dePhi * dePhi * (*it)->pt();
283 denominator_tracks = denominator_tracks + (*it)->pt();
284 Zch = Zch + (*it)->pt();
286 Pout2 = Pout2 + (**it).p() * (**it).p() - (Zch * p4.P()) * (Zch * p4.P());
294 Zch = Zch + (*it)->pt();
297 it !=
muons.inVertexOutOfCalo_.end();
299 Zch = Zch + (*it)->pt();
302 it !=
elecs.inVertexOutOfCalo_.end();
304 Zch = Zch + (*it)->pt();
307 if (mJPTalgo->getSumPtForBeta() > 0.)
308 Zch = Zch / mJPTalgo->getSumPtForBeta();
313 if (denominator_tracks != 0) {
314 deR2Tr = deR2Tr / denominator_tracks;
315 deEta2Tr = deEta2Tr / denominator_tracks;
316 dePhi2Tr = dePhi2Tr / denominator_tracks;
338 if (fJet.pt() > ptCUT_)
339 pOut->push_back(fJet);
reco::TrackRefVector muonsInVertexOutCalo
T getParameter(std::string const &) const
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_
void produce(edm::Event &, const edm::EventSetup &) override
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...
T getUntrackedParameter(std::string const &, T const &) const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
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.
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
double py() const final
y coordinate of momentum vector
edm::RefToBase< reco::Jet > theCaloJetRef
JetPlusTrackProducer(const edm::ParameterSet &)
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.
Jet energy correction algorithm using tracks.
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
~JetPlusTrackProducer() override
const_iterator begin() const
Initialize an iterator over the RefVector.
*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
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects
math::XYZPoint Point
point in the space
double energy() const final
energy