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
//--------------------------------------------------------------------------------
34
//just define here a list of objects you would like to be able to have a branch of
35
//--------------------------------------------------------------------------------
36
#define ANOTHER_VECTOR_CLASS(C) if (class_==#C) return StringBranchHelper<C>(*this, iEvent)()
37
#define ANOTHER_CLASS(C) if (class_==#C) return StringLeaveHelper<C>(*this, iEvent)()
38
39
TreeBranch::value
TreeBranch::branch
(
const
edm::Event
&
iEvent
){
40
ANOTHER_VECTOR_CLASS
(
pat::Jet
);
41
else
ANOTHER_VECTOR_CLASS
(
pat::Muon
);
42
else
ANOTHER_VECTOR_CLASS
(
reco::GenParticle
);
43
else
ANOTHER_VECTOR_CLASS
(
pat::Electron
);
44
else
ANOTHER_VECTOR_CLASS
(
pat::MET
);
45
else
ANOTHER_VECTOR_CLASS
(
pat::Tau
);
46
else
ANOTHER_VECTOR_CLASS
(
pat::Hemisphere
);
47
else
ANOTHER_VECTOR_CLASS
(
pat::Photon
);
48
else
ANOTHER_VECTOR_CLASS
(
reco::Muon
);
49
else
ANOTHER_VECTOR_CLASS
(
reco::Track
);
50
else
ANOTHER_VECTOR_CLASS
(
reco::GsfElectron
);
51
else
ANOTHER_VECTOR_CLASS
(
SimTrack
);
52
else
ANOTHER_VECTOR_CLASS
(
l1extra::L1ParticleMap
);
53
else
ANOTHER_VECTOR_CLASS
(
reco::Vertex
);
54
else
ANOTHER_VECTOR_CLASS
(
pat::GenericParticle
);
55
else
ANOTHER_VECTOR_CLASS
(
reco::MET
);
56
else
ANOTHER_CLASS
(
edm::HepMCProduct
);
57
else
ANOTHER_CLASS
(
reco::BeamSpot
);
58
else
ANOTHER_CLASS
(
HcalNoiseSummary
);
59
else
ANOTHER_CLASS
(
GenEventInfoProduct
);
60
else
ANOTHER_VECTOR_CLASS
(
reco::HcalNoiseRBX
);
61
else
ANOTHER_VECTOR_CLASS
(
reco::BasicJet
);
62
else
ANOTHER_VECTOR_CLASS
(
reco::CaloJet
);
63
else
ANOTHER_VECTOR_CLASS
(
reco::GenJet
);
64
else
ANOTHER_VECTOR_CLASS
(
pat::TriggerPath
);
65
else
ANOTHER_VECTOR_CLASS
(
reco::PFCandidate
);
66
else
ANOTHER_VECTOR_CLASS
(
reco::CaloCluster
);
67
else
{
68
edm::LogError
(
"TreeBranch"
)<<
branchName
()<<
" failed to recognized class type: "
<<
class_
;
69
return
TreeBranch::value
(
new
std::vector<float>());
70
}
71
}
72
#undef ANOTHER_CLASS
pat::MET
Analysis-level MET class.
Definition:
MET.h:43
pat::Photon
Analysis-level Photon class.
Definition:
Photon.h:47
GenericParticle.h
reco::CaloJet
Jets made from CaloTowers.
Definition:
CaloJet.h:29
PFParticle.h
SimTrack.h
GenEventInfoProduct
Definition:
GenEventInfoProduct.h:15
TreeBranch::branchName
const std::string branchName() const
Definition:
StringBasedNTupler.h:65
ANOTHER_CLASS
#define ANOTHER_CLASS(C)
Definition:
StringBasedNTupler.cc:37
reco::GsfElectron
Definition:
GsfElectron.h:37
MET.h
GenParticle.h
TreeBranch::branch
value branch(const edm::Event &iEvent)
Definition:
StringBasedNTupler.cc:39
SimTrack
Definition:
SimTrack.h:6
l1extra::L1ParticleMap
Definition:
L1ParticleMap.h:117
reco::BasicJet
Jets made from CaloTowers.
Definition:
BasicJet.h:20
reco::HcalNoiseRBX
Definition:
HcalNoiseRBX.h:35
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:40
edm::LogError
Definition:
MessageLogger.h:174
iEvent
int iEvent
Definition:
GenABIO.cc:230
reco::Vertex
Definition:
Vertex.h:34
pat::TriggerPath
Analysis-level HLTrigger path class.
Definition:
TriggerPath.h:39
CaloCluster.h
reco::MET
Definition:
MET.h:42
MET.h
HcalNoiseSummary.h
HcalNoiseSummary
Definition:
HcalNoiseSummary.h:31
reco::GenJet
Jets made from MC generator particles.
Definition:
GenJet.h:24
Tau.h
reco::CaloCluster
Definition:
CaloCluster.h:32
HcalNoiseRBX.h
BasicJet.h
reco::Muon
Definition:
Muon.h:27
StringBasedNTupler.h
TreeBranch::value
std::unique_ptr< std::vector< float > > value
Definition:
StringBasedNTupler.h:71
Electron.h
pat::Tau
Analysis-level tau class.
Definition:
Tau.h:55
Hemisphere.h
HepMCProduct.h
Photon.h
pat::Electron
Analysis-level electron class.
Definition:
Electron.h:52
pat::Jet
Analysis-level calorimeter jet class.
Definition:
Jet.h:80
reco::Track
Definition:
Track.h:28
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:36
edm::HepMCProduct
Definition:
HepMCProduct.h:18
BeamSpot.h
Jet.h
TreeBranch::class_
std::string class_
Definition:
StringBasedNTupler.h:78
GenEventInfoProduct.h
CaloJet.h
edm::Event
Definition:
Event.h:70
TriggerPath.h
pat::Muon
Analysis-level muon class.
Definition:
Muon.h:50
reco::BeamSpot
Definition:
BeamSpot.h:22
GenJet.h
Generated for CMSSW Reference Manual by
1.8.11