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
const edm::Eventevt () const
 
edm::Eventevt ()
 
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 18 of file RecoTauChargeCleanerPlugin.cc.

Constructor & Destructor Documentation

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

Definition at line 31 of file RecoTauChargeCleanerPlugin.cc.

32  : RecoTauCleanerPlugin(pset,std::move(iC)),
33  nprongs_(pset.getParameter<std::vector<unsigned> >("nprongs")),
34  failResult_(pset.getParameter<double>("selectionFailValue")),
35  charge_(pset.getParameter<int>("passForCharge"))
36 {}
T getParameter(std::string const &) const
RecoTauCleanerPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
def move(src, dest)
Definition: eostools.py:511
reco::tau::RecoTauChargeCleanerPlugin::~RecoTauChargeCleanerPlugin ( )
inlineoverride

Definition at line 22 of file RecoTauChargeCleanerPlugin.cc.

References operator()(), and metsig::tau.

22 {}

Member Function Documentation

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

Implements reco::tau::RecoTauCleanerPlugin.

Definition at line 38 of file RecoTauChargeCleanerPlugin.cc.

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

Referenced by ~RecoTauChargeCleanerPlugin().

39 {
40  int charge = 0;
41  unsigned nChargedPFCandidate(0), nTrack(0);
42  for(auto const& tauCand : cand->signalTauChargedHadronCandidates()){
43  charge += tauCand.charge();
44  if(tauCand.algoIs(reco::PFRecoTauChargedHadron::kChargedPFCandidate)) nChargedPFCandidate++;
45  else if(tauCand.algoIs(reco::PFRecoTauChargedHadron::kTrack)) nTrack++;
46  }
47 
48  for(auto nprong : nprongs_){
49  if(nChargedPFCandidate+nTrack == nprong) return abs(charge)-charge_;
50  }
51 
52  return failResult_;
53 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

Member Data Documentation

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

Definition at line 28 of file RecoTauChargeCleanerPlugin.cc.

Referenced by operator()().

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

Definition at line 27 of file RecoTauChargeCleanerPlugin.cc.

Referenced by operator()().

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

Definition at line 26 of file RecoTauChargeCleanerPlugin.cc.

Referenced by operator()().