Main Page
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
d
e
f
l
m
o
p
s
t
u
v
Related Functions
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Package Documentation
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
PhysicsTools
UtilAlgos
src
StringBasedNTupler.cc
Go to the documentation of this file.
1
#include "
PhysicsTools/UtilAlgos/interface/StringBasedNTupler.h
"
2
3
#include "
DataFormats/PatCandidates/interface/Jet.h
"
4
#include "
DataFormats/PatCandidates/interface/Muon.h
"
5
#include "
DataFormats/PatCandidates/interface/MET.h
"
6
#include "
DataFormats/PatCandidates/interface/Electron.h
"
7
#include "
DataFormats/PatCandidates/interface/Photon.h
"
8
#include "
DataFormats/PatCandidates/interface/Tau.h
"
9
#include "
DataFormats/PatCandidates/interface/Hemisphere.h
"
10
#include "
DataFormats/PatCandidates/interface/GenericParticle.h
"
11
12
#include "
DataFormats/BeamSpot/interface/BeamSpot.h
"
13
#include "
SimDataFormats/Track/interface/SimTrack.h
"
14
#include "
DataFormats/HepMCCandidate/interface/GenParticle.h
"
15
#include "
DataFormats/L1Trigger/interface/L1ParticleMap.h
"
16
#include "
DataFormats/METReco/interface/MET.h
"
17
#include "
SimDataFormats/GeneratorProducts/interface/HepMCProduct.h
"
18
19
#include "
DataFormats/METReco/interface/HcalNoiseSummary.h
"
20
#include "
DataFormats/METReco/interface/HcalNoiseRBX.h
"
21
22
#include "
DataFormats/JetReco/interface/BasicJet.h
"
23
#include "
DataFormats/JetReco/interface/CaloJet.h
"
24
#include "
DataFormats/JetReco/interface/GenJet.h
"
25
#include <
DataFormats/CaloRecHit/interface/CaloCluster.h
>
26
27
#include <
DataFormats/PatCandidates/interface/TriggerPath.h
>
28
29
#include <
DataFormats/PatCandidates/interface/PFParticle.h
>
30
#include <
SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h
>
31
32
#include <memory>
33
34
//--------------------------------------------------------------------------------
35
//just define here a list of objects you would like to be able to have a branch of
36
//--------------------------------------------------------------------------------
37
#define ANOTHER_VECTOR_CLASS(C) \
38
if (class_ == #C) \
39
return StringBranchHelper<C>(*this, iEvent)()
40
#define ANOTHER_CLASS(C) \
41
if (class_ == #C) \
42
return StringLeaveHelper<C>(*this, iEvent)()
43
44
TreeBranch::value
TreeBranch::branch
(
const
edm::Event
&
iEvent
) {
45
ANOTHER_VECTOR_CLASS
(
pat::Jet
);
46
else
ANOTHER_VECTOR_CLASS
(
pat::Muon
);
47
else
ANOTHER_VECTOR_CLASS
(
reco::GenParticle
);
48
else
ANOTHER_VECTOR_CLASS
(
pat::Electron
);
49
else
ANOTHER_VECTOR_CLASS
(
pat::MET
);
50
else
ANOTHER_VECTOR_CLASS
(
pat::Tau
);
51
else
ANOTHER_VECTOR_CLASS
(
pat::Hemisphere
);
52
else
ANOTHER_VECTOR_CLASS
(
pat::Photon
);
53
else
ANOTHER_VECTOR_CLASS
(
reco::Muon
);
54
else
ANOTHER_VECTOR_CLASS
(
reco::Track
);
55
else
ANOTHER_VECTOR_CLASS
(
reco::GsfElectron
);
56
else
ANOTHER_VECTOR_CLASS
(
SimTrack
);
57
else
ANOTHER_VECTOR_CLASS
(
l1extra::L1ParticleMap
);
58
else
ANOTHER_VECTOR_CLASS
(
reco::Vertex
);
59
else
ANOTHER_VECTOR_CLASS
(
pat::GenericParticle
);
60
else
ANOTHER_VECTOR_CLASS
(
reco::MET
);
61
else
ANOTHER_CLASS
(
edm::HepMCProduct
);
62
else
ANOTHER_CLASS
(
reco::BeamSpot
);
63
else
ANOTHER_CLASS
(
HcalNoiseSummary
);
64
else
ANOTHER_CLASS
(
GenEventInfoProduct
);
65
else
ANOTHER_VECTOR_CLASS
(
reco::HcalNoiseRBX
);
66
else
ANOTHER_VECTOR_CLASS
(
reco::BasicJet
);
67
else
ANOTHER_VECTOR_CLASS
(
reco::CaloJet
);
68
else
ANOTHER_VECTOR_CLASS
(
reco::GenJet
);
69
else
ANOTHER_VECTOR_CLASS
(
pat::TriggerPath
);
70
else
ANOTHER_VECTOR_CLASS
(
reco::PFCandidate
);
71
else
ANOTHER_VECTOR_CLASS
(
reco::CaloCluster
);
72
else
{
73
edm::LogError
(
"TreeBranch"
) <<
branchName
() <<
" failed to recognized class type: "
<<
class_
;
74
return
std::make_unique<std::vector<float>>();
75
}
76
}
77
#undef ANOTHER_CLASS
GenEventInfoProduct
Definition:
GenEventInfoProduct.h:17
HcalNoiseSummary
Definition:
HcalNoiseSummary.h:31
reco::CaloJet
Jets made from CaloTowers.
Definition:
CaloJet.h:27
HcalNoiseSummary.h
CaloJet.h
HcalNoiseRBX.h
reco::GenJet
Jets made from MC generator particles.
Definition:
GenJet.h:23
StringBasedNTupler.h
reco::GenParticle
Definition:
GenParticle.h:21
TreeBranch::class_
std::string class_
Definition:
StringBasedNTupler.h:77
Muon.h
pat::Tau
Analysis-level tau class.
Definition:
Tau.h:53
Photon.h
pat::Photon
Analysis-level Photon class.
Definition:
Photon.h:46
GenericParticle.h
ANOTHER_CLASS
#define ANOTHER_CLASS(C)
Definition:
StringBasedNTupler.cc:40
TreeBranch::value
std::unique_ptr< std::vector< float > > value
Definition:
StringBasedNTupler.h:69
pat::Muon
Analysis-level muon class.
Definition:
Muon.h:51
Tau.h
reco::Muon
Definition:
Muon.h:27
GenParticle.h
reco::BasicJet
Jets made from CaloTowers.
Definition:
BasicJet.h:19
reco::MET
Definition:
MET.h:41
pat::Jet
Analysis-level calorimeter jet class.
Definition:
Jet.h:77
BeamSpot.h
reco::CaloCluster
Definition:
CaloCluster.h:31
reco::BeamSpot
Definition:
BeamSpot.h:21
reco::Track
Definition:
Track.h:27
reco::GsfElectron
Definition:
GsfElectron.h:35
pat::Hemisphere
Definition:
Hemisphere.h:17
pat::GenericParticle
Analysis-level Generic Particle class (e.g. for hadron or muon not fully reconstructed)
Definition:
GenericParticle.h:38
GenEventInfoProduct.h
pat::TriggerPath
Analysis-level HLTrigger path class.
Definition:
TriggerPath.h:36
l1extra::L1ParticleMap
Definition:
L1ParticleMap.h:117
iEvent
int iEvent
Definition:
GenABIO.cc:224
pat::MET
Analysis-level MET class.
Definition:
MET.h:40
L1ParticleMap.h
PFParticle.h
edm::LogError
Log< level::Error, false > LogError
Definition:
MessageLogger.h:123
MET.h
Jet.h
MET.h
TreeBranch::branchName
const std::string branchName() const
Definition:
StringBasedNTupler.h:62
ANOTHER_VECTOR_CLASS
#define ANOTHER_VECTOR_CLASS(C)
Definition:
StringBasedNTupler.cc:37
SimTrack
Definition:
SimTrack.h:6
reco::HcalNoiseRBX
Definition:
HcalNoiseRBX.h:32
BasicJet.h
Electron.h
Hemisphere.h
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition:
PFCandidate.h:41
GenJet.h
pat::Electron
Analysis-level electron class.
Definition:
Electron.h:51
edm::HepMCProduct
Definition:
HepMCProduct.h:18
SimTrack.h
HepMCProduct.h
TreeBranch::branch
value branch(const edm::Event &iEvent)
Definition:
StringBasedNTupler.cc:44
edm::Event
Definition:
Event.h:73
reco::Vertex
Definition:
Vertex.h:35
CaloCluster.h
TriggerPath.h
Generated for CMSSW Reference Manual by
1.8.16