PhysicsTools
PatAlgos
plugins
CaloJetSlimmer.cc
Go to the documentation of this file.
1
2
#include "
FWCore/Framework/interface/stream/EDProducer.h
"
3
#include "
DataFormats/Common/interface/RefVector.h
"
4
5
#include "
CommonTools/UtilAlgos/interface/StringCutObjectSelector.h
"
6
#include "
CommonTools/UtilAlgos/interface/SingleObjectSelector.h
"
7
#include "
CommonTools/UtilAlgos/interface/ObjectSelector.h
"
8
#include "
CommonTools/UtilAlgos/interface/SingleElementCollectionSelector.h
"
9
10
#include "
DataFormats/JetReco/interface/CaloJet.h
"
11
#include "
DataFormats/Candidate/interface/Candidate.h
"
12
13
#include <vector>
14
15
class
CaloJetSlimmer
:
public
edm::stream::EDProducer
<> {
16
public
:
17
CaloJetSlimmer
(
edm::ParameterSet
const
&
params
)
18
:
srcToken_
(consumes<
edm
::
View
<
reco
::
CaloJet
> >(
params
.getParameter<
edm
::
InputTag
>(
"src"
))),
19
cut_
(
params
.getParameter<
std
::
string
>(
"cut"
)),
20
selector_
(
cut_
) {
21
produces<reco::CaloJetCollection>();
22
}
23
24
~CaloJetSlimmer
()
override
{}
25
26
void
produce
(
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup)
override
{
27
auto
caloJets
= std::make_unique<reco::CaloJetCollection>();
28
29
edm::Handle<edm::View<reco::CaloJet>
> h_jets;
30
iEvent
.getByToken(
srcToken_
, h_jets);
31
32
for
(
auto
const
& ijet : *h_jets) {
33
if
(
selector_
(ijet)) {
34
reco::CaloJet::Specific
tmp_specific;
35
const
reco::Candidate::Point
orivtx(0, 0, 0);
36
tmp_specific.
mEnergyFractionEm
= ijet.emEnergyFraction();
37
tmp_specific.
mEnergyFractionHadronic
= ijet.energyFractionHadronic();
38
reco::CaloJet
newCaloJet(ijet.p4(), orivtx, tmp_specific);
39
float
jetArea = ijet.
jetArea
();
40
newCaloJet.setJetArea(jetArea);
41
caloJets
->push_back(newCaloJet);
42
}
43
}
44
iEvent
.put(
std::move
(
caloJets
),
""
);
45
}
46
47
protected
:
48
const
edm::EDGetTokenT<edm::View<reco::CaloJet>
>
srcToken_
;
49
const
std::string
cut_
;
50
const
StringCutObjectSelector<reco::Jet>
selector_
;
51
};
52
53
#include "
FWCore/Framework/interface/MakerMacros.h
"
54
DEFINE_FWK_MODULE
(
CaloJetSlimmer
);
reco::CaloJet
Jets made from CaloTowers.
Definition:
CaloJet.h:27
ObjectSelector.h
CaloJet.h
StringCutObjectSelector.h
sistrip::View
View
Definition:
ConstantsForView.h:26
CalibrationSummaryClient_cfi.params
params
Definition:
CalibrationSummaryClient_cfi.py:14
CaloJetSlimmer::produce
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
Definition:
CaloJetSlimmer.cc:26
edm::EDGetTokenT
Definition:
EDGetToken.h:33
edm
HLT enums.
Definition:
AlignableModifier.h:19
SingleObjectSelector.h
HLT_FULL_cff.InputTag
InputTag
Definition:
HLT_FULL_cff.py:89285
reco::CaloJet::Specific::mEnergyFractionEm
float mEnergyFractionEm
Em energy fraction.
Definition:
CaloJet.h:68
btagElecInJet_cfi.CaloJet
CaloJet
Definition:
btagElecInJet_cfi.py:4
EDProducer.h
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:45
edm::Handle
Definition:
AssociativeIterator.h:50
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
reco::CaloJet::Specific::mEnergyFractionHadronic
float mEnergyFractionHadronic
Hadronic energy fraction.
Definition:
CaloJet.h:66
CaloJetSlimmer
Definition:
CaloJetSlimmer.cc:15
CaloJetSlimmer::CaloJetSlimmer
CaloJetSlimmer(edm::ParameterSet const ¶ms)
Definition:
CaloJetSlimmer.cc:17
isolatedTracks_cfi.caloJets
caloJets
Definition:
isolatedTracks_cfi.py:33
CaloJetSlimmer::~CaloJetSlimmer
~CaloJetSlimmer() override
Definition:
CaloJetSlimmer.cc:24
CaloJetSlimmer::selector_
const StringCutObjectSelector< reco::Jet > selector_
Definition:
CaloJetSlimmer.cc:50
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
reco::Jet::jetArea
virtual float jetArea() const
get jet area
Definition:
Jet.h:103
SingleElementCollectionSelector.h
edm::ParameterSet
Definition:
ParameterSet.h:47
RefVector.h
iEvent
int iEvent
Definition:
GenABIO.cc:224
edm::stream::EDProducer
Definition:
EDProducer.h:38
CaloJetSlimmer::srcToken_
const edm::EDGetTokenT< edm::View< reco::CaloJet > > srcToken_
Definition:
CaloJetSlimmer.cc:48
edm::EventSetup
Definition:
EventSetup.h:58
eostools.move
def move(src, dest)
Definition:
eostools.py:511
std
Definition:
JetResolutionObject.h:76
StringCutObjectSelector< reco::Jet >
CaloJetSlimmer::cut_
const std::string cut_
Definition:
CaloJetSlimmer.cc:49
Candidate.h
reco::Candidate::Point
math::XYZPoint Point
point in the space
Definition:
Candidate.h:40
reco::CaloJet::Specific
Definition:
CaloJet.h:32
edm::Event
Definition:
Event.h:73
Generated for CMSSW Reference Manual by
1.8.16