CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Classes | Functions
PatTauAnalyzer.cc File Reference
#include "CommonTools/UtilAlgos/interface/TFileService.h"
#include "DataFormats/PatCandidates/interface/Tau.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Utilities/interface/InputTag.h"
#include <TH1.h>
#include <TMath.h>
#include <string>
#include "FWCore/Framework/interface/MakerMacros.h"

Go to the source code of this file.

Classes

class  PatTauAnalyzer
 

Functions

const reco::GenParticlegetGenTau (const pat::Tau &patTau)
 
static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker< edm::ParameterSetDescriptionFiller< PatTauAnalyzer > > s_filler_0__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 73 of file PatTauAnalyzer.cc.

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

Referenced by PatTauAnalyzer::analyze().

73  {
74  std::vector<reco::GenParticleRef> associatedGenParticles = patTau.genParticleRefs();
75  for (std::vector<reco::GenParticleRef>::const_iterator it = associatedGenParticles.begin();
76  it != associatedGenParticles.end();
77  ++it) {
78  if (it->isAvailable()) {
79  const reco::GenParticleRef& genParticle = (*it);
80  if (genParticle->pdgId() == -15 || genParticle->pdgId() == +15)
81  return genParticle.get();
82  }
83  }
84 
85  return nullptr;
86 }
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
std::vector< reco::GenParticleRef > genParticleRefs() const
Definition: PATObject.h:779

◆ s_filler_0__LINE__()

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

◆ s_maker__LINE__()

static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< PatTauAnalyzer > > s_maker__LINE__ ( "PatTauAnalyzer"  )
static