TopQuarkAnalysis
TopEventSelection
plugins
TtFullHadSignalSelMVAComputer.cc
Go to the documentation of this file.
1
#include "
PhysicsTools/JetMCUtils/interface/combination.h
"
2
3
#include "
TopQuarkAnalysis/TopEventSelection/plugins/TtFullHadSignalSelMVAComputer.h
"
4
#include "
TopQuarkAnalysis/TopEventSelection/interface/TtFullHadSignalSelEval.h
"
5
6
#include "
DataFormats/RecoCandidate/interface/RecoCandidate.h
"
7
8
#include "
DataFormats/Common/interface/TriggerResults.h
"
9
#include "
FWCore/Framework/interface/TriggerNamesService.h
"
10
#include "
FWCore/ServiceRegistry/interface/Service.h
"
11
#include "
DataFormats/PatCandidates/interface/Flags.h
"
12
13
TtFullHadSignalSelMVAComputer::TtFullHadSignalSelMVAComputer
(
const
edm::ParameterSet
&
cfg
)
14
: jetsToken_(consumes<
std
::
vector
<
pat
::
Jet
> >(
cfg
.getParameter<
edm
::
InputTag
>(
"jets"
))) {
15
produces<double>(
"DiscSel"
);
16
}
17
18
TtFullHadSignalSelMVAComputer::~TtFullHadSignalSelMVAComputer
() {}
19
20
void
TtFullHadSignalSelMVAComputer::produce
(
edm::Event
& evt,
const
edm::EventSetup
&
setup
) {
21
std::unique_ptr<double> pOutDisc(
new
double
);
22
23
mvaComputer
.
update
<
TtFullHadSignalSelMVARcd
>(
setup
,
"ttFullHadSignalSelMVA"
);
24
25
// read name of the last processor in the MVA calibration
26
// (to be used as meta information)
27
edm::ESHandle<PhysicsTools::Calibration::MVAComputerContainer>
calibContainer;
28
setup
.get<
TtFullHadSignalSelMVARcd
>().
get
(calibContainer);
29
std::vector<PhysicsTools::Calibration::VarProcessor*> processors =
30
(calibContainer->find(
"ttFullHadSignalSelMVA"
)).getProcessors();
31
32
edm::Handle<std::vector<pat::Jet>
>
jets
;
33
evt.
getByToken
(
jetsToken_
,
jets
);
34
35
//calculation of InputVariables
36
//see TopQuarkAnalysis/TopTools/interface/TtFullHadSignalSel.h
37
// /src/TtFullHadSignalSel.cc
38
//all objects, jets, which are needed for the calculation
39
//of the input-variables have to be passed to this class
40
TtFullHadSignalSel
selection
(*
jets
);
41
42
double
discrim =
evaluateTtFullHadSignalSel
(
mvaComputer
,
selection
);
43
44
*pOutDisc = discrim;
45
46
evt.
put
(
std::move
(pOutDisc),
"DiscSel"
);
47
48
DiscSel
= discrim;
49
}
50
51
void
TtFullHadSignalSelMVAComputer::beginJob
() {}
52
53
void
TtFullHadSignalSelMVAComputer::endJob
() {}
54
55
// implement the plugins for the computer container
56
// -> register TtFullHadSignalSelMVARcd
57
// -> define TtFullHadSignalSelMVAFileSource
58
MVA_COMPUTER_CONTAINER_IMPLEMENT
(TtFullHadSignalSelMVA);
TtFullHadSignalSelMVAComputer.h
TriggerResults.h
TriggerNamesService.h
edm
HLT enums.
Definition:
AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition:
HLT_FULL_cff.py:89287
singleTopDQM_cfi.jets
jets
Definition:
singleTopDQM_cfi.py:42
edm::Handle
Definition:
AssociativeIterator.h:50
RecoCandidate.h
singleTopDQM_cfi.setup
setup
Definition:
singleTopDQM_cfi.py:37
TtFullHadSignalSelMVAComputer::endJob
void endJob() override
Definition:
TtFullHadSignalSelMVAComputer.cc:53
TtFullHadSignalSel
Definition:
TtFullHadSignalSel.h:10
TtFullHadSignalSelMVARcd
Definition:
TtFullHadSignalSelMVAComputer.h:15
Jet
Definition:
Jet.py:1
Service.h
corrVsCorr.selection
selection
main part
Definition:
corrVsCorr.py:100
edm::ESHandle
Definition:
DTSurvey.h:22
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition:
Event.h:531
TtFullHadSignalSelMVAComputer::DiscSel
double DiscSel
Definition:
TtFullHadSignalSelMVAComputer.h:32
TtFullHadSignalSelMVAComputer::beginJob
void beginJob() override
Definition:
TtFullHadSignalSelMVAComputer.cc:51
evaluateTtFullHadSignalSel
double evaluateTtFullHadSignalSel(PhysicsTools::MVAComputerCache &mvaComputer, const TtFullHadSignalSel &sigsel, double weight=1.0, const bool isSignal=false)
Definition:
TtFullHadSignalSelEval.h:13
TtFullHadSignalSelMVAComputer::~TtFullHadSignalSelMVAComputer
~TtFullHadSignalSelMVAComputer() override
Definition:
TtFullHadSignalSelMVAComputer.cc:18
edm::ParameterSet
Definition:
ParameterSet.h:47
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition:
Event.h:133
trackerHitRTTI::vector
Definition:
trackerHitRTTI.h:21
TtFullHadSignalSelMVAComputer::TtFullHadSignalSelMVAComputer
TtFullHadSignalSelMVAComputer(const edm::ParameterSet &)
Definition:
TtFullHadSignalSelMVAComputer.cc:13
edm::EventSetup
Definition:
EventSetup.h:57
pat
Definition:
HeavyIon.h:7
get
#define get
TtFullHadSignalSelMVAComputer::jetsToken_
edm::EDGetTokenT< std::vector< pat::Jet > > jetsToken_
Definition:
TtFullHadSignalSelMVAComputer.h:28
TtFullHadSignalSelMVAComputer::mvaComputer
PhysicsTools::MVAComputerCache mvaComputer
Definition:
TtFullHadSignalSelMVAComputer.h:30
looper.cfg
cfg
Definition:
looper.py:297
eostools.move
def move(src, dest)
Definition:
eostools.py:511
std
Definition:
JetResolutionObject.h:76
PhysicsTools::MVAComputerCache::update
bool update(const Calibration::MVAComputer *computer)
Definition:
MVAComputerCache.cc:15
MVA_COMPUTER_CONTAINER_IMPLEMENT
#define MVA_COMPUTER_CONTAINER_IMPLEMENT(N)
Definition:
HelperMacros.h:53
Flags.h
TtFullHadSignalSelMVAComputer::produce
void produce(edm::Event &evt, const edm::EventSetup &setup) override
Definition:
TtFullHadSignalSelMVAComputer.cc:20
edm::Event
Definition:
Event.h:73
TtFullHadSignalSelEval.h
combination.h
Generated for CMSSW Reference Manual by
1.8.16