CMS 3D CMS Logo

Functions
PatTauAnalyzer.cc File Reference
#include "PhysicsTools/PatExamples/plugins/PatTauAnalyzer.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "CommonTools/UtilAlgos/interface/TFileService.h"
#include <TMath.h>
#include "FWCore/Framework/interface/MakerMacros.h"

Go to the source code of this file.

Functions

const reco::GenParticlegetGenTau (const pat::Tau &patTau)
 
static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker< edm::ParameterSetDescriptionFiller< PatTauAnalyzer > > s_filler__LINE__ ("PatTauAnalyzer")
 
static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< PatTauAnalyzer > > s_maker__LINE__ ("PatTauAnalyzer")
 

Function Documentation

◆ getGenTau()

const reco::GenParticle* getGenTau ( const pat::Tau patTau)

Definition at line 10 of file PatTauAnalyzer.cc.

10  {
11  std::vector<reco::GenParticleRef> associatedGenParticles = patTau.genParticleRefs();
12  for (std::vector<reco::GenParticleRef>::const_iterator it = associatedGenParticles.begin();
13  it != associatedGenParticles.end();
14  ++it) {
15  if (it->isAvailable()) {
16  const reco::GenParticleRef& genParticle = (*it);
17  if (genParticle->pdgId() == -15 || genParticle->pdgId() == +15)
18  return genParticle.get();
19  }
20  }
21 
22  return nullptr;
23 }

References pat::PATObject< ObjectType >::genParticleRefs(), and edm::Ref< C, T, F >::get().

Referenced by PatTauAnalyzer::analyze().

◆ s_filler__LINE__()

static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker<edm::ParameterSetDescriptionFiller< PatTauAnalyzer > > s_filler__LINE__ ( "PatTauAnalyzer"  )
static

◆ s_maker__LINE__()

static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< PatTauAnalyzer > > s_maker__LINE__ ( "PatTauAnalyzer"  )
static
edm::Ref::get
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
edm::Ref< GenParticleCollection >
pat::PATObject::genParticleRefs
std::vector< reco::GenParticleRef > genParticleRefs() const
Definition: PATObject.h:781