CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
L1HPSPFTauQualityCut Class Reference

#include <L1HPSPFTauQualityCut.h>

Public Types

enum  { kDisabled, kEnabledPrimary, kEnabledPileup }
 

Public Member Functions

int dzCut () const
 
 L1HPSPFTauQualityCut (const edm::ParameterSet &cfg)
 constructor More...
 
float_t maxDz () const
 
float_t minPt () const
 
bool operator() (const l1t::PFCandidate &pfCand, float_t primaryVertexZ) const
 returns true (false) if PFCandidate passes (fails) quality cuts More...
 
l1t::PFCandidate::ParticleType pfCandType () const
 accessor functions More...
 
 ~L1HPSPFTauQualityCut ()=default
 destructor More...
 

Private Attributes

bool debug_
 
int dzCut_
 
float_t maxDz_
 
float_t minPt_
 
l1t::PFCandidate::ParticleType pfCandType_
 

Detailed Description

Definition at line 9 of file L1HPSPFTauQualityCut.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Constructor & Destructor Documentation

◆ L1HPSPFTauQualityCut()

L1HPSPFTauQualityCut::L1HPSPFTauQualityCut ( const edm::ParameterSet cfg)

constructor

Definition at line 4 of file L1HPSPFTauQualityCut.cc.

References looper::cfg, l1t::PFCandidate::ChargedHadron, dzCut_, l1t::PFCandidate::Electron, Exception, kDisabled, kEnabledPileup, kEnabledPrimary, maxDz_, minPt_, l1t::PFCandidate::Muon, l1t::PFCandidate::NeutralHadron, pfCandType_, l1t::PFCandidate::Photon, and AlCaHLTBitMon_QueryRunRegistry::string.

5  : debug_(cfg.getUntrackedParameter<bool>("debug", false)) {
6  std::string pfCandTypeString = cfg.getParameter<std::string>("pfCandType");
7  if (pfCandTypeString == "chargedHadron")
9  else if (pfCandTypeString == "electron")
11  else if (pfCandTypeString == "muon")
13  else if (pfCandTypeString == "neutralHadron")
15  else if (pfCandTypeString == "photon")
17  else
18  throw cms::Exception("L1HPSPFTauQualityCut")
19  << "Invalid Configuration parameter 'pfCandType' = '" << pfCandTypeString << "' !!\n";
20 
21  std::string dzCutString = cfg.getParameter<std::string>("dzCut");
22  if (dzCutString == "disabled")
23  dzCut_ = kDisabled;
24  else if (dzCutString == "enabled_primary")
26  else if (dzCutString == "enabled_pileup")
28  else
29  throw cms::Exception("L1HPSPFTauQualityCut")
30  << "Invalid Configuration parameter 'dzCut' = '" << dzCutString << "' !!\n";
31 
32  minPt_ = cfg.getParameter<double>("minPt");
33  maxDz_ = (cfg.exists("maxDz")) ? cfg.getParameter<double>("maxDz") : 1.e+3;
34 }
l1t::PFCandidate::ParticleType pfCandType_

◆ ~L1HPSPFTauQualityCut()

L1HPSPFTauQualityCut::~L1HPSPFTauQualityCut ( )
default

destructor

Member Function Documentation

◆ dzCut()

int L1HPSPFTauQualityCut::dzCut ( ) const

Definition at line 60 of file L1HPSPFTauQualityCut.cc.

References dzCut_.

60 { return dzCut_; }

◆ maxDz()

float_t L1HPSPFTauQualityCut::maxDz ( ) const

Definition at line 64 of file L1HPSPFTauQualityCut.cc.

References maxDz_.

64 { return maxDz_; }

◆ minPt()

float_t L1HPSPFTauQualityCut::minPt ( ) const

Definition at line 62 of file L1HPSPFTauQualityCut.cc.

References minPt_.

62 { return minPt_; }

◆ operator()()

bool L1HPSPFTauQualityCut::operator() ( const l1t::PFCandidate pfCand,
float_t  primaryVertexZ 
) const

returns true (false) if PFCandidate passes (fails) quality cuts

Definition at line 36 of file L1HPSPFTauQualityCut.cc.

References funct::abs(), reco::LeafCandidate::charge(), PVValHelper::dz, dzCut_, l1t::PFCandidate::id(), kEnabledPileup, kEnabledPrimary, maxDz_, minPt_, pfCandType_, l1t::PFCandidate::pfTrack(), and reco::LeafCandidate::pt().

36  {
37  if (pfCand.id() == pfCandType_) {
38  if (pfCand.pt() < minPt_) {
39  return false;
40  }
41 
42  if (pfCand.charge() != 0) {
44  const l1t::PFTrackRef& pfCand_track = pfCand.pfTrack();
45  double dz = std::abs(pfCand_track->vertex().z() - primaryVertex_z);
46  if (dzCut_ == kEnabledPrimary && dz > maxDz_)
47  return false;
48  if (dzCut_ == kEnabledPileup && dz <= maxDz_)
49  return false;
50  }
51  } else if (dzCut_ == kEnabledPileup) {
52  return false; // CV: only consider charged PFCands as originating from pileup
53  }
54  }
55  return true;
56 }
l1t::PFCandidate::ParticleType pfCandType_
double pt() const final
transverse momentum
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const PFTrackRef & pfTrack() const
Definition: PFCandidate.h:36
ParticleType id() const
Definition: PFCandidate.h:34
int charge() const final
electric charge

◆ pfCandType()

l1t::PFCandidate::ParticleType L1HPSPFTauQualityCut::pfCandType ( ) const

accessor functions

Definition at line 58 of file L1HPSPFTauQualityCut.cc.

References pfCandType_.

58 { return pfCandType_; }
l1t::PFCandidate::ParticleType pfCandType_

Member Data Documentation

◆ debug_

bool L1HPSPFTauQualityCut::debug_
private

Definition at line 35 of file L1HPSPFTauQualityCut.h.

◆ dzCut_

int L1HPSPFTauQualityCut::dzCut_
private

Definition at line 30 of file L1HPSPFTauQualityCut.h.

Referenced by dzCut(), L1HPSPFTauQualityCut(), and operator()().

◆ maxDz_

float_t L1HPSPFTauQualityCut::maxDz_
private

Definition at line 33 of file L1HPSPFTauQualityCut.h.

Referenced by L1HPSPFTauQualityCut(), maxDz(), and operator()().

◆ minPt_

float_t L1HPSPFTauQualityCut::minPt_
private

Definition at line 32 of file L1HPSPFTauQualityCut.h.

Referenced by L1HPSPFTauQualityCut(), minPt(), and operator()().

◆ pfCandType_

l1t::PFCandidate::ParticleType L1HPSPFTauQualityCut::pfCandType_
private

Definition at line 28 of file L1HPSPFTauQualityCut.h.

Referenced by L1HPSPFTauQualityCut(), operator()(), and pfCandType().