17 |
|
// |
18 |
|
// |
19 |
|
|
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" |
21 |
– |
#include "VHbbAnalysis/HbbAnalyzer/interface/VHbbEvent.h" |
27 |
|
|
28 |
|
#define GENPTOLOR(a) TLorentzVector((a).px(), (a).py(), (a).pz(), (a).energy()) |
29 |
|
#define GENPTOLORP(a) TLorentzVector((a)->px(), (a)->py(), (a)->pz(), (a)->energy()) |
30 |
|
|
31 |
< |
HbbAnalyzerNew::HbbAnalyzerNew(const edm::ParameterSet& iConfig): |
32 |
< |
eleLabel_(iConfig.getUntrackedParameter<edm::InputTag>("electronTag")), |
33 |
< |
muoLabel_(iConfig.getUntrackedParameter<edm::InputTag>("muonTag")), |
34 |
< |
jetLabel_(iConfig.getUntrackedParameter<edm::InputTag>("jetTag")), |
35 |
< |
subjetLabel_(iConfig.getUntrackedParameter<edm::InputTag>("subjetTag")), |
36 |
< |
simplejet1Label_(iConfig.getUntrackedParameter<edm::InputTag>("simplejet1Tag")), |
37 |
< |
simplejet2Label_(iConfig.getUntrackedParameter<edm::InputTag>("simplejet2Tag")), |
38 |
< |
simplejet3Label_(iConfig.getUntrackedParameter<edm::InputTag>("simplejet3Tag")), |
39 |
< |
simplejet4Label_(iConfig.getUntrackedParameter<edm::InputTag>("simplejet4Tag")), |
40 |
< |
tauLabel_(iConfig.getUntrackedParameter<edm::InputTag>("tauTag")), |
41 |
< |
metLabel_(iConfig.getUntrackedParameter<edm::InputTag>("metTag")), |
42 |
< |
phoLabel_(iConfig.getUntrackedParameter<edm::InputTag>("photonTag")), |
43 |
< |
dimuLabel_(iConfig.getUntrackedParameter<edm::InputTag>("dimuTag")), |
44 |
< |
dielecLabel_(iConfig.getUntrackedParameter<edm::InputTag>("dielecTag")), |
45 |
< |
hltResults_(iConfig.getUntrackedParameter<edm::InputTag>("hltResultsTag")), |
46 |
< |
runOnMC_(iConfig.getParameter<bool>("runOnMC")) { |
31 |
> |
|
32 |
> |
struct CompareJetPtMuons { |
33 |
> |
bool operator()( const VHbbEvent::MuonInfo& j1, const VHbbEvent::MuonInfo& j2 ) const { |
34 |
> |
return j1.p4.Pt() > j2.p4.Pt(); |
35 |
> |
} |
36 |
> |
}; |
37 |
> |
struct CompareJetPtElectrons { |
38 |
> |
bool operator()( const VHbbEvent::ElectronInfo& j1, const VHbbEvent::ElectronInfo& j2 ) const { |
39 |
> |
return j1.p4.Pt() > j2.p4.Pt(); |
40 |
> |
} |
41 |
> |
}; |
42 |
> |
struct CompareJetPtTaus { |
43 |
> |
bool operator()( const VHbbEvent::TauInfo& j1, const VHbbEvent::TauInfo& j2 ) const { |
44 |
> |
return j1.p4.Pt() > j2.p4.Pt(); |
45 |
> |
} |
46 |
> |
}; |
47 |
> |
|
48 |
|
|
49 |
|
|
50 |
+ |
HbbAnalyzerNew::HbbAnalyzerNew(const edm::ParameterSet& iConfig): |
51 |
+ |
eleLabel_(iConfig.getParameter<edm::InputTag>("electronTag")), |
52 |
+ |
muoLabel_(iConfig.getParameter<edm::InputTag>("muonTag")), |
53 |
+ |
jetLabel_(iConfig.getParameter<edm::InputTag>("jetTag")), |
54 |
+ |
subjetLabel_(iConfig.getParameter<edm::InputTag>("subjetTag")), |
55 |
+ |
simplejet1Label_(iConfig.getParameter<edm::InputTag>("simplejet1Tag")), |
56 |
+ |
simplejet2Label_(iConfig.getParameter<edm::InputTag>("simplejet2Tag")), |
57 |
+ |
simplejet3Label_(iConfig.getParameter<edm::InputTag>("simplejet3Tag")), |
58 |
+ |
simplejet4Label_(iConfig.getParameter<edm::InputTag>("simplejet4Tag")), |
59 |
+ |
tauLabel_(iConfig.getParameter<edm::InputTag>("tauTag")), |
60 |
+ |
metLabel_(iConfig.getParameter<edm::InputTag>("metTag")), |
61 |
+ |
phoLabel_(iConfig.getParameter<edm::InputTag>("photonTag")), |
62 |
+ |
dimuLabel_(iConfig.getParameter<edm::InputTag>("dimuTag")), |
63 |
+ |
dielecLabel_(iConfig.getParameter<edm::InputTag>("dielecTag")), |
64 |
+ |
hltResults_(iConfig.getParameter<edm::InputTag>("hltResultsTag")), |
65 |
+ |
runOnMC_(iConfig.getParameter<bool>("runOnMC")), verbose_(iConfig.getUntrackedParameter<bool>("verbose")) { |
66 |
+ |
|
67 |
|
// |
68 |
|
// put the setwhatproduced etc etc |
69 |
|
|
70 |
|
produces<VHbbEvent>(); |
71 |
+ |
produces<VHbbEventAuxInfo>(); |
72 |
|
|
73 |
|
|
74 |
|
} |
92 |
|
using namespace edm; |
93 |
|
using namespace reco; |
94 |
|
|
95 |
+ |
// JEC Uncertainty |
96 |
+ |
|
97 |
+ |
// JetCorrectionUncertainty *jecUnc=0; |
98 |
+ |
edm::ESHandle<g> JetCorParColl; |
99 |
+ |
iSetup.get<JetCorrectionsRecord>().get("AK5PF",JetCorParColl); |
100 |
+ |
std::cout <<" PIPPO " << JetCorParColl.isValid()<<" " <<std::endl; |
101 |
+ |
JetCorrectorParameters const & JetCorPar = (*JetCorParColl)["Uncertainty"]; |
102 |
+ |
std::cout <<" Pluto " << &JetCorPar<<std::endl; |
103 |
+ |
JetCorrectionUncertainty *jecUnc = new JetCorrectionUncertainty(JetCorPar); |
104 |
|
|
105 |
< |
std::auto_ptr<VHbbEvent> hbbInfo( new VHbbEvent() ); |
105 |
> |
|
106 |
> |
|
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); |
86 |
– |
|
87 |
– |
int ntrigs = hltresults->size(); |
88 |
– |
if (ntrigs==0){std::cout << "%HLTInfo -- No trigger name given in TriggerResults of the input " << std::endl;} |
89 |
– |
|
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){(hbbInfo->triggerInfo.flag)[itrig] = 1;} |
96 |
– |
else { (hbbInfo->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)) hbbInfo->triggerInfo.triggerMu9=1; else hbbInfo->triggerInfo.triggerMu9=0; |
208 |
– |
if (itrig2!=-99 && hltresults->accept(itrig2)) hbbInfo->triggerInfo.triggerIsoMu9=1; else hbbInfo->triggerInfo.triggerIsoMu9=0; |
209 |
– |
if (itrig3!=-99 && hltresults->accept(itrig3)) hbbInfo->triggerInfo.triggerIsoMu13_3=1; else hbbInfo->triggerInfo.triggerIsoMu13_3=0; |
210 |
– |
if (itrig4!=-99 && hltresults->accept(itrig4)) hbbInfo->triggerInfo.triggerMu11=1; else hbbInfo->triggerInfo.triggerMu11=0; |
211 |
– |
if (itrig5!=-99 && hltresults->accept(itrig5)) hbbInfo->triggerInfo.triggerDoubleMu3=1; else hbbInfo->triggerInfo.triggerDoubleMu3=0; |
212 |
– |
if (itrig6!=-99 && hltresults->accept(itrig6)) hbbInfo->triggerInfo.triggerDoubleMu3_2=1; else hbbInfo->triggerInfo.triggerDoubleMu3_2=0; |
213 |
– |
if (itrig7!=-99 && hltresults->accept(itrig7)) hbbInfo->triggerInfo.triggerMu15=1; else hbbInfo->triggerInfo.triggerMu15=0; |
214 |
– |
if (itrig8!=-99 && hltresults->accept(itrig8)) hbbInfo->triggerInfo.triggerMu15_1=1; else hbbInfo->triggerInfo.triggerMu15_1=0; |
215 |
– |
|
216 |
– |
if (itrig9!=-99 && hltresults->accept(itrig9)) hbbInfo->triggerInfo.triggerDoubleElec10=1; else hbbInfo->triggerInfo.triggerDoubleElec10=0; |
217 |
– |
if (itrig10!=-99 && hltresults->accept(itrig10)) hbbInfo->triggerInfo.triggerDoubleElec15_1=1; else hbbInfo->triggerInfo.triggerDoubleElec15_1=0; |
218 |
– |
if (itrig11!=-99 && hltresults->accept(itrig11)) hbbInfo->triggerInfo.triggerDoubleElec17_1=1; else hbbInfo->triggerInfo.triggerDoubleElec17_1=0; |
219 |
– |
if (itrig12!=-99 && hltresults->accept(itrig12)) hbbInfo->triggerInfo.triggerMet100_1=1; else hbbInfo->triggerInfo.triggerMet100_1=0; |
220 |
– |
|
221 |
– |
if (itrig13!=-99 && hltresults->accept(itrig13)) hbbInfo->triggerInfo.triggerSingleEle1=1; else hbbInfo->triggerInfo.triggerSingleEle1=0; |
222 |
– |
if (itrig14!=-99 && hltresults->accept(itrig14)) hbbInfo->triggerInfo.triggerSingleEle2=1; else hbbInfo->triggerInfo.triggerSingleEle2=0; |
223 |
– |
if (itrig15!=-99 && hltresults->accept(itrig15)) hbbInfo->triggerInfo.triggerSingleEle3=1; else hbbInfo->triggerInfo.triggerSingleEle3=0; |
224 |
– |
if (itrig16!=-99 && hltresults->accept(itrig16)) hbbInfo->triggerInfo.triggerSingleEle4=1; else hbbInfo->triggerInfo.triggerSingleEle4=0; |
225 |
– |
|
226 |
– |
if (itrig17!=-99 && hltresults->accept(itrig17)) hbbInfo->triggerInfo.triggerBtagMu1=1; else hbbInfo->triggerInfo.triggerBtagMu1=0; |
227 |
– |
if (itrig18!=-99 && hltresults->accept(itrig18)) hbbInfo->triggerInfo.triggerBtagMu2=1; else hbbInfo->triggerInfo.triggerBtagMu2=0; |
228 |
– |
if (itrig19!=-99 && hltresults->accept(itrig19)) hbbInfo->triggerInfo.triggerBtagMu0=1; else hbbInfo->triggerInfo.triggerBtagMu0=0; |
229 |
– |
if (itrig20!=-99 && hltresults->accept(itrig20)) hbbInfo->triggerInfo.triggerBtagMu11=1; else hbbInfo->triggerInfo.triggerBtagMu11=0; |
230 |
– |
if (itrig21!=-99 && hltresults->accept(itrig21)) hbbInfo->triggerInfo.triggerBtagMuJet1=1; else hbbInfo->triggerInfo.triggerBtagMuJet1=0; |
231 |
– |
if (itrig22!=-99 && hltresults->accept(itrig22)) hbbInfo->triggerInfo.triggerBtagMuJet2=1; else hbbInfo->triggerInfo.triggerBtagMuJet2=0; |
232 |
– |
if (itrig23!=-99 && hltresults->accept(itrig23)) hbbInfo->triggerInfo.triggerBtagMuJet3=1; else hbbInfo->triggerInfo.triggerBtagMuJet3=0; |
233 |
– |
if (itrig231!=-99 && hltresults->accept(itrig231)) hbbInfo->triggerInfo.triggerBtagMuJet4=1; else hbbInfo->triggerInfo.triggerBtagMuJet4=0; |
234 |
– |
|
235 |
– |
if (itrig24!=-99 && hltresults->accept(itrig24)) hbbInfo->triggerInfo.triggerIsoMu15=1; else hbbInfo->triggerInfo.triggerIsoMu15=0; |
236 |
– |
if (itrig25!=-99 && hltresults->accept(itrig25)) hbbInfo->triggerInfo.triggerIsoMu17v5=1; else hbbInfo->triggerInfo.triggerIsoMu17v5=0; |
237 |
– |
if (itrig26!=-99 && hltresults->accept(itrig26)) hbbInfo->triggerInfo.triggerIsoMu17v6=1; else hbbInfo->triggerInfo.triggerIsoMu17v6=0; |
238 |
– |
|
239 |
– |
if (itrig1==-99) hbbInfo->triggerInfo.triggerMu9=-99; |
240 |
– |
if (itrig2==-99) hbbInfo->triggerInfo.triggerIsoMu9=-99; |
241 |
– |
if (itrig3==-99) hbbInfo->triggerInfo.triggerIsoMu13_3=-99; |
242 |
– |
if (itrig4==-99) hbbInfo->triggerInfo.triggerMu11=-99; |
243 |
– |
if (itrig5==-99) hbbInfo->triggerInfo.triggerDoubleMu3=-99; |
244 |
– |
if (itrig6==-99) hbbInfo->triggerInfo.triggerDoubleMu3_2=-99; |
245 |
– |
if (itrig7==-99) hbbInfo->triggerInfo.triggerMu15=-99; |
246 |
– |
if (itrig8==-99) hbbInfo->triggerInfo.triggerMu15_1=-99; |
247 |
– |
|
248 |
– |
if (itrig9==-99) hbbInfo->triggerInfo.triggerDoubleElec10=-99; |
249 |
– |
if (itrig10==-99) hbbInfo->triggerInfo.triggerDoubleElec15_1=-99; |
250 |
– |
if (itrig11==-99) hbbInfo->triggerInfo.triggerDoubleElec17_1=-99; |
251 |
– |
if (itrig12==-99) hbbInfo->triggerInfo.triggerMet100_1=-99; |
252 |
– |
|
253 |
– |
if (itrig13==-99) hbbInfo->triggerInfo.triggerSingleEle1=-99; |
254 |
– |
if (itrig14==-99) hbbInfo->triggerInfo.triggerSingleEle2=-99; |
255 |
– |
if (itrig15==-99) hbbInfo->triggerInfo.triggerSingleEle3=-99; |
256 |
– |
if (itrig16==-99) hbbInfo->triggerInfo.triggerSingleEle4=-99; |
257 |
– |
|
258 |
– |
if(itrig17==-99) hbbInfo->triggerInfo.triggerBtagMu1=-99; |
259 |
– |
if(itrig18==-99) hbbInfo->triggerInfo.triggerBtagMu2=-99; |
260 |
– |
if(itrig19==-99) hbbInfo->triggerInfo.triggerBtagMu0=-99; |
261 |
– |
if(itrig20==-99) hbbInfo->triggerInfo.triggerBtagMu11=-99; |
262 |
– |
if(itrig21==-99) hbbInfo->triggerInfo.triggerBtagMuJet1=-99; |
263 |
– |
if(itrig22==-99) hbbInfo->triggerInfo.triggerBtagMuJet2=-99; |
264 |
– |
if(itrig23==-99) hbbInfo->triggerInfo.triggerBtagMuJet3=-99; |
265 |
– |
if(itrig231==-99) hbbInfo->triggerInfo.triggerBtagMuJet4=-99; |
266 |
– |
|
267 |
– |
if(itrig24==-99) hbbInfo->triggerInfo.triggerIsoMu15=-99; |
268 |
– |
if(itrig25==-99) hbbInfo->triggerInfo.triggerIsoMu17v5=-99; |
269 |
– |
if(itrig26==-99) hbbInfo->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 |
– |
|
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") |
310 |
< |
hbbInfo->puInfo.rho = *rhoHandle; |
163 |
> |
iEvent.getByLabel(edm::InputTag("kt6PFJets", "rho"),rhoHandle); auxInfo->puInfo.rho = *rhoHandle; |
164 |
|
|
165 |
|
//// real start |
166 |
|
|
172 |
|
|
173 |
|
if(runOnMC_){ |
174 |
|
|
175 |
< |
int Hin=-99,Win=-99,Zin=-99,bin=-99,bbarin=-99; |
323 |
< |
|
324 |
< |
iEvent.getByLabel("genParticles", genParticles); |
175 |
> |
iEvent.getByLabel("genParticles", genParticles); |
176 |
|
|
177 |
|
for(size_t i = 0; i < genParticles->size(); ++ i) { |
178 |
+ |
|
179 |
|
const GenParticle & p = (*genParticles)[i]; |
180 |
|
int id = p.pdgId(); |
181 |
|
int st = p.status(); |
182 |
< |
|
182 |
> |
|
183 |
|
if(id==25){ |
184 |
< |
|
185 |
< |
/* int wh=0; |
186 |
< |
int nMoth = p.numberOfMothers(); |
187 |
< |
for(size_t jj = 0; jj < nMoth; ++ jj) { |
188 |
< |
const Candidate * mom = p.mother( jj ); |
189 |
< |
int nmomdau= mom->numberOfDaughters(); |
190 |
< |
for(size_t j = 0; j < nmomdau; ++ j) { |
191 |
< |
const Candidate * Wmomdau = mom->daughter( j ); |
340 |
< |
if(abs(Wmomdau->pdgId())==24) wh++; |
341 |
< |
} |
342 |
< |
} |
343 |
< |
|
344 |
< |
if(wh==0) continue; |
345 |
< |
*/ |
346 |
< |
Hin=i; |
347 |
< |
hbbInfo->mcH.status=st; |
348 |
< |
hbbInfo->mcH.charge=p.charge(); |
349 |
< |
if(p.mother(0)!=0) hbbInfo->mcH.momid=p.mother(0)->pdgId(); |
350 |
< |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) hbbInfo->mcH.gmomid=p.mother(0)->mother(0)->pdgId(); |
351 |
< |
hbbInfo->mcH.fourMomentum = GENPTOLOR(p); |
352 |
< |
|
184 |
> |
|
185 |
> |
VHbbEventAuxInfo::ParticleMCInfo htemp; |
186 |
> |
htemp.status=st; |
187 |
> |
htemp.charge=p.charge(); |
188 |
> |
if(p.mother(0)!=0) htemp.momid=p.mother(0)->pdgId(); |
189 |
> |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) htemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
190 |
> |
htemp.p4 = GENPTOLOR(p); |
191 |
> |
|
192 |
|
int ndau = p.numberOfDaughters(); |
193 |
|
for(int j = 0; j < ndau; ++ j) { |
194 |
|
const Candidate * Hdau = p.daughter( j ); |
195 |
< |
hbbInfo->mcH.dauid.push_back(Hdau->pdgId()); |
196 |
< |
hbbInfo->mcH.dauFourMomentum.push_back(GENPTOLORP(Hdau)); |
195 |
> |
htemp.dauid.push_back(Hdau->pdgId()); |
196 |
> |
htemp.dauFourMomentum.push_back(GENPTOLORP(Hdau)); |
197 |
|
} |
198 |
+ |
(auxInfo->mcH).push_back(htemp); |
199 |
|
} |
200 |
+ |
|
201 |
+ |
|
202 |
+ |
if(abs(id)==24){ |
203 |
|
|
204 |
+ |
VHbbEventAuxInfo::ParticleMCInfo wtemp; |
205 |
+ |
wtemp.status=st; |
206 |
+ |
wtemp.charge=p.charge(); |
207 |
+ |
if(p.mother(0)!=0) wtemp.momid=p.mother(0)->pdgId(); |
208 |
+ |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) wtemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
209 |
+ |
wtemp.p4=GENPTOLOR(p); |
210 |
|
|
362 |
– |
if(abs(id)==24){ |
363 |
– |
|
364 |
– |
Win=i; |
365 |
– |
hbbInfo->mcW.status=st; |
366 |
– |
hbbInfo->mcW.charge=p.charge(); |
367 |
– |
if(p.mother(0)!=0) hbbInfo->mcW.momid=p.mother(0)->pdgId(); |
368 |
– |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) hbbInfo->mcW.gmomid=p.mother(0)->mother(0)->pdgId(); |
369 |
– |
hbbInfo->mcW.fourMomentum=GENPTOLOR(p); |
370 |
– |
|
211 |
|
int ndau = p.numberOfDaughters(); |
212 |
|
for(int j = 0; j < ndau; ++ j) { |
213 |
|
const Candidate * Wdau = p.daughter( j ); |
214 |
< |
hbbInfo->mcW.dauid.push_back(Wdau->pdgId()); |
215 |
< |
hbbInfo->mcW.dauFourMomentum.push_back(GENPTOLORP(Wdau)); |
214 |
> |
wtemp.dauid.push_back(Wdau->pdgId()); |
215 |
> |
wtemp.dauFourMomentum.push_back(GENPTOLORP(Wdau)); |
216 |
|
} |
217 |
+ |
auxInfo->mcW.push_back(wtemp); |
218 |
|
} |
219 |
|
|
220 |
|
if(abs(id)==23){ |
221 |
|
|
222 |
< |
Zin=i; |
223 |
< |
hbbInfo->mcZ.status=st; |
224 |
< |
hbbInfo->mcZ.charge=p.charge(); |
225 |
< |
if(p.mother(0)!=0) hbbInfo->mcZ.momid=p.mother(0)->pdgId(); |
226 |
< |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) hbbInfo->mcZ.gmomid=p.mother(0)->mother(0)->pdgId(); |
227 |
< |
hbbInfo->mcZ.fourMomentum=GENPTOLOR(p); |
222 |
> |
|
223 |
> |
VHbbEventAuxInfo::ParticleMCInfo ztemp; |
224 |
> |
ztemp.status=st; |
225 |
> |
ztemp.charge=p.charge(); |
226 |
> |
if(p.mother(0)!=0) ztemp.momid=p.mother(0)->pdgId(); |
227 |
> |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) ztemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
228 |
> |
ztemp.p4=GENPTOLOR(p); |
229 |
|
|
230 |
|
int ndau = p.numberOfDaughters(); |
231 |
|
for(int j = 0; j < ndau; ++ j) { |
232 |
|
const Candidate * Zdau = p.daughter( j ); |
233 |
< |
hbbInfo->mcZ.dauid.push_back(Zdau->pdgId()); |
234 |
< |
hbbInfo->mcZ.dauFourMomentum.push_back(GENPTOLOR(p)); |
233 |
> |
ztemp.dauid.push_back(Zdau->pdgId()); |
234 |
> |
ztemp.dauFourMomentum.push_back(GENPTOLOR(p)); |
235 |
|
} |
236 |
+ |
auxInfo->mcZ.push_back(ztemp); |
237 |
|
} |
238 |
|
// |
239 |
|
// binfo |
240 |
|
// |
241 |
< |
|
241 |
> |
|
242 |
|
|
243 |
|
if(id==5){ |
244 |
< |
bin=i; |
245 |
< |
hbbInfo->mcB.status=st; |
246 |
< |
hbbInfo->mcB.charge=p.charge(); |
247 |
< |
if(p.mother(0)!=0) hbbInfo->mcB.momid=p.mother(0)->pdgId(); |
248 |
< |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) hbbInfo->mcB.gmomid=p.mother(0)->mother(0)->pdgId(); |
244 |
> |
|
245 |
> |
VHbbEventAuxInfo::ParticleMCInfo btemp; |
246 |
> |
btemp.status=st; |
247 |
> |
btemp.charge=p.charge(); |
248 |
> |
if(p.mother(0)!=0) btemp.momid=p.mother(0)->pdgId(); |
249 |
> |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) btemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
250 |
> |
|
251 |
> |
btemp.p4=GENPTOLOR(p); |
252 |
> |
|
253 |
> |
int nHDaubdau = p.numberOfDaughters(); |
254 |
> |
for(int j = 0; j < nHDaubdau; ++ j) { |
255 |
> |
const Candidate * Bdau = p.daughter( j ); |
256 |
> |
btemp.dauid.push_back(Bdau->pdgId()); |
257 |
> |
} |
258 |
> |
auxInfo->mcB.push_back(btemp); |
259 |
|
} |
260 |
|
|
261 |
|
if(id==-5){ |
409 |
– |
bbarin=i; |
410 |
– |
hbbInfo->mcBbar.status=st; |
411 |
– |
hbbInfo->mcBbar.charge=p.charge(); |
412 |
– |
if(p.mother(0)!=0) hbbInfo->mcBbar.momid=p.mother(0)->pdgId(); |
413 |
– |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) hbbInfo->mcBbar.gmomid=p.mother(0)->mother(0)->pdgId(); |
414 |
– |
} |
415 |
– |
|
416 |
– |
if(abs(id)==4){ |
417 |
– |
hbbInfo->mcC.status=st; |
418 |
– |
hbbInfo->mcC.charge=p.charge(); |
419 |
– |
if(p.mother(0)!=0) hbbInfo->mcC.momid=p.mother(0)->pdgId(); |
420 |
– |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) hbbInfo->mcC.gmomid=p.mother(0)->mother(0)->pdgId(); |
421 |
– |
} |
262 |
|
|
263 |
+ |
VHbbEventAuxInfo::ParticleMCInfo bbtemp; |
264 |
+ |
|
265 |
+ |
bbtemp.status=st; |
266 |
+ |
bbtemp.charge=p.charge(); |
267 |
+ |
if(p.mother(0)!=0) bbtemp.momid=p.mother(0)->pdgId(); |
268 |
+ |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) bbtemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
269 |
|
|
270 |
< |
} |
270 |
> |
bbtemp.p4=GENPTOLOR(p); |
271 |
> |
|
272 |
> |
int nHDaubdau = p.numberOfDaughters(); |
273 |
> |
for(int j = 0; j < nHDaubdau; ++ j) { |
274 |
> |
const Candidate * Bdau = p.daughter( j ); |
275 |
> |
bbtemp.dauid.push_back(Bdau->pdgId()); |
276 |
> |
} |
277 |
|
|
278 |
|
|
279 |
< |
if(bin!=-99 && bbarin!=-99){ |
280 |
< |
const Candidate & bGen = (*genParticles)[bin]; |
429 |
< |
const Candidate & bbarGen = (*genParticles)[bbarin]; |
430 |
< |
hbbInfo->mcB.fourMomentum=GENPTOLOR(bGen); |
431 |
< |
hbbInfo->mcBbar.fourMomentum=GENPTOLOR(bbarGen); |
279 |
> |
auxInfo->mcBbar.push_back(bbtemp); |
280 |
> |
} |
281 |
|
|
282 |
< |
int nHDaubdau = bGen.numberOfDaughters(); |
283 |
< |
for(int j = 0; j < nHDaubdau; ++ j) { |
284 |
< |
const Candidate * Bdau = bGen.daughter( j ); |
285 |
< |
hbbInfo->mcB.dauid.push_back(Bdau->pdgId()); |
286 |
< |
hbbInfo->mcB.dauFourMomentum.push_back(GENPTOLORP(Bdau)); |
287 |
< |
} |
439 |
< |
int nHDaubbardau = bbarGen.numberOfDaughters(); |
440 |
< |
for(int j = 0; j < nHDaubbardau; ++ j) { |
441 |
< |
const Candidate * Bbardau = bbarGen.daughter( j ); |
442 |
< |
hbbInfo->mcBbar.dauid.push_back(Bbardau->pdgId()); |
443 |
< |
hbbInfo->mcBbar.dauFourMomentum.push_back(GENPTOLORP(Bbardau)); |
444 |
< |
} |
282 |
> |
if(abs(id)==4){ |
283 |
> |
VHbbEventAuxInfo::ParticleMCInfo ctemp; |
284 |
> |
ctemp.status=st; |
285 |
> |
ctemp.charge=p.charge(); |
286 |
> |
if(p.mother(0)!=0) ctemp.momid=p.mother(0)->pdgId(); |
287 |
> |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) ctemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
288 |
|
|
289 |
< |
|
289 |
> |
ctemp.p4=GENPTOLOR(p); |
290 |
> |
|
291 |
> |
int nHDaubdau = p.numberOfDaughters(); |
292 |
> |
for(int j = 0; j < nHDaubdau; ++ j) { |
293 |
> |
const Candidate * Bdau = p.daughter( j ); |
294 |
> |
ctemp.dauid.push_back(Bdau->pdgId()); |
295 |
> |
} |
296 |
|
|
297 |
< |
} |
297 |
> |
auxInfo->mcC.push_back(ctemp); |
298 |
> |
|
299 |
> |
} |
300 |
|
|
301 |
+ |
} |
302 |
|
|
303 |
|
} // isMC |
304 |
|
|
342 |
|
iEvent.getByLabel(eleLabel_,electronHandle); |
343 |
|
edm::View<pat::Electron> electrons = *electronHandle; |
344 |
|
|
493 |
– |
edm::Handle<edm::View<pat::MET> > metHandle; |
494 |
– |
iEvent.getByLabel(metLabel_,metHandle); |
495 |
– |
edm::View<pat::MET> mets = *metHandle; |
345 |
|
|
346 |
|
// edm::Handle<edm::View<pat::Photon> > phoHandle; |
347 |
|
// iEvent.getByLabel(phoLabel_,phoHandle); |
357 |
|
edm::Handle<CandidateView> dielectrons; |
358 |
|
iEvent.getByLabel(dielecLabel_,dielectrons); |
359 |
|
|
360 |
+ |
//BTAGGING SCALE FACTOR FROM DATABASE |
361 |
+ |
//Combined Secondary Vertex Loose |
362 |
+ |
edm::ESHandle<BtagPerformance> bTagSF_CSVL_; |
363 |
+ |
iSetup.get<BTagPerformanceRecord>().get("BTAGCSVL",bTagSF_CSVL_); |
364 |
+ |
const BtagPerformance & bTagSF_CSVL = *(bTagSF_CSVL_.product()); |
365 |
+ |
//Combined Secondary Vertex Medium |
366 |
+ |
edm::ESHandle<BtagPerformance> bTagSF_CSVM_; |
367 |
+ |
iSetup.get<BTagPerformanceRecord>().get("BTAGCSVM",bTagSF_CSVM_); |
368 |
+ |
const BtagPerformance & bTagSF_CSVM = *(bTagSF_CSVM_.product()); |
369 |
+ |
//Combined Secondary Vertex Tight |
370 |
+ |
edm::ESHandle<BtagPerformance> bTagSF_CSVT_; |
371 |
+ |
iSetup.get<BTagPerformanceRecord>().get("BTAGCSVT",bTagSF_CSVT_); |
372 |
+ |
const BtagPerformance & bTagSF_CSVT = *(bTagSF_CSVT_.product()); |
373 |
+ |
|
374 |
+ |
edm::ESHandle<BtagPerformance> mistagSF_CSVL_; |
375 |
+ |
iSetup.get<BTagPerformanceRecord>().get("MISTAGCSVL",mistagSF_CSVL_); |
376 |
+ |
const BtagPerformance & mistagSF_CSVL = *(mistagSF_CSVL_.product()); |
377 |
+ |
//Combined Secondary Vertex Medium |
378 |
+ |
edm::ESHandle<BtagPerformance> mistagSF_CSVM_; |
379 |
+ |
iSetup.get<BTagPerformanceRecord>().get("MISTAGCSVM",mistagSF_CSVM_); |
380 |
+ |
const BtagPerformance & mistagSF_CSVM = *(mistagSF_CSVM_.product()); |
381 |
+ |
//Combined Secondary Vertex Tight |
382 |
+ |
edm::ESHandle<BtagPerformance> mistagSF_CSVT_; |
383 |
+ |
iSetup.get<BTagPerformanceRecord>().get("MISTAGCSVT",mistagSF_CSVT_); |
384 |
+ |
const BtagPerformance & mistagSF_CSVT = *(mistagSF_CSVT_.product()); |
385 |
+ |
|
386 |
+ |
BTagSFContainer btagSFs; |
387 |
+ |
btagSFs.BTAGSF_CSVL = (bTagSF_CSVL_.product()); |
388 |
+ |
btagSFs.BTAGSF_CSVM = (bTagSF_CSVM_.product()); |
389 |
+ |
btagSFs.BTAGSF_CSVT = (bTagSF_CSVT_.product()); |
390 |
+ |
btagSFs.MISTAGSF_CSVL = (mistagSF_CSVL_.product()); |
391 |
+ |
btagSFs.MISTAGSF_CSVM = (mistagSF_CSVM_.product()); |
392 |
+ |
btagSFs.MISTAGSF_CSVT = (mistagSF_CSVT_.product()); |
393 |
|
|
394 |
|
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets1.begin(); jet_iter!=simplejets1.end(); ++jet_iter){ |
395 |
|
// if(jet_iter->pt()>50) |
396 |
|
// njetscounter++; |
397 |
|
VHbbEvent::SimpleJet sj; |
398 |
< |
sj.flavour = jet_iter->partonFlavour(); |
399 |
< |
|
398 |
> |
fillSimpleJet(sj,jet_iter); |
399 |
> |
if(runOnMC_) setJecUnc(sj,jecUnc); |
400 |
> |
/* sj.flavour = jet_iter->partonFlavour(); |
401 |
|
|
402 |
|
sj.tche=jet_iter->bDiscriminator("trackCountingHighEffBJetTags"); |
403 |
|
sj.tchp=jet_iter->bDiscriminator("trackCountingHighPurBJetTags"); |
408 |
|
sj.csvmva=jet_iter->bDiscriminator("combinedSecondaryVertexMVABJetTags"); |
409 |
|
sj.charge=jet_iter->jetCharge(); |
410 |
|
sj.ntracks=jet_iter->associatedTracks().size(); |
411 |
< |
sj.fourMomentum=GENPTOLORP(jet_iter); |
411 |
> |
sj.p4=GENPTOLORP(jet_iter); |
412 |
> |
sj.chargedTracksFourMomentum=(getChargedTracksMomentum(&*(jet_iter))); |
413 |
> |
sj.SF_CSVL=1; |
414 |
> |
sj.SF_CSVM=1; |
415 |
> |
sj.SF_CSVT=1; |
416 |
> |
sj.SF_CSVLerr=0; |
417 |
> |
sj.SF_CSVMerr=0; |
418 |
> |
sj.SF_CSVTerr=0; |
419 |
> |
|
420 |
> |
|
421 |
> |
|
422 |
> |
sj.chargedHadronEFraction = jet_iter-> chargedHadronEnergyFraction(); |
423 |
> |
|
424 |
> |
|
425 |
> |
// |
426 |
> |
// addtaginfo for csv |
427 |
> |
// |
428 |
> |
|
429 |
> |
if (jet_iter->hasTagInfo("SimpleSecondaryVertex")) { |
430 |
> |
|
431 |
> |
const reco::SecondaryVertexTagInfo * tf = jet_iter->tagInfoSecondaryVertex(); |
432 |
> |
sj.vtxMass = tf->secondaryVertex(0).p4().mass(); |
433 |
> |
sj.vtxNTracks = tf->secondaryVertex(0).nTracks(); |
434 |
> |
Measurement1D m = tf->flightDistance(0); |
435 |
> |
sj.vtx3dL = m.value(); |
436 |
> |
sj.vtx3deL = m.error(); |
437 |
> |
} |
438 |
> |
|
439 |
> |
|
440 |
> |
// |
441 |
> |
// add tVector |
442 |
> |
// |
443 |
> |
sj.tVector = getTvect(&(*jet_iter)); |
444 |
> |
|
445 |
> |
*/ |
446 |
|
|
447 |
|
Particle::LorentzVector p4Jet = jet_iter->p4(); |
448 |
|
|
449 |
|
if(runOnMC_){ |
450 |
< |
double minb1DR=9999.; |
451 |
< |
for(size_t i = 0; i < genParticles->size(); ++ i) { |
452 |
< |
const GenParticle & p = (*genParticles)[i]; |
453 |
< |
int id = p.pdgId(); |
454 |
< |
if(abs(id)<=6 || id==21 || id==23 || abs(id)==24){ |
455 |
< |
double bb1DR=TMath::Sqrt((p.eta()-p4Jet.eta())*(p.eta()-p4Jet.eta())+ |
456 |
< |
(p.phi()-p4Jet.phi())*(p.phi()-p4Jet.phi())); |
457 |
< |
if(bb1DR<minb1DR) {minb1DR=bb1DR; sj.b1BestMCid=id; if(p.mother()!=0) sj.b1BestMCmomid=p.mother()->pdgId();} |
450 |
> |
|
451 |
> |
fillScaleFactors(sj, btagSFs); |
452 |
> |
|
453 |
> |
//PAT genJet matching |
454 |
> |
//genJet |
455 |
> |
const reco::GenJet *gJ = jet_iter->genJet(); |
456 |
> |
//physical parton for mother info ONLY |
457 |
> |
if( (jet_iter->genParton()) |
458 |
> |
and (jet_iter->genParton()->mother()) ) |
459 |
> |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
460 |
> |
TLorentzVector gJp4; |
461 |
> |
if(gJ){ |
462 |
> |
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
463 |
> |
sj. bestMCp4mom = gJp4; |
464 |
> |
if(verbose_){ |
465 |
> |
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
466 |
> |
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
467 |
> |
std::clog << "genJet matched deltaR = " <<gJp4.DeltaR(sj.p4) << std::endl; |
468 |
> |
std::clog << "genJet matched mother id = " << sj.bestMCmomid << std::endl; |
469 |
|
} |
470 |
|
} |
471 |
< |
} //isMC |
471 |
> |
|
472 |
> |
} //isMC |
473 |
|
hbbInfo->simpleJets.push_back(sj); |
474 |
|
|
475 |
|
} |
478 |
|
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets2.begin(); jet_iter!=simplejets2.end(); ++jet_iter){ |
479 |
|
|
480 |
|
VHbbEvent::SimpleJet sj; |
481 |
< |
sj.flavour = jet_iter->partonFlavour(); |
481 |
> |
fillSimpleJet(sj,jet_iter); |
482 |
> |
if(runOnMC_) setJecUnc(sj,jecUnc); |
483 |
> |
/* sj.flavour = jet_iter->partonFlavour(); |
484 |
|
|
485 |
|
|
486 |
|
sj.tche=jet_iter->bDiscriminator("trackCountingHighEffBJetTags"); |
492 |
|
sj.csvmva=jet_iter->bDiscriminator("combinedSecondaryVertexMVABJetTags"); |
493 |
|
sj.charge=jet_iter->jetCharge(); |
494 |
|
sj.ntracks=jet_iter->associatedTracks().size(); |
495 |
< |
sj.fourMomentum=GENPTOLORP(jet_iter); |
495 |
> |
sj.p4=GENPTOLORP(jet_iter); |
496 |
> |
sj.chargedTracksFourMomentum=(getChargedTracksMomentum(&*(jet_iter))); |
497 |
> |
sj.SF_CSVL=1; |
498 |
> |
sj.SF_CSVM=1; |
499 |
> |
sj.SF_CSVT=1; |
500 |
> |
sj.SF_CSVLerr=0; |
501 |
> |
sj.SF_CSVMerr=0; |
502 |
> |
sj.SF_CSVTerr=0; |
503 |
> |
|
504 |
> |
// |
505 |
> |
// addtaginfo for csv |
506 |
> |
// |
507 |
> |
|
508 |
> |
if (jet_iter->hasTagInfo("SimpleSecondaryVertex")) { |
509 |
> |
|
510 |
> |
const reco::SecondaryVertexTagInfo * tf = jet_iter->tagInfoSecondaryVertex(); |
511 |
> |
sj.vtxMass = tf->secondaryVertex(0).p4().mass(); |
512 |
> |
sj.vtxNTracks = tf->secondaryVertex(0).nTracks(); |
513 |
> |
Measurement1D m = tf->flightDistance(0); |
514 |
> |
sj.vtx3dL = m.value(); |
515 |
> |
sj.vtx3deL = m.error(); |
516 |
> |
} |
517 |
|
|
518 |
+ |
|
519 |
+ |
// |
520 |
+ |
// add tVector |
521 |
+ |
// |
522 |
+ |
sj.tVector = getTvect(&(*jet_iter)); |
523 |
+ |
*/ |
524 |
|
Particle::LorentzVector p4Jet = jet_iter->p4(); |
525 |
|
|
526 |
+ |
|
527 |
|
if(runOnMC_){ |
528 |
< |
double minb2DR=9999.; |
529 |
< |
for(size_t i = 0; i < genParticles->size(); ++ i) { |
530 |
< |
const GenParticle & p = (*genParticles)[i]; |
531 |
< |
int id = p.pdgId(); |
532 |
< |
if(abs(id)<=6 || id==21 || id==23 || abs(id)==24){ |
533 |
< |
double bb2DR=TMath::Sqrt((p.eta()-p4Jet.eta())*(p.eta()-p4Jet.eta())+ |
534 |
< |
(p.phi()-p4Jet.phi())*(p.phi()-p4Jet.phi())); |
535 |
< |
if(bb2DR<minb2DR) {minb2DR=bb2DR; sj.b1BestMCid=id; if(p.mother()!=0) sj.b1BestMCmomid=p.mother()->pdgId();} |
528 |
> |
|
529 |
> |
//BTV scale factors |
530 |
> |
fillScaleFactors(sj, btagSFs); |
531 |
> |
|
532 |
> |
//PAT genJet matching |
533 |
> |
//genJet |
534 |
> |
const reco::GenJet *gJ = jet_iter->genJet(); |
535 |
> |
//physical parton for mother info ONLY |
536 |
> |
if( (jet_iter->genParton()) |
537 |
> |
and (jet_iter->genParton()->mother()) ) |
538 |
> |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
539 |
> |
TLorentzVector gJp4; |
540 |
> |
if(gJ){ |
541 |
> |
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
542 |
> |
sj. bestMCp4mom = gJp4; |
543 |
> |
if(verbose_){ |
544 |
> |
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
545 |
> |
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
546 |
> |
std::clog << "genJet matched deltaR = " << gJp4.DeltaR(sj.p4) << std::endl; |
547 |
> |
std::clog << "genJet matched mother id = " << sj.bestMCmomid << std::endl; |
548 |
|
} |
549 |
|
} |
550 |
+ |
|
551 |
|
} //isMC |
552 |
|
|
553 |
|
hbbInfo->simpleJets2.push_back(sj); |
585 |
|
// if(printJet) {std::cout << "NsubJets: " << constituents.size() << "\n";} |
586 |
|
VHbbEvent::HardJet hj; |
587 |
|
hj.constituents=constituents.size(); |
588 |
< |
hj.fourMomentum =GENPTOLORP(jet_iter); |
589 |
< |
|
588 |
> |
hj.p4 =GENPTOLORP(jet_iter); |
589 |
> |
|
590 |
|
for (unsigned int iJC(0); iJC<constituents.size(); ++iJC ){ |
591 |
|
Jet::Constituent icandJet = constituents[iJC]; |
592 |
|
|
597 |
|
hj.subFourMomentum.push_back(GENPTOLORP(icandJet)); |
598 |
|
hj.etaSub.push_back(icandJet->eta()); |
599 |
|
hj.phiSub.push_back(icandJet->phi()); |
628 |
– |
|
600 |
|
|
601 |
|
} |
602 |
|
hbbInfo->hardJets.push_back(hj); |
619 |
|
<< "," << subjet_iter->bDiscriminator("combinedSecondaryVertexBJetTags") << "\n";} |
620 |
|
|
621 |
|
VHbbEvent::SimpleJet sj; |
622 |
< |
|
623 |
< |
sj.flavour = subjet_iter->partonFlavour(); |
624 |
< |
|
622 |
> |
fillSimpleJet(sj,subjet_iter); |
623 |
> |
if(runOnMC_) setJecUnc(sj,jecUnc); |
624 |
> |
/* sj.flavour = subjet_iter->partonFlavour(); |
625 |
> |
sj.tVector = getTvect(&(*subjet_iter)); |
626 |
|
sj.tche=subjet_iter->bDiscriminator("trackCountingHighEffBJetTags"); |
627 |
|
sj.tchp=subjet_iter->bDiscriminator("trackCountingHighPurBJetTags"); |
628 |
|
sj.jp=subjet_iter->bDiscriminator("jetProbabilityBJetTags"); |
632 |
|
sj.csvmva=subjet_iter->bDiscriminator("combinedSecondaryVertexMVABJetTags"); |
633 |
|
sj.charge=subjet_iter->jetCharge(); |
634 |
|
sj.ntracks=subjet_iter->associatedTracks().size(); |
635 |
< |
sj.fourMomentum=GENPTOLORP(subjet_iter); |
635 |
> |
sj.p4=GENPTOLORP(subjet_iter); |
636 |
> |
sj.p4=(getChargedTracksMomentum(&*(subjet_iter))); |
637 |
|
|
638 |
+ |
// |
639 |
+ |
// addtaginfo for csv |
640 |
+ |
// |
641 |
+ |
|
642 |
+ |
if (subjet_iter->hasTagInfo("SimpleSecondaryVertex")) { |
643 |
+ |
|
644 |
+ |
const reco::SecondaryVertexTagInfo * tf = subjet_iter->tagInfoSecondaryVertex(); |
645 |
+ |
sj.vtxMass = tf->secondaryVertex(0).p4().mass(); |
646 |
+ |
sj.vtxNTracks = tf->secondaryVertex(0).nTracks(); |
647 |
+ |
Measurement1D m = tf->flightDistance(0); |
648 |
+ |
sj.vtx3dL = m.value(); |
649 |
+ |
sj.vtx3deL = m.error(); |
650 |
+ |
} |
651 |
+ |
*/ |
652 |
|
hbbInfo->subJets.push_back(sj); |
653 |
|
|
654 |
|
} |
658 |
|
// met is calomet |
659 |
|
// |
660 |
|
|
674 |
– |
|
675 |
– |
for(edm::View<pat::MET>::const_iterator met = mets.begin(); met!=mets.end(); ++met){ |
676 |
– |
hbbInfo->calomet.sumEt=met->sumEt(); |
677 |
– |
hbbInfo->calomet.metSig=met->mEtSig(); |
678 |
– |
hbbInfo->calomet.eLong=met->e_longitudinal(); |
679 |
– |
hbbInfo->calomet.fourMomentum=GENPTOLORP(met); |
680 |
– |
} |
681 |
– |
|
661 |
|
edm::Handle<edm::View<pat::MET> > metTCHandle; |
662 |
|
iEvent.getByLabel("patMETsTC",metTCHandle); |
663 |
|
edm::View<pat::MET> metsTC = *metTCHandle; |
664 |
< |
for(edm::View<pat::MET>::const_iterator metTC = metsTC.begin(); metTC!=metsTC.end(); ++metTC){ |
665 |
< |
hbbInfo->calomet.sumEt=metTC->sumEt(); |
666 |
< |
hbbInfo->calomet.metSig=metTC->mEtSig(); |
667 |
< |
hbbInfo->calomet.eLong=metTC->e_longitudinal(); |
668 |
< |
hbbInfo->calomet.fourMomentum=GENPTOLORP(metTC); |
664 |
> |
if(metsTC.size()){ |
665 |
> |
hbbInfo->tcmet.sumEt=(metsTC[0]).sumEt(); |
666 |
> |
hbbInfo->tcmet.metSig=(metsTC[0]).mEtSig(); |
667 |
> |
hbbInfo->tcmet.eLong=(metsTC[0]).e_longitudinal(); |
668 |
> |
hbbInfo->tcmet.p4=GENPTOLOR((metsTC[0])); |
669 |
> |
if (verbose_) std::cout <<" METTC "<< hbbInfo->tcmet.metSig <<" " << hbbInfo->tcmet.sumEt<<std::endl; |
670 |
|
} |
671 |
+ |
|
672 |
+ |
|
673 |
+ |
edm::Handle<edm::View<reco::MET> > mHTHandle; |
674 |
+ |
iEvent.getByLabel("patMETsHT",mHTHandle); |
675 |
+ |
edm::View<reco::MET> metsHT = *mHTHandle; |
676 |
+ |
if(metsHT.size()){ |
677 |
+ |
hbbInfo->mht.sumEt=(metsHT[0]).sumEt(); |
678 |
+ |
hbbInfo->mht.metSig=(metsHT[0]).mEtSig(); |
679 |
+ |
hbbInfo->mht.eLong=(metsHT[0]).e_longitudinal(); |
680 |
+ |
hbbInfo->mht.p4=GENPTOLOR((metsHT[0])); |
681 |
+ |
if (verbose_) std::cout <<" METHT "<< hbbInfo->mht.metSig <<" " << hbbInfo->mht.sumEt<<std::endl; |
682 |
+ |
} |
683 |
+ |
|
684 |
+ |
edm::Handle<edm::View<pat::MET> > metHandle; |
685 |
+ |
iEvent.getByLabel(metLabel_,metHandle); |
686 |
+ |
edm::View<pat::MET> mets = *metHandle; |
687 |
+ |
|
688 |
+ |
if(mets.size()){ |
689 |
+ |
hbbInfo->calomet.sumEt=(mets[0]).sumEt(); |
690 |
+ |
hbbInfo->calomet.metSig=(mets[0]).mEtSig(); |
691 |
+ |
hbbInfo->calomet.eLong=(mets[0]).e_longitudinal(); |
692 |
+ |
hbbInfo->calomet.p4=GENPTOLOR((mets[0])); |
693 |
+ |
if (verbose_) std::cout <<" METCALO "<< hbbInfo->calomet.metSig <<" " << hbbInfo->calomet.sumEt<<std::endl; |
694 |
+ |
} |
695 |
+ |
|
696 |
|
edm::Handle<edm::View<pat::MET> > metPFHandle; |
697 |
|
iEvent.getByLabel("patMETsPF",metPFHandle); |
698 |
|
edm::View<pat::MET> metsPF = *metPFHandle; |
699 |
< |
for(edm::View<pat::MET>::const_iterator metPF = metsPF.begin(); metPF!=metsPF.end(); ++metPF){ |
700 |
< |
hbbInfo->calomet.sumEt=metPF->sumEt(); |
701 |
< |
hbbInfo->calomet.metSig=metPF->mEtSig(); |
702 |
< |
hbbInfo->calomet.eLong=metPF->e_longitudinal(); |
703 |
< |
hbbInfo->calomet.fourMomentum=GENPTOLORP(metPF); |
699 |
> |
|
700 |
> |
if(metsPF.size()){ |
701 |
> |
hbbInfo->pfmet.sumEt=(metsPF[0]).sumEt(); |
702 |
> |
hbbInfo->pfmet.metSig=(metsPF[0]).mEtSig(); |
703 |
> |
hbbInfo->pfmet.eLong=(metsPF[0]).e_longitudinal(); |
704 |
> |
hbbInfo->pfmet.p4=GENPTOLOR((metsPF[0])); |
705 |
> |
if (verbose_) std::cout <<" METPF "<< hbbInfo->pfmet.metSig <<" " << hbbInfo->pfmet.sumEt<<std::endl; |
706 |
> |
} |
707 |
> |
|
708 |
> |
|
709 |
> |
if(verbose_){ |
710 |
> |
std::cout << "METs: calomet "<<mets.size()<<" tcmet"<<metsTC.size()<<" pfmet "<<metsPF.size()<<" MHT" <<metsHT.size()<<std::endl; |
711 |
|
} |
712 |
|
|
713 |
< |
|
713 |
> |
if(verbose_) |
714 |
> |
std::cout << " INPUT MUONS "<<muons.size()<<std::endl; |
715 |
|
|
716 |
|
for(edm::View<pat::Muon>::const_iterator mu = muons.begin(); mu!=muons.end(); ++mu){ |
717 |
|
VHbbEvent::MuonInfo mf; |
718 |
< |
mf.fourMomentum =GENPTOLORP( mu); |
718 |
> |
mf.p4 =GENPTOLORP( mu); |
719 |
|
mf.charge=mu->charge(); |
720 |
|
mf.tIso=mu->trackIso(); |
721 |
|
mf.eIso=mu->ecalIso(); |
722 |
|
mf.hIso=mu->hcalIso(); |
723 |
< |
Geom::Phi<double> deltaphi(mu->phi()-atan2(mf.fourMomentum.Px(), mf.fourMomentum.Py())); |
723 |
> |
mf.pfChaIso=mu->chargedHadronIso(); |
724 |
> |
mf.pfPhoIso=mu->photonIso(); |
725 |
> |
mf.pfNeuIso=mu->neutralHadronIso(); |
726 |
> |
Geom::Phi<double> deltaphi(mu->phi()-atan2(mf.p4.Px(), mf.p4.Py())); |
727 |
|
double acop = deltaphi.value(); |
728 |
|
mf.acop=acop; |
729 |
|
|
730 |
|
mf.ipDb=mu->dB(); |
731 |
|
mf.ipErrDb=mu->edB(); |
732 |
< |
if(mu->isGlobalMuon()) mf.cat=1; |
733 |
< |
else if(mu->isTrackerMuon()) mf.cat=2; |
734 |
< |
else mf.cat=3; |
732 |
> |
mf.cat=0; |
733 |
> |
if(mu->isGlobalMuon()) mf.cat|=1; |
734 |
> |
if(mu->isTrackerMuon()) mf.cat|=2; |
735 |
> |
if(mu->isStandAloneMuon()) mf.cat|=4; |
736 |
|
TrackRef trkMu1Ref = mu->get<TrackRef>(); |
737 |
|
if(trkMu1Ref.isNonnull()){ |
738 |
|
const Track* MuTrk1 = mu->get<TrackRef>().get(); |
749 |
|
const reco::HitPattern& q = gTrack->hitPattern(); |
750 |
|
mf.globChi2=gTrack.get()->normalizedChi2(); |
751 |
|
mf.globNHits=q.numberOfValidMuonHits(); |
752 |
+ |
mf. validMuStations = q. muonStationsWithValidHits(); |
753 |
|
}else{ |
754 |
|
mf.globChi2=-99; |
755 |
|
mf.globNHits=-99; |
756 |
|
} |
757 |
|
|
758 |
+ |
//Muon trigger matching |
759 |
+ |
for (int itrig = 0; itrig != ntrigs; ++itrig){ |
760 |
+ |
std::string trigName=triggerNames_.triggerName(itrig); |
761 |
+ |
if( (mu->triggerObjectMatchesByPath(trigName,false,false).size() != 0) ){ |
762 |
+ |
mf.hltMatchedBits.push_back(itrig); |
763 |
+ |
if(verbose_){ |
764 |
+ |
std::clog << "Trigger Matching box" << std::endl; |
765 |
+ |
std::clog << "+++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; |
766 |
+ |
std::clog << "Matching parameters are defined in the cfg" << std::endl; |
767 |
+ |
std::clog << "Trigger bit = " << itrig << std::endl; |
768 |
+ |
std::clog << "Trigger name = " << trigName << std::endl; |
769 |
+ |
std::clog << "Trigger object matched collection size = " << mu->triggerObjectMatchesByPath(trigName,false,false).size() << std::endl; |
770 |
+ |
std::clog << "Pat Muon pt = " << mf.p4.Pt() << " HLT object matched = " << mu->triggerObjectMatch(0)->p4().Pt() << std::endl; |
771 |
+ |
std::clog << "+++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; |
772 |
+ |
} |
773 |
+ |
} |
774 |
+ |
} |
775 |
+ |
// |
776 |
+ |
|
777 |
+ |
// add stamuon |
778 |
+ |
|
779 |
+ |
// if (mu->isStandAloneMuon()) { |
780 |
+ |
// reco::TrackRef sta = mu->standAloneMuon(); |
781 |
+ |
// |
782 |
+ |
// } |
783 |
+ |
|
784 |
+ |
|
785 |
|
// int muInfo[12]; |
786 |
|
// fillMuBlock(mu, muInfo); |
787 |
|
if(runOnMC_){ |
795 |
|
hbbInfo->muInfo.push_back(mf); |
796 |
|
} |
797 |
|
|
798 |
< |
|
798 |
> |
if(verbose_) |
799 |
> |
std::cout << " INPUT electrons "<<electrons.size()<<std::endl; |
800 |
|
for(edm::View<pat::Electron>::const_iterator elec = electrons.begin(); elec!=electrons.end(); ++elec){ |
801 |
|
VHbbEvent::ElectronInfo ef; |
802 |
< |
ef.fourMomentum=GENPTOLORP(elec); |
802 |
> |
ef.p4=GENPTOLORP(elec); |
803 |
|
ef.scEta =elec->superCluster()->eta(); |
804 |
|
ef.scPhi =elec->superCluster()->phi(); |
805 |
|
// if(ElecEta[eleccont]!=0) ElecEt[eleccont]=elec->superCluster()->energy()/cosh(elec->superCluster()->eta()); |
807 |
|
ef.tIso=elec->trackIso(); |
808 |
|
ef.eIso=elec->ecalIso(); |
809 |
|
ef.hIso=elec->hcalIso(); |
810 |
< |
Geom::Phi<double> deltaphi(elec->superCluster()->phi()-atan2(hbbInfo->calomet.fourMomentum.Py(),hbbInfo->calomet.fourMomentum.Px())); |
810 |
> |
ef.pfChaIso=elec->chargedHadronIso(); |
811 |
> |
ef.pfPhoIso=elec->photonIso(); |
812 |
> |
ef.pfNeuIso=elec->neutralHadronIso(); |
813 |
> |
|
814 |
> |
Geom::Phi<double> deltaphi(elec->superCluster()->phi()-atan2(hbbInfo->calomet.p4.Py(),hbbInfo->calomet.p4.Px())); |
815 |
|
ef.acop = deltaphi.value(); |
816 |
< |
|
816 |
> |
// |
817 |
> |
// fill eleids |
818 |
> |
// |
819 |
> |
/* ef.id95 = elec->electronID("simpleEleId95cIso"); |
820 |
> |
ef.id85 = elec->electronID("simpleEleId85cIso"); |
821 |
> |
ef.id70 = elec->electronID("simpleEleId70cIso"); |
822 |
> |
ef.id95r = elec->electronID("simpleEleId95relIso"); |
823 |
> |
ef.id70r = elec->electronID("simpleEleId70relIso"); |
824 |
> |
ef.id85r = elec->electronID("simpleEleId85relIso"); |
825 |
> |
*/ |
826 |
> |
ef.id95 =elec->electronID("eidVBTFCom95"); |
827 |
> |
ef.id95r=elec->electronID("eidVBTFRel95"); |
828 |
> |
ef.id85 =elec->electronID("eidVBTFCom85"); |
829 |
> |
ef.id85r=elec->electronID("eidVBTFRel85"); |
830 |
> |
ef.id80 =elec->electronID("eidVBTFCom80"); |
831 |
> |
ef.id80r=elec->electronID("eidVBTFRel80"); |
832 |
> |
ef.id70 =elec->electronID("eidVBTFCom70"); |
833 |
> |
ef.id70r=elec->electronID("eidVBTFRel70"); |
834 |
> |
|
835 |
> |
//Electron trigger matching |
836 |
> |
for (int itrig = 0; itrig != ntrigs; ++itrig){ |
837 |
> |
std::string trigName=triggerNames_.triggerName(itrig); |
838 |
> |
if( (elec->triggerObjectMatchesByPath(trigName).size() != 0) ){ |
839 |
> |
ef.hltMatchedBits.push_back(itrig); |
840 |
> |
if(verbose_){ |
841 |
> |
std::clog << "Trigger Matching box" << std::endl; |
842 |
> |
std::clog << "+++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; |
843 |
> |
std::clog << "Matching parameters are defined in the cfg" << std::endl; |
844 |
> |
std::clog << "Trigger bit = " << itrig << std::endl; |
845 |
> |
std::clog << "Trigger name = " << trigName << std::endl; |
846 |
> |
std::clog << "Trigger object matched collection size = " << elec->triggerObjectMatchesByPath(trigName).size() << std::endl; |
847 |
> |
std::clog << "Pat Electron pt = " << ef.p4.Pt() << " HLT object matched = " << elec->triggerObjectMatch(0)->p4().Pt() << std::endl; |
848 |
> |
std::clog << "+++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; |
849 |
> |
} |
850 |
> |
} |
851 |
> |
} |
852 |
> |
|
853 |
|
if(runOnMC_){ |
854 |
|
const GenParticle* elecMc = elec->genLepton(); |
855 |
|
if(elecMc!=0){ |
861 |
|
hbbInfo->eleInfo.push_back(ef); |
862 |
|
} |
863 |
|
|
864 |
+ |
if(verbose_) |
865 |
+ |
std::cout << " INPUT taus "<<taus.size()<<std::endl; |
866 |
|
for(edm::View<pat::Tau>::const_iterator tau = taus.begin(); tau!=taus.end(); ++tau){ |
867 |
|
VHbbEvent::TauInfo tf; |
868 |
< |
tf.fourMomentum=GENPTOLORP(tau); |
868 |
> |
tf.p4=GENPTOLORP(tau); |
869 |
|
tf.charge=tau->charge(); |
870 |
|
tf.tIso=tau->trackIso(); |
871 |
|
tf.eIso=tau->ecalIso(); |
872 |
|
tf.hIso=tau->hcalIso(); |
873 |
< |
Geom::Phi<double> deltaphi(tau->phi()-atan2(hbbInfo->calomet.fourMomentum.Py(),hbbInfo->calomet.fourMomentum.Px())); |
873 |
> |
Geom::Phi<double> deltaphi(tau->phi()-atan2(hbbInfo->calomet.p4.Py(),hbbInfo->calomet.p4.Px())); |
874 |
|
double acop = deltaphi.value(); |
875 |
|
tf.acop=acop; |
876 |
|
tf.idbyIso=tau->tauID("byIsolation"); |
883 |
|
hbbInfo->tauInfo.push_back(tf); |
884 |
|
} |
885 |
|
|
886 |
+ |
CompareJetPtMuons ptComparatorMu; |
887 |
+ |
CompareJetPtElectrons ptComparatorE; |
888 |
+ |
CompareJetPtTaus ptComparatorTau; |
889 |
+ |
|
890 |
+ |
std::sort(hbbInfo->muInfo.begin(), hbbInfo->muInfo.end(), ptComparatorMu); |
891 |
+ |
std::sort(hbbInfo->eleInfo.begin(), hbbInfo->eleInfo.end(), ptComparatorE); |
892 |
+ |
std::sort(hbbInfo->tauInfo.begin(), hbbInfo->tauInfo.end(), ptComparatorTau); |
893 |
+ |
|
894 |
|
|
895 |
|
// dimuons and dielectrons |
896 |
|
|
897 |
|
for( size_t i = 0; i < dimuons->size(); i++ ) { |
898 |
|
VHbbEvent::DiMuonInfo df; |
899 |
|
const Candidate & dimuonCand = (*dimuons)[ i ]; |
900 |
< |
df.fourMomentum= GENPTOLOR(dimuonCand); |
900 |
> |
df.p4= GENPTOLOR(dimuonCand); |
901 |
|
const Candidate * lep0 = dimuonCand.daughter( 0 ); |
902 |
|
const Candidate * lep1 = dimuonCand.daughter( 1 ); |
903 |
|
// needed to access specific methods of pat::Muon |
904 |
|
const pat::Muon & muonDau0 = dynamic_cast<const pat::Muon &>(*lep0->masterClone()); |
905 |
|
const pat::Muon & muonDau1 = dynamic_cast<const pat::Muon &>(*lep1->masterClone()); |
906 |
|
|
907 |
< |
df.daughter1.fourMomentum=GENPTOLOR(muonDau0); |
908 |
< |
df.daughter2.fourMomentum=GENPTOLOR(muonDau1); |
907 |
> |
df.daughter1.p4=GENPTOLOR(muonDau0); |
908 |
> |
df.daughter2.p4=GENPTOLOR(muonDau1); |
909 |
|
|
910 |
|
df.daughter1.tIso= muonDau0.trackIso(); |
911 |
|
df.daughter2.tIso= muonDau1.trackIso(); |
922 |
|
df.daughter1.ipErrDb=muonDau0.edB(); |
923 |
|
df.daughter2.ipErrDb=muonDau1.edB(); |
924 |
|
|
925 |
< |
|
926 |
< |
if(muonDau0.isGlobalMuon()) df.daughter1.cat =1; |
927 |
< |
else if(muonDau0.isTrackerMuon()) df.daughter1.cat=2; |
928 |
< |
else df.daughter1.cat=3; |
929 |
< |
if(muonDau1.isGlobalMuon()) df.daughter2.cat =1; |
930 |
< |
else if(muonDau1.isTrackerMuon()) df.daughter2.cat=2; |
931 |
< |
else df.daughter2.cat=3; |
925 |
> |
df.daughter1.cat=0; |
926 |
> |
if(muonDau0.isGlobalMuon()) df.daughter1.cat|=1; |
927 |
> |
if(muonDau0.isTrackerMuon()) df.daughter1.cat|=2; |
928 |
> |
if(muonDau0.isStandAloneMuon()) df.daughter1.cat|=4; |
929 |
> |
df.daughter2.cat=0; |
930 |
> |
if(muonDau1.isGlobalMuon()) df.daughter2.cat|=1; |
931 |
> |
if(muonDau1.isTrackerMuon()) df.daughter2.cat|=2; |
932 |
> |
if(muonDau1.isStandAloneMuon()) df.daughter2.cat|=4; |
933 |
|
|
934 |
|
TrackRef trkMu1Ref = muonDau0.get<TrackRef>(); |
935 |
|
TrackRef trkMu2Ref = muonDau1.get<TrackRef>(); |
961 |
|
const reco::HitPattern& q = gTrack->hitPattern(); |
962 |
|
df.daughter1.globNHits=q.numberOfValidMuonHits(); |
963 |
|
df.daughter1.globChi2=gTrack.get()->normalizedChi2(); |
964 |
+ |
df.daughter1.validMuStations = q. muonStationsWithValidHits(); |
965 |
|
} |
966 |
|
if(muonDau1.isGlobalMuon()){ |
967 |
|
TrackRef gTrack = muonDau1.globalTrack(); |
968 |
|
const reco::HitPattern& q = gTrack->hitPattern(); |
969 |
|
df.daughter2.globNHits=q.numberOfValidMuonHits(); |
970 |
|
df.daughter2.globChi2=gTrack.get()->normalizedChi2(); |
971 |
+ |
df.daughter2.validMuStations = q. muonStationsWithValidHits(); |
972 |
|
} |
973 |
|
|
974 |
|
} |
980 |
|
VHbbEvent::DiElectronInfo df; |
981 |
|
const Candidate & dielecCand = (*dielectrons)[ i ]; |
982 |
|
|
983 |
< |
df.fourMomentum=GENPTOLOR(dielecCand); |
983 |
> |
df.p4=GENPTOLOR(dielecCand); |
984 |
|
|
985 |
|
// accessing the daughters of the dimuon candidate |
986 |
|
const Candidate * lep0 = dielecCand.daughter( 0 ); |
989 |
|
const pat::Electron & elecDau0 = dynamic_cast<const pat::Electron &>(*lep0->masterClone()); |
990 |
|
const pat::Electron & elecDau1 = dynamic_cast<const pat::Electron &>(*lep1->masterClone()); |
991 |
|
|
992 |
< |
df.daughter1.fourMomentum = GENPTOLOR(elecDau0); |
993 |
< |
df.daughter2.fourMomentum = GENPTOLOR(elecDau1); |
992 |
> |
df.daughter1.p4 = GENPTOLOR(elecDau0); |
993 |
> |
df.daughter2.p4= GENPTOLOR(elecDau1); |
994 |
|
|
995 |
|
df.daughter1.tIso = elecDau0.trackIso(); |
996 |
|
df.daughter2.tIso = elecDau1.trackIso(); |
1001 |
|
df.daughter1.hIso = elecDau0.hcalIso(); |
1002 |
|
df.daughter2.hIso = elecDau1.hcalIso(); |
1003 |
|
|
1004 |
< |
|
1004 |
> |
// ids |
1005 |
> |
/*df.daughter1.id95 = elecDau0.electronID("simpleEleId95cIso"); |
1006 |
> |
df.daughter1.id85 = elecDau0.electronID ("simpleEleId85cIso"); |
1007 |
> |
df.daughter1.id70 = elecDau0.electronID ("simpleEleId70cIso"); |
1008 |
> |
df.daughter1.id95r = elecDau0.electronID ("simpleEleId95relIso"); |
1009 |
> |
df.daughter1.id85r = elecDau0.electronID ("simpleEleId85relIso"); |
1010 |
> |
df.daughter1.id70r = elecDau0.electronID ("simpleEleId70relIso"); |
1011 |
> |
|
1012 |
> |
|
1013 |
> |
df.daughter2.id95 = elecDau1.electronID("simpleEleId95cIso"); |
1014 |
> |
df.daughter2.id85 = elecDau1.electronID ("simpleEleId85cIso"); |
1015 |
> |
df.daughter2.id70 = elecDau1.electronID ("simpleEleId70cIso"); |
1016 |
> |
df.daughter2.id95r = elecDau1.electronID ("simpleEleId95relIso"); |
1017 |
> |
df.daughter2.id85r = elecDau1.electronID ("simpleEleId85relIso"); |
1018 |
> |
df.daughter2.id70r = elecDau1.electronID ("simpleEleId70relIso"); |
1019 |
> |
*/ |
1020 |
|
hbbInfo->diElectronInfo.push_back(df); |
1021 |
|
|
1022 |
|
} |
1023 |
+ |
if (verbose_){ |
1024 |
+ |
std::cout <<" Pushing hbbInfo "<<std::endl; |
1025 |
+ |
std::cout <<" SimpleJets1 = "<<hbbInfo->simpleJets.size()<<std::endl<< |
1026 |
+ |
" SimpleJets2 = "<<hbbInfo->simpleJets2.size()<<std::endl<< |
1027 |
+ |
" SubJets = "<<hbbInfo->subJets.size()<<std::endl<< |
1028 |
+ |
" HardJets = "<<hbbInfo->hardJets.size()<<std::endl<< |
1029 |
+ |
" Muons = "<<hbbInfo->muInfo.size()<<std::endl<< |
1030 |
+ |
" Electrons = "<<hbbInfo->eleInfo.size()<<std::endl<< |
1031 |
+ |
" Taus = "<<hbbInfo->tauInfo.size()<<std::endl<< |
1032 |
+ |
" Electrons = "<<hbbInfo->eleInfo.size()<<std::endl<< |
1033 |
+ |
"--------------------- "<<std::endl; |
1034 |
+ |
} |
1035 |
+ |
|
1036 |
+ |
|
1037 |
|
iEvent.put(hbbInfo); |
1038 |
+ |
iEvent.put(auxInfo); |
1039 |
+ |
|
1040 |
|
|
1041 |
|
} |
1042 |
|
|
1071 |
|
HbbAnalyzerNew::endJob() { |
1072 |
|
} |
1073 |
|
|
1074 |
+ |
TVector2 HbbAnalyzerNew::getTvect( const pat::Jet* patJet ){ |
1075 |
+ |
|
1076 |
+ |
TVector2 t_Vect(0,0); |
1077 |
+ |
TVector2 null(0,0); |
1078 |
+ |
TVector2 ci(0,0); |
1079 |
+ |
TLorentzVector pi(0,0,0,0); |
1080 |
+ |
TLorentzVector J(0,0,0,0); |
1081 |
+ |
TVector2 r(0,0); |
1082 |
+ |
double patJetpfcPt = 1e10; |
1083 |
+ |
double r_mag = 1e10; |
1084 |
+ |
unsigned int nOfconst = 0; |
1085 |
+ |
|
1086 |
+ |
|
1087 |
+ |
if (patJet->isPFJet() == false) { |
1088 |
+ |
return t_Vect; |
1089 |
+ |
} |
1090 |
+ |
|
1091 |
+ |
|
1092 |
+ |
//re-reconstruct the jet direction with the charged tracks |
1093 |
+ |
std::vector<reco::PFCandidatePtr> |
1094 |
+ |
patJetpfc = patJet->getPFConstituents(); |
1095 |
+ |
for(size_t idx = 0; idx < patJetpfc.size(); idx++){ |
1096 |
+ |
if( patJetpfc.at(idx)->charge() != 0 ){ |
1097 |
+ |
pi.SetPtEtaPhiE( patJetpfc.at(idx)->pt(), patJetpfc.at(idx)->eta(), patJetpfc.at(idx)->phi(), patJetpfc.at(idx)->energy() ); |
1098 |
+ |
J += pi; |
1099 |
+ |
nOfconst++; |
1100 |
+ |
} |
1101 |
+ |
} |
1102 |
+ |
// if there are less than two charged tracks do not calculate the pull (there is not enough info). It returns a null vector |
1103 |
+ |
|
1104 |
+ |
if( nOfconst < 2 ) |
1105 |
+ |
return null; |
1106 |
+ |
|
1107 |
+ |
|
1108 |
+ |
|
1109 |
+ |
TVector2 v_J( J.Rapidity(), J.Phi() ); |
1110 |
+ |
//calculate TVector using only charged tracks |
1111 |
+ |
for(size_t idx = 0; idx < patJetpfc.size(); idx++){ |
1112 |
+ |
if( patJetpfc.at(idx)->charge() != 0 ){ |
1113 |
+ |
patJetpfcPt = patJetpfc.at(idx)->pt(); |
1114 |
+ |
pi.SetPtEtaPhiE( patJetpfc.at(idx)->pt(), patJetpfc.at(idx)->eta(), patJetpfc.at(idx)->phi(), patJetpfc.at(idx)->energy() ); |
1115 |
+ |
r.Set( pi.Rapidity() - J.Rapidity(), Geom::deltaPhi( patJetpfc.at(idx)->phi(), J.Phi() ) ); |
1116 |
+ |
r_mag = r.Mod(); |
1117 |
+ |
t_Vect += ( patJetpfcPt / J.Pt() ) * r_mag * r; |
1118 |
+ |
} |
1119 |
+ |
} |
1120 |
+ |
|
1121 |
+ |
|
1122 |
+ |
return t_Vect; |
1123 |
+ |
|
1124 |
+ |
} |
1125 |
+ |
|
1126 |
+ |
TLorentzVector HbbAnalyzerNew::getChargedTracksMomentum(const pat::Jet* patJet ){ |
1127 |
+ |
// return TLorentzVector(); |
1128 |
+ |
TLorentzVector pi(0,0,0,0); |
1129 |
+ |
TLorentzVector v_j1(0,0,0,0); |
1130 |
+ |
|
1131 |
+ |
|
1132 |
+ |
// std::cout <<"fff ECCCCCCOOOOO "<<patJet->isPFJet()<<std::endl; |
1133 |
+ |
|
1134 |
+ |
if (patJet->isPFJet() == false ){ |
1135 |
+ |
v_j1 = GENPTOLORP(patJet); |
1136 |
+ |
return v_j1; |
1137 |
+ |
} |
1138 |
+ |
std::vector<reco::PFCandidatePtr> |
1139 |
+ |
j1pfc = patJet->getPFConstituents(); |
1140 |
+ |
for(size_t idx = 0; idx < j1pfc.size(); idx++){ |
1141 |
+ |
if( j1pfc.at(idx)->charge() != 0 ){ |
1142 |
+ |
pi.SetPtEtaPhiE( j1pfc.at(idx)->pt(), j1pfc.at(idx)->eta(), j1pfc.at(idx)->phi(), j1pfc.at(idx)->energy() ); |
1143 |
+ |
v_j1 += pi; |
1144 |
+ |
} |
1145 |
+ |
} |
1146 |
+ |
return v_j1; |
1147 |
+ |
//re- |
1148 |
+ |
} |
1149 |
+ |
|
1150 |
+ |
|
1151 |
+ |
//Btagging scale factors |
1152 |
+ |
void HbbAnalyzerNew::fillScaleFactors(VHbbEvent::SimpleJet sj, BTagSFContainer iSF){ |
1153 |
+ |
|
1154 |
+ |
|
1155 |
+ |
BinningPointByMap measurePoint; |
1156 |
+ |
//for a USDG |
1157 |
+ |
//for CB jets |
1158 |
+ |
//scale factor 1 for CB jets over 240GeV/c |
1159 |
+ |
if( TMath::Abs(sj.flavour) == 4 or TMath::Abs(sj.flavour) == 5 ){ |
1160 |
+ |
measurePoint.insert( BinningVariables::JetEt, sj.p4.Et() ); |
1161 |
+ |
measurePoint.insert( BinningVariables::JetAbsEta, fabs(sj.p4.Eta()) ); |
1162 |
+ |
if( iSF.BTAGSF_CSVL->isResultOk(PerformanceResult::BTAGBEFFCORR , measurePoint) ){ |
1163 |
+ |
sj.SF_CSVL = iSF.BTAGSF_CSVL->getResult(PerformanceResult::BTAGBEFFCORR , measurePoint); |
1164 |
+ |
sj.SF_CSVLerr = iSF.BTAGSF_CSVL->getResult(PerformanceResult::BTAGBERRCORR , measurePoint); |
1165 |
+ |
if(verbose_){ |
1166 |
+ |
std::clog << "C/B Jet flavour = " << sj.flavour << std::endl; |
1167 |
+ |
std::clog << "C/B Jet Et = " << sj.p4.Et() << std::endl; |
1168 |
+ |
std::clog << "C/B Jet eta = " << sj.p4.Eta() << std::endl; |
1169 |
+ |
std::clog << "C/B CSVL Scale Factor = " << sj.SF_CSVL << std::endl; |
1170 |
+ |
std::clog << "C/B CSVL Scale Factor error = " << sj.SF_CSVLerr << std::endl; |
1171 |
+ |
} |
1172 |
+ |
} |
1173 |
+ |
if( iSF.BTAGSF_CSVM->isResultOk(PerformanceResult::BTAGBEFFCORR , measurePoint) ){ |
1174 |
+ |
sj.SF_CSVM = iSF.BTAGSF_CSVM->getResult(PerformanceResult::BTAGBEFFCORR , measurePoint); |
1175 |
+ |
sj.SF_CSVMerr = iSF.BTAGSF_CSVM->getResult(PerformanceResult::BTAGBERRCORR , measurePoint); |
1176 |
+ |
} |
1177 |
+ |
if( iSF.BTAGSF_CSVT->isResultOk(PerformanceResult::BTAGBEFFCORR , measurePoint) ){ |
1178 |
+ |
sj.SF_CSVT = iSF.BTAGSF_CSVT->getResult(PerformanceResult::BTAGBEFFCORR , measurePoint); |
1179 |
+ |
sj.SF_CSVTerr = iSF.BTAGSF_CSVT->getResult(PerformanceResult::BTAGBERRCORR , measurePoint); |
1180 |
+ |
} |
1181 |
+ |
else{ |
1182 |
+ |
if(verbose_){ |
1183 |
+ |
std::cerr << "No SF found in the database for this jet" << std::endl; |
1184 |
+ |
std::clog << "No SF found: Jet flavour = " << sj.flavour << std::endl; |
1185 |
+ |
std::clog << "No SF found: Jet Et = " << sj.p4.Et() << std::endl; |
1186 |
+ |
std::clog << "No SF found: Jet eta = " << sj.p4.Eta() << std::endl; |
1187 |
+ |
} |
1188 |
+ |
} |
1189 |
+ |
} |
1190 |
+ |
else { |
1191 |
+ |
measurePoint.insert( BinningVariables::JetEt, sj.p4.Et() ); |
1192 |
+ |
measurePoint.insert( BinningVariables::JetAbsEta, fabs(sj.p4.Eta()) ); |
1193 |
+ |
if( iSF.MISTAGSF_CSVL->isResultOk(PerformanceResult::BTAGLEFFCORR , measurePoint) ){ |
1194 |
+ |
sj.SF_CSVL = iSF.MISTAGSF_CSVL->getResult(PerformanceResult::BTAGLEFFCORR , measurePoint); |
1195 |
+ |
sj.SF_CSVLerr = iSF.MISTAGSF_CSVL->getResult(PerformanceResult::BTAGLERRCORR , measurePoint); |
1196 |
+ |
if(verbose_){ |
1197 |
+ |
std::clog << "Light Jet flavour = " << sj.flavour << std::endl; |
1198 |
+ |
std::clog << "Light Jet Et = " << sj.p4.Et() << std::endl; |
1199 |
+ |
std::clog << "Light Jet eta = " << sj.p4.Eta() << std::endl; |
1200 |
+ |
std::clog << "Light CSVL Scale Factor = " << sj.SF_CSVL << std::endl; |
1201 |
+ |
std::clog << "Light CSVL Scale Factor error = " << sj.SF_CSVLerr << std::endl; |
1202 |
+ |
} |
1203 |
+ |
} |
1204 |
+ |
if( iSF.MISTAGSF_CSVM->isResultOk(PerformanceResult::BTAGLEFFCORR , measurePoint) ){ |
1205 |
+ |
sj.SF_CSVM = iSF.MISTAGSF_CSVM->getResult(PerformanceResult::BTAGLEFFCORR , measurePoint); |
1206 |
+ |
sj.SF_CSVMerr = iSF.MISTAGSF_CSVM->getResult(PerformanceResult::BTAGLERRCORR , measurePoint); |
1207 |
+ |
} |
1208 |
+ |
if( iSF.MISTAGSF_CSVT->isResultOk(PerformanceResult::BTAGLEFFCORR , measurePoint) ){ |
1209 |
+ |
sj.SF_CSVT = iSF.MISTAGSF_CSVT->getResult(PerformanceResult::BTAGLEFFCORR , measurePoint); |
1210 |
+ |
sj.SF_CSVTerr = iSF.MISTAGSF_CSVT->getResult(PerformanceResult::BTAGLERRCORR , measurePoint); |
1211 |
+ |
} |
1212 |
+ |
else{ |
1213 |
+ |
if(verbose_){ |
1214 |
+ |
std::cerr << "No SF found in the database for this jet" << std::endl; |
1215 |
+ |
std::clog << "No SF found: Jet flavour = " << sj.flavour << std::endl; |
1216 |
+ |
std::clog << "No SF found: Jet Et = " << sj.p4.Et() << std::endl; |
1217 |
+ |
std::clog << "No SF found: Jet eta = " << sj.p4.Eta() << std::endl; |
1218 |
+ |
} |
1219 |
+ |
} |
1220 |
+ |
} |
1221 |
+ |
|
1222 |
+ |
} |
1223 |
+ |
|
1224 |
+ |
void HbbAnalyzerNew::setJecUnc(VHbbEvent::SimpleJet& sj,JetCorrectionUncertainty* jecunc){ |
1225 |
+ |
// |
1226 |
+ |
// test |
1227 |
+ |
// |
1228 |
+ |
|
1229 |
+ |
return; |
1230 |
+ |
double eta = sj.p4.Eta(); |
1231 |
+ |
double pt = sj.p4.Pt(); |
1232 |
+ |
|
1233 |
+ |
jecunc->setJetEta(eta); |
1234 |
+ |
jecunc->setJetPt(pt); // here you must use the CORRECTED jet pt |
1235 |
+ |
double unc = jecunc->getUncertainty(true); |
1236 |
+ |
sj.jecunc= unc; |
1237 |
+ |
} |
1238 |
+ |
|
1239 |
+ |
|
1240 |
+ |
void HbbAnalyzerNew ::fillSimpleJet (VHbbEvent::SimpleJet& sj, edm::View<pat::Jet>::const_iterator jet_iter){ |
1241 |
+ |
sj.flavour = jet_iter->partonFlavour(); |
1242 |
+ |
|
1243 |
+ |
sj.tche=jet_iter->bDiscriminator("trackCountingHighEffBJetTags"); |
1244 |
+ |
sj.tchp=jet_iter->bDiscriminator("trackCountingHighPurBJetTags"); |
1245 |
+ |
sj.jp=jet_iter->bDiscriminator("jetProbabilityBJetTags"); |
1246 |
+ |
sj.jpb=jet_iter->bDiscriminator("jetBProbabilityBJetTags"); |
1247 |
+ |
sj.ssvhe=jet_iter->bDiscriminator("simpleSecondaryVertexHighEffBJetTags"); |
1248 |
+ |
sj.csv=jet_iter->bDiscriminator("combinedSecondaryVertexBJetTags"); |
1249 |
+ |
sj.csvmva=jet_iter->bDiscriminator("combinedSecondaryVertexMVABJetTags"); |
1250 |
+ |
sj.charge=jet_iter->jetCharge(); |
1251 |
+ |
sj.ntracks=jet_iter->associatedTracks().size(); |
1252 |
+ |
sj.p4=GENPTOLORP(jet_iter); |
1253 |
+ |
sj.chargedTracksFourMomentum=(getChargedTracksMomentum(&*(jet_iter))); |
1254 |
+ |
sj.SF_CSVL=1; |
1255 |
+ |
sj.SF_CSVM=1; |
1256 |
+ |
sj.SF_CSVT=1; |
1257 |
+ |
sj.SF_CSVLerr=0; |
1258 |
+ |
sj.SF_CSVMerr=0; |
1259 |
+ |
sj.SF_CSVTerr=0; |
1260 |
+ |
|
1261 |
+ |
|
1262 |
+ |
if (jet_iter->isPFJet() == true) { |
1263 |
+ |
|
1264 |
+ |
sj.chargedHadronEFraction = jet_iter-> chargedHadronEnergyFraction(); |
1265 |
+ |
sj.neutralHadronEFraction = jet_iter-> neutralHadronEnergyFraction (); |
1266 |
+ |
sj.chargedEmEFraction = jet_iter-> chargedEmEnergyFraction (); |
1267 |
+ |
sj.neutralEmEFraction = jet_iter-> neutralEmEnergyFraction (); |
1268 |
+ |
sj. nConstituents = jet_iter->getPFConstituents().size(); |
1269 |
+ |
|
1270 |
+ |
} |
1271 |
+ |
// |
1272 |
+ |
// addtaginfo for csv |
1273 |
+ |
// |
1274 |
+ |
|
1275 |
+ |
// if (jet_iter->hasTagInfo("SimpleSecondaryVertex")) { |
1276 |
+ |
|
1277 |
+ |
const reco::SecondaryVertexTagInfo * tf = jet_iter->tagInfoSecondaryVertex(); |
1278 |
+ |
if (tf){ |
1279 |
+ |
sj.vtxMass = tf->secondaryVertex(0).p4().mass(); |
1280 |
+ |
sj.vtxNTracks = tf->secondaryVertex(0).nTracks(); |
1281 |
+ |
std::vector<reco::TrackBaseRef >::const_iterator tit = tf->secondaryVertex(0).tracks_begin(); |
1282 |
+ |
for (; tit< tf->secondaryVertex(0).tracks_end(); ++tit){ |
1283 |
+ |
sj.vtxTrackIds.push_back(tit->key()); |
1284 |
+ |
} |
1285 |
+ |
Measurement1D m = tf->flightDistance(0); |
1286 |
+ |
sj.vtx3dL = m.value(); |
1287 |
+ |
sj.vtx3deL = m.error(); |
1288 |
+ |
} |
1289 |
+ |
// |
1290 |
+ |
// add tVector |
1291 |
+ |
// |
1292 |
+ |
sj.tVector = getTvect(&(*jet_iter)); |
1293 |
+ |
} |
1294 |
+ |
|
1295 |
+ |
|
1296 |
|
//define this as a plug-in |
1297 |
|
DEFINE_FWK_MODULE(HbbAnalyzerNew); |