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
Enumerator
kDisabled 
kEnabledPrimary 
kEnabledPileup 

Definition at line 22 of file L1HPSPFTauQualityCut.h.

Constructor & Destructor Documentation

◆ L1HPSPFTauQualityCut()

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

constructor

Definition at line 4 of file L1HPSPFTauQualityCut.cc.

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 }

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.

◆ ~L1HPSPFTauQualityCut()

L1HPSPFTauQualityCut::~L1HPSPFTauQualityCut ( )
default

destructor

Member Function Documentation

◆ dzCut()

int L1HPSPFTauQualityCut::dzCut ( ) const

Definition at line 60 of file L1HPSPFTauQualityCut.cc.

60 { return dzCut_; }

References dzCut_.

◆ maxDz()

float_t L1HPSPFTauQualityCut::maxDz ( ) const

Definition at line 64 of file L1HPSPFTauQualityCut.cc.

64 { return maxDz_; }

References maxDz_.

◆ minPt()

float_t L1HPSPFTauQualityCut::minPt ( ) const

Definition at line 62 of file L1HPSPFTauQualityCut.cc.

62 { return minPt_; }

References 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.

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::fabs(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 }

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

◆ pfCandType()

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

accessor functions

Definition at line 58 of file L1HPSPFTauQualityCut.cc.

58 { return pfCandType_; }

References 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().

l1t::PFCandidate::Photon
Definition: PFCandidate.h:15
l1t::PFCandidate::pfTrack
const PFTrackRef & pfTrack() const
Definition: PFCandidate.h:36
reco::LeafCandidate::pt
double pt() const final
transverse momentum
Definition: LeafCandidate.h:146
l1t::PFCandidate::Electron
Definition: PFCandidate.h:15
edm::Ref< l1t::PFTrackCollection >
L1HPSPFTauQualityCut::maxDz_
float_t maxDz_
Definition: L1HPSPFTauQualityCut.h:33
L1HPSPFTauQualityCut::kEnabledPileup
Definition: L1HPSPFTauQualityCut.h:22
l1t::PFCandidate::ChargedHadron
Definition: PFCandidate.h:15
reco::LeafCandidate::charge
int charge() const final
electric charge
Definition: LeafCandidate.h:106
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
looper.cfg
cfg
Definition: looper.py:296
l1t::PFCandidate::Muon
Definition: PFCandidate.h:15
l1t::PFCandidate::id
ParticleType id() const
Definition: PFCandidate.h:34
PVValHelper::dz
Definition: PVValidationHelpers.h:51
Exception
Definition: hltDiff.cc:245
L1HPSPFTauQualityCut::debug_
bool debug_
Definition: L1HPSPFTauQualityCut.h:35
L1HPSPFTauQualityCut::pfCandType_
l1t::PFCandidate::ParticleType pfCandType_
Definition: L1HPSPFTauQualityCut.h:28
L1HPSPFTauQualityCut::kEnabledPrimary
Definition: L1HPSPFTauQualityCut.h:22
L1HPSPFTauQualityCut::minPt_
float_t minPt_
Definition: L1HPSPFTauQualityCut.h:32
l1t::PFCandidate::NeutralHadron
Definition: PFCandidate.h:15
L1HPSPFTauQualityCut::dzCut_
int dzCut_
Definition: L1HPSPFTauQualityCut.h:30
L1HPSPFTauQualityCut::kDisabled
Definition: L1HPSPFTauQualityCut.h:22