Main Page
Namespaces
Classes
Package Documentation
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
//--------------------------------------------------------------------------------
33
//just define here a list of objects you would like to be able to have a branch of
34
//--------------------------------------------------------------------------------
35
#define ANOTHER_VECTOR_CLASS(C) \
36
if (class_ == #C) \
37
return StringBranchHelper<C>(*this, iEvent)()
38
#define ANOTHER_CLASS(C) \
39
if (class_ == #C) \
40
return StringLeaveHelper<C>(*this, iEvent)()
41
42
TreeBranch::value
TreeBranch::branch
(
const
edm::Event
&
iEvent
) {
43
ANOTHER_VECTOR_CLASS
(
pat::Jet
);
44
else
ANOTHER_VECTOR_CLASS
(
pat::Muon
);
45
else
ANOTHER_VECTOR_CLASS
(
reco::GenParticle
);
46
else
ANOTHER_VECTOR_CLASS
(
pat::Electron
);
47
else
ANOTHER_VECTOR_CLASS
(
pat::MET
);
48
else
ANOTHER_VECTOR_CLASS
(
pat::Tau
);
49
else
ANOTHER_VECTOR_CLASS
(
pat::Hemisphere
);
50
else
ANOTHER_VECTOR_CLASS
(
pat::Photon
);
51
else
ANOTHER_VECTOR_CLASS
(
reco::Muon
);
52
else
ANOTHER_VECTOR_CLASS
(
reco::Track
);
53
else
ANOTHER_VECTOR_CLASS
(
reco::GsfElectron
);
54
else
ANOTHER_VECTOR_CLASS
(
SimTrack
);
55
else
ANOTHER_VECTOR_CLASS
(
l1extra::L1ParticleMap
);
56
else
ANOTHER_VECTOR_CLASS
(
reco::Vertex
);
57
else
ANOTHER_VECTOR_CLASS
(
pat::GenericParticle
);
58
else
ANOTHER_VECTOR_CLASS
(
reco::MET
);
59
else
ANOTHER_CLASS
(
edm::HepMCProduct
);
60
else
ANOTHER_CLASS
(
reco::BeamSpot
);
61
else
ANOTHER_CLASS
(
HcalNoiseSummary
);
62
else
ANOTHER_CLASS
(
GenEventInfoProduct
);
63
else
ANOTHER_VECTOR_CLASS
(
reco::HcalNoiseRBX
);
64
else
ANOTHER_VECTOR_CLASS
(
reco::BasicJet
);
65
else
ANOTHER_VECTOR_CLASS
(
reco::CaloJet
);
66
else
ANOTHER_VECTOR_CLASS
(
reco::GenJet
);
67
else
ANOTHER_VECTOR_CLASS
(
pat::TriggerPath
);
68
else
ANOTHER_VECTOR_CLASS
(
reco::PFCandidate
);
69
else
ANOTHER_VECTOR_CLASS
(
reco::CaloCluster
);
70
else
{
71
edm::LogError
(
"TreeBranch"
) <<
branchName
() <<
" failed to recognized class type: "
<<
class_
;
72
return
TreeBranch::value
(
new
std::vector<float>());
73
}
74
}
75
#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
GenEventInfoProduct
Definition:
GenEventInfoProduct.h:15
TreeBranch::branchName
const std::string branchName() const
Definition:
StringBasedNTupler.h:67
ANOTHER_CLASS
#define ANOTHER_CLASS(C)
Definition:
StringBasedNTupler.cc:38
reco::GsfElectron
Definition:
GsfElectron.h:36
MET.h
GenParticle.h
TreeBranch::branch
value branch(const edm::Event &iEvent)
Definition:
StringBasedNTupler.cc:42
SimTrack
Definition:
SimTrack.h:6
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
edm::LogError
Definition:
MessageLogger.h:183
iEvent
int iEvent
Definition:
GenABIO.cc:224
reco::Vertex
Definition:
Vertex.h:34
pat::TriggerPath
Analysis-level HLTrigger path class.
Definition:
TriggerPath.h:36
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:74
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:40
reco::GenParticle
Definition:
GenParticle.h:21
ANOTHER_VECTOR_CLASS
#define ANOTHER_VECTOR_CLASS(C)
Definition:
StringBasedNTupler.cc:35
edm::HepMCProduct
Definition:
HepMCProduct.h:18
BeamSpot.h
Jet.h
TreeBranch::class_
std::string class_
Definition:
StringBasedNTupler.h:82
GenEventInfoProduct.h
CaloJet.h
edm::Event
Definition:
Event.h:72
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.11