CMS 3D CMS Logo

RecoTauChargeCleanerPlugin.cc
Go to the documentation of this file.
1 /*
2  * Original author: Alexander Nehrkorn (RWTH Aachen)
3  *
4  * Description:
5  * This module rejects tau candidates that do not have unit charge.
6  * It takes the fact into account that taus do not necessarily need
7  * to be created from PF charged hadrons only but can be created
8  * from a combination of PF charged hadrons and tracks.
9  *
10  */
11 
15 
16 namespace reco {
17  namespace tau {
18 
20  public:
23  double operator()(const PFTauRef& tau) const override;
24 
25  private:
26  std::vector<unsigned> nprongs_;
27  double failResult_;
28  int charge_;
29  };
30 
33  nprongs_(pset.getParameter<std::vector<unsigned> >("nprongs")),
34  failResult_(pset.getParameter<double>("selectionFailValue")),
35  charge_(pset.getParameter<int>("passForCharge")) {}
36 
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  }
55 
56  } // namespace tau
57 } // namespace reco
58 
60 
PFTauFwd.h
metsig::tau
Definition: SignAlgoResolutions.h:49
reco::tau::RecoTauChargeCleanerPlugin::~RecoTauChargeCleanerPlugin
~RecoTauChargeCleanerPlugin() override
Definition: RecoTauChargeCleanerPlugin.cc:22
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Ref< PFTauCollection >
MakerMacros.h
reco::tau::RecoTauChargeCleanerPlugin::RecoTauChargeCleanerPlugin
RecoTauChargeCleanerPlugin(const edm::ParameterSet &, edm::ConsumesCollector &&iC)
Definition: RecoTauChargeCleanerPlugin.cc:31
reco::tau::RecoTauChargeCleanerPlugin
Definition: RecoTauChargeCleanerPlugin.cc:19
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
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
edm::ParameterSet
Definition: ParameterSet.h:47
edmplugin::PluginFactory
Definition: PluginFactory.h:34
reco::PFRecoTauChargedHadron::kChargedPFCandidate
Definition: PFRecoTauChargedHadron.h:30
cand
Definition: decayParser.h:32
createfilelist.int
int
Definition: createfilelist.py:10
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
RecoTauBuilderPlugins.h
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
reco::tau::RecoTauChargeCleanerPlugin::operator()
double operator()(const PFTauRef &tau) const override
Definition: RecoTauChargeCleanerPlugin.cc:37
PFTau.h
reco::tau::RecoTauCleanerPlugin
Definition: RecoTauBuilderPlugins.h:116
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
reco::tau::RecoTauChargeCleanerPlugin::charge_
int charge_
Definition: RecoTauChargeCleanerPlugin.cc:28
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
reco::PFRecoTauChargedHadron::kTrack
Definition: PFRecoTauChargedHadron.h:31