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 "SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h" |
33 |
+ |
|
34 |
+ |
#include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h" |
35 |
|
|
36 |
|
#define GENPTOLOR(a) TLorentzVector((a).px(), (a).py(), (a).pz(), (a).energy()) |
37 |
|
#define GENPTOLORP(a) TLorentzVector((a)->px(), (a)->py(), (a)->pz(), (a)->energy()) |
38 |
|
|
39 |
+ |
|
40 |
+ |
struct CompareJetPtMuons { |
41 |
+ |
bool operator()( const VHbbEvent::MuonInfo& j1, const VHbbEvent::MuonInfo& j2 ) const { |
42 |
+ |
return j1.p4.Pt() > j2.p4.Pt(); |
43 |
+ |
} |
44 |
+ |
}; |
45 |
+ |
struct CompareJetPtElectrons { |
46 |
+ |
bool operator()( const VHbbEvent::ElectronInfo& j1, const VHbbEvent::ElectronInfo& j2 ) const { |
47 |
+ |
return j1.p4.Pt() > j2.p4.Pt(); |
48 |
+ |
} |
49 |
+ |
}; |
50 |
+ |
struct CompareJetPtTaus { |
51 |
+ |
bool operator()( const VHbbEvent::TauInfo& j1, const VHbbEvent::TauInfo& j2 ) const { |
52 |
+ |
return j1.p4.Pt() > j2.p4.Pt(); |
53 |
+ |
} |
54 |
+ |
}; |
55 |
+ |
|
56 |
+ |
|
57 |
+ |
|
58 |
|
HbbAnalyzerNew::HbbAnalyzerNew(const edm::ParameterSet& iConfig): |
59 |
|
eleLabel_(iConfig.getParameter<edm::InputTag>("electronTag")), |
60 |
|
muoLabel_(iConfig.getParameter<edm::InputTag>("muonTag")), |
67 |
|
tauLabel_(iConfig.getParameter<edm::InputTag>("tauTag")), |
68 |
|
metLabel_(iConfig.getParameter<edm::InputTag>("metTag")), |
69 |
|
phoLabel_(iConfig.getParameter<edm::InputTag>("photonTag")), |
37 |
– |
dimuLabel_(iConfig.getParameter<edm::InputTag>("dimuTag")), |
38 |
– |
dielecLabel_(iConfig.getParameter<edm::InputTag>("dielecTag")), |
70 |
|
hltResults_(iConfig.getParameter<edm::InputTag>("hltResultsTag")), |
71 |
|
runOnMC_(iConfig.getParameter<bool>("runOnMC")), verbose_(iConfig.getUntrackedParameter<bool>("verbose")) { |
72 |
|
|
97 |
|
HbbAnalyzerNew::produce(edm::Event& iEvent, const edm::EventSetup& iSetup){ |
98 |
|
using namespace edm; |
99 |
|
using namespace reco; |
100 |
< |
|
100 |
> |
|
101 |
> |
|
102 |
> |
// JEC Uncertainty |
103 |
> |
|
104 |
> |
// JetCorrectionUncertainty *jecUnc=0; |
105 |
> |
edm::ESHandle<JetCorrectorParametersCollection> JetCorParColl; |
106 |
> |
iSetup.get<JetCorrectionsRecord>().get("AK5PF",JetCorParColl); |
107 |
> |
JetCorrectionUncertainty *jecUnc=0; |
108 |
> |
// if (!runOnMC_){ |
109 |
> |
JetCorrectorParameters const & JetCorPar = (*JetCorParColl)["Uncertainty"]; |
110 |
> |
jecUnc = new JetCorrectionUncertainty(JetCorPar); |
111 |
> |
// } |
112 |
|
|
113 |
|
std::auto_ptr<VHbbEvent> hbbInfo( new VHbbEvent() ); |
114 |
|
std::auto_ptr<VHbbEventAuxInfo> auxInfo( new VHbbEventAuxInfo() ); |
115 |
< |
|
115 |
> |
|
116 |
> |
|
117 |
> |
if (runOnMC_){ |
118 |
> |
Handle<GenEventInfoProduct> evt_info; |
119 |
> |
iEvent.getByType(evt_info); |
120 |
> |
auxInfo->weightMCProd = evt_info->weight(); |
121 |
> |
} |
122 |
> |
else |
123 |
> |
{ auxInfo->weightMCProd =1.;} |
124 |
|
// |
125 |
|
// ?? |
126 |
< |
|
126 |
> |
|
127 |
> |
// trigger |
128 |
> |
|
129 |
|
// trigger |
130 |
|
edm::Handle<edm::TriggerResults> hltresults; |
131 |
|
//iEvent.getByLabel("TriggerResults", hltresults); |
135 |
|
iEvent.getByLabel(hltResults_, hltresults); |
136 |
|
|
137 |
|
const edm::TriggerNames & triggerNames_ = iEvent.triggerNames(*hltresults); |
138 |
< |
|
138 |
> |
|
139 |
|
int ntrigs = hltresults->size(); |
140 |
|
if (ntrigs==0){std::cerr << "%HLTInfo -- No trigger name given in TriggerResults of the input " << std::endl;} |
141 |
|
|
90 |
– |
for (int itrig = 0; itrig != ntrigs; ++itrig){ |
91 |
– |
|
92 |
– |
TString trigName=triggerNames_.triggerName(itrig); |
93 |
– |
bool accept = hltresults->accept(itrig); |
94 |
– |
|
95 |
– |
if (accept){(auxInfo->triggerInfo.flag)[itrig] = 1;} |
96 |
– |
else { (auxInfo->triggerInfo.flag)[itrig] = 0;} |
97 |
– |
|
98 |
– |
// std::cout << "%HLTInfo -- Number of HLT Triggers: " << ntrigs << std::endl; |
99 |
– |
// std::cout << "%HLTInfo -- HLTTrigger(" << itrig << "): " << trigName << " = " << accept << std::endl; |
100 |
– |
} |
101 |
– |
|
102 |
– |
// // |
103 |
– |
// // big bloat |
104 |
– |
// // |
105 |
– |
|
106 |
– |
|
107 |
– |
int goodDoubleMu3=0,goodDoubleMu3_2=0, |
108 |
– |
goodMu9=0, goodIsoMu9=0, goodMu11=0, goodIsoMu13_3=0, goodMu15=0, goodMu15_1=0; |
109 |
– |
int goodDoubleElec10=0,goodDoubleElec15_1=0,goodDoubleElec17_1=0; |
110 |
– |
int goodMet100=0; |
111 |
– |
int goodSingleEle1=0,goodSingleEle2=0,goodSingleEle3=0,goodSingleEle4=0; |
112 |
– |
int goodBtagMu1=0,goodBtagMu2=0,goodBtagMu0=0,goodBtagMu11=0; |
113 |
– |
int goodBtagMuJet1=0, goodBtagMuJet2=0, goodBtagMuJet3=0, goodBtagMuJet4=0; |
114 |
– |
int goodIsoMu15=0,goodIsoMu17v5=0,goodIsoMu17v6=0; |
115 |
– |
|
116 |
– |
for (int itrig = 0; itrig != ntrigs; ++itrig){ |
117 |
– |
TString trigName=triggerNames_.triggerName(itrig); |
118 |
– |
if(strcmp(trigName,"HLT_Mu9")==0) goodMu9++; |
119 |
– |
if(strcmp(trigName,"HLT_IsoMu9")==0) goodIsoMu9++; |
120 |
– |
if(strcmp(trigName,"HLT_IsoMu13_v3")==0) goodIsoMu13_3++; |
121 |
– |
if(strcmp(trigName,"HLT_Mu11")==0) goodMu11++; |
122 |
– |
if(strcmp(trigName,"HLT_DoubleMu3")==0) goodDoubleMu3++; |
123 |
– |
if(strcmp(trigName,"HLT_DoubleMu3_v2")==0) goodDoubleMu3_2++; |
124 |
– |
if(strcmp(trigName,"HLT_Mu15")==0) goodMu15++; |
125 |
– |
if(strcmp(trigName,"HLT_Mu15_v1")==0) goodMu15_1++; |
126 |
– |
|
127 |
– |
if(strcmp(trigName,"HLT_DoubleEle10_SW_L1R")==0) goodDoubleElec10++; |
128 |
– |
if(strcmp(trigName,"HLT_DoubleEle15_SW_L1R_v1")==0) goodDoubleElec15_1++; |
129 |
– |
if(strcmp(trigName,"HLT_DoubleEle17_SW_L1R_v1")==0) goodDoubleElec17_1++; |
130 |
– |
if(strcmp(trigName,"HLT_MET100_v1")==0) goodMet100++; |
131 |
– |
if(strcmp(trigName,"HLT_Ele15_SW_L1R")==0) goodSingleEle1++; |
132 |
– |
if(strcmp(trigName,"HLT_Ele17_SW_TightEleId_L1R")==0) goodSingleEle2++; |
133 |
– |
if(strcmp(trigName,"HLT_Ele17_SW_TighterEleIdIsol_L1R_v2")==0) goodSingleEle3++; |
134 |
– |
if(strcmp(trigName,"HLT_Ele17_SW_TighterEleIdIsol_L1R_v3")==0) goodSingleEle4++; |
135 |
– |
if(strcmp(trigName,"HLT_BTagMu_DiJet20U_v1")==0) goodBtagMu1++; |
136 |
– |
if(strcmp(trigName,"HLT_BTagMu_DiJet30U_Mu5_v3")==0) goodBtagMu2++; |
137 |
– |
if(strcmp(trigName,"HLT_BTagMu_Jet20U")==0) goodBtagMu0++; |
138 |
– |
if(strcmp(trigName,"HLT_BTagMu_DiJet20U_Mu5_v1")==0) goodBtagMu11++; |
139 |
– |
if(strcmp(trigName,"HLT_Mu17_CentralJet30_BTagIP_v2")==0) goodBtagMuJet1++; |
140 |
– |
if(strcmp(trigName,"HLT_Mu17_CentralJet30_v2")==0) goodBtagMuJet2++; |
141 |
– |
if(strcmp(trigName,"HLT_HT200_Mu5_PFMHT35_v2")==0) goodBtagMuJet3++; |
142 |
– |
if(strcmp(trigName,"HLT_Mu12_CentralJet30_BTagIP_v2")==0) goodBtagMuJet4++; |
143 |
– |
|
144 |
– |
if(strcmp(trigName,"HLT_IsoMu15_v5")==0) goodIsoMu15++; |
145 |
– |
if(strcmp(trigName,"HLT_IsoMu17_v5")==0) goodIsoMu17v5++; |
146 |
– |
if(strcmp(trigName,"HLT_IsoMu17_v6")==0) goodIsoMu17v6++; |
147 |
– |
} |
148 |
– |
int itrig1=-99; |
149 |
– |
if(goodMu9!=0) itrig1 = triggerNames_.triggerIndex("HLT_Mu9"); |
150 |
– |
int itrig2=-99; |
151 |
– |
if(goodIsoMu9!=0) itrig2 = triggerNames_.triggerIndex("HLT_IsoMu9"); |
152 |
– |
int itrig3=-99; |
153 |
– |
if(goodIsoMu13_3!=0) itrig3 = triggerNames_.triggerIndex("HLT_IsoMu13_v3"); |
154 |
– |
int itrig4=-99; |
155 |
– |
if(goodMu11!=0) itrig4 = triggerNames_.triggerIndex("HLT_Mu11"); |
156 |
– |
int itrig5=-99; |
157 |
– |
if(goodDoubleMu3!=0) itrig5 = triggerNames_.triggerIndex("HLT_DoubleMu3"); |
158 |
– |
int itrig6=-99; |
159 |
– |
if(goodDoubleMu3_2!=0) itrig6 = triggerNames_.triggerIndex("HLT_DoubleMu3_v2"); |
160 |
– |
int itrig7=-99; |
161 |
– |
if(goodMu15!=0) itrig7 = triggerNames_.triggerIndex("HLT_Mu15"); |
162 |
– |
int itrig8=-99; |
163 |
– |
if(goodMu15_1!=0) itrig8 = triggerNames_.triggerIndex("HLT_Mu15_v1"); |
164 |
– |
|
165 |
– |
int itrig9=-99; |
166 |
– |
if(goodDoubleElec10!=0) itrig9 = triggerNames_.triggerIndex("HLT_DoubleEle10_SW_L1R"); |
167 |
– |
int itrig10=-99; |
168 |
– |
if(goodDoubleElec15_1!=0) itrig10 = triggerNames_.triggerIndex("HLT_DoubleEle15_SW_L1R_v1"); |
169 |
– |
int itrig11=-99; |
170 |
– |
if(goodDoubleElec17_1!=0) itrig11 = triggerNames_.triggerIndex("HLT_DoubleEle17_SW_L1R_v1"); |
171 |
– |
int itrig12=-99; |
172 |
– |
if(goodMet100!=0) itrig12 = triggerNames_.triggerIndex("HLT_MET100_v1"); |
173 |
– |
|
174 |
– |
int itrig13=-99; |
175 |
– |
if(goodSingleEle1!=0) itrig13 = triggerNames_.triggerIndex("HLT_Ele15_SW_L1R"); |
176 |
– |
int itrig14=-99; |
177 |
– |
if(goodSingleEle2!=0) itrig14 = triggerNames_.triggerIndex("HLT_Ele17_SW_TightEleId_L1R"); |
178 |
– |
int itrig15=-99; |
179 |
– |
if(goodSingleEle3!=0) itrig15 = triggerNames_.triggerIndex("HLT_Ele17_SW_TighterEleIdIsol_L1R_v2"); |
180 |
– |
int itrig16=-99; |
181 |
– |
if(goodSingleEle4!=0) itrig16 = triggerNames_.triggerIndex("HLT_Ele17_SW_TighterEleIdIsol_L1R_v3"); |
182 |
– |
|
183 |
– |
int itrig17=-99; |
184 |
– |
if(goodBtagMu1!=0) itrig17 = triggerNames_.triggerIndex("HLT_BTagMu_DiJet20U_v1"); |
185 |
– |
int itrig18=-99; |
186 |
– |
if(goodBtagMu2!=0) itrig18 = triggerNames_.triggerIndex("HLT_BTagMu_DiJet30U_Mu5_v3"); |
187 |
– |
int itrig19=-99; |
188 |
– |
if(goodBtagMu0!=0) itrig19 = triggerNames_.triggerIndex("HLT_BTagMu_Jet20U"); |
189 |
– |
int itrig20=-99; |
190 |
– |
if(goodBtagMu11!=0) itrig20 = triggerNames_.triggerIndex("HLT_BTagMu_DiJet20U_Mu5_v1"); |
191 |
– |
int itrig21=-99; |
192 |
– |
if(goodBtagMuJet1!=0) itrig21 = triggerNames_.triggerIndex("HLT_Mu17_CentralJet30_BTagIP_v2"); |
193 |
– |
int itrig22=-99; |
194 |
– |
if(goodBtagMuJet2!=0) itrig22 = triggerNames_.triggerIndex("HLT_Mu17_CentralJet30_v2"); |
195 |
– |
int itrig23=-99; |
196 |
– |
if(goodBtagMuJet3!=0) itrig23 = triggerNames_.triggerIndex("HLT_HT200_Mu5_PFMHT35_v2"); |
197 |
– |
int itrig231=-99; |
198 |
– |
if(goodBtagMuJet4!=0) itrig231 = triggerNames_.triggerIndex("HLT_Mu12_CentralJet30_BTagIP_v2"); |
199 |
– |
|
200 |
– |
int itrig24=-99; |
201 |
– |
if(goodIsoMu15!=0) itrig24 = triggerNames_.triggerIndex("HLT_IsoMu15_v5"); |
202 |
– |
int itrig25=-99; |
203 |
– |
if(goodIsoMu17v5!=0) itrig25 = triggerNames_.triggerIndex("HLT_IsoMu17_v5"); |
204 |
– |
int itrig26=-99; |
205 |
– |
if(goodIsoMu17v6!=0) itrig26 = triggerNames_.triggerIndex("HLT_IsoMu17_v6"); |
206 |
– |
|
207 |
– |
if (itrig1!=-99 && hltresults->accept(itrig1)) auxInfo->triggerInfo.triggerMu9=1; else auxInfo->triggerInfo.triggerMu9=0; |
208 |
– |
if (itrig2!=-99 && hltresults->accept(itrig2)) auxInfo->triggerInfo.triggerIsoMu9=1; else auxInfo->triggerInfo.triggerIsoMu9=0; |
209 |
– |
if (itrig3!=-99 && hltresults->accept(itrig3)) auxInfo->triggerInfo.triggerIsoMu13_3=1; else auxInfo->triggerInfo.triggerIsoMu13_3=0; |
210 |
– |
if (itrig4!=-99 && hltresults->accept(itrig4)) auxInfo->triggerInfo.triggerMu11=1; else auxInfo->triggerInfo.triggerMu11=0; |
211 |
– |
if (itrig5!=-99 && hltresults->accept(itrig5)) auxInfo->triggerInfo.triggerDoubleMu3=1; else auxInfo->triggerInfo.triggerDoubleMu3=0; |
212 |
– |
if (itrig6!=-99 && hltresults->accept(itrig6)) auxInfo->triggerInfo.triggerDoubleMu3_2=1; else auxInfo->triggerInfo.triggerDoubleMu3_2=0; |
213 |
– |
if (itrig7!=-99 && hltresults->accept(itrig7)) auxInfo->triggerInfo.triggerMu15=1; else auxInfo->triggerInfo.triggerMu15=0; |
214 |
– |
if (itrig8!=-99 && hltresults->accept(itrig8)) auxInfo->triggerInfo.triggerMu15_1=1; else auxInfo->triggerInfo.triggerMu15_1=0; |
215 |
– |
|
216 |
– |
if (itrig9!=-99 && hltresults->accept(itrig9)) auxInfo->triggerInfo.triggerDoubleElec10=1; else auxInfo->triggerInfo.triggerDoubleElec10=0; |
217 |
– |
if (itrig10!=-99 && hltresults->accept(itrig10)) auxInfo->triggerInfo.triggerDoubleElec15_1=1; else auxInfo->triggerInfo.triggerDoubleElec15_1=0; |
218 |
– |
if (itrig11!=-99 && hltresults->accept(itrig11)) auxInfo->triggerInfo.triggerDoubleElec17_1=1; else auxInfo->triggerInfo.triggerDoubleElec17_1=0; |
219 |
– |
if (itrig12!=-99 && hltresults->accept(itrig12)) auxInfo->triggerInfo.triggerMet100_1=1; else auxInfo->triggerInfo.triggerMet100_1=0; |
220 |
– |
|
221 |
– |
if (itrig13!=-99 && hltresults->accept(itrig13)) auxInfo->triggerInfo.triggerSingleEle1=1; else auxInfo->triggerInfo.triggerSingleEle1=0; |
222 |
– |
if (itrig14!=-99 && hltresults->accept(itrig14)) auxInfo->triggerInfo.triggerSingleEle2=1; else auxInfo->triggerInfo.triggerSingleEle2=0; |
223 |
– |
if (itrig15!=-99 && hltresults->accept(itrig15)) auxInfo->triggerInfo.triggerSingleEle3=1; else auxInfo->triggerInfo.triggerSingleEle3=0; |
224 |
– |
if (itrig16!=-99 && hltresults->accept(itrig16)) auxInfo->triggerInfo.triggerSingleEle4=1; else auxInfo->triggerInfo.triggerSingleEle4=0; |
225 |
– |
|
226 |
– |
if (itrig17!=-99 && hltresults->accept(itrig17)) auxInfo->triggerInfo.triggerBtagMu1=1; else auxInfo->triggerInfo.triggerBtagMu1=0; |
227 |
– |
if (itrig18!=-99 && hltresults->accept(itrig18)) auxInfo->triggerInfo.triggerBtagMu2=1; else auxInfo->triggerInfo.triggerBtagMu2=0; |
228 |
– |
if (itrig19!=-99 && hltresults->accept(itrig19)) auxInfo->triggerInfo.triggerBtagMu0=1; else auxInfo->triggerInfo.triggerBtagMu0=0; |
229 |
– |
if (itrig20!=-99 && hltresults->accept(itrig20)) auxInfo->triggerInfo.triggerBtagMu11=1; else auxInfo->triggerInfo.triggerBtagMu11=0; |
230 |
– |
if (itrig21!=-99 && hltresults->accept(itrig21)) auxInfo->triggerInfo.triggerBtagMuJet1=1; else auxInfo->triggerInfo.triggerBtagMuJet1=0; |
231 |
– |
if (itrig22!=-99 && hltresults->accept(itrig22)) auxInfo->triggerInfo.triggerBtagMuJet2=1; else auxInfo->triggerInfo.triggerBtagMuJet2=0; |
232 |
– |
if (itrig23!=-99 && hltresults->accept(itrig23)) auxInfo->triggerInfo.triggerBtagMuJet3=1; else auxInfo->triggerInfo.triggerBtagMuJet3=0; |
233 |
– |
if (itrig231!=-99 && hltresults->accept(itrig231)) auxInfo->triggerInfo.triggerBtagMuJet4=1; else auxInfo->triggerInfo.triggerBtagMuJet4=0; |
234 |
– |
|
235 |
– |
if (itrig24!=-99 && hltresults->accept(itrig24)) auxInfo->triggerInfo.triggerIsoMu15=1; else auxInfo->triggerInfo.triggerIsoMu15=0; |
236 |
– |
if (itrig25!=-99 && hltresults->accept(itrig25)) auxInfo->triggerInfo.triggerIsoMu17v5=1; else auxInfo->triggerInfo.triggerIsoMu17v5=0; |
237 |
– |
if (itrig26!=-99 && hltresults->accept(itrig26)) auxInfo->triggerInfo.triggerIsoMu17v6=1; else auxInfo->triggerInfo.triggerIsoMu17v6=0; |
238 |
– |
|
239 |
– |
if (itrig1==-99) auxInfo->triggerInfo.triggerMu9=-99; |
240 |
– |
if (itrig2==-99) auxInfo->triggerInfo.triggerIsoMu9=-99; |
241 |
– |
if (itrig3==-99) auxInfo->triggerInfo.triggerIsoMu13_3=-99; |
242 |
– |
if (itrig4==-99) auxInfo->triggerInfo.triggerMu11=-99; |
243 |
– |
if (itrig5==-99) auxInfo->triggerInfo.triggerDoubleMu3=-99; |
244 |
– |
if (itrig6==-99) auxInfo->triggerInfo.triggerDoubleMu3_2=-99; |
245 |
– |
if (itrig7==-99) auxInfo->triggerInfo.triggerMu15=-99; |
246 |
– |
if (itrig8==-99) auxInfo->triggerInfo.triggerMu15_1=-99; |
247 |
– |
|
248 |
– |
if (itrig9==-99) auxInfo->triggerInfo.triggerDoubleElec10=-99; |
249 |
– |
if (itrig10==-99) auxInfo->triggerInfo.triggerDoubleElec15_1=-99; |
250 |
– |
if (itrig11==-99) auxInfo->triggerInfo.triggerDoubleElec17_1=-99; |
251 |
– |
if (itrig12==-99) auxInfo->triggerInfo.triggerMet100_1=-99; |
252 |
– |
|
253 |
– |
if (itrig13==-99) auxInfo->triggerInfo.triggerSingleEle1=-99; |
254 |
– |
if (itrig14==-99) auxInfo->triggerInfo.triggerSingleEle2=-99; |
255 |
– |
if (itrig15==-99) auxInfo->triggerInfo.triggerSingleEle3=-99; |
256 |
– |
if (itrig16==-99) auxInfo->triggerInfo.triggerSingleEle4=-99; |
257 |
– |
|
258 |
– |
if(itrig17==-99) auxInfo->triggerInfo.triggerBtagMu1=-99; |
259 |
– |
if(itrig18==-99) auxInfo->triggerInfo.triggerBtagMu2=-99; |
260 |
– |
if(itrig19==-99) auxInfo->triggerInfo.triggerBtagMu0=-99; |
261 |
– |
if(itrig20==-99) auxInfo->triggerInfo.triggerBtagMu11=-99; |
262 |
– |
if(itrig21==-99) auxInfo->triggerInfo.triggerBtagMuJet1=-99; |
263 |
– |
if(itrig22==-99) auxInfo->triggerInfo.triggerBtagMuJet2=-99; |
264 |
– |
if(itrig23==-99) auxInfo->triggerInfo.triggerBtagMuJet3=-99; |
265 |
– |
if(itrig231==-99) auxInfo->triggerInfo.triggerBtagMuJet4=-99; |
266 |
– |
|
267 |
– |
if(itrig24==-99) auxInfo->triggerInfo.triggerIsoMu15=-99; |
268 |
– |
if(itrig25==-99) auxInfo->triggerInfo.triggerIsoMu17v5=-99; |
269 |
– |
if(itrig26==-99) auxInfo->triggerInfo.triggerIsoMu17v6=-99; |
270 |
– |
|
271 |
– |
// MinDRMu=-99.,MCBestMuId=-99,MCBestMuMomId=-99,MCBestMuGMomId=-99; |
272 |
– |
// for(int i=0;i<50;i++) {DeltaRMu[i]=-99;} |
273 |
– |
|
274 |
– |
|
275 |
– |
|
142 |
|
BeamSpot vertexBeamSpot; |
143 |
|
edm::Handle<reco::BeamSpot> recoBeamSpotHandle; |
144 |
|
iEvent.getByLabel("offlineBeamSpot",recoBeamSpotHandle); |
174 |
|
|
175 |
|
|
176 |
|
edm::Handle<double> rhoHandle; |
177 |
< |
iEvent.getByLabel(edm::InputTag("kt6PFJets", "rho"),rhoHandle); auxInfo->puInfo.rho = *rhoHandle; |
178 |
< |
|
177 |
> |
iEvent.getByLabel(edm::InputTag("kt6PFJets", "rho"),rhoHandle); |
178 |
> |
auxInfo->puInfo.rho = *rhoHandle; |
179 |
> |
|
180 |
> |
edm::Handle<double> rho25Handle; |
181 |
> |
iEvent.getByLabel(edm::InputTag("kt6PFJets25", "rho"),rho25Handle); |
182 |
> |
auxInfo->puInfo.rho25 = *rho25Handle; |
183 |
> |
|
184 |
> |
edm::Handle<std::vector< PileupSummaryInfo> > puHandle; |
185 |
> |
|
186 |
> |
if (runOnMC_){ |
187 |
> |
iEvent.getByType(puHandle); |
188 |
> |
if (puHandle.isValid()){ |
189 |
> |
|
190 |
> |
std::vector< PileupSummaryInfo> pu = (*puHandle); |
191 |
> |
for (std::vector<PileupSummaryInfo>::const_iterator it= pu.begin(); it!=pu.end(); ++it){ |
192 |
> |
int bx = (*it).getBunchCrossing(); |
193 |
> |
unsigned int num = (*it).getPU_NumInteractions(); |
194 |
> |
// std::cout <<" PU PUSHING "<<bx<<" " <<num<<std::endl; |
195 |
> |
auxInfo->puInfo.pus[bx] =num; |
196 |
> |
} |
197 |
> |
} |
198 |
> |
} |
199 |
> |
|
200 |
|
//// real start |
201 |
|
|
202 |
|
|
207 |
|
|
208 |
|
if(runOnMC_){ |
209 |
|
|
210 |
< |
int Hin=-99,Win=-99,Zin=-99,bin=-99,bbarin=-99; |
324 |
< |
iEvent.getByLabel("genParticles", genParticles); |
210 |
> |
iEvent.getByLabel("genParticles", genParticles); |
211 |
|
|
212 |
|
for(size_t i = 0; i < genParticles->size(); ++ i) { |
213 |
< |
int Hin=-99,Win=-99,Zin=-99,bin=-99,bbarin=-99; |
328 |
< |
|
213 |
> |
|
214 |
|
const GenParticle & p = (*genParticles)[i]; |
215 |
|
int id = p.pdgId(); |
216 |
|
int st = p.status(); |
217 |
|
|
218 |
|
if(id==25){ |
219 |
|
|
335 |
– |
/* int wh=0; |
336 |
– |
int nMoth = p.numberOfMothers(); |
337 |
– |
for(size_t jj = 0; jj < nMoth; ++ jj) { |
338 |
– |
const Candidate * mom = p.mother( jj ); |
339 |
– |
int nmomdau= mom->numberOfDaughters(); |
340 |
– |
for(size_t j = 0; j < nmomdau; ++ j) { |
341 |
– |
const Candidate * Wmomdau = mom->daughter( j ); |
342 |
– |
if(abs(Wmomdau->pdgId())==24) wh++; |
343 |
– |
} |
344 |
– |
} |
345 |
– |
|
346 |
– |
if(wh==0) continue; |
347 |
– |
*/ |
220 |
|
VHbbEventAuxInfo::ParticleMCInfo htemp; |
349 |
– |
Hin=i; |
221 |
|
htemp.status=st; |
222 |
|
htemp.charge=p.charge(); |
223 |
|
if(p.mother(0)!=0) htemp.momid=p.mother(0)->pdgId(); |
224 |
|
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) htemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
225 |
|
htemp.p4 = GENPTOLOR(p); |
226 |
< |
|
226 |
> |
|
227 |
|
int ndau = p.numberOfDaughters(); |
228 |
|
for(int j = 0; j < ndau; ++ j) { |
229 |
|
const Candidate * Hdau = p.daughter( j ); |
232 |
|
} |
233 |
|
(auxInfo->mcH).push_back(htemp); |
234 |
|
} |
235 |
< |
|
236 |
< |
|
235 |
> |
|
236 |
> |
|
237 |
|
if(abs(id)==24){ |
238 |
< |
|
368 |
< |
Win=i; |
238 |
> |
|
239 |
|
VHbbEventAuxInfo::ParticleMCInfo wtemp; |
240 |
|
wtemp.status=st; |
241 |
|
wtemp.charge=p.charge(); |
242 |
|
if(p.mother(0)!=0) wtemp.momid=p.mother(0)->pdgId(); |
243 |
|
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) wtemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
244 |
|
wtemp.p4=GENPTOLOR(p); |
245 |
< |
|
245 |
> |
|
246 |
|
int ndau = p.numberOfDaughters(); |
247 |
|
for(int j = 0; j < ndau; ++ j) { |
248 |
|
const Candidate * Wdau = p.daughter( j ); |
254 |
|
|
255 |
|
if(abs(id)==23){ |
256 |
|
|
257 |
< |
Zin=i; |
257 |
> |
|
258 |
|
VHbbEventAuxInfo::ParticleMCInfo ztemp; |
259 |
|
ztemp.status=st; |
260 |
|
ztemp.charge=p.charge(); |
276 |
|
|
277 |
|
|
278 |
|
if(id==5){ |
279 |
< |
bin=i; |
279 |
> |
|
280 |
|
VHbbEventAuxInfo::ParticleMCInfo btemp; |
281 |
|
btemp.status=st; |
282 |
|
btemp.charge=p.charge(); |
283 |
|
if(p.mother(0)!=0) btemp.momid=p.mother(0)->pdgId(); |
284 |
|
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) btemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
285 |
+ |
|
286 |
+ |
btemp.p4=GENPTOLOR(p); |
287 |
+ |
|
288 |
+ |
int nHDaubdau = p.numberOfDaughters(); |
289 |
+ |
for(int j = 0; j < nHDaubdau; ++ j) { |
290 |
+ |
const Candidate * Bdau = p.daughter( j ); |
291 |
+ |
btemp.dauid.push_back(Bdau->pdgId()); |
292 |
+ |
} |
293 |
|
auxInfo->mcB.push_back(btemp); |
294 |
|
} |
295 |
|
|
296 |
|
if(id==-5){ |
297 |
< |
bbarin=i; |
297 |
> |
|
298 |
|
VHbbEventAuxInfo::ParticleMCInfo bbtemp; |
299 |
|
|
300 |
|
bbtemp.status=st; |
301 |
|
bbtemp.charge=p.charge(); |
302 |
|
if(p.mother(0)!=0) bbtemp.momid=p.mother(0)->pdgId(); |
303 |
|
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) bbtemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
304 |
+ |
|
305 |
+ |
bbtemp.p4=GENPTOLOR(p); |
306 |
+ |
|
307 |
+ |
int nHDaubdau = p.numberOfDaughters(); |
308 |
+ |
for(int j = 0; j < nHDaubdau; ++ j) { |
309 |
+ |
const Candidate * Bdau = p.daughter( j ); |
310 |
+ |
bbtemp.dauid.push_back(Bdau->pdgId()); |
311 |
+ |
} |
312 |
+ |
|
313 |
+ |
|
314 |
|
auxInfo->mcBbar.push_back(bbtemp); |
315 |
|
} |
316 |
|
|
320 |
|
ctemp.charge=p.charge(); |
321 |
|
if(p.mother(0)!=0) ctemp.momid=p.mother(0)->pdgId(); |
322 |
|
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) ctemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
323 |
+ |
|
324 |
+ |
ctemp.p4=GENPTOLOR(p); |
325 |
+ |
|
326 |
+ |
int nHDaubdau = p.numberOfDaughters(); |
327 |
+ |
for(int j = 0; j < nHDaubdau; ++ j) { |
328 |
+ |
const Candidate * Bdau = p.daughter( j ); |
329 |
+ |
ctemp.dauid.push_back(Bdau->pdgId()); |
330 |
+ |
} |
331 |
+ |
|
332 |
|
auxInfo->mcC.push_back(ctemp); |
333 |
+ |
|
334 |
|
} |
437 |
– |
|
438 |
– |
if(bin!=-99 && bbarin!=-99){ |
439 |
– |
const Candidate & bGen = (*genParticles)[bin]; |
440 |
– |
const Candidate & bbarGen = (*genParticles)[bbarin]; |
441 |
– |
((auxInfo->mcB).back()).p4=GENPTOLOR(bGen); |
442 |
– |
((auxInfo->mcBbar).back()).p4=GENPTOLOR(bbarGen); |
443 |
– |
|
444 |
– |
int nHDaubdau = bGen.numberOfDaughters(); |
445 |
– |
for(int j = 0; j < nHDaubdau; ++ j) { |
446 |
– |
const Candidate * Bdau = bGen.daughter( j ); |
447 |
– |
((auxInfo->mcB).back()).dauid.push_back(Bdau->pdgId()); |
448 |
– |
((auxInfo->mcB).back()).dauFourMomentum.push_back(GENPTOLORP(Bdau)); |
449 |
– |
} |
450 |
– |
int nHDaubbardau = bbarGen.numberOfDaughters(); |
451 |
– |
for(int j = 0; j < nHDaubbardau; ++ j) { |
452 |
– |
const Candidate * Bbardau = bbarGen.daughter( j ); |
453 |
– |
((auxInfo->mcBbar).back()).dauid.push_back(Bbardau->pdgId()); |
454 |
– |
((auxInfo->mcBbar).back()).dauFourMomentum.push_back(GENPTOLORP(Bbardau)); |
455 |
– |
} |
456 |
– |
|
457 |
– |
} |
335 |
|
|
336 |
|
} |
337 |
|
|
461 |
– |
|
338 |
|
} // isMC |
339 |
|
|
340 |
|
/////// end generator block |
377 |
|
iEvent.getByLabel(eleLabel_,electronHandle); |
378 |
|
edm::View<pat::Electron> electrons = *electronHandle; |
379 |
|
|
504 |
– |
edm::Handle<edm::View<pat::MET> > metHandle; |
505 |
– |
iEvent.getByLabel(metLabel_,metHandle); |
506 |
– |
edm::View<pat::MET> mets = *metHandle; |
380 |
|
|
381 |
|
// edm::Handle<edm::View<pat::Photon> > phoHandle; |
382 |
|
// iEvent.getByLabel(phoLabel_,phoHandle); |
386 |
|
iEvent.getByLabel(tauLabel_,tauHandle); |
387 |
|
edm::View<pat::Tau> taus = *tauHandle; |
388 |
|
|
516 |
– |
edm::Handle<CandidateView> dimuons; |
517 |
– |
iEvent.getByLabel(dimuLabel_,dimuons); |
518 |
– |
|
519 |
– |
edm::Handle<CandidateView> dielectrons; |
520 |
– |
iEvent.getByLabel(dielecLabel_,dielectrons); |
389 |
|
|
390 |
|
//BTAGGING SCALE FACTOR FROM DATABASE |
391 |
|
//Combined Secondary Vertex Loose |
392 |
|
edm::ESHandle<BtagPerformance> bTagSF_CSVL_; |
393 |
|
iSetup.get<BTagPerformanceRecord>().get("BTAGCSVL",bTagSF_CSVL_); |
526 |
– |
const BtagPerformance & bTagSF_CSVL = *(bTagSF_CSVL_.product()); |
394 |
|
//Combined Secondary Vertex Medium |
395 |
|
edm::ESHandle<BtagPerformance> bTagSF_CSVM_; |
396 |
|
iSetup.get<BTagPerformanceRecord>().get("BTAGCSVM",bTagSF_CSVM_); |
530 |
– |
const BtagPerformance & bTagSF_CSVM = *(bTagSF_CSVM_.product()); |
397 |
|
//Combined Secondary Vertex Tight |
398 |
|
edm::ESHandle<BtagPerformance> bTagSF_CSVT_; |
399 |
|
iSetup.get<BTagPerformanceRecord>().get("BTAGCSVT",bTagSF_CSVT_); |
534 |
– |
const BtagPerformance & bTagSF_CSVT = *(bTagSF_CSVT_.product()); |
400 |
|
|
401 |
|
edm::ESHandle<BtagPerformance> mistagSF_CSVL_; |
402 |
|
iSetup.get<BTagPerformanceRecord>().get("MISTAGCSVL",mistagSF_CSVL_); |
538 |
– |
const BtagPerformance & mistagSF_CSVL = *(mistagSF_CSVL_.product()); |
403 |
|
//Combined Secondary Vertex Medium |
404 |
|
edm::ESHandle<BtagPerformance> mistagSF_CSVM_; |
405 |
|
iSetup.get<BTagPerformanceRecord>().get("MISTAGCSVM",mistagSF_CSVM_); |
542 |
– |
const BtagPerformance & mistagSF_CSVM = *(mistagSF_CSVM_.product()); |
406 |
|
//Combined Secondary Vertex Tight |
407 |
|
edm::ESHandle<BtagPerformance> mistagSF_CSVT_; |
408 |
|
iSetup.get<BTagPerformanceRecord>().get("MISTAGCSVT",mistagSF_CSVT_); |
546 |
– |
const BtagPerformance & mistagSF_CSVT = *(mistagSF_CSVT_.product()); |
409 |
|
|
410 |
< |
iBTV.BTAGSF_CSVL = (bTagSF_CSVL_.product()); |
411 |
< |
iBTV.BTAGSF_CSVM = (bTagSF_CSVM_.product()); |
412 |
< |
iBTV.BTAGSF_CSVT = (bTagSF_CSVT_.product()); |
413 |
< |
iBTV.MISTAGSF_CSVL = (mistagSF_CSVL_.product()); |
414 |
< |
iBTV.MISTAGSF_CSVM = (mistagSF_CSVM_.product()); |
415 |
< |
iBTV.MISTAGSF_CSVT = (mistagSF_CSVT_.product()); |
410 |
> |
BTagSFContainer btagSFs; |
411 |
> |
btagSFs.BTAGSF_CSVL = (bTagSF_CSVL_.product()); |
412 |
> |
btagSFs.BTAGSF_CSVM = (bTagSF_CSVM_.product()); |
413 |
> |
btagSFs.BTAGSF_CSVT = (bTagSF_CSVT_.product()); |
414 |
> |
btagSFs.MISTAGSF_CSVL = (mistagSF_CSVL_.product()); |
415 |
> |
btagSFs.MISTAGSF_CSVM = (mistagSF_CSVM_.product()); |
416 |
> |
btagSFs.MISTAGSF_CSVT = (mistagSF_CSVT_.product()); |
417 |
|
|
418 |
+ |
#ifdef ENABLE_SIMPLEJETS1 |
419 |
|
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets1.begin(); jet_iter!=simplejets1.end(); ++jet_iter){ |
420 |
|
// if(jet_iter->pt()>50) |
421 |
|
// njetscounter++; |
422 |
|
VHbbEvent::SimpleJet sj; |
423 |
< |
sj.flavour = jet_iter->partonFlavour(); |
423 |
> |
fillSimpleJet(sj,jet_iter); |
424 |
> |
// if(!runOnMC_) |
425 |
|
|
426 |
< |
sj.tche=jet_iter->bDiscriminator("trackCountingHighEffBJetTags"); |
562 |
< |
sj.tchp=jet_iter->bDiscriminator("trackCountingHighPurBJetTags"); |
563 |
< |
sj.jp=jet_iter->bDiscriminator("jetProbabilityBJetTags"); |
564 |
< |
sj.jpb=jet_iter->bDiscriminator("jetBProbabilityBJetTags"); |
565 |
< |
sj.ssvhe=jet_iter->bDiscriminator("simpleSecondaryVertexHighEffBJetTags"); |
566 |
< |
sj.csv=jet_iter->bDiscriminator("combinedSecondaryVertexBJetTags"); |
567 |
< |
sj.csvmva=jet_iter->bDiscriminator("combinedSecondaryVertexMVABJetTags"); |
568 |
< |
sj.charge=jet_iter->jetCharge(); |
569 |
< |
sj.ntracks=jet_iter->associatedTracks().size(); |
570 |
< |
sj.p4=GENPTOLORP(jet_iter); |
571 |
< |
sj.chargedTracksFourMomentum=(getChargedTracksMomentum(&*(jet_iter))); |
572 |
< |
sj.SF_CSVL=1; |
573 |
< |
sj.SF_CSVM=1; |
574 |
< |
sj.SF_CSVT=1; |
575 |
< |
sj.SF_CSVLerr=0; |
576 |
< |
sj.SF_CSVMerr=0; |
577 |
< |
sj.SF_CSVTerr=0; |
578 |
< |
// |
579 |
< |
// add tVector |
580 |
< |
// |
581 |
< |
sj.tVector = getTvect(&(*jet_iter)); |
426 |
> |
setJecUnc(sj,jecUnc); |
427 |
|
|
428 |
|
Particle::LorentzVector p4Jet = jet_iter->p4(); |
429 |
|
|
430 |
|
if(runOnMC_){ |
431 |
|
|
432 |
< |
fillScaleFactors(sj, iBTV); |
432 |
> |
fillScaleFactors(sj, btagSFs); |
433 |
|
|
434 |
|
//PAT genJet matching |
435 |
|
//genJet |
441 |
|
TLorentzVector gJp4; |
442 |
|
if(gJ){ |
443 |
|
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
444 |
+ |
sj.bestMCp4mom = gJp4; |
445 |
+ |
std::cout <<" KKKKK 1 "<< sj.bestMCp4mom.Pt() <<std::endl; |
446 |
|
if(verbose_){ |
447 |
|
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
448 |
|
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
449 |
< |
std::clog << "genJet matched deltaR = " << gJp4.DeltaR(sj.p4) << std::endl; |
449 |
> |
std::clog << "genJet matched deltaR = " <<gJp4.DeltaR(sj.p4) << std::endl; |
450 |
|
std::clog << "genJet matched mother id = " << sj.bestMCmomid << std::endl; |
451 |
|
} |
452 |
|
} |
455 |
|
hbbInfo->simpleJets.push_back(sj); |
456 |
|
|
457 |
|
} |
458 |
< |
|
458 |
> |
#endif //ENABLE_SIMPLEJETS1 |
459 |
> |
|
460 |
> |
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets3.begin(); jet_iter!=simplejets3.end(); ++jet_iter){ |
461 |
> |
// if(jet_iter->pt()>50) |
462 |
> |
// njetscounter++; |
463 |
> |
VHbbEvent::SimpleJet sj; |
464 |
> |
fillSimpleJet(sj,jet_iter); |
465 |
> |
// if(!runOnMC_) |
466 |
> |
setJecUnc(sj,jecUnc); |
467 |
> |
|
468 |
> |
|
469 |
> |
Particle::LorentzVector p4Jet = jet_iter->p4(); |
470 |
> |
|
471 |
> |
if(runOnMC_){ |
472 |
> |
|
473 |
> |
fillScaleFactors(sj, btagSFs); |
474 |
> |
|
475 |
> |
//PAT genJet matching |
476 |
> |
//genJet |
477 |
> |
const reco::GenJet *gJ = jet_iter->genJet(); |
478 |
> |
//physical parton for mother info ONLY |
479 |
> |
if( (jet_iter->genParton()) |
480 |
> |
and (jet_iter->genParton()->mother()) ) |
481 |
> |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
482 |
> |
TLorentzVector gJp4; |
483 |
> |
if(gJ){ |
484 |
> |
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
485 |
> |
sj.bestMCp4mom = gJp4; |
486 |
> |
std::cout <<" KKKKK 2 "<< (sj.bestMCp4mom.Pt()) <<std::endl; |
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 |
> |
|
495 |
> |
} //isMC |
496 |
> |
hbbInfo->simpleJets3.push_back(sj); |
497 |
> |
|
498 |
> |
} |
499 |
> |
|
500 |
> |
#ifdef ENABLE_SIMPLEJETS4 |
501 |
> |
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets4.begin(); jet_iter!=simplejets4.end(); ++jet_iter){ |
502 |
> |
// if(jet_iter->pt()>50) |
503 |
> |
// njetscounter++; |
504 |
> |
VHbbEvent::SimpleJet sj; |
505 |
> |
fillSimpleJet(sj,jet_iter); |
506 |
> |
// if(!runOnMC_) |
507 |
> |
setJecUnc(sj,jecUnc); |
508 |
> |
|
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 |
> |
and (jet_iter->genParton()->mother()) ) |
522 |
> |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
523 |
> |
TLorentzVector gJp4; |
524 |
> |
if(gJ){ |
525 |
> |
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
526 |
> |
sj.bestMCp4mom = gJp4; |
527 |
> |
std::cout <<" KKKKK 3 "<< sj.bestMCp4mom.Pt() <<std::endl; |
528 |
> |
if(verbose_){ |
529 |
> |
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
530 |
> |
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
531 |
> |
std::clog << "genJet matched deltaR = " <<gJp4.DeltaR(sj.p4) << std::endl; |
532 |
> |
std::clog << "genJet matched mother id = " << sj.bestMCmomid << std::endl; |
533 |
> |
} |
534 |
> |
} |
535 |
> |
|
536 |
> |
} //isMC |
537 |
> |
hbbInfo->simpleJets4.push_back(sj); |
538 |
> |
|
539 |
> |
} |
540 |
> |
#endif //ENABLE SIMPLEJETS4 |
541 |
> |
|
542 |
|
|
543 |
|
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets2.begin(); jet_iter!=simplejets2.end(); ++jet_iter){ |
544 |
|
|
545 |
|
VHbbEvent::SimpleJet sj; |
546 |
< |
sj.flavour = jet_iter->partonFlavour(); |
546 |
> |
fillSimpleJet(sj,jet_iter); |
547 |
> |
// if(!runOnMC_) |
548 |
> |
setJecUnc(sj,jecUnc); |
549 |
> |
/* sj.flavour = jet_iter->partonFlavour(); |
550 |
|
|
551 |
|
|
552 |
|
sj.tche=jet_iter->bDiscriminator("trackCountingHighEffBJetTags"); |
566 |
|
sj.SF_CSVLerr=0; |
567 |
|
sj.SF_CSVMerr=0; |
568 |
|
sj.SF_CSVTerr=0; |
569 |
+ |
|
570 |
+ |
// |
571 |
+ |
// addtaginfo for csv |
572 |
+ |
// |
573 |
+ |
|
574 |
+ |
if (jet_iter->hasTagInfo("SimpleSecondaryVertex")) { |
575 |
+ |
|
576 |
+ |
const reco::SecondaryVertexTagInfo * tf = jet_iter->tagInfoSecondaryVertex(); |
577 |
+ |
sj.vtxMass = tf->secondaryVertex(0).p4().mass(); |
578 |
+ |
sj.vtxNTracks = tf->secondaryVertex(0).nTracks(); |
579 |
+ |
Measurement1D m = tf->flightDistance(0); |
580 |
+ |
sj.vtx3dL = m.value(); |
581 |
+ |
sj.vtx3deL = m.error(); |
582 |
+ |
} |
583 |
+ |
|
584 |
+ |
|
585 |
|
// |
586 |
|
// add tVector |
587 |
|
// |
588 |
|
sj.tVector = getTvect(&(*jet_iter)); |
589 |
< |
|
589 |
> |
*/ |
590 |
|
Particle::LorentzVector p4Jet = jet_iter->p4(); |
591 |
|
|
643 |
– |
|
592 |
|
if(runOnMC_){ |
593 |
|
|
594 |
|
//BTV scale factors |
595 |
< |
fillScaleFactors(sj, iBTV); |
595 |
> |
fillScaleFactors(sj, btagSFs); |
596 |
|
|
597 |
|
//PAT genJet matching |
598 |
|
//genJet |
604 |
|
TLorentzVector gJp4; |
605 |
|
if(gJ){ |
606 |
|
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
607 |
+ |
sj.bestMCp4mom = gJp4; |
608 |
+ |
std::cout <<" KKKKK 4 "<< sj.bestMCp4mom.Pt() <<std::endl; |
609 |
|
if(verbose_){ |
610 |
|
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
611 |
|
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
652 |
|
VHbbEvent::HardJet hj; |
653 |
|
hj.constituents=constituents.size(); |
654 |
|
hj.p4 =GENPTOLORP(jet_iter); |
655 |
< |
|
655 |
> |
|
656 |
|
for (unsigned int iJC(0); iJC<constituents.size(); ++iJC ){ |
657 |
|
Jet::Constituent icandJet = constituents[iJC]; |
658 |
|
|
685 |
|
<< "," << subjet_iter->bDiscriminator("combinedSecondaryVertexBJetTags") << "\n";} |
686 |
|
|
687 |
|
VHbbEvent::SimpleJet sj; |
688 |
< |
|
689 |
< |
sj.flavour = subjet_iter->partonFlavour(); |
688 |
> |
fillSimpleJet(sj,subjet_iter); |
689 |
> |
// if(!runOnMC_) |
690 |
> |
setJecUnc(sj,jecUnc); |
691 |
> |
/* sj.flavour = subjet_iter->partonFlavour(); |
692 |
|
sj.tVector = getTvect(&(*subjet_iter)); |
693 |
|
sj.tche=subjet_iter->bDiscriminator("trackCountingHighEffBJetTags"); |
694 |
|
sj.tchp=subjet_iter->bDiscriminator("trackCountingHighPurBJetTags"); |
701 |
|
sj.ntracks=subjet_iter->associatedTracks().size(); |
702 |
|
sj.p4=GENPTOLORP(subjet_iter); |
703 |
|
sj.p4=(getChargedTracksMomentum(&*(subjet_iter))); |
704 |
+ |
|
705 |
+ |
// |
706 |
+ |
// addtaginfo for csv |
707 |
+ |
// |
708 |
+ |
|
709 |
+ |
if (subjet_iter->hasTagInfo("SimpleSecondaryVertex")) { |
710 |
+ |
|
711 |
+ |
const reco::SecondaryVertexTagInfo * tf = subjet_iter->tagInfoSecondaryVertex(); |
712 |
+ |
sj.vtxMass = tf->secondaryVertex(0).p4().mass(); |
713 |
+ |
sj.vtxNTracks = tf->secondaryVertex(0).nTracks(); |
714 |
+ |
Measurement1D m = tf->flightDistance(0); |
715 |
+ |
sj.vtx3dL = m.value(); |
716 |
+ |
sj.vtx3deL = m.error(); |
717 |
+ |
} |
718 |
+ |
*/ |
719 |
|
hbbInfo->subJets.push_back(sj); |
720 |
|
|
721 |
|
} |
730 |
|
edm::View<pat::MET> metsTC = *metTCHandle; |
731 |
|
if(metsTC.size()){ |
732 |
|
hbbInfo->tcmet.sumEt=(metsTC[0]).sumEt(); |
733 |
< |
hbbInfo->tcmet.metSig=(metsTC[0]).mEtSig(); |
733 |
> |
hbbInfo->tcmet.metSig=(metsTC[0]).significance(); |
734 |
|
hbbInfo->tcmet.eLong=(metsTC[0]).e_longitudinal(); |
735 |
|
hbbInfo->tcmet.p4=GENPTOLOR((metsTC[0])); |
736 |
|
if (verbose_) std::cout <<" METTC "<< hbbInfo->tcmet.metSig <<" " << hbbInfo->tcmet.sumEt<<std::endl; |
737 |
|
} |
738 |
|
|
739 |
+ |
edm::Handle<edm::View<reco::MET> > pfMETNoPUHandle; |
740 |
+ |
iEvent.getByLabel("pfMETNoPU",pfMETNoPUHandle); |
741 |
+ |
edm::View<reco::MET> metspfMETNoPU = *pfMETNoPUHandle; |
742 |
+ |
if(metspfMETNoPU.size()){ |
743 |
+ |
hbbInfo->metNoPU.sumEt=(metspfMETNoPU[0]).sumEt(); |
744 |
+ |
hbbInfo->metNoPU.metSig=(metspfMETNoPU[0]).significance(); |
745 |
+ |
hbbInfo->metNoPU.eLong=(metspfMETNoPU[0]).e_longitudinal(); |
746 |
+ |
hbbInfo->metNoPU.p4=GENPTOLOR((metspfMETNoPU[0])); |
747 |
+ |
if (verbose_) std::cout <<" pfMETNoPU "<< hbbInfo->metNoPU.metSig <<" " << hbbInfo->metNoPU.sumEt<<std::endl; |
748 |
+ |
} |
749 |
+ |
|
750 |
+ |
edm::Handle<edm::View<reco::MET> > mHTHandle; |
751 |
+ |
iEvent.getByLabel("patMETsHT",mHTHandle); |
752 |
+ |
edm::View<reco::MET> metsHT = *mHTHandle; |
753 |
+ |
if(metsHT.size()){ |
754 |
+ |
hbbInfo->mht.sumEt=(metsHT[0]).sumEt(); |
755 |
+ |
hbbInfo->mht.metSig=(metsHT[0]).significance(); |
756 |
+ |
hbbInfo->mht.eLong=(metsHT[0]).e_longitudinal(); |
757 |
+ |
hbbInfo->mht.p4=GENPTOLOR((metsHT[0])); |
758 |
+ |
if (verbose_) std::cout <<" METHT "<< hbbInfo->mht.metSig <<" " << hbbInfo->mht.sumEt<<std::endl; |
759 |
+ |
} |
760 |
+ |
|
761 |
+ |
edm::Handle<edm::View<reco::MET> > metHandle; |
762 |
+ |
iEvent.getByLabel(metLabel_,metHandle); |
763 |
+ |
edm::View<reco::MET> mets = *metHandle; |
764 |
+ |
|
765 |
|
if(mets.size()){ |
766 |
|
hbbInfo->calomet.sumEt=(mets[0]).sumEt(); |
767 |
< |
hbbInfo->calomet.metSig=(mets[0]).mEtSig(); |
767 |
> |
hbbInfo->calomet.metSig=(mets[0]).significance(); |
768 |
|
hbbInfo->calomet.eLong=(mets[0]).e_longitudinal(); |
769 |
|
hbbInfo->calomet.p4=GENPTOLOR((mets[0])); |
770 |
< |
if (verbose_) std::cout <<" METTC "<< hbbInfo->calomet.metSig <<" " << hbbInfo->calomet.sumEt<<std::endl; |
770 |
> |
if (verbose_) std::cout <<" METCALO "<< hbbInfo->calomet.metSig <<" " << hbbInfo->calomet.sumEt<<std::endl; |
771 |
|
} |
779 |
– |
|
772 |
|
|
773 |
|
edm::Handle<edm::View<pat::MET> > metPFHandle; |
774 |
|
iEvent.getByLabel("patMETsPF",metPFHandle); |
775 |
|
edm::View<pat::MET> metsPF = *metPFHandle; |
776 |
< |
|
776 |
> |
|
777 |
|
if(metsPF.size()){ |
778 |
|
hbbInfo->pfmet.sumEt=(metsPF[0]).sumEt(); |
779 |
< |
hbbInfo->pfmet.metSig=(metsPF[0]).mEtSig(); |
779 |
> |
hbbInfo->pfmet.metSig=(metsPF[0]).significance(); |
780 |
|
hbbInfo->pfmet.eLong=(metsPF[0]).e_longitudinal(); |
781 |
|
hbbInfo->pfmet.p4=GENPTOLOR((metsPF[0])); |
782 |
< |
if (verbose_) std::cout <<" METTC "<< hbbInfo->pfmet.metSig <<" " << hbbInfo->pfmet.sumEt<<std::endl; |
782 |
> |
if (verbose_) std::cout <<" METPF "<< hbbInfo->pfmet.metSig <<" " << hbbInfo->pfmet.sumEt<<std::endl; |
783 |
|
} |
784 |
< |
|
785 |
< |
|
784 |
> |
|
785 |
> |
|
786 |
|
if(verbose_){ |
787 |
< |
std::cout << "METs: calomet "<<mets.size()<<" tcmet "<<metsTC.size()<<" pfmet "<<metsPF.size()<<std::endl; |
787 |
> |
std::cout << "METs: calomet "<<mets.size()<<" tcmet"<<metsTC.size()<<" pfmet "<<metsPF.size()<<" MHT" <<metsHT.size()<<std::endl; |
788 |
|
} |
789 |
|
|
790 |
|
if(verbose_) |
798 |
|
mf.eIso=mu->ecalIso(); |
799 |
|
mf.hIso=mu->hcalIso(); |
800 |
|
mf.pfChaIso=mu->chargedHadronIso(); |
801 |
+ |
mf.pfChaPUIso=mu->userIso(5); |
802 |
|
mf.pfPhoIso=mu->photonIso(); |
803 |
|
mf.pfNeuIso=mu->neutralHadronIso(); |
804 |
|
Geom::Phi<double> deltaphi(mu->phi()-atan2(mf.p4.Px(), mf.p4.Py())); |
827 |
|
const reco::HitPattern& q = gTrack->hitPattern(); |
828 |
|
mf.globChi2=gTrack.get()->normalizedChi2(); |
829 |
|
mf.globNHits=q.numberOfValidMuonHits(); |
830 |
< |
mf. validMuStations = q. muonStationsWithValidHits(); |
830 |
> |
mf.validMuStations = q.muonStationsWithValidHits(); |
831 |
|
}else{ |
832 |
|
mf.globChi2=-99; |
833 |
|
mf.globNHits=-99; |
873 |
|
hbbInfo->muInfo.push_back(mf); |
874 |
|
} |
875 |
|
|
876 |
< |
if(verbose_) |
876 |
> |
if(verbose_) |
877 |
|
std::cout << " INPUT electrons "<<electrons.size()<<std::endl; |
878 |
|
for(edm::View<pat::Electron>::const_iterator elec = electrons.begin(); elec!=electrons.end(); ++elec){ |
879 |
|
VHbbEvent::ElectronInfo ef; |
886 |
|
ef.eIso=elec->ecalIso(); |
887 |
|
ef.hIso=elec->hcalIso(); |
888 |
|
ef.pfChaIso=elec->chargedHadronIso(); |
889 |
+ |
ef.pfChaPUIso=elec->userIso(5); |
890 |
|
ef.pfPhoIso=elec->photonIso(); |
891 |
|
ef.pfNeuIso=elec->neutralHadronIso(); |
892 |
|
|
893 |
< |
Geom::Phi<double> deltaphi(elec->superCluster()->phi()-atan2(hbbInfo->calomet.p4.Py(),hbbInfo->calomet.p4.Px())); |
893 |
> |
Geom::Phi<double> deltaphi(elec->superCluster()->phi()-atan2(hbbInfo->pfmet.p4.Py(),hbbInfo->pfmet.p4.Px())); |
894 |
|
ef.acop = deltaphi.value(); |
895 |
|
// |
896 |
|
// fill eleids |
949 |
|
tf.tIso=tau->trackIso(); |
950 |
|
tf.eIso=tau->ecalIso(); |
951 |
|
tf.hIso=tau->hcalIso(); |
952 |
< |
Geom::Phi<double> deltaphi(tau->phi()-atan2(hbbInfo->calomet.p4.Py(),hbbInfo->calomet.p4.Px())); |
952 |
> |
Geom::Phi<double> deltaphi(tau->phi()-atan2(hbbInfo->pfmet.p4.Py(),hbbInfo->pfmet.p4.Px())); |
953 |
|
double acop = deltaphi.value(); |
954 |
|
tf.acop=acop; |
955 |
|
tf.idbyIso=tau->tauID("byIsolation"); |
962 |
|
hbbInfo->tauInfo.push_back(tf); |
963 |
|
} |
964 |
|
|
965 |
+ |
CompareJetPtMuons ptComparatorMu; |
966 |
+ |
CompareJetPtElectrons ptComparatorE; |
967 |
+ |
CompareJetPtTaus ptComparatorTau; |
968 |
+ |
|
969 |
+ |
std::sort(hbbInfo->muInfo.begin(), hbbInfo->muInfo.end(), ptComparatorMu); |
970 |
+ |
std::sort(hbbInfo->eleInfo.begin(), hbbInfo->eleInfo.end(), ptComparatorE); |
971 |
+ |
std::sort(hbbInfo->tauInfo.begin(), hbbInfo->tauInfo.end(), ptComparatorTau); |
972 |
|
|
972 |
– |
// dimuons and dielectrons |
973 |
|
|
974 |
– |
for( size_t i = 0; i < dimuons->size(); i++ ) { |
975 |
– |
VHbbEvent::DiMuonInfo df; |
976 |
– |
const Candidate & dimuonCand = (*dimuons)[ i ]; |
977 |
– |
df.p4= GENPTOLOR(dimuonCand); |
978 |
– |
const Candidate * lep0 = dimuonCand.daughter( 0 ); |
979 |
– |
const Candidate * lep1 = dimuonCand.daughter( 1 ); |
980 |
– |
// needed to access specific methods of pat::Muon |
981 |
– |
const pat::Muon & muonDau0 = dynamic_cast<const pat::Muon &>(*lep0->masterClone()); |
982 |
– |
const pat::Muon & muonDau1 = dynamic_cast<const pat::Muon &>(*lep1->masterClone()); |
983 |
– |
|
984 |
– |
df.daughter1.p4=GENPTOLOR(muonDau0); |
985 |
– |
df.daughter2.p4=GENPTOLOR(muonDau1); |
974 |
|
|
987 |
– |
df.daughter1.tIso= muonDau0.trackIso(); |
988 |
– |
df.daughter2.tIso= muonDau1.trackIso(); |
989 |
– |
|
990 |
– |
df.daughter1.eIso= muonDau0.ecalIso(); |
991 |
– |
df.daughter2.eIso= muonDau1.ecalIso(); |
992 |
– |
|
993 |
– |
df.daughter1.hIso= muonDau0.hcalIso(); |
994 |
– |
df.daughter2.hIso= muonDau1.hcalIso(); |
995 |
– |
|
996 |
– |
df.daughter1.ipDb=muonDau0.dB(); |
997 |
– |
df.daughter2.ipDb=muonDau1.dB(); |
998 |
– |
|
999 |
– |
df.daughter1.ipErrDb=muonDau0.edB(); |
1000 |
– |
df.daughter2.ipErrDb=muonDau1.edB(); |
1001 |
– |
|
1002 |
– |
df.daughter1.cat=0; |
1003 |
– |
if(muonDau0.isGlobalMuon()) df.daughter1.cat|=1; |
1004 |
– |
if(muonDau0.isTrackerMuon()) df.daughter1.cat|=2; |
1005 |
– |
if(muonDau0.isStandAloneMuon()) df.daughter1.cat|=4; |
1006 |
– |
df.daughter2.cat=0; |
1007 |
– |
if(muonDau1.isGlobalMuon()) df.daughter2.cat|=1; |
1008 |
– |
if(muonDau1.isTrackerMuon()) df.daughter2.cat|=2; |
1009 |
– |
if(muonDau1.isStandAloneMuon()) df.daughter2.cat|=4; |
1010 |
– |
|
1011 |
– |
TrackRef trkMu1Ref = muonDau0.get<TrackRef>(); |
1012 |
– |
TrackRef trkMu2Ref = muonDau1.get<TrackRef>(); |
1013 |
– |
|
1014 |
– |
if(trkMu1Ref.isNonnull() && trkMu2Ref.isNonnull()){ |
1015 |
– |
const Track* MuTrk1 = muonDau0.get<TrackRef>().get(); |
1016 |
– |
const Track* MuTrk2 = muonDau1.get<TrackRef>().get(); |
1017 |
– |
df.daughter1.zPVPt=MuTrk1->dz(RecVtxFirst.position()); |
1018 |
– |
df.daughter1.zPVProb=MuTrk1->dz(RecVtx.position()); |
1019 |
– |
df.daughter2.zPVPt=MuTrk2->dz(RecVtxFirst.position()); |
1020 |
– |
df.daughter2.zPVProb=MuTrk2->dz(RecVtx.position()); |
1021 |
– |
|
1022 |
– |
df.daughter1.nHits = MuTrk1->numberOfValidHits(); |
1023 |
– |
df.daughter2.nHits = MuTrk2->numberOfValidHits(); |
1024 |
– |
|
1025 |
– |
df.daughter1.chi2 = MuTrk1->normalizedChi2(); |
1026 |
– |
df.daughter2.chi2 = MuTrk2->normalizedChi2(); |
1027 |
– |
|
1028 |
– |
TrackRef iTrack1 = muonDau0.innerTrack(); |
1029 |
– |
const reco::HitPattern& p1 = iTrack1->hitPattern(); |
1030 |
– |
TrackRef iTrack2 = muonDau1.innerTrack(); |
1031 |
– |
const reco::HitPattern& p2 = iTrack2->hitPattern(); |
1032 |
– |
|
1033 |
– |
df.daughter1.nPixelHits = p1.pixelLayersWithMeasurement(); |
1034 |
– |
df.daughter2.nPixelHits = p2.pixelLayersWithMeasurement(); |
1035 |
– |
|
1036 |
– |
if(muonDau0.isGlobalMuon()){ |
1037 |
– |
TrackRef gTrack = muonDau0.globalTrack(); |
1038 |
– |
const reco::HitPattern& q = gTrack->hitPattern(); |
1039 |
– |
df.daughter1.globNHits=q.numberOfValidMuonHits(); |
1040 |
– |
df.daughter1.globChi2=gTrack.get()->normalizedChi2(); |
1041 |
– |
df.daughter1.validMuStations = q. muonStationsWithValidHits(); |
1042 |
– |
} |
1043 |
– |
if(muonDau1.isGlobalMuon()){ |
1044 |
– |
TrackRef gTrack = muonDau1.globalTrack(); |
1045 |
– |
const reco::HitPattern& q = gTrack->hitPattern(); |
1046 |
– |
df.daughter2.globNHits=q.numberOfValidMuonHits(); |
1047 |
– |
df.daughter2.globChi2=gTrack.get()->normalizedChi2(); |
1048 |
– |
df.daughter2.validMuStations = q. muonStationsWithValidHits(); |
1049 |
– |
} |
975 |
|
|
1051 |
– |
} |
1052 |
– |
|
1053 |
– |
hbbInfo->diMuonInfo.push_back(df); |
1054 |
– |
} |
1055 |
– |
|
1056 |
– |
for( size_t i = 0; i < dielectrons->size(); i++ ) { |
1057 |
– |
VHbbEvent::DiElectronInfo df; |
1058 |
– |
const Candidate & dielecCand = (*dielectrons)[ i ]; |
1059 |
– |
|
1060 |
– |
df.p4=GENPTOLOR(dielecCand); |
1061 |
– |
|
1062 |
– |
// accessing the daughters of the dimuon candidate |
1063 |
– |
const Candidate * lep0 = dielecCand.daughter( 0 ); |
1064 |
– |
const Candidate * lep1 = dielecCand.daughter( 1 ); |
1065 |
– |
// needed to access specific methods of pat::Muon |
1066 |
– |
const pat::Electron & elecDau0 = dynamic_cast<const pat::Electron &>(*lep0->masterClone()); |
1067 |
– |
const pat::Electron & elecDau1 = dynamic_cast<const pat::Electron &>(*lep1->masterClone()); |
1068 |
– |
|
1069 |
– |
df.daughter1.p4 = GENPTOLOR(elecDau0); |
1070 |
– |
df.daughter2.p4= GENPTOLOR(elecDau1); |
1071 |
– |
|
1072 |
– |
df.daughter1.tIso = elecDau0.trackIso(); |
1073 |
– |
df.daughter2.tIso = elecDau1.trackIso(); |
1074 |
– |
|
1075 |
– |
df.daughter1.eIso = elecDau0.ecalIso(); |
1076 |
– |
df.daughter2.eIso = elecDau1.ecalIso(); |
1077 |
– |
|
1078 |
– |
df.daughter1.hIso = elecDau0.hcalIso(); |
1079 |
– |
df.daughter2.hIso = elecDau1.hcalIso(); |
1080 |
– |
|
1081 |
– |
// ids |
1082 |
– |
/*df.daughter1.id95 = elecDau0.electronID("simpleEleId95cIso"); |
1083 |
– |
df.daughter1.id85 = elecDau0.electronID ("simpleEleId85cIso"); |
1084 |
– |
df.daughter1.id70 = elecDau0.electronID ("simpleEleId70cIso"); |
1085 |
– |
df.daughter1.id95r = elecDau0.electronID ("simpleEleId95relIso"); |
1086 |
– |
df.daughter1.id85r = elecDau0.electronID ("simpleEleId85relIso"); |
1087 |
– |
df.daughter1.id70r = elecDau0.electronID ("simpleEleId70relIso"); |
1088 |
– |
|
1089 |
– |
|
1090 |
– |
df.daughter2.id95 = elecDau1.electronID("simpleEleId95cIso"); |
1091 |
– |
df.daughter2.id85 = elecDau1.electronID ("simpleEleId85cIso"); |
1092 |
– |
df.daughter2.id70 = elecDau1.electronID ("simpleEleId70cIso"); |
1093 |
– |
df.daughter2.id95r = elecDau1.electronID ("simpleEleId95relIso"); |
1094 |
– |
df.daughter2.id85r = elecDau1.electronID ("simpleEleId85relIso"); |
1095 |
– |
df.daughter2.id70r = elecDau1.electronID ("simpleEleId70relIso"); |
1096 |
– |
*/ |
1097 |
– |
hbbInfo->diElectronInfo.push_back(df); |
1098 |
– |
|
1099 |
– |
} |
976 |
|
if (verbose_){ |
977 |
|
std::cout <<" Pushing hbbInfo "<<std::endl; |
978 |
|
std::cout <<" SimpleJets1 = "<<hbbInfo->simpleJets.size()<<std::endl<< |
1102 |
|
|
1103 |
|
|
1104 |
|
//Btagging scale factors |
1105 |
< |
void HbbAnalyzerNew::fillScaleFactors(VHbbEvent::SimpleJet sj, BTV_SF iSF){ |
1105 |
> |
void HbbAnalyzerNew::fillScaleFactors(VHbbEvent::SimpleJet& sj, BTagSFContainer iSF){ |
1106 |
|
|
1107 |
|
|
1108 |
|
BinningPointByMap measurePoint; |
1174 |
|
|
1175 |
|
} |
1176 |
|
|
1177 |
+ |
void HbbAnalyzerNew::setJecUnc(VHbbEvent::SimpleJet& sj,JetCorrectionUncertainty* jecunc){ |
1178 |
+ |
// |
1179 |
+ |
// test |
1180 |
+ |
// |
1181 |
+ |
|
1182 |
+ |
return; |
1183 |
+ |
double eta = sj.p4.Eta(); |
1184 |
+ |
double pt = sj.p4.Pt(); |
1185 |
+ |
|
1186 |
+ |
jecunc->setJetEta(eta); |
1187 |
+ |
jecunc->setJetPt(pt); // here you must use the CORRECTED jet pt |
1188 |
+ |
double unc = jecunc->getUncertainty(true); |
1189 |
+ |
sj.jecunc= unc; |
1190 |
+ |
} |
1191 |
+ |
|
1192 |
+ |
|
1193 |
+ |
void HbbAnalyzerNew ::fillSimpleJet (VHbbEvent::SimpleJet& sj, edm::View<pat::Jet>::const_iterator jet_iter){ |
1194 |
+ |
sj.flavour = jet_iter->partonFlavour(); |
1195 |
+ |
|
1196 |
+ |
sj.tche=jet_iter->bDiscriminator("trackCountingHighEffBJetTags"); |
1197 |
+ |
sj.tchp=jet_iter->bDiscriminator("trackCountingHighPurBJetTags"); |
1198 |
+ |
sj.jp=jet_iter->bDiscriminator("jetProbabilityBJetTags"); |
1199 |
+ |
sj.jpb=jet_iter->bDiscriminator("jetBProbabilityBJetTags"); |
1200 |
+ |
sj.ssvhe=jet_iter->bDiscriminator("simpleSecondaryVertexHighEffBJetTags"); |
1201 |
+ |
sj.csv=jet_iter->bDiscriminator("combinedSecondaryVertexBJetTags"); |
1202 |
+ |
sj.csvmva=jet_iter->bDiscriminator("combinedSecondaryVertexMVABJetTags"); |
1203 |
+ |
sj.charge=jet_iter->jetCharge(); |
1204 |
+ |
sj.ntracks=jet_iter->associatedTracks().size(); |
1205 |
+ |
sj.p4=GENPTOLORP(jet_iter); |
1206 |
+ |
sj.chargedTracksFourMomentum=(getChargedTracksMomentum(&*(jet_iter))); |
1207 |
+ |
sj.SF_CSVL=1; |
1208 |
+ |
sj.SF_CSVM=1; |
1209 |
+ |
sj.SF_CSVT=1; |
1210 |
+ |
sj.SF_CSVLerr=0; |
1211 |
+ |
sj.SF_CSVMerr=0; |
1212 |
+ |
sj.SF_CSVTerr=0; |
1213 |
+ |
|
1214 |
+ |
|
1215 |
+ |
if (jet_iter->isPFJet() == true) { |
1216 |
+ |
|
1217 |
+ |
sj.chargedHadronEFraction = jet_iter-> chargedHadronEnergyFraction(); |
1218 |
+ |
sj.neutralHadronEFraction = jet_iter-> neutralHadronEnergyFraction (); |
1219 |
+ |
sj.chargedEmEFraction = jet_iter-> chargedEmEnergyFraction (); |
1220 |
+ |
sj.neutralEmEFraction = jet_iter-> neutralEmEnergyFraction (); |
1221 |
+ |
sj.nConstituents = jet_iter->getPFConstituents().size(); |
1222 |
+ |
|
1223 |
+ |
} |
1224 |
+ |
// |
1225 |
+ |
// addtaginfo for csv |
1226 |
+ |
// |
1227 |
+ |
|
1228 |
+ |
// if (jet_iter->hasTagInfo("SimpleSecondaryVertex")) { |
1229 |
+ |
|
1230 |
+ |
const reco::SecondaryVertexTagInfo * tf = jet_iter->tagInfoSecondaryVertex(); |
1231 |
+ |
if (tf){ |
1232 |
+ |
if (tf->nVertices() >0){ |
1233 |
+ |
sj.vtxMass = tf->secondaryVertex(0).p4().mass(); |
1234 |
+ |
sj.vtxNTracks = tf->secondaryVertex(0).nTracks(); |
1235 |
+ |
std::vector<reco::TrackBaseRef >::const_iterator tit = tf->secondaryVertex(0).tracks_begin(); |
1236 |
+ |
for (; tit< tf->secondaryVertex(0).tracks_end(); ++tit){ |
1237 |
+ |
sj.vtxTrackIds.push_back(tit->key()); |
1238 |
+ |
} |
1239 |
+ |
Measurement1D m = tf->flightDistance(0); |
1240 |
+ |
sj.vtx3dL = m.value(); |
1241 |
+ |
sj.vtx3deL = m.error(); |
1242 |
+ |
} |
1243 |
+ |
} |
1244 |
+ |
// |
1245 |
+ |
// add tVector |
1246 |
+ |
// |
1247 |
+ |
sj.tVector = getTvect(&(*jet_iter)); |
1248 |
+ |
} |
1249 |
+ |
|
1250 |
+ |
|
1251 |
|
//define this as a plug-in |
1252 |
|
DEFINE_FWK_MODULE(HbbAnalyzerNew); |