ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/UHHAnalysis/NtupleWriter/interface/NtupleWriter.h
Revision: 1.17
Committed: Fri Apr 5 13:23:58 2013 UTC (12 years, 1 month ago) by eusai
Content type: text/plain
Branch: MAIN
Changes since 1.16: +2 -1 lines
Log Message:
add tag info

File Contents

# Content
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 #include "JetMETCorrections/Objects/interface/JetCorrectionsRecord.h"
42 #include "CondFormats/JetMETObjects/interface/JetCorrectionUncertainty.h"
43 #include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h"
44 #include "RecoEgamma/EgammaTools/interface/ConversionTools.h"
45 #include "DataFormats/Luminosity/interface/LumiSummary.h"
46
47 #include "EGamma/EGammaAnalysisTools/interface/ElectronEffectiveArea.h"
48
49 #include "UHHAnalysis/NtupleWriter/Objects/Particle.h"
50 #include "UHHAnalysis/NtupleWriter/Objects/Jet.h"
51 #include "UHHAnalysis/NtupleWriter/Objects/Electron.h"
52 #include "UHHAnalysis/NtupleWriter/Objects/Muon.h"
53 #include "UHHAnalysis/NtupleWriter/Objects/Tau.h"
54 #include "UHHAnalysis/NtupleWriter/Objects/Photon.h"
55 #include "UHHAnalysis/NtupleWriter/Objects/MET.h"
56 #include "UHHAnalysis/NtupleWriter/Objects/PrimaryVertex.h"
57 #include "UHHAnalysis/NtupleWriter/Objects/TopJet.h"
58 #include "UHHAnalysis/NtupleWriter/Objects/GenInfo.h"
59 #include "UHHAnalysis/NtupleWriter/Objects/GenParticle.h"
60
61 //
62 // class declaration
63 //
64
65
66
67 //allow Nmax different electron, muon, jet collections
68 const int Nmax=12;
69
70 class NtupleWriter : public edm::EDAnalyzer {
71 public:
72 explicit NtupleWriter(const edm::ParameterSet&);
73 ~NtupleWriter();
74
75 static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
76
77 private:
78 virtual void beginJob() ;
79 virtual void analyze(const edm::Event&, const edm::EventSetup&);
80 virtual void endJob() ;
81
82 virtual void beginRun(edm::Run const&, edm::EventSetup const&);
83 virtual void endRun(edm::Run const&, edm::EventSetup const&);
84 virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&);
85 virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&);
86
87 // ----------member data ---------------------------
88 TFile *outfile;
89 TTree *tr;
90 TString fileName;
91
92 bool doElectrons;
93 bool doMuons;
94 bool doTaus;
95 bool doJets;
96 bool doJECUncertainty;
97 bool doTopJets;
98 bool doGenTopJets;
99 bool doMET;
100 bool doPhotons;
101 bool doGenInfo;
102 bool doAllGenParticles;
103 bool doLumiInfo;
104 bool doPV;
105 bool doTrigger;
106 bool doTagInfos;
107
108 int run;
109 int luminosityBlock;
110 int event;
111 bool isRealData;
112 //bool HBHENoiseFilterResult;
113 float rho;
114
115 float intgDelLumi;
116 float intgRecLumi;
117 float totalDelLumi;
118 float totalRecLumi;
119
120 edm::InputTag rho_source;
121
122 std::vector<std::string> electron_sources;
123 std::vector<Electron> eles[Nmax];
124
125 std::vector<std::string> muon_sources;
126 std::vector<Muon> mus[Nmax];
127
128 std::vector<std::string> tau_sources;
129 std::vector<Tau> taus[Nmax];
130 double tau_ptmin;
131 double tau_etamax;
132
133 std::vector<std::string> jet_sources;
134 std::vector<Jet> jets[Nmax];
135 double jet_ptmin;
136 double jet_etamax;
137
138 std::vector<std::string> topjet_sources;
139 std::vector<TopJet> topjets[Nmax];
140 double topjet_ptmin;
141 double topjet_etamax;
142
143 std::vector<std::string> gentopjet_sources;
144 std::vector<TopJet> gentopjets[Nmax];
145 double gentopjet_ptmin;
146 double gentopjet_etamax;
147
148 std::vector<std::string> photon_sources;
149 std::vector<Photon> phs[Nmax];
150
151 std::vector<std::string> met_sources;
152 MET met[Nmax];
153
154 std::vector<std::string> pv_sources;
155 std::vector<PrimaryVertex> pvs[Nmax];
156
157 float beamspot_x0;
158 float beamspot_y0;
159 float beamspot_z0;
160
161 edm::InputTag genparticle_source;
162 GenInfo genInfo;
163 std::vector<GenParticle> genps;
164 edm::InputTag SVComputer_;
165 std::vector<std::string> trigger_prefixes;
166 //std::map<std::string, bool> triggerResults;
167 std::vector<std::string> triggerNames;
168 std::vector<bool> triggerResults;
169 /* std::vector<int> L1_prescale; */
170 /* std::vector<int> HLT_prescale; */
171
172 //HLTConfigProvider hlt_cfg;
173 bool newrun;
174 bool previouslumiblockwasfilled;
175
176 JetCorrectionUncertainty *jecUnc;
177 };
178
179
180 #endif