ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/HbbAnalysis/plugins/HbbTreeMaker.hh
Revision: 1.20
Committed: Wed Jan 25 18:45:49 2012 UTC (13 years, 3 months ago) by agilbert
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.19: +3 -1 lines
Log Message:
Lots of updates

File Contents

# Content
1 #ifndef HbbAnalysis_HbbTreeMaker_hh
2 #define HbbAnalysis_HbbTreeMaker_hh
3
4 #include <fstream>
5 #include <string>
6 #include <iostream>
7 #include <vector>
8
9 #include "Math/VectorUtil.h"
10
11 #include "FWCore/Framework/interface/EDAnalyzer.h"
12 #include "FWCore/Framework/interface/ESHandle.h"
13 #include "FWCore/Framework/interface/Event.h"
14 #include "FWCore/Framework/interface/EventSetup.h"
15 #include "FWCore/Common/interface/TriggerNames.h"
16 #include "FWCore/ParameterSet/interface/ParameterSet.h"
17
18 #include "DataFormats/Common/interface/Handle.h"
19
20 #include "DataFormats/L1Trigger/interface/L1JetParticleFwd.h"
21 #include "DataFormats/L1Trigger/interface/L1JetParticle.h"
22 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h"
23 #include "DataFormats/HLTReco/interface/TriggerEvent.h"
24 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
25 #include "DataFormats/JetReco/interface/GenJet.h"
26
27 #include "DataFormats/PatCandidates/interface/Lepton.h"
28 #include "DataFormats/PatCandidates/interface/Jet.h"
29 #include "DataFormats/PatCandidates/interface/Muon.h"
30 #include "DataFormats/PatCandidates/interface/Electron.h"
31 #include "DataFormats/PatCandidates/interface/Tau.h"
32
33 #include "SimDataFormats/GeneratorProducts/interface/GenRunInfoProduct.h"
34 #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
35 #include "SimDataFormats/GeneratorProducts/interface/LHEEventProduct.h"
36 #include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h"
37
38 #include "UserCode/HbbAnalysis/interface/JetFlavour.hh"
39 #include "UserCode/HbbAnalysis/interface/HbbEvent.hh"
40
41 #include "CondFormats/JetMETObjects/interface/JetCorrectionUncertainty.h"
42 #include "SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h"
43 #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"
44
45 #include "TTree.h"
46 #include "boost/regex.hpp"
47
48 class HbbTreeMaker : public edm::EDAnalyzer {//class
49
50 public:
51
52 HbbTreeMaker(const edm::ParameterSet & pset);
53 ~HbbTreeMaker();
54
55 void beginJob();
56 void analyze(const edm::Event& ,
57 const edm::EventSetup&
58 );
59 void beginRun(const edm::Run& ,
60 const edm::EventSetup&
61 );
62 void endJob();
63
64 private:
65 HLTConfigProvider hltConfig_;
66 bool jecUncSet_;
67
68
69
70 void HbbParticles(const edm::Handle<reco::GenParticleCollection> & aCol,
71 std::vector<HbbAnalysis::GenParticle> & aVec, HbbAnalysis::P4Total & p4total);
72
73 void HbbGenJets(const edm::Handle<reco::GenJetCollection> & aCol,
74 std::vector<HbbAnalysis::GenJet> & aVec,
75 const bool aSaveConstituants);
76
77
78 void HbbLHEInfo(const edm::Handle<LHEEventProduct> & aLHEEvt,
79 std::vector<HbbAnalysis::GenParticle> & aVec);
80
81 void HbbPUInfo(const edm::Handle<std::vector<PileupSummaryInfo> > & aPUInfo,
82 std::vector<HbbAnalysis::PUVars> & aVec);
83
84
85
86 void HbbBeamSpot(const edm::Handle<reco::BeamSpot> & aBeamSpot,
87 HbbAnalysis::BeamSpot & aBS);
88
89 void HbbElectrons(const edm::Handle<std::vector<pat::Electron> > & aCol,
90 std::vector<HbbAnalysis::Electron> & aVec, const edm::Handle<reco::BeamSpot> & aBeamSpot);
91
92 void HbbMuons(const edm::Handle<std::vector<pat::Muon> > & aCol,
93 const edm::Handle<std::vector<reco::Vertex> > & aRecoVertices,
94 const edm::Handle<reco::BeamSpot> & aBeamSpot,
95 std::vector<HbbAnalysis::Muon> & aVec);
96
97 /*
98 void HbbTaus(const edm::Handle<std::vector<pat::Tau> > & aCol,
99 const edm::Handle<std::vector<reco::Vertex> > & aRecoVertices,
100 std::vector<HbbAnalysis::Tau> & aVec);
101 */
102
103 void HbbJets(const edm::Handle<std::vector<pat::Jet> > & aCol,
104 const HbbAnalysis::JetFlavour & aFlavour,
105 const edm::Handle<reco::GenParticleCollection> & aGenParticles,
106 std::vector<HbbAnalysis::Jet> & aVec);
107
108 JetCorrectionUncertainty* jecUncCalo;
109 JetCorrectionUncertainty* jecUncPF;
110 JetCorrectionUncertainty* jecUncJPT;
111
112 void HbbMet(const edm::Handle<std::vector<pat::MET> > & aCol,
113 HbbAnalysis::Met & aVec);
114
115 void HbbTrigger(const edm::Handle<edm::TriggerResults> & aCol,
116 const edm::TriggerNames & aNames,
117 std::vector<HbbAnalysis::Trigger> & aVec, int prescaleSet);
118
119 void HbbVertices(const edm::Handle<std::vector<reco::Vertex> > & aCol,
120 std::vector<HbbAnalysis::Vertex> & aVec);
121
122 /*
123 void HbbL1Objects(const edm::Handle<l1extra::L1JetParticleCollection> & aCol,
124 std::vector<HbbAnalysis::L1Object> & aVec,
125 const unsigned int aType);
126
127 void HbbHLTObjects(const edm::Handle<trigger::TriggerEvent> & aCol,
128 std::vector<HbbAnalysis::HLTObject> & aVec);
129
130 void fillHLTVector(const edm::InputTag & aTag,
131 const edm::Handle<trigger::TriggerEvent> & aCol,
132 std::vector<HbbAnalysis::HLTObject> & aVec,
133 const unsigned int aType);
134 */
135
136 void HbbGenInfo(const edm::Handle<edm::HepMCProduct> & amcProd,
137 const edm::Handle<GenRunInfoProduct> & aRunProd,
138 const edm::Handle<GenEventInfoProduct> & aInfoProd);
139
140 int debug_;
141
142 bool processData_;
143
144
145 //flavour of jets required :
146 // 3 = u,d,s,g, 21 = g
147 // 4=c, 5=b, 45=b or c
148 unsigned int flavour_;
149
150 bool doGen_;
151
152 HbbAnalysis::JetFlavour jetFlav_;
153
154 edm::InputTag genParticleSrc_;
155 edm::InputTag genJetSrc_;
156 edm::InputTag partonJetSrc_;
157 edm::InputTag ak7genJetSrc_;
158 edm::InputTag ak7partonJetSrc_;
159 edm::InputTag trackSrc_;
160 edm::InputTag dcsSrc_;
161 edm::InputTag electronSrc_;
162 edm::InputTag muonSrc_;
163 edm::InputTag caloTauSrc_;
164 edm::InputTag pfTauSrc_;
165 edm::InputTag caloJetSrc_;
166 edm::InputTag jptJetSrc_;
167 edm::InputTag ak7JetSrc_;
168 edm::InputTag pfJetSrc_;
169 edm::InputTag ak7pfJetSrc_;
170 edm::InputTag caloMetSrc_;
171 edm::InputTag tcMetSrc_;
172 edm::InputTag pfMetSrc_;
173 //edm::InputTag pairSrc_;
174 //edm::InputTag mmPairSrc_;
175 //edm::InputTag etPairSrc_;
176 //edm::InputTag mtPairSrc_;
177 edm::InputTag vertexSrc_;
178 edm::InputTag triggerSrc_;
179 std::vector<std::string> hltPaths_;
180 edm::InputTag l1CenJetSrc_;
181 edm::InputTag l1TauJetSrc_;
182 edm::InputTag l1FwdJetSrc_;
183 edm::InputTag hltSummarySrc_;
184 std::vector<std::string> status1ToKeep_;
185 std::vector<std::string> status2ToKeep_;
186 std::vector<std::string> status3ToKeep_;
187 std::vector<boost::regex> status1ToKeepRegex_;
188 std::vector<boost::regex> status2ToKeepRegex_;
189 std::vector<boost::regex> status3ToKeepRegex_;
190
191 //vector filled during processing with all existing collections
192 //std::vector<std::pair<std::string,std::string> > collections_;
193
194 //list of processes to consider to find input collections
195 //std::vector<std::string> processVec_;
196
197 HbbAnalysis::HbbEvent * event_;
198
199 TTree *tree_;
200
201 //name of the desired collection for hlt matches
202 std::vector<edm::InputTag> hltTagsElec_;
203 std::vector<edm::InputTag> hltTagsMu_;
204 std::vector<edm::InputTag> hltTagsJet_;
205
206 };//class
207
208 #endif //HbbAnalysis_HbbTreeMaker_hh