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/Framework/interface/TriggerNames.h" |
16 |
|
#include "FWCore/ParameterSet/interface/ParameterSet.h" |
17 |
< |
//#include "DataFormats/Common/interface/Handle.h" |
17 |
> |
|
18 |
> |
#include "DataFormats/Common/interface/Handle.h" |
19 |
> |
#include "DataFormats/PatCandidates/interface/Lepton.h" |
20 |
> |
#include "DataFormats/PatCandidates/interface/Jet.h" |
21 |
> |
#include "DataFormats/PatCandidates/interface/Muon.h" |
22 |
> |
#include "DataFormats/PatCandidates/interface/Electron.h" |
23 |
> |
#include "DataFormats/PatCandidates/interface/Tau.h" |
24 |
|
|
25 |
|
#include "UserCode/HbbAnalysis/interface/HistosElecs.hh" |
26 |
|
#include "UserCode/HbbAnalysis/interface/HistosMuons.hh" |
28 |
|
#include "UserCode/HbbAnalysis/interface/HistosJets.hh" |
29 |
|
#include "UserCode/HbbAnalysis/interface/HistosPairs.hh" |
30 |
|
#include "UserCode/HbbAnalysis/interface/HistosMET.hh" |
31 |
+ |
#include "UserCode/HbbAnalysis/interface/JetFlavour.hh" |
32 |
|
|
33 |
|
|
34 |
|
//#include "TFile.h" |
42 |
|
~HbbAnalyzer(); |
43 |
|
|
44 |
|
void beginJob(const edm::EventSetup&); |
45 |
< |
void analyze(const edm::Event& , const edm::EventSetup&); |
45 |
> |
void analyze(const edm::Event& , |
46 |
> |
const edm::EventSetup& |
47 |
> |
); |
48 |
|
void endJob(); |
49 |
< |
void dumpContent(const edm::Event& aEvt, std::string aName, std::string aProcess); |
49 |
> |
void dumpContent(const edm::Event& aEvt, |
50 |
> |
std::string aName, |
51 |
> |
std::string aProcess |
52 |
> |
); |
53 |
> |
|
54 |
> |
bool jetLeptonIsolation(const pat::Jet & aJet, |
55 |
> |
const edm::Handle<std::vector<pat::Electron> > & aColEle, |
56 |
> |
const edm::Handle<std::vector<pat::Muon> > & aColMu, |
57 |
> |
const edm::Handle<std::vector<pat::Tau> > & aColCalotau, |
58 |
> |
const edm::Handle<std::vector<pat::Tau> > & aColPFtau, |
59 |
> |
HbbAnalysis::HistosJets & aHists |
60 |
> |
); |
61 |
> |
|
62 |
|
|
63 |
|
|
64 |
|
private: |
65 |
|
|
66 |
+ |
template <class T> |
67 |
+ |
double deltaRwithLepton(const pat::Jet & aJet, |
68 |
+ |
const edm::Handle<std::vector<T> > & aCol |
69 |
+ |
); |
70 |
+ |
|
71 |
|
//void processFirstEvent(const edm::Event& aEvt, std::string aName, std::vector<std::string> & aProcVec); |
72 |
|
//void InitialiseHistograms(); |
73 |
|
//void FillHistograms(std::string aDirName, std::string aSubDirName, unsigned int aIndex, double apT, double aEta, double aPhi); |
74 |
|
//void SaveHistograms(); |
75 |
|
|
76 |
|
int debug_; |
77 |
+ |
|
78 |
+ |
//flavour of jets required : |
79 |
+ |
// 3 = u,d,s,g, 21 = g |
80 |
+ |
// 4=c, 5=b, 45=b or c |
81 |
+ |
unsigned int flavour_; |
82 |
|
//TFile* file_; |
83 |
|
|
84 |
+ |
double jetLeptonIsolation_; |
85 |
+ |
|
86 |
+ |
bool doElectrons_; |
87 |
+ |
bool doMuons_; |
88 |
+ |
bool doTaus_; |
89 |
+ |
bool doJets_; |
90 |
+ |
bool doMETs_; |
91 |
+ |
bool doLepTauPairs_; |
92 |
+ |
bool doLepLepPairs_; |
93 |
+ |
|
94 |
+ |
|
95 |
+ |
HbbAnalysis::JetFlavour jetFlav_; |
96 |
+ |
|
97 |
|
edm::InputTag genParticleSrc_; |
98 |
|
edm::InputTag electronSrc_; |
99 |
|
edm::InputTag muonSrc_; |
123 |
|
HbbAnalysis::HistosElecs ElecHistLeadGenMatched_; |
124 |
|
HbbAnalysis::HistosElecs ElecHistNtoLead_; |
125 |
|
HbbAnalysis::HistosElecs ElecHistNtoLeadGenMatched_; |
126 |
+ |
HbbAnalysis::HistosElecs ElecHistBarrelLead_; |
127 |
+ |
HbbAnalysis::HistosElecs ElecHistBarrelLeadGenMatched_; |
128 |
+ |
HbbAnalysis::HistosElecs ElecHistBarrelNtoLead_; |
129 |
+ |
HbbAnalysis::HistosElecs ElecHistBarrelNtoLeadGenMatched_; |
130 |
+ |
HbbAnalysis::HistosElecs ElecHistEndCapLead_; |
131 |
+ |
HbbAnalysis::HistosElecs ElecHistEndCapLeadGenMatched_; |
132 |
+ |
HbbAnalysis::HistosElecs ElecHistEndCapNtoLead_; |
133 |
+ |
HbbAnalysis::HistosElecs ElecHistEndCapNtoLeadGenMatched_; |
134 |
|
HbbAnalysis::HistosMuons MuHistLead_; |
135 |
|
HbbAnalysis::HistosMuons MuHistLeadGenMatched_; |
136 |
|
HbbAnalysis::HistosMuons MuHistNtoLead_; |
142 |
|
HbbAnalysis::HistosJets JetHist_; |
143 |
|
HbbAnalysis::HistosJets JPTJetHist_; |
144 |
|
HbbAnalysis::HistosJets PFJetHist_; |
145 |
+ |
HbbAnalysis::HistosJets JetHistLead_; |
146 |
+ |
HbbAnalysis::HistosJets JPTJetHistLead_; |
147 |
+ |
HbbAnalysis::HistosJets PFJetHistLead_; |
148 |
+ |
HbbAnalysis::HistosJets JetHistNtoLead_; |
149 |
+ |
HbbAnalysis::HistosJets JPTJetHistNtoLead_; |
150 |
+ |
HbbAnalysis::HistosJets PFJetHistNtoLead_; |
151 |
|
HbbAnalysis::HistosPairs EEPairHist_; |
152 |
|
HbbAnalysis::HistosPairs MMPairHist_; |
153 |
|
HbbAnalysis::HistosPairs ETPairHist_; |
165 |
|
};//class |
166 |
|
|
167 |
|
|
168 |
+ |
|
169 |
+ |
template <class T> |
170 |
+ |
double HbbAnalyzer::deltaRwithLepton(const pat::Jet & aJet, |
171 |
+ |
const edm::Handle<std::vector< T > > & aCol |
172 |
+ |
) |
173 |
+ |
{ |
174 |
+ |
double lMin = 1000; |
175 |
+ |
bool lValid=(aCol->empty())?true:false; |
176 |
+ |
|
177 |
+ |
// pat::Lepton<LeptonType> lLep; |
178 |
+ |
typename std::vector< T >::const_iterator iLepton; |
179 |
+ |
|
180 |
+ |
for (iLepton= aCol->begin(); |
181 |
+ |
iLepton != aCol->end(); |
182 |
+ |
iLepton++) |
183 |
+ |
// for (unsigned int iLepton(0); iLepton< aCol->size(); iLepton++) |
184 |
+ |
{ |
185 |
+ |
//double lDeltaR = ROOT::Math::VectorUtil::DeltaR(aJet.p4(),aCol->at(iLepton).p4()); |
186 |
+ |
double lDeltaR = ROOT::Math::VectorUtil::DeltaR(aJet.p4(),iLepton->p4()); |
187 |
+ |
if (lDeltaR<lMin){ |
188 |
+ |
lMin=lDeltaR; |
189 |
+ |
lValid=true; |
190 |
+ |
} |
191 |
+ |
} |
192 |
+ |
|
193 |
+ |
if(!lValid){ |
194 |
+ |
std::cerr<<__PRETTY_FUNCTION__<<" : Invalid Return value " |
195 |
+ |
<< lMin |
196 |
+ |
<< "... AAAAAAARRRRRRRRRRRRGGGGGGGGGHHHHH" |
197 |
+ |
<<std::endl; |
198 |
+ |
} |
199 |
+ |
if (lMin > 100) return -1; |
200 |
+ |
|
201 |
+ |
return lMin; |
202 |
+ |
|
203 |
+ |
} |
204 |
+ |
|
205 |
+ |
|
206 |
+ |
|
207 |
+ |
|
208 |
+ |
|
209 |
|
#endif //HbbAnalysis_HbbAnalyzer_hh |