ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/UHHAnalysis/NtupleWriter/interface/NtupleWriter.h
Revision: 1.13
Committed: Tue May 22 09:32:31 2012 UTC (12 years, 11 months ago) by peiffer
Content type: text/plain
Branch: MAIN
Changes since 1.12: +11 -2 lines
Log Message:
new class structure for objects

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