src
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
pat::MET
Analysis-level MET class.
Definition:
MET.h:40
pat::Photon
Analysis-level Photon class.
Definition:
Photon.h:46
GenericParticle.h
reco::CaloJet
Jets made from CaloTowers.
Definition:
CaloJet.h:27
PFParticle.h
SimTrack.h
TreeBranch::branchName
const std::string branchName() const
Definition:
StringBasedNTupler.h:59
GenEventInfoProduct
Definition:
GenEventInfoProduct.h:17
ANOTHER_CLASS
#define ANOTHER_CLASS(C)
Definition:
StringBasedNTupler.cc:40
reco::GsfElectron
Definition:
GsfElectron.h:36
MET.h
GenParticle.h
TreeBranch::branch
value branch(const edm::Event &iEvent)
Definition:
StringBasedNTupler.cc:44
SimTrack
Definition:
SimTrack.h:9
edm::LogError
Log< level::Error, false > LogError
Definition:
MessageLogger.h:129
l1extra::L1ParticleMap
Definition:
L1ParticleMap.h:117
reco::BasicJet
Jets made from CaloTowers.
Definition:
BasicJet.h:19
reco::HcalNoiseRBX
Definition:
HcalNoiseRBX.h:32
L1ParticleMap.h
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
BeamSpot.h
iEvent
int iEvent
Definition:
GenABIO.cc:224
reco::Vertex
Definition:
Vertex.h:35
pat::TriggerPath
Definition:
TriggerPath.h:37
CaloCluster.h
reco::MET
Definition:
MET.h:41
MET.h
HcalNoiseSummary.h
HcalNoiseSummary
Definition:
HcalNoiseSummary.h:31
reco::GenJet
Jets made from MC generator particles.
Definition:
GenJet.h:23
Tau.h
reco::CaloCluster
Definition:
CaloCluster.h:31
HcalNoiseRBX.h
BasicJet.h
reco::Muon
Definition:
Muon.h:27
StringBasedNTupler.h
TreeBranch::value
std::unique_ptr< std::vector< float > > value
Definition:
StringBasedNTupler.h:66
CaloJet.h
Electron.h
pat::Tau
Analysis-level tau class.
Definition:
Tau.h:53
Hemisphere.h
HepMCProduct.h
Photon.h
pat::Electron
Analysis-level electron class.
Definition:
Electron.h:51
pat::Jet
Analysis-level calorimeter jet class.
Definition:
Jet.h:77
reco::Track
Definition:
Track.h:27
Muon.h
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition:
PFCandidate.h:41
reco::GenParticle
Definition:
GenParticle.h:21
ANOTHER_VECTOR_CLASS
#define ANOTHER_VECTOR_CLASS(C)
Definition:
StringBasedNTupler.cc:37
edm::HepMCProduct
Definition:
HepMCProduct.h:21
Jet.h
TreeBranch::class_
std::string class_
Definition:
StringBasedNTupler.h:74
GenEventInfoProduct.h
edm::Event
Definition:
Event.h:73
TriggerPath.h
pat::Muon
Analysis-level muon class.
Definition:
Muon.h:51
reco::BeamSpot
Definition:
BeamSpot.h:21
GenJet.h
Generated for CMSSW Reference Manual by
1.8.14