ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/UHHAnalysis/NtupleWriter/interface/NtupleWriter.h
Revision: 1.1
Committed: Mon Apr 2 12:40:08 2012 UTC (13 years, 1 month ago) by peiffer
Content type: text/plain
Branch: MAIN
Branch point for: INITIAL
Log Message:
new

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