RecoJets
JetAnalyzers
src
SimpleJetDump.cc
Go to the documentation of this file.
1
// SimpleJetDump.cc
2
// Description: Prints out Jets, consituent CaloTowers, constituent RecHits and associated Digis (the digis for HCAL only).
3
// The user can specify which level in the config file:
4
// DumpLevel="Jets": Printout of jets and their kinematic quantities.
5
// DumpLevel="Towers": Nested Printout of jets and their constituent CaloTowers
6
// DumpLevel="RecHits": Nested Printout of jets, constituent CaloTowers and constituent RecHits
7
// DumpLevel="Digis": Nested Printout of jets, constituent CaloTowers, RecHits and all the HCAL digis
8
// associated with the RecHit channel (no links exist to go back to actual digis used).
9
// Does simple sanity checks on energy sums at each level: jets=sum of towers, tower=sum of RecHits.
10
// Does quick and dirty estimate of the fC/GeV factor that was applied to make the RecHit from the Digis.
11
//
12
// Author: Robert M. Harris
13
// Date: 19 - October - 2006
14
//
15
#include "
RecoJets/JetAnalyzers/interface/SimpleJetDump.h
"
16
#include "
RecoJets/JetAnalyzers/interface/JetPlotsExample.h
"
17
#include "
DataFormats/JetReco/interface/CaloJetCollection.h
"
18
#include "
DataFormats/JetReco/interface/CaloJet.h
"
19
#include "
DataFormats/JetReco/interface/GenJet.h
"
20
#include "
FWCore/Framework/interface/Event.h
"
21
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
22
using namespace
edm
;
23
using namespace
reco
;
24
using namespace
std
;
25
26
SimpleJetDump::SimpleJetDump
(
const
ParameterSet
&
cfg
)
27
: CaloJetAlg(
cfg
.getParameter<
string
>(
"CaloJetAlg"
)), GenJetAlg(
cfg
.getParameter<
string
>(
"GenJetAlg"
)) {}
28
29
void
SimpleJetDump::beginJob
() {
evtCount
= 0; }
30
31
void
SimpleJetDump::analyze
(
const
Event
& evt,
const
EventSetup
& es) {
32
int
jetInd;
33
Handle<CaloJetCollection>
caloJets
;
34
Handle<GenJetCollection>
genJets
;
35
36
//Find the CaloTowers in leading CaloJets
37
evt.
getByLabel
(
CaloJetAlg
,
caloJets
);
38
evt.
getByLabel
(
GenJetAlg
,
genJets
);
39
40
cout
<< endl
41
<<
"Evt: "
<<
evtCount
<<
", Num Calo Jets="
<<
caloJets
->end() -
caloJets
->begin()
42
<<
", Num Gen Jets="
<<
genJets
->end() -
genJets
->begin() << endl;
43
cout
<<
" *********************************************************"
<< endl;
44
jetInd = 0;
45
for
(CaloJetCollection::const_iterator
jet
=
caloJets
->begin();
jet
!=
caloJets
->end(); ++
jet
) {
46
cout
<<
"Calo Jet: "
<< jetInd <<
", pt="
<<
jet
->pt() <<
", eta="
<<
jet
->eta() <<
", phi="
<<
jet
->phi() << endl;
47
jetInd++;
48
}
49
cout
<<
" *********************************************************"
<< endl;
50
jetInd = 0;
51
for
(GenJetCollection::const_iterator
jet
=
genJets
->begin();
jet
!=
genJets
->end(); ++
jet
) {
52
cout
<<
"Gen Jet: "
<< jetInd <<
", pt="
<<
jet
->pt() <<
", eta="
<<
jet
->eta() <<
", phi="
<<
jet
->phi() << endl;
53
jetInd++;
54
}
55
evtCount
++;
56
cout
<<
" *********************************************************"
<< endl;
57
}
58
59
void
SimpleJetDump::endJob
() {}
60
#include "
FWCore/Framework/interface/MakerMacros.h
"
61
DEFINE_FWK_MODULE
(
SimpleJetDump
);
SimpleJetDump
Definition:
SimpleJetDump.h:13
CaloJetCollection.h
CaloJet.h
SimpleJetDump::CaloJetAlg
std::string CaloJetAlg
Definition:
SimpleJetDump.h:21
SimpleJetDump::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
SimpleJetDump.cc:31
edm
HLT enums.
Definition:
AlignableModifier.h:19
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:45
edm::Handle
Definition:
AssociativeIterator.h:50
SimpleJetDump::SimpleJetDump
SimpleJetDump(const edm::ParameterSet &)
Definition:
SimpleJetDump.cc:26
MakerMacros.h
JetPlotsExample.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
SimpleJetDump::beginJob
void beginJob() override
Definition:
SimpleJetDump.cc:29
SimpleJetDump::evtCount
int evtCount
Definition:
SimpleJetDump.h:23
isolatedTracks_cfi.caloJets
caloJets
Definition:
isolatedTracks_cfi.py:33
edm::Event::getByLabel
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition:
Event.h:492
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
SimpleJetDump::GenJetAlg
std::string GenJetAlg
Definition:
SimpleJetDump.h:21
edm::ParameterSet
Definition:
ParameterSet.h:47
SimpleJetDump.h
Event.h
ttbarCategorization_cff.genJets
genJets
Definition:
ttbarCategorization_cff.py:29
edm::EventSetup
Definition:
EventSetup.h:57
looper.cfg
cfg
Definition:
looper.py:297
std
Definition:
JetResolutionObject.h:76
metsig::jet
Definition:
SignAlgoResolutions.h:47
GenJet.h
ParameterSet.h
edm::Event
Definition:
Event.h:73
SimpleJetDump::endJob
void endJob() override
Definition:
SimpleJetDump.cc:59
Generated for CMSSW Reference Manual by
1.8.16