CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
reco::tau::RecoTauChargeCleanerPlugin Class Reference
Inheritance diagram for reco::tau::RecoTauChargeCleanerPlugin:
reco::tau::RecoTauCleanerPlugin reco::tau::RecoTauEventHolderPlugin reco::tau::RecoTauNamedPlugin

Public Member Functions

double operator() (const PFTauRef &tau) const override
 
 RecoTauChargeCleanerPlugin (const edm::ParameterSet &, edm::ConsumesCollector &&iC)
 
 ~RecoTauChargeCleanerPlugin () override
 
- Public Member Functions inherited from reco::tau::RecoTauCleanerPlugin
void beginEvent () override
 
 RecoTauCleanerPlugin (const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
 
 ~RecoTauCleanerPlugin () override
 
- Public Member Functions inherited from reco::tau::RecoTauEventHolderPlugin
edm::Eventevt ()
 
const edm::Eventevt () const
 
const edm::EventSetupevtSetup () const
 
 RecoTauEventHolderPlugin (const edm::ParameterSet &pset)
 
void setup (edm::Event &, const edm::EventSetup &)
 
 ~RecoTauEventHolderPlugin () override
 
- Public Member Functions inherited from reco::tau::RecoTauNamedPlugin
const std::string & name () const
 
 RecoTauNamedPlugin (const edm::ParameterSet &pset)
 
virtual ~RecoTauNamedPlugin ()
 

Private Attributes

int charge_
 
double failResult_
 
std::vector< unsigned > nprongs_
 

Detailed Description

Definition at line 19 of file RecoTauChargeCleanerPlugin.cc.

Constructor & Destructor Documentation

◆ RecoTauChargeCleanerPlugin()

reco::tau::RecoTauChargeCleanerPlugin::RecoTauChargeCleanerPlugin ( const edm::ParameterSet pset,
edm::ConsumesCollector &&  iC 
)
explicit

Definition at line 31 of file RecoTauChargeCleanerPlugin.cc.

33  nprongs_(pset.getParameter<std::vector<unsigned> >("nprongs")),
34  failResult_(pset.getParameter<double>("selectionFailValue")),
35  charge_(pset.getParameter<int>("passForCharge")) {}

◆ ~RecoTauChargeCleanerPlugin()

reco::tau::RecoTauChargeCleanerPlugin::~RecoTauChargeCleanerPlugin ( )
inlineoverride

Definition at line 22 of file RecoTauChargeCleanerPlugin.cc.

22 {}

Member Function Documentation

◆ operator()()

double reco::tau::RecoTauChargeCleanerPlugin::operator() ( const PFTauRef tau) const
overridevirtual

Implements reco::tau::RecoTauCleanerPlugin.

Definition at line 37 of file RecoTauChargeCleanerPlugin.cc.

37  {
38  int charge = 0;
39  unsigned nChargedPFCandidate(0), nTrack(0);
40  for (auto const& tauCand : cand->signalTauChargedHadronCandidates()) {
41  charge += tauCand.charge();
43  nChargedPFCandidate++;
44  else if (tauCand.algoIs(reco::PFRecoTauChargedHadron::kTrack))
45  nTrack++;
46  }
47 
48  for (auto nprong : nprongs_) {
49  if (nChargedPFCandidate + nTrack == nprong)
50  return abs(charge) - charge_;
51  }
52 
53  return failResult_;
54  }

References funct::abs(), ALCARECOTkAlJpsiMuMu_cff::charge, charge_, failResult_, reco::PFRecoTauChargedHadron::kChargedPFCandidate, reco::PFRecoTauChargedHadron::kTrack, and nprongs_.

Member Data Documentation

◆ charge_

int reco::tau::RecoTauChargeCleanerPlugin::charge_
private

Definition at line 28 of file RecoTauChargeCleanerPlugin.cc.

Referenced by operator()().

◆ failResult_

double reco::tau::RecoTauChargeCleanerPlugin::failResult_
private

Definition at line 27 of file RecoTauChargeCleanerPlugin.cc.

Referenced by operator()().

◆ nprongs_

std::vector<unsigned> reco::tau::RecoTauChargeCleanerPlugin::nprongs_
private

Definition at line 26 of file RecoTauChargeCleanerPlugin.cc.

Referenced by operator()().

reco::tau::RecoTauChargeCleanerPlugin::nprongs_
std::vector< unsigned > nprongs_
Definition: RecoTauChargeCleanerPlugin.cc:26
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
reco::tau::RecoTauChargeCleanerPlugin::failResult_
double failResult_
Definition: RecoTauChargeCleanerPlugin.cc:27
reco::PFRecoTauChargedHadron::kChargedPFCandidate
Definition: PFRecoTauChargedHadron.h:30
cand
Definition: decayParser.h:34
reco::tau::RecoTauCleanerPlugin::RecoTauCleanerPlugin
RecoTauCleanerPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
Definition: RecoTauBuilderPlugins.h:118
eostools.move
def move(src, dest)
Definition: eostools.py:511
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
reco::tau::RecoTauChargeCleanerPlugin::charge_
int charge_
Definition: RecoTauChargeCleanerPlugin.cc:28
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
reco::PFRecoTauChargedHadron::kTrack
Definition: PFRecoTauChargedHadron.h:31