CMS 3D CMS Logo

AnalysisRootpleProducer.h
Go to the documentation of this file.
1 #ifndef AnalysisRootpleProducer_H
2 #define AnalysisRootpleProducer_H
3 
4 #include <iostream>
5 
12 
15 
18 
19 #include <TROOT.h>
20 #include <TTree.h>
21 #include <TFile.h>
22 #include <TLorentzVector.h>
23 #include <TObjString.h>
24 #include <TClonesArray.h>
25 
34 
35 // access trigger results
39 
41 public:
42  //
44  ~AnalysisRootpleProducer() override {} // no need to delete ROOT stuff
45  // as it'll be deleted upon closing TFile
46 
47  void analyze(const edm::Event&, const edm::EventSetup&) override;
48  void beginJob() override;
49  void endJob() override;
50 
51  void fillEventInfo(int);
52  void fillMCParticles(float, float, float, float);
53  void fillTracks(float, float, float, float);
54  void fillInclusiveJet(float, float, float, float);
55  void fillChargedJet(float, float, float, float);
56  void fillTracksJet(float, float, float, float);
57  void fillCaloJet(float, float, float, float);
58  void store();
59 
60 private:
61  bool onlyRECO;
62 
64  edm::EDGetTokenT<reco::GenJetCollection> genJetCollToken; // label of Jet made with MC particles
65  edm::EDGetTokenT<reco::GenJetCollection> chgJetCollToken; // label of Jet made with only charged MC particles
71 
80  // edm::Handle<TriggerFilterObjectWithRefs> hltFilter; // not used at the moment: can access objects that fired the trigger
81 
83 
84  float piG;
85 
86  TTree* AnalysisTree;
87 
88  static const int NMCPMAX = 10000;
89  static const int NTKMAX = 10000;
90  static const int NIJMAX = 10000;
91  static const int NCJMAX = 10000;
92  static const int NTJMAX = 10000;
93  static const int NEHJMAX = 10000;
94 
96 
103 
104  TClonesArray* MonteCarlo;
105  TClonesArray* InclusiveJet;
106  TClonesArray* ChargedJet;
107  TClonesArray* Track;
108  TClonesArray* TracksJet;
109  TClonesArray* CalorimeterJet;
110  TClonesArray* acceptedTriggers;
111 };
112 
113 #endif
AnalysisRootpleProducer::MomentumTJ
float MomentumTJ[NTJMAX]
Definition: AnalysisRootpleProducer.h:101
CaloJetCollection.h
GenJetCollection.h
Handle.h
AnalysisRootpleProducer::CandHandleMC
edm::Handle< std::vector< reco::GenParticle > > CandHandleMC
Definition: AnalysisRootpleProducer.h:73
AnalysisRootpleProducer::fillMCParticles
void fillMCParticles(float, float, float, float)
Definition: AnalysisRootpleProducer.cc:42
AnalysisRootpleProducer
Definition: AnalysisRootpleProducer.h:40
ESHandle.h
TriggerResults.h
AnalysisRootpleProducer::TransverseMomentumTJ
float TransverseMomentumTJ[NTJMAX]
Definition: AnalysisRootpleProducer.h:101
AnalysisRootpleProducer::PhiEHJ
float PhiEHJ[NEHJMAX]
Definition: AnalysisRootpleProducer.h:102
AnalysisRootpleProducer::endJob
void endJob() override
Definition: AnalysisRootpleProducer.cc:365
AnalysisRootpleProducer::EventKind
int EventKind
Definition: AnalysisRootpleProducer.h:95
TriggerEvent.h
edm::EDGetTokenT< edm::HepMCProduct >
AnalysisRootpleProducer::fillInclusiveJet
void fillInclusiveJet(float, float, float, float)
Definition: AnalysisRootpleProducer.cc:58
AnalysisRootpleProducer::EtaMC
float EtaMC[NMCPMAX]
Definition: AnalysisRootpleProducer.h:97
AnalysisRootpleProducer::NumberCaloJet
int NumberCaloJet
Definition: AnalysisRootpleProducer.h:95
AnalysisRootpleProducer::fillChargedJet
void fillChargedJet(float, float, float, float)
Definition: AnalysisRootpleProducer.cc:66
AnalysisRootpleProducer::MomentumEHJ
float MomentumEHJ[NEHJMAX]
Definition: AnalysisRootpleProducer.h:102
AnalysisRootpleProducer::ChargedJet
TClonesArray * ChargedJet
Definition: AnalysisRootpleProducer.h:106
AnalysisRootpleProducer::CalorimeterJet
TClonesArray * CalorimeterJet
Definition: AnalysisRootpleProducer.h:109
AnalysisRootpleProducer::fillTracksJet
void fillTracksJet(float, float, float, float)
Definition: AnalysisRootpleProducer.cc:74
AnalysisRootpleProducer::NTKMAX
static const int NTKMAX
Definition: AnalysisRootpleProducer.h:89
BasicJetCollection.h
Jet.h
TriggerFilterObjectWithRefs.h
AnalysisRootpleProducer::genJetCollToken
edm::EDGetTokenT< reco::GenJetCollection > genJetCollToken
Definition: AnalysisRootpleProducer.h:64
EDAnalyzer.h
AnalysisRootpleProducer::chgJetCollToken
edm::EDGetTokenT< reco::GenJetCollection > chgJetCollToken
Definition: AnalysisRootpleProducer.h:65
AnalysisRootpleProducer::TransverseMomentumCJ
float TransverseMomentumCJ[NCJMAX]
Definition: AnalysisRootpleProducer.h:100
AnalysisRootpleProducer::onlyRECO
bool onlyRECO
Definition: AnalysisRootpleProducer.h:61
edm::Handle< edm::HepMCProduct >
AnalysisRootpleProducer::ChgGenJetsHandle
edm::Handle< reco::GenJetCollection > ChgGenJetsHandle
Definition: AnalysisRootpleProducer.h:75
AnalysisRootpleProducer::NEHJMAX
static const int NEHJMAX
Definition: AnalysisRootpleProducer.h:93
AnalysisRootpleProducer::EtaTK
float EtaTK[NTKMAX]
Definition: AnalysisRootpleProducer.h:98
edm::EDAnalyzer
Definition: EDAnalyzer.h:29
GenParticle.h
AnalysisRootpleProducer::EtaTJ
float EtaTJ[NTJMAX]
Definition: AnalysisRootpleProducer.h:101
AnalysisRootpleProducer::store
void store()
Definition: AnalysisRootpleProducer.cc:29
MakerMacros.h
AnalysisRootpleProducer::TransverseMomentumTK
float TransverseMomentumTK[NTKMAX]
Definition: AnalysisRootpleProducer.h:98
AnalysisRootpleProducer::MomentumMC
float MomentumMC[NMCPMAX]
Definition: AnalysisRootpleProducer.h:97
AnalysisRootpleProducer::PhiTJ
float PhiTJ[NTJMAX]
Definition: AnalysisRootpleProducer.h:101
Service.h
AnalysisRootpleProducer::EtaIJ
float EtaIJ[NIJMAX]
Definition: AnalysisRootpleProducer.h:99
AnalysisRootpleProducer::NumberChargedJet
int NumberChargedJet
Definition: AnalysisRootpleProducer.h:95
AnalysisRootpleProducer::TracksJetsHandle
edm::Handle< reco::BasicJetCollection > TracksJetsHandle
Definition: AnalysisRootpleProducer.h:77
AnalysisRootpleProducer::InclusiveJet
TClonesArray * InclusiveJet
Definition: AnalysisRootpleProducer.h:105
AnalysisRootpleProducer::acceptedTriggers
TClonesArray * acceptedTriggers
Definition: AnalysisRootpleProducer.h:110
TFileService.h
AnalysisRootpleProducer::NumberInclusiveJet
int NumberInclusiveJet
Definition: AnalysisRootpleProducer.h:95
edm::ParameterSet
Definition: ParameterSet.h:36
AnalysisRootpleProducer::PhiCJ
float PhiCJ[NCJMAX]
Definition: AnalysisRootpleProducer.h:100
AnalysisRootpleProducer::CandHandleRECO
edm::Handle< reco::CandidateCollection > CandHandleRECO
Definition: AnalysisRootpleProducer.h:76
AnalysisRootpleProducer::NCJMAX
static const int NCJMAX
Definition: AnalysisRootpleProducer.h:91
Event.h
AnalysisRootpleProducer::TracksJet
TClonesArray * TracksJet
Definition: AnalysisRootpleProducer.h:108
AnalysisRootpleProducer::TransverseMomentumIJ
float TransverseMomentumIJ[NIJMAX]
Definition: AnalysisRootpleProducer.h:99
AnalysisRootpleProducer::fs
edm::Service< TFileService > fs
Definition: AnalysisRootpleProducer.h:82
AnalysisRootpleProducer::triggerResults
edm::Handle< edm::TriggerResults > triggerResults
Definition: AnalysisRootpleProducer.h:79
AnalysisRootpleProducer::GenJetsHandle
edm::Handle< reco::GenJetCollection > GenJetsHandle
Definition: AnalysisRootpleProducer.h:74
edm::Service< TFileService >
AnalysisRootpleProducer::chgGenPartCollToken
edm::EDGetTokenT< std::vector< reco::GenParticle > > chgGenPartCollToken
Definition: AnalysisRootpleProducer.h:66
AnalysisRootpleProducer::NTJMAX
static const int NTJMAX
Definition: AnalysisRootpleProducer.h:92
AnalysisRootpleProducer::AnalysisTree
TTree * AnalysisTree
Definition: AnalysisRootpleProducer.h:86
AnalysisRootpleProducer::MomentumTK
float MomentumTK[NTKMAX]
Definition: AnalysisRootpleProducer.h:98
edm::EventSetup
Definition: EventSetup.h:57
AnalysisRootpleProducer::tracksJetCollToken
edm::EDGetTokenT< reco::BasicJetCollection > tracksJetCollToken
Definition: AnalysisRootpleProducer.h:67
AnalysisRootpleProducer::PhiTK
float PhiTK[NTKMAX]
Definition: AnalysisRootpleProducer.h:98
AnalysisRootpleProducer::mcEventToken
edm::EDGetTokenT< edm::HepMCProduct > mcEventToken
Definition: AnalysisRootpleProducer.h:63
AnalysisRootpleProducer::NMCPMAX
static const int NMCPMAX
Definition: AnalysisRootpleProducer.h:88
AnalysisRootpleProducer::EtaCJ
float EtaCJ[NCJMAX]
Definition: AnalysisRootpleProducer.h:100
AnalysisRootpleProducer::RecoCaloJetsHandle
edm::Handle< reco::CaloJetCollection > RecoCaloJetsHandle
Definition: AnalysisRootpleProducer.h:78
AnalysisRootpleProducer::fillEventInfo
void fillEventInfo(int)
Definition: AnalysisRootpleProducer.cc:40
AnalysisRootpleProducer::PhiMC
float PhiMC[NMCPMAX]
Definition: AnalysisRootpleProducer.h:97
AnalysisRootpleProducer::Track
TClonesArray * Track
Definition: AnalysisRootpleProducer.h:107
AnalysisRootpleProducer::~AnalysisRootpleProducer
~AnalysisRootpleProducer() override
Definition: AnalysisRootpleProducer.h:44
AnalysisRootpleProducer::fillCaloJet
void fillCaloJet(float, float, float, float)
Definition: AnalysisRootpleProducer.cc:82
Frameworkfwd.h
AnalysisRootpleProducer::NumberMCParticles
int NumberMCParticles
Definition: AnalysisRootpleProducer.h:95
AnalysisRootpleProducer::NumberTracks
int NumberTracks
Definition: AnalysisRootpleProducer.h:95
AnalysisRootpleProducer::EtaEHJ
float EtaEHJ[NEHJMAX]
Definition: AnalysisRootpleProducer.h:102
AnalysisRootpleProducer::MomentumIJ
float MomentumIJ[NIJMAX]
Definition: AnalysisRootpleProducer.h:99
AnalysisRootpleProducer::NIJMAX
static const int NIJMAX
Definition: AnalysisRootpleProducer.h:90
AnalysisRootpleProducer::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: AnalysisRootpleProducer.cc:199
AnalysisRootpleProducer::EvtHandle
edm::Handle< edm::HepMCProduct > EvtHandle
Definition: AnalysisRootpleProducer.h:72
AnalysisRootpleProducer::AnalysisRootpleProducer
AnalysisRootpleProducer(const edm::ParameterSet &)
Definition: AnalysisRootpleProducer.cc:90
BasicJet.h
AnalysisRootpleProducer::triggerResultsToken
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken
Definition: AnalysisRootpleProducer.h:70
AnalysisRootpleProducer::beginJob
void beginJob() override
Definition: AnalysisRootpleProducer.cc:123
AnalysisRootpleProducer::MomentumCJ
float MomentumCJ[NCJMAX]
Definition: AnalysisRootpleProducer.h:100
AnalysisRootpleProducer::NumberTracksJet
int NumberTracksJet
Definition: AnalysisRootpleProducer.h:95
AnalysisRootpleProducer::piG
float piG
Definition: AnalysisRootpleProducer.h:84
GenJet.h
Candidate.h
AnalysisRootpleProducer::PhiIJ
float PhiIJ[NIJMAX]
Definition: AnalysisRootpleProducer.h:99
ParameterSet.h
AnalysisRootpleProducer::TransverseMomentumEHJ
float TransverseMomentumEHJ[NEHJMAX]
Definition: AnalysisRootpleProducer.h:102
AnalysisRootpleProducer::TransverseMomentumMC
float TransverseMomentumMC[NMCPMAX]
Definition: AnalysisRootpleProducer.h:97
HepMCProduct.h
AnalysisRootpleProducer::fillTracks
void fillTracks(float, float, float, float)
Definition: AnalysisRootpleProducer.cc:50
edm::Event
Definition: Event.h:73
AnalysisRootpleProducer::recoCaloJetCollToken
edm::EDGetTokenT< reco::CaloJetCollection > recoCaloJetCollToken
Definition: AnalysisRootpleProducer.h:68
AnalysisRootpleProducer::tracksCollToken
edm::EDGetTokenT< reco::CandidateCollection > tracksCollToken
Definition: AnalysisRootpleProducer.h:69
AnalysisRootpleProducer::MonteCarlo
TClonesArray * MonteCarlo
Definition: AnalysisRootpleProducer.h:104