RecoTauTag
RecoTau
plugins
RecoTauDiscriminantCleanerPlugin.cc
Go to the documentation of this file.
1
/*
2
* RecoTauDiscriminantCleanerPlugin
3
*
4
* Author: Evan K. Friis, UC Davis
5
*
6
* A reco tau cleaner plugin that given a PFTau returns the associated value
7
* stored in a PFTauDiscrimiantor.
8
*/
9
10
#include "
RecoTauTag/RecoTau/interface/RecoTauBuilderPlugins.h
"
11
#include "
DataFormats/TauReco/interface/PFTauDiscriminator.h
"
12
13
namespace
reco
{
14
namespace
tau
{
15
16
class
RecoTauDiscriminantCleanerPlugin
:
public
RecoTauCleanerPlugin
{
17
public
:
18
RecoTauDiscriminantCleanerPlugin
(
const
edm::ParameterSet
&
pset
,
edm::ConsumesCollector
&& iC);
19
~RecoTauDiscriminantCleanerPlugin
()
override
{}
20
21
// Get discriminant value for a given tau Ref
22
double
operator()
(
const
reco::PFTauRef
&)
const override
;
23
// Hook called from base class at the beginning of each event
24
void
beginEvent
()
override
;
25
26
private
:
27
edm::InputTag
discriminatorSrc_
;
28
edm::Handle<PFTauDiscriminator>
discriminator_
;
29
edm::EDGetTokenT<PFTauDiscriminator>
discriminator_token
;
30
};
31
32
RecoTauDiscriminantCleanerPlugin::RecoTauDiscriminantCleanerPlugin
(
const
edm::ParameterSet
&
pset
,
33
edm::ConsumesCollector
&& iC)
34
:
RecoTauCleanerPlugin
(
pset
,
std
::
move
(iC)) {
35
discriminatorSrc_
=
pset
.getParameter<
edm::InputTag
>(
"src"
);
36
discriminator_token
= iC.consumes<
PFTauDiscriminator
>(
discriminatorSrc_
);
37
}
38
39
void
RecoTauDiscriminantCleanerPlugin::beginEvent
() {
40
// Load our handle to the discriminators from the event
41
evt
()->
getByToken
(
discriminator_token
,
discriminator_
);
42
}
43
44
double
RecoTauDiscriminantCleanerPlugin::operator()
(
const
reco::PFTauRef
&
tau
)
const
{
45
// Get the discriminator result for this tau. N.B. result is negated! lower
46
// = more "tau like"! This is opposite to the normal case.
47
double
result
= -(*discriminator_)[
tau
];
48
return
result
;
49
}
50
51
}
// namespace tau
52
}
// namespace reco
53
54
// Register our plugin
55
#include "
FWCore/Framework/interface/MakerMacros.h
"
56
DEFINE_EDM_PLUGIN
(
RecoTauCleanerPluginFactory
,
57
reco::tau::RecoTauDiscriminantCleanerPlugin
,
58
"RecoTauDiscriminantCleanerPlugin"
);
reco::tau::RecoTauDiscriminantCleanerPlugin::beginEvent
void beginEvent() override
Definition:
RecoTauDiscriminantCleanerPlugin.cc:39
reco::tau::RecoTauEventHolderPlugin::evt
const edm::Event * evt() const
Definition:
RecoTauPluginsCommon.cc:16
PFTauDiscriminator.h
metsig::tau
Definition:
SignAlgoResolutions.h:49
edm::EDGetTokenT< PFTauDiscriminator >
reco::PFTauDiscriminator
Definition:
PFTauDiscriminator.h:12
reco::tau::RecoTauDiscriminantCleanerPlugin
Definition:
RecoTauDiscriminantCleanerPlugin.cc:16
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:45
reco::tau::RecoTauDiscriminantCleanerPlugin::discriminator_token
edm::EDGetTokenT< PFTauDiscriminator > discriminator_token
Definition:
RecoTauDiscriminantCleanerPlugin.cc:29
edm::Handle< PFTauDiscriminator >
edm::Ref< PFTauCollection >
MakerMacros.h
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition:
Event.h:528
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition:
PluginFactory.h:124
reco::tau::RecoTauDiscriminantCleanerPlugin::operator()
double operator()(const reco::PFTauRef &) const override
Definition:
RecoTauDiscriminantCleanerPlugin.cc:44
edm::ParameterSet
Definition:
ParameterSet.h:36
reco::tau::RecoTauDiscriminantCleanerPlugin::discriminator_
edm::Handle< PFTauDiscriminator > discriminator_
Definition:
RecoTauDiscriminantCleanerPlugin.cc:28
edmplugin::PluginFactory
Definition:
PluginFactory.h:34
RecoTauBuilderPlugins.h
eostools.move
def move(src, dest)
Definition:
eostools.py:511
std
Definition:
JetResolutionObject.h:76
reco::tau::RecoTauDiscriminantCleanerPlugin::RecoTauDiscriminantCleanerPlugin
RecoTauDiscriminantCleanerPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
Definition:
RecoTauDiscriminantCleanerPlugin.cc:32
reco::tau::RecoTauCleanerPlugin
Definition:
RecoTauBuilderPlugins.h:116
mps_fire.result
result
Definition:
mps_fire.py:303
reco::tau::RecoTauDiscriminantCleanerPlugin::discriminatorSrc_
edm::InputTag discriminatorSrc_
Definition:
RecoTauDiscriminantCleanerPlugin.cc:27
edm::InputTag
Definition:
InputTag.h:15
edm::ConsumesCollector
Definition:
ConsumesCollector.h:39
reco::tau::RecoTauDiscriminantCleanerPlugin::~RecoTauDiscriminantCleanerPlugin
~RecoTauDiscriminantCleanerPlugin() override
Definition:
RecoTauDiscriminantCleanerPlugin.cc:19
muonDTDigis_cfi.pset
pset
Definition:
muonDTDigis_cfi.py:27
Generated for CMSSW Reference Manual by
1.8.16