1 |
peiffer |
1.1 |
#ifndef NtupleWriter_h
|
2 |
|
|
#define NtupleWriter_h
|
3 |
|
|
|
4 |
|
|
// system include files
|
5 |
|
|
#include <memory>
|
6 |
|
|
|
7 |
|
|
// user include files
|
8 |
|
|
|
9 |
|
|
#include "FWCore/Framework/interface/ESHandle.h"
|
10 |
|
|
#include "FWCore/Utilities/interface/InputTag.h"
|
11 |
|
|
#include "DataFormats/Common/interface/Handle.h"
|
12 |
|
|
|
13 |
|
|
#include "FWCore/Framework/interface/Frameworkfwd.h"
|
14 |
|
|
#include "FWCore/Framework/interface/EDAnalyzer.h"
|
15 |
|
|
|
16 |
|
|
#include "FWCore/Framework/interface/Event.h"
|
17 |
|
|
#include "FWCore/Framework/interface/MakerMacros.h"
|
18 |
|
|
|
19 |
|
|
#include "FWCore/ParameterSet/interface/ParameterSet.h"
|
20 |
|
|
#include "FWCore/ServiceRegistry/interface/Service.h"
|
21 |
|
|
#include "CommonTools/UtilAlgos/interface/TFileService.h"
|
22 |
|
|
#include "DataFormats/HepMCCandidate/interface/GenParticle.h"
|
23 |
|
|
#include "DataFormats/HepMCCandidate/interface/GenParticleFwd.h"
|
24 |
|
|
#include "TTree.h"
|
25 |
|
|
#include "TMath.h"
|
26 |
|
|
#include "TLorentzVector.h"
|
27 |
|
|
|
28 |
|
|
#include "DataFormats/PatCandidates/interface/Electron.h"
|
29 |
|
|
#include "DataFormats/PatCandidates/interface/Muon.h"
|
30 |
|
|
#include "DataFormats/PatCandidates/interface/Tau.h"
|
31 |
|
|
#include "DataFormats/PatCandidates/interface/Jet.h"
|
32 |
|
|
#include "DataFormats/PatCandidates/interface/Photon.h"
|
33 |
|
|
#include "DataFormats/PatCandidates/interface/MET.h"
|
34 |
|
|
#include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h"
|
35 |
|
|
#include "SimDataFormats/GeneratorProducts/interface/PdfInfo.h"
|
36 |
|
|
#include "SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h"
|
37 |
|
|
#include "DataFormats/Common/interface/TriggerResults.h"
|
38 |
|
|
#include "FWCore/Framework/interface/TriggerNamesService.h"
|
39 |
|
|
#include "DataFormats/HLTReco/interface/TriggerEvent.h"
|
40 |
|
|
#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"
|
41 |
peiffer |
1.5 |
#include "JetMETCorrections/Objects/interface/JetCorrectionsRecord.h"
|
42 |
|
|
#include "CondFormats/JetMETObjects/interface/JetCorrectionUncertainty.h"
|
43 |
|
|
#include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h"
|
44 |
peiffer |
1.7 |
#include "RecoEgamma/EgammaTools/interface/ConversionTools.h"
|
45 |
|
|
#include "DataFormats/Luminosity/interface/LumiSummary.h"
|
46 |
peiffer |
1.1 |
|
47 |
peiffer |
1.2 |
#include "UHHAnalysis/NtupleWriter/interface/Objects.h"
|
48 |
peiffer |
1.5 |
|
49 |
peiffer |
1.1 |
//
|
50 |
|
|
// class declaration
|
51 |
|
|
//
|
52 |
|
|
|
53 |
|
|
|
54 |
|
|
|
55 |
|
|
//allow Nmax different electron, muon, jet collections
|
56 |
|
|
const int Nmax=12;
|
57 |
|
|
|
58 |
|
|
class NtupleWriter : public edm::EDAnalyzer {
|
59 |
|
|
public:
|
60 |
|
|
explicit NtupleWriter(const edm::ParameterSet&);
|
61 |
|
|
~NtupleWriter();
|
62 |
|
|
|
63 |
|
|
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
|
64 |
|
|
|
65 |
|
|
|
66 |
|
|
private:
|
67 |
|
|
virtual void beginJob() ;
|
68 |
|
|
virtual void analyze(const edm::Event&, const edm::EventSetup&);
|
69 |
|
|
virtual void endJob() ;
|
70 |
|
|
|
71 |
|
|
virtual void beginRun(edm::Run const&, edm::EventSetup const&);
|
72 |
|
|
virtual void endRun(edm::Run const&, edm::EventSetup const&);
|
73 |
|
|
virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&);
|
74 |
|
|
virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&);
|
75 |
|
|
|
76 |
|
|
// ----------member data ---------------------------
|
77 |
|
|
TFile *outfile;
|
78 |
|
|
TTree *tr;
|
79 |
|
|
TString fileName;
|
80 |
|
|
|
81 |
|
|
bool doElectrons;
|
82 |
|
|
bool doMuons;
|
83 |
|
|
bool doTaus;
|
84 |
|
|
bool doJets;
|
85 |
|
|
bool doTopJets;
|
86 |
peiffer |
1.9 |
bool doGenTopJets;
|
87 |
peiffer |
1.1 |
bool doMET;
|
88 |
|
|
bool doPhotons;
|
89 |
|
|
bool doGenInfo;
|
90 |
peiffer |
1.8 |
bool doAllGenParticles;
|
91 |
peiffer |
1.7 |
bool doLumiInfo;
|
92 |
peiffer |
1.1 |
bool doPV;
|
93 |
peiffer |
1.6 |
bool doTrigger;
|
94 |
peiffer |
1.1 |
|
95 |
peiffer |
1.12 |
int run;
|
96 |
|
|
int luminosityBlock;
|
97 |
peiffer |
1.1 |
int event;
|
98 |
|
|
bool isRealData;
|
99 |
|
|
bool HBHENoiseFilterResult;
|
100 |
|
|
|
101 |
peiffer |
1.7 |
float intgDelLumi;
|
102 |
|
|
float intgRecLumi;
|
103 |
|
|
float totalDelLumi;
|
104 |
|
|
float totalRecLumi;
|
105 |
|
|
|
106 |
peiffer |
1.1 |
std::vector<std::string> electron_sources;
|
107 |
|
|
std::vector<Electron> eles[Nmax];
|
108 |
|
|
|
109 |
|
|
std::vector<std::string> muon_sources;
|
110 |
|
|
std::vector<Muon> mus[Nmax];
|
111 |
|
|
|
112 |
|
|
std::vector<std::string> tau_sources;
|
113 |
|
|
std::vector<Tau> taus[Nmax];
|
114 |
|
|
double tau_ptmin;
|
115 |
|
|
double tau_etamax;
|
116 |
|
|
|
117 |
|
|
std::vector<std::string> jet_sources;
|
118 |
|
|
std::vector<Jet> jets[Nmax];
|
119 |
|
|
double jet_ptmin;
|
120 |
|
|
double jet_etamax;
|
121 |
|
|
|
122 |
|
|
std::vector<std::string> topjet_sources;
|
123 |
|
|
std::vector<TopJet> topjets[Nmax];
|
124 |
|
|
double topjet_ptmin;
|
125 |
|
|
double topjet_etamax;
|
126 |
|
|
|
127 |
peiffer |
1.9 |
std::vector<std::string> gentopjet_sources;
|
128 |
|
|
std::vector<TopJet> gentopjets[Nmax];
|
129 |
|
|
double gentopjet_ptmin;
|
130 |
|
|
double gentopjet_etamax;
|
131 |
|
|
|
132 |
peiffer |
1.1 |
std::vector<std::string> photon_sources;
|
133 |
|
|
std::vector<Photon> phs[Nmax];
|
134 |
|
|
|
135 |
|
|
std::vector<std::string> met_sources;
|
136 |
|
|
MET met[Nmax];
|
137 |
|
|
|
138 |
|
|
std::vector<std::string> pv_sources;
|
139 |
|
|
std::vector<PrimaryVertex> pvs[Nmax];
|
140 |
|
|
|
141 |
|
|
float beamspot_x0;
|
142 |
|
|
float beamspot_y0;
|
143 |
|
|
float beamspot_z0;
|
144 |
|
|
|
145 |
|
|
GenInfo genInfo;
|
146 |
|
|
std::vector<GenParticle> genps;
|
147 |
|
|
|
148 |
|
|
std::vector<std::string> trigger_prefixes;
|
149 |
|
|
//std::map<std::string, bool> triggerResults;
|
150 |
|
|
std::vector<std::string> triggerNames;
|
151 |
|
|
std::vector<bool> triggerResults;
|
152 |
peiffer |
1.10 |
/* std::vector<int> L1_prescale; */
|
153 |
|
|
/* std::vector<int> HLT_prescale; */
|
154 |
peiffer |
1.1 |
|
155 |
|
|
HLTConfigProvider hlt_cfg;
|
156 |
|
|
bool newrun;
|
157 |
peiffer |
1.7 |
bool previouslumiblockwasfilled;
|
158 |
peiffer |
1.5 |
|
159 |
|
|
JetCorrectionUncertainty *jecUnc;
|
160 |
peiffer |
1.1 |
};
|
161 |
|
|
|
162 |
|
|
|
163 |
|
|
#endif
|