65 vectorial_ = iConfig.
getParameter<
bool>(
"VectorialCorrection");
71 produces<reco::JPTJetCollection>().setBranchAlias(alias);
73 input_jets_token_ = consumes<edm::View<reco::CaloJet> >(
src);
74 input_vertex_token_ = consumes<reco::VertexCollection>(srcPVs_);
105 iEvent.
getByToken (input_jets_token_, jets_h);
108 auto pOut = std::make_unique<reco::JPTJetCollection>();
110 for (
unsigned i = 0;
i < jets_h->size(); ++
i) {
118 double factorZSP = 1.;
119 if(useZSP) factorZSP = mZSPalgo->correction(corrected, iEvent, iSetup);
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();
240 if(mJPTalgo->getSumPtForBeta()> 0.) Zch = Zch/mJPTalgo->getSumPtForBeta();
247 if (denominator_tracks!=0){
248 deR2Tr = deR2Tr/denominator_tracks;
249 deEta2Tr= deEta2Tr/denominator_tracks;
250 dePhi2Tr= dePhi2Tr/denominator_tracks;
256 specific.
Pout = Pout;
269 iEvent.
getByToken(input_vertex_token_, pvCollection);
270 if ( pvCollection.
isValid() && !pvCollection->empty() ) vertex_=pvCollection->begin()->position();
277 if(fJet.pt()>
ptCUT) pOut->push_back(fJet);
reco::TrackRefVector muonsInVertexOutCalo
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
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_
float mResponseOfChargedWithEff
void produce(edm::Event &, const edm::EventSetup &) override
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.
double pz() const final
z coordinate of momentum vector
Jets made from CaloJets corrected for ZSP and tracks.
reco::TrackRefVector pionsOutVertexInCalo
double energy() const final
energy
float mSumEnergyOfChargedWithEff
math::XYZPoint Point
point in the space
reco::TrackRefVector outOfVertexInCalo_
reco::TrackRefVector elecsInVertexInCalo
edm::RefToBase< reco::Jet > theCaloJetRef
JetPlusTrackProducer(const edm::ParameterSet &)
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.
Jet energy correction algorithm using tracks.
~JetPlusTrackProducer() override
math::XYZPoint Point
point in the space