CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
JetPlusTrackProducerAA Class Reference

#include <RecoJets/JetPlusTracks/src/JetPlusTrackProducerAA.cc>

Inheritance diagram for JetPlusTrackProducerAA:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

virtual void beginJob ()
 
reco::TrackRefVector calculateBGtracksJet (reco::JPTJetCollection &, std::vector< reco::TrackRef > &, edm::Handle< std::vector< reco::TrackExtrapolation > > &, reco::TrackRefVector &)
 
virtual void endJob ()
 
 JetPlusTrackProducerAA (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~JetPlusTrackProducerAA ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

std::string alias
 
double mConeSize
 
edm::InputTag mExtrapolations
 
JetPlusTrackCorrectormJPTalgo
 
edm::InputTag mTracks
 
ZSPJPTJetCorrectormZSPalgo
 
edm::InputTag src
 
edm::InputTag srcPVs_
 
reco::TrackBase::TrackQuality trackQuality_
 
bool useZSP
 
bool vectorial_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 54 of file JetPlusTrackProducerAA.h.

Constructor & Destructor Documentation

JetPlusTrackProducerAA::JetPlusTrackProducerAA ( const edm::ParameterSet iConfig)
explicit

Definition at line 80 of file JetPlusTrackProducerAA.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), reco::TrackBase::qualityByName(), and alcazmumu_cfi::src.

81 {
82  //register your products
83  src = iConfig.getParameter<edm::InputTag>("src");
84  alias = iConfig.getUntrackedParameter<string>("alias");
85  mTracks = iConfig.getParameter<edm::InputTag> ("tracks");
86  srcPVs_ = iConfig.getParameter<edm::InputTag>("srcPVs");
87  vectorial_ = iConfig.getParameter<bool>("VectorialCorrection");
88  useZSP = iConfig.getParameter<bool>("UseZSP");
89  std::string tq = iConfig.getParameter<std::string>("TrackQuality");
91  mConeSize = iConfig.getParameter<double> ("coneSize");
92 //=>
93  mExtrapolations = iConfig.getParameter<edm::InputTag> ("extrapolations");
94 //=>
95  mJPTalgo = new JetPlusTrackCorrector(iConfig);
96  if(useZSP) mZSPalgo = new ZSPJPTJetCorrector(iConfig);
97 
98  produces<reco::JPTJetCollection>().setBranchAlias(alias);
99 
100 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
reco::TrackBase::TrackQuality trackQuality_
ZSPJPTJetCorrector * mZSPalgo
JetPlusTrackCorrector * mJPTalgo
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:46
Jet energy correction algorithm using tracks.
JetPlusTrackProducerAA::~JetPlusTrackProducerAA ( )

Definition at line 103 of file JetPlusTrackProducerAA.cc.

104 {
105 
106  // do anything here that needs to be done at desctruction time
107  // (e.g. close files, deallocate resources etc.)
108 
109 }

Member Function Documentation

void JetPlusTrackProducerAA::beginJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 478 of file JetPlusTrackProducerAA.cc.

479 {
480 }
reco::TrackRefVector JetPlusTrackProducerAA::calculateBGtracksJet ( reco::JPTJetCollection fJets,
std::vector< reco::TrackRef > &  fTracks,
edm::Handle< std::vector< reco::TrackExtrapolation > > &  extrapolations_h,
reco::TrackRefVector trBgOutOfCalo 
)

Definition at line 387 of file JetPlusTrackProducerAA.cc.

References edm::RefVector< C, T, F >::begin(), edm::RefVector< C, T, F >::end(), reco::TrackBase::eta(), reco::LeafCandidate::eta(), spr::find(), j, metsig::jet, reco::btau::jetEta, reco::btau::jetPhi, M_PI, reco::TrackBase::phi(), reco::LeafCandidate::phi(), edm::RefVector< C, T, F >::push_back(), lumiQTWidget::t, reco::btau::trackEta, and reco::btau::trackPhi.

389  {
390 
391 
392  reco::TrackRefVector trBgOutOfVertex;
393 
394  for (unsigned t = 0; t < fTracks.size(); ++t) {
395 
396  int track_bg = 0;
397 
398  // if(!(*fTracks[t]).quality(trackQuality_))
399  // {
400  // cout<<"BG, BAD trackQuality, ptBgV="<<fTracks[t]->pt()<<" etaBgV = "<<fTracks[t]->eta()<<" phiBgV = "<<fTracks[t]->phi()<<endl;
401  // continue;
402  // }
403 
404  const reco::Track* track = &*(fTracks[t]);
405  double trackEta = track->eta();
406  double trackPhi = track->phi();
407 
408  // std::cout<<"++++++++++++++++> track="<<t<<" trackEta="<<trackEta<<" trackPhi="<<trackPhi
409  // <<" coneSize="<<mConeSize<<std::endl;
410 
411  //loop on jets
412  for (unsigned j = 0; j < fJets.size(); ++j) {
413 
414  const reco::Jet* jet = &(fJets[j]);
415  double jetEta = jet->eta();
416  double jetPhi = jet->phi();
417 
418  // std::cout<<"-jet="<<j<<" jetEt ="<<jet->pt()
419  // <<" jetE="<<jet->energy()<<" jetEta="<<jetEta<<" jetPhi="<<jetPhi<<std::endl;
420 
421  if(fabs(jetEta - trackEta) < mConeSize) {
422  double dphiTrackJet = fabs(trackPhi - jetPhi);
423  if(dphiTrackJet > M_PI) dphiTrackJet = 2*M_PI - dphiTrackJet;
424 
425  if(dphiTrackJet < mConeSize)
426  {
427  track_bg = 1;
428  // std::cout<<"===>>>> Track inside jet at vertex, track_bg="<< track_bg <<" track="<<t<<" jet="<<j
429  // <<" trackEta="<<trackEta<<" trackPhi="<<trackPhi
430  // <<" jetEta="<<jetEta<<" jetPhi="<<jetPhi<<std::endl;
431  }
432  }
433  } //jets
434 
435  if( track_bg == 0 )
436  {
437  trBgOutOfVertex.push_back (fTracks[t]);
438 
439 // std::cout<<"------Track outside jet at vertex, track_bg="<< track_bg<<" track="<<t
440 // <<" trackEta="<<trackEta<<" trackPhi="<<trackPhi <<std::endl;
441  }
442 
443  } //tracks
444 
445 //=====> Propagate BG tracks to calo
446  int nValid = 0;
447  for ( std::vector<reco::TrackExtrapolation>::const_iterator xtrpBegin = extrapolations_h->begin(),
448  xtrpEnd = extrapolations_h->end(), ixtrp = xtrpBegin;
449  ixtrp != xtrpEnd; ++ixtrp ) {
450 
451 // std::cout<<"JetPlusTrackProducerAA::calculateBGtracksJet: initial track pt= "<<ixtrp->track()->pt()
452 // <<" eta= "<<ixtrp->track()->eta()<<" phi="<<ixtrp->track()->phi()
453 // <<" Valid? "<<ixtrp->isValid().at(0)<<std::endl;
454 
455  //if( ixtrp->isValid().at(0) == 0 ) continue;
456  //in DF change in 4.2, all entries are valid.
457  nValid++;
458 
459  reco::TrackRefVector::iterator it = find(trBgOutOfVertex.begin(),trBgOutOfVertex.end(),(*ixtrp).track() );
460 
461  if ( it != trBgOutOfVertex.end() ){
462  trBgOutOfCalo.push_back (*it);
463 
464 // std::cout<<"+++trBgOutOfCalo, pt= "<<ixtrp->track()->pt()<<" eta= "<<ixtrp->track()->eta()<<" phi="<<ixtrp->track()->phi()
465 // <<" Valid? "<<ixtrp->isValid().at(0)<<std::endl;
466  }
467 
468  }
469 
470 // std::cout<<"calculateBGtracksJet, trBgOutOfCalo="<<trBgOutOfCalo.size()
471 // <<" trBgOutOfVertex="<<trBgOutOfVertex.size()<<" nValid="<<nValid<<endl;
472 //=====>
473 
474  return trBgOutOfVertex;
475 }
Base class for all types of Jets.
Definition: Jet.h:21
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:139
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:249
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
virtual double eta() const
momentum pseudorapidity
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:244
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:141
int j
Definition: DBlmapReader.cc:9
#define M_PI
Definition: BFit3D.cc:3
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:64
virtual double phi() const
momentum azimuthal angle
void JetPlusTrackProducerAA::endJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 484 of file JetPlusTrackProducerAA.cc.

484  {
485 }
void JetPlusTrackProducerAA::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 118 of file JetPlusTrackProducerAA.cc.

References edm::RefVector< C, T, F >::begin(), SiPixelRawToDigiRegional_cfi::deltaPhi, deltaR(), reco::JPTJet::Specific::elecsInVertexInCalo, reco::JPTJet::Specific::elecsInVertexOutCalo, reco::JPTJet::Specific::elecsOutVertexInCalo, edm::RefVector< C, T, F >::end(), reco::LeafCandidate::energy(), reco::JPTJet::Specific::Eta2momtr, edm::Event::getByLabel(), reco::Jet::getJetConstituents(), i, jpt::MatchedTracks::inVertexInCalo_, jpt::MatchedTracks::inVertexOutOfCalo_, edm::HandleBase::isValid(), M_PI, reco::JPTJet::Specific::mChargedHadronEnergy, reco::JPTJet::Specific::mResponseOfChargedWithEff, reco::JPTJet::Specific::mResponseOfChargedWithoutEff, reco::JPTJet::Specific::mSumEnergyOfChargedWithEff, reco::JPTJet::Specific::mSumEnergyOfChargedWithoutEff, reco::JPTJet::Specific::mSumPtOfChargedWithEff, reco::JPTJet::Specific::mSumPtOfChargedWithoutEff, patZpeak::muons, reco::JPTJet::Specific::muonsInVertexInCalo, reco::JPTJet::Specific::muonsInVertexOutCalo, reco::JPTJet::Specific::muonsOutVertexInCalo, reco::JPTJet::Specific::mZSPCor, convertSQLiteXML::ok, jpt::MatchedTracks::outOfVertexInCalo_, p4, reco::JPTJet::Specific::Phi2momtr, reco::JPTJet::Specific::pionsInVertexInCalo, reco::JPTJet::Specific::pionsInVertexOutCalo, reco::JPTJet::Specific::pionsOutVertexInCalo, reco::JPTJet::Specific::Pout, edm::Event::put(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), reco::LeafCandidate::pz(), reco::JPTJet::Specific::R2momtr, reco::Jet::scaleEnergy(), edm::second(), timingPdfMaker::specific, mathSSE::sqrt(), alcazmumu_cfi::src, reco::JPTJet::Specific::theCaloJetRef, and reco::JPTJet::Specific::Zch.

119 {
120  using namespace edm;
121 
122 
123 // std::cout<<" RecoJets::JetPlusTrackProducerAA::produce "<<std::endl;
124 
125 // get stuff from Event
127  iEvent.getByLabel (src, jets_h);
128 
130  iEvent.getByLabel (mTracks, tracks_h);
131 
132  std::vector <reco::TrackRef> fTracks;
133  fTracks.reserve (tracks_h->size());
134  for (unsigned i = 0; i < tracks_h->size(); ++i) {
135  fTracks.push_back (reco::TrackRef (tracks_h, i));
136  }
137 
138 //=>
140  iEvent.getByLabel (mExtrapolations, extrapolations_h);
141 
142 // std::cout<<"JetPlusTrackProducerAA::produce, extrapolations_h="<<extrapolations_h->size()<<std::endl;
143 //=>
144 
145  std::auto_ptr<reco::JPTJetCollection> pOut(new reco::JPTJetCollection());
146 
147  reco::JPTJetCollection tmpColl;
148 
149  for (unsigned i = 0; i < jets_h->size(); ++i) {
150 
151  const reco::CaloJet* oldjet = &(*(jets_h->refAt(i)));
152 
153  reco::CaloJet corrected = *oldjet;
154 
155 // ZSP corrections
156 
157  double factorZSP = 1.;
158  if(useZSP) factorZSP = mZSPalgo->correction(corrected, iEvent, iSetup);
159 
160 // std::cout << " UseZSP = "<<useZSP<<std::endl;
161 
162 
163  corrected.scaleEnergy (factorZSP);
164 
165 // JPT corrections
166 
167  double scaleJPT = 1.;
168 
170 
171 // Construct JPTJet constituent
172  jpt::MatchedTracks pions;
174  jpt::MatchedTracks elecs;
175  bool ok=false;
176 
177  if ( !vectorial_ ) {
178 
179  scaleJPT = mJPTalgo->correction ( corrected, *oldjet, iEvent, iSetup, pions, muons, elecs, ok );
180  p4 = math::XYZTLorentzVector( corrected.px()*scaleJPT,
181  corrected.py()*scaleJPT,
182  corrected.pz()*scaleJPT,
183  corrected.energy()*scaleJPT );
184  } else {
185  scaleJPT = mJPTalgo->correction( corrected, *oldjet, iEvent, iSetup, p4, pions, muons, elecs, ok );
186  }
187 
188 
189 
191 
192  if(ok) {
193 // std::cout<<" Size of Pion in-in "<<pions.inVertexInCalo_.size()<<" in-out "<<pions.inVertexOutOfCalo_.size()
194 // <<" out-in "<<pions.outOfVertexInCalo_.size()<<" Oldjet "<<oldjet->et()<<" factorZSP "<<factorZSP
195 // <<" "<<corrected.et()<<" scaleJPT "<<scaleJPT<<" after JPT "<<p4.pt()<<std::endl;
196 
197 
198  specific.pionsInVertexInCalo = pions.inVertexInCalo_;
199  specific.pionsInVertexOutCalo = pions.inVertexOutOfCalo_;
200  specific.pionsOutVertexInCalo = pions.outOfVertexInCalo_;
201  specific.muonsInVertexInCalo = muons.inVertexInCalo_;
202  specific.muonsInVertexOutCalo = muons.inVertexOutOfCalo_;
203  specific.muonsOutVertexInCalo = muons.outOfVertexInCalo_;
204  specific.elecsInVertexInCalo = elecs.inVertexInCalo_;
205  specific.elecsInVertexOutCalo = elecs.inVertexOutOfCalo_;
206  specific.elecsOutVertexInCalo = elecs.outOfVertexInCalo_;
207  }
208 
209 // Fill JPT Specific
210  edm::RefToBase<reco::Jet> myjet = (edm::RefToBase<reco::Jet>)jets_h->refAt(i);
211  specific.theCaloJetRef = myjet;
212  specific.mZSPCor = factorZSP;
215  specific.mSumPtOfChargedWithEff = (float)mJPTalgo->getSumPtWithEff();
220 // Fill Charged Jet shape parameters
221  double deR2Tr = 0.;
222  double deEta2Tr = 0.;
223  double dePhi2Tr = 0.;
224  double Zch = 0.;
225  double Pout2 = 0.;
226  double Pout = 0.;
227  double denominator_tracks = 0.;
228  int ntracks = 0;
229 
230  for( reco::TrackRefVector::const_iterator it = pions.inVertexInCalo_.begin(); it != pions.inVertexInCalo_.end(); it++) {
231  double deR = deltaR((*it)->eta(), (*it)->phi(), p4.eta(), p4.phi());
232  double deEta = (*it)->eta() - p4.eta();
233  double dePhi = deltaPhi((*it)->phi(), p4.phi());
234  if((**it).ptError()/(**it).pt() < 0.1) {
235  deR2Tr = deR2Tr + deR*deR*(*it)->pt();
236  deEta2Tr = deEta2Tr + deEta*deEta*(*it)->pt();
237  dePhi2Tr = dePhi2Tr + dePhi*dePhi*(*it)->pt();
238  denominator_tracks = denominator_tracks + (*it)->pt();
239  Zch = Zch + (*it)->pt();
240 
241  Pout2 = Pout2 + (**it).p()*(**it).p() - (Zch*p4.P())*(Zch*p4.P());
242  ntracks++;
243  }
244  }
245  for( reco::TrackRefVector::const_iterator it = muons.inVertexInCalo_.begin(); it != muons.inVertexInCalo_.end(); it++) {
246  double deR = deltaR((*it)->eta(), (*it)->phi(), p4.eta(), p4.phi());
247  double deEta = (*it)->eta() - p4.eta();
248  double dePhi = deltaPhi((*it)->phi(), p4.phi());
249  if((**it).ptError()/(**it).pt() < 0.1) {
250  deR2Tr = deR2Tr + deR*deR*(*it)->pt();
251  deEta2Tr = deEta2Tr + deEta*deEta*(*it)->pt();
252  dePhi2Tr = dePhi2Tr + dePhi*dePhi*(*it)->pt();
253  denominator_tracks = denominator_tracks + (*it)->pt();
254  Zch = Zch + (*it)->pt();
255 
256  Pout2 = Pout2 + (**it).p()*(**it).p() - (Zch*p4.P())*(Zch*p4.P());
257  ntracks++;
258  }
259  }
260  for( reco::TrackRefVector::const_iterator it = elecs.inVertexInCalo_.begin(); it != elecs.inVertexInCalo_.end(); it++) {
261  double deR = deltaR((*it)->eta(), (*it)->phi(), p4.eta(), p4.phi());
262  double deEta = (*it)->eta() - p4.eta();
263  double dePhi = deltaPhi((*it)->phi(), p4.phi());
264  if((**it).ptError()/(**it).pt() < 0.1) {
265  deR2Tr = deR2Tr + deR*deR*(*it)->pt();
266  deEta2Tr = deEta2Tr + deEta*deEta*(*it)->pt();
267  dePhi2Tr = dePhi2Tr + dePhi*dePhi*(*it)->pt();
268  denominator_tracks = denominator_tracks + (*it)->pt();
269  Zch = Zch + (*it)->pt();
270 
271  Pout2 = Pout2 + (**it).p()*(**it).p() - (Zch*p4.P())*(Zch*p4.P());
272  ntracks++;
273  }
274  }
275  for( reco::TrackRefVector::const_iterator it = pions.inVertexOutOfCalo_.begin(); it != pions.inVertexOutOfCalo_.end(); it++) {
276  Zch = Zch + (*it)->pt();
277  }
278  for( reco::TrackRefVector::const_iterator it = muons.inVertexOutOfCalo_.begin(); it != muons.inVertexOutOfCalo_.end(); it++) {
279  Zch = Zch + (*it)->pt();
280  }
281  for( reco::TrackRefVector::const_iterator it = elecs.inVertexOutOfCalo_.begin(); it != elecs.inVertexOutOfCalo_.end(); it++) {
282  Zch = Zch + (*it)->pt();
283  }
284 
285  if(mJPTalgo->getSumPtForBeta()> 0.) Zch = Zch/mJPTalgo->getSumPtForBeta();
286 
287  // std::cout<<" Zch "<< Zch<<" "<<mJPTalgo->getSumPtForBeta()<<std::endl;
288 
289  if(ntracks > 0) {
290  Pout = sqrt(fabs(Pout2))/ntracks;
291  }
292 
293 
294  if (denominator_tracks!=0){
295  deR2Tr = deR2Tr/denominator_tracks;
296  deEta2Tr= deEta2Tr/denominator_tracks;
297  dePhi2Tr= dePhi2Tr/denominator_tracks;
298  }
299 
300  specific.R2momtr = deR2Tr;
301  specific.Eta2momtr = deEta2Tr;
302  specific.Phi2momtr = dePhi2Tr;
303  specific.Pout = Pout;
304  specific.Zch = Zch;
305 
306 // Create JPT jet
307 
309 
310 // If we add primary vertex
312  iEvent.getByLabel(srcPVs_,pvCollection);
313  if ( pvCollection.isValid() && pvCollection->size()>0 ) vertex_=pvCollection->begin()->position();
314 
315  reco::JPTJet fJet(p4, vertex_, specific, corrected.getJetConstituents());
316  // fJet.printJet();
317 
318 // Temporarily collection before correction for background
319 
320  tmpColl.push_back(fJet);
321 
322  }
323 
324 //=======================================================================================================>
325 // Correction for background
326 
327  reco::TrackRefVector trBgOutOfCalo;
328  reco::TrackRefVector trBgOutOfVertex = calculateBGtracksJet(tmpColl,fTracks,extrapolations_h,trBgOutOfCalo);
329 
330 //===> Area without Jets
331  std::map<reco::JPTJetCollection::iterator, double> AreaNonJet;
332 
333  for(reco::JPTJetCollection::iterator ij1=tmpColl.begin(); ij1!=tmpColl.end(); ij1++)
334  {
335  int nj1 = 1;
336  for(reco::JPTJetCollection::iterator ij2=tmpColl.begin(); ij2!=tmpColl.end(); ij2++)
337  {
338  if(ij2 == ij1) continue;
339  if(fabs((*ij1).eta() - (*ij2).eta()) > 0.5 ) continue;
340  nj1++;
341 
342  }
343 
344  AreaNonJet[ij1] = 4*M_PI*mConeSize - nj1*4*mConeSize*mConeSize;
345 
346 // std::cout<<"+++AreaNonJet[ij1]="<<AreaNonJet[ij1]<<" nj1="<<nj1<<std::endl;
347  }
348 
349 //===>
350 
351 // std::cout<<" The size of BG tracks: trBgOutOfVertex= "<<trBgOutOfVertex.size()
352 // <<" trBgOutOfCalo= "<<trBgOutOfCalo.size()<<std::endl;
353 //
354 // std::cout<<" The size of JPT jet collection "<<tmpColl.size()<<std::endl;
355 
356  for(reco::JPTJetCollection::iterator ij=tmpColl.begin(); ij!=tmpColl.end(); ij++)
357  {
358 // Correct JPTjet for background tracks
359 
360  const reco::TrackRefVector pioninin = (*ij).getPionsInVertexInCalo();
361  const reco::TrackRefVector pioninout = (*ij).getPionsInVertexOutCalo();
362 
363  double ja = (AreaNonJet.find(ij))->second;
364 
365 // std::cout<<"+++ ja="<<ja<<" pioninout="<<pioninout.size()<<std::endl;
366 
367  double factorPU = mJPTalgo->correctAA(*ij,trBgOutOfVertex,mConeSize,pioninin,pioninout,ja,trBgOutOfCalo);
368 
369  (*ij).scaleEnergy (factorPU);
370 
371 // std::cout<<" FactorPU "<<factorPU<<std::endl;
372 
373 // Output module
374  pOut->push_back(*ij);
375 
376 // std::cout<<" New JPT energy "<<(*ij).et()<<" "<<(*ij).pt()<<" "<<(*ij).eta()<<" "<<(*ij).phi()<<std::endl;
377 
378  }
379 
380  iEvent.put(pOut);
381 
382 }
reco::TrackRefVector muonsInVertexOutCalo
Definition: JPTJet.h:57
int i
Definition: DBlmapReader.cc:9
float mSumEnergyOfChargedWithoutEff
Definition: JPTJet.h:71
dictionary specific
Jets made from CaloTowers.
Definition: CaloJet.h:30
reco::TrackRefVector muonsInVertexInCalo
Definition: JPTJet.h:56
reco::TrackRefVector calculateBGtracksJet(reco::JPTJetCollection &, std::vector< reco::TrackRef > &, edm::Handle< std::vector< reco::TrackExtrapolation > > &, reco::TrackRefVector &)
ZSPJPTJetCorrector * mZSPalgo
std::vector< JPTJet > JPTJetCollection
collection of CaloJet objects
float mChargedHadronEnergy
Definition: JPTJet.h:62
float mSumPtOfChargedWithEff
Definition: JPTJet.h:68
reco::TrackRefVector inVertexInCalo_
reco::TrackRefVector muonsOutVertexInCalo
Definition: JPTJet.h:58
virtual void scaleEnergy(double fScale)
scale energy of the jet
Definition: Jet.cc:445
reco::TrackRefVector inVertexOutOfCalo_
virtual double correction(const reco::Jet &, const edm::Event &, const edm::EventSetup &) const
apply correction using Event information
float mResponseOfChargedWithEff
Definition: JPTJet.h:66
reco::TrackRefVector elecsOutVertexInCalo
Definition: JPTJet.h:61
reco::TrackRefVector pionsInVertexOutCalo
Definition: JPTJet.h:54
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:249
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:244
U second(std::pair< T, U > const &p)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:30
virtual double energy() const
energy
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
T sqrt(T t)
Definition: SSEVec.h:46
double p4[4]
Definition: TauolaWrapper.h:92
Jets made from CaloJets corrected for ZSP and tracks.
Definition: JPTJet.h:29
JetPlusTrackCorrector * mJPTalgo
double getResponseOfChargedWithEff()
Get responses/sumPT/SumEnergy with and without Efficiency correction.
reco::TrackRefVector pionsOutVertexInCalo
Definition: JPTJet.h:55
float mSumEnergyOfChargedWithEff
Definition: JPTJet.h:70
math::XYZPoint Point
point in the space
Definition: Particle.h:29
reco::TrackRefVector outOfVertexInCalo_
reco::TrackRefVector elecsInVertexInCalo
Definition: JPTJet.h:59
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) const
Vectorial correction method (corrected 4-momentum passed by reference)
bool isValid() const
Definition: HandleBase.h:76
double correctAA(const reco::Jet &, const reco::TrackRefVector &, double &, const reco::TrackRefVector &, const reco::TrackRefVector &, double, const reco::TrackRefVector &) const
For AA - correct in tracker.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
edm::RefToBase< reco::Jet > theCaloJetRef
Definition: JPTJet.h:52
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
float mResponseOfChargedWithoutEff
Definition: JPTJet.h:67
reco::TrackRefVector pionsInVertexInCalo
Definition: JPTJet.h:53
#define M_PI
Definition: BFit3D.cc:3
virtual double px() const
x coordinate of momentum vector
float mSumPtOfChargedWithoutEff
Definition: JPTJet.h:69
reco::TrackRefVector elecsInVertexOutCalo
Definition: JPTJet.h:60
virtual double pz() const
z coordinate of momentum vector
Particles matched to tracks that are in/in, in/out, out/in at Vertex and CaloFace.
tuple muons
Definition: patZpeak.py:38
virtual double py() const
y coordinate of momentum vector
math::XYZPoint Point
point in the space
Definition: LeafCandidate.h:29
virtual Constituents getJetConstituents() const
list of constituents
Definition: Jet.cc:351

Member Data Documentation

std::string JetPlusTrackProducerAA::alias
private

Definition at line 74 of file JetPlusTrackProducerAA.h.

double JetPlusTrackProducerAA::mConeSize
private

Definition at line 78 of file JetPlusTrackProducerAA.h.

edm::InputTag JetPlusTrackProducerAA::mExtrapolations
private

Definition at line 82 of file JetPlusTrackProducerAA.h.

JetPlusTrackCorrector* JetPlusTrackProducerAA::mJPTalgo
private

Definition at line 70 of file JetPlusTrackProducerAA.h.

edm::InputTag JetPlusTrackProducerAA::mTracks
private

Definition at line 77 of file JetPlusTrackProducerAA.h.

ZSPJPTJetCorrector* JetPlusTrackProducerAA::mZSPalgo
private

Definition at line 71 of file JetPlusTrackProducerAA.h.

edm::InputTag JetPlusTrackProducerAA::src
private

Definition at line 72 of file JetPlusTrackProducerAA.h.

edm::InputTag JetPlusTrackProducerAA::srcPVs_
private

Definition at line 73 of file JetPlusTrackProducerAA.h.

reco::TrackBase::TrackQuality JetPlusTrackProducerAA::trackQuality_
private

Definition at line 79 of file JetPlusTrackProducerAA.h.

bool JetPlusTrackProducerAA::useZSP
private

Definition at line 76 of file JetPlusTrackProducerAA.h.

bool JetPlusTrackProducerAA::vectorial_
private

Definition at line 75 of file JetPlusTrackProducerAA.h.