86 vectorial_ = iConfig.
getParameter<
bool>(
"VectorialCorrection");
97 produces<reco::JPTJetCollection>().setBranchAlias(alias);
131 std::vector <reco::TrackRef> fTracks;
132 fTracks.reserve (tracks_h->size());
133 for (
unsigned i = 0;
i < tracks_h->size(); ++
i) {
139 iEvent.
getByLabel (mExtrapolations, extrapolations_h);
148 for (
unsigned i = 0;
i < jets_h->size(); ++
i) {
156 double factorZSP = 1.;
157 if(useZSP) factorZSP = mZSPalgo->correction(corrected, iEvent, iSetup);
166 double scaleJPT = 1.;
178 scaleJPT = mJPTalgo->correction ( corrected, *oldjet, iEvent, iSetup, pions, muons, elecs, ok );
180 corrected.
py()*scaleJPT,
181 corrected.
pz()*scaleJPT,
182 corrected.
energy()*scaleJPT );
184 scaleJPT = mJPTalgo->correction( corrected, *oldjet, iEvent, iSetup, p4, pions, muons, elecs, ok );
221 double deEta2Tr = 0.;
222 double dePhi2Tr = 0.;
226 double denominator_tracks = 0.;
230 double deR =
deltaR((*it)->eta(), (*it)->phi(), p4.eta(), p4.phi());
231 double deEta = (*it)->eta() - p4.eta();
232 double dePhi =
deltaPhi((*it)->phi(), p4.phi());
233 if((**it).ptError()/(**it).pt() < 0.1) {
234 deR2Tr = deR2Tr + deR*deR*(*it)->pt();
235 deEta2Tr = deEta2Tr + deEta*deEta*(*it)->pt();
236 dePhi2Tr = dePhi2Tr + dePhi*dePhi*(*it)->pt();
237 denominator_tracks = denominator_tracks + (*it)->pt();
238 Zch = Zch + (*it)->pt();
240 Pout2 = Pout2 + (**it).p()*(**it).p() - (Zch*p4.P())*(Zch*p4.P());
245 double deR =
deltaR((*it)->eta(), (*it)->phi(), p4.eta(), p4.phi());
246 double deEta = (*it)->eta() - p4.eta();
247 double dePhi =
deltaPhi((*it)->phi(), p4.phi());
248 if((**it).ptError()/(**it).pt() < 0.1) {
249 deR2Tr = deR2Tr + deR*deR*(*it)->pt();
250 deEta2Tr = deEta2Tr + deEta*deEta*(*it)->pt();
251 dePhi2Tr = dePhi2Tr + dePhi*dePhi*(*it)->pt();
252 denominator_tracks = denominator_tracks + (*it)->pt();
253 Zch = Zch + (*it)->pt();
255 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());
275 Zch = Zch + (*it)->pt();
278 Zch = Zch + (*it)->pt();
281 Zch = Zch + (*it)->pt();
284 if(mJPTalgo->getSumPtForBeta()> 0.) Zch = Zch/mJPTalgo->getSumPtForBeta();
289 Pout =
sqrt(fabs(Pout2))/ntracks;
293 if (denominator_tracks!=0){
294 deR2Tr = deR2Tr/denominator_tracks;
295 deEta2Tr= deEta2Tr/denominator_tracks;
296 dePhi2Tr= dePhi2Tr/denominator_tracks;
302 specific.
Pout = Pout;
312 if ( pvCollection.
isValid() && pvCollection->size()>0 ) vertex_=pvCollection->begin()->position();
319 tmpColl.push_back(fJet);
327 reco::TrackRefVector trBgOutOfVertex = calculateBGtracksJet(tmpColl,fTracks,extrapolations_h,trBgOutOfCalo);
330 std::map<reco::JPTJetCollection::iterator, double> AreaNonJet;
332 for(reco::JPTJetCollection::iterator ij1=tmpColl.begin(); ij1!=tmpColl.end(); ij1++)
335 for(reco::JPTJetCollection::iterator ij2=tmpColl.begin(); ij2!=tmpColl.end(); ij2++)
337 if(ij2 == ij1)
continue;
338 if(fabs((*ij1).eta() - (*ij2).eta()) > 0.5 )
continue;
343 AreaNonJet[ij1] = 4*
M_PI*mConeSize - nj1*4*mConeSize*mConeSize;
355 for(reco::JPTJetCollection::iterator ij=tmpColl.begin(); ij!=tmpColl.end(); ij++)
362 double ja = (AreaNonJet.find(ij))->
second;
366 double factorPU = mJPTalgo->correctAA(*ij,trBgOutOfVertex,mConeSize,pioninin,pioninout,ja,trBgOutOfCalo);
368 (*ij).scaleEnergy (factorPU);
373 pOut->push_back(*ij);
387 edm::Handle <std::vector<reco::TrackExtrapolation> > & extrapolations_h,
393 for (
unsigned t = 0;
t < fTracks.size(); ++
t) {
411 for (
unsigned j = 0;
j < fJets.size(); ++
j) {
420 if(fabs(jetEta - trackEta) < mConeSize) {
421 double dphiTrackJet = fabs(trackPhi - jetPhi);
422 if(dphiTrackJet >
M_PI) dphiTrackJet = 2*
M_PI - dphiTrackJet;
424 if(dphiTrackJet < mConeSize)
446 for ( std::vector<reco::TrackExtrapolation>::const_iterator xtrpBegin = extrapolations_h->begin(),
447 xtrpEnd = extrapolations_h->end(), ixtrp = xtrpBegin;
448 ixtrp != xtrpEnd; ++ixtrp ) {
460 if ( it != trBgOutOfVertex.
end() ){
473 return trBgOutOfVertex;
reco::TrackRefVector muonsInVertexOutCalo
virtual double energy() const GCC11_FINAL
energy
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
float mSumEnergyOfChargedWithoutEff
Jets made from CaloTowers.
reco::TrackRefVector muonsInVertexInCalo
reco::TrackRefVector calculateBGtracksJet(reco::JPTJetCollection &, std::vector< reco::TrackRef > &, edm::Handle< std::vector< reco::TrackExtrapolation > > &, reco::TrackRefVector &)
~JetPlusTrackProducerAA()
std::vector< JPTJet > JPTJetCollection
collection of CaloJet objects
Base class for all types of Jets.
float mChargedHadronEnergy
float mSumPtOfChargedWithEff
reco::TrackRefVector inVertexInCalo_
reco::TrackRefVector muonsOutVertexInCalo
JetPlusTrackProducerAA(const edm::ParameterSet &)
double phi() const
azimuthal angle of momentum vector
virtual void scaleEnergy(double fScale)
scale energy of the jet
reco::TrackRefVector inVertexOutOfCalo_
float mResponseOfChargedWithEff
reco::TrackRefVector elecsOutVertexInCalo
reco::TrackRefVector pionsInVertexOutCalo
const_iterator end() const
Termination of iteration.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
virtual double pz() const GCC11_FINAL
z coordinate of momentum vector
virtual double py() const GCC11_FINAL
y coordinate of momentum vector
const_iterator begin() const
Initialize an iterator over the RefVector.
U second(std::pair< T, U > const &p)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
double eta() const
pseudorapidity of momentum vector
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Jets made from CaloJets corrected for ZSP and tracks.
reco::TrackRefVector pionsOutVertexInCalo
float mSumEnergyOfChargedWithEff
virtual double px() const GCC11_FINAL
x coordinate of momentum vector
math::XYZPoint Point
point in the space
reco::TrackRefVector outOfVertexInCalo_
reco::TrackRefVector elecsInVertexInCalo
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
edm::RefToBase< reco::Jet > theCaloJetRef
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
double deltaR(double eta1, double eta2, double phi1, double phi2)
float mResponseOfChargedWithoutEff
reco::TrackRefVector pionsInVertexInCalo
static TrackQuality qualityByName(const std::string &name)
float mSumPtOfChargedWithoutEff
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.
virtual void produce(edm::Event &, const edm::EventSetup &)
math::XYZPoint Point
point in the space
virtual Constituents getJetConstituents() const
list of constituents