17 |
|
// |
18 |
|
// |
19 |
|
|
20 |
+ |
|
21 |
+ |
//uncomment to save also jet collections 1 and 4 |
22 |
+ |
//#define ENABLE_SIMPLEJETS1 |
23 |
+ |
//#define ENABLE_SIMPLEJETS4 |
24 |
+ |
|
25 |
+ |
#include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h" |
26 |
+ |
#include "CondFormats/JetMETObjects/interface/JetCorrectionUncertainty.h" |
27 |
+ |
#include "JetMETCorrections/Objects/interface/JetCorrector.h" |
28 |
+ |
#include "JetMETCorrections/Objects/interface/JetCorrectionsRecord.h" |
29 |
+ |
#include "DataFormats/TrackReco/interface/TrackFwd.h" |
30 |
+ |
|
31 |
|
#include "VHbbAnalysis/HbbAnalyzer/interface/HbbAnalyzerNew.h" |
32 |
< |
#include "VHbbAnalysis/VHbbDataFormats/interface/VHbbEvent.h" |
33 |
< |
#include "VHbbAnalysis/VHbbDataFormats/interface/VHbbEventAuxInfo.h" |
32 |
> |
#include "SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h" |
33 |
> |
|
34 |
> |
#include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h" |
35 |
> |
#include "DataFormats/Math/interface/deltaR.h" |
36 |
> |
#include "DataFormats/Math/interface/LorentzVector.h" |
37 |
> |
#include "DataFormats/Math/interface/Vector3D.h" |
38 |
> |
#include "Math/GenVector/PxPyPzM4D.h" |
39 |
> |
|
40 |
> |
|
41 |
> |
#include <cmath> |
42 |
> |
|
43 |
|
|
24 |
– |
#include "DataFormats/GeometryVector/interface/VectorUtil.h" |
44 |
|
|
45 |
|
|
46 |
|
#define GENPTOLOR(a) TLorentzVector((a).px(), (a).py(), (a).pz(), (a).energy()) |
47 |
|
#define GENPTOLORP(a) TLorentzVector((a)->px(), (a)->py(), (a)->pz(), (a)->energy()) |
48 |
|
|
49 |
+ |
|
50 |
+ |
|
51 |
+ |
struct CompareJetPtMuons { |
52 |
+ |
bool operator()( const VHbbEvent::MuonInfo& j1, const VHbbEvent::MuonInfo& j2 ) const { |
53 |
+ |
return j1.p4.Pt() > j2.p4.Pt(); |
54 |
+ |
} |
55 |
+ |
}; |
56 |
+ |
struct CompareJetPtElectrons { |
57 |
+ |
bool operator()( const VHbbEvent::ElectronInfo& j1, const VHbbEvent::ElectronInfo& j2 ) const { |
58 |
+ |
return j1.p4.Pt() > j2.p4.Pt(); |
59 |
+ |
} |
60 |
+ |
}; |
61 |
+ |
struct CompareJetPtTaus { |
62 |
+ |
bool operator()( const VHbbEvent::TauInfo& j1, const VHbbEvent::TauInfo& j2 ) const { |
63 |
+ |
return j1.p4.Pt() > j2.p4.Pt(); |
64 |
+ |
} |
65 |
+ |
}; |
66 |
+ |
|
67 |
+ |
|
68 |
+ |
|
69 |
|
HbbAnalyzerNew::HbbAnalyzerNew(const edm::ParameterSet& iConfig): |
70 |
|
eleLabel_(iConfig.getParameter<edm::InputTag>("electronTag")), |
71 |
|
muoLabel_(iConfig.getParameter<edm::InputTag>("muonTag")), |
72 |
+ |
lep_ptCutForBjets_(iConfig.getParameter<double>("lep_ptCutForBjets")), |
73 |
+ |
elenoCutsLabel_(iConfig.getParameter<edm::InputTag>("electronNoCutsTag")), |
74 |
+ |
muonoCutsLabel_(iConfig.getParameter<edm::InputTag>("muonNoCutsTag")), |
75 |
|
jetLabel_(iConfig.getParameter<edm::InputTag>("jetTag")), |
76 |
|
subjetLabel_(iConfig.getParameter<edm::InputTag>("subjetTag")), |
77 |
+ |
filterjetLabel_(iConfig.getParameter<edm::InputTag>("filterjetTag")), |
78 |
|
simplejet1Label_(iConfig.getParameter<edm::InputTag>("simplejet1Tag")), |
79 |
|
simplejet2Label_(iConfig.getParameter<edm::InputTag>("simplejet2Tag")), |
80 |
|
simplejet3Label_(iConfig.getParameter<edm::InputTag>("simplejet3Tag")), |
82 |
|
tauLabel_(iConfig.getParameter<edm::InputTag>("tauTag")), |
83 |
|
metLabel_(iConfig.getParameter<edm::InputTag>("metTag")), |
84 |
|
phoLabel_(iConfig.getParameter<edm::InputTag>("photonTag")), |
42 |
– |
dimuLabel_(iConfig.getParameter<edm::InputTag>("dimuTag")), |
43 |
– |
dielecLabel_(iConfig.getParameter<edm::InputTag>("dielecTag")), |
85 |
|
hltResults_(iConfig.getParameter<edm::InputTag>("hltResultsTag")), |
86 |
|
runOnMC_(iConfig.getParameter<bool>("runOnMC")), verbose_(iConfig.getUntrackedParameter<bool>("verbose")) { |
87 |
|
|
112 |
|
HbbAnalyzerNew::produce(edm::Event& iEvent, const edm::EventSetup& iSetup){ |
113 |
|
using namespace edm; |
114 |
|
using namespace reco; |
115 |
< |
|
115 |
> |
|
116 |
> |
|
117 |
> |
// JEC Uncertainty |
118 |
> |
|
119 |
> |
// JetCorrectionUncertainty *jecUnc=0; |
120 |
> |
edm::ESHandle<JetCorrectorParametersCollection> JetCorParColl; |
121 |
> |
iSetup.get<JetCorrectionsRecord>().get("AK5PFchs",JetCorParColl); |
122 |
> |
JetCorrectionUncertainty *jecUnc=0; |
123 |
> |
// if (!runOnMC_){ |
124 |
> |
JetCorrectorParameters const & JetCorPar = (*JetCorParColl)["Uncertainty"]; |
125 |
> |
jecUnc = new JetCorrectionUncertainty(JetCorPar); |
126 |
> |
// } |
127 |
|
|
128 |
|
std::auto_ptr<VHbbEvent> hbbInfo( new VHbbEvent() ); |
129 |
|
std::auto_ptr<VHbbEventAuxInfo> auxInfo( new VHbbEventAuxInfo() ); |
130 |
< |
|
130 |
> |
|
131 |
> |
|
132 |
> |
if (runOnMC_){ |
133 |
> |
Handle<GenEventInfoProduct> evt_info; |
134 |
> |
iEvent.getByType(evt_info); |
135 |
> |
auxInfo->weightMCProd = evt_info->weight(); |
136 |
> |
} |
137 |
> |
else |
138 |
> |
{ auxInfo->weightMCProd =1.;} |
139 |
|
// |
140 |
|
// ?? |
141 |
< |
|
141 |
> |
|
142 |
> |
// trigger |
143 |
> |
|
144 |
|
// trigger |
145 |
|
edm::Handle<edm::TriggerResults> hltresults; |
146 |
|
//iEvent.getByLabel("TriggerResults", hltresults); |
150 |
|
iEvent.getByLabel(hltResults_, hltresults); |
151 |
|
|
152 |
|
const edm::TriggerNames & triggerNames_ = iEvent.triggerNames(*hltresults); |
91 |
– |
|
92 |
– |
int ntrigs = hltresults->size(); |
93 |
– |
if (ntrigs==0){std::cout << "%HLTInfo -- No trigger name given in TriggerResults of the input " << std::endl;} |
94 |
– |
|
95 |
– |
for (int itrig = 0; itrig != ntrigs; ++itrig){ |
96 |
– |
|
97 |
– |
TString trigName=triggerNames_.triggerName(itrig); |
98 |
– |
bool accept = hltresults->accept(itrig); |
99 |
– |
|
100 |
– |
if (accept){(auxInfo->triggerInfo.flag)[itrig] = 1;} |
101 |
– |
else { (auxInfo->triggerInfo.flag)[itrig] = 0;} |
102 |
– |
|
103 |
– |
// std::cout << "%HLTInfo -- Number of HLT Triggers: " << ntrigs << std::endl; |
104 |
– |
// std::cout << "%HLTInfo -- HLTTrigger(" << itrig << "): " << trigName << " = " << accept << std::endl; |
105 |
– |
} |
106 |
– |
|
107 |
– |
// |
108 |
– |
// big bloat |
109 |
– |
// |
110 |
– |
|
111 |
– |
|
112 |
– |
int goodDoubleMu3=0,goodDoubleMu3_2=0, |
113 |
– |
goodMu9=0, goodIsoMu9=0, goodMu11=0, goodIsoMu13_3=0, goodMu15=0, goodMu15_1=0; |
114 |
– |
int goodDoubleElec10=0,goodDoubleElec15_1=0,goodDoubleElec17_1=0; |
115 |
– |
int goodMet100=0; |
116 |
– |
int goodSingleEle1=0,goodSingleEle2=0,goodSingleEle3=0,goodSingleEle4=0; |
117 |
– |
int goodBtagMu1=0,goodBtagMu2=0,goodBtagMu0=0,goodBtagMu11=0; |
118 |
– |
int goodBtagMuJet1=0, goodBtagMuJet2=0, goodBtagMuJet3=0, goodBtagMuJet4=0; |
119 |
– |
int goodIsoMu15=0,goodIsoMu17v5=0,goodIsoMu17v6=0; |
120 |
– |
|
121 |
– |
for (int itrig = 0; itrig != ntrigs; ++itrig){ |
122 |
– |
TString trigName=triggerNames_.triggerName(itrig); |
123 |
– |
if(strcmp(trigName,"HLT_Mu9")==0) goodMu9++; |
124 |
– |
if(strcmp(trigName,"HLT_IsoMu9")==0) goodIsoMu9++; |
125 |
– |
if(strcmp(trigName,"HLT_IsoMu13_v3")==0) goodIsoMu13_3++; |
126 |
– |
if(strcmp(trigName,"HLT_Mu11")==0) goodMu11++; |
127 |
– |
if(strcmp(trigName,"HLT_DoubleMu3")==0) goodDoubleMu3++; |
128 |
– |
if(strcmp(trigName,"HLT_DoubleMu3_v2")==0) goodDoubleMu3_2++; |
129 |
– |
if(strcmp(trigName,"HLT_Mu15")==0) goodMu15++; |
130 |
– |
if(strcmp(trigName,"HLT_Mu15_v1")==0) goodMu15_1++; |
131 |
– |
|
132 |
– |
if(strcmp(trigName,"HLT_DoubleEle10_SW_L1R")==0) goodDoubleElec10++; |
133 |
– |
if(strcmp(trigName,"HLT_DoubleEle15_SW_L1R_v1")==0) goodDoubleElec15_1++; |
134 |
– |
if(strcmp(trigName,"HLT_DoubleEle17_SW_L1R_v1")==0) goodDoubleElec17_1++; |
135 |
– |
if(strcmp(trigName,"HLT_MET100_v1")==0) goodMet100++; |
136 |
– |
if(strcmp(trigName,"HLT_Ele15_SW_L1R")==0) goodSingleEle1++; |
137 |
– |
if(strcmp(trigName,"HLT_Ele17_SW_TightEleId_L1R")==0) goodSingleEle2++; |
138 |
– |
if(strcmp(trigName,"HLT_Ele17_SW_TighterEleIdIsol_L1R_v2")==0) goodSingleEle3++; |
139 |
– |
if(strcmp(trigName,"HLT_Ele17_SW_TighterEleIdIsol_L1R_v3")==0) goodSingleEle4++; |
140 |
– |
if(strcmp(trigName,"HLT_BTagMu_DiJet20U_v1")==0) goodBtagMu1++; |
141 |
– |
if(strcmp(trigName,"HLT_BTagMu_DiJet30U_Mu5_v3")==0) goodBtagMu2++; |
142 |
– |
if(strcmp(trigName,"HLT_BTagMu_Jet20U")==0) goodBtagMu0++; |
143 |
– |
if(strcmp(trigName,"HLT_BTagMu_DiJet20U_Mu5_v1")==0) goodBtagMu11++; |
144 |
– |
if(strcmp(trigName,"HLT_Mu17_CentralJet30_BTagIP_v2")==0) goodBtagMuJet1++; |
145 |
– |
if(strcmp(trigName,"HLT_Mu17_CentralJet30_v2")==0) goodBtagMuJet2++; |
146 |
– |
if(strcmp(trigName,"HLT_HT200_Mu5_PFMHT35_v2")==0) goodBtagMuJet3++; |
147 |
– |
if(strcmp(trigName,"HLT_Mu12_CentralJet30_BTagIP_v2")==0) goodBtagMuJet4++; |
148 |
– |
|
149 |
– |
if(strcmp(trigName,"HLT_IsoMu15_v5")==0) goodIsoMu15++; |
150 |
– |
if(strcmp(trigName,"HLT_IsoMu17_v5")==0) goodIsoMu17v5++; |
151 |
– |
if(strcmp(trigName,"HLT_IsoMu17_v6")==0) goodIsoMu17v6++; |
152 |
– |
} |
153 |
– |
int itrig1=-99; |
154 |
– |
if(goodMu9!=0) itrig1 = triggerNames_.triggerIndex("HLT_Mu9"); |
155 |
– |
int itrig2=-99; |
156 |
– |
if(goodIsoMu9!=0) itrig2 = triggerNames_.triggerIndex("HLT_IsoMu9"); |
157 |
– |
int itrig3=-99; |
158 |
– |
if(goodIsoMu13_3!=0) itrig3 = triggerNames_.triggerIndex("HLT_IsoMu13_v3"); |
159 |
– |
int itrig4=-99; |
160 |
– |
if(goodMu11!=0) itrig4 = triggerNames_.triggerIndex("HLT_Mu11"); |
161 |
– |
int itrig5=-99; |
162 |
– |
if(goodDoubleMu3!=0) itrig5 = triggerNames_.triggerIndex("HLT_DoubleMu3"); |
163 |
– |
int itrig6=-99; |
164 |
– |
if(goodDoubleMu3_2!=0) itrig6 = triggerNames_.triggerIndex("HLT_DoubleMu3_v2"); |
165 |
– |
int itrig7=-99; |
166 |
– |
if(goodMu15!=0) itrig7 = triggerNames_.triggerIndex("HLT_Mu15"); |
167 |
– |
int itrig8=-99; |
168 |
– |
if(goodMu15_1!=0) itrig8 = triggerNames_.triggerIndex("HLT_Mu15_v1"); |
169 |
– |
|
170 |
– |
int itrig9=-99; |
171 |
– |
if(goodDoubleElec10!=0) itrig9 = triggerNames_.triggerIndex("HLT_DoubleEle10_SW_L1R"); |
172 |
– |
int itrig10=-99; |
173 |
– |
if(goodDoubleElec15_1!=0) itrig10 = triggerNames_.triggerIndex("HLT_DoubleEle15_SW_L1R_v1"); |
174 |
– |
int itrig11=-99; |
175 |
– |
if(goodDoubleElec17_1!=0) itrig11 = triggerNames_.triggerIndex("HLT_DoubleEle17_SW_L1R_v1"); |
176 |
– |
int itrig12=-99; |
177 |
– |
if(goodMet100!=0) itrig12 = triggerNames_.triggerIndex("HLT_MET100_v1"); |
178 |
– |
|
179 |
– |
int itrig13=-99; |
180 |
– |
if(goodSingleEle1!=0) itrig13 = triggerNames_.triggerIndex("HLT_Ele15_SW_L1R"); |
181 |
– |
int itrig14=-99; |
182 |
– |
if(goodSingleEle2!=0) itrig14 = triggerNames_.triggerIndex("HLT_Ele17_SW_TightEleId_L1R"); |
183 |
– |
int itrig15=-99; |
184 |
– |
if(goodSingleEle3!=0) itrig15 = triggerNames_.triggerIndex("HLT_Ele17_SW_TighterEleIdIsol_L1R_v2"); |
185 |
– |
int itrig16=-99; |
186 |
– |
if(goodSingleEle4!=0) itrig16 = triggerNames_.triggerIndex("HLT_Ele17_SW_TighterEleIdIsol_L1R_v3"); |
187 |
– |
|
188 |
– |
int itrig17=-99; |
189 |
– |
if(goodBtagMu1!=0) itrig17 = triggerNames_.triggerIndex("HLT_BTagMu_DiJet20U_v1"); |
190 |
– |
int itrig18=-99; |
191 |
– |
if(goodBtagMu2!=0) itrig18 = triggerNames_.triggerIndex("HLT_BTagMu_DiJet30U_Mu5_v3"); |
192 |
– |
int itrig19=-99; |
193 |
– |
if(goodBtagMu0!=0) itrig19 = triggerNames_.triggerIndex("HLT_BTagMu_Jet20U"); |
194 |
– |
int itrig20=-99; |
195 |
– |
if(goodBtagMu11!=0) itrig20 = triggerNames_.triggerIndex("HLT_BTagMu_DiJet20U_Mu5_v1"); |
196 |
– |
int itrig21=-99; |
197 |
– |
if(goodBtagMuJet1!=0) itrig21 = triggerNames_.triggerIndex("HLT_Mu17_CentralJet30_BTagIP_v2"); |
198 |
– |
int itrig22=-99; |
199 |
– |
if(goodBtagMuJet2!=0) itrig22 = triggerNames_.triggerIndex("HLT_Mu17_CentralJet30_v2"); |
200 |
– |
int itrig23=-99; |
201 |
– |
if(goodBtagMuJet3!=0) itrig23 = triggerNames_.triggerIndex("HLT_HT200_Mu5_PFMHT35_v2"); |
202 |
– |
int itrig231=-99; |
203 |
– |
if(goodBtagMuJet4!=0) itrig231 = triggerNames_.triggerIndex("HLT_Mu12_CentralJet30_BTagIP_v2"); |
204 |
– |
|
205 |
– |
int itrig24=-99; |
206 |
– |
if(goodIsoMu15!=0) itrig24 = triggerNames_.triggerIndex("HLT_IsoMu15_v5"); |
207 |
– |
int itrig25=-99; |
208 |
– |
if(goodIsoMu17v5!=0) itrig25 = triggerNames_.triggerIndex("HLT_IsoMu17_v5"); |
209 |
– |
int itrig26=-99; |
210 |
– |
if(goodIsoMu17v6!=0) itrig26 = triggerNames_.triggerIndex("HLT_IsoMu17_v6"); |
211 |
– |
|
212 |
– |
if (itrig1!=-99 && hltresults->accept(itrig1)) auxInfo->triggerInfo.triggerMu9=1; else auxInfo->triggerInfo.triggerMu9=0; |
213 |
– |
if (itrig2!=-99 && hltresults->accept(itrig2)) auxInfo->triggerInfo.triggerIsoMu9=1; else auxInfo->triggerInfo.triggerIsoMu9=0; |
214 |
– |
if (itrig3!=-99 && hltresults->accept(itrig3)) auxInfo->triggerInfo.triggerIsoMu13_3=1; else auxInfo->triggerInfo.triggerIsoMu13_3=0; |
215 |
– |
if (itrig4!=-99 && hltresults->accept(itrig4)) auxInfo->triggerInfo.triggerMu11=1; else auxInfo->triggerInfo.triggerMu11=0; |
216 |
– |
if (itrig5!=-99 && hltresults->accept(itrig5)) auxInfo->triggerInfo.triggerDoubleMu3=1; else auxInfo->triggerInfo.triggerDoubleMu3=0; |
217 |
– |
if (itrig6!=-99 && hltresults->accept(itrig6)) auxInfo->triggerInfo.triggerDoubleMu3_2=1; else auxInfo->triggerInfo.triggerDoubleMu3_2=0; |
218 |
– |
if (itrig7!=-99 && hltresults->accept(itrig7)) auxInfo->triggerInfo.triggerMu15=1; else auxInfo->triggerInfo.triggerMu15=0; |
219 |
– |
if (itrig8!=-99 && hltresults->accept(itrig8)) auxInfo->triggerInfo.triggerMu15_1=1; else auxInfo->triggerInfo.triggerMu15_1=0; |
220 |
– |
|
221 |
– |
if (itrig9!=-99 && hltresults->accept(itrig9)) auxInfo->triggerInfo.triggerDoubleElec10=1; else auxInfo->triggerInfo.triggerDoubleElec10=0; |
222 |
– |
if (itrig10!=-99 && hltresults->accept(itrig10)) auxInfo->triggerInfo.triggerDoubleElec15_1=1; else auxInfo->triggerInfo.triggerDoubleElec15_1=0; |
223 |
– |
if (itrig11!=-99 && hltresults->accept(itrig11)) auxInfo->triggerInfo.triggerDoubleElec17_1=1; else auxInfo->triggerInfo.triggerDoubleElec17_1=0; |
224 |
– |
if (itrig12!=-99 && hltresults->accept(itrig12)) auxInfo->triggerInfo.triggerMet100_1=1; else auxInfo->triggerInfo.triggerMet100_1=0; |
225 |
– |
|
226 |
– |
if (itrig13!=-99 && hltresults->accept(itrig13)) auxInfo->triggerInfo.triggerSingleEle1=1; else auxInfo->triggerInfo.triggerSingleEle1=0; |
227 |
– |
if (itrig14!=-99 && hltresults->accept(itrig14)) auxInfo->triggerInfo.triggerSingleEle2=1; else auxInfo->triggerInfo.triggerSingleEle2=0; |
228 |
– |
if (itrig15!=-99 && hltresults->accept(itrig15)) auxInfo->triggerInfo.triggerSingleEle3=1; else auxInfo->triggerInfo.triggerSingleEle3=0; |
229 |
– |
if (itrig16!=-99 && hltresults->accept(itrig16)) auxInfo->triggerInfo.triggerSingleEle4=1; else auxInfo->triggerInfo.triggerSingleEle4=0; |
230 |
– |
|
231 |
– |
if (itrig17!=-99 && hltresults->accept(itrig17)) auxInfo->triggerInfo.triggerBtagMu1=1; else auxInfo->triggerInfo.triggerBtagMu1=0; |
232 |
– |
if (itrig18!=-99 && hltresults->accept(itrig18)) auxInfo->triggerInfo.triggerBtagMu2=1; else auxInfo->triggerInfo.triggerBtagMu2=0; |
233 |
– |
if (itrig19!=-99 && hltresults->accept(itrig19)) auxInfo->triggerInfo.triggerBtagMu0=1; else auxInfo->triggerInfo.triggerBtagMu0=0; |
234 |
– |
if (itrig20!=-99 && hltresults->accept(itrig20)) auxInfo->triggerInfo.triggerBtagMu11=1; else auxInfo->triggerInfo.triggerBtagMu11=0; |
235 |
– |
if (itrig21!=-99 && hltresults->accept(itrig21)) auxInfo->triggerInfo.triggerBtagMuJet1=1; else auxInfo->triggerInfo.triggerBtagMuJet1=0; |
236 |
– |
if (itrig22!=-99 && hltresults->accept(itrig22)) auxInfo->triggerInfo.triggerBtagMuJet2=1; else auxInfo->triggerInfo.triggerBtagMuJet2=0; |
237 |
– |
if (itrig23!=-99 && hltresults->accept(itrig23)) auxInfo->triggerInfo.triggerBtagMuJet3=1; else auxInfo->triggerInfo.triggerBtagMuJet3=0; |
238 |
– |
if (itrig231!=-99 && hltresults->accept(itrig231)) auxInfo->triggerInfo.triggerBtagMuJet4=1; else auxInfo->triggerInfo.triggerBtagMuJet4=0; |
239 |
– |
|
240 |
– |
if (itrig24!=-99 && hltresults->accept(itrig24)) auxInfo->triggerInfo.triggerIsoMu15=1; else auxInfo->triggerInfo.triggerIsoMu15=0; |
241 |
– |
if (itrig25!=-99 && hltresults->accept(itrig25)) auxInfo->triggerInfo.triggerIsoMu17v5=1; else auxInfo->triggerInfo.triggerIsoMu17v5=0; |
242 |
– |
if (itrig26!=-99 && hltresults->accept(itrig26)) auxInfo->triggerInfo.triggerIsoMu17v6=1; else auxInfo->triggerInfo.triggerIsoMu17v6=0; |
243 |
– |
|
244 |
– |
if (itrig1==-99) auxInfo->triggerInfo.triggerMu9=-99; |
245 |
– |
if (itrig2==-99) auxInfo->triggerInfo.triggerIsoMu9=-99; |
246 |
– |
if (itrig3==-99) auxInfo->triggerInfo.triggerIsoMu13_3=-99; |
247 |
– |
if (itrig4==-99) auxInfo->triggerInfo.triggerMu11=-99; |
248 |
– |
if (itrig5==-99) auxInfo->triggerInfo.triggerDoubleMu3=-99; |
249 |
– |
if (itrig6==-99) auxInfo->triggerInfo.triggerDoubleMu3_2=-99; |
250 |
– |
if (itrig7==-99) auxInfo->triggerInfo.triggerMu15=-99; |
251 |
– |
if (itrig8==-99) auxInfo->triggerInfo.triggerMu15_1=-99; |
252 |
– |
|
253 |
– |
if (itrig9==-99) auxInfo->triggerInfo.triggerDoubleElec10=-99; |
254 |
– |
if (itrig10==-99) auxInfo->triggerInfo.triggerDoubleElec15_1=-99; |
255 |
– |
if (itrig11==-99) auxInfo->triggerInfo.triggerDoubleElec17_1=-99; |
256 |
– |
if (itrig12==-99) auxInfo->triggerInfo.triggerMet100_1=-99; |
257 |
– |
|
258 |
– |
if (itrig13==-99) auxInfo->triggerInfo.triggerSingleEle1=-99; |
259 |
– |
if (itrig14==-99) auxInfo->triggerInfo.triggerSingleEle2=-99; |
260 |
– |
if (itrig15==-99) auxInfo->triggerInfo.triggerSingleEle3=-99; |
261 |
– |
if (itrig16==-99) auxInfo->triggerInfo.triggerSingleEle4=-99; |
262 |
– |
|
263 |
– |
if(itrig17==-99) auxInfo->triggerInfo.triggerBtagMu1=-99; |
264 |
– |
if(itrig18==-99) auxInfo->triggerInfo.triggerBtagMu2=-99; |
265 |
– |
if(itrig19==-99) auxInfo->triggerInfo.triggerBtagMu0=-99; |
266 |
– |
if(itrig20==-99) auxInfo->triggerInfo.triggerBtagMu11=-99; |
267 |
– |
if(itrig21==-99) auxInfo->triggerInfo.triggerBtagMuJet1=-99; |
268 |
– |
if(itrig22==-99) auxInfo->triggerInfo.triggerBtagMuJet2=-99; |
269 |
– |
if(itrig23==-99) auxInfo->triggerInfo.triggerBtagMuJet3=-99; |
270 |
– |
if(itrig231==-99) auxInfo->triggerInfo.triggerBtagMuJet4=-99; |
271 |
– |
|
272 |
– |
if(itrig24==-99) auxInfo->triggerInfo.triggerIsoMu15=-99; |
273 |
– |
if(itrig25==-99) auxInfo->triggerInfo.triggerIsoMu17v5=-99; |
274 |
– |
if(itrig26==-99) auxInfo->triggerInfo.triggerIsoMu17v6=-99; |
275 |
– |
|
276 |
– |
// MinDRMu=-99.,MCBestMuId=-99,MCBestMuMomId=-99,MCBestMuGMomId=-99; |
277 |
– |
// for(int i=0;i<50;i++) {DeltaRMu[i]=-99;} |
278 |
– |
|
153 |
|
|
154 |
+ |
int ntrigs = hltresults->size(); |
155 |
+ |
if (ntrigs==0){std::cerr << "%HLTInfo -- No trigger name given in TriggerResults of the input " << std::endl;} |
156 |
|
|
157 |
|
BeamSpot vertexBeamSpot; |
158 |
|
edm::Handle<reco::BeamSpot> recoBeamSpotHandle; |
170 |
|
Handle<reco::VertexCollection> recVtxs; |
171 |
|
iEvent.getByLabel("offlinePrimaryVertices", recVtxs); |
172 |
|
|
173 |
+ |
auxInfo->pvInfo.nVertices = recVtxs->size(); |
174 |
+ |
|
175 |
|
for(size_t i = 0; i < recVtxs->size(); ++ i) { |
176 |
|
const Vertex &vtx = (*recVtxs)[i]; |
177 |
|
double RecVtxProb=TMath::Prob(vtx.chi2(),vtx.ndof()); |
186 |
|
|
187 |
|
auxInfo->pvInfo.firstPVInPT2 = TVector3(RecVtxFirst.x(), RecVtxFirst.y(), RecVtxFirst.z()); |
188 |
|
auxInfo->pvInfo.firstPVInProb = TVector3(RecVtx.x(), RecVtx.y(), RecVtx.z()); |
189 |
< |
|
189 |
> |
|
190 |
> |
(auxInfo->pvInfo).efirstPVInPT2 = (RecVtxFirst.error()); |
191 |
> |
(auxInfo->pvInfo).efirstPVInProb = RecVtx.error(); |
192 |
|
|
193 |
|
edm::Handle<double> rhoHandle; |
194 |
< |
iEvent.getByLabel(edm::InputTag("kt6PFJets", "rho"),rhoHandle); // configure srcRho = cms.InputTag('kt6PFJets") |
194 |
> |
iEvent.getByLabel(edm::InputTag("kt6PFJets", "rho"),rhoHandle); |
195 |
|
auxInfo->puInfo.rho = *rhoHandle; |
196 |
< |
|
196 |
> |
|
197 |
> |
edm::Handle<double> rho25Handle; |
198 |
> |
iEvent.getByLabel(edm::InputTag("kt6PFJets25", "rho"),rho25Handle); |
199 |
> |
auxInfo->puInfo.rho25 = *rho25Handle; |
200 |
> |
|
201 |
> |
edm::Handle<std::vector< PileupSummaryInfo> > puHandle; |
202 |
> |
|
203 |
> |
if (runOnMC_){ |
204 |
> |
iEvent.getByType(puHandle); |
205 |
> |
if (puHandle.isValid()){ |
206 |
> |
|
207 |
> |
std::vector< PileupSummaryInfo> pu = (*puHandle); |
208 |
> |
for (std::vector<PileupSummaryInfo>::const_iterator it= pu.begin(); it!=pu.end(); ++it){ |
209 |
> |
int bx = (*it).getBunchCrossing(); |
210 |
> |
unsigned int num = (*it).getPU_NumInteractions(); |
211 |
> |
// std::cout <<" PU PUSHING "<<bx<<" " <<num<<std::endl; |
212 |
> |
auxInfo->puInfo.pus[bx] =num; |
213 |
> |
} |
214 |
> |
} |
215 |
> |
} |
216 |
> |
|
217 |
|
//// real start |
218 |
|
|
219 |
|
|
224 |
|
|
225 |
|
if(runOnMC_){ |
226 |
|
|
227 |
< |
int Hin=-99,Win=-99,Zin=-99,bin=-99,bbarin=-99; |
328 |
< |
iEvent.getByLabel("genParticles", genParticles); |
227 |
> |
iEvent.getByLabel("genParticles", genParticles); |
228 |
|
|
229 |
|
for(size_t i = 0; i < genParticles->size(); ++ i) { |
230 |
< |
int Hin=-99,Win=-99,Zin=-99,bin=-99,bbarin=-99; |
332 |
< |
|
230 |
> |
|
231 |
|
const GenParticle & p = (*genParticles)[i]; |
232 |
|
int id = p.pdgId(); |
233 |
|
int st = p.status(); |
234 |
|
|
235 |
|
if(id==25){ |
236 |
|
|
339 |
– |
/* int wh=0; |
340 |
– |
int nMoth = p.numberOfMothers(); |
341 |
– |
for(size_t jj = 0; jj < nMoth; ++ jj) { |
342 |
– |
const Candidate * mom = p.mother( jj ); |
343 |
– |
int nmomdau= mom->numberOfDaughters(); |
344 |
– |
for(size_t j = 0; j < nmomdau; ++ j) { |
345 |
– |
const Candidate * Wmomdau = mom->daughter( j ); |
346 |
– |
if(abs(Wmomdau->pdgId())==24) wh++; |
347 |
– |
} |
348 |
– |
} |
349 |
– |
|
350 |
– |
if(wh==0) continue; |
351 |
– |
*/ |
237 |
|
VHbbEventAuxInfo::ParticleMCInfo htemp; |
353 |
– |
Hin=i; |
238 |
|
htemp.status=st; |
239 |
|
htemp.charge=p.charge(); |
240 |
|
if(p.mother(0)!=0) htemp.momid=p.mother(0)->pdgId(); |
241 |
|
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) htemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
242 |
|
htemp.p4 = GENPTOLOR(p); |
243 |
< |
|
243 |
> |
|
244 |
|
int ndau = p.numberOfDaughters(); |
245 |
|
for(int j = 0; j < ndau; ++ j) { |
246 |
|
const Candidate * Hdau = p.daughter( j ); |
249 |
|
} |
250 |
|
(auxInfo->mcH).push_back(htemp); |
251 |
|
} |
252 |
< |
|
253 |
< |
|
252 |
> |
|
253 |
> |
|
254 |
|
if(abs(id)==24){ |
255 |
< |
|
372 |
< |
Win=i; |
255 |
> |
|
256 |
|
VHbbEventAuxInfo::ParticleMCInfo wtemp; |
257 |
|
wtemp.status=st; |
258 |
|
wtemp.charge=p.charge(); |
259 |
|
if(p.mother(0)!=0) wtemp.momid=p.mother(0)->pdgId(); |
260 |
|
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) wtemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
261 |
|
wtemp.p4=GENPTOLOR(p); |
262 |
< |
|
262 |
> |
|
263 |
|
int ndau = p.numberOfDaughters(); |
264 |
|
for(int j = 0; j < ndau; ++ j) { |
265 |
|
const Candidate * Wdau = p.daughter( j ); |
268 |
|
} |
269 |
|
auxInfo->mcW.push_back(wtemp); |
270 |
|
} |
271 |
+ |
|
272 |
+ |
if(abs(id)==15) { |
273 |
+ |
VHbbEventAuxInfo::ParticleMCInfo tautemp; |
274 |
+ |
tautemp.status=st; |
275 |
+ |
tautemp.charge=p.charge(); |
276 |
+ |
if(p.mother(0)!=0) tautemp.momid=p.mother(0)->pdgId(); |
277 |
+ |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) tautemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
278 |
+ |
tautemp.p4=GENPTOLOR(p); |
279 |
+ |
|
280 |
+ |
int ndau = p.numberOfDaughters(); |
281 |
+ |
for(int j = 0; j < ndau; ++ j) { |
282 |
+ |
const Candidate * Taudau = p.daughter( j ); |
283 |
+ |
tautemp.dauid.push_back(Taudau->pdgId()); |
284 |
+ |
tautemp.dauFourMomentum.push_back(GENPTOLORP(Taudau)); |
285 |
+ |
} |
286 |
+ |
auxInfo->mcTau.push_back(tautemp); |
287 |
+ |
} |
288 |
|
|
289 |
|
if(abs(id)==23){ |
290 |
|
|
291 |
< |
Zin=i; |
291 |
> |
|
292 |
|
VHbbEventAuxInfo::ParticleMCInfo ztemp; |
293 |
|
ztemp.status=st; |
294 |
|
ztemp.charge=p.charge(); |
300 |
|
for(int j = 0; j < ndau; ++ j) { |
301 |
|
const Candidate * Zdau = p.daughter( j ); |
302 |
|
ztemp.dauid.push_back(Zdau->pdgId()); |
303 |
< |
ztemp.dauFourMomentum.push_back(GENPTOLOR(p)); |
303 |
> |
ztemp.dauFourMomentum.push_back(GENPTOLORP(Zdau)); |
304 |
|
} |
305 |
|
auxInfo->mcZ.push_back(ztemp); |
306 |
|
} |
310 |
|
|
311 |
|
|
312 |
|
if(id==5){ |
313 |
< |
bin=i; |
313 |
> |
|
314 |
|
VHbbEventAuxInfo::ParticleMCInfo btemp; |
315 |
|
btemp.status=st; |
316 |
|
btemp.charge=p.charge(); |
317 |
|
if(p.mother(0)!=0) btemp.momid=p.mother(0)->pdgId(); |
318 |
|
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) btemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
319 |
+ |
|
320 |
+ |
btemp.p4=GENPTOLOR(p); |
321 |
+ |
|
322 |
+ |
int nHDaubdau = p.numberOfDaughters(); |
323 |
+ |
for(int j = 0; j < nHDaubdau; ++ j) { |
324 |
+ |
const Candidate * Bdau = p.daughter( j ); |
325 |
+ |
btemp.dauid.push_back(Bdau->pdgId()); |
326 |
+ |
} |
327 |
|
auxInfo->mcB.push_back(btemp); |
328 |
|
} |
329 |
|
|
330 |
|
if(id==-5){ |
331 |
< |
bbarin=i; |
331 |
> |
|
332 |
|
VHbbEventAuxInfo::ParticleMCInfo bbtemp; |
333 |
|
|
334 |
|
bbtemp.status=st; |
335 |
|
bbtemp.charge=p.charge(); |
336 |
|
if(p.mother(0)!=0) bbtemp.momid=p.mother(0)->pdgId(); |
337 |
|
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) bbtemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
338 |
+ |
|
339 |
+ |
bbtemp.p4=GENPTOLOR(p); |
340 |
+ |
|
341 |
+ |
int nHDaubdau = p.numberOfDaughters(); |
342 |
+ |
for(int j = 0; j < nHDaubdau; ++ j) { |
343 |
+ |
const Candidate * Bdau = p.daughter( j ); |
344 |
+ |
bbtemp.dauid.push_back(Bdau->pdgId()); |
345 |
+ |
} |
346 |
+ |
|
347 |
+ |
|
348 |
|
auxInfo->mcBbar.push_back(bbtemp); |
349 |
|
} |
350 |
|
|
354 |
|
ctemp.charge=p.charge(); |
355 |
|
if(p.mother(0)!=0) ctemp.momid=p.mother(0)->pdgId(); |
356 |
|
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) ctemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
357 |
+ |
|
358 |
+ |
ctemp.p4=GENPTOLOR(p); |
359 |
+ |
|
360 |
+ |
int nHDaubdau = p.numberOfDaughters(); |
361 |
+ |
for(int j = 0; j < nHDaubdau; ++ j) { |
362 |
+ |
const Candidate * Bdau = p.daughter( j ); |
363 |
+ |
ctemp.dauid.push_back(Bdau->pdgId()); |
364 |
+ |
} |
365 |
+ |
|
366 |
|
auxInfo->mcC.push_back(ctemp); |
367 |
+ |
|
368 |
|
} |
441 |
– |
|
442 |
– |
if(bin!=-99 && bbarin!=-99){ |
443 |
– |
const Candidate & bGen = (*genParticles)[bin]; |
444 |
– |
const Candidate & bbarGen = (*genParticles)[bbarin]; |
445 |
– |
((auxInfo->mcB).back()).p4=GENPTOLOR(bGen); |
446 |
– |
((auxInfo->mcBbar).back()).p4=GENPTOLOR(bbarGen); |
447 |
– |
|
448 |
– |
int nHDaubdau = bGen.numberOfDaughters(); |
449 |
– |
for(int j = 0; j < nHDaubdau; ++ j) { |
450 |
– |
const Candidate * Bdau = bGen.daughter( j ); |
451 |
– |
((auxInfo->mcB).back()).dauid.push_back(Bdau->pdgId()); |
452 |
– |
((auxInfo->mcB).back()).dauFourMomentum.push_back(GENPTOLORP(Bdau)); |
453 |
– |
} |
454 |
– |
int nHDaubbardau = bbarGen.numberOfDaughters(); |
455 |
– |
for(int j = 0; j < nHDaubbardau; ++ j) { |
456 |
– |
const Candidate * Bbardau = bbarGen.daughter( j ); |
457 |
– |
((auxInfo->mcBbar).back()).dauid.push_back(Bbardau->pdgId()); |
458 |
– |
((auxInfo->mcBbar).back()).dauFourMomentum.push_back(GENPTOLORP(Bbardau)); |
459 |
– |
} |
460 |
– |
|
461 |
– |
} |
369 |
|
|
370 |
|
} |
371 |
|
|
465 |
– |
|
372 |
|
} // isMC |
373 |
|
|
374 |
|
/////// end generator block |
388 |
|
iEvent.getByLabel(subjetLabel_,subjetHandle); |
389 |
|
edm::View<pat::Jet> subjets = *subjetHandle; |
390 |
|
|
391 |
+ |
// filter jet |
392 |
+ |
edm::Handle<edm::View<pat::Jet> > filterjetHandle; |
393 |
+ |
iEvent.getByLabel(filterjetLabel_,filterjetHandle); |
394 |
+ |
edm::View<pat::Jet> filterjets = *filterjetHandle; |
395 |
+ |
|
396 |
|
// standard jets |
397 |
|
|
398 |
|
edm::Handle<edm::View<pat::Jet> > simplejet1Handle; |
416 |
|
iEvent.getByLabel(eleLabel_,electronHandle); |
417 |
|
edm::View<pat::Electron> electrons = *electronHandle; |
418 |
|
|
508 |
– |
edm::Handle<edm::View<pat::MET> > metHandle; |
509 |
– |
iEvent.getByLabel(metLabel_,metHandle); |
510 |
– |
edm::View<pat::MET> mets = *metHandle; |
419 |
|
|
420 |
|
// edm::Handle<edm::View<pat::Photon> > phoHandle; |
421 |
|
// iEvent.getByLabel(phoLabel_,phoHandle); |
425 |
|
iEvent.getByLabel(tauLabel_,tauHandle); |
426 |
|
edm::View<pat::Tau> taus = *tauHandle; |
427 |
|
|
520 |
– |
edm::Handle<CandidateView> dimuons; |
521 |
– |
iEvent.getByLabel(dimuLabel_,dimuons); |
522 |
– |
|
523 |
– |
edm::Handle<CandidateView> dielectrons; |
524 |
– |
iEvent.getByLabel(dielecLabel_,dielectrons); |
428 |
|
|
429 |
+ |
//BTAGGING SCALE FACTOR FROM DATABASE |
430 |
+ |
//Combined Secondary Vertex Loose |
431 |
+ |
edm::ESHandle<BtagPerformance> bTagSF_CSVL_; |
432 |
+ |
iSetup.get<BTagPerformanceRecord>().get("BTAGCSVL",bTagSF_CSVL_); |
433 |
+ |
//Combined Secondary Vertex Medium |
434 |
+ |
edm::ESHandle<BtagPerformance> bTagSF_CSVM_; |
435 |
+ |
iSetup.get<BTagPerformanceRecord>().get("BTAGCSVM",bTagSF_CSVM_); |
436 |
+ |
//Combined Secondary Vertex Tight |
437 |
+ |
edm::ESHandle<BtagPerformance> bTagSF_CSVT_; |
438 |
+ |
iSetup.get<BTagPerformanceRecord>().get("BTAGCSVT",bTagSF_CSVT_); |
439 |
+ |
|
440 |
+ |
edm::ESHandle<BtagPerformance> mistagSF_CSVL_; |
441 |
+ |
iSetup.get<BTagPerformanceRecord>().get("MISTAGCSVL",mistagSF_CSVL_); |
442 |
+ |
//Combined Secondary Vertex Medium |
443 |
+ |
edm::ESHandle<BtagPerformance> mistagSF_CSVM_; |
444 |
+ |
iSetup.get<BTagPerformanceRecord>().get("MISTAGCSVM",mistagSF_CSVM_); |
445 |
+ |
//Combined Secondary Vertex Tight |
446 |
+ |
edm::ESHandle<BtagPerformance> mistagSF_CSVT_; |
447 |
+ |
iSetup.get<BTagPerformanceRecord>().get("MISTAGCSVT",mistagSF_CSVT_); |
448 |
+ |
|
449 |
+ |
BTagSFContainer btagSFs; |
450 |
+ |
btagSFs.BTAGSF_CSVL = (bTagSF_CSVL_.product()); |
451 |
+ |
btagSFs.BTAGSF_CSVM = (bTagSF_CSVM_.product()); |
452 |
+ |
btagSFs.BTAGSF_CSVT = (bTagSF_CSVT_.product()); |
453 |
+ |
btagSFs.MISTAGSF_CSVL = (mistagSF_CSVL_.product()); |
454 |
+ |
btagSFs.MISTAGSF_CSVM = (mistagSF_CSVM_.product()); |
455 |
+ |
btagSFs.MISTAGSF_CSVT = (mistagSF_CSVT_.product()); |
456 |
|
|
457 |
+ |
#ifdef ENABLE_SIMPLEJETS1 |
458 |
|
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets1.begin(); jet_iter!=simplejets1.end(); ++jet_iter){ |
459 |
|
// if(jet_iter->pt()>50) |
460 |
|
// njetscounter++; |
461 |
|
VHbbEvent::SimpleJet sj; |
462 |
< |
sj.flavour = jet_iter->partonFlavour(); |
462 |
> |
// std::cout <<" sj1"<<std::endl; |
463 |
> |
fillSimpleJet(sj,jet_iter); |
464 |
> |
// if(!runOnMC_) |
465 |
|
|
466 |
< |
sj.tche=jet_iter->bDiscriminator("trackCountingHighEffBJetTags"); |
534 |
< |
sj.tchp=jet_iter->bDiscriminator("trackCountingHighPurBJetTags"); |
535 |
< |
sj.jp=jet_iter->bDiscriminator("jetProbabilityBJetTags"); |
536 |
< |
sj.jpb=jet_iter->bDiscriminator("jetBProbabilityBJetTags"); |
537 |
< |
sj.ssvhe=jet_iter->bDiscriminator("simpleSecondaryVertexHighEffBJetTags"); |
538 |
< |
sj.csv=jet_iter->bDiscriminator("combinedSecondaryVertexBJetTags"); |
539 |
< |
sj.csvmva=jet_iter->bDiscriminator("combinedSecondaryVertexMVABJetTags"); |
540 |
< |
sj.charge=jet_iter->jetCharge(); |
541 |
< |
sj.ntracks=jet_iter->associatedTracks().size(); |
542 |
< |
sj.p4=GENPTOLORP(jet_iter); |
543 |
< |
sj.chargedTracksFourMomentum=(getChargedTracksMomentum(&*(jet_iter))); |
544 |
< |
|
545 |
< |
// |
546 |
< |
// add tVector |
547 |
< |
// |
548 |
< |
sj.tVector = getTvect(&(*jet_iter)); |
466 |
> |
setJecUnc(sj,jecUnc); |
467 |
|
|
468 |
|
Particle::LorentzVector p4Jet = jet_iter->p4(); |
469 |
|
|
470 |
|
if(runOnMC_){ |
471 |
< |
double minb1DR=9999.; |
472 |
< |
for(size_t i = 0; i < genParticles->size(); ++ i) { |
473 |
< |
const GenParticle & p = (*genParticles)[i]; |
474 |
< |
int id = p.pdgId(); |
475 |
< |
if(abs(id)<=6 || id==21 || id==23 || abs(id)==24){ |
476 |
< |
double bb1DR=TMath::Sqrt((p.eta()-p4Jet.eta())*(p.eta()-p4Jet.eta())+ |
477 |
< |
(p.phi()-p4Jet.phi())*(p.phi()-p4Jet.phi())); |
478 |
< |
if(bb1DR<minb1DR) {minb1DR=bb1DR; sj.bestMCid=id; if(p.mother()!=0) sj.bestMCmomid=p.mother()->pdgId();} |
471 |
> |
|
472 |
> |
fillScaleFactors(sj, btagSFs); |
473 |
> |
|
474 |
> |
//PAT genJet matching |
475 |
> |
//genJet |
476 |
> |
const reco::GenJet *gJ = jet_iter->genJet(); |
477 |
> |
//physical parton for mother info ONLY |
478 |
> |
if( (jet_iter->genParton()) ){ |
479 |
> |
sj.bestMCid = jet_iter->genParton()->pdgId(); |
480 |
> |
if( (jet_iter->genParton()->mother()) ) |
481 |
> |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
482 |
> |
} |
483 |
> |
TLorentzVector gJp4; |
484 |
> |
if(gJ){ |
485 |
> |
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
486 |
> |
sj.bestMCp4 = gJp4; |
487 |
> |
if(verbose_){ |
488 |
> |
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
489 |
> |
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
490 |
> |
std::clog << "genJet matched deltaR = " <<gJp4.DeltaR(sj.p4) << std::endl; |
491 |
> |
std::clog << "genJet matched mother id = " << sj.bestMCmomid << std::endl; |
492 |
|
} |
493 |
|
} |
494 |
< |
} //isMC |
494 |
> |
|
495 |
> |
} //isMC |
496 |
|
hbbInfo->simpleJets.push_back(sj); |
497 |
|
|
498 |
|
} |
499 |
< |
|
499 |
> |
#endif //ENABLE_SIMPLEJETS1 |
500 |
> |
|
501 |
> |
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets3.begin(); jet_iter!=simplejets3.end(); ++jet_iter){ |
502 |
> |
// if(jet_iter->pt()>50) |
503 |
> |
// njetscounter++; |
504 |
> |
VHbbEvent::SimpleJet sj; |
505 |
> |
// std::cout <<" sj3"<<std::endl; |
506 |
> |
fillSimpleJet(sj,jet_iter); |
507 |
> |
// if(!runOnMC_) |
508 |
> |
setJecUnc(sj,jecUnc); |
509 |
> |
|
510 |
> |
Particle::LorentzVector p4Jet = jet_iter->p4(); |
511 |
> |
|
512 |
> |
if(runOnMC_){ |
513 |
> |
|
514 |
> |
fillScaleFactors(sj, btagSFs); |
515 |
> |
|
516 |
> |
//PAT genJet matching |
517 |
> |
//genJet |
518 |
> |
const reco::GenJet *gJ = jet_iter->genJet(); |
519 |
> |
//physical parton for mother info ONLY |
520 |
> |
if( (jet_iter->genParton()) ){ |
521 |
> |
sj.bestMCid = jet_iter->genParton()->pdgId(); |
522 |
> |
if( (jet_iter->genParton()->mother()) ) |
523 |
> |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
524 |
> |
} |
525 |
> |
TLorentzVector gJp4; |
526 |
> |
if(gJ){ |
527 |
> |
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
528 |
> |
sj.bestMCp4 = gJp4; |
529 |
> |
if(verbose_){ |
530 |
> |
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
531 |
> |
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
532 |
> |
std::clog << "genJet matched deltaR = " <<gJp4.DeltaR(sj.p4) << std::endl; |
533 |
> |
std::clog << "genJet matched mother id = " << sj.bestMCmomid << std::endl; |
534 |
> |
} |
535 |
> |
} |
536 |
> |
|
537 |
> |
} //isMC |
538 |
> |
// |
539 |
> |
|
540 |
> |
|
541 |
> |
hbbInfo->simpleJets3.push_back(sj); |
542 |
> |
|
543 |
> |
} |
544 |
> |
|
545 |
> |
#ifdef ENABLE_SIMPLEJETS4 |
546 |
> |
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets4.begin(); jet_iter!=simplejets4.end(); ++jet_iter){ |
547 |
> |
// if(jet_iter->pt()>50) |
548 |
> |
// njetscounter++; |
549 |
> |
VHbbEvent::SimpleJet sj; |
550 |
> |
// std::cout <<" sj4"<<std::endl; |
551 |
> |
fillSimpleJet(sj,jet_iter); |
552 |
> |
// if(!runOnMC_) |
553 |
> |
setJecUnc(sj,jecUnc); |
554 |
> |
|
555 |
> |
|
556 |
> |
Particle::LorentzVector p4Jet = jet_iter->p4(); |
557 |
> |
|
558 |
> |
if(runOnMC_){ |
559 |
> |
|
560 |
> |
fillScaleFactors(sj, btagSFs); |
561 |
> |
|
562 |
> |
//PAT genJet matching |
563 |
> |
//genJet |
564 |
> |
const reco::GenJet *gJ = jet_iter->genJet(); |
565 |
> |
//physical parton for mother info ONLY |
566 |
> |
if( (jet_iter->genParton()) ){ |
567 |
> |
sj.bestMCid = jet_iter->genParton()->pdgId(); |
568 |
> |
if( (jet_iter->genParton()->mother()) ) |
569 |
> |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
570 |
> |
} |
571 |
> |
TLorentzVector gJp4; |
572 |
> |
if(gJ){ |
573 |
> |
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
574 |
> |
sj.bestMCp4 = gJp4; |
575 |
> |
if(verbose_){ |
576 |
> |
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
577 |
> |
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
578 |
> |
std::clog << "genJet matched deltaR = " <<gJp4.DeltaR(sj.p4) << std::endl; |
579 |
> |
std::clog << "genJet matched mother id = " << sj.bestMCmomid << std::endl; |
580 |
> |
} |
581 |
> |
} |
582 |
> |
|
583 |
> |
} //isMC |
584 |
> |
hbbInfo->simpleJets4.push_back(sj); |
585 |
> |
|
586 |
> |
} |
587 |
> |
#endif //ENABLE SIMPLEJETS4 |
588 |
> |
|
589 |
|
|
590 |
|
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets2.begin(); jet_iter!=simplejets2.end(); ++jet_iter){ |
591 |
|
|
592 |
|
VHbbEvent::SimpleJet sj; |
593 |
< |
sj.flavour = jet_iter->partonFlavour(); |
593 |
> |
// std::cout <<" sj2"<<std::endl; |
594 |
> |
fillSimpleJet(sj,jet_iter); |
595 |
> |
// if(!runOnMC_) |
596 |
> |
setJecUnc(sj,jecUnc); |
597 |
> |
/* sj.flavour = jet_iter->partonFlavour(); |
598 |
|
|
599 |
|
|
600 |
|
sj.tche=jet_iter->bDiscriminator("trackCountingHighEffBJetTags"); |
608 |
|
sj.ntracks=jet_iter->associatedTracks().size(); |
609 |
|
sj.p4=GENPTOLORP(jet_iter); |
610 |
|
sj.chargedTracksFourMomentum=(getChargedTracksMomentum(&*(jet_iter))); |
611 |
< |
sj.tVector = getTvect(&(*jet_iter)); |
611 |
> |
sj.SF_CSVL=1; |
612 |
> |
sj.SF_CSVM=1; |
613 |
> |
sj.SF_CSVT=1; |
614 |
> |
sj.SF_CSVLerr=0; |
615 |
> |
sj.SF_CSVMerr=0; |
616 |
> |
sj.SF_CSVTerr=0; |
617 |
> |
|
618 |
> |
// |
619 |
> |
// addtaginfo for csv |
620 |
> |
// |
621 |
> |
|
622 |
> |
if (jet_iter->hasTagInfo("SimpleSecondaryVertex")) { |
623 |
> |
|
624 |
> |
const reco::SecondaryVertexTagInfo * tf = jet_iter->tagInfoSecondaryVertex(); |
625 |
> |
sj.vtxMass = tf->secondaryVertex(0).p4().mass(); |
626 |
> |
sj.vtxNTracks = tf->secondaryVertex(0).nTracks(); |
627 |
> |
Measurement1D m = tf->flightDistance(0); |
628 |
> |
sj.vtx3dL = m.value(); |
629 |
> |
sj.vtx3deL = m.error(); |
630 |
> |
} |
631 |
> |
|
632 |
|
|
633 |
+ |
// |
634 |
+ |
// add tVector |
635 |
+ |
// |
636 |
+ |
sj.tVector = getTvect(&(*jet_iter)); |
637 |
+ |
*/ |
638 |
|
Particle::LorentzVector p4Jet = jet_iter->p4(); |
639 |
|
|
640 |
|
if(runOnMC_){ |
641 |
< |
double minb2DR=9999.; |
642 |
< |
for(size_t i = 0; i < genParticles->size(); ++ i) { |
643 |
< |
const GenParticle & p = (*genParticles)[i]; |
644 |
< |
int id = p.pdgId(); |
645 |
< |
if(abs(id)<=6 || id==21 || id==23 || abs(id)==24){ |
646 |
< |
double bb2DR=TMath::Sqrt((p.eta()-p4Jet.eta())*(p.eta()-p4Jet.eta())+ |
647 |
< |
(p.phi()-p4Jet.phi())*(p.phi()-p4Jet.phi())); |
648 |
< |
if(bb2DR<minb2DR) {minb2DR=bb2DR; sj.bestMCid=id; if(p.mother()!=0) sj.bestMCmomid=p.mother()->pdgId();} |
641 |
> |
|
642 |
> |
//BTV scale factors |
643 |
> |
fillScaleFactors(sj, btagSFs); |
644 |
> |
|
645 |
> |
//PAT genJet matching |
646 |
> |
//genJet |
647 |
> |
const reco::GenJet *gJ = jet_iter->genJet(); |
648 |
> |
//physical parton for mother info ONLY |
649 |
> |
if( (jet_iter->genParton()) ){ |
650 |
> |
sj.bestMCid = jet_iter->genParton()->pdgId(); |
651 |
> |
if( (jet_iter->genParton()->mother()) ) |
652 |
> |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
653 |
> |
} |
654 |
> |
TLorentzVector gJp4; |
655 |
> |
if(gJ){ |
656 |
> |
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
657 |
> |
sj.bestMCp4 = gJp4; |
658 |
> |
if(verbose_){ |
659 |
> |
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
660 |
> |
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
661 |
> |
std::clog << "genJet matched deltaR = " << gJp4.DeltaR(sj.p4) << std::endl; |
662 |
> |
std::clog << "genJet matched mother id = " << sj.bestMCmomid << std::endl; |
663 |
|
} |
664 |
|
} |
665 |
< |
} //isMC |
665 |
> |
|
666 |
> |
// add flag if a mc lepton is find inside a cone around the jets... |
667 |
> |
iEvent.getByLabel("genParticles", genParticles); |
668 |
> |
|
669 |
> |
for(size_t i = 0; i < genParticles->size(); ++ i) { |
670 |
> |
|
671 |
> |
const GenParticle & p = (*genParticles)[i]; |
672 |
> |
int id = 0; |
673 |
> |
p.pt()> lep_ptCutForBjets_ ? id= p.pdgId(): 0; |
674 |
> |
|
675 |
> |
// std::cout<< "found a muon with pt " << mu->pt() << std::endl; |
676 |
> |
if ((abs(id)==13 || abs(id)==11) && deltaR(p.eta(), p.phi(), sj.p4.Eta(), sj.p4.Phi() ) <0.5) sj.isSemiLeptMCtruth=1; |
677 |
> |
} |
678 |
> |
|
679 |
> |
} //isMC |
680 |
> |
|
681 |
> |
// add flag if a reco lepton is find inside a cone around the jets... |
682 |
> |
edm::Handle<edm::View<reco::Candidate> > muonNoCutsHandle; |
683 |
> |
iEvent.getByLabel(muonoCutsLabel_,muonNoCutsHandle); |
684 |
> |
edm::View<reco::Candidate> muonsNoCuts = *muonNoCutsHandle; |
685 |
> |
|
686 |
> |
|
687 |
> |
|
688 |
> |
for(edm::View<reco::Candidate>::const_iterator mu = muonsNoCuts.begin(); mu!=muonsNoCuts.end() && sj.isSemiLept!=1; ++mu){ |
689 |
> |
// std::cout<< "found a muon with pt " << mu->pt() << std::endl; |
690 |
> |
const pat::Muon& m = static_cast <const pat::Muon&> (*mu); |
691 |
> |
float Smpt = m.pt(); |
692 |
> |
float Smeta = m.eta(); |
693 |
> |
float Smphi = m.phi(); |
694 |
> |
|
695 |
> |
float SmJdR = deltaR(Smeta, Smphi, sj.p4.Eta(), sj.p4.Phi()); |
696 |
> |
|
697 |
> |
if ( Smpt> lep_ptCutForBjets_ && SmJdR <0.5) { |
698 |
> |
sj.isSemiLept=1; |
699 |
> |
//isSemiLept(-99), isSemiLeptMCtruth(-99), SoftLeptPt(-99), SoftLeptdR(-99), SoftLeptptRel(-99), SoftLeptpdgId(-99), SoftLeptIdlooseMu(-99), SoftLeptId95(-99), SoftLeptRelCombIso(-99), |
700 |
> |
sj.SoftLeptpdgId =13; |
701 |
> |
sj.SoftLeptdR= SmJdR; |
702 |
> |
sj.SoftLeptPt=Smpt; |
703 |
> |
TVector3 mvec ( m.p4().Vect().X(), m.p4().Vect().Y(), m.p4().Vect().Z() ); |
704 |
> |
sj.SoftLeptptRel= sj.p4.Perp( mvec ); |
705 |
> |
sj.SoftLeptRelCombIso = (m.trackIso() + m.ecalIso() + m.hcalIso() ) / Smpt ; |
706 |
> |
sj.SoftLeptIdlooseMu=m.muonID("TMLastStationLoose"); |
707 |
> |
} |
708 |
> |
} |
709 |
> |
|
710 |
> |
|
711 |
> |
edm::Handle<edm::View<reco::Candidate> > eleNoCutsHandle; |
712 |
> |
iEvent.getByLabel(elenoCutsLabel_,eleNoCutsHandle); |
713 |
> |
edm::View<reco::Candidate> elesNoCuts = *eleNoCutsHandle; |
714 |
> |
|
715 |
> |
|
716 |
> |
|
717 |
> |
for(edm::View<reco::Candidate>::const_iterator ele = elesNoCuts.begin(); ele!=elesNoCuts.end() && sj.isSemiLept!=1; ++ele){ |
718 |
> |
|
719 |
> |
const pat::Electron& e = static_cast <const pat::Electron&> (*ele); |
720 |
> |
float Smpt = e.pt(); |
721 |
> |
float Smeta = e.eta(); |
722 |
> |
float Smphi = e.phi(); |
723 |
> |
|
724 |
> |
float SmJdR = deltaR(Smeta, Smphi, sj.p4.Eta(), sj.p4.Phi()); |
725 |
> |
if ( Smpt> lep_ptCutForBjets_ && SmJdR <0.5) { |
726 |
> |
sj.isSemiLept=1; |
727 |
> |
sj.SoftLeptpdgId =11; |
728 |
> |
sj.SoftLeptdR= SmJdR; |
729 |
> |
sj.SoftLeptPt=Smpt; |
730 |
> |
TVector3 mvec ( e.p4().Vect().X(), e.p4().Vect().Y(), e.p4().Vect().Z() ); |
731 |
> |
sj.SoftLeptptRel= sj.p4.Perp( mvec ); |
732 |
> |
sj.SoftLeptRelCombIso = (e.trackIso() + e.ecalIso() + e.hcalIso() ) / Smpt ; |
733 |
> |
// sj.SoftLeptId95=e.electronID("eidVBTFCom95"); |
734 |
> |
//std::cout << "before ele id " << std::endl; |
735 |
> |
// std::cout << " e.e.sigmaIetaIeta " << e.sigmaIetaIeta() << std::endl; |
736 |
> |
//std::cout << " e.isEB() " << e.isEB() << std::endl; |
737 |
> |
if ( |
738 |
> |
( fabs(Smeta)<2.5 && !( abs(Smeta)>1.4442 && abs(Smeta)<1.566)) && |
739 |
> |
|
740 |
> |
(( abs(Smeta)>1.566 && (e.sigmaIetaIeta()<0.01) && ( e.deltaPhiSuperClusterTrackAtVtx()<0.8 && e.deltaPhiSuperClusterTrackAtVtx()>-0.8) && ( e.deltaEtaSuperClusterTrackAtVtx()<0.007 && e.deltaEtaSuperClusterTrackAtVtx()>-0.007 ) ) |
741 |
> |
|| ( abs(Smeta)<1.4442 && (e.sigmaIetaIeta()<0.03) && ( e.deltaPhiSuperClusterTrackAtVtx()<0.7 && e.deltaPhiSuperClusterTrackAtVtx()>-0.7 ) && ( e.deltaEtaSuperClusterTrackAtVtx()<0.01 && e.deltaEtaSuperClusterTrackAtVtx()>-0.01 ) )) |
742 |
> |
) |
743 |
> |
sj.SoftLeptId95=1; |
744 |
> |
} |
745 |
> |
} |
746 |
> |
|
747 |
> |
|
748 |
> |
|
749 |
> |
|
750 |
|
|
751 |
|
hbbInfo->simpleJets2.push_back(sj); |
752 |
|
|
784 |
|
VHbbEvent::HardJet hj; |
785 |
|
hj.constituents=constituents.size(); |
786 |
|
hj.p4 =GENPTOLORP(jet_iter); |
787 |
< |
|
787 |
> |
|
788 |
|
for (unsigned int iJC(0); iJC<constituents.size(); ++iJC ){ |
789 |
|
Jet::Constituent icandJet = constituents[iJC]; |
790 |
|
|
817 |
|
<< "," << subjet_iter->bDiscriminator("combinedSecondaryVertexBJetTags") << "\n";} |
818 |
|
|
819 |
|
VHbbEvent::SimpleJet sj; |
820 |
< |
|
821 |
< |
sj.flavour = subjet_iter->partonFlavour(); |
820 |
> |
// std::cout <<" sub jet "<<std::endl; |
821 |
> |
fillSimpleJet(sj,subjet_iter); |
822 |
> |
// if(!runOnMC_) |
823 |
> |
setJecUnc(sj,jecUnc); |
824 |
> |
/* sj.flavour = subjet_iter->partonFlavour(); |
825 |
|
sj.tVector = getTvect(&(*subjet_iter)); |
826 |
|
sj.tche=subjet_iter->bDiscriminator("trackCountingHighEffBJetTags"); |
827 |
|
sj.tchp=subjet_iter->bDiscriminator("trackCountingHighPurBJetTags"); |
834 |
|
sj.ntracks=subjet_iter->associatedTracks().size(); |
835 |
|
sj.p4=GENPTOLORP(subjet_iter); |
836 |
|
sj.p4=(getChargedTracksMomentum(&*(subjet_iter))); |
837 |
+ |
|
838 |
+ |
// |
839 |
+ |
// addtaginfo for csv |
840 |
+ |
// |
841 |
+ |
|
842 |
+ |
if (subjet_iter->hasTagInfo("SimpleSecondaryVertex")) { |
843 |
+ |
|
844 |
+ |
const reco::SecondaryVertexTagInfo * tf = subjet_iter->tagInfoSecondaryVertex(); |
845 |
+ |
sj.vtxMass = tf->secondaryVertex(0).p4().mass(); |
846 |
+ |
sj.vtxNTracks = tf->secondaryVertex(0).nTracks(); |
847 |
+ |
Measurement1D m = tf->flightDistance(0); |
848 |
+ |
sj.vtx3dL = m.value(); |
849 |
+ |
sj.vtx3deL = m.error(); |
850 |
+ |
} |
851 |
+ |
*/ |
852 |
|
hbbInfo->subJets.push_back(sj); |
853 |
|
|
854 |
|
} |
855 |
|
|
856 |
+ |
for(edm::View<pat::Jet>::const_iterator filterjet_iter = filterjets.begin(); filterjet_iter!=filterjets.end(); ++filterjet_iter){ |
857 |
+ |
|
858 |
+ |
if(printJet) {std::cout << "FilterjetTagged Pt: " << filterjet_iter->pt() << " E,M,eta,phi,Btag: " << filterjet_iter->p4().E() << "," << filterjet_iter->p4().M() << "," << filterjet_iter->eta() << "," << filterjet_iter->phi() << "," << filterjet_iter->bDiscriminator("combinedSecondaryVertexBJetTags") << "\n";} |
859 |
+ |
|
860 |
+ |
VHbbEvent::SimpleJet fj; |
861 |
+ |
// std::cout <<" sub jet "<<std::endl; |
862 |
+ |
fillSimpleJet(fj,filterjet_iter); |
863 |
+ |
// if(!runOnMC_) |
864 |
+ |
setJecUnc(fj,jecUnc); |
865 |
+ |
|
866 |
+ |
hbbInfo->filterJets.push_back(fj); |
867 |
+ |
|
868 |
+ |
|
869 |
+ |
} |
870 |
+ |
|
871 |
+ |
// |
872 |
+ |
// add charged met |
873 |
+ |
// |
874 |
+ |
|
875 |
+ |
edm::Handle<edm::View<reco::MET> > metChargedHandle; |
876 |
+ |
iEvent.getByLabel("pfMETNoPUCharge",metChargedHandle); |
877 |
+ |
edm::View<reco::MET> metsCh = *metChargedHandle; |
878 |
+ |
if(metsCh.size()){ |
879 |
+ |
hbbInfo->metCh.sumEt=(metsCh[0]).sumEt(); |
880 |
+ |
hbbInfo->metCh.metSig=metSignificance(& (metsCh[0])); |
881 |
+ |
hbbInfo->metCh.eLong=(metsCh[0]).e_longitudinal(); |
882 |
+ |
hbbInfo->metCh.p4=GENPTOLOR((metsCh[0])); |
883 |
+ |
if (verbose_) std::cout <<" METCharged "<< hbbInfo->metCh.metSig <<" " << hbbInfo->metCh.sumEt<<std::endl; |
884 |
+ |
} |
885 |
+ |
|
886 |
+ |
// type 1 corr met |
887 |
+ |
edm::Handle<edm::View<reco::MET> > pfmetType1corrHandle; |
888 |
+ |
iEvent.getByLabel("patType1CorrectedPFMet",pfmetType1corrHandle); |
889 |
+ |
edm::View<reco::MET> pfmetsType1corr = *pfmetType1corrHandle; |
890 |
+ |
if(pfmetsType1corr.size()){ |
891 |
+ |
hbbInfo->pfmetType1corr.sumEt=(pfmetsType1corr[0]).sumEt(); |
892 |
+ |
hbbInfo->pfmetType1corr.metSig=metSignificance(& (pfmetsType1corr[0])); |
893 |
+ |
hbbInfo->pfmetType1corr.eLong=(pfmetsType1corr[0]).e_longitudinal(); |
894 |
+ |
hbbInfo->pfmetType1corr.p4=GENPTOLOR((pfmetsType1corr[0])); |
895 |
+ |
if (verbose_) std::cout <<" type 1 corrected pfMET "<< hbbInfo->pfmetType1corr.metSig <<" " << hbbInfo->pfmetType1corr.sumEt<<std::endl; |
896 |
+ |
} |
897 |
+ |
|
898 |
+ |
|
899 |
+ |
// type 1 + 2 corr met |
900 |
+ |
edm::Handle<edm::View<reco::MET> > pfmetType1p2corrHandle; |
901 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMet",pfmetType1p2corrHandle); |
902 |
+ |
edm::View<reco::MET> pfmetsType1p2corr = *pfmetType1p2corrHandle; |
903 |
+ |
if(pfmetsType1p2corr.size()){ |
904 |
+ |
hbbInfo->pfmetType1p2corr.sumEt=(pfmetsType1p2corr[0]).sumEt(); |
905 |
+ |
hbbInfo->pfmetType1p2corr.metSig=metSignificance(& (pfmetsType1p2corr[0])); |
906 |
+ |
hbbInfo->pfmetType1p2corr.eLong=(pfmetsType1p2corr[0]).e_longitudinal(); |
907 |
+ |
hbbInfo->pfmetType1p2corr.p4=GENPTOLOR((pfmetsType1p2corr[0])); |
908 |
+ |
if (verbose_) std::cout <<" type 1 +2 corrected pfMET "<< hbbInfo->pfmetType1p2corr.metSig <<" " << hbbInfo->pfmetType1p2corr.sumEt<<std::endl; |
909 |
+ |
} |
910 |
+ |
|
911 |
+ |
// type 1 corr met NoPU |
912 |
+ |
edm::Handle<edm::View<reco::MET> > pfmetNoPUType1corrHandle; |
913 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetNoPU",pfmetNoPUType1corrHandle); |
914 |
+ |
edm::View<reco::MET> pfmetsNoPUType1corr = *pfmetNoPUType1corrHandle; |
915 |
+ |
if(pfmetsNoPUType1corr.size()){ |
916 |
+ |
hbbInfo->pfmetNoPUType1corr.sumEt=(pfmetsNoPUType1corr[0]).sumEt(); |
917 |
+ |
hbbInfo->pfmetNoPUType1corr.metSig=metSignificance(& (pfmetsNoPUType1corr[0])); |
918 |
+ |
hbbInfo->pfmetNoPUType1corr.eLong=(pfmetsNoPUType1corr[0]).e_longitudinal(); |
919 |
+ |
hbbInfo->pfmetNoPUType1corr.p4=GENPTOLOR((pfmetsNoPUType1corr[0])); |
920 |
+ |
if (verbose_) std::cout <<" type 1 corrected pfMET NoPU"<< hbbInfo->pfmetNoPUType1corr.metSig <<" " << hbbInfo->pfmetNoPUType1corr.sumEt<<std::endl; |
921 |
+ |
} |
922 |
+ |
|
923 |
+ |
|
924 |
+ |
// type 1 + 2 corr met |
925 |
+ |
edm::Handle<edm::View<reco::MET> > pfmetNoPUType1p2corrHandle; |
926 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetNoPU",pfmetNoPUType1p2corrHandle); |
927 |
+ |
edm::View<reco::MET> pfmetsNoPUType1p2corr = *pfmetNoPUType1p2corrHandle; |
928 |
+ |
if(pfmetsNoPUType1p2corr.size()){ |
929 |
+ |
hbbInfo->pfmetNoPUType1p2corr.sumEt=(pfmetsNoPUType1p2corr[0]).sumEt(); |
930 |
+ |
hbbInfo->pfmetNoPUType1p2corr.metSig=metSignificance(& (pfmetsNoPUType1p2corr[0])); |
931 |
+ |
hbbInfo->pfmetNoPUType1p2corr.eLong=(pfmetsNoPUType1p2corr[0]).e_longitudinal(); |
932 |
+ |
hbbInfo->pfmetNoPUType1p2corr.p4=GENPTOLOR((pfmetsNoPUType1p2corr[0])); |
933 |
+ |
if (verbose_) std::cout <<" type 1 +2 corrected pfMET "<< hbbInfo->pfmetNoPUType1p2corr.metSig <<" " << hbbInfo->pfmetNoPUType1p2corr.sumEt<<std::endl; |
934 |
+ |
} |
935 |
+ |
|
936 |
+ |
|
937 |
+ |
/* |
938 |
+ |
// MET uncertainty vector |
939 |
+ |
vector<pat::MET> "patType1CorrectedPFMet" "" "VH" |
940 |
+ |
vector<pat::MET> "patType1CorrectedPFMetElectronEnDown" "" "VH" |
941 |
+ |
vector<pat::MET> "patType1CorrectedPFMetElectronEnUp" "" "VH" |
942 |
+ |
vector<pat::MET> "patType1CorrectedPFMetJetEnDown" "" "VH" |
943 |
+ |
vector<pat::MET> "patType1CorrectedPFMetJetEnUp" "" "VH" |
944 |
+ |
vector<pat::MET> "patType1CorrectedPFMetJetResDown" "" "VH" |
945 |
+ |
vector<pat::MET> "patType1CorrectedPFMetJetResUp" "" "VH" |
946 |
+ |
vector<pat::MET> "patType1CorrectedPFMetMuonEnDown" "" "VH" |
947 |
+ |
vector<pat::MET> "patType1CorrectedPFMetMuonEnUp" "" "VH" |
948 |
+ |
vector<pat::MET> "patType1CorrectedPFMetNoPU" "" "VH" |
949 |
+ |
vector<pat::MET> "patType1CorrectedPFMetTauEnDown" "" "VH" |
950 |
+ |
vector<pat::MET> "patType1CorrectedPFMetTauEnUp" "" "VH" |
951 |
+ |
vector<pat::MET> "patType1CorrectedPFMetUnclusteredEnDown" "" "VH" |
952 |
+ |
vector<pat::MET> "patType1CorrectedPFMetUnclusteredEnUp" "" "VH" |
953 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMet" "" "VH" |
954 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetElectronEnDown" "" "VH" |
955 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetElectronEnUp" "" "VH" |
956 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetJetEnDown" "" "VH" |
957 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetJetEnUp" "" "VH" |
958 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetJetResDown" "" "VH" |
959 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetJetResUp" "" "VH" |
960 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetMuonEnDown" "" "VH" |
961 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetMuonEnUp" "" "VH" |
962 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetNoPU" "" "VH" |
963 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetTauEnDown" "" "VH" |
964 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetTauEnUp" "" "VH" |
965 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetUnclusteredEnDown" "" "VH" |
966 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetUnclusteredEnUp" "" "VH" |
967 |
+ |
*/ |
968 |
+ |
|
969 |
+ |
VHbbEvent::METInfo metunc; |
970 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetElectronEnDownHandle; |
971 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetElectronEnDown",patType1CorrectedPFMetElectronEnDownHandle); |
972 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsElectronEnDown = *patType1CorrectedPFMetElectronEnDownHandle; |
973 |
+ |
if(patType1CorrectedPFMetsElectronEnDown.size()){ |
974 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsElectronEnDown[0]).sumEt(); |
975 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsElectronEnDown[0])); |
976 |
+ |
metunc.eLong=(patType1CorrectedPFMetsElectronEnDown[0]).e_longitudinal(); |
977 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsElectronEnDown[0])); |
978 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
979 |
+ |
} |
980 |
+ |
|
981 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetElectronEnUpHandle; |
982 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetElectronEnUp",patType1CorrectedPFMetElectronEnUpHandle); |
983 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsElectronEnUp = *patType1CorrectedPFMetElectronEnUpHandle; |
984 |
+ |
if(patType1CorrectedPFMetsElectronEnUp.size()){ |
985 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsElectronEnUp[0]).sumEt(); |
986 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsElectronEnUp[0])); |
987 |
+ |
metunc.eLong=(patType1CorrectedPFMetsElectronEnUp[0]).e_longitudinal(); |
988 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsElectronEnUp[0])); |
989 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
990 |
+ |
} |
991 |
+ |
|
992 |
+ |
|
993 |
+ |
|
994 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetMuonEnDownHandle; |
995 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetMuonEnDown",patType1CorrectedPFMetMuonEnDownHandle); |
996 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsMuonEnDown = *patType1CorrectedPFMetMuonEnDownHandle; |
997 |
+ |
if(patType1CorrectedPFMetsMuonEnDown.size()){ |
998 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsMuonEnDown[0]).sumEt(); |
999 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsMuonEnDown[0])); |
1000 |
+ |
metunc.eLong=(patType1CorrectedPFMetsMuonEnDown[0]).e_longitudinal(); |
1001 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsMuonEnDown[0])); |
1002 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1003 |
+ |
} |
1004 |
+ |
|
1005 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetMuonEnUpHandle; |
1006 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetMuonEnUp",patType1CorrectedPFMetMuonEnUpHandle); |
1007 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsMuonEnUp = *patType1CorrectedPFMetMuonEnUpHandle; |
1008 |
+ |
if(patType1CorrectedPFMetsMuonEnUp.size()){ |
1009 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsMuonEnUp[0]).sumEt(); |
1010 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsMuonEnUp[0])); |
1011 |
+ |
metunc.eLong=(patType1CorrectedPFMetsMuonEnUp[0]).e_longitudinal(); |
1012 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsMuonEnUp[0])); |
1013 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1014 |
+ |
} |
1015 |
+ |
|
1016 |
+ |
|
1017 |
+ |
|
1018 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetTauEnDownHandle; |
1019 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetTauEnDown",patType1CorrectedPFMetTauEnDownHandle); |
1020 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsTauEnDown = *patType1CorrectedPFMetTauEnDownHandle; |
1021 |
+ |
if(patType1CorrectedPFMetsTauEnDown.size()){ |
1022 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsTauEnDown[0]).sumEt(); |
1023 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsTauEnDown[0])); |
1024 |
+ |
metunc.eLong=(patType1CorrectedPFMetsTauEnDown[0]).e_longitudinal(); |
1025 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsTauEnDown[0])); |
1026 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1027 |
+ |
} |
1028 |
+ |
|
1029 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetTauEnUpHandle; |
1030 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetTauEnUp",patType1CorrectedPFMetTauEnUpHandle); |
1031 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsTauEnUp = *patType1CorrectedPFMetTauEnUpHandle; |
1032 |
+ |
if(patType1CorrectedPFMetsTauEnUp.size()){ |
1033 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsTauEnUp[0]).sumEt(); |
1034 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsTauEnUp[0])); |
1035 |
+ |
metunc.eLong=(patType1CorrectedPFMetsTauEnUp[0]).e_longitudinal(); |
1036 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsTauEnUp[0])); |
1037 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1038 |
+ |
} |
1039 |
+ |
|
1040 |
+ |
|
1041 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetJetEnDownHandle; |
1042 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetJetEnDown",patType1CorrectedPFMetJetEnDownHandle); |
1043 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsJetEnDown = *patType1CorrectedPFMetJetEnDownHandle; |
1044 |
+ |
if(patType1CorrectedPFMetsJetEnDown.size()){ |
1045 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsJetEnDown[0]).sumEt(); |
1046 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsJetEnDown[0])); |
1047 |
+ |
metunc.eLong=(patType1CorrectedPFMetsJetEnDown[0]).e_longitudinal(); |
1048 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsJetEnDown[0])); |
1049 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1050 |
+ |
} |
1051 |
+ |
|
1052 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetJetEnUpHandle; |
1053 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetJetEnUp",patType1CorrectedPFMetJetEnUpHandle); |
1054 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsJetEnUp = *patType1CorrectedPFMetJetEnUpHandle; |
1055 |
+ |
if(patType1CorrectedPFMetsJetEnUp.size()){ |
1056 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsJetEnUp[0]).sumEt(); |
1057 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsJetEnUp[0])); |
1058 |
+ |
metunc.eLong=(patType1CorrectedPFMetsJetEnUp[0]).e_longitudinal(); |
1059 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsJetEnUp[0])); |
1060 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1061 |
+ |
} |
1062 |
+ |
|
1063 |
+ |
|
1064 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetJetResDownHandle; |
1065 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetJetResDown",patType1CorrectedPFMetJetResDownHandle); |
1066 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsJetResDown = *patType1CorrectedPFMetJetResDownHandle; |
1067 |
+ |
if(patType1CorrectedPFMetsJetResDown.size()){ |
1068 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsJetResDown[0]).sumEt(); |
1069 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsJetResDown[0])); |
1070 |
+ |
metunc.eLong=(patType1CorrectedPFMetsJetResDown[0]).e_longitudinal(); |
1071 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsJetResDown[0])); |
1072 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1073 |
+ |
} |
1074 |
+ |
|
1075 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetJetResUpHandle; |
1076 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetJetResUp",patType1CorrectedPFMetJetResUpHandle); |
1077 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsJetResUp = *patType1CorrectedPFMetJetResUpHandle; |
1078 |
+ |
if(patType1CorrectedPFMetsJetResUp.size()){ |
1079 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsJetResUp[0]).sumEt(); |
1080 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsJetResUp[0])); |
1081 |
+ |
metunc.eLong=(patType1CorrectedPFMetsJetResUp[0]).e_longitudinal(); |
1082 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsJetResUp[0])); |
1083 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1084 |
+ |
} |
1085 |
+ |
|
1086 |
+ |
|
1087 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetUnclusteredEnDownHandle; |
1088 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetUnclusteredEnDown",patType1CorrectedPFMetUnclusteredEnDownHandle); |
1089 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsUnclusteredEnDown = *patType1CorrectedPFMetUnclusteredEnDownHandle; |
1090 |
+ |
if(patType1CorrectedPFMetsUnclusteredEnDown.size()){ |
1091 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsUnclusteredEnDown[0]).sumEt(); |
1092 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsUnclusteredEnDown[0])); |
1093 |
+ |
metunc.eLong=(patType1CorrectedPFMetsUnclusteredEnDown[0]).e_longitudinal(); |
1094 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsUnclusteredEnDown[0])); |
1095 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1096 |
+ |
} |
1097 |
+ |
|
1098 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetUnclusteredEnUpHandle; |
1099 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetUnclusteredEnUp",patType1CorrectedPFMetUnclusteredEnUpHandle); |
1100 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsUnclusteredEnUp = *patType1CorrectedPFMetUnclusteredEnUpHandle; |
1101 |
+ |
if(patType1CorrectedPFMetsUnclusteredEnUp.size()){ |
1102 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsUnclusteredEnUp[0]).sumEt(); |
1103 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsUnclusteredEnUp[0])); |
1104 |
+ |
metunc.eLong=(patType1CorrectedPFMetsUnclusteredEnUp[0]).e_longitudinal(); |
1105 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsUnclusteredEnUp[0])); |
1106 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1107 |
+ |
} |
1108 |
+ |
|
1109 |
+ |
|
1110 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetElectronEnDownHandle; |
1111 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetElectronEnDown",patType1p2CorrectedPFMetElectronEnDownHandle); |
1112 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsElectronEnDown = *patType1p2CorrectedPFMetElectronEnDownHandle; |
1113 |
+ |
if(patType1p2CorrectedPFMetsElectronEnDown.size()){ |
1114 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsElectronEnDown[0]).sumEt(); |
1115 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsElectronEnDown[0])); |
1116 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsElectronEnDown[0]).e_longitudinal(); |
1117 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsElectronEnDown[0])); |
1118 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1119 |
+ |
} |
1120 |
+ |
|
1121 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetElectronEnUpHandle; |
1122 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetElectronEnUp",patType1p2CorrectedPFMetElectronEnUpHandle); |
1123 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsElectronEnUp = *patType1p2CorrectedPFMetElectronEnUpHandle; |
1124 |
+ |
if(patType1p2CorrectedPFMetsElectronEnUp.size()){ |
1125 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsElectronEnUp[0]).sumEt(); |
1126 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsElectronEnUp[0])); |
1127 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsElectronEnUp[0]).e_longitudinal(); |
1128 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsElectronEnUp[0])); |
1129 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1130 |
+ |
} |
1131 |
+ |
|
1132 |
+ |
|
1133 |
+ |
|
1134 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetMuonEnDownHandle; |
1135 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetMuonEnDown",patType1p2CorrectedPFMetMuonEnDownHandle); |
1136 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsMuonEnDown = *patType1p2CorrectedPFMetMuonEnDownHandle; |
1137 |
+ |
if(patType1p2CorrectedPFMetsMuonEnDown.size()){ |
1138 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsMuonEnDown[0]).sumEt(); |
1139 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsMuonEnDown[0])); |
1140 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsMuonEnDown[0]).e_longitudinal(); |
1141 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsMuonEnDown[0])); |
1142 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1143 |
+ |
} |
1144 |
+ |
|
1145 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetMuonEnUpHandle; |
1146 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetMuonEnUp",patType1p2CorrectedPFMetMuonEnUpHandle); |
1147 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsMuonEnUp = *patType1p2CorrectedPFMetMuonEnUpHandle; |
1148 |
+ |
if(patType1p2CorrectedPFMetsMuonEnUp.size()){ |
1149 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsMuonEnUp[0]).sumEt(); |
1150 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsMuonEnUp[0])); |
1151 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsMuonEnUp[0]).e_longitudinal(); |
1152 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsMuonEnUp[0])); |
1153 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1154 |
+ |
} |
1155 |
+ |
|
1156 |
+ |
|
1157 |
+ |
|
1158 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetTauEnDownHandle; |
1159 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetTauEnDown",patType1p2CorrectedPFMetTauEnDownHandle); |
1160 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsTauEnDown = *patType1p2CorrectedPFMetTauEnDownHandle; |
1161 |
+ |
if(patType1p2CorrectedPFMetsTauEnDown.size()){ |
1162 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsTauEnDown[0]).sumEt(); |
1163 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsTauEnDown[0])); |
1164 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsTauEnDown[0]).e_longitudinal(); |
1165 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsTauEnDown[0])); |
1166 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1167 |
+ |
} |
1168 |
+ |
|
1169 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetTauEnUpHandle; |
1170 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetTauEnUp",patType1p2CorrectedPFMetTauEnUpHandle); |
1171 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsTauEnUp = *patType1p2CorrectedPFMetTauEnUpHandle; |
1172 |
+ |
if(patType1p2CorrectedPFMetsTauEnUp.size()){ |
1173 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsTauEnUp[0]).sumEt(); |
1174 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsTauEnUp[0])); |
1175 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsTauEnUp[0]).e_longitudinal(); |
1176 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsTauEnUp[0])); |
1177 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1178 |
+ |
} |
1179 |
+ |
|
1180 |
+ |
|
1181 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetJetEnDownHandle; |
1182 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetJetEnDown",patType1p2CorrectedPFMetJetEnDownHandle); |
1183 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsJetEnDown = *patType1p2CorrectedPFMetJetEnDownHandle; |
1184 |
+ |
if(patType1p2CorrectedPFMetsJetEnDown.size()){ |
1185 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsJetEnDown[0]).sumEt(); |
1186 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsJetEnDown[0])); |
1187 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsJetEnDown[0]).e_longitudinal(); |
1188 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsJetEnDown[0])); |
1189 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1190 |
+ |
} |
1191 |
+ |
|
1192 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetJetEnUpHandle; |
1193 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetJetEnUp",patType1p2CorrectedPFMetJetEnUpHandle); |
1194 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsJetEnUp = *patType1p2CorrectedPFMetJetEnUpHandle; |
1195 |
+ |
if(patType1p2CorrectedPFMetsJetEnUp.size()){ |
1196 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsJetEnUp[0]).sumEt(); |
1197 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsJetEnUp[0])); |
1198 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsJetEnUp[0]).e_longitudinal(); |
1199 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsJetEnUp[0])); |
1200 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1201 |
+ |
} |
1202 |
+ |
|
1203 |
+ |
|
1204 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetJetResDownHandle; |
1205 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetJetResDown",patType1p2CorrectedPFMetJetResDownHandle); |
1206 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsJetResDown = *patType1p2CorrectedPFMetJetResDownHandle; |
1207 |
+ |
if(patType1p2CorrectedPFMetsJetResDown.size()){ |
1208 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsJetResDown[0]).sumEt(); |
1209 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsJetResDown[0])); |
1210 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsJetResDown[0]).e_longitudinal(); |
1211 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsJetResDown[0])); |
1212 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1213 |
+ |
} |
1214 |
+ |
|
1215 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetJetResUpHandle; |
1216 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetJetResUp",patType1p2CorrectedPFMetJetResUpHandle); |
1217 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsJetResUp = *patType1p2CorrectedPFMetJetResUpHandle; |
1218 |
+ |
if(patType1p2CorrectedPFMetsJetResUp.size()){ |
1219 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsJetResUp[0]).sumEt(); |
1220 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsJetResUp[0])); |
1221 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsJetResUp[0]).e_longitudinal(); |
1222 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsJetResUp[0])); |
1223 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1224 |
+ |
} |
1225 |
+ |
|
1226 |
+ |
|
1227 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetUnclusteredEnDownHandle; |
1228 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetUnclusteredEnDown",patType1p2CorrectedPFMetUnclusteredEnDownHandle); |
1229 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsUnclusteredEnDown = *patType1p2CorrectedPFMetUnclusteredEnDownHandle; |
1230 |
+ |
if(patType1p2CorrectedPFMetsUnclusteredEnDown.size()){ |
1231 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsUnclusteredEnDown[0]).sumEt(); |
1232 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsUnclusteredEnDown[0])); |
1233 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsUnclusteredEnDown[0]).e_longitudinal(); |
1234 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsUnclusteredEnDown[0])); |
1235 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1236 |
+ |
} |
1237 |
+ |
|
1238 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetUnclusteredEnUpHandle; |
1239 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetUnclusteredEnUp",patType1p2CorrectedPFMetUnclusteredEnUpHandle); |
1240 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsUnclusteredEnUp = *patType1p2CorrectedPFMetUnclusteredEnUpHandle; |
1241 |
+ |
if(patType1p2CorrectedPFMetsUnclusteredEnUp.size()){ |
1242 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsUnclusteredEnUp[0]).sumEt(); |
1243 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsUnclusteredEnUp[0])); |
1244 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsUnclusteredEnUp[0]).e_longitudinal(); |
1245 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsUnclusteredEnUp[0])); |
1246 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1247 |
+ |
} |
1248 |
+ |
|
1249 |
+ |
|
1250 |
|
|
1251 |
|
// |
1252 |
|
// met is calomet |
1257 |
|
edm::View<pat::MET> metsTC = *metTCHandle; |
1258 |
|
if(metsTC.size()){ |
1259 |
|
hbbInfo->tcmet.sumEt=(metsTC[0]).sumEt(); |
1260 |
< |
hbbInfo->tcmet.metSig=(metsTC[0]).mEtSig(); |
1260 |
> |
hbbInfo->tcmet.metSig=metSignificance(&(metsTC[0])); |
1261 |
|
hbbInfo->tcmet.eLong=(metsTC[0]).e_longitudinal(); |
1262 |
|
hbbInfo->tcmet.p4=GENPTOLOR((metsTC[0])); |
1263 |
|
if (verbose_) std::cout <<" METTC "<< hbbInfo->tcmet.metSig <<" " << hbbInfo->tcmet.sumEt<<std::endl; |
1264 |
|
} |
1265 |
|
|
1266 |
+ |
edm::Handle<edm::View<reco::MET> > pfMETNoPUHandle; |
1267 |
+ |
iEvent.getByLabel("pfMETNoPU",pfMETNoPUHandle); |
1268 |
+ |
edm::View<reco::MET> metspfMETNoPU = *pfMETNoPUHandle; |
1269 |
+ |
if(metspfMETNoPU.size()){ |
1270 |
+ |
hbbInfo->metNoPU.sumEt=(metspfMETNoPU[0]).sumEt(); |
1271 |
+ |
hbbInfo->metNoPU.metSig=metSignificance(&(metspfMETNoPU[0])); |
1272 |
+ |
hbbInfo->metNoPU.eLong=(metspfMETNoPU[0]).e_longitudinal(); |
1273 |
+ |
hbbInfo->metNoPU.p4=GENPTOLOR((metspfMETNoPU[0])); |
1274 |
+ |
if (verbose_) std::cout <<" pfMETNoPU "<< hbbInfo->metNoPU.metSig <<" " << hbbInfo->metNoPU.sumEt<<std::endl; |
1275 |
+ |
} |
1276 |
+ |
|
1277 |
+ |
edm::Handle<edm::View<reco::MET> > mHTHandle; |
1278 |
+ |
iEvent.getByLabel("patMETsHT",mHTHandle); |
1279 |
+ |
edm::View<reco::MET> metsHT = *mHTHandle; |
1280 |
+ |
if(metsHT.size()){ |
1281 |
+ |
hbbInfo->mht.sumEt=(metsHT[0]).sumEt(); |
1282 |
+ |
hbbInfo->mht.metSig=metSignificance(&(metsHT[0])); |
1283 |
+ |
hbbInfo->mht.eLong=(metsHT[0]).e_longitudinal(); |
1284 |
+ |
hbbInfo->mht.p4=GENPTOLOR((metsHT[0])); |
1285 |
+ |
if (verbose_) std::cout <<" METHT "<< hbbInfo->mht.metSig <<" " << hbbInfo->mht.sumEt<<std::endl; |
1286 |
+ |
} |
1287 |
+ |
|
1288 |
+ |
edm::Handle<edm::View<reco::MET> > metHandle; |
1289 |
+ |
iEvent.getByLabel(metLabel_,metHandle); |
1290 |
+ |
edm::View<reco::MET> mets = *metHandle; |
1291 |
+ |
|
1292 |
|
if(mets.size()){ |
1293 |
|
hbbInfo->calomet.sumEt=(mets[0]).sumEt(); |
1294 |
< |
hbbInfo->calomet.metSig=(mets[0]).mEtSig(); |
1294 |
> |
hbbInfo->calomet.metSig=metSignificance(&(mets[0])); |
1295 |
|
hbbInfo->calomet.eLong=(mets[0]).e_longitudinal(); |
1296 |
|
hbbInfo->calomet.p4=GENPTOLOR((mets[0])); |
1297 |
< |
if (verbose_) std::cout <<" METTC "<< hbbInfo->calomet.metSig <<" " << hbbInfo->calomet.sumEt<<std::endl; |
1297 |
> |
if (verbose_) std::cout <<" METCALO "<< hbbInfo->calomet.metSig <<" " << hbbInfo->calomet.sumEt<<std::endl; |
1298 |
|
} |
713 |
– |
|
1299 |
|
|
1300 |
|
edm::Handle<edm::View<pat::MET> > metPFHandle; |
1301 |
|
iEvent.getByLabel("patMETsPF",metPFHandle); |
1302 |
|
edm::View<pat::MET> metsPF = *metPFHandle; |
1303 |
< |
|
1303 |
> |
|
1304 |
|
if(metsPF.size()){ |
1305 |
|
hbbInfo->pfmet.sumEt=(metsPF[0]).sumEt(); |
1306 |
< |
hbbInfo->pfmet.metSig=(metsPF[0]).mEtSig(); |
1306 |
> |
hbbInfo->pfmet.metSig=metSignificance(&(metsPF[0])); |
1307 |
|
hbbInfo->pfmet.eLong=(metsPF[0]).e_longitudinal(); |
1308 |
|
hbbInfo->pfmet.p4=GENPTOLOR((metsPF[0])); |
1309 |
< |
if (verbose_) std::cout <<" METTC "<< hbbInfo->pfmet.metSig <<" " << hbbInfo->pfmet.sumEt<<std::endl; |
1309 |
> |
if (verbose_) std::cout <<" METPF "<< hbbInfo->pfmet.metSig <<" " << hbbInfo->pfmet.sumEt<<std::endl; |
1310 |
|
} |
1311 |
< |
|
1312 |
< |
|
1311 |
> |
|
1312 |
> |
|
1313 |
|
if(verbose_){ |
1314 |
< |
std::cout << "METs: calomet "<<mets.size()<<" tcmet "<<metsTC.size()<<" pfmet "<<metsPF.size()<<std::endl; |
1314 |
> |
std::cout << "METs: calomet "<<mets.size()<<" tcmet"<<metsTC.size()<<" pfmet "<<metsPF.size()<<" MHT" <<metsHT.size()<<std::endl; |
1315 |
|
} |
1316 |
|
|
1317 |
< |
std::cout << " INPUT MUONS "<<muons.size()<<std::endl; |
1317 |
> |
if(verbose_) |
1318 |
> |
std::cout << " INPUT MUONS "<<muons.size()<<std::endl; |
1319 |
|
|
1320 |
|
for(edm::View<pat::Muon>::const_iterator mu = muons.begin(); mu!=muons.end(); ++mu){ |
1321 |
|
VHbbEvent::MuonInfo mf; |
1324 |
|
mf.tIso=mu->trackIso(); |
1325 |
|
mf.eIso=mu->ecalIso(); |
1326 |
|
mf.hIso=mu->hcalIso(); |
1327 |
+ |
mf.pfChaIso=mu->chargedHadronIso(); |
1328 |
+ |
mf.pfChaPUIso=mu->userIso(5); |
1329 |
+ |
mf.pfPhoIso=mu->photonIso(); |
1330 |
+ |
mf.pfNeuIso=mu->neutralHadronIso(); |
1331 |
|
Geom::Phi<double> deltaphi(mu->phi()-atan2(mf.p4.Px(), mf.p4.Py())); |
1332 |
|
double acop = deltaphi.value(); |
1333 |
|
mf.acop=acop; |
1334 |
|
|
1335 |
+ |
mf.emEnergy = mu->calEnergy().em; |
1336 |
+ |
mf.hadEnergy = mu->calEnergy().had; |
1337 |
+ |
|
1338 |
+ |
mf.nMatches = mu->numberOfMatches(); |
1339 |
+ |
|
1340 |
|
mf.ipDb=mu->dB(); |
1341 |
|
mf.ipErrDb=mu->edB(); |
1342 |
< |
if(mu->isGlobalMuon()) mf.cat=1; |
1343 |
< |
else if(mu->isTrackerMuon()) mf.cat=2; |
1344 |
< |
else mf.cat=3; |
1342 |
> |
mf.cat=0; |
1343 |
> |
|
1344 |
> |
if(mu->isGlobalMuon()) mf.cat|=1; |
1345 |
> |
if(mu->isTrackerMuon()) mf.cat|=2; |
1346 |
> |
if(mu->isStandAloneMuon()) mf.cat|=4; |
1347 |
|
TrackRef trkMu1Ref = mu->get<TrackRef>(); |
1348 |
|
if(trkMu1Ref.isNonnull()){ |
1349 |
|
const Track* MuTrk1 = mu->get<TrackRef>().get(); |
1354 |
|
TrackRef iTrack1 = mu->innerTrack(); |
1355 |
|
const reco::HitPattern& p1 = iTrack1->hitPattern(); |
1356 |
|
mf.nPixelHits=p1.pixelLayersWithMeasurement(); |
1357 |
< |
} |
1357 |
> |
|
1358 |
> |
mf.nValidTracker = p1.numberOfValidTrackerHits(); |
1359 |
> |
mf.nValidPixel = p1.numberOfValidPixelHits(); |
1360 |
> |
|
1361 |
> |
|
1362 |
> |
|
1363 |
> |
} |
1364 |
|
if(mu->isGlobalMuon()){ |
1365 |
|
TrackRef gTrack = mu->globalTrack(); |
1366 |
|
const reco::HitPattern& q = gTrack->hitPattern(); |
1367 |
|
mf.globChi2=gTrack.get()->normalizedChi2(); |
1368 |
|
mf.globNHits=q.numberOfValidMuonHits(); |
1369 |
< |
mf. validMuStations = q. muonStationsWithValidHits(); |
1369 |
> |
mf.validMuStations = q.muonStationsWithValidHits(); |
1370 |
|
}else{ |
1371 |
|
mf.globChi2=-99; |
1372 |
|
mf.globNHits=-99; |
1373 |
|
} |
1374 |
+ |
|
1375 |
+ |
//Muon trigger matching |
1376 |
+ |
for (int itrig = 0; itrig != ntrigs; ++itrig){ |
1377 |
+ |
std::string trigName=triggerNames_.triggerName(itrig); |
1378 |
+ |
if( (mu->triggerObjectMatchesByPath(trigName,false,false).size() != 0) ){ |
1379 |
+ |
mf.hltMatchedBits.push_back(itrig); |
1380 |
+ |
if(verbose_){ |
1381 |
+ |
std::clog << "Trigger Matching box" << std::endl; |
1382 |
+ |
std::clog << "+++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; |
1383 |
+ |
std::clog << "Matching parameters are defined in the cfg" << std::endl; |
1384 |
+ |
std::clog << "Trigger bit = " << itrig << std::endl; |
1385 |
+ |
std::clog << "Trigger name = " << trigName << std::endl; |
1386 |
+ |
std::clog << "Trigger object matched collection size = " << mu->triggerObjectMatchesByPath(trigName,false,false).size() << std::endl; |
1387 |
+ |
std::clog << "Pat Muon pt = " << mf.p4.Pt() << " HLT object matched = " << mu->triggerObjectMatch(0)->p4().Pt() << std::endl; |
1388 |
+ |
std::clog << "+++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; |
1389 |
+ |
} |
1390 |
+ |
} |
1391 |
+ |
} |
1392 |
|
// |
1393 |
+ |
|
1394 |
|
// add stamuon |
1395 |
|
|
1396 |
|
// if (mu->isStandAloneMuon()) { |
1412 |
|
hbbInfo->muInfo.push_back(mf); |
1413 |
|
} |
1414 |
|
|
1415 |
< |
std::cout << " INPUT electrons "<<electrons.size()<<std::endl; |
1415 |
> |
if(verbose_) |
1416 |
> |
std::cout << " INPUT electrons "<<electrons.size()<<std::endl; |
1417 |
|
for(edm::View<pat::Electron>::const_iterator elec = electrons.begin(); elec!=electrons.end(); ++elec){ |
1418 |
|
VHbbEvent::ElectronInfo ef; |
1419 |
|
ef.p4=GENPTOLORP(elec); |
1424 |
|
ef.tIso=elec->trackIso(); |
1425 |
|
ef.eIso=elec->ecalIso(); |
1426 |
|
ef.hIso=elec->hcalIso(); |
1427 |
< |
Geom::Phi<double> deltaphi(elec->superCluster()->phi()-atan2(hbbInfo->calomet.p4.Py(),hbbInfo->calomet.p4.Px())); |
1427 |
> |
ef.pfChaIso=elec->chargedHadronIso(); |
1428 |
> |
ef.pfChaPUIso=elec->userIso(5); |
1429 |
> |
ef.pfPhoIso=elec->photonIso(); |
1430 |
> |
ef.pfNeuIso=elec->neutralHadronIso(); |
1431 |
> |
|
1432 |
> |
// |
1433 |
> |
// ip info |
1434 |
> |
// |
1435 |
> |
|
1436 |
> |
ef.ipDb=elec->dB(); |
1437 |
> |
ef.ipErrDb=elec->edB(); |
1438 |
> |
|
1439 |
> |
|
1440 |
> |
|
1441 |
> |
Geom::Phi<double> deltaphi(elec->superCluster()->phi()-atan2(hbbInfo->pfmet.p4.Py(),hbbInfo->pfmet.p4.Px())); |
1442 |
|
ef.acop = deltaphi.value(); |
1443 |
|
// |
1444 |
+ |
ef.sihih = elec->sigmaIetaIeta(); |
1445 |
+ |
ef.Dphi = elec->deltaPhiSuperClusterTrackAtVtx(); |
1446 |
+ |
ef.Deta = elec->deltaEtaSuperClusterTrackAtVtx(); |
1447 |
+ |
ef.HoE = elec->hadronicOverEm(); |
1448 |
+ |
ef.convDist = elec->convDist(); |
1449 |
+ |
ef.convDcot = elec->convDcot(); |
1450 |
+ |
if(elec->gsfTrack().isNonnull()) ef.innerHits = elec->gsfTrack()->trackerExpectedHitsInner().numberOfHits(); |
1451 |
+ |
ef.isEB = elec->isEB(); |
1452 |
+ |
ef.isEE = elec->isEE(); |
1453 |
+ |
// |
1454 |
|
// fill eleids |
1455 |
|
// |
1456 |
< |
ef.id95 = elec->electronID("simpleEleId95cIso"); |
1456 |
> |
/* ef.id95 = elec->electronID("simpleEleId95cIso"); |
1457 |
|
ef.id85 = elec->electronID("simpleEleId85cIso"); |
1458 |
|
ef.id70 = elec->electronID("simpleEleId70cIso"); |
1459 |
|
ef.id95r = elec->electronID("simpleEleId95relIso"); |
1460 |
|
ef.id70r = elec->electronID("simpleEleId70relIso"); |
1461 |
|
ef.id85r = elec->electronID("simpleEleId85relIso"); |
1462 |
+ |
*/ |
1463 |
+ |
ef.id95 =elec->electronID("eidVBTFCom95"); |
1464 |
+ |
ef.id95r=elec->electronID("eidVBTFRel95"); |
1465 |
+ |
ef.id85 =elec->electronID("eidVBTFCom85"); |
1466 |
+ |
ef.id85r=elec->electronID("eidVBTFRel85"); |
1467 |
+ |
ef.id80 =elec->electronID("eidVBTFCom80"); |
1468 |
+ |
ef.id80r=elec->electronID("eidVBTFRel80"); |
1469 |
+ |
ef.id70 =elec->electronID("eidVBTFCom70"); |
1470 |
+ |
ef.id70r=elec->electronID("eidVBTFRel70"); |
1471 |
+ |
|
1472 |
+ |
//Electron trigger matching |
1473 |
+ |
for (int itrig = 0; itrig != ntrigs; ++itrig){ |
1474 |
+ |
std::string trigName=triggerNames_.triggerName(itrig); |
1475 |
+ |
if( (elec->triggerObjectMatchesByPath(trigName).size() != 0) ){ |
1476 |
+ |
ef.hltMatchedBits.push_back(itrig); |
1477 |
+ |
if(verbose_){ |
1478 |
+ |
std::clog << "Trigger Matching box" << std::endl; |
1479 |
+ |
std::clog << "+++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; |
1480 |
+ |
std::clog << "Matching parameters are defined in the cfg" << std::endl; |
1481 |
+ |
std::clog << "Trigger bit = " << itrig << std::endl; |
1482 |
+ |
std::clog << "Trigger name = " << trigName << std::endl; |
1483 |
+ |
std::clog << "Trigger object matched collection size = " << elec->triggerObjectMatchesByPath(trigName).size() << std::endl; |
1484 |
+ |
std::clog << "Pat Electron pt = " << ef.p4.Pt() << " HLT object matched = " << elec->triggerObjectMatch(0)->p4().Pt() << std::endl; |
1485 |
+ |
std::clog << "+++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; |
1486 |
+ |
} |
1487 |
+ |
} |
1488 |
+ |
} |
1489 |
|
|
1490 |
|
if(runOnMC_){ |
1491 |
|
const GenParticle* elecMc = elec->genLepton(); |
1498 |
|
hbbInfo->eleInfo.push_back(ef); |
1499 |
|
} |
1500 |
|
|
1501 |
< |
|
1502 |
< |
std::cout << " INPUT taus "<<taus.size()<<std::endl; |
1501 |
> |
if(verbose_) |
1502 |
> |
std::cout << " INPUT taus "<<taus.size()<<std::endl; |
1503 |
|
for(edm::View<pat::Tau>::const_iterator tau = taus.begin(); tau!=taus.end(); ++tau){ |
1504 |
|
VHbbEvent::TauInfo tf; |
1505 |
|
tf.p4=GENPTOLORP(tau); |
1507 |
|
tf.tIso=tau->trackIso(); |
1508 |
|
tf.eIso=tau->ecalIso(); |
1509 |
|
tf.hIso=tau->hcalIso(); |
1510 |
< |
Geom::Phi<double> deltaphi(tau->phi()-atan2(hbbInfo->calomet.p4.Py(),hbbInfo->calomet.p4.Px())); |
1510 |
> |
Geom::Phi<double> deltaphi(tau->phi()-atan2(hbbInfo->pfmet.p4.Py(),hbbInfo->pfmet.p4.Px())); |
1511 |
|
double acop = deltaphi.value(); |
1512 |
|
tf.acop=acop; |
1513 |
< |
tf.idbyIso=tau->tauID("byIsolation"); |
1514 |
< |
tf.idbyTrackIso=tau->tauID("trackIsolation"); |
1515 |
< |
tf.idbyTaNCfrOnePercent=tau->tauID("byTaNCfrOnePercent"); |
1516 |
< |
tf.idbyTaNCfrHalfPercent=tau->tauID("byTaNCfrHalfPercent"); |
1517 |
< |
tf.idbyTaNCfrQuarterPercent=tau->tauID("byTaNCfrQuarterPercent"); |
1518 |
< |
tf.idbyTaNCfrTenthPercent=tau->tauID("byTaNCfrTenthPercent"); |
1519 |
< |
tf.idbyTaNC=tau->tauID("byTaNC"); |
1513 |
> |
if (tau->isTauIDAvailable("againstElectronLoose")) tf.againstElectronLoose=tau->tauID("againstElectronLoose"); |
1514 |
> |
if (tau->isTauIDAvailable("againstElectronMedium")) tf.againstElectronMedium=tau->tauID("againstElectronMedium"); |
1515 |
> |
if (tau->isTauIDAvailable("againstElectronTight")) tf.againstElectronTight=tau->tauID("againstElectronTight"); |
1516 |
> |
if (tau->isTauIDAvailable("againstMuonLoose")) tf.againstMuonLoose=tau->tauID("againstMuonLoose"); |
1517 |
> |
if (tau->isTauIDAvailable("againstMuonTight")) tf.againstMuonTight=tau->tauID("againstMuonTight"); |
1518 |
> |
if (tau->isTauIDAvailable("byLooseIsolation")) tf.byLooseIsolation=tau->tauID("byLooseIsolation"); |
1519 |
> |
if (tau->isTauIDAvailable("byMediumIsolation")) tf.byMediumIsolation=tau->tauID("byMediumIsolation"); |
1520 |
> |
if (tau->isTauIDAvailable("byTightIsolation")) tf.byTightIsolation=tau->tauID("byTightIsolation"); |
1521 |
> |
if (tau->isTauIDAvailable("byVLooseIsolation")) tf.byVLooseIsolation=tau->tauID("byVLooseIsolation"); |
1522 |
> |
if (tau->isTauIDAvailable("decayModeFinding")) tf.decayModeFinding=tau->tauID("decayModeFinding"); |
1523 |
> |
if (tau->isTauIDAvailable("byIsolation")) tf.byIsolation=tau->tauID("byIsolation"); |
1524 |
> |
if (tau->isTauIDAvailable("trackIsolation")) tf.trackIsolation=tau->tauID("trackIsolation"); |
1525 |
> |
if (tau->isTauIDAvailable("byTaNCfrOnePercent")) tf.byTaNCfrOnePercent=tau->tauID("byTaNCfrOnePercent"); |
1526 |
> |
if (tau->isTauIDAvailable("byTaNCfrHalfPercent")) tf.byTaNCfrHalfPercent=tau->tauID("byTaNCfrHalfPercent"); |
1527 |
> |
if (tau->isTauIDAvailable("byTaNCfrQuarterPercent")) tf.byTaNCfrQuarterPercent=tau->tauID("byTaNCfrQuarterPercent"); |
1528 |
> |
if (tau->isTauIDAvailable("byTaNCfrTenthPercent")) tf.byTaNCfrTenthPercent=tau->tauID("byTaNCfrTenthPercent"); |
1529 |
> |
if (tau->isTauIDAvailable("byTaNC")) tf.byTaNC=tau->tauID("byTaNC"); |
1530 |
> |
if (tau->isTauIDAvailable("byLooseCombinedIsolationDeltaBetaCorr")) tf.byLooseCombinedIsolationDeltaBetaCorr=tau->tauID("byLooseCombinedIsolationDeltaBetaCorr"); |
1531 |
> |
if (tau->isTauIDAvailable("againstElectronMVA")) tf.againstElectronMVA=tau->tauID("againstElectronMVA"); |
1532 |
> |
if (tau->isPFTau()) { |
1533 |
> |
tf.isolationPFChargedHadrCandsPtSum = tau->isolationPFChargedHadrCandsPtSum(); |
1534 |
> |
tf.isolationPFGammaCandsEtSum = tau->isolationPFGammaCandsEtSum(); |
1535 |
> |
if (tau->leadPFChargedHadrCand().isAvailable()) tf.leadPFChargedHadrCandPt = tau->leadPFChargedHadrCand()->pt(); |
1536 |
> |
tf.NsignalPFChargedHadrCands = tau->signalPFChargedHadrCands().size(); |
1537 |
> |
tf.NsignalPFGammaCands = tau->signalPFGammaCands().size(); |
1538 |
> |
} |
1539 |
|
hbbInfo->tauInfo.push_back(tf); |
1540 |
< |
} |
1541 |
< |
|
1542 |
< |
|
1543 |
< |
// dimuons and dielectrons |
1544 |
< |
|
1545 |
< |
for( size_t i = 0; i < dimuons->size(); i++ ) { |
1546 |
< |
VHbbEvent::DiMuonInfo df; |
1547 |
< |
const Candidate & dimuonCand = (*dimuons)[ i ]; |
1548 |
< |
df.p4= GENPTOLOR(dimuonCand); |
1549 |
< |
const Candidate * lep0 = dimuonCand.daughter( 0 ); |
1550 |
< |
const Candidate * lep1 = dimuonCand.daughter( 1 ); |
1551 |
< |
// needed to access specific methods of pat::Muon |
1552 |
< |
const pat::Muon & muonDau0 = dynamic_cast<const pat::Muon &>(*lep0->masterClone()); |
1553 |
< |
const pat::Muon & muonDau1 = dynamic_cast<const pat::Muon &>(*lep1->masterClone()); |
1554 |
< |
|
1555 |
< |
df.daughter1.p4=GENPTOLOR(muonDau0); |
1556 |
< |
df.daughter2.p4=GENPTOLOR(muonDau1); |
1557 |
< |
|
1558 |
< |
df.daughter1.tIso= muonDau0.trackIso(); |
1559 |
< |
df.daughter2.tIso= muonDau1.trackIso(); |
1560 |
< |
|
1561 |
< |
df.daughter1.eIso= muonDau0.ecalIso(); |
1562 |
< |
df.daughter2.eIso= muonDau1.ecalIso(); |
1563 |
< |
|
1564 |
< |
df.daughter1.hIso= muonDau0.hcalIso(); |
872 |
< |
df.daughter2.hIso= muonDau1.hcalIso(); |
873 |
< |
|
874 |
< |
df.daughter1.ipDb=muonDau0.dB(); |
875 |
< |
df.daughter2.ipDb=muonDau1.dB(); |
876 |
< |
|
877 |
< |
df.daughter1.ipErrDb=muonDau0.edB(); |
878 |
< |
df.daughter2.ipErrDb=muonDau1.edB(); |
879 |
< |
|
880 |
< |
|
881 |
< |
if(muonDau0.isGlobalMuon()) df.daughter1.cat =1; |
882 |
< |
else if(muonDau0.isTrackerMuon()) df.daughter1.cat=2; |
883 |
< |
else df.daughter1.cat=3; |
884 |
< |
if(muonDau1.isGlobalMuon()) df.daughter2.cat =1; |
885 |
< |
else if(muonDau1.isTrackerMuon()) df.daughter2.cat=2; |
886 |
< |
else df.daughter2.cat=3; |
887 |
< |
|
888 |
< |
TrackRef trkMu1Ref = muonDau0.get<TrackRef>(); |
889 |
< |
TrackRef trkMu2Ref = muonDau1.get<TrackRef>(); |
890 |
< |
|
891 |
< |
if(trkMu1Ref.isNonnull() && trkMu2Ref.isNonnull()){ |
892 |
< |
const Track* MuTrk1 = muonDau0.get<TrackRef>().get(); |
893 |
< |
const Track* MuTrk2 = muonDau1.get<TrackRef>().get(); |
894 |
< |
df.daughter1.zPVPt=MuTrk1->dz(RecVtxFirst.position()); |
895 |
< |
df.daughter1.zPVProb=MuTrk1->dz(RecVtx.position()); |
896 |
< |
df.daughter2.zPVPt=MuTrk2->dz(RecVtxFirst.position()); |
897 |
< |
df.daughter2.zPVProb=MuTrk2->dz(RecVtx.position()); |
898 |
< |
|
899 |
< |
df.daughter1.nHits = MuTrk1->numberOfValidHits(); |
900 |
< |
df.daughter2.nHits = MuTrk2->numberOfValidHits(); |
901 |
< |
|
902 |
< |
df.daughter1.chi2 = MuTrk1->normalizedChi2(); |
903 |
< |
df.daughter2.chi2 = MuTrk2->normalizedChi2(); |
904 |
< |
|
905 |
< |
TrackRef iTrack1 = muonDau0.innerTrack(); |
906 |
< |
const reco::HitPattern& p1 = iTrack1->hitPattern(); |
907 |
< |
TrackRef iTrack2 = muonDau1.innerTrack(); |
908 |
< |
const reco::HitPattern& p2 = iTrack2->hitPattern(); |
909 |
< |
|
910 |
< |
df.daughter1.nPixelHits = p1.pixelLayersWithMeasurement(); |
911 |
< |
df.daughter2.nPixelHits = p2.pixelLayersWithMeasurement(); |
912 |
< |
|
913 |
< |
if(muonDau0.isGlobalMuon()){ |
914 |
< |
TrackRef gTrack = muonDau0.globalTrack(); |
915 |
< |
const reco::HitPattern& q = gTrack->hitPattern(); |
916 |
< |
df.daughter1.globNHits=q.numberOfValidMuonHits(); |
917 |
< |
df.daughter1.globChi2=gTrack.get()->normalizedChi2(); |
918 |
< |
df.daughter1.validMuStations = q. muonStationsWithValidHits(); |
919 |
< |
} |
920 |
< |
if(muonDau1.isGlobalMuon()){ |
921 |
< |
TrackRef gTrack = muonDau1.globalTrack(); |
922 |
< |
const reco::HitPattern& q = gTrack->hitPattern(); |
923 |
< |
df.daughter2.globNHits=q.numberOfValidMuonHits(); |
924 |
< |
df.daughter2.globChi2=gTrack.get()->normalizedChi2(); |
925 |
< |
df.daughter2.validMuStations = q. muonStationsWithValidHits(); |
926 |
< |
} |
927 |
< |
|
1540 |
> |
if (verbose_) { |
1541 |
> |
std::cout << "SCZ DEBUG: againstElectronLoose is " << tf.againstElectronLoose << std::endl; |
1542 |
> |
std::cout << "SCZ DEBUG: againstElectronMedium is " << tf.againstElectronMedium << std::endl; |
1543 |
> |
std::cout << "SCZ DEBUG: againstElectronTight is " << tf.againstElectronTight << std::endl; |
1544 |
> |
std::cout << "SCZ DEBUG: againstMuonLoose is " << tf.againstMuonLoose << std::endl; |
1545 |
> |
std::cout << "SCZ DEBUG: againstMuonTight is " << tf.againstMuonTight << std::endl; |
1546 |
> |
std::cout << "SCZ DEBUG: byLooseIsolation is " << tf.byLooseIsolation << std::endl; |
1547 |
> |
std::cout << "SCZ DEBUG: byMediumIsolation is " << tf.byMediumIsolation << std::endl; |
1548 |
> |
std::cout << "SCZ DEBUG: byTightIsolation is " << tf.byTightIsolation << std::endl; |
1549 |
> |
std::cout << "SCZ DEBUG: byVLooseIsolation is " << tf.byVLooseIsolation << std::endl; |
1550 |
> |
std::cout << "SCZ DEBUG: decayModeFinding is " << tf.decayModeFinding << std::endl; |
1551 |
> |
std::cout << "SCZ DEBUG: byIsolation is " << tf.byIsolation<< std::endl; |
1552 |
> |
std::cout << "SCZ DEBUG: trackIsolation is " << tf.trackIsolation << std::endl; |
1553 |
> |
std::cout << "SCZ DEBUG: byTaNCfrOnePercent is " << tf.byTaNCfrOnePercent << std::endl; |
1554 |
> |
std::cout << "SCZ DEBUG: byTaNCfrHalfPercent is " << tf.byTaNCfrHalfPercent << std::endl; |
1555 |
> |
std::cout << "SCZ DEBUG: byTaNCfrQuarterPercent is " << tf.byTaNCfrQuarterPercent << std::endl; |
1556 |
> |
std::cout << "SCZ DEBUG: byTaNCfrTenthPercent is " << tf.byTaNCfrTenthPercent << std::endl; |
1557 |
> |
std::cout << "SCZ DEBUG: byTaNC is " << tf.byTaNC << std::endl; |
1558 |
> |
std::cout << "SCZ DEBUG: isolationPFChargedHadrCandsPtSum is " << tf.isolationPFChargedHadrCandsPtSum << std::endl; |
1559 |
> |
std::cout << "SCZ DEBUG: isolationPFGammaCandsEtSum is " << tf.isolationPFGammaCandsEtSum << std::endl; |
1560 |
> |
std::cout << "SCZ DEBUG: isolationPFGammaCandsEtSum is " << tf.leadPFChargedHadrCandPt << std::endl; |
1561 |
> |
std::cout << "SCZ DEBUG: NsignalPFChargedHadrCands is " << tf.NsignalPFChargedHadrCands << std::endl; |
1562 |
> |
std::cout << "SCZ DEBUG: NsignalPFGammaCands is " << tf.NsignalPFGammaCands << std::endl; |
1563 |
> |
std::cout << "SCZ DEBUG: byLooseCombinedIsolationDeltaBetaCorr is " << tf.byLooseCombinedIsolationDeltaBetaCorr << std::endl; |
1564 |
> |
std::cout << "SCZ DEBUG: againstElectronMVA is " << tf.againstElectronMVA << std::endl; |
1565 |
|
} |
929 |
– |
|
930 |
– |
hbbInfo->diMuonInfo.push_back(df); |
1566 |
|
} |
1567 |
|
|
1568 |
< |
for( size_t i = 0; i < dielectrons->size(); i++ ) { |
1569 |
< |
VHbbEvent::DiElectronInfo df; |
1570 |
< |
const Candidate & dielecCand = (*dielectrons)[ i ]; |
1571 |
< |
|
1572 |
< |
df.p4=GENPTOLOR(dielecCand); |
1573 |
< |
|
1574 |
< |
// accessing the daughters of the dimuon candidate |
940 |
< |
const Candidate * lep0 = dielecCand.daughter( 0 ); |
941 |
< |
const Candidate * lep1 = dielecCand.daughter( 1 ); |
942 |
< |
// needed to access specific methods of pat::Muon |
943 |
< |
const pat::Electron & elecDau0 = dynamic_cast<const pat::Electron &>(*lep0->masterClone()); |
944 |
< |
const pat::Electron & elecDau1 = dynamic_cast<const pat::Electron &>(*lep1->masterClone()); |
945 |
< |
|
946 |
< |
df.daughter1.p4 = GENPTOLOR(elecDau0); |
947 |
< |
df.daughter2.p4= GENPTOLOR(elecDau1); |
948 |
< |
|
949 |
< |
df.daughter1.tIso = elecDau0.trackIso(); |
950 |
< |
df.daughter2.tIso = elecDau1.trackIso(); |
1568 |
> |
CompareJetPtMuons ptComparatorMu; |
1569 |
> |
CompareJetPtElectrons ptComparatorE; |
1570 |
> |
CompareJetPtTaus ptComparatorTau; |
1571 |
> |
|
1572 |
> |
std::sort(hbbInfo->muInfo.begin(), hbbInfo->muInfo.end(), ptComparatorMu); |
1573 |
> |
std::sort(hbbInfo->eleInfo.begin(), hbbInfo->eleInfo.end(), ptComparatorE); |
1574 |
> |
std::sort(hbbInfo->tauInfo.begin(), hbbInfo->tauInfo.end(), ptComparatorTau); |
1575 |
|
|
952 |
– |
df.daughter1.eIso = elecDau0.ecalIso(); |
953 |
– |
df.daughter2.eIso = elecDau1.ecalIso(); |
1576 |
|
|
955 |
– |
df.daughter1.hIso = elecDau0.hcalIso(); |
956 |
– |
df.daughter2.hIso = elecDau1.hcalIso(); |
1577 |
|
|
1578 |
< |
// ids |
959 |
< |
df.daughter1.id95 = elecDau0.electronID("simpleEleId95cIso"); |
960 |
< |
df.daughter1.id85 = elecDau0.electronID ("simpleEleId85cIso"); |
961 |
< |
df.daughter1.id70 = elecDau0.electronID ("simpleEleId70cIso"); |
962 |
< |
df.daughter1.id95r = elecDau0.electronID ("simpleEleId95relIso"); |
963 |
< |
df.daughter1.id85r = elecDau0.electronID ("simpleEleId85relIso"); |
964 |
< |
df.daughter1.id70r = elecDau0.electronID ("simpleEleId70relIso"); |
965 |
< |
|
966 |
< |
|
967 |
< |
df.daughter2.id95 = elecDau1.electronID("simpleEleId95cIso"); |
968 |
< |
df.daughter2.id85 = elecDau1.electronID ("simpleEleId85cIso"); |
969 |
< |
df.daughter2.id70 = elecDau1.electronID ("simpleEleId70cIso"); |
970 |
< |
df.daughter2.id95r = elecDau1.electronID ("simpleEleId95relIso"); |
971 |
< |
df.daughter2.id85r = elecDau1.electronID ("simpleEleId85relIso"); |
972 |
< |
df.daughter2.id70r = elecDau1.electronID ("simpleEleId70relIso"); |
973 |
< |
|
974 |
< |
hbbInfo->diElectronInfo.push_back(df); |
975 |
< |
|
976 |
< |
} |
1578 |
> |
|
1579 |
|
if (verbose_){ |
1580 |
|
std::cout <<" Pushing hbbInfo "<<std::endl; |
1581 |
|
std::cout <<" SimpleJets1 = "<<hbbInfo->simpleJets.size()<<std::endl<< |
1582 |
|
" SimpleJets2 = "<<hbbInfo->simpleJets2.size()<<std::endl<< |
1583 |
|
" SubJets = "<<hbbInfo->subJets.size()<<std::endl<< |
1584 |
|
" HardJets = "<<hbbInfo->hardJets.size()<<std::endl<< |
1585 |
+ |
" FilterJets = "<<hbbInfo->filterJets.size()<<std::endl<< |
1586 |
|
" Muons = "<<hbbInfo->muInfo.size()<<std::endl<< |
1587 |
|
" Electrons = "<<hbbInfo->eleInfo.size()<<std::endl<< |
1588 |
|
" Taus = "<<hbbInfo->tauInfo.size()<<std::endl<< |
1592 |
|
|
1593 |
|
|
1594 |
|
iEvent.put(hbbInfo); |
1595 |
+ |
iEvent.put(auxInfo); |
1596 |
+ |
|
1597 |
|
|
1598 |
+ |
delete jecUnc; |
1599 |
|
|
1600 |
|
} |
1601 |
|
|
1706 |
|
//re- |
1707 |
|
} |
1708 |
|
|
1709 |
+ |
|
1710 |
+ |
//Btagging scale factors |
1711 |
+ |
void HbbAnalyzerNew::fillScaleFactors(VHbbEvent::SimpleJet& sj, BTagSFContainer iSF){ |
1712 |
+ |
|
1713 |
+ |
|
1714 |
+ |
BinningPointByMap measurePoint; |
1715 |
+ |
//for a USDG |
1716 |
+ |
//for CB jets |
1717 |
+ |
//scale factor 1 for CB jets over 240GeV/c |
1718 |
+ |
if( TMath::Abs(sj.flavour) == 4 or TMath::Abs(sj.flavour) == 5 ){ |
1719 |
+ |
measurePoint.insert( BinningVariables::JetEt, sj.p4.Et() ); |
1720 |
+ |
measurePoint.insert( BinningVariables::JetAbsEta, fabs(sj.p4.Eta()) ); |
1721 |
+ |
if( iSF.BTAGSF_CSVL->isResultOk(PerformanceResult::BTAGBEFFCORR , measurePoint) ){ |
1722 |
+ |
sj.SF_CSVL = iSF.BTAGSF_CSVL->getResult(PerformanceResult::BTAGBEFFCORR , measurePoint); |
1723 |
+ |
sj.SF_CSVLerr = iSF.BTAGSF_CSVL->getResult(PerformanceResult::BTAGBERRCORR , measurePoint); |
1724 |
+ |
if(verbose_){ |
1725 |
+ |
std::clog << "C/B Jet flavour = " << sj.flavour << std::endl; |
1726 |
+ |
std::clog << "C/B Jet Et = " << sj.p4.Et() << std::endl; |
1727 |
+ |
std::clog << "C/B Jet eta = " << sj.p4.Eta() << std::endl; |
1728 |
+ |
std::clog << "C/B CSVL Scale Factor = " << sj.SF_CSVL << std::endl; |
1729 |
+ |
std::clog << "C/B CSVL Scale Factor error = " << sj.SF_CSVLerr << std::endl; |
1730 |
+ |
} |
1731 |
+ |
} |
1732 |
+ |
if( iSF.BTAGSF_CSVM->isResultOk(PerformanceResult::BTAGBEFFCORR , measurePoint) ){ |
1733 |
+ |
sj.SF_CSVM = iSF.BTAGSF_CSVM->getResult(PerformanceResult::BTAGBEFFCORR , measurePoint); |
1734 |
+ |
sj.SF_CSVMerr = iSF.BTAGSF_CSVM->getResult(PerformanceResult::BTAGBERRCORR , measurePoint); |
1735 |
+ |
} |
1736 |
+ |
if( iSF.BTAGSF_CSVT->isResultOk(PerformanceResult::BTAGBEFFCORR , measurePoint) ){ |
1737 |
+ |
sj.SF_CSVT = iSF.BTAGSF_CSVT->getResult(PerformanceResult::BTAGBEFFCORR , measurePoint); |
1738 |
+ |
sj.SF_CSVTerr = iSF.BTAGSF_CSVT->getResult(PerformanceResult::BTAGBERRCORR , measurePoint); |
1739 |
+ |
} |
1740 |
+ |
else{ |
1741 |
+ |
if(verbose_){ |
1742 |
+ |
std::cerr << "No SF found in the database for this jet" << std::endl; |
1743 |
+ |
std::clog << "No SF found: Jet flavour = " << sj.flavour << std::endl; |
1744 |
+ |
std::clog << "No SF found: Jet Et = " << sj.p4.Et() << std::endl; |
1745 |
+ |
std::clog << "No SF found: Jet eta = " << sj.p4.Eta() << std::endl; |
1746 |
+ |
} |
1747 |
+ |
} |
1748 |
+ |
} |
1749 |
+ |
else { |
1750 |
+ |
measurePoint.insert( BinningVariables::JetEt, sj.p4.Et() ); |
1751 |
+ |
measurePoint.insert( BinningVariables::JetAbsEta, fabs(sj.p4.Eta()) ); |
1752 |
+ |
if( iSF.MISTAGSF_CSVL->isResultOk(PerformanceResult::BTAGLEFFCORR , measurePoint) ){ |
1753 |
+ |
sj.SF_CSVL = iSF.MISTAGSF_CSVL->getResult(PerformanceResult::BTAGLEFFCORR , measurePoint); |
1754 |
+ |
sj.SF_CSVLerr = iSF.MISTAGSF_CSVL->getResult(PerformanceResult::BTAGLERRCORR , measurePoint); |
1755 |
+ |
if(verbose_){ |
1756 |
+ |
std::clog << "Light Jet flavour = " << sj.flavour << std::endl; |
1757 |
+ |
std::clog << "Light Jet Et = " << sj.p4.Et() << std::endl; |
1758 |
+ |
std::clog << "Light Jet eta = " << sj.p4.Eta() << std::endl; |
1759 |
+ |
std::clog << "Light CSVL Scale Factor = " << sj.SF_CSVL << std::endl; |
1760 |
+ |
std::clog << "Light CSVL Scale Factor error = " << sj.SF_CSVLerr << std::endl; |
1761 |
+ |
} |
1762 |
+ |
} |
1763 |
+ |
if( iSF.MISTAGSF_CSVM->isResultOk(PerformanceResult::BTAGLEFFCORR , measurePoint) ){ |
1764 |
+ |
sj.SF_CSVM = iSF.MISTAGSF_CSVM->getResult(PerformanceResult::BTAGLEFFCORR , measurePoint); |
1765 |
+ |
sj.SF_CSVMerr = iSF.MISTAGSF_CSVM->getResult(PerformanceResult::BTAGLERRCORR , measurePoint); |
1766 |
+ |
} |
1767 |
+ |
if( iSF.MISTAGSF_CSVT->isResultOk(PerformanceResult::BTAGLEFFCORR , measurePoint) ){ |
1768 |
+ |
sj.SF_CSVT = iSF.MISTAGSF_CSVT->getResult(PerformanceResult::BTAGLEFFCORR , measurePoint); |
1769 |
+ |
sj.SF_CSVTerr = iSF.MISTAGSF_CSVT->getResult(PerformanceResult::BTAGLERRCORR , measurePoint); |
1770 |
+ |
} |
1771 |
+ |
else{ |
1772 |
+ |
if(verbose_){ |
1773 |
+ |
std::cerr << "No SF found in the database for this jet" << std::endl; |
1774 |
+ |
std::clog << "No SF found: Jet flavour = " << sj.flavour << std::endl; |
1775 |
+ |
std::clog << "No SF found: Jet Et = " << sj.p4.Et() << std::endl; |
1776 |
+ |
std::clog << "No SF found: Jet eta = " << sj.p4.Eta() << std::endl; |
1777 |
+ |
} |
1778 |
+ |
} |
1779 |
+ |
} |
1780 |
+ |
|
1781 |
+ |
} |
1782 |
+ |
|
1783 |
+ |
void HbbAnalyzerNew::setJecUnc(VHbbEvent::SimpleJet& sj,JetCorrectionUncertainty* jecunc){ |
1784 |
+ |
// |
1785 |
+ |
// test |
1786 |
+ |
// |
1787 |
+ |
|
1788 |
+ |
// return; |
1789 |
+ |
double eta = sj.p4.Eta(); |
1790 |
+ |
double pt = sj.p4.Pt(); |
1791 |
+ |
|
1792 |
+ |
jecunc->setJetEta(eta); |
1793 |
+ |
jecunc->setJetPt(pt); // here you must use the CORRECTED jet pt |
1794 |
+ |
double unc = jecunc->getUncertainty(true); |
1795 |
+ |
sj.jecunc= unc; |
1796 |
+ |
} |
1797 |
+ |
|
1798 |
+ |
|
1799 |
+ |
void HbbAnalyzerNew ::fillSimpleJet (VHbbEvent::SimpleJet& sj, edm::View<pat::Jet>::const_iterator jet_iter){ |
1800 |
+ |
sj.flavour = jet_iter->partonFlavour(); |
1801 |
+ |
|
1802 |
+ |
sj.tche=jet_iter->bDiscriminator("trackCountingHighEffBJetTags"); |
1803 |
+ |
sj.tchp=jet_iter->bDiscriminator("trackCountingHighPurBJetTags"); |
1804 |
+ |
sj.jp=jet_iter->bDiscriminator("jetProbabilityBJetTags"); |
1805 |
+ |
sj.jpb=jet_iter->bDiscriminator("jetBProbabilityBJetTags"); |
1806 |
+ |
sj.ssvhe=jet_iter->bDiscriminator("simpleSecondaryVertexHighEffBJetTags"); |
1807 |
+ |
sj.csv=jet_iter->bDiscriminator("combinedSecondaryVertexBJetTags"); |
1808 |
+ |
sj.csvmva=jet_iter->bDiscriminator("combinedSecondaryVertexMVABJetTags"); |
1809 |
+ |
sj.csvivf=jet_iter->bDiscriminator("combinedInclusiveSecondaryVertexBJetTags"); |
1810 |
+ |
sj.cmva=jet_iter->bDiscriminator("combinedMVABJetTags"); |
1811 |
+ |
sj.charge=jet_iter->jetCharge(); |
1812 |
+ |
sj.ntracks=jet_iter->associatedTracks().size(); |
1813 |
+ |
sj.p4=GENPTOLORP(jet_iter); |
1814 |
+ |
// std::cout << " ECCO "<<sj.csv<< " "<< sj.p4.Pt()<<std::endl; |
1815 |
+ |
sj.chargedTracksFourMomentum=(getChargedTracksMomentum(&*(jet_iter))); |
1816 |
+ |
sj.SF_CSVL=1; |
1817 |
+ |
sj.SF_CSVM=1; |
1818 |
+ |
sj.SF_CSVT=1; |
1819 |
+ |
sj.SF_CSVLerr=0; |
1820 |
+ |
sj.SF_CSVMerr=0; |
1821 |
+ |
sj.SF_CSVTerr=0; |
1822 |
+ |
|
1823 |
+ |
|
1824 |
+ |
if (jet_iter->isPFJet() == true) { |
1825 |
+ |
|
1826 |
+ |
sj.chargedHadronEFraction = jet_iter-> chargedHadronEnergyFraction(); |
1827 |
+ |
sj.neutralHadronEFraction = jet_iter-> neutralHadronEnergyFraction (); |
1828 |
+ |
sj.chargedEmEFraction = jet_iter-> chargedEmEnergyFraction (); |
1829 |
+ |
sj.neutralEmEFraction = jet_iter-> neutralEmEnergyFraction (); |
1830 |
+ |
sj.nConstituents = jet_iter->getPFConstituents().size(); |
1831 |
+ |
|
1832 |
+ |
} |
1833 |
+ |
// |
1834 |
+ |
// addtaginfo for csv |
1835 |
+ |
// |
1836 |
+ |
|
1837 |
+ |
// if (jet_iter->hasTagInfo("SimpleSecondaryVertex")) { |
1838 |
+ |
|
1839 |
+ |
const reco::SecondaryVertexTagInfo * tf = jet_iter->tagInfoSecondaryVertex(); |
1840 |
+ |
if (tf){ |
1841 |
+ |
if (tf->nVertices() >0){ |
1842 |
+ |
sj.vtxMass = tf->secondaryVertex(0).p4().mass(); |
1843 |
+ |
sj.vtxNTracks = tf->secondaryVertex(0).nTracks(); |
1844 |
+ |
std::vector<reco::TrackBaseRef >::const_iterator tit = tf->secondaryVertex(0).tracks_begin(); |
1845 |
+ |
for (; tit< tf->secondaryVertex(0).tracks_end(); ++tit){ |
1846 |
+ |
sj.vtxTrackIds.push_back(tit->key()); |
1847 |
+ |
} |
1848 |
+ |
Measurement1D m = tf->flightDistance(0); |
1849 |
+ |
sj.vtx3dL = m.value(); |
1850 |
+ |
sj.vtx3deL = m.error(); |
1851 |
+ |
} |
1852 |
+ |
} |
1853 |
+ |
// |
1854 |
+ |
// add tVector |
1855 |
+ |
// |
1856 |
+ |
sj.tVector = getTvect(&(*jet_iter)); |
1857 |
+ |
|
1858 |
+ |
|
1859 |
+ |
} |
1860 |
+ |
|
1861 |
+ |
float HbbAnalyzerNew::metSignificance(const reco::MET * met) |
1862 |
+ |
{ |
1863 |
+ |
double sigmaX2= met->getSignificanceMatrix()(0,0); |
1864 |
+ |
double sigmaY2= met->getSignificanceMatrix()(1,1); |
1865 |
+ |
double significance = 0; |
1866 |
+ |
try { |
1867 |
+ |
if(sigmaX2<1.e10 && sigmaY2<1.e10) significance = met->significance(); |
1868 |
+ |
} |
1869 |
+ |
catch(...) |
1870 |
+ |
{ |
1871 |
+ |
std::cout << "PROBLEM WITH MET SIGNIFICANCE sigma X2 and Y2 are: " << sigmaX2 << " " << sigmaY2 << std::endl; |
1872 |
+ |
} |
1873 |
+ |
return significance; |
1874 |
+ |
} |
1875 |
+ |
|
1876 |
+ |
|
1877 |
|
//define this as a plug-in |
1878 |
|
DEFINE_FWK_MODULE(HbbAnalyzerNew); |