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 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")) {}
RecoTauCleanerPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
def move(src, dest)
Definition: eostools.py:511

◆ ~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.

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

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  }
ALPAKA_FN_HOST_ACC ALPAKA_FN_INLINE constexpr float charge(ConstView const &tracks, int32_t i)
Definition: TracksSoA.h:73
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

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