17 |
|
// |
18 |
|
// |
19 |
|
|
20 |
< |
#include "VHbbAnalysis/HbbAnalyzer/interface/HbbAnalyzerNew.h" |
21 |
< |
#include "VHbbAnalysis/HbbAnalyzer/interface/VHbbEvent.h" |
22 |
< |
|
23 |
< |
#include "DataFormats/GeometryVector/interface/VectorUtil.h" |
20 |
> |
#include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h" |
21 |
> |
#include "CondFormats/JetMETObjects/interface/JetCorrectionUncertainty.h" |
22 |
> |
#include "JetMETCorrections/Objects/interface/JetCorrector.h" |
23 |
> |
#include "JetMETCorrections/Objects/interface/JetCorrectionsRecord.h" |
24 |
> |
#include "DataFormats/TrackReco/interface/TrackFwd.h" |
25 |
|
|
26 |
+ |
#include "VHbbAnalysis/HbbAnalyzer/interface/HbbAnalyzerNew.h" |
27 |
+ |
#include "SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h" |
28 |
|
|
29 |
|
#define GENPTOLOR(a) TLorentzVector((a).px(), (a).py(), (a).pz(), (a).energy()) |
30 |
|
#define GENPTOLORP(a) TLorentzVector((a)->px(), (a)->py(), (a)->pz(), (a)->energy()) |
31 |
|
|
32 |
+ |
|
33 |
+ |
struct CompareJetPtMuons { |
34 |
+ |
bool operator()( const VHbbEvent::MuonInfo& j1, const VHbbEvent::MuonInfo& j2 ) const { |
35 |
+ |
return j1.p4.Pt() > j2.p4.Pt(); |
36 |
+ |
} |
37 |
+ |
}; |
38 |
+ |
struct CompareJetPtElectrons { |
39 |
+ |
bool operator()( const VHbbEvent::ElectronInfo& j1, const VHbbEvent::ElectronInfo& j2 ) const { |
40 |
+ |
return j1.p4.Pt() > j2.p4.Pt(); |
41 |
+ |
} |
42 |
+ |
}; |
43 |
+ |
struct CompareJetPtTaus { |
44 |
+ |
bool operator()( const VHbbEvent::TauInfo& j1, const VHbbEvent::TauInfo& j2 ) const { |
45 |
+ |
return j1.p4.Pt() > j2.p4.Pt(); |
46 |
+ |
} |
47 |
+ |
}; |
48 |
+ |
|
49 |
+ |
|
50 |
+ |
|
51 |
|
HbbAnalyzerNew::HbbAnalyzerNew(const edm::ParameterSet& iConfig): |
52 |
|
eleLabel_(iConfig.getParameter<edm::InputTag>("electronTag")), |
53 |
|
muoLabel_(iConfig.getParameter<edm::InputTag>("muonTag")), |
63 |
|
dimuLabel_(iConfig.getParameter<edm::InputTag>("dimuTag")), |
64 |
|
dielecLabel_(iConfig.getParameter<edm::InputTag>("dielecTag")), |
65 |
|
hltResults_(iConfig.getParameter<edm::InputTag>("hltResultsTag")), |
66 |
< |
runOnMC_(iConfig.getParameter<bool>("runOnMC")) { |
66 |
> |
runOnMC_(iConfig.getParameter<bool>("runOnMC")), verbose_(iConfig.getUntrackedParameter<bool>("verbose")) { |
67 |
|
|
68 |
|
// |
69 |
|
// put the setwhatproduced etc etc |
70 |
|
|
71 |
|
produces<VHbbEvent>(); |
72 |
+ |
produces<VHbbEventAuxInfo>(); |
73 |
|
|
74 |
|
|
75 |
|
} |
93 |
|
using namespace edm; |
94 |
|
using namespace reco; |
95 |
|
|
96 |
+ |
// JEC Uncertainty |
97 |
+ |
|
98 |
+ |
// JetCorrectionUncertainty *jecUnc=0; |
99 |
+ |
edm::ESHandle<JetCorrectorParametersCollection> JetCorParColl; |
100 |
+ |
iSetup.get<JetCorrectionsRecord>().get("AK5PF",JetCorParColl); |
101 |
+ |
JetCorrectionUncertainty *jecUnc=0; |
102 |
+ |
// if (!runOnMC_){ |
103 |
+ |
JetCorrectorParameters const & JetCorPar = (*JetCorParColl)["Uncertainty"]; |
104 |
+ |
jecUnc = new JetCorrectionUncertainty(JetCorPar); |
105 |
+ |
// } |
106 |
|
|
107 |
< |
std::auto_ptr<VHbbEvent> hbbInfo( new VHbbEvent() ); |
107 |
> |
std::auto_ptr<VHbbEvent> hbbInfo( new VHbbEvent() ); |
108 |
> |
std::auto_ptr<VHbbEventAuxInfo> auxInfo( new VHbbEventAuxInfo() ); |
109 |
|
|
110 |
|
// |
111 |
|
// ?? |
112 |
|
|
113 |
|
// trigger |
114 |
+ |
|
115 |
+ |
// trigger |
116 |
|
edm::Handle<edm::TriggerResults> hltresults; |
117 |
|
//iEvent.getByLabel("TriggerResults", hltresults); |
118 |
|
|
121 |
|
iEvent.getByLabel(hltResults_, hltresults); |
122 |
|
|
123 |
|
const edm::TriggerNames & triggerNames_ = iEvent.triggerNames(*hltresults); |
88 |
– |
|
89 |
– |
int ntrigs = hltresults->size(); |
90 |
– |
if (ntrigs==0){std::cout << "%HLTInfo -- No trigger name given in TriggerResults of the input " << std::endl;} |
91 |
– |
|
92 |
– |
for (int itrig = 0; itrig != ntrigs; ++itrig){ |
93 |
– |
|
94 |
– |
TString trigName=triggerNames_.triggerName(itrig); |
95 |
– |
bool accept = hltresults->accept(itrig); |
96 |
– |
|
97 |
– |
if (accept){(hbbInfo->triggerInfo.flag)[itrig] = 1;} |
98 |
– |
else { (hbbInfo->triggerInfo.flag)[itrig] = 0;} |
99 |
– |
|
100 |
– |
// std::cout << "%HLTInfo -- Number of HLT Triggers: " << ntrigs << std::endl; |
101 |
– |
// std::cout << "%HLTInfo -- HLTTrigger(" << itrig << "): " << trigName << " = " << accept << std::endl; |
102 |
– |
} |
103 |
– |
|
104 |
– |
// |
105 |
– |
// big bloat |
106 |
– |
// |
107 |
– |
|
108 |
– |
|
109 |
– |
int goodDoubleMu3=0,goodDoubleMu3_2=0, |
110 |
– |
goodMu9=0, goodIsoMu9=0, goodMu11=0, goodIsoMu13_3=0, goodMu15=0, goodMu15_1=0; |
111 |
– |
int goodDoubleElec10=0,goodDoubleElec15_1=0,goodDoubleElec17_1=0; |
112 |
– |
int goodMet100=0; |
113 |
– |
int goodSingleEle1=0,goodSingleEle2=0,goodSingleEle3=0,goodSingleEle4=0; |
114 |
– |
int goodBtagMu1=0,goodBtagMu2=0,goodBtagMu0=0,goodBtagMu11=0; |
115 |
– |
int goodBtagMuJet1=0, goodBtagMuJet2=0, goodBtagMuJet3=0, goodBtagMuJet4=0; |
116 |
– |
int goodIsoMu15=0,goodIsoMu17v5=0,goodIsoMu17v6=0; |
117 |
– |
|
118 |
– |
for (int itrig = 0; itrig != ntrigs; ++itrig){ |
119 |
– |
TString trigName=triggerNames_.triggerName(itrig); |
120 |
– |
if(strcmp(trigName,"HLT_Mu9")==0) goodMu9++; |
121 |
– |
if(strcmp(trigName,"HLT_IsoMu9")==0) goodIsoMu9++; |
122 |
– |
if(strcmp(trigName,"HLT_IsoMu13_v3")==0) goodIsoMu13_3++; |
123 |
– |
if(strcmp(trigName,"HLT_Mu11")==0) goodMu11++; |
124 |
– |
if(strcmp(trigName,"HLT_DoubleMu3")==0) goodDoubleMu3++; |
125 |
– |
if(strcmp(trigName,"HLT_DoubleMu3_v2")==0) goodDoubleMu3_2++; |
126 |
– |
if(strcmp(trigName,"HLT_Mu15")==0) goodMu15++; |
127 |
– |
if(strcmp(trigName,"HLT_Mu15_v1")==0) goodMu15_1++; |
128 |
– |
|
129 |
– |
if(strcmp(trigName,"HLT_DoubleEle10_SW_L1R")==0) goodDoubleElec10++; |
130 |
– |
if(strcmp(trigName,"HLT_DoubleEle15_SW_L1R_v1")==0) goodDoubleElec15_1++; |
131 |
– |
if(strcmp(trigName,"HLT_DoubleEle17_SW_L1R_v1")==0) goodDoubleElec17_1++; |
132 |
– |
if(strcmp(trigName,"HLT_MET100_v1")==0) goodMet100++; |
133 |
– |
if(strcmp(trigName,"HLT_Ele15_SW_L1R")==0) goodSingleEle1++; |
134 |
– |
if(strcmp(trigName,"HLT_Ele17_SW_TightEleId_L1R")==0) goodSingleEle2++; |
135 |
– |
if(strcmp(trigName,"HLT_Ele17_SW_TighterEleIdIsol_L1R_v2")==0) goodSingleEle3++; |
136 |
– |
if(strcmp(trigName,"HLT_Ele17_SW_TighterEleIdIsol_L1R_v3")==0) goodSingleEle4++; |
137 |
– |
if(strcmp(trigName,"HLT_BTagMu_DiJet20U_v1")==0) goodBtagMu1++; |
138 |
– |
if(strcmp(trigName,"HLT_BTagMu_DiJet30U_Mu5_v3")==0) goodBtagMu2++; |
139 |
– |
if(strcmp(trigName,"HLT_BTagMu_Jet20U")==0) goodBtagMu0++; |
140 |
– |
if(strcmp(trigName,"HLT_BTagMu_DiJet20U_Mu5_v1")==0) goodBtagMu11++; |
141 |
– |
if(strcmp(trigName,"HLT_Mu17_CentralJet30_BTagIP_v2")==0) goodBtagMuJet1++; |
142 |
– |
if(strcmp(trigName,"HLT_Mu17_CentralJet30_v2")==0) goodBtagMuJet2++; |
143 |
– |
if(strcmp(trigName,"HLT_HT200_Mu5_PFMHT35_v2")==0) goodBtagMuJet3++; |
144 |
– |
if(strcmp(trigName,"HLT_Mu12_CentralJet30_BTagIP_v2")==0) goodBtagMuJet4++; |
145 |
– |
|
146 |
– |
if(strcmp(trigName,"HLT_IsoMu15_v5")==0) goodIsoMu15++; |
147 |
– |
if(strcmp(trigName,"HLT_IsoMu17_v5")==0) goodIsoMu17v5++; |
148 |
– |
if(strcmp(trigName,"HLT_IsoMu17_v6")==0) goodIsoMu17v6++; |
149 |
– |
} |
150 |
– |
int itrig1=-99; |
151 |
– |
if(goodMu9!=0) itrig1 = triggerNames_.triggerIndex("HLT_Mu9"); |
152 |
– |
int itrig2=-99; |
153 |
– |
if(goodIsoMu9!=0) itrig2 = triggerNames_.triggerIndex("HLT_IsoMu9"); |
154 |
– |
int itrig3=-99; |
155 |
– |
if(goodIsoMu13_3!=0) itrig3 = triggerNames_.triggerIndex("HLT_IsoMu13_v3"); |
156 |
– |
int itrig4=-99; |
157 |
– |
if(goodMu11!=0) itrig4 = triggerNames_.triggerIndex("HLT_Mu11"); |
158 |
– |
int itrig5=-99; |
159 |
– |
if(goodDoubleMu3!=0) itrig5 = triggerNames_.triggerIndex("HLT_DoubleMu3"); |
160 |
– |
int itrig6=-99; |
161 |
– |
if(goodDoubleMu3_2!=0) itrig6 = triggerNames_.triggerIndex("HLT_DoubleMu3_v2"); |
162 |
– |
int itrig7=-99; |
163 |
– |
if(goodMu15!=0) itrig7 = triggerNames_.triggerIndex("HLT_Mu15"); |
164 |
– |
int itrig8=-99; |
165 |
– |
if(goodMu15_1!=0) itrig8 = triggerNames_.triggerIndex("HLT_Mu15_v1"); |
166 |
– |
|
167 |
– |
int itrig9=-99; |
168 |
– |
if(goodDoubleElec10!=0) itrig9 = triggerNames_.triggerIndex("HLT_DoubleEle10_SW_L1R"); |
169 |
– |
int itrig10=-99; |
170 |
– |
if(goodDoubleElec15_1!=0) itrig10 = triggerNames_.triggerIndex("HLT_DoubleEle15_SW_L1R_v1"); |
171 |
– |
int itrig11=-99; |
172 |
– |
if(goodDoubleElec17_1!=0) itrig11 = triggerNames_.triggerIndex("HLT_DoubleEle17_SW_L1R_v1"); |
173 |
– |
int itrig12=-99; |
174 |
– |
if(goodMet100!=0) itrig12 = triggerNames_.triggerIndex("HLT_MET100_v1"); |
175 |
– |
|
176 |
– |
int itrig13=-99; |
177 |
– |
if(goodSingleEle1!=0) itrig13 = triggerNames_.triggerIndex("HLT_Ele15_SW_L1R"); |
178 |
– |
int itrig14=-99; |
179 |
– |
if(goodSingleEle2!=0) itrig14 = triggerNames_.triggerIndex("HLT_Ele17_SW_TightEleId_L1R"); |
180 |
– |
int itrig15=-99; |
181 |
– |
if(goodSingleEle3!=0) itrig15 = triggerNames_.triggerIndex("HLT_Ele17_SW_TighterEleIdIsol_L1R_v2"); |
182 |
– |
int itrig16=-99; |
183 |
– |
if(goodSingleEle4!=0) itrig16 = triggerNames_.triggerIndex("HLT_Ele17_SW_TighterEleIdIsol_L1R_v3"); |
184 |
– |
|
185 |
– |
int itrig17=-99; |
186 |
– |
if(goodBtagMu1!=0) itrig17 = triggerNames_.triggerIndex("HLT_BTagMu_DiJet20U_v1"); |
187 |
– |
int itrig18=-99; |
188 |
– |
if(goodBtagMu2!=0) itrig18 = triggerNames_.triggerIndex("HLT_BTagMu_DiJet30U_Mu5_v3"); |
189 |
– |
int itrig19=-99; |
190 |
– |
if(goodBtagMu0!=0) itrig19 = triggerNames_.triggerIndex("HLT_BTagMu_Jet20U"); |
191 |
– |
int itrig20=-99; |
192 |
– |
if(goodBtagMu11!=0) itrig20 = triggerNames_.triggerIndex("HLT_BTagMu_DiJet20U_Mu5_v1"); |
193 |
– |
int itrig21=-99; |
194 |
– |
if(goodBtagMuJet1!=0) itrig21 = triggerNames_.triggerIndex("HLT_Mu17_CentralJet30_BTagIP_v2"); |
195 |
– |
int itrig22=-99; |
196 |
– |
if(goodBtagMuJet2!=0) itrig22 = triggerNames_.triggerIndex("HLT_Mu17_CentralJet30_v2"); |
197 |
– |
int itrig23=-99; |
198 |
– |
if(goodBtagMuJet3!=0) itrig23 = triggerNames_.triggerIndex("HLT_HT200_Mu5_PFMHT35_v2"); |
199 |
– |
int itrig231=-99; |
200 |
– |
if(goodBtagMuJet4!=0) itrig231 = triggerNames_.triggerIndex("HLT_Mu12_CentralJet30_BTagIP_v2"); |
201 |
– |
|
202 |
– |
int itrig24=-99; |
203 |
– |
if(goodIsoMu15!=0) itrig24 = triggerNames_.triggerIndex("HLT_IsoMu15_v5"); |
204 |
– |
int itrig25=-99; |
205 |
– |
if(goodIsoMu17v5!=0) itrig25 = triggerNames_.triggerIndex("HLT_IsoMu17_v5"); |
206 |
– |
int itrig26=-99; |
207 |
– |
if(goodIsoMu17v6!=0) itrig26 = triggerNames_.triggerIndex("HLT_IsoMu17_v6"); |
208 |
– |
|
209 |
– |
if (itrig1!=-99 && hltresults->accept(itrig1)) hbbInfo->triggerInfo.triggerMu9=1; else hbbInfo->triggerInfo.triggerMu9=0; |
210 |
– |
if (itrig2!=-99 && hltresults->accept(itrig2)) hbbInfo->triggerInfo.triggerIsoMu9=1; else hbbInfo->triggerInfo.triggerIsoMu9=0; |
211 |
– |
if (itrig3!=-99 && hltresults->accept(itrig3)) hbbInfo->triggerInfo.triggerIsoMu13_3=1; else hbbInfo->triggerInfo.triggerIsoMu13_3=0; |
212 |
– |
if (itrig4!=-99 && hltresults->accept(itrig4)) hbbInfo->triggerInfo.triggerMu11=1; else hbbInfo->triggerInfo.triggerMu11=0; |
213 |
– |
if (itrig5!=-99 && hltresults->accept(itrig5)) hbbInfo->triggerInfo.triggerDoubleMu3=1; else hbbInfo->triggerInfo.triggerDoubleMu3=0; |
214 |
– |
if (itrig6!=-99 && hltresults->accept(itrig6)) hbbInfo->triggerInfo.triggerDoubleMu3_2=1; else hbbInfo->triggerInfo.triggerDoubleMu3_2=0; |
215 |
– |
if (itrig7!=-99 && hltresults->accept(itrig7)) hbbInfo->triggerInfo.triggerMu15=1; else hbbInfo->triggerInfo.triggerMu15=0; |
216 |
– |
if (itrig8!=-99 && hltresults->accept(itrig8)) hbbInfo->triggerInfo.triggerMu15_1=1; else hbbInfo->triggerInfo.triggerMu15_1=0; |
217 |
– |
|
218 |
– |
if (itrig9!=-99 && hltresults->accept(itrig9)) hbbInfo->triggerInfo.triggerDoubleElec10=1; else hbbInfo->triggerInfo.triggerDoubleElec10=0; |
219 |
– |
if (itrig10!=-99 && hltresults->accept(itrig10)) hbbInfo->triggerInfo.triggerDoubleElec15_1=1; else hbbInfo->triggerInfo.triggerDoubleElec15_1=0; |
220 |
– |
if (itrig11!=-99 && hltresults->accept(itrig11)) hbbInfo->triggerInfo.triggerDoubleElec17_1=1; else hbbInfo->triggerInfo.triggerDoubleElec17_1=0; |
221 |
– |
if (itrig12!=-99 && hltresults->accept(itrig12)) hbbInfo->triggerInfo.triggerMet100_1=1; else hbbInfo->triggerInfo.triggerMet100_1=0; |
222 |
– |
|
223 |
– |
if (itrig13!=-99 && hltresults->accept(itrig13)) hbbInfo->triggerInfo.triggerSingleEle1=1; else hbbInfo->triggerInfo.triggerSingleEle1=0; |
224 |
– |
if (itrig14!=-99 && hltresults->accept(itrig14)) hbbInfo->triggerInfo.triggerSingleEle2=1; else hbbInfo->triggerInfo.triggerSingleEle2=0; |
225 |
– |
if (itrig15!=-99 && hltresults->accept(itrig15)) hbbInfo->triggerInfo.triggerSingleEle3=1; else hbbInfo->triggerInfo.triggerSingleEle3=0; |
226 |
– |
if (itrig16!=-99 && hltresults->accept(itrig16)) hbbInfo->triggerInfo.triggerSingleEle4=1; else hbbInfo->triggerInfo.triggerSingleEle4=0; |
227 |
– |
|
228 |
– |
if (itrig17!=-99 && hltresults->accept(itrig17)) hbbInfo->triggerInfo.triggerBtagMu1=1; else hbbInfo->triggerInfo.triggerBtagMu1=0; |
229 |
– |
if (itrig18!=-99 && hltresults->accept(itrig18)) hbbInfo->triggerInfo.triggerBtagMu2=1; else hbbInfo->triggerInfo.triggerBtagMu2=0; |
230 |
– |
if (itrig19!=-99 && hltresults->accept(itrig19)) hbbInfo->triggerInfo.triggerBtagMu0=1; else hbbInfo->triggerInfo.triggerBtagMu0=0; |
231 |
– |
if (itrig20!=-99 && hltresults->accept(itrig20)) hbbInfo->triggerInfo.triggerBtagMu11=1; else hbbInfo->triggerInfo.triggerBtagMu11=0; |
232 |
– |
if (itrig21!=-99 && hltresults->accept(itrig21)) hbbInfo->triggerInfo.triggerBtagMuJet1=1; else hbbInfo->triggerInfo.triggerBtagMuJet1=0; |
233 |
– |
if (itrig22!=-99 && hltresults->accept(itrig22)) hbbInfo->triggerInfo.triggerBtagMuJet2=1; else hbbInfo->triggerInfo.triggerBtagMuJet2=0; |
234 |
– |
if (itrig23!=-99 && hltresults->accept(itrig23)) hbbInfo->triggerInfo.triggerBtagMuJet3=1; else hbbInfo->triggerInfo.triggerBtagMuJet3=0; |
235 |
– |
if (itrig231!=-99 && hltresults->accept(itrig231)) hbbInfo->triggerInfo.triggerBtagMuJet4=1; else hbbInfo->triggerInfo.triggerBtagMuJet4=0; |
236 |
– |
|
237 |
– |
if (itrig24!=-99 && hltresults->accept(itrig24)) hbbInfo->triggerInfo.triggerIsoMu15=1; else hbbInfo->triggerInfo.triggerIsoMu15=0; |
238 |
– |
if (itrig25!=-99 && hltresults->accept(itrig25)) hbbInfo->triggerInfo.triggerIsoMu17v5=1; else hbbInfo->triggerInfo.triggerIsoMu17v5=0; |
239 |
– |
if (itrig26!=-99 && hltresults->accept(itrig26)) hbbInfo->triggerInfo.triggerIsoMu17v6=1; else hbbInfo->triggerInfo.triggerIsoMu17v6=0; |
240 |
– |
|
241 |
– |
if (itrig1==-99) hbbInfo->triggerInfo.triggerMu9=-99; |
242 |
– |
if (itrig2==-99) hbbInfo->triggerInfo.triggerIsoMu9=-99; |
243 |
– |
if (itrig3==-99) hbbInfo->triggerInfo.triggerIsoMu13_3=-99; |
244 |
– |
if (itrig4==-99) hbbInfo->triggerInfo.triggerMu11=-99; |
245 |
– |
if (itrig5==-99) hbbInfo->triggerInfo.triggerDoubleMu3=-99; |
246 |
– |
if (itrig6==-99) hbbInfo->triggerInfo.triggerDoubleMu3_2=-99; |
247 |
– |
if (itrig7==-99) hbbInfo->triggerInfo.triggerMu15=-99; |
248 |
– |
if (itrig8==-99) hbbInfo->triggerInfo.triggerMu15_1=-99; |
249 |
– |
|
250 |
– |
if (itrig9==-99) hbbInfo->triggerInfo.triggerDoubleElec10=-99; |
251 |
– |
if (itrig10==-99) hbbInfo->triggerInfo.triggerDoubleElec15_1=-99; |
252 |
– |
if (itrig11==-99) hbbInfo->triggerInfo.triggerDoubleElec17_1=-99; |
253 |
– |
if (itrig12==-99) hbbInfo->triggerInfo.triggerMet100_1=-99; |
254 |
– |
|
255 |
– |
if (itrig13==-99) hbbInfo->triggerInfo.triggerSingleEle1=-99; |
256 |
– |
if (itrig14==-99) hbbInfo->triggerInfo.triggerSingleEle2=-99; |
257 |
– |
if (itrig15==-99) hbbInfo->triggerInfo.triggerSingleEle3=-99; |
258 |
– |
if (itrig16==-99) hbbInfo->triggerInfo.triggerSingleEle4=-99; |
259 |
– |
|
260 |
– |
if(itrig17==-99) hbbInfo->triggerInfo.triggerBtagMu1=-99; |
261 |
– |
if(itrig18==-99) hbbInfo->triggerInfo.triggerBtagMu2=-99; |
262 |
– |
if(itrig19==-99) hbbInfo->triggerInfo.triggerBtagMu0=-99; |
263 |
– |
if(itrig20==-99) hbbInfo->triggerInfo.triggerBtagMu11=-99; |
264 |
– |
if(itrig21==-99) hbbInfo->triggerInfo.triggerBtagMuJet1=-99; |
265 |
– |
if(itrig22==-99) hbbInfo->triggerInfo.triggerBtagMuJet2=-99; |
266 |
– |
if(itrig23==-99) hbbInfo->triggerInfo.triggerBtagMuJet3=-99; |
267 |
– |
if(itrig231==-99) hbbInfo->triggerInfo.triggerBtagMuJet4=-99; |
268 |
– |
|
269 |
– |
if(itrig24==-99) hbbInfo->triggerInfo.triggerIsoMu15=-99; |
270 |
– |
if(itrig25==-99) hbbInfo->triggerInfo.triggerIsoMu17v5=-99; |
271 |
– |
if(itrig26==-99) hbbInfo->triggerInfo.triggerIsoMu17v6=-99; |
272 |
– |
|
273 |
– |
// MinDRMu=-99.,MCBestMuId=-99,MCBestMuMomId=-99,MCBestMuGMomId=-99; |
274 |
– |
// for(int i=0;i<50;i++) {DeltaRMu[i]=-99;} |
275 |
– |
|
124 |
|
|
125 |
+ |
int ntrigs = hltresults->size(); |
126 |
+ |
if (ntrigs==0){std::cerr << "%HLTInfo -- No trigger name given in TriggerResults of the input " << std::endl;} |
127 |
|
|
128 |
|
BeamSpot vertexBeamSpot; |
129 |
|
edm::Handle<reco::BeamSpot> recoBeamSpotHandle; |
141 |
|
Handle<reco::VertexCollection> recVtxs; |
142 |
|
iEvent.getByLabel("offlinePrimaryVertices", recVtxs); |
143 |
|
|
144 |
+ |
auxInfo->pvInfo.nVertices = recVtxs->size(); |
145 |
+ |
|
146 |
|
for(size_t i = 0; i < recVtxs->size(); ++ i) { |
147 |
|
const Vertex &vtx = (*recVtxs)[i]; |
148 |
|
double RecVtxProb=TMath::Prob(vtx.chi2(),vtx.ndof()); |
155 |
|
const Vertex &RecVtx = (*recVtxs)[VtxIn]; |
156 |
|
const Vertex &RecVtxFirst = (*recVtxs)[0]; |
157 |
|
|
158 |
< |
hbbInfo->pvInfo.firstPVInPT2 = TVector3(RecVtxFirst.x(), RecVtxFirst.y(), RecVtxFirst.z()); |
159 |
< |
hbbInfo->pvInfo.firstPVInProb = TVector3(RecVtx.x(), RecVtx.y(), RecVtx.z()); |
158 |
> |
auxInfo->pvInfo.firstPVInPT2 = TVector3(RecVtxFirst.x(), RecVtxFirst.y(), RecVtxFirst.z()); |
159 |
> |
auxInfo->pvInfo.firstPVInProb = TVector3(RecVtx.x(), RecVtx.y(), RecVtx.z()); |
160 |
|
|
161 |
|
|
162 |
|
edm::Handle<double> rhoHandle; |
163 |
< |
iEvent.getByLabel(edm::InputTag("kt6PFJets", "rho"),rhoHandle); // configure srcRho = cms.InputTag('kt6PFJets") |
164 |
< |
hbbInfo->puInfo.rho = *rhoHandle; |
163 |
> |
iEvent.getByLabel(edm::InputTag("kt6PFJets", "rho"),rhoHandle); |
164 |
> |
auxInfo->puInfo.rho = *rhoHandle; |
165 |
|
|
166 |
+ |
edm::Handle<std::vector< PileupSummaryInfo> > puHandle; |
167 |
+ |
|
168 |
+ |
if (runOnMC_){ |
169 |
+ |
iEvent.getByType(puHandle); |
170 |
+ |
if (puHandle.isValid()){ |
171 |
+ |
|
172 |
+ |
std::vector< PileupSummaryInfo> pu = (*puHandle); |
173 |
+ |
for (std::vector<PileupSummaryInfo>::const_iterator it= pu.begin(); it!=pu.end(); ++it){ |
174 |
+ |
int bx = (*it).getBunchCrossing(); |
175 |
+ |
unsigned int num = (*it).getPU_NumInteractions(); |
176 |
+ |
// std::cout <<" PU PUSHING "<<bx<<" " <<num<<std::endl; |
177 |
+ |
auxInfo->puInfo.pus[bx] =num; |
178 |
+ |
} |
179 |
+ |
} |
180 |
+ |
} |
181 |
+ |
|
182 |
|
//// real start |
183 |
|
|
184 |
|
|
189 |
|
|
190 |
|
if(runOnMC_){ |
191 |
|
|
192 |
< |
int Hin=-99,Win=-99,Zin=-99,bin=-99,bbarin=-99; |
325 |
< |
|
326 |
< |
iEvent.getByLabel("genParticles", genParticles); |
192 |
> |
iEvent.getByLabel("genParticles", genParticles); |
193 |
|
|
194 |
|
for(size_t i = 0; i < genParticles->size(); ++ i) { |
195 |
+ |
|
196 |
|
const GenParticle & p = (*genParticles)[i]; |
197 |
|
int id = p.pdgId(); |
198 |
|
int st = p.status(); |
199 |
< |
|
199 |
> |
|
200 |
|
if(id==25){ |
201 |
< |
|
202 |
< |
/* int wh=0; |
203 |
< |
int nMoth = p.numberOfMothers(); |
204 |
< |
for(size_t jj = 0; jj < nMoth; ++ jj) { |
205 |
< |
const Candidate * mom = p.mother( jj ); |
206 |
< |
int nmomdau= mom->numberOfDaughters(); |
207 |
< |
for(size_t j = 0; j < nmomdau; ++ j) { |
208 |
< |
const Candidate * Wmomdau = mom->daughter( j ); |
342 |
< |
if(abs(Wmomdau->pdgId())==24) wh++; |
343 |
< |
} |
344 |
< |
} |
345 |
< |
|
346 |
< |
if(wh==0) continue; |
347 |
< |
*/ |
348 |
< |
Hin=i; |
349 |
< |
hbbInfo->mcH.status=st; |
350 |
< |
hbbInfo->mcH.charge=p.charge(); |
351 |
< |
if(p.mother(0)!=0) hbbInfo->mcH.momid=p.mother(0)->pdgId(); |
352 |
< |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) hbbInfo->mcH.gmomid=p.mother(0)->mother(0)->pdgId(); |
353 |
< |
hbbInfo->mcH.fourMomentum = GENPTOLOR(p); |
354 |
< |
|
201 |
> |
|
202 |
> |
VHbbEventAuxInfo::ParticleMCInfo htemp; |
203 |
> |
htemp.status=st; |
204 |
> |
htemp.charge=p.charge(); |
205 |
> |
if(p.mother(0)!=0) htemp.momid=p.mother(0)->pdgId(); |
206 |
> |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) htemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
207 |
> |
htemp.p4 = GENPTOLOR(p); |
208 |
> |
|
209 |
|
int ndau = p.numberOfDaughters(); |
210 |
|
for(int j = 0; j < ndau; ++ j) { |
211 |
|
const Candidate * Hdau = p.daughter( j ); |
212 |
< |
hbbInfo->mcH.dauid.push_back(Hdau->pdgId()); |
213 |
< |
hbbInfo->mcH.dauFourMomentum.push_back(GENPTOLORP(Hdau)); |
212 |
> |
htemp.dauid.push_back(Hdau->pdgId()); |
213 |
> |
htemp.dauFourMomentum.push_back(GENPTOLORP(Hdau)); |
214 |
|
} |
215 |
+ |
(auxInfo->mcH).push_back(htemp); |
216 |
|
} |
217 |
+ |
|
218 |
+ |
|
219 |
+ |
if(abs(id)==24){ |
220 |
|
|
221 |
+ |
VHbbEventAuxInfo::ParticleMCInfo wtemp; |
222 |
+ |
wtemp.status=st; |
223 |
+ |
wtemp.charge=p.charge(); |
224 |
+ |
if(p.mother(0)!=0) wtemp.momid=p.mother(0)->pdgId(); |
225 |
+ |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) wtemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
226 |
+ |
wtemp.p4=GENPTOLOR(p); |
227 |
|
|
364 |
– |
if(abs(id)==24){ |
365 |
– |
|
366 |
– |
Win=i; |
367 |
– |
hbbInfo->mcW.status=st; |
368 |
– |
hbbInfo->mcW.charge=p.charge(); |
369 |
– |
if(p.mother(0)!=0) hbbInfo->mcW.momid=p.mother(0)->pdgId(); |
370 |
– |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) hbbInfo->mcW.gmomid=p.mother(0)->mother(0)->pdgId(); |
371 |
– |
hbbInfo->mcW.fourMomentum=GENPTOLOR(p); |
372 |
– |
|
228 |
|
int ndau = p.numberOfDaughters(); |
229 |
|
for(int j = 0; j < ndau; ++ j) { |
230 |
|
const Candidate * Wdau = p.daughter( j ); |
231 |
< |
hbbInfo->mcW.dauid.push_back(Wdau->pdgId()); |
232 |
< |
hbbInfo->mcW.dauFourMomentum.push_back(GENPTOLORP(Wdau)); |
231 |
> |
wtemp.dauid.push_back(Wdau->pdgId()); |
232 |
> |
wtemp.dauFourMomentum.push_back(GENPTOLORP(Wdau)); |
233 |
|
} |
234 |
+ |
auxInfo->mcW.push_back(wtemp); |
235 |
|
} |
236 |
|
|
237 |
|
if(abs(id)==23){ |
238 |
|
|
239 |
< |
Zin=i; |
240 |
< |
hbbInfo->mcZ.status=st; |
241 |
< |
hbbInfo->mcZ.charge=p.charge(); |
242 |
< |
if(p.mother(0)!=0) hbbInfo->mcZ.momid=p.mother(0)->pdgId(); |
243 |
< |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) hbbInfo->mcZ.gmomid=p.mother(0)->mother(0)->pdgId(); |
244 |
< |
hbbInfo->mcZ.fourMomentum=GENPTOLOR(p); |
239 |
> |
|
240 |
> |
VHbbEventAuxInfo::ParticleMCInfo ztemp; |
241 |
> |
ztemp.status=st; |
242 |
> |
ztemp.charge=p.charge(); |
243 |
> |
if(p.mother(0)!=0) ztemp.momid=p.mother(0)->pdgId(); |
244 |
> |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) ztemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
245 |
> |
ztemp.p4=GENPTOLOR(p); |
246 |
|
|
247 |
|
int ndau = p.numberOfDaughters(); |
248 |
|
for(int j = 0; j < ndau; ++ j) { |
249 |
|
const Candidate * Zdau = p.daughter( j ); |
250 |
< |
hbbInfo->mcZ.dauid.push_back(Zdau->pdgId()); |
251 |
< |
hbbInfo->mcZ.dauFourMomentum.push_back(GENPTOLOR(p)); |
250 |
> |
ztemp.dauid.push_back(Zdau->pdgId()); |
251 |
> |
ztemp.dauFourMomentum.push_back(GENPTOLOR(p)); |
252 |
|
} |
253 |
+ |
auxInfo->mcZ.push_back(ztemp); |
254 |
|
} |
255 |
|
// |
256 |
|
// binfo |
257 |
|
// |
258 |
< |
|
258 |
> |
|
259 |
|
|
260 |
|
if(id==5){ |
261 |
< |
bin=i; |
262 |
< |
hbbInfo->mcB.status=st; |
263 |
< |
hbbInfo->mcB.charge=p.charge(); |
264 |
< |
if(p.mother(0)!=0) hbbInfo->mcB.momid=p.mother(0)->pdgId(); |
265 |
< |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) hbbInfo->mcB.gmomid=p.mother(0)->mother(0)->pdgId(); |
261 |
> |
|
262 |
> |
VHbbEventAuxInfo::ParticleMCInfo btemp; |
263 |
> |
btemp.status=st; |
264 |
> |
btemp.charge=p.charge(); |
265 |
> |
if(p.mother(0)!=0) btemp.momid=p.mother(0)->pdgId(); |
266 |
> |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) btemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
267 |
> |
|
268 |
> |
btemp.p4=GENPTOLOR(p); |
269 |
> |
|
270 |
> |
int nHDaubdau = p.numberOfDaughters(); |
271 |
> |
for(int j = 0; j < nHDaubdau; ++ j) { |
272 |
> |
const Candidate * Bdau = p.daughter( j ); |
273 |
> |
btemp.dauid.push_back(Bdau->pdgId()); |
274 |
> |
} |
275 |
> |
auxInfo->mcB.push_back(btemp); |
276 |
|
} |
277 |
|
|
278 |
|
if(id==-5){ |
411 |
– |
bbarin=i; |
412 |
– |
hbbInfo->mcBbar.status=st; |
413 |
– |
hbbInfo->mcBbar.charge=p.charge(); |
414 |
– |
if(p.mother(0)!=0) hbbInfo->mcBbar.momid=p.mother(0)->pdgId(); |
415 |
– |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) hbbInfo->mcBbar.gmomid=p.mother(0)->mother(0)->pdgId(); |
416 |
– |
} |
417 |
– |
|
418 |
– |
if(abs(id)==4){ |
419 |
– |
hbbInfo->mcC.status=st; |
420 |
– |
hbbInfo->mcC.charge=p.charge(); |
421 |
– |
if(p.mother(0)!=0) hbbInfo->mcC.momid=p.mother(0)->pdgId(); |
422 |
– |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) hbbInfo->mcC.gmomid=p.mother(0)->mother(0)->pdgId(); |
423 |
– |
} |
279 |
|
|
280 |
+ |
VHbbEventAuxInfo::ParticleMCInfo bbtemp; |
281 |
+ |
|
282 |
+ |
bbtemp.status=st; |
283 |
+ |
bbtemp.charge=p.charge(); |
284 |
+ |
if(p.mother(0)!=0) bbtemp.momid=p.mother(0)->pdgId(); |
285 |
+ |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) bbtemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
286 |
|
|
287 |
< |
} |
287 |
> |
bbtemp.p4=GENPTOLOR(p); |
288 |
> |
|
289 |
> |
int nHDaubdau = p.numberOfDaughters(); |
290 |
> |
for(int j = 0; j < nHDaubdau; ++ j) { |
291 |
> |
const Candidate * Bdau = p.daughter( j ); |
292 |
> |
bbtemp.dauid.push_back(Bdau->pdgId()); |
293 |
> |
} |
294 |
|
|
295 |
|
|
296 |
< |
if(bin!=-99 && bbarin!=-99){ |
297 |
< |
const Candidate & bGen = (*genParticles)[bin]; |
431 |
< |
const Candidate & bbarGen = (*genParticles)[bbarin]; |
432 |
< |
hbbInfo->mcB.fourMomentum=GENPTOLOR(bGen); |
433 |
< |
hbbInfo->mcBbar.fourMomentum=GENPTOLOR(bbarGen); |
296 |
> |
auxInfo->mcBbar.push_back(bbtemp); |
297 |
> |
} |
298 |
|
|
299 |
< |
int nHDaubdau = bGen.numberOfDaughters(); |
300 |
< |
for(int j = 0; j < nHDaubdau; ++ j) { |
301 |
< |
const Candidate * Bdau = bGen.daughter( j ); |
302 |
< |
hbbInfo->mcB.dauid.push_back(Bdau->pdgId()); |
303 |
< |
hbbInfo->mcB.dauFourMomentum.push_back(GENPTOLORP(Bdau)); |
304 |
< |
} |
441 |
< |
int nHDaubbardau = bbarGen.numberOfDaughters(); |
442 |
< |
for(int j = 0; j < nHDaubbardau; ++ j) { |
443 |
< |
const Candidate * Bbardau = bbarGen.daughter( j ); |
444 |
< |
hbbInfo->mcBbar.dauid.push_back(Bbardau->pdgId()); |
445 |
< |
hbbInfo->mcBbar.dauFourMomentum.push_back(GENPTOLORP(Bbardau)); |
446 |
< |
} |
299 |
> |
if(abs(id)==4){ |
300 |
> |
VHbbEventAuxInfo::ParticleMCInfo ctemp; |
301 |
> |
ctemp.status=st; |
302 |
> |
ctemp.charge=p.charge(); |
303 |
> |
if(p.mother(0)!=0) ctemp.momid=p.mother(0)->pdgId(); |
304 |
> |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) ctemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
305 |
|
|
306 |
< |
|
306 |
> |
ctemp.p4=GENPTOLOR(p); |
307 |
> |
|
308 |
> |
int nHDaubdau = p.numberOfDaughters(); |
309 |
> |
for(int j = 0; j < nHDaubdau; ++ j) { |
310 |
> |
const Candidate * Bdau = p.daughter( j ); |
311 |
> |
ctemp.dauid.push_back(Bdau->pdgId()); |
312 |
> |
} |
313 |
|
|
314 |
< |
} |
314 |
> |
auxInfo->mcC.push_back(ctemp); |
315 |
|
|
316 |
+ |
} |
317 |
+ |
|
318 |
+ |
} |
319 |
|
|
320 |
|
} // isMC |
321 |
|
|
359 |
|
iEvent.getByLabel(eleLabel_,electronHandle); |
360 |
|
edm::View<pat::Electron> electrons = *electronHandle; |
361 |
|
|
495 |
– |
edm::Handle<edm::View<pat::MET> > metHandle; |
496 |
– |
iEvent.getByLabel(metLabel_,metHandle); |
497 |
– |
edm::View<pat::MET> mets = *metHandle; |
362 |
|
|
363 |
|
// edm::Handle<edm::View<pat::Photon> > phoHandle; |
364 |
|
// iEvent.getByLabel(phoLabel_,phoHandle); |
374 |
|
edm::Handle<CandidateView> dielectrons; |
375 |
|
iEvent.getByLabel(dielecLabel_,dielectrons); |
376 |
|
|
377 |
+ |
//BTAGGING SCALE FACTOR FROM DATABASE |
378 |
+ |
//Combined Secondary Vertex Loose |
379 |
+ |
edm::ESHandle<BtagPerformance> bTagSF_CSVL_; |
380 |
+ |
iSetup.get<BTagPerformanceRecord>().get("BTAGCSVL",bTagSF_CSVL_); |
381 |
+ |
const BtagPerformance & bTagSF_CSVL = *(bTagSF_CSVL_.product()); |
382 |
+ |
//Combined Secondary Vertex Medium |
383 |
+ |
edm::ESHandle<BtagPerformance> bTagSF_CSVM_; |
384 |
+ |
iSetup.get<BTagPerformanceRecord>().get("BTAGCSVM",bTagSF_CSVM_); |
385 |
+ |
const BtagPerformance & bTagSF_CSVM = *(bTagSF_CSVM_.product()); |
386 |
+ |
//Combined Secondary Vertex Tight |
387 |
+ |
edm::ESHandle<BtagPerformance> bTagSF_CSVT_; |
388 |
+ |
iSetup.get<BTagPerformanceRecord>().get("BTAGCSVT",bTagSF_CSVT_); |
389 |
+ |
const BtagPerformance & bTagSF_CSVT = *(bTagSF_CSVT_.product()); |
390 |
+ |
|
391 |
+ |
edm::ESHandle<BtagPerformance> mistagSF_CSVL_; |
392 |
+ |
iSetup.get<BTagPerformanceRecord>().get("MISTAGCSVL",mistagSF_CSVL_); |
393 |
+ |
const BtagPerformance & mistagSF_CSVL = *(mistagSF_CSVL_.product()); |
394 |
+ |
//Combined Secondary Vertex Medium |
395 |
+ |
edm::ESHandle<BtagPerformance> mistagSF_CSVM_; |
396 |
+ |
iSetup.get<BTagPerformanceRecord>().get("MISTAGCSVM",mistagSF_CSVM_); |
397 |
+ |
const BtagPerformance & mistagSF_CSVM = *(mistagSF_CSVM_.product()); |
398 |
+ |
//Combined Secondary Vertex Tight |
399 |
+ |
edm::ESHandle<BtagPerformance> mistagSF_CSVT_; |
400 |
+ |
iSetup.get<BTagPerformanceRecord>().get("MISTAGCSVT",mistagSF_CSVT_); |
401 |
+ |
const BtagPerformance & mistagSF_CSVT = *(mistagSF_CSVT_.product()); |
402 |
+ |
|
403 |
+ |
BTagSFContainer btagSFs; |
404 |
+ |
btagSFs.BTAGSF_CSVL = (bTagSF_CSVL_.product()); |
405 |
+ |
btagSFs.BTAGSF_CSVM = (bTagSF_CSVM_.product()); |
406 |
+ |
btagSFs.BTAGSF_CSVT = (bTagSF_CSVT_.product()); |
407 |
+ |
btagSFs.MISTAGSF_CSVL = (mistagSF_CSVL_.product()); |
408 |
+ |
btagSFs.MISTAGSF_CSVM = (mistagSF_CSVM_.product()); |
409 |
+ |
btagSFs.MISTAGSF_CSVT = (mistagSF_CSVT_.product()); |
410 |
|
|
411 |
|
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets1.begin(); jet_iter!=simplejets1.end(); ++jet_iter){ |
412 |
|
// if(jet_iter->pt()>50) |
413 |
|
// njetscounter++; |
414 |
|
VHbbEvent::SimpleJet sj; |
415 |
< |
sj.flavour = jet_iter->partonFlavour(); |
415 |
> |
fillSimpleJet(sj,jet_iter); |
416 |
> |
// if(!runOnMC_) |
417 |
|
|
418 |
< |
sj.tche=jet_iter->bDiscriminator("trackCountingHighEffBJetTags"); |
521 |
< |
sj.tchp=jet_iter->bDiscriminator("trackCountingHighPurBJetTags"); |
522 |
< |
sj.jp=jet_iter->bDiscriminator("jetProbabilityBJetTags"); |
523 |
< |
sj.jpb=jet_iter->bDiscriminator("jetBProbabilityBJetTags"); |
524 |
< |
sj.ssvhe=jet_iter->bDiscriminator("simpleSecondaryVertexHighEffBJetTags"); |
525 |
< |
sj.csv=jet_iter->bDiscriminator("combinedSecondaryVertexBJetTags"); |
526 |
< |
sj.csvmva=jet_iter->bDiscriminator("combinedSecondaryVertexMVABJetTags"); |
527 |
< |
sj.charge=jet_iter->jetCharge(); |
528 |
< |
sj.ntracks=jet_iter->associatedTracks().size(); |
529 |
< |
sj.fourMomentum=GENPTOLORP(jet_iter); |
530 |
< |
sj.chargedTracksFourMomentum=(getChargedTracksMomentum(&*(jet_iter))); |
531 |
< |
|
532 |
< |
// |
533 |
< |
// add tVector |
534 |
< |
// |
535 |
< |
sj.tVector = getTvect(&(*jet_iter)); |
418 |
> |
setJecUnc(sj,jecUnc); |
419 |
|
|
420 |
|
Particle::LorentzVector p4Jet = jet_iter->p4(); |
421 |
|
|
422 |
|
if(runOnMC_){ |
423 |
< |
double minb1DR=9999.; |
424 |
< |
for(size_t i = 0; i < genParticles->size(); ++ i) { |
425 |
< |
const GenParticle & p = (*genParticles)[i]; |
426 |
< |
int id = p.pdgId(); |
427 |
< |
if(abs(id)<=6 || id==21 || id==23 || abs(id)==24){ |
428 |
< |
double bb1DR=TMath::Sqrt((p.eta()-p4Jet.eta())*(p.eta()-p4Jet.eta())+ |
429 |
< |
(p.phi()-p4Jet.phi())*(p.phi()-p4Jet.phi())); |
430 |
< |
if(bb1DR<minb1DR) {minb1DR=bb1DR; sj.bestMCid=id; if(p.mother()!=0) sj.bestMCmomid=p.mother()->pdgId();} |
423 |
> |
|
424 |
> |
fillScaleFactors(sj, btagSFs); |
425 |
> |
|
426 |
> |
//PAT genJet matching |
427 |
> |
//genJet |
428 |
> |
const reco::GenJet *gJ = jet_iter->genJet(); |
429 |
> |
//physical parton for mother info ONLY |
430 |
> |
if( (jet_iter->genParton()) |
431 |
> |
and (jet_iter->genParton()->mother()) ) |
432 |
> |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
433 |
> |
TLorentzVector gJp4; |
434 |
> |
if(gJ){ |
435 |
> |
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
436 |
> |
sj. bestMCp4mom = gJp4; |
437 |
> |
if(verbose_){ |
438 |
> |
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
439 |
> |
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
440 |
> |
std::clog << "genJet matched deltaR = " <<gJp4.DeltaR(sj.p4) << std::endl; |
441 |
> |
std::clog << "genJet matched mother id = " << sj.bestMCmomid << std::endl; |
442 |
|
} |
443 |
|
} |
444 |
< |
} //isMC |
444 |
> |
|
445 |
> |
} //isMC |
446 |
|
hbbInfo->simpleJets.push_back(sj); |
447 |
|
|
448 |
|
} |
449 |
< |
|
449 |
> |
|
450 |
> |
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets3.begin(); jet_iter!=simplejets3.end(); ++jet_iter){ |
451 |
> |
// if(jet_iter->pt()>50) |
452 |
> |
// njetscounter++; |
453 |
> |
VHbbEvent::SimpleJet sj; |
454 |
> |
fillSimpleJet(sj,jet_iter); |
455 |
> |
// if(!runOnMC_) |
456 |
> |
setJecUnc(sj,jecUnc); |
457 |
> |
|
458 |
> |
|
459 |
> |
Particle::LorentzVector p4Jet = jet_iter->p4(); |
460 |
> |
|
461 |
> |
if(runOnMC_){ |
462 |
> |
|
463 |
> |
fillScaleFactors(sj, btagSFs); |
464 |
> |
|
465 |
> |
//PAT genJet matching |
466 |
> |
//genJet |
467 |
> |
const reco::GenJet *gJ = jet_iter->genJet(); |
468 |
> |
//physical parton for mother info ONLY |
469 |
> |
if( (jet_iter->genParton()) |
470 |
> |
and (jet_iter->genParton()->mother()) ) |
471 |
> |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
472 |
> |
TLorentzVector gJp4; |
473 |
> |
if(gJ){ |
474 |
> |
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
475 |
> |
sj. bestMCp4mom = gJp4; |
476 |
> |
if(verbose_){ |
477 |
> |
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
478 |
> |
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
479 |
> |
std::clog << "genJet matched deltaR = " <<gJp4.DeltaR(sj.p4) << std::endl; |
480 |
> |
std::clog << "genJet matched mother id = " << sj.bestMCmomid << std::endl; |
481 |
> |
} |
482 |
> |
} |
483 |
> |
|
484 |
> |
} //isMC |
485 |
> |
hbbInfo->simpleJets3.push_back(sj); |
486 |
> |
|
487 |
> |
} |
488 |
> |
|
489 |
> |
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets4.begin(); jet_iter!=simplejets4.end(); ++jet_iter){ |
490 |
> |
// if(jet_iter->pt()>50) |
491 |
> |
// njetscounter++; |
492 |
> |
VHbbEvent::SimpleJet sj; |
493 |
> |
fillSimpleJet(sj,jet_iter); |
494 |
> |
// if(!runOnMC_) |
495 |
> |
setJecUnc(sj,jecUnc); |
496 |
> |
|
497 |
> |
|
498 |
> |
Particle::LorentzVector p4Jet = jet_iter->p4(); |
499 |
> |
|
500 |
> |
if(runOnMC_){ |
501 |
> |
|
502 |
> |
fillScaleFactors(sj, btagSFs); |
503 |
> |
|
504 |
> |
//PAT genJet matching |
505 |
> |
//genJet |
506 |
> |
const reco::GenJet *gJ = jet_iter->genJet(); |
507 |
> |
//physical parton for mother info ONLY |
508 |
> |
if( (jet_iter->genParton()) |
509 |
> |
and (jet_iter->genParton()->mother()) ) |
510 |
> |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
511 |
> |
TLorentzVector gJp4; |
512 |
> |
if(gJ){ |
513 |
> |
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
514 |
> |
sj. bestMCp4mom = gJp4; |
515 |
> |
if(verbose_){ |
516 |
> |
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
517 |
> |
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
518 |
> |
std::clog << "genJet matched deltaR = " <<gJp4.DeltaR(sj.p4) << std::endl; |
519 |
> |
std::clog << "genJet matched mother id = " << sj.bestMCmomid << std::endl; |
520 |
> |
} |
521 |
> |
} |
522 |
> |
|
523 |
> |
} //isMC |
524 |
> |
hbbInfo->simpleJets4.push_back(sj); |
525 |
> |
|
526 |
> |
} |
527 |
> |
|
528 |
|
|
529 |
|
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets2.begin(); jet_iter!=simplejets2.end(); ++jet_iter){ |
530 |
|
|
531 |
|
VHbbEvent::SimpleJet sj; |
532 |
< |
sj.flavour = jet_iter->partonFlavour(); |
532 |
> |
fillSimpleJet(sj,jet_iter); |
533 |
> |
// if(!runOnMC_) |
534 |
> |
setJecUnc(sj,jecUnc); |
535 |
> |
/* sj.flavour = jet_iter->partonFlavour(); |
536 |
|
|
537 |
|
|
538 |
|
sj.tche=jet_iter->bDiscriminator("trackCountingHighEffBJetTags"); |
544 |
|
sj.csvmva=jet_iter->bDiscriminator("combinedSecondaryVertexMVABJetTags"); |
545 |
|
sj.charge=jet_iter->jetCharge(); |
546 |
|
sj.ntracks=jet_iter->associatedTracks().size(); |
547 |
< |
sj.fourMomentum=GENPTOLORP(jet_iter); |
547 |
> |
sj.p4=GENPTOLORP(jet_iter); |
548 |
|
sj.chargedTracksFourMomentum=(getChargedTracksMomentum(&*(jet_iter))); |
549 |
< |
sj.tVector = getTvect(&(*jet_iter)); |
549 |
> |
sj.SF_CSVL=1; |
550 |
> |
sj.SF_CSVM=1; |
551 |
> |
sj.SF_CSVT=1; |
552 |
> |
sj.SF_CSVLerr=0; |
553 |
> |
sj.SF_CSVMerr=0; |
554 |
> |
sj.SF_CSVTerr=0; |
555 |
> |
|
556 |
> |
// |
557 |
> |
// addtaginfo for csv |
558 |
> |
// |
559 |
> |
|
560 |
> |
if (jet_iter->hasTagInfo("SimpleSecondaryVertex")) { |
561 |
> |
|
562 |
> |
const reco::SecondaryVertexTagInfo * tf = jet_iter->tagInfoSecondaryVertex(); |
563 |
> |
sj.vtxMass = tf->secondaryVertex(0).p4().mass(); |
564 |
> |
sj.vtxNTracks = tf->secondaryVertex(0).nTracks(); |
565 |
> |
Measurement1D m = tf->flightDistance(0); |
566 |
> |
sj.vtx3dL = m.value(); |
567 |
> |
sj.vtx3deL = m.error(); |
568 |
> |
} |
569 |
> |
|
570 |
|
|
571 |
+ |
// |
572 |
+ |
// add tVector |
573 |
+ |
// |
574 |
+ |
sj.tVector = getTvect(&(*jet_iter)); |
575 |
+ |
*/ |
576 |
|
Particle::LorentzVector p4Jet = jet_iter->p4(); |
577 |
|
|
578 |
+ |
|
579 |
|
if(runOnMC_){ |
580 |
< |
double minb2DR=9999.; |
581 |
< |
for(size_t i = 0; i < genParticles->size(); ++ i) { |
582 |
< |
const GenParticle & p = (*genParticles)[i]; |
583 |
< |
int id = p.pdgId(); |
584 |
< |
if(abs(id)<=6 || id==21 || id==23 || abs(id)==24){ |
585 |
< |
double bb2DR=TMath::Sqrt((p.eta()-p4Jet.eta())*(p.eta()-p4Jet.eta())+ |
586 |
< |
(p.phi()-p4Jet.phi())*(p.phi()-p4Jet.phi())); |
587 |
< |
if(bb2DR<minb2DR) {minb2DR=bb2DR; sj.bestMCid=id; if(p.mother()!=0) sj.bestMCmomid=p.mother()->pdgId();} |
580 |
> |
|
581 |
> |
//BTV scale factors |
582 |
> |
fillScaleFactors(sj, btagSFs); |
583 |
> |
|
584 |
> |
//PAT genJet matching |
585 |
> |
//genJet |
586 |
> |
const reco::GenJet *gJ = jet_iter->genJet(); |
587 |
> |
//physical parton for mother info ONLY |
588 |
> |
if( (jet_iter->genParton()) |
589 |
> |
and (jet_iter->genParton()->mother()) ) |
590 |
> |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
591 |
> |
TLorentzVector gJp4; |
592 |
> |
if(gJ){ |
593 |
> |
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
594 |
> |
sj. bestMCp4mom = gJp4; |
595 |
> |
if(verbose_){ |
596 |
> |
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
597 |
> |
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
598 |
> |
std::clog << "genJet matched deltaR = " << gJp4.DeltaR(sj.p4) << std::endl; |
599 |
> |
std::clog << "genJet matched mother id = " << sj.bestMCmomid << std::endl; |
600 |
|
} |
601 |
|
} |
602 |
+ |
|
603 |
|
} //isMC |
604 |
|
|
605 |
|
hbbInfo->simpleJets2.push_back(sj); |
637 |
|
// if(printJet) {std::cout << "NsubJets: " << constituents.size() << "\n";} |
638 |
|
VHbbEvent::HardJet hj; |
639 |
|
hj.constituents=constituents.size(); |
640 |
< |
hj.fourMomentum =GENPTOLORP(jet_iter); |
641 |
< |
|
640 |
> |
hj.p4 =GENPTOLORP(jet_iter); |
641 |
> |
|
642 |
|
for (unsigned int iJC(0); iJC<constituents.size(); ++iJC ){ |
643 |
|
Jet::Constituent icandJet = constituents[iJC]; |
644 |
|
|
671 |
|
<< "," << subjet_iter->bDiscriminator("combinedSecondaryVertexBJetTags") << "\n";} |
672 |
|
|
673 |
|
VHbbEvent::SimpleJet sj; |
674 |
< |
|
675 |
< |
sj.flavour = subjet_iter->partonFlavour(); |
674 |
> |
fillSimpleJet(sj,subjet_iter); |
675 |
> |
// if(!runOnMC_) |
676 |
> |
setJecUnc(sj,jecUnc); |
677 |
> |
/* sj.flavour = subjet_iter->partonFlavour(); |
678 |
|
sj.tVector = getTvect(&(*subjet_iter)); |
679 |
|
sj.tche=subjet_iter->bDiscriminator("trackCountingHighEffBJetTags"); |
680 |
|
sj.tchp=subjet_iter->bDiscriminator("trackCountingHighPurBJetTags"); |
685 |
|
sj.csvmva=subjet_iter->bDiscriminator("combinedSecondaryVertexMVABJetTags"); |
686 |
|
sj.charge=subjet_iter->jetCharge(); |
687 |
|
sj.ntracks=subjet_iter->associatedTracks().size(); |
688 |
< |
sj.fourMomentum=GENPTOLORP(subjet_iter); |
689 |
< |
sj.fourMomentum=(getChargedTracksMomentum(&*(subjet_iter))); |
688 |
> |
sj.p4=GENPTOLORP(subjet_iter); |
689 |
> |
sj.p4=(getChargedTracksMomentum(&*(subjet_iter))); |
690 |
> |
|
691 |
> |
// |
692 |
> |
// addtaginfo for csv |
693 |
> |
// |
694 |
> |
|
695 |
> |
if (subjet_iter->hasTagInfo("SimpleSecondaryVertex")) { |
696 |
> |
|
697 |
> |
const reco::SecondaryVertexTagInfo * tf = subjet_iter->tagInfoSecondaryVertex(); |
698 |
> |
sj.vtxMass = tf->secondaryVertex(0).p4().mass(); |
699 |
> |
sj.vtxNTracks = tf->secondaryVertex(0).nTracks(); |
700 |
> |
Measurement1D m = tf->flightDistance(0); |
701 |
> |
sj.vtx3dL = m.value(); |
702 |
> |
sj.vtx3deL = m.error(); |
703 |
> |
} |
704 |
> |
*/ |
705 |
|
hbbInfo->subJets.push_back(sj); |
706 |
|
|
707 |
|
} |
711 |
|
// met is calomet |
712 |
|
// |
713 |
|
|
682 |
– |
|
683 |
– |
for(edm::View<pat::MET>::const_iterator met = mets.begin(); met!=mets.end(); ++met){ |
684 |
– |
hbbInfo->calomet.sumEt=met->sumEt(); |
685 |
– |
hbbInfo->calomet.metSig=met->mEtSig(); |
686 |
– |
hbbInfo->calomet.eLong=met->e_longitudinal(); |
687 |
– |
hbbInfo->calomet.fourMomentum=GENPTOLORP(met); |
688 |
– |
} |
689 |
– |
|
714 |
|
edm::Handle<edm::View<pat::MET> > metTCHandle; |
715 |
|
iEvent.getByLabel("patMETsTC",metTCHandle); |
716 |
|
edm::View<pat::MET> metsTC = *metTCHandle; |
717 |
< |
for(edm::View<pat::MET>::const_iterator metTC = metsTC.begin(); metTC!=metsTC.end(); ++metTC){ |
718 |
< |
hbbInfo->calomet.sumEt=metTC->sumEt(); |
719 |
< |
hbbInfo->calomet.metSig=metTC->mEtSig(); |
720 |
< |
hbbInfo->calomet.eLong=metTC->e_longitudinal(); |
721 |
< |
hbbInfo->calomet.fourMomentum=GENPTOLORP(metTC); |
717 |
> |
if(metsTC.size()){ |
718 |
> |
hbbInfo->tcmet.sumEt=(metsTC[0]).sumEt(); |
719 |
> |
hbbInfo->tcmet.metSig=(metsTC[0]).significance(); |
720 |
> |
hbbInfo->tcmet.eLong=(metsTC[0]).e_longitudinal(); |
721 |
> |
hbbInfo->tcmet.p4=GENPTOLOR((metsTC[0])); |
722 |
> |
if (verbose_) std::cout <<" METTC "<< hbbInfo->tcmet.metSig <<" " << hbbInfo->tcmet.sumEt<<std::endl; |
723 |
> |
} |
724 |
> |
|
725 |
> |
|
726 |
> |
edm::Handle<edm::View<reco::MET> > mHTHandle; |
727 |
> |
iEvent.getByLabel("patMETsHT",mHTHandle); |
728 |
> |
edm::View<reco::MET> metsHT = *mHTHandle; |
729 |
> |
if(metsHT.size()){ |
730 |
> |
hbbInfo->mht.sumEt=(metsHT[0]).sumEt(); |
731 |
> |
hbbInfo->mht.metSig=(metsHT[0]).significance(); |
732 |
> |
hbbInfo->mht.eLong=(metsHT[0]).e_longitudinal(); |
733 |
> |
hbbInfo->mht.p4=GENPTOLOR((metsHT[0])); |
734 |
> |
if (verbose_) std::cout <<" METHT "<< hbbInfo->mht.metSig <<" " << hbbInfo->mht.sumEt<<std::endl; |
735 |
> |
} |
736 |
> |
|
737 |
> |
edm::Handle<edm::View<pat::MET> > metHandle; |
738 |
> |
iEvent.getByLabel(metLabel_,metHandle); |
739 |
> |
edm::View<pat::MET> mets = *metHandle; |
740 |
> |
|
741 |
> |
if(mets.size()){ |
742 |
> |
hbbInfo->calomet.sumEt=(mets[0]).sumEt(); |
743 |
> |
hbbInfo->calomet.metSig=(mets[0]).significance(); |
744 |
> |
hbbInfo->calomet.eLong=(mets[0]).e_longitudinal(); |
745 |
> |
hbbInfo->calomet.p4=GENPTOLOR((mets[0])); |
746 |
> |
if (verbose_) std::cout <<" METCALO "<< hbbInfo->calomet.metSig <<" " << hbbInfo->calomet.sumEt<<std::endl; |
747 |
|
} |
748 |
+ |
|
749 |
|
edm::Handle<edm::View<pat::MET> > metPFHandle; |
750 |
|
iEvent.getByLabel("patMETsPF",metPFHandle); |
751 |
|
edm::View<pat::MET> metsPF = *metPFHandle; |
752 |
< |
for(edm::View<pat::MET>::const_iterator metPF = metsPF.begin(); metPF!=metsPF.end(); ++metPF){ |
753 |
< |
hbbInfo->calomet.sumEt=metPF->sumEt(); |
754 |
< |
hbbInfo->calomet.metSig=metPF->mEtSig(); |
755 |
< |
hbbInfo->calomet.eLong=metPF->e_longitudinal(); |
756 |
< |
hbbInfo->calomet.fourMomentum=GENPTOLORP(metPF); |
752 |
> |
|
753 |
> |
if(metsPF.size()){ |
754 |
> |
hbbInfo->pfmet.sumEt=(metsPF[0]).sumEt(); |
755 |
> |
hbbInfo->pfmet.metSig=(metsPF[0]).significance(); |
756 |
> |
hbbInfo->pfmet.eLong=(metsPF[0]).e_longitudinal(); |
757 |
> |
hbbInfo->pfmet.p4=GENPTOLOR((metsPF[0])); |
758 |
> |
if (verbose_) std::cout <<" METPF "<< hbbInfo->pfmet.metSig <<" " << hbbInfo->pfmet.sumEt<<std::endl; |
759 |
> |
} |
760 |
> |
|
761 |
> |
|
762 |
> |
if(verbose_){ |
763 |
> |
std::cout << "METs: calomet "<<mets.size()<<" tcmet"<<metsTC.size()<<" pfmet "<<metsPF.size()<<" MHT" <<metsHT.size()<<std::endl; |
764 |
|
} |
765 |
|
|
766 |
< |
|
766 |
> |
if(verbose_) |
767 |
> |
std::cout << " INPUT MUONS "<<muons.size()<<std::endl; |
768 |
|
|
769 |
|
for(edm::View<pat::Muon>::const_iterator mu = muons.begin(); mu!=muons.end(); ++mu){ |
770 |
|
VHbbEvent::MuonInfo mf; |
771 |
< |
mf.fourMomentum =GENPTOLORP( mu); |
771 |
> |
mf.p4 =GENPTOLORP( mu); |
772 |
|
mf.charge=mu->charge(); |
773 |
|
mf.tIso=mu->trackIso(); |
774 |
|
mf.eIso=mu->ecalIso(); |
775 |
|
mf.hIso=mu->hcalIso(); |
776 |
< |
Geom::Phi<double> deltaphi(mu->phi()-atan2(mf.fourMomentum.Px(), mf.fourMomentum.Py())); |
776 |
> |
mf.pfChaIso=mu->chargedHadronIso(); |
777 |
> |
mf.pfPhoIso=mu->photonIso(); |
778 |
> |
mf.pfNeuIso=mu->neutralHadronIso(); |
779 |
> |
Geom::Phi<double> deltaphi(mu->phi()-atan2(mf.p4.Px(), mf.p4.Py())); |
780 |
|
double acop = deltaphi.value(); |
781 |
|
mf.acop=acop; |
782 |
|
|
783 |
|
mf.ipDb=mu->dB(); |
784 |
|
mf.ipErrDb=mu->edB(); |
785 |
< |
if(mu->isGlobalMuon()) mf.cat=1; |
786 |
< |
else if(mu->isTrackerMuon()) mf.cat=2; |
787 |
< |
else mf.cat=3; |
785 |
> |
mf.cat=0; |
786 |
> |
if(mu->isGlobalMuon()) mf.cat|=1; |
787 |
> |
if(mu->isTrackerMuon()) mf.cat|=2; |
788 |
> |
if(mu->isStandAloneMuon()) mf.cat|=4; |
789 |
|
TrackRef trkMu1Ref = mu->get<TrackRef>(); |
790 |
|
if(trkMu1Ref.isNonnull()){ |
791 |
|
const Track* MuTrk1 = mu->get<TrackRef>().get(); |
802 |
|
const reco::HitPattern& q = gTrack->hitPattern(); |
803 |
|
mf.globChi2=gTrack.get()->normalizedChi2(); |
804 |
|
mf.globNHits=q.numberOfValidMuonHits(); |
805 |
+ |
mf. validMuStations = q. muonStationsWithValidHits(); |
806 |
|
}else{ |
807 |
|
mf.globChi2=-99; |
808 |
|
mf.globNHits=-99; |
809 |
|
} |
810 |
|
|
811 |
+ |
//Muon trigger matching |
812 |
+ |
for (int itrig = 0; itrig != ntrigs; ++itrig){ |
813 |
+ |
std::string trigName=triggerNames_.triggerName(itrig); |
814 |
+ |
if( (mu->triggerObjectMatchesByPath(trigName,false,false).size() != 0) ){ |
815 |
+ |
mf.hltMatchedBits.push_back(itrig); |
816 |
+ |
if(verbose_){ |
817 |
+ |
std::clog << "Trigger Matching box" << std::endl; |
818 |
+ |
std::clog << "+++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; |
819 |
+ |
std::clog << "Matching parameters are defined in the cfg" << std::endl; |
820 |
+ |
std::clog << "Trigger bit = " << itrig << std::endl; |
821 |
+ |
std::clog << "Trigger name = " << trigName << std::endl; |
822 |
+ |
std::clog << "Trigger object matched collection size = " << mu->triggerObjectMatchesByPath(trigName,false,false).size() << std::endl; |
823 |
+ |
std::clog << "Pat Muon pt = " << mf.p4.Pt() << " HLT object matched = " << mu->triggerObjectMatch(0)->p4().Pt() << std::endl; |
824 |
+ |
std::clog << "+++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; |
825 |
+ |
} |
826 |
+ |
} |
827 |
+ |
} |
828 |
+ |
// |
829 |
+ |
|
830 |
+ |
// add stamuon |
831 |
+ |
|
832 |
+ |
// if (mu->isStandAloneMuon()) { |
833 |
+ |
// reco::TrackRef sta = mu->standAloneMuon(); |
834 |
+ |
// |
835 |
+ |
// } |
836 |
+ |
|
837 |
+ |
|
838 |
|
// int muInfo[12]; |
839 |
|
// fillMuBlock(mu, muInfo); |
840 |
|
if(runOnMC_){ |
848 |
|
hbbInfo->muInfo.push_back(mf); |
849 |
|
} |
850 |
|
|
851 |
< |
|
851 |
> |
if(verbose_) |
852 |
> |
std::cout << " INPUT electrons "<<electrons.size()<<std::endl; |
853 |
|
for(edm::View<pat::Electron>::const_iterator elec = electrons.begin(); elec!=electrons.end(); ++elec){ |
854 |
|
VHbbEvent::ElectronInfo ef; |
855 |
< |
ef.fourMomentum=GENPTOLORP(elec); |
855 |
> |
ef.p4=GENPTOLORP(elec); |
856 |
|
ef.scEta =elec->superCluster()->eta(); |
857 |
|
ef.scPhi =elec->superCluster()->phi(); |
858 |
|
// if(ElecEta[eleccont]!=0) ElecEt[eleccont]=elec->superCluster()->energy()/cosh(elec->superCluster()->eta()); |
860 |
|
ef.tIso=elec->trackIso(); |
861 |
|
ef.eIso=elec->ecalIso(); |
862 |
|
ef.hIso=elec->hcalIso(); |
863 |
< |
Geom::Phi<double> deltaphi(elec->superCluster()->phi()-atan2(hbbInfo->calomet.fourMomentum.Py(),hbbInfo->calomet.fourMomentum.Px())); |
863 |
> |
ef.pfChaIso=elec->chargedHadronIso(); |
864 |
> |
ef.pfPhoIso=elec->photonIso(); |
865 |
> |
ef.pfNeuIso=elec->neutralHadronIso(); |
866 |
> |
|
867 |
> |
Geom::Phi<double> deltaphi(elec->superCluster()->phi()-atan2(hbbInfo->calomet.p4.Py(),hbbInfo->calomet.p4.Px())); |
868 |
|
ef.acop = deltaphi.value(); |
869 |
< |
|
869 |
> |
// |
870 |
> |
// fill eleids |
871 |
> |
// |
872 |
> |
/* ef.id95 = elec->electronID("simpleEleId95cIso"); |
873 |
> |
ef.id85 = elec->electronID("simpleEleId85cIso"); |
874 |
> |
ef.id70 = elec->electronID("simpleEleId70cIso"); |
875 |
> |
ef.id95r = elec->electronID("simpleEleId95relIso"); |
876 |
> |
ef.id70r = elec->electronID("simpleEleId70relIso"); |
877 |
> |
ef.id85r = elec->electronID("simpleEleId85relIso"); |
878 |
> |
*/ |
879 |
> |
ef.id95 =elec->electronID("eidVBTFCom95"); |
880 |
> |
ef.id95r=elec->electronID("eidVBTFRel95"); |
881 |
> |
ef.id85 =elec->electronID("eidVBTFCom85"); |
882 |
> |
ef.id85r=elec->electronID("eidVBTFRel85"); |
883 |
> |
ef.id80 =elec->electronID("eidVBTFCom80"); |
884 |
> |
ef.id80r=elec->electronID("eidVBTFRel80"); |
885 |
> |
ef.id70 =elec->electronID("eidVBTFCom70"); |
886 |
> |
ef.id70r=elec->electronID("eidVBTFRel70"); |
887 |
> |
|
888 |
> |
//Electron trigger matching |
889 |
> |
for (int itrig = 0; itrig != ntrigs; ++itrig){ |
890 |
> |
std::string trigName=triggerNames_.triggerName(itrig); |
891 |
> |
if( (elec->triggerObjectMatchesByPath(trigName).size() != 0) ){ |
892 |
> |
ef.hltMatchedBits.push_back(itrig); |
893 |
> |
if(verbose_){ |
894 |
> |
std::clog << "Trigger Matching box" << std::endl; |
895 |
> |
std::clog << "+++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; |
896 |
> |
std::clog << "Matching parameters are defined in the cfg" << std::endl; |
897 |
> |
std::clog << "Trigger bit = " << itrig << std::endl; |
898 |
> |
std::clog << "Trigger name = " << trigName << std::endl; |
899 |
> |
std::clog << "Trigger object matched collection size = " << elec->triggerObjectMatchesByPath(trigName).size() << std::endl; |
900 |
> |
std::clog << "Pat Electron pt = " << ef.p4.Pt() << " HLT object matched = " << elec->triggerObjectMatch(0)->p4().Pt() << std::endl; |
901 |
> |
std::clog << "+++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; |
902 |
> |
} |
903 |
> |
} |
904 |
> |
} |
905 |
> |
|
906 |
|
if(runOnMC_){ |
907 |
|
const GenParticle* elecMc = elec->genLepton(); |
908 |
|
if(elecMc!=0){ |
914 |
|
hbbInfo->eleInfo.push_back(ef); |
915 |
|
} |
916 |
|
|
917 |
+ |
if(verbose_) |
918 |
+ |
std::cout << " INPUT taus "<<taus.size()<<std::endl; |
919 |
|
for(edm::View<pat::Tau>::const_iterator tau = taus.begin(); tau!=taus.end(); ++tau){ |
920 |
|
VHbbEvent::TauInfo tf; |
921 |
< |
tf.fourMomentum=GENPTOLORP(tau); |
921 |
> |
tf.p4=GENPTOLORP(tau); |
922 |
|
tf.charge=tau->charge(); |
923 |
|
tf.tIso=tau->trackIso(); |
924 |
|
tf.eIso=tau->ecalIso(); |
925 |
|
tf.hIso=tau->hcalIso(); |
926 |
< |
Geom::Phi<double> deltaphi(tau->phi()-atan2(hbbInfo->calomet.fourMomentum.Py(),hbbInfo->calomet.fourMomentum.Px())); |
926 |
> |
Geom::Phi<double> deltaphi(tau->phi()-atan2(hbbInfo->calomet.p4.Py(),hbbInfo->calomet.p4.Px())); |
927 |
|
double acop = deltaphi.value(); |
928 |
|
tf.acop=acop; |
929 |
|
tf.idbyIso=tau->tauID("byIsolation"); |
936 |
|
hbbInfo->tauInfo.push_back(tf); |
937 |
|
} |
938 |
|
|
939 |
+ |
CompareJetPtMuons ptComparatorMu; |
940 |
+ |
CompareJetPtElectrons ptComparatorE; |
941 |
+ |
CompareJetPtTaus ptComparatorTau; |
942 |
+ |
|
943 |
+ |
std::sort(hbbInfo->muInfo.begin(), hbbInfo->muInfo.end(), ptComparatorMu); |
944 |
+ |
std::sort(hbbInfo->eleInfo.begin(), hbbInfo->eleInfo.end(), ptComparatorE); |
945 |
+ |
std::sort(hbbInfo->tauInfo.begin(), hbbInfo->tauInfo.end(), ptComparatorTau); |
946 |
+ |
|
947 |
|
|
948 |
|
// dimuons and dielectrons |
949 |
|
|
950 |
|
for( size_t i = 0; i < dimuons->size(); i++ ) { |
951 |
|
VHbbEvent::DiMuonInfo df; |
952 |
|
const Candidate & dimuonCand = (*dimuons)[ i ]; |
953 |
< |
df.fourMomentum= GENPTOLOR(dimuonCand); |
953 |
> |
df.p4= GENPTOLOR(dimuonCand); |
954 |
|
const Candidate * lep0 = dimuonCand.daughter( 0 ); |
955 |
|
const Candidate * lep1 = dimuonCand.daughter( 1 ); |
956 |
|
// needed to access specific methods of pat::Muon |
957 |
|
const pat::Muon & muonDau0 = dynamic_cast<const pat::Muon &>(*lep0->masterClone()); |
958 |
|
const pat::Muon & muonDau1 = dynamic_cast<const pat::Muon &>(*lep1->masterClone()); |
959 |
|
|
960 |
< |
df.daughter1.fourMomentum=GENPTOLOR(muonDau0); |
961 |
< |
df.daughter2.fourMomentum=GENPTOLOR(muonDau1); |
960 |
> |
df.daughter1.p4=GENPTOLOR(muonDau0); |
961 |
> |
df.daughter2.p4=GENPTOLOR(muonDau1); |
962 |
|
|
963 |
|
df.daughter1.tIso= muonDau0.trackIso(); |
964 |
|
df.daughter2.tIso= muonDau1.trackIso(); |
975 |
|
df.daughter1.ipErrDb=muonDau0.edB(); |
976 |
|
df.daughter2.ipErrDb=muonDau1.edB(); |
977 |
|
|
978 |
< |
|
979 |
< |
if(muonDau0.isGlobalMuon()) df.daughter1.cat =1; |
980 |
< |
else if(muonDau0.isTrackerMuon()) df.daughter1.cat=2; |
981 |
< |
else df.daughter1.cat=3; |
982 |
< |
if(muonDau1.isGlobalMuon()) df.daughter2.cat =1; |
983 |
< |
else if(muonDau1.isTrackerMuon()) df.daughter2.cat=2; |
984 |
< |
else df.daughter2.cat=3; |
978 |
> |
df.daughter1.cat=0; |
979 |
> |
if(muonDau0.isGlobalMuon()) df.daughter1.cat|=1; |
980 |
> |
if(muonDau0.isTrackerMuon()) df.daughter1.cat|=2; |
981 |
> |
if(muonDau0.isStandAloneMuon()) df.daughter1.cat|=4; |
982 |
> |
df.daughter2.cat=0; |
983 |
> |
if(muonDau1.isGlobalMuon()) df.daughter2.cat|=1; |
984 |
> |
if(muonDau1.isTrackerMuon()) df.daughter2.cat|=2; |
985 |
> |
if(muonDau1.isStandAloneMuon()) df.daughter2.cat|=4; |
986 |
|
|
987 |
|
TrackRef trkMu1Ref = muonDau0.get<TrackRef>(); |
988 |
|
TrackRef trkMu2Ref = muonDau1.get<TrackRef>(); |
1014 |
|
const reco::HitPattern& q = gTrack->hitPattern(); |
1015 |
|
df.daughter1.globNHits=q.numberOfValidMuonHits(); |
1016 |
|
df.daughter1.globChi2=gTrack.get()->normalizedChi2(); |
1017 |
+ |
df.daughter1.validMuStations = q. muonStationsWithValidHits(); |
1018 |
|
} |
1019 |
|
if(muonDau1.isGlobalMuon()){ |
1020 |
|
TrackRef gTrack = muonDau1.globalTrack(); |
1021 |
|
const reco::HitPattern& q = gTrack->hitPattern(); |
1022 |
|
df.daughter2.globNHits=q.numberOfValidMuonHits(); |
1023 |
|
df.daughter2.globChi2=gTrack.get()->normalizedChi2(); |
1024 |
+ |
df.daughter2.validMuStations = q. muonStationsWithValidHits(); |
1025 |
|
} |
1026 |
|
|
1027 |
|
} |
1033 |
|
VHbbEvent::DiElectronInfo df; |
1034 |
|
const Candidate & dielecCand = (*dielectrons)[ i ]; |
1035 |
|
|
1036 |
< |
df.fourMomentum=GENPTOLOR(dielecCand); |
1036 |
> |
df.p4=GENPTOLOR(dielecCand); |
1037 |
|
|
1038 |
|
// accessing the daughters of the dimuon candidate |
1039 |
|
const Candidate * lep0 = dielecCand.daughter( 0 ); |
1042 |
|
const pat::Electron & elecDau0 = dynamic_cast<const pat::Electron &>(*lep0->masterClone()); |
1043 |
|
const pat::Electron & elecDau1 = dynamic_cast<const pat::Electron &>(*lep1->masterClone()); |
1044 |
|
|
1045 |
< |
df.daughter1.fourMomentum = GENPTOLOR(elecDau0); |
1046 |
< |
df.daughter2.fourMomentum = GENPTOLOR(elecDau1); |
1045 |
> |
df.daughter1.p4 = GENPTOLOR(elecDau0); |
1046 |
> |
df.daughter2.p4= GENPTOLOR(elecDau1); |
1047 |
|
|
1048 |
|
df.daughter1.tIso = elecDau0.trackIso(); |
1049 |
|
df.daughter2.tIso = elecDau1.trackIso(); |
1054 |
|
df.daughter1.hIso = elecDau0.hcalIso(); |
1055 |
|
df.daughter2.hIso = elecDau1.hcalIso(); |
1056 |
|
|
1057 |
< |
|
1057 |
> |
// ids |
1058 |
> |
/*df.daughter1.id95 = elecDau0.electronID("simpleEleId95cIso"); |
1059 |
> |
df.daughter1.id85 = elecDau0.electronID ("simpleEleId85cIso"); |
1060 |
> |
df.daughter1.id70 = elecDau0.electronID ("simpleEleId70cIso"); |
1061 |
> |
df.daughter1.id95r = elecDau0.electronID ("simpleEleId95relIso"); |
1062 |
> |
df.daughter1.id85r = elecDau0.electronID ("simpleEleId85relIso"); |
1063 |
> |
df.daughter1.id70r = elecDau0.electronID ("simpleEleId70relIso"); |
1064 |
> |
|
1065 |
> |
|
1066 |
> |
df.daughter2.id95 = elecDau1.electronID("simpleEleId95cIso"); |
1067 |
> |
df.daughter2.id85 = elecDau1.electronID ("simpleEleId85cIso"); |
1068 |
> |
df.daughter2.id70 = elecDau1.electronID ("simpleEleId70cIso"); |
1069 |
> |
df.daughter2.id95r = elecDau1.electronID ("simpleEleId95relIso"); |
1070 |
> |
df.daughter2.id85r = elecDau1.electronID ("simpleEleId85relIso"); |
1071 |
> |
df.daughter2.id70r = elecDau1.electronID ("simpleEleId70relIso"); |
1072 |
> |
*/ |
1073 |
|
hbbInfo->diElectronInfo.push_back(df); |
1074 |
|
|
1075 |
|
} |
1076 |
+ |
if (verbose_){ |
1077 |
+ |
std::cout <<" Pushing hbbInfo "<<std::endl; |
1078 |
+ |
std::cout <<" SimpleJets1 = "<<hbbInfo->simpleJets.size()<<std::endl<< |
1079 |
+ |
" SimpleJets2 = "<<hbbInfo->simpleJets2.size()<<std::endl<< |
1080 |
+ |
" SubJets = "<<hbbInfo->subJets.size()<<std::endl<< |
1081 |
+ |
" HardJets = "<<hbbInfo->hardJets.size()<<std::endl<< |
1082 |
+ |
" Muons = "<<hbbInfo->muInfo.size()<<std::endl<< |
1083 |
+ |
" Electrons = "<<hbbInfo->eleInfo.size()<<std::endl<< |
1084 |
+ |
" Taus = "<<hbbInfo->tauInfo.size()<<std::endl<< |
1085 |
+ |
" Electrons = "<<hbbInfo->eleInfo.size()<<std::endl<< |
1086 |
+ |
"--------------------- "<<std::endl; |
1087 |
+ |
} |
1088 |
+ |
|
1089 |
+ |
|
1090 |
|
iEvent.put(hbbInfo); |
1091 |
+ |
iEvent.put(auxInfo); |
1092 |
+ |
|
1093 |
|
|
1094 |
|
} |
1095 |
|
|
1200 |
|
//re- |
1201 |
|
} |
1202 |
|
|
1203 |
+ |
|
1204 |
+ |
//Btagging scale factors |
1205 |
+ |
void HbbAnalyzerNew::fillScaleFactors(VHbbEvent::SimpleJet& sj, BTagSFContainer iSF){ |
1206 |
+ |
|
1207 |
+ |
|
1208 |
+ |
BinningPointByMap measurePoint; |
1209 |
+ |
//for a USDG |
1210 |
+ |
//for CB jets |
1211 |
+ |
//scale factor 1 for CB jets over 240GeV/c |
1212 |
+ |
if( TMath::Abs(sj.flavour) == 4 or TMath::Abs(sj.flavour) == 5 ){ |
1213 |
+ |
measurePoint.insert( BinningVariables::JetEt, sj.p4.Et() ); |
1214 |
+ |
measurePoint.insert( BinningVariables::JetAbsEta, fabs(sj.p4.Eta()) ); |
1215 |
+ |
if( iSF.BTAGSF_CSVL->isResultOk(PerformanceResult::BTAGBEFFCORR , measurePoint) ){ |
1216 |
+ |
sj.SF_CSVL = iSF.BTAGSF_CSVL->getResult(PerformanceResult::BTAGBEFFCORR , measurePoint); |
1217 |
+ |
sj.SF_CSVLerr = iSF.BTAGSF_CSVL->getResult(PerformanceResult::BTAGBERRCORR , measurePoint); |
1218 |
+ |
if(verbose_){ |
1219 |
+ |
std::clog << "C/B Jet flavour = " << sj.flavour << std::endl; |
1220 |
+ |
std::clog << "C/B Jet Et = " << sj.p4.Et() << std::endl; |
1221 |
+ |
std::clog << "C/B Jet eta = " << sj.p4.Eta() << std::endl; |
1222 |
+ |
std::clog << "C/B CSVL Scale Factor = " << sj.SF_CSVL << std::endl; |
1223 |
+ |
std::clog << "C/B CSVL Scale Factor error = " << sj.SF_CSVLerr << std::endl; |
1224 |
+ |
} |
1225 |
+ |
} |
1226 |
+ |
if( iSF.BTAGSF_CSVM->isResultOk(PerformanceResult::BTAGBEFFCORR , measurePoint) ){ |
1227 |
+ |
sj.SF_CSVM = iSF.BTAGSF_CSVM->getResult(PerformanceResult::BTAGBEFFCORR , measurePoint); |
1228 |
+ |
sj.SF_CSVMerr = iSF.BTAGSF_CSVM->getResult(PerformanceResult::BTAGBERRCORR , measurePoint); |
1229 |
+ |
} |
1230 |
+ |
if( iSF.BTAGSF_CSVT->isResultOk(PerformanceResult::BTAGBEFFCORR , measurePoint) ){ |
1231 |
+ |
sj.SF_CSVT = iSF.BTAGSF_CSVT->getResult(PerformanceResult::BTAGBEFFCORR , measurePoint); |
1232 |
+ |
sj.SF_CSVTerr = iSF.BTAGSF_CSVT->getResult(PerformanceResult::BTAGBERRCORR , measurePoint); |
1233 |
+ |
} |
1234 |
+ |
else{ |
1235 |
+ |
if(verbose_){ |
1236 |
+ |
std::cerr << "No SF found in the database for this jet" << std::endl; |
1237 |
+ |
std::clog << "No SF found: Jet flavour = " << sj.flavour << std::endl; |
1238 |
+ |
std::clog << "No SF found: Jet Et = " << sj.p4.Et() << std::endl; |
1239 |
+ |
std::clog << "No SF found: Jet eta = " << sj.p4.Eta() << std::endl; |
1240 |
+ |
} |
1241 |
+ |
} |
1242 |
+ |
} |
1243 |
+ |
else { |
1244 |
+ |
measurePoint.insert( BinningVariables::JetEt, sj.p4.Et() ); |
1245 |
+ |
measurePoint.insert( BinningVariables::JetAbsEta, fabs(sj.p4.Eta()) ); |
1246 |
+ |
if( iSF.MISTAGSF_CSVL->isResultOk(PerformanceResult::BTAGLEFFCORR , measurePoint) ){ |
1247 |
+ |
sj.SF_CSVL = iSF.MISTAGSF_CSVL->getResult(PerformanceResult::BTAGLEFFCORR , measurePoint); |
1248 |
+ |
sj.SF_CSVLerr = iSF.MISTAGSF_CSVL->getResult(PerformanceResult::BTAGLERRCORR , measurePoint); |
1249 |
+ |
if(verbose_){ |
1250 |
+ |
std::clog << "Light Jet flavour = " << sj.flavour << std::endl; |
1251 |
+ |
std::clog << "Light Jet Et = " << sj.p4.Et() << std::endl; |
1252 |
+ |
std::clog << "Light Jet eta = " << sj.p4.Eta() << std::endl; |
1253 |
+ |
std::clog << "Light CSVL Scale Factor = " << sj.SF_CSVL << std::endl; |
1254 |
+ |
std::clog << "Light CSVL Scale Factor error = " << sj.SF_CSVLerr << std::endl; |
1255 |
+ |
} |
1256 |
+ |
} |
1257 |
+ |
if( iSF.MISTAGSF_CSVM->isResultOk(PerformanceResult::BTAGLEFFCORR , measurePoint) ){ |
1258 |
+ |
sj.SF_CSVM = iSF.MISTAGSF_CSVM->getResult(PerformanceResult::BTAGLEFFCORR , measurePoint); |
1259 |
+ |
sj.SF_CSVMerr = iSF.MISTAGSF_CSVM->getResult(PerformanceResult::BTAGLERRCORR , measurePoint); |
1260 |
+ |
} |
1261 |
+ |
if( iSF.MISTAGSF_CSVT->isResultOk(PerformanceResult::BTAGLEFFCORR , measurePoint) ){ |
1262 |
+ |
sj.SF_CSVT = iSF.MISTAGSF_CSVT->getResult(PerformanceResult::BTAGLEFFCORR , measurePoint); |
1263 |
+ |
sj.SF_CSVTerr = iSF.MISTAGSF_CSVT->getResult(PerformanceResult::BTAGLERRCORR , measurePoint); |
1264 |
+ |
} |
1265 |
+ |
else{ |
1266 |
+ |
if(verbose_){ |
1267 |
+ |
std::cerr << "No SF found in the database for this jet" << std::endl; |
1268 |
+ |
std::clog << "No SF found: Jet flavour = " << sj.flavour << std::endl; |
1269 |
+ |
std::clog << "No SF found: Jet Et = " << sj.p4.Et() << std::endl; |
1270 |
+ |
std::clog << "No SF found: Jet eta = " << sj.p4.Eta() << std::endl; |
1271 |
+ |
} |
1272 |
+ |
} |
1273 |
+ |
} |
1274 |
+ |
|
1275 |
+ |
} |
1276 |
+ |
|
1277 |
+ |
void HbbAnalyzerNew::setJecUnc(VHbbEvent::SimpleJet& sj,JetCorrectionUncertainty* jecunc){ |
1278 |
+ |
// |
1279 |
+ |
// test |
1280 |
+ |
// |
1281 |
+ |
|
1282 |
+ |
return; |
1283 |
+ |
double eta = sj.p4.Eta(); |
1284 |
+ |
double pt = sj.p4.Pt(); |
1285 |
+ |
|
1286 |
+ |
jecunc->setJetEta(eta); |
1287 |
+ |
jecunc->setJetPt(pt); // here you must use the CORRECTED jet pt |
1288 |
+ |
double unc = jecunc->getUncertainty(true); |
1289 |
+ |
sj.jecunc= unc; |
1290 |
+ |
} |
1291 |
+ |
|
1292 |
+ |
|
1293 |
+ |
void HbbAnalyzerNew ::fillSimpleJet (VHbbEvent::SimpleJet& sj, edm::View<pat::Jet>::const_iterator jet_iter){ |
1294 |
+ |
sj.flavour = jet_iter->partonFlavour(); |
1295 |
+ |
|
1296 |
+ |
sj.tche=jet_iter->bDiscriminator("trackCountingHighEffBJetTags"); |
1297 |
+ |
sj.tchp=jet_iter->bDiscriminator("trackCountingHighPurBJetTags"); |
1298 |
+ |
sj.jp=jet_iter->bDiscriminator("jetProbabilityBJetTags"); |
1299 |
+ |
sj.jpb=jet_iter->bDiscriminator("jetBProbabilityBJetTags"); |
1300 |
+ |
sj.ssvhe=jet_iter->bDiscriminator("simpleSecondaryVertexHighEffBJetTags"); |
1301 |
+ |
sj.csv=jet_iter->bDiscriminator("combinedSecondaryVertexBJetTags"); |
1302 |
+ |
sj.csvmva=jet_iter->bDiscriminator("combinedSecondaryVertexMVABJetTags"); |
1303 |
+ |
sj.charge=jet_iter->jetCharge(); |
1304 |
+ |
sj.ntracks=jet_iter->associatedTracks().size(); |
1305 |
+ |
sj.p4=GENPTOLORP(jet_iter); |
1306 |
+ |
sj.chargedTracksFourMomentum=(getChargedTracksMomentum(&*(jet_iter))); |
1307 |
+ |
sj.SF_CSVL=1; |
1308 |
+ |
sj.SF_CSVM=1; |
1309 |
+ |
sj.SF_CSVT=1; |
1310 |
+ |
sj.SF_CSVLerr=0; |
1311 |
+ |
sj.SF_CSVMerr=0; |
1312 |
+ |
sj.SF_CSVTerr=0; |
1313 |
+ |
|
1314 |
+ |
|
1315 |
+ |
if (jet_iter->isPFJet() == true) { |
1316 |
+ |
|
1317 |
+ |
sj.chargedHadronEFraction = jet_iter-> chargedHadronEnergyFraction(); |
1318 |
+ |
sj.neutralHadronEFraction = jet_iter-> neutralHadronEnergyFraction (); |
1319 |
+ |
sj.chargedEmEFraction = jet_iter-> chargedEmEnergyFraction (); |
1320 |
+ |
sj.neutralEmEFraction = jet_iter-> neutralEmEnergyFraction (); |
1321 |
+ |
sj. nConstituents = jet_iter->getPFConstituents().size(); |
1322 |
+ |
|
1323 |
+ |
} |
1324 |
+ |
// |
1325 |
+ |
// addtaginfo for csv |
1326 |
+ |
// |
1327 |
+ |
|
1328 |
+ |
// if (jet_iter->hasTagInfo("SimpleSecondaryVertex")) { |
1329 |
+ |
|
1330 |
+ |
const reco::SecondaryVertexTagInfo * tf = jet_iter->tagInfoSecondaryVertex(); |
1331 |
+ |
if (tf){ |
1332 |
+ |
if (tf->nVertices() >0){ |
1333 |
+ |
sj.vtxMass = tf->secondaryVertex(0).p4().mass(); |
1334 |
+ |
sj.vtxNTracks = tf->secondaryVertex(0).nTracks(); |
1335 |
+ |
std::vector<reco::TrackBaseRef >::const_iterator tit = tf->secondaryVertex(0).tracks_begin(); |
1336 |
+ |
for (; tit< tf->secondaryVertex(0).tracks_end(); ++tit){ |
1337 |
+ |
sj.vtxTrackIds.push_back(tit->key()); |
1338 |
+ |
} |
1339 |
+ |
Measurement1D m = tf->flightDistance(0); |
1340 |
+ |
sj.vtx3dL = m.value(); |
1341 |
+ |
sj.vtx3deL = m.error(); |
1342 |
+ |
} |
1343 |
+ |
} |
1344 |
+ |
// |
1345 |
+ |
// add tVector |
1346 |
+ |
// |
1347 |
+ |
sj.tVector = getTvect(&(*jet_iter)); |
1348 |
+ |
} |
1349 |
+ |
|
1350 |
+ |
|
1351 |
|
//define this as a plug-in |
1352 |
|
DEFINE_FWK_MODULE(HbbAnalyzerNew); |