17 |
|
// |
18 |
|
// |
19 |
|
|
20 |
+ |
|
21 |
+ |
//uncomment to save also jet collections 1 and 4 |
22 |
+ |
//#define ENABLE_SIMPLEJETS1 |
23 |
+ |
//#define ENABLE_SIMPLEJETS4 |
24 |
+ |
|
25 |
+ |
#include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h" |
26 |
+ |
#include "CondFormats/JetMETObjects/interface/JetCorrectionUncertainty.h" |
27 |
+ |
#include "JetMETCorrections/Objects/interface/JetCorrector.h" |
28 |
+ |
#include "JetMETCorrections/Objects/interface/JetCorrectionsRecord.h" |
29 |
+ |
#include "DataFormats/TrackReco/interface/TrackFwd.h" |
30 |
+ |
|
31 |
|
#include "VHbbAnalysis/HbbAnalyzer/interface/HbbAnalyzerNew.h" |
32 |
< |
#include "VHbbAnalysis/VHbbDataFormats/interface/VHbbEvent.h" |
33 |
< |
#include "VHbbAnalysis/VHbbDataFormats/interface/VHbbEventAuxInfo.h" |
32 |
> |
#include "SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h" |
33 |
> |
|
34 |
> |
#include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h" |
35 |
> |
#include "DataFormats/Math/interface/deltaR.h" |
36 |
> |
#include "DataFormats/Math/interface/LorentzVector.h" |
37 |
> |
#include "DataFormats/Math/interface/Vector3D.h" |
38 |
> |
#include "Math/GenVector/PxPyPzM4D.h" |
39 |
> |
|
40 |
> |
#include "RecoEcal/EgammaCoreTools/interface/EcalClusterLazyTools.h" |
41 |
> |
#include "TrackingTools/TransientTrack/interface/TransientTrackBuilder.h" |
42 |
> |
#include "TrackingTools/Records/interface/TransientTrackRecord.h" |
43 |
> |
#include "TrackingTools/IPTools/interface/IPTools.h" |
44 |
> |
|
45 |
> |
#include "CMGTools/External/interface/PileupJetIdentifier.h" |
46 |
> |
#include "CMGTools/External/interface/PileupJetIdAlgo.h" |
47 |
> |
//#include "CMGTools/External/interface/PileupJetIdProducer.h" |
48 |
> |
|
49 |
> |
#include <cmath> |
50 |
> |
|
51 |
|
|
24 |
– |
#include "DataFormats/GeometryVector/interface/VectorUtil.h" |
52 |
|
|
53 |
|
|
54 |
|
#define GENPTOLOR(a) TLorentzVector((a).px(), (a).py(), (a).pz(), (a).energy()) |
55 |
|
#define GENPTOLORP(a) TLorentzVector((a)->px(), (a)->py(), (a)->pz(), (a)->energy()) |
56 |
|
|
57 |
+ |
|
58 |
+ |
|
59 |
+ |
struct CompareJetPtMuons { |
60 |
+ |
bool operator()( const VHbbEvent::MuonInfo& j1, const VHbbEvent::MuonInfo& j2 ) const { |
61 |
+ |
return j1.p4.Pt() > j2.p4.Pt(); |
62 |
+ |
} |
63 |
+ |
}; |
64 |
+ |
struct CompareJetPtElectrons { |
65 |
+ |
bool operator()( const VHbbEvent::ElectronInfo& j1, const VHbbEvent::ElectronInfo& j2 ) const { |
66 |
+ |
return j1.p4.Pt() > j2.p4.Pt(); |
67 |
+ |
} |
68 |
+ |
}; |
69 |
+ |
struct CompareJetPtTaus { |
70 |
+ |
bool operator()( const VHbbEvent::TauInfo& j1, const VHbbEvent::TauInfo& j2 ) const { |
71 |
+ |
return j1.p4.Pt() > j2.p4.Pt(); |
72 |
+ |
} |
73 |
+ |
}; |
74 |
+ |
|
75 |
+ |
|
76 |
+ |
|
77 |
|
HbbAnalyzerNew::HbbAnalyzerNew(const edm::ParameterSet& iConfig): |
78 |
|
eleLabel_(iConfig.getParameter<edm::InputTag>("electronTag")), |
79 |
|
muoLabel_(iConfig.getParameter<edm::InputTag>("muonTag")), |
80 |
+ |
lep_ptCutForBjets_(iConfig.getParameter<double>("lep_ptCutForBjets")), |
81 |
+ |
elenoCutsLabel_(iConfig.getParameter<edm::InputTag>("electronNoCutsTag")), |
82 |
+ |
muonoCutsLabel_(iConfig.getParameter<edm::InputTag>("muonNoCutsTag")), |
83 |
|
jetLabel_(iConfig.getParameter<edm::InputTag>("jetTag")), |
84 |
|
subjetLabel_(iConfig.getParameter<edm::InputTag>("subjetTag")), |
85 |
+ |
filterjetLabel_(iConfig.getParameter<edm::InputTag>("filterjetTag")), |
86 |
|
simplejet1Label_(iConfig.getParameter<edm::InputTag>("simplejet1Tag")), |
87 |
|
simplejet2Label_(iConfig.getParameter<edm::InputTag>("simplejet2Tag")), |
88 |
|
simplejet3Label_(iConfig.getParameter<edm::InputTag>("simplejet3Tag")), |
90 |
|
tauLabel_(iConfig.getParameter<edm::InputTag>("tauTag")), |
91 |
|
metLabel_(iConfig.getParameter<edm::InputTag>("metTag")), |
92 |
|
phoLabel_(iConfig.getParameter<edm::InputTag>("photonTag")), |
42 |
– |
dimuLabel_(iConfig.getParameter<edm::InputTag>("dimuTag")), |
43 |
– |
dielecLabel_(iConfig.getParameter<edm::InputTag>("dielecTag")), |
93 |
|
hltResults_(iConfig.getParameter<edm::InputTag>("hltResultsTag")), |
94 |
|
runOnMC_(iConfig.getParameter<bool>("runOnMC")), verbose_(iConfig.getUntrackedParameter<bool>("verbose")) { |
95 |
|
|
120 |
|
HbbAnalyzerNew::produce(edm::Event& iEvent, const edm::EventSetup& iSetup){ |
121 |
|
using namespace edm; |
122 |
|
using namespace reco; |
123 |
< |
|
123 |
> |
|
124 |
> |
|
125 |
> |
// JEC Uncertainty |
126 |
> |
|
127 |
> |
// JetCorrectionUncertainty *jecUnc=0; |
128 |
> |
edm::ESHandle<JetCorrectorParametersCollection> JetCorParColl; |
129 |
> |
iSetup.get<JetCorrectionsRecord>().get("AK5PFchs",JetCorParColl); |
130 |
> |
JetCorrectionUncertainty *jecUnc=0; |
131 |
> |
// if (!runOnMC_){ |
132 |
> |
JetCorrectorParameters const & JetCorPar = (*JetCorParColl)["Uncertainty"]; |
133 |
> |
jecUnc = new JetCorrectionUncertainty(JetCorPar); |
134 |
> |
// } |
135 |
|
|
136 |
|
std::auto_ptr<VHbbEvent> hbbInfo( new VHbbEvent() ); |
137 |
|
std::auto_ptr<VHbbEventAuxInfo> auxInfo( new VHbbEventAuxInfo() ); |
138 |
< |
|
138 |
> |
|
139 |
> |
|
140 |
> |
if (runOnMC_){ |
141 |
> |
Handle<GenEventInfoProduct> evt_info; |
142 |
> |
iEvent.getByType(evt_info); |
143 |
> |
auxInfo->weightMCProd = evt_info->weight(); |
144 |
> |
} |
145 |
> |
else |
146 |
> |
{ auxInfo->weightMCProd =1.;} |
147 |
|
// |
148 |
|
// ?? |
149 |
< |
|
149 |
> |
|
150 |
> |
// trigger |
151 |
> |
|
152 |
|
// trigger |
153 |
|
edm::Handle<edm::TriggerResults> hltresults; |
154 |
|
//iEvent.getByLabel("TriggerResults", hltresults); |
158 |
|
iEvent.getByLabel(hltResults_, hltresults); |
159 |
|
|
160 |
|
const edm::TriggerNames & triggerNames_ = iEvent.triggerNames(*hltresults); |
91 |
– |
|
92 |
– |
int ntrigs = hltresults->size(); |
93 |
– |
if (ntrigs==0){std::cout << "%HLTInfo -- No trigger name given in TriggerResults of the input " << std::endl;} |
94 |
– |
|
95 |
– |
for (int itrig = 0; itrig != ntrigs; ++itrig){ |
96 |
– |
|
97 |
– |
TString trigName=triggerNames_.triggerName(itrig); |
98 |
– |
bool accept = hltresults->accept(itrig); |
99 |
– |
|
100 |
– |
if (accept){(auxInfo->triggerInfo.flag)[itrig] = 1;} |
101 |
– |
else { (auxInfo->triggerInfo.flag)[itrig] = 0;} |
102 |
– |
|
103 |
– |
// std::cout << "%HLTInfo -- Number of HLT Triggers: " << ntrigs << std::endl; |
104 |
– |
// std::cout << "%HLTInfo -- HLTTrigger(" << itrig << "): " << trigName << " = " << accept << std::endl; |
105 |
– |
} |
106 |
– |
|
107 |
– |
// |
108 |
– |
// big bloat |
109 |
– |
// |
110 |
– |
|
111 |
– |
|
112 |
– |
int goodDoubleMu3=0,goodDoubleMu3_2=0, |
113 |
– |
goodMu9=0, goodIsoMu9=0, goodMu11=0, goodIsoMu13_3=0, goodMu15=0, goodMu15_1=0; |
114 |
– |
int goodDoubleElec10=0,goodDoubleElec15_1=0,goodDoubleElec17_1=0; |
115 |
– |
int goodMet100=0; |
116 |
– |
int goodSingleEle1=0,goodSingleEle2=0,goodSingleEle3=0,goodSingleEle4=0; |
117 |
– |
int goodBtagMu1=0,goodBtagMu2=0,goodBtagMu0=0,goodBtagMu11=0; |
118 |
– |
int goodBtagMuJet1=0, goodBtagMuJet2=0, goodBtagMuJet3=0, goodBtagMuJet4=0; |
119 |
– |
int goodIsoMu15=0,goodIsoMu17v5=0,goodIsoMu17v6=0; |
120 |
– |
|
121 |
– |
for (int itrig = 0; itrig != ntrigs; ++itrig){ |
122 |
– |
TString trigName=triggerNames_.triggerName(itrig); |
123 |
– |
if(strcmp(trigName,"HLT_Mu9")==0) goodMu9++; |
124 |
– |
if(strcmp(trigName,"HLT_IsoMu9")==0) goodIsoMu9++; |
125 |
– |
if(strcmp(trigName,"HLT_IsoMu13_v3")==0) goodIsoMu13_3++; |
126 |
– |
if(strcmp(trigName,"HLT_Mu11")==0) goodMu11++; |
127 |
– |
if(strcmp(trigName,"HLT_DoubleMu3")==0) goodDoubleMu3++; |
128 |
– |
if(strcmp(trigName,"HLT_DoubleMu3_v2")==0) goodDoubleMu3_2++; |
129 |
– |
if(strcmp(trigName,"HLT_Mu15")==0) goodMu15++; |
130 |
– |
if(strcmp(trigName,"HLT_Mu15_v1")==0) goodMu15_1++; |
131 |
– |
|
132 |
– |
if(strcmp(trigName,"HLT_DoubleEle10_SW_L1R")==0) goodDoubleElec10++; |
133 |
– |
if(strcmp(trigName,"HLT_DoubleEle15_SW_L1R_v1")==0) goodDoubleElec15_1++; |
134 |
– |
if(strcmp(trigName,"HLT_DoubleEle17_SW_L1R_v1")==0) goodDoubleElec17_1++; |
135 |
– |
if(strcmp(trigName,"HLT_MET100_v1")==0) goodMet100++; |
136 |
– |
if(strcmp(trigName,"HLT_Ele15_SW_L1R")==0) goodSingleEle1++; |
137 |
– |
if(strcmp(trigName,"HLT_Ele17_SW_TightEleId_L1R")==0) goodSingleEle2++; |
138 |
– |
if(strcmp(trigName,"HLT_Ele17_SW_TighterEleIdIsol_L1R_v2")==0) goodSingleEle3++; |
139 |
– |
if(strcmp(trigName,"HLT_Ele17_SW_TighterEleIdIsol_L1R_v3")==0) goodSingleEle4++; |
140 |
– |
if(strcmp(trigName,"HLT_BTagMu_DiJet20U_v1")==0) goodBtagMu1++; |
141 |
– |
if(strcmp(trigName,"HLT_BTagMu_DiJet30U_Mu5_v3")==0) goodBtagMu2++; |
142 |
– |
if(strcmp(trigName,"HLT_BTagMu_Jet20U")==0) goodBtagMu0++; |
143 |
– |
if(strcmp(trigName,"HLT_BTagMu_DiJet20U_Mu5_v1")==0) goodBtagMu11++; |
144 |
– |
if(strcmp(trigName,"HLT_Mu17_CentralJet30_BTagIP_v2")==0) goodBtagMuJet1++; |
145 |
– |
if(strcmp(trigName,"HLT_Mu17_CentralJet30_v2")==0) goodBtagMuJet2++; |
146 |
– |
if(strcmp(trigName,"HLT_HT200_Mu5_PFMHT35_v2")==0) goodBtagMuJet3++; |
147 |
– |
if(strcmp(trigName,"HLT_Mu12_CentralJet30_BTagIP_v2")==0) goodBtagMuJet4++; |
148 |
– |
|
149 |
– |
if(strcmp(trigName,"HLT_IsoMu15_v5")==0) goodIsoMu15++; |
150 |
– |
if(strcmp(trigName,"HLT_IsoMu17_v5")==0) goodIsoMu17v5++; |
151 |
– |
if(strcmp(trigName,"HLT_IsoMu17_v6")==0) goodIsoMu17v6++; |
152 |
– |
} |
153 |
– |
int itrig1=-99; |
154 |
– |
if(goodMu9!=0) itrig1 = triggerNames_.triggerIndex("HLT_Mu9"); |
155 |
– |
int itrig2=-99; |
156 |
– |
if(goodIsoMu9!=0) itrig2 = triggerNames_.triggerIndex("HLT_IsoMu9"); |
157 |
– |
int itrig3=-99; |
158 |
– |
if(goodIsoMu13_3!=0) itrig3 = triggerNames_.triggerIndex("HLT_IsoMu13_v3"); |
159 |
– |
int itrig4=-99; |
160 |
– |
if(goodMu11!=0) itrig4 = triggerNames_.triggerIndex("HLT_Mu11"); |
161 |
– |
int itrig5=-99; |
162 |
– |
if(goodDoubleMu3!=0) itrig5 = triggerNames_.triggerIndex("HLT_DoubleMu3"); |
163 |
– |
int itrig6=-99; |
164 |
– |
if(goodDoubleMu3_2!=0) itrig6 = triggerNames_.triggerIndex("HLT_DoubleMu3_v2"); |
165 |
– |
int itrig7=-99; |
166 |
– |
if(goodMu15!=0) itrig7 = triggerNames_.triggerIndex("HLT_Mu15"); |
167 |
– |
int itrig8=-99; |
168 |
– |
if(goodMu15_1!=0) itrig8 = triggerNames_.triggerIndex("HLT_Mu15_v1"); |
169 |
– |
|
170 |
– |
int itrig9=-99; |
171 |
– |
if(goodDoubleElec10!=0) itrig9 = triggerNames_.triggerIndex("HLT_DoubleEle10_SW_L1R"); |
172 |
– |
int itrig10=-99; |
173 |
– |
if(goodDoubleElec15_1!=0) itrig10 = triggerNames_.triggerIndex("HLT_DoubleEle15_SW_L1R_v1"); |
174 |
– |
int itrig11=-99; |
175 |
– |
if(goodDoubleElec17_1!=0) itrig11 = triggerNames_.triggerIndex("HLT_DoubleEle17_SW_L1R_v1"); |
176 |
– |
int itrig12=-99; |
177 |
– |
if(goodMet100!=0) itrig12 = triggerNames_.triggerIndex("HLT_MET100_v1"); |
178 |
– |
|
179 |
– |
int itrig13=-99; |
180 |
– |
if(goodSingleEle1!=0) itrig13 = triggerNames_.triggerIndex("HLT_Ele15_SW_L1R"); |
181 |
– |
int itrig14=-99; |
182 |
– |
if(goodSingleEle2!=0) itrig14 = triggerNames_.triggerIndex("HLT_Ele17_SW_TightEleId_L1R"); |
183 |
– |
int itrig15=-99; |
184 |
– |
if(goodSingleEle3!=0) itrig15 = triggerNames_.triggerIndex("HLT_Ele17_SW_TighterEleIdIsol_L1R_v2"); |
185 |
– |
int itrig16=-99; |
186 |
– |
if(goodSingleEle4!=0) itrig16 = triggerNames_.triggerIndex("HLT_Ele17_SW_TighterEleIdIsol_L1R_v3"); |
187 |
– |
|
188 |
– |
int itrig17=-99; |
189 |
– |
if(goodBtagMu1!=0) itrig17 = triggerNames_.triggerIndex("HLT_BTagMu_DiJet20U_v1"); |
190 |
– |
int itrig18=-99; |
191 |
– |
if(goodBtagMu2!=0) itrig18 = triggerNames_.triggerIndex("HLT_BTagMu_DiJet30U_Mu5_v3"); |
192 |
– |
int itrig19=-99; |
193 |
– |
if(goodBtagMu0!=0) itrig19 = triggerNames_.triggerIndex("HLT_BTagMu_Jet20U"); |
194 |
– |
int itrig20=-99; |
195 |
– |
if(goodBtagMu11!=0) itrig20 = triggerNames_.triggerIndex("HLT_BTagMu_DiJet20U_Mu5_v1"); |
196 |
– |
int itrig21=-99; |
197 |
– |
if(goodBtagMuJet1!=0) itrig21 = triggerNames_.triggerIndex("HLT_Mu17_CentralJet30_BTagIP_v2"); |
198 |
– |
int itrig22=-99; |
199 |
– |
if(goodBtagMuJet2!=0) itrig22 = triggerNames_.triggerIndex("HLT_Mu17_CentralJet30_v2"); |
200 |
– |
int itrig23=-99; |
201 |
– |
if(goodBtagMuJet3!=0) itrig23 = triggerNames_.triggerIndex("HLT_HT200_Mu5_PFMHT35_v2"); |
202 |
– |
int itrig231=-99; |
203 |
– |
if(goodBtagMuJet4!=0) itrig231 = triggerNames_.triggerIndex("HLT_Mu12_CentralJet30_BTagIP_v2"); |
204 |
– |
|
205 |
– |
int itrig24=-99; |
206 |
– |
if(goodIsoMu15!=0) itrig24 = triggerNames_.triggerIndex("HLT_IsoMu15_v5"); |
207 |
– |
int itrig25=-99; |
208 |
– |
if(goodIsoMu17v5!=0) itrig25 = triggerNames_.triggerIndex("HLT_IsoMu17_v5"); |
209 |
– |
int itrig26=-99; |
210 |
– |
if(goodIsoMu17v6!=0) itrig26 = triggerNames_.triggerIndex("HLT_IsoMu17_v6"); |
211 |
– |
|
212 |
– |
if (itrig1!=-99 && hltresults->accept(itrig1)) auxInfo->triggerInfo.triggerMu9=1; else auxInfo->triggerInfo.triggerMu9=0; |
213 |
– |
if (itrig2!=-99 && hltresults->accept(itrig2)) auxInfo->triggerInfo.triggerIsoMu9=1; else auxInfo->triggerInfo.triggerIsoMu9=0; |
214 |
– |
if (itrig3!=-99 && hltresults->accept(itrig3)) auxInfo->triggerInfo.triggerIsoMu13_3=1; else auxInfo->triggerInfo.triggerIsoMu13_3=0; |
215 |
– |
if (itrig4!=-99 && hltresults->accept(itrig4)) auxInfo->triggerInfo.triggerMu11=1; else auxInfo->triggerInfo.triggerMu11=0; |
216 |
– |
if (itrig5!=-99 && hltresults->accept(itrig5)) auxInfo->triggerInfo.triggerDoubleMu3=1; else auxInfo->triggerInfo.triggerDoubleMu3=0; |
217 |
– |
if (itrig6!=-99 && hltresults->accept(itrig6)) auxInfo->triggerInfo.triggerDoubleMu3_2=1; else auxInfo->triggerInfo.triggerDoubleMu3_2=0; |
218 |
– |
if (itrig7!=-99 && hltresults->accept(itrig7)) auxInfo->triggerInfo.triggerMu15=1; else auxInfo->triggerInfo.triggerMu15=0; |
219 |
– |
if (itrig8!=-99 && hltresults->accept(itrig8)) auxInfo->triggerInfo.triggerMu15_1=1; else auxInfo->triggerInfo.triggerMu15_1=0; |
220 |
– |
|
221 |
– |
if (itrig9!=-99 && hltresults->accept(itrig9)) auxInfo->triggerInfo.triggerDoubleElec10=1; else auxInfo->triggerInfo.triggerDoubleElec10=0; |
222 |
– |
if (itrig10!=-99 && hltresults->accept(itrig10)) auxInfo->triggerInfo.triggerDoubleElec15_1=1; else auxInfo->triggerInfo.triggerDoubleElec15_1=0; |
223 |
– |
if (itrig11!=-99 && hltresults->accept(itrig11)) auxInfo->triggerInfo.triggerDoubleElec17_1=1; else auxInfo->triggerInfo.triggerDoubleElec17_1=0; |
224 |
– |
if (itrig12!=-99 && hltresults->accept(itrig12)) auxInfo->triggerInfo.triggerMet100_1=1; else auxInfo->triggerInfo.triggerMet100_1=0; |
225 |
– |
|
226 |
– |
if (itrig13!=-99 && hltresults->accept(itrig13)) auxInfo->triggerInfo.triggerSingleEle1=1; else auxInfo->triggerInfo.triggerSingleEle1=0; |
227 |
– |
if (itrig14!=-99 && hltresults->accept(itrig14)) auxInfo->triggerInfo.triggerSingleEle2=1; else auxInfo->triggerInfo.triggerSingleEle2=0; |
228 |
– |
if (itrig15!=-99 && hltresults->accept(itrig15)) auxInfo->triggerInfo.triggerSingleEle3=1; else auxInfo->triggerInfo.triggerSingleEle3=0; |
229 |
– |
if (itrig16!=-99 && hltresults->accept(itrig16)) auxInfo->triggerInfo.triggerSingleEle4=1; else auxInfo->triggerInfo.triggerSingleEle4=0; |
230 |
– |
|
231 |
– |
if (itrig17!=-99 && hltresults->accept(itrig17)) auxInfo->triggerInfo.triggerBtagMu1=1; else auxInfo->triggerInfo.triggerBtagMu1=0; |
232 |
– |
if (itrig18!=-99 && hltresults->accept(itrig18)) auxInfo->triggerInfo.triggerBtagMu2=1; else auxInfo->triggerInfo.triggerBtagMu2=0; |
233 |
– |
if (itrig19!=-99 && hltresults->accept(itrig19)) auxInfo->triggerInfo.triggerBtagMu0=1; else auxInfo->triggerInfo.triggerBtagMu0=0; |
234 |
– |
if (itrig20!=-99 && hltresults->accept(itrig20)) auxInfo->triggerInfo.triggerBtagMu11=1; else auxInfo->triggerInfo.triggerBtagMu11=0; |
235 |
– |
if (itrig21!=-99 && hltresults->accept(itrig21)) auxInfo->triggerInfo.triggerBtagMuJet1=1; else auxInfo->triggerInfo.triggerBtagMuJet1=0; |
236 |
– |
if (itrig22!=-99 && hltresults->accept(itrig22)) auxInfo->triggerInfo.triggerBtagMuJet2=1; else auxInfo->triggerInfo.triggerBtagMuJet2=0; |
237 |
– |
if (itrig23!=-99 && hltresults->accept(itrig23)) auxInfo->triggerInfo.triggerBtagMuJet3=1; else auxInfo->triggerInfo.triggerBtagMuJet3=0; |
238 |
– |
if (itrig231!=-99 && hltresults->accept(itrig231)) auxInfo->triggerInfo.triggerBtagMuJet4=1; else auxInfo->triggerInfo.triggerBtagMuJet4=0; |
239 |
– |
|
240 |
– |
if (itrig24!=-99 && hltresults->accept(itrig24)) auxInfo->triggerInfo.triggerIsoMu15=1; else auxInfo->triggerInfo.triggerIsoMu15=0; |
241 |
– |
if (itrig25!=-99 && hltresults->accept(itrig25)) auxInfo->triggerInfo.triggerIsoMu17v5=1; else auxInfo->triggerInfo.triggerIsoMu17v5=0; |
242 |
– |
if (itrig26!=-99 && hltresults->accept(itrig26)) auxInfo->triggerInfo.triggerIsoMu17v6=1; else auxInfo->triggerInfo.triggerIsoMu17v6=0; |
243 |
– |
|
244 |
– |
if (itrig1==-99) auxInfo->triggerInfo.triggerMu9=-99; |
245 |
– |
if (itrig2==-99) auxInfo->triggerInfo.triggerIsoMu9=-99; |
246 |
– |
if (itrig3==-99) auxInfo->triggerInfo.triggerIsoMu13_3=-99; |
247 |
– |
if (itrig4==-99) auxInfo->triggerInfo.triggerMu11=-99; |
248 |
– |
if (itrig5==-99) auxInfo->triggerInfo.triggerDoubleMu3=-99; |
249 |
– |
if (itrig6==-99) auxInfo->triggerInfo.triggerDoubleMu3_2=-99; |
250 |
– |
if (itrig7==-99) auxInfo->triggerInfo.triggerMu15=-99; |
251 |
– |
if (itrig8==-99) auxInfo->triggerInfo.triggerMu15_1=-99; |
252 |
– |
|
253 |
– |
if (itrig9==-99) auxInfo->triggerInfo.triggerDoubleElec10=-99; |
254 |
– |
if (itrig10==-99) auxInfo->triggerInfo.triggerDoubleElec15_1=-99; |
255 |
– |
if (itrig11==-99) auxInfo->triggerInfo.triggerDoubleElec17_1=-99; |
256 |
– |
if (itrig12==-99) auxInfo->triggerInfo.triggerMet100_1=-99; |
257 |
– |
|
258 |
– |
if (itrig13==-99) auxInfo->triggerInfo.triggerSingleEle1=-99; |
259 |
– |
if (itrig14==-99) auxInfo->triggerInfo.triggerSingleEle2=-99; |
260 |
– |
if (itrig15==-99) auxInfo->triggerInfo.triggerSingleEle3=-99; |
261 |
– |
if (itrig16==-99) auxInfo->triggerInfo.triggerSingleEle4=-99; |
262 |
– |
|
263 |
– |
if(itrig17==-99) auxInfo->triggerInfo.triggerBtagMu1=-99; |
264 |
– |
if(itrig18==-99) auxInfo->triggerInfo.triggerBtagMu2=-99; |
265 |
– |
if(itrig19==-99) auxInfo->triggerInfo.triggerBtagMu0=-99; |
266 |
– |
if(itrig20==-99) auxInfo->triggerInfo.triggerBtagMu11=-99; |
267 |
– |
if(itrig21==-99) auxInfo->triggerInfo.triggerBtagMuJet1=-99; |
268 |
– |
if(itrig22==-99) auxInfo->triggerInfo.triggerBtagMuJet2=-99; |
269 |
– |
if(itrig23==-99) auxInfo->triggerInfo.triggerBtagMuJet3=-99; |
270 |
– |
if(itrig231==-99) auxInfo->triggerInfo.triggerBtagMuJet4=-99; |
271 |
– |
|
272 |
– |
if(itrig24==-99) auxInfo->triggerInfo.triggerIsoMu15=-99; |
273 |
– |
if(itrig25==-99) auxInfo->triggerInfo.triggerIsoMu17v5=-99; |
274 |
– |
if(itrig26==-99) auxInfo->triggerInfo.triggerIsoMu17v6=-99; |
275 |
– |
|
276 |
– |
// MinDRMu=-99.,MCBestMuId=-99,MCBestMuMomId=-99,MCBestMuGMomId=-99; |
277 |
– |
// for(int i=0;i<50;i++) {DeltaRMu[i]=-99;} |
278 |
– |
|
161 |
|
|
162 |
+ |
int ntrigs = hltresults->size(); |
163 |
+ |
if (ntrigs==0){std::cerr << "%HLTInfo -- No trigger name given in TriggerResults of the input " << std::endl;} |
164 |
|
|
165 |
|
BeamSpot vertexBeamSpot; |
166 |
|
edm::Handle<reco::BeamSpot> recoBeamSpotHandle; |
178 |
|
Handle<reco::VertexCollection> recVtxs; |
179 |
|
iEvent.getByLabel("offlinePrimaryVertices", recVtxs); |
180 |
|
|
181 |
+ |
auxInfo->pvInfo.nVertices = recVtxs->size(); |
182 |
+ |
|
183 |
|
for(size_t i = 0; i < recVtxs->size(); ++ i) { |
184 |
|
const Vertex &vtx = (*recVtxs)[i]; |
185 |
|
double RecVtxProb=TMath::Prob(vtx.chi2(),vtx.ndof()); |
191 |
|
|
192 |
|
const Vertex &RecVtx = (*recVtxs)[VtxIn]; |
193 |
|
const Vertex &RecVtxFirst = (*recVtxs)[0]; |
194 |
+ |
const Vertex &vertex = RecVtxFirst; //used in ele id 2012 |
195 |
|
|
196 |
|
auxInfo->pvInfo.firstPVInPT2 = TVector3(RecVtxFirst.x(), RecVtxFirst.y(), RecVtxFirst.z()); |
197 |
|
auxInfo->pvInfo.firstPVInProb = TVector3(RecVtx.x(), RecVtx.y(), RecVtx.z()); |
198 |
< |
|
198 |
> |
|
199 |
> |
(auxInfo->pvInfo).efirstPVInPT2 = (RecVtxFirst.error()); |
200 |
> |
(auxInfo->pvInfo).efirstPVInProb = RecVtx.error(); |
201 |
|
|
202 |
|
edm::Handle<double> rhoHandle; |
203 |
< |
iEvent.getByLabel(edm::InputTag("kt6PFJets", "rho"),rhoHandle); // configure srcRho = cms.InputTag('kt6PFJets") |
203 |
> |
iEvent.getByLabel(edm::InputTag("kt6PFJets", "rho"),rhoHandle); |
204 |
|
auxInfo->puInfo.rho = *rhoHandle; |
205 |
< |
|
205 |
> |
|
206 |
> |
edm::Handle<double> rho25Handle; |
207 |
> |
iEvent.getByLabel(edm::InputTag("kt6PFJets25", "rho"),rho25Handle); |
208 |
> |
auxInfo->puInfo.rho25 = *rho25Handle; |
209 |
> |
|
210 |
> |
edm::Handle<double> rhoNeutralHandle; |
211 |
> |
iEvent.getByLabel(edm::InputTag("kt6PFJetsCentralNeutral", "rho"),rhoNeutralHandle); |
212 |
> |
auxInfo->puInfo.rhoNeutral = *rhoNeutralHandle; |
213 |
> |
|
214 |
> |
|
215 |
> |
edm::Handle<std::vector< PileupSummaryInfo> > puHandle; |
216 |
> |
|
217 |
> |
if (runOnMC_){ |
218 |
> |
iEvent.getByType(puHandle); |
219 |
> |
if (puHandle.isValid()){ |
220 |
> |
|
221 |
> |
std::vector< PileupSummaryInfo> pu = (*puHandle); |
222 |
> |
for (std::vector<PileupSummaryInfo>::const_iterator it= pu.begin(); it!=pu.end(); ++it){ |
223 |
> |
int bx = (*it).getBunchCrossing(); |
224 |
> |
unsigned int num = (*it).getPU_NumInteractions(); |
225 |
> |
// std::cout <<" PU PUSHING "<<bx<<" " <<num<<std::endl; |
226 |
> |
auxInfo->puInfo.pus[bx] =num; |
227 |
> |
} |
228 |
> |
} |
229 |
> |
} |
230 |
> |
|
231 |
|
//// real start |
232 |
|
|
233 |
|
|
238 |
|
|
239 |
|
if(runOnMC_){ |
240 |
|
|
241 |
< |
int Hin=-99,Win=-99,Zin=-99,bin=-99,bbarin=-99; |
328 |
< |
iEvent.getByLabel("genParticles", genParticles); |
241 |
> |
iEvent.getByLabel("genParticles", genParticles); |
242 |
|
|
243 |
|
for(size_t i = 0; i < genParticles->size(); ++ i) { |
244 |
< |
int Hin=-99,Win=-99,Zin=-99,bin=-99,bbarin=-99; |
332 |
< |
|
244 |
> |
|
245 |
|
const GenParticle & p = (*genParticles)[i]; |
246 |
|
int id = p.pdgId(); |
247 |
|
int st = p.status(); |
248 |
|
|
249 |
|
if(id==25){ |
250 |
|
|
339 |
– |
/* int wh=0; |
340 |
– |
int nMoth = p.numberOfMothers(); |
341 |
– |
for(size_t jj = 0; jj < nMoth; ++ jj) { |
342 |
– |
const Candidate * mom = p.mother( jj ); |
343 |
– |
int nmomdau= mom->numberOfDaughters(); |
344 |
– |
for(size_t j = 0; j < nmomdau; ++ j) { |
345 |
– |
const Candidate * Wmomdau = mom->daughter( j ); |
346 |
– |
if(abs(Wmomdau->pdgId())==24) wh++; |
347 |
– |
} |
348 |
– |
} |
349 |
– |
|
350 |
– |
if(wh==0) continue; |
351 |
– |
*/ |
251 |
|
VHbbEventAuxInfo::ParticleMCInfo htemp; |
353 |
– |
Hin=i; |
252 |
|
htemp.status=st; |
253 |
|
htemp.charge=p.charge(); |
254 |
|
if(p.mother(0)!=0) htemp.momid=p.mother(0)->pdgId(); |
255 |
|
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) htemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
256 |
|
htemp.p4 = GENPTOLOR(p); |
257 |
< |
|
257 |
> |
|
258 |
|
int ndau = p.numberOfDaughters(); |
259 |
|
for(int j = 0; j < ndau; ++ j) { |
260 |
|
const Candidate * Hdau = p.daughter( j ); |
263 |
|
} |
264 |
|
(auxInfo->mcH).push_back(htemp); |
265 |
|
} |
266 |
< |
|
267 |
< |
|
266 |
> |
|
267 |
> |
|
268 |
|
if(abs(id)==24){ |
269 |
< |
|
372 |
< |
Win=i; |
269 |
> |
|
270 |
|
VHbbEventAuxInfo::ParticleMCInfo wtemp; |
271 |
|
wtemp.status=st; |
272 |
|
wtemp.charge=p.charge(); |
273 |
|
if(p.mother(0)!=0) wtemp.momid=p.mother(0)->pdgId(); |
274 |
|
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) wtemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
275 |
|
wtemp.p4=GENPTOLOR(p); |
276 |
< |
|
276 |
> |
|
277 |
|
int ndau = p.numberOfDaughters(); |
278 |
|
for(int j = 0; j < ndau; ++ j) { |
279 |
|
const Candidate * Wdau = p.daughter( j ); |
282 |
|
} |
283 |
|
auxInfo->mcW.push_back(wtemp); |
284 |
|
} |
285 |
+ |
|
286 |
+ |
if(abs(id)==15) { |
287 |
+ |
VHbbEventAuxInfo::ParticleMCInfo tautemp; |
288 |
+ |
tautemp.status=st; |
289 |
+ |
tautemp.charge=p.charge(); |
290 |
+ |
if(p.mother(0)!=0) tautemp.momid=p.mother(0)->pdgId(); |
291 |
+ |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) tautemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
292 |
+ |
tautemp.p4=GENPTOLOR(p); |
293 |
+ |
|
294 |
+ |
int ndau = p.numberOfDaughters(); |
295 |
+ |
for(int j = 0; j < ndau; ++ j) { |
296 |
+ |
const Candidate * Taudau = p.daughter( j ); |
297 |
+ |
tautemp.dauid.push_back(Taudau->pdgId()); |
298 |
+ |
tautemp.dauFourMomentum.push_back(GENPTOLORP(Taudau)); |
299 |
+ |
} |
300 |
+ |
auxInfo->mcTau.push_back(tautemp); |
301 |
+ |
} |
302 |
|
|
303 |
|
if(abs(id)==23){ |
304 |
|
|
305 |
< |
Zin=i; |
305 |
> |
|
306 |
|
VHbbEventAuxInfo::ParticleMCInfo ztemp; |
307 |
|
ztemp.status=st; |
308 |
|
ztemp.charge=p.charge(); |
314 |
|
for(int j = 0; j < ndau; ++ j) { |
315 |
|
const Candidate * Zdau = p.daughter( j ); |
316 |
|
ztemp.dauid.push_back(Zdau->pdgId()); |
317 |
< |
ztemp.dauFourMomentum.push_back(GENPTOLOR(p)); |
317 |
> |
ztemp.dauFourMomentum.push_back(GENPTOLORP(Zdau)); |
318 |
|
} |
319 |
|
auxInfo->mcZ.push_back(ztemp); |
320 |
|
} |
324 |
|
|
325 |
|
|
326 |
|
if(id==5){ |
327 |
< |
bin=i; |
327 |
> |
|
328 |
|
VHbbEventAuxInfo::ParticleMCInfo btemp; |
329 |
|
btemp.status=st; |
330 |
|
btemp.charge=p.charge(); |
331 |
|
if(p.mother(0)!=0) btemp.momid=p.mother(0)->pdgId(); |
332 |
|
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) btemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
333 |
+ |
|
334 |
+ |
btemp.p4=GENPTOLOR(p); |
335 |
+ |
|
336 |
+ |
int nHDaubdau = p.numberOfDaughters(); |
337 |
+ |
for(int j = 0; j < nHDaubdau; ++ j) { |
338 |
+ |
const Candidate * Bdau = p.daughter( j ); |
339 |
+ |
btemp.dauid.push_back(Bdau->pdgId()); |
340 |
+ |
} |
341 |
|
auxInfo->mcB.push_back(btemp); |
342 |
|
} |
343 |
|
|
344 |
|
if(id==-5){ |
345 |
< |
bbarin=i; |
345 |
> |
|
346 |
|
VHbbEventAuxInfo::ParticleMCInfo bbtemp; |
347 |
|
|
348 |
|
bbtemp.status=st; |
349 |
|
bbtemp.charge=p.charge(); |
350 |
|
if(p.mother(0)!=0) bbtemp.momid=p.mother(0)->pdgId(); |
351 |
|
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) bbtemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
352 |
+ |
|
353 |
+ |
bbtemp.p4=GENPTOLOR(p); |
354 |
+ |
|
355 |
+ |
int nHDaubdau = p.numberOfDaughters(); |
356 |
+ |
for(int j = 0; j < nHDaubdau; ++ j) { |
357 |
+ |
const Candidate * Bdau = p.daughter( j ); |
358 |
+ |
bbtemp.dauid.push_back(Bdau->pdgId()); |
359 |
+ |
} |
360 |
+ |
|
361 |
+ |
|
362 |
|
auxInfo->mcBbar.push_back(bbtemp); |
363 |
|
} |
364 |
|
|
368 |
|
ctemp.charge=p.charge(); |
369 |
|
if(p.mother(0)!=0) ctemp.momid=p.mother(0)->pdgId(); |
370 |
|
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) ctemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
371 |
+ |
|
372 |
+ |
ctemp.p4=GENPTOLOR(p); |
373 |
+ |
|
374 |
+ |
int nHDaubdau = p.numberOfDaughters(); |
375 |
+ |
for(int j = 0; j < nHDaubdau; ++ j) { |
376 |
+ |
const Candidate * Bdau = p.daughter( j ); |
377 |
+ |
ctemp.dauid.push_back(Bdau->pdgId()); |
378 |
+ |
} |
379 |
+ |
|
380 |
|
auxInfo->mcC.push_back(ctemp); |
381 |
+ |
|
382 |
|
} |
441 |
– |
|
442 |
– |
if(bin!=-99 && bbarin!=-99){ |
443 |
– |
const Candidate & bGen = (*genParticles)[bin]; |
444 |
– |
const Candidate & bbarGen = (*genParticles)[bbarin]; |
445 |
– |
((auxInfo->mcB).back()).p4=GENPTOLOR(bGen); |
446 |
– |
((auxInfo->mcBbar).back()).p4=GENPTOLOR(bbarGen); |
447 |
– |
|
448 |
– |
int nHDaubdau = bGen.numberOfDaughters(); |
449 |
– |
for(int j = 0; j < nHDaubdau; ++ j) { |
450 |
– |
const Candidate * Bdau = bGen.daughter( j ); |
451 |
– |
((auxInfo->mcB).back()).dauid.push_back(Bdau->pdgId()); |
452 |
– |
((auxInfo->mcB).back()).dauFourMomentum.push_back(GENPTOLORP(Bdau)); |
453 |
– |
} |
454 |
– |
int nHDaubbardau = bbarGen.numberOfDaughters(); |
455 |
– |
for(int j = 0; j < nHDaubbardau; ++ j) { |
456 |
– |
const Candidate * Bbardau = bbarGen.daughter( j ); |
457 |
– |
((auxInfo->mcBbar).back()).dauid.push_back(Bbardau->pdgId()); |
458 |
– |
((auxInfo->mcBbar).back()).dauFourMomentum.push_back(GENPTOLORP(Bbardau)); |
459 |
– |
} |
460 |
– |
|
461 |
– |
} |
383 |
|
|
384 |
|
} |
385 |
|
|
465 |
– |
|
386 |
|
} // isMC |
387 |
|
|
388 |
|
/////// end generator block |
402 |
|
iEvent.getByLabel(subjetLabel_,subjetHandle); |
403 |
|
edm::View<pat::Jet> subjets = *subjetHandle; |
404 |
|
|
405 |
+ |
// filter jet |
406 |
+ |
edm::Handle<edm::View<pat::Jet> > filterjetHandle; |
407 |
+ |
iEvent.getByLabel(filterjetLabel_,filterjetHandle); |
408 |
+ |
edm::View<pat::Jet> filterjets = *filterjetHandle; |
409 |
+ |
|
410 |
|
// standard jets |
411 |
|
|
487 |
– |
edm::Handle<edm::View<pat::Jet> > simplejet1Handle; |
488 |
– |
iEvent.getByLabel(simplejet1Label_,simplejet1Handle); |
489 |
– |
edm::View<pat::Jet> simplejets1 = *simplejet1Handle; |
412 |
|
|
413 |
|
edm::Handle<edm::View<pat::Jet> > simplejet2Handle; |
414 |
|
iEvent.getByLabel(simplejet2Label_,simplejet2Handle); |
418 |
|
iEvent.getByLabel(simplejet3Label_,simplejet3Handle); |
419 |
|
edm::View<pat::Jet> simplejets3 = *simplejet3Handle; |
420 |
|
|
499 |
– |
edm::Handle<edm::View<pat::Jet> > simplejet4Handle; |
500 |
– |
iEvent.getByLabel(simplejet4Label_,simplejet4Handle); |
501 |
– |
edm::View<pat::Jet> simplejets4 = *simplejet4Handle; |
421 |
|
|
422 |
|
|
423 |
|
edm::Handle<edm::View<pat::Electron> > electronHandle; |
424 |
|
iEvent.getByLabel(eleLabel_,electronHandle); |
425 |
|
edm::View<pat::Electron> electrons = *electronHandle; |
426 |
|
|
508 |
– |
edm::Handle<edm::View<pat::MET> > metHandle; |
509 |
– |
iEvent.getByLabel(metLabel_,metHandle); |
510 |
– |
edm::View<pat::MET> mets = *metHandle; |
427 |
|
|
428 |
|
// edm::Handle<edm::View<pat::Photon> > phoHandle; |
429 |
|
// iEvent.getByLabel(phoLabel_,phoHandle); |
432 |
|
edm::Handle<edm::View<pat::Tau> > tauHandle; |
433 |
|
iEvent.getByLabel(tauLabel_,tauHandle); |
434 |
|
edm::View<pat::Tau> taus = *tauHandle; |
435 |
+ |
|
436 |
+ |
//Get the computer for the CSV |
437 |
+ |
ESHandle<JetTagComputer> handle; |
438 |
+ |
iSetup.get<JetTagComputerRecord>().get("combinedSecondaryVertex", handle); |
439 |
+ |
computer = dynamic_cast<const GenericMVAJetTagComputer*>(handle.product()); |
440 |
+ |
|
441 |
+ |
//BTAGGING SCALE FACTOR FROM DATABASE |
442 |
+ |
//Combined Secondary Vertex Loose |
443 |
+ |
edm::ESHandle<BtagPerformance> bTagSF_CSVL_; |
444 |
+ |
iSetup.get<BTagPerformanceRecord>().get("BTAGCSVL",bTagSF_CSVL_); |
445 |
+ |
//Combined Secondary Vertex Medium |
446 |
+ |
edm::ESHandle<BtagPerformance> bTagSF_CSVM_; |
447 |
+ |
iSetup.get<BTagPerformanceRecord>().get("BTAGCSVM",bTagSF_CSVM_); |
448 |
+ |
//Combined Secondary Vertex Tight |
449 |
+ |
edm::ESHandle<BtagPerformance> bTagSF_CSVT_; |
450 |
+ |
iSetup.get<BTagPerformanceRecord>().get("BTAGCSVT",bTagSF_CSVT_); |
451 |
+ |
|
452 |
+ |
edm::ESHandle<BtagPerformance> mistagSF_CSVL_; |
453 |
+ |
iSetup.get<BTagPerformanceRecord>().get("MISTAGCSVL",mistagSF_CSVL_); |
454 |
+ |
//Combined Secondary Vertex Medium |
455 |
+ |
edm::ESHandle<BtagPerformance> mistagSF_CSVM_; |
456 |
+ |
iSetup.get<BTagPerformanceRecord>().get("MISTAGCSVM",mistagSF_CSVM_); |
457 |
+ |
//Combined Secondary Vertex Tight |
458 |
+ |
edm::ESHandle<BtagPerformance> mistagSF_CSVT_; |
459 |
+ |
iSetup.get<BTagPerformanceRecord>().get("MISTAGCSVT",mistagSF_CSVT_); |
460 |
+ |
|
461 |
+ |
BTagSFContainer btagSFs; |
462 |
+ |
btagSFs.BTAGSF_CSVL = (bTagSF_CSVL_.product()); |
463 |
+ |
btagSFs.BTAGSF_CSVM = (bTagSF_CSVM_.product()); |
464 |
+ |
btagSFs.BTAGSF_CSVT = (bTagSF_CSVT_.product()); |
465 |
+ |
btagSFs.MISTAGSF_CSVL = (mistagSF_CSVL_.product()); |
466 |
+ |
btagSFs.MISTAGSF_CSVM = (mistagSF_CSVM_.product()); |
467 |
+ |
btagSFs.MISTAGSF_CSVT = (mistagSF_CSVT_.product()); |
468 |
|
|
469 |
< |
edm::Handle<CandidateView> dimuons; |
470 |
< |
iEvent.getByLabel(dimuLabel_,dimuons); |
469 |
> |
#ifdef ENABLE_SIMPLEJETS1 |
470 |
> |
edm::Handle<edm::View<pat::Jet> > simplejet1Handle; |
471 |
> |
iEvent.getByLabel(simplejet1Label_,simplejet1Handle); |
472 |
> |
edm::View<pat::Jet> simplejets1 = *simplejet1Handle; |
473 |
> |
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets1.begin(); jet_iter!=simplejets1.end(); ++jet_iter){ |
474 |
> |
// if(jet_iter->pt()>50) |
475 |
> |
// njetscounter++; |
476 |
> |
VHbbEvent::SimpleJet sj; |
477 |
> |
// std::cout <<" sj1"<<std::endl; |
478 |
> |
fillSimpleJet(sj,jet_iter); |
479 |
> |
// if(!runOnMC_) |
480 |
|
|
481 |
< |
edm::Handle<CandidateView> dielectrons; |
524 |
< |
iEvent.getByLabel(dielecLabel_,dielectrons); |
481 |
> |
setJecUnc(sj,jecUnc); |
482 |
|
|
483 |
+ |
Particle::LorentzVector p4Jet = jet_iter->p4(); |
484 |
|
|
485 |
< |
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets1.begin(); jet_iter!=simplejets1.end(); ++jet_iter){ |
485 |
> |
if(runOnMC_){ |
486 |
> |
|
487 |
> |
fillScaleFactors(sj, btagSFs); |
488 |
> |
|
489 |
> |
//PAT genJet matching |
490 |
> |
//genJet |
491 |
> |
const reco::GenJet *gJ = jet_iter->genJet(); |
492 |
> |
//physical parton for mother info ONLY |
493 |
> |
if( (jet_iter->genParton()) ){ |
494 |
> |
sj.bestMCid = jet_iter->genParton()->pdgId(); |
495 |
> |
if( (jet_iter->genParton()->mother()) ) |
496 |
> |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
497 |
> |
} |
498 |
> |
TLorentzVector gJp4; |
499 |
> |
if(gJ){ |
500 |
> |
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
501 |
> |
sj.bestMCp4 = gJp4; |
502 |
> |
if(verbose_){ |
503 |
> |
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
504 |
> |
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
505 |
> |
std::clog << "genJet matched deltaR = " <<gJp4.DeltaR(sj.p4) << std::endl; |
506 |
> |
std::clog << "genJet matched mother id = " << sj.bestMCmomid << std::endl; |
507 |
> |
} |
508 |
> |
} |
509 |
> |
|
510 |
> |
} //isMC |
511 |
> |
hbbInfo->simpleJets.push_back(sj); |
512 |
> |
|
513 |
> |
} |
514 |
> |
#endif //ENABLE_SIMPLEJETS1 |
515 |
> |
|
516 |
> |
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets3.begin(); jet_iter!=simplejets3.end(); ++jet_iter){ |
517 |
|
// if(jet_iter->pt()>50) |
518 |
|
// njetscounter++; |
519 |
|
VHbbEvent::SimpleJet sj; |
520 |
< |
sj.flavour = jet_iter->partonFlavour(); |
520 |
> |
// std::cout <<" sj3"<<std::endl; |
521 |
> |
fillSimpleJet(sj,jet_iter); |
522 |
> |
// if(!runOnMC_) |
523 |
> |
setJecUnc(sj,jecUnc); |
524 |
|
|
525 |
< |
sj.tche=jet_iter->bDiscriminator("trackCountingHighEffBJetTags"); |
526 |
< |
sj.tchp=jet_iter->bDiscriminator("trackCountingHighPurBJetTags"); |
527 |
< |
sj.jp=jet_iter->bDiscriminator("jetProbabilityBJetTags"); |
528 |
< |
sj.jpb=jet_iter->bDiscriminator("jetBProbabilityBJetTags"); |
529 |
< |
sj.ssvhe=jet_iter->bDiscriminator("simpleSecondaryVertexHighEffBJetTags"); |
530 |
< |
sj.csv=jet_iter->bDiscriminator("combinedSecondaryVertexBJetTags"); |
531 |
< |
sj.csvmva=jet_iter->bDiscriminator("combinedSecondaryVertexMVABJetTags"); |
532 |
< |
sj.charge=jet_iter->jetCharge(); |
533 |
< |
sj.ntracks=jet_iter->associatedTracks().size(); |
534 |
< |
sj.p4=GENPTOLORP(jet_iter); |
535 |
< |
sj.chargedTracksFourMomentum=(getChargedTracksMomentum(&*(jet_iter))); |
525 |
> |
Particle::LorentzVector p4Jet = jet_iter->p4(); |
526 |
> |
|
527 |
> |
if(runOnMC_){ |
528 |
> |
|
529 |
> |
fillScaleFactors(sj, btagSFs); |
530 |
> |
|
531 |
> |
//PAT genJet matching |
532 |
> |
//genJet |
533 |
> |
const reco::GenJet *gJ = jet_iter->genJet(); |
534 |
> |
//physical parton for mother info ONLY |
535 |
> |
if( (jet_iter->genParton()) ){ |
536 |
> |
sj.bestMCid = jet_iter->genParton()->pdgId(); |
537 |
> |
if( (jet_iter->genParton()->mother()) ) |
538 |
> |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
539 |
> |
} |
540 |
> |
TLorentzVector gJp4; |
541 |
> |
if(gJ){ |
542 |
> |
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
543 |
> |
sj.bestMCp4 = gJp4; |
544 |
> |
if(verbose_){ |
545 |
> |
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
546 |
> |
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
547 |
> |
std::clog << "genJet matched deltaR = " <<gJp4.DeltaR(sj.p4) << std::endl; |
548 |
> |
std::clog << "genJet matched mother id = " << sj.bestMCmomid << std::endl; |
549 |
> |
} |
550 |
> |
} |
551 |
> |
|
552 |
> |
} //isMC |
553 |
> |
// |
554 |
> |
|
555 |
> |
|
556 |
> |
hbbInfo->simpleJets3.push_back(sj); |
557 |
|
|
558 |
< |
// |
559 |
< |
// add tVector |
560 |
< |
// |
561 |
< |
sj.tVector = getTvect(&(*jet_iter)); |
558 |
> |
} |
559 |
> |
|
560 |
> |
#ifdef ENABLE_SIMPLEJETS4 |
561 |
> |
edm::Handle<edm::View<pat::Jet> > simplejet4Handle; |
562 |
> |
iEvent.getByLabel(simplejet4Label_,simplejet4Handle); |
563 |
> |
edm::View<pat::Jet> simplejets4 = *simplejet4Handle; |
564 |
> |
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets4.begin(); jet_iter!=simplejets4.end(); ++jet_iter){ |
565 |
> |
// if(jet_iter->pt()>50) |
566 |
> |
// njetscounter++; |
567 |
> |
|
568 |
> |
VHbbEvent::SimpleJet sj; |
569 |
> |
// std::cout <<" sj4"<<std::endl; |
570 |
> |
fillSimpleJet(sj,jet_iter); |
571 |
> |
// if(!runOnMC_) |
572 |
> |
setJecUnc(sj,jecUnc); |
573 |
> |
|
574 |
> |
|
575 |
|
|
576 |
|
Particle::LorentzVector p4Jet = jet_iter->p4(); |
577 |
|
|
578 |
|
if(runOnMC_){ |
579 |
< |
double minb1DR=9999.; |
580 |
< |
for(size_t i = 0; i < genParticles->size(); ++ i) { |
581 |
< |
const GenParticle & p = (*genParticles)[i]; |
582 |
< |
int id = p.pdgId(); |
583 |
< |
if(abs(id)<=6 || id==21 || id==23 || abs(id)==24){ |
584 |
< |
double bb1DR=TMath::Sqrt((p.eta()-p4Jet.eta())*(p.eta()-p4Jet.eta())+ |
585 |
< |
(p.phi()-p4Jet.phi())*(p.phi()-p4Jet.phi())); |
586 |
< |
if(bb1DR<minb1DR) {minb1DR=bb1DR; sj.bestMCid=id; if(p.mother()!=0) sj.bestMCmomid=p.mother()->pdgId();} |
579 |
> |
|
580 |
> |
fillScaleFactors(sj, btagSFs); |
581 |
> |
|
582 |
> |
//PAT genJet matching |
583 |
> |
//genJet |
584 |
> |
const reco::GenJet *gJ = jet_iter->genJet(); |
585 |
> |
//physical parton for mother info ONLY |
586 |
> |
if( (jet_iter->genParton()) ){ |
587 |
> |
sj.bestMCid = jet_iter->genParton()->pdgId(); |
588 |
> |
if( (jet_iter->genParton()->mother()) ) |
589 |
> |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
590 |
> |
} |
591 |
> |
TLorentzVector gJp4; |
592 |
> |
if(gJ){ |
593 |
> |
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
594 |
> |
sj.bestMCp4 = 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 |
< |
} //isMC |
603 |
< |
hbbInfo->simpleJets.push_back(sj); |
602 |
> |
|
603 |
> |
} //isMC |
604 |
> |
hbbInfo->simpleJets4.push_back(sj); |
605 |
|
|
606 |
|
} |
607 |
< |
|
608 |
< |
|
607 |
> |
#endif //ENABLE SIMPLEJETS4 |
608 |
> |
|
609 |
> |
|
610 |
|
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets2.begin(); jet_iter!=simplejets2.end(); ++jet_iter){ |
611 |
|
|
612 |
+ |
|
613 |
+ |
|
614 |
|
VHbbEvent::SimpleJet sj; |
615 |
< |
sj.flavour = jet_iter->partonFlavour(); |
615 |
> |
// std::cout <<" sj2"<<std::endl; |
616 |
> |
fillSimpleJet(sj,jet_iter); |
617 |
> |
|
618 |
> |
///########### PU JET ID ################# |
619 |
> |
// add puId... |
620 |
> |
edm::Handle<edm::ValueMap<float> > puJetIdMVA; |
621 |
> |
iEvent.getByLabel("puJetMva","fullDiscriminant", puJetIdMVA); |
622 |
> |
|
623 |
> |
edm::Handle<edm::ValueMap<int> > puJetIdFlag; |
624 |
> |
iEvent.getByLabel("puJetMva", "fullId", puJetIdFlag); |
625 |
> |
|
626 |
> |
// cout << " pt " << jet_iter->pt() << " eta " << jet_iter->eta() << std::endl; |
627 |
> |
unsigned int idx = jet_iter - simplejets2.begin(); |
628 |
> |
|
629 |
> |
|
630 |
> |
|
631 |
> |
sj.puJetIdMva = (*puJetIdMVA)[simplejets2.refAt(idx)]; |
632 |
> |
int idflag = (*puJetIdFlag)[simplejets2.refAt(idx)]; |
633 |
> |
|
634 |
> |
|
635 |
> |
// cout << " PU JetID MVA " << mva; |
636 |
> |
if( PileupJetIdentifier::passJetId( idflag, PileupJetIdentifier::kLoose )) { |
637 |
> |
//cout << " pass loose wp"; |
638 |
> |
sj.puJetIdL =1; |
639 |
> |
} |
640 |
> |
if( PileupJetIdentifier::passJetId( idflag, PileupJetIdentifier::kMedium )) { |
641 |
> |
// cout << " pass medium wp"; |
642 |
> |
sj.puJetIdM =1; |
643 |
> |
} |
644 |
> |
if( PileupJetIdentifier::passJetId( idflag, PileupJetIdentifier::kTight )) { |
645 |
> |
// cout << " pass tight wp"; |
646 |
> |
sj.puJetIdT =1; |
647 |
> |
} |
648 |
> |
// cout << endl; |
649 |
> |
// ############# END OF PU JET ID ###################### |
650 |
> |
|
651 |
> |
|
652 |
> |
// if(!runOnMC_) |
653 |
> |
setJecUnc(sj,jecUnc); |
654 |
> |
/* sj.flavour = jet_iter->partonFlavour(); |
655 |
|
|
656 |
|
|
657 |
|
sj.tche=jet_iter->bDiscriminator("trackCountingHighEffBJetTags"); |
665 |
|
sj.ntracks=jet_iter->associatedTracks().size(); |
666 |
|
sj.p4=GENPTOLORP(jet_iter); |
667 |
|
sj.chargedTracksFourMomentum=(getChargedTracksMomentum(&*(jet_iter))); |
668 |
< |
sj.tVector = getTvect(&(*jet_iter)); |
668 |
> |
sj.SF_CSVL=1; |
669 |
> |
sj.SF_CSVM=1; |
670 |
> |
sj.SF_CSVT=1; |
671 |
> |
sj.SF_CSVLerr=0; |
672 |
> |
sj.SF_CSVMerr=0; |
673 |
> |
sj.SF_CSVTerr=0; |
674 |
> |
|
675 |
> |
|
676 |
> |
// |
677 |
> |
// addtaginfo for csv |
678 |
> |
// |
679 |
> |
|
680 |
> |
if (jet_iter->hasTagInfo("SimpleSecondaryVertex")) { |
681 |
> |
|
682 |
> |
const reco::SecondaryVertexTagInfo * tf = jet_iter->tagInfoSecondaryVertex(); |
683 |
> |
sj.vtxMass = tf->secondaryVertex(0).p4().mass(); |
684 |
> |
sj.vtxNTracks = tf->secondaryVertex(0).nTracks(); |
685 |
> |
Measurement1D m = tf->flightDistance(0); |
686 |
> |
sj.vtx3dL = m.value(); |
687 |
> |
sj.vtx3deL = m.error(); |
688 |
> |
} |
689 |
> |
|
690 |
|
|
691 |
+ |
// |
692 |
+ |
// add tVector |
693 |
+ |
// |
694 |
+ |
sj.tVector = getTvect(&(*jet_iter)); |
695 |
+ |
*/ |
696 |
|
Particle::LorentzVector p4Jet = jet_iter->p4(); |
697 |
|
|
698 |
|
if(runOnMC_){ |
699 |
< |
double minb2DR=9999.; |
700 |
< |
for(size_t i = 0; i < genParticles->size(); ++ i) { |
701 |
< |
const GenParticle & p = (*genParticles)[i]; |
702 |
< |
int id = p.pdgId(); |
703 |
< |
if(abs(id)<=6 || id==21 || id==23 || abs(id)==24){ |
704 |
< |
double bb2DR=TMath::Sqrt((p.eta()-p4Jet.eta())*(p.eta()-p4Jet.eta())+ |
705 |
< |
(p.phi()-p4Jet.phi())*(p.phi()-p4Jet.phi())); |
706 |
< |
if(bb2DR<minb2DR) {minb2DR=bb2DR; sj.bestMCid=id; if(p.mother()!=0) sj.bestMCmomid=p.mother()->pdgId();} |
699 |
> |
|
700 |
> |
//BTV scale factors |
701 |
> |
fillScaleFactors(sj, btagSFs); |
702 |
> |
|
703 |
> |
//PAT genJet matching |
704 |
> |
//genJet |
705 |
> |
const reco::GenJet *gJ = jet_iter->genJet(); |
706 |
> |
//physical parton for mother info ONLY |
707 |
> |
if( (jet_iter->genParton()) ){ |
708 |
> |
sj.bestMCid = jet_iter->genParton()->pdgId(); |
709 |
> |
if( (jet_iter->genParton()->mother()) ) |
710 |
> |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
711 |
> |
} |
712 |
> |
TLorentzVector gJp4; |
713 |
> |
if(gJ){ |
714 |
> |
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
715 |
> |
sj.bestMCp4 = gJp4; |
716 |
> |
if(verbose_){ |
717 |
> |
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
718 |
> |
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
719 |
> |
std::clog << "genJet matched deltaR = " << gJp4.DeltaR(sj.p4) << std::endl; |
720 |
> |
std::clog << "genJet matched mother id = " << sj.bestMCmomid << std::endl; |
721 |
|
} |
722 |
|
} |
723 |
< |
} //isMC |
723 |
> |
|
724 |
> |
// add flag if a mc lepton is find inside a cone around the jets... |
725 |
> |
iEvent.getByLabel("genParticles", genParticles); |
726 |
> |
|
727 |
> |
for(size_t i = 0; i < genParticles->size(); ++ i) { |
728 |
> |
|
729 |
> |
const GenParticle & p = (*genParticles)[i]; |
730 |
> |
int id = 0; |
731 |
> |
p.pt()> lep_ptCutForBjets_ ? id= p.pdgId(): 0; |
732 |
> |
|
733 |
> |
// std::cout<< "found a muon with pt " << mu->pt() << std::endl; |
734 |
> |
if ((abs(id)==13 || abs(id)==11) && deltaR(p.eta(), p.phi(), sj.p4.Eta(), sj.p4.Phi() ) <0.5) sj.isSemiLeptMCtruth=1; |
735 |
> |
} |
736 |
> |
|
737 |
> |
} //isMC |
738 |
> |
|
739 |
> |
// add flag if a reco lepton is find inside a cone around the jets... |
740 |
> |
edm::Handle<edm::View<reco::Candidate> > muonNoCutsHandle; |
741 |
> |
iEvent.getByLabel(muonoCutsLabel_,muonNoCutsHandle); |
742 |
> |
edm::View<reco::Candidate> muonsNoCuts = *muonNoCutsHandle; |
743 |
> |
|
744 |
> |
|
745 |
> |
|
746 |
> |
for(edm::View<reco::Candidate>::const_iterator mu = muonsNoCuts.begin(); mu!=muonsNoCuts.end() && sj.isSemiLept!=1; ++mu){ |
747 |
> |
// std::cout<< "found a muon with pt " << mu->pt() << std::endl; |
748 |
> |
const pat::Muon& m = static_cast <const pat::Muon&> (*mu); |
749 |
> |
float Smpt = m.pt(); |
750 |
> |
float Smeta = m.eta(); |
751 |
> |
float Smphi = m.phi(); |
752 |
> |
|
753 |
> |
float SmJdR = deltaR(Smeta, Smphi, sj.p4.Eta(), sj.p4.Phi()); |
754 |
> |
|
755 |
> |
if ( Smpt> lep_ptCutForBjets_ && SmJdR <0.5) { |
756 |
> |
sj.isSemiLept=1; |
757 |
> |
//isSemiLept(-99), isSemiLeptMCtruth(-99), SoftLeptPt(-99), SoftLeptdR(-99), SoftLeptptRel(-99), SoftLeptpdgId(-99), SoftLeptIdlooseMu(-99), SoftLeptId95(-99), SoftLeptRelCombIso(-99), |
758 |
> |
sj.SoftLeptpdgId =13; |
759 |
> |
sj.SoftLeptdR= SmJdR; |
760 |
> |
sj.SoftLeptPt=Smpt; |
761 |
> |
TVector3 mvec ( m.p4().Vect().X(), m.p4().Vect().Y(), m.p4().Vect().Z() ); |
762 |
> |
sj.SoftLeptptRel= sj.p4.Perp( mvec ); |
763 |
> |
sj.SoftLeptRelCombIso = (m.trackIso() + m.ecalIso() + m.hcalIso() ) / Smpt ; |
764 |
> |
sj.SoftLeptIdlooseMu=m.muonID("TMLastStationLoose"); |
765 |
> |
} |
766 |
> |
} |
767 |
> |
|
768 |
> |
|
769 |
> |
edm::Handle<edm::View<reco::Candidate> > eleNoCutsHandle; |
770 |
> |
iEvent.getByLabel(elenoCutsLabel_,eleNoCutsHandle); |
771 |
> |
edm::View<reco::Candidate> elesNoCuts = *eleNoCutsHandle; |
772 |
> |
|
773 |
> |
|
774 |
> |
|
775 |
> |
for(edm::View<reco::Candidate>::const_iterator ele = elesNoCuts.begin(); ele!=elesNoCuts.end() && sj.isSemiLept!=1; ++ele){ |
776 |
> |
|
777 |
> |
const pat::Electron& e = static_cast <const pat::Electron&> (*ele); |
778 |
> |
float Smpt = e.pt(); |
779 |
> |
float Smeta = e.eta(); |
780 |
> |
float Smphi = e.phi(); |
781 |
> |
|
782 |
> |
float SmJdR = deltaR(Smeta, Smphi, sj.p4.Eta(), sj.p4.Phi()); |
783 |
> |
if ( Smpt> lep_ptCutForBjets_ && SmJdR <0.5) { |
784 |
> |
sj.isSemiLept=1; |
785 |
> |
sj.SoftLeptpdgId =11; |
786 |
> |
sj.SoftLeptdR= SmJdR; |
787 |
> |
sj.SoftLeptPt=Smpt; |
788 |
> |
TVector3 mvec ( e.p4().Vect().X(), e.p4().Vect().Y(), e.p4().Vect().Z() ); |
789 |
> |
sj.SoftLeptptRel= sj.p4.Perp( mvec ); |
790 |
> |
sj.SoftLeptRelCombIso = (e.trackIso() + e.ecalIso() + e.hcalIso() ) / Smpt ; |
791 |
> |
// sj.SoftLeptId95=e.electronID("eidVBTFCom95"); |
792 |
> |
//std::cout << "before ele id " << std::endl; |
793 |
> |
// std::cout << " e.e.sigmaIetaIeta " << e.sigmaIetaIeta() << std::endl; |
794 |
> |
//std::cout << " e.isEB() " << e.isEB() << std::endl; |
795 |
> |
if ( |
796 |
> |
( fabs(Smeta)<2.5 && !( abs(Smeta)>1.4442 && abs(Smeta)<1.566)) && |
797 |
> |
|
798 |
> |
(( abs(Smeta)>1.566 && (e.sigmaIetaIeta()<0.01) && ( e.deltaPhiSuperClusterTrackAtVtx()<0.8 && e.deltaPhiSuperClusterTrackAtVtx()>-0.8) && ( e.deltaEtaSuperClusterTrackAtVtx()<0.007 && e.deltaEtaSuperClusterTrackAtVtx()>-0.007 ) ) |
799 |
> |
|| ( abs(Smeta)<1.4442 && (e.sigmaIetaIeta()<0.03) && ( e.deltaPhiSuperClusterTrackAtVtx()<0.7 && e.deltaPhiSuperClusterTrackAtVtx()>-0.7 ) && ( e.deltaEtaSuperClusterTrackAtVtx()<0.01 && e.deltaEtaSuperClusterTrackAtVtx()>-0.01 ) )) |
800 |
> |
) |
801 |
> |
sj.SoftLeptId95=1; |
802 |
> |
} |
803 |
> |
} |
804 |
> |
|
805 |
> |
|
806 |
> |
|
807 |
> |
|
808 |
|
|
809 |
|
hbbInfo->simpleJets2.push_back(sj); |
810 |
|
|
842 |
|
VHbbEvent::HardJet hj; |
843 |
|
hj.constituents=constituents.size(); |
844 |
|
hj.p4 =GENPTOLORP(jet_iter); |
845 |
< |
|
845 |
> |
|
846 |
|
for (unsigned int iJC(0); iJC<constituents.size(); ++iJC ){ |
847 |
|
Jet::Constituent icandJet = constituents[iJC]; |
848 |
|
|
875 |
|
<< "," << subjet_iter->bDiscriminator("combinedSecondaryVertexBJetTags") << "\n";} |
876 |
|
|
877 |
|
VHbbEvent::SimpleJet sj; |
878 |
< |
|
879 |
< |
sj.flavour = subjet_iter->partonFlavour(); |
878 |
> |
// std::cout <<" sub jet "<<std::endl; |
879 |
> |
fillSimpleJet(sj,subjet_iter); |
880 |
> |
// if(!runOnMC_) |
881 |
> |
setJecUnc(sj,jecUnc); |
882 |
> |
/* sj.flavour = subjet_iter->partonFlavour(); |
883 |
|
sj.tVector = getTvect(&(*subjet_iter)); |
884 |
|
sj.tche=subjet_iter->bDiscriminator("trackCountingHighEffBJetTags"); |
885 |
|
sj.tchp=subjet_iter->bDiscriminator("trackCountingHighPurBJetTags"); |
892 |
|
sj.ntracks=subjet_iter->associatedTracks().size(); |
893 |
|
sj.p4=GENPTOLORP(subjet_iter); |
894 |
|
sj.p4=(getChargedTracksMomentum(&*(subjet_iter))); |
895 |
+ |
|
896 |
+ |
// |
897 |
+ |
// addtaginfo for csv |
898 |
+ |
// |
899 |
+ |
|
900 |
+ |
if (subjet_iter->hasTagInfo("SimpleSecondaryVertex")) { |
901 |
+ |
|
902 |
+ |
const reco::SecondaryVertexTagInfo * tf = subjet_iter->tagInfoSecondaryVertex(); |
903 |
+ |
sj.vtxMass = tf->secondaryVertex(0).p4().mass(); |
904 |
+ |
sj.vtxNTracks = tf->secondaryVertex(0).nTracks(); |
905 |
+ |
Measurement1D m = tf->flightDistance(0); |
906 |
+ |
sj.vtx3dL = m.value(); |
907 |
+ |
sj.vtx3deL = m.error(); |
908 |
+ |
} |
909 |
+ |
*/ |
910 |
|
hbbInfo->subJets.push_back(sj); |
911 |
|
|
912 |
|
} |
913 |
|
|
914 |
+ |
for(edm::View<pat::Jet>::const_iterator filterjet_iter = filterjets.begin(); filterjet_iter!=filterjets.end(); ++filterjet_iter){ |
915 |
+ |
|
916 |
+ |
if(printJet) {std::cout << "FilterjetTagged Pt: " << filterjet_iter->pt() << " E,M,eta,phi,Btag: " << filterjet_iter->p4().E() << "," << filterjet_iter->p4().M() << "," << filterjet_iter->eta() << "," << filterjet_iter->phi() << "," << filterjet_iter->bDiscriminator("combinedSecondaryVertexBJetTags") << "\n";} |
917 |
+ |
|
918 |
+ |
VHbbEvent::SimpleJet fj; |
919 |
+ |
// std::cout <<" sub jet "<<std::endl; |
920 |
+ |
fillSimpleJet(fj,filterjet_iter); |
921 |
+ |
// if(!runOnMC_) |
922 |
+ |
setJecUnc(fj,jecUnc); |
923 |
+ |
|
924 |
+ |
hbbInfo->filterJets.push_back(fj); |
925 |
+ |
|
926 |
+ |
|
927 |
+ |
} |
928 |
+ |
|
929 |
+ |
// |
930 |
+ |
// add charged met |
931 |
+ |
// |
932 |
+ |
|
933 |
+ |
edm::Handle<edm::View<reco::MET> > metChargedHandle; |
934 |
+ |
iEvent.getByLabel("pfMETNoPUCharge",metChargedHandle); |
935 |
+ |
edm::View<reco::MET> metsCh = *metChargedHandle; |
936 |
+ |
if(metsCh.size()){ |
937 |
+ |
hbbInfo->metCh.sumEt=(metsCh[0]).sumEt(); |
938 |
+ |
hbbInfo->metCh.metSig=metSignificance(& (metsCh[0])); |
939 |
+ |
hbbInfo->metCh.eLong=(metsCh[0]).e_longitudinal(); |
940 |
+ |
hbbInfo->metCh.p4=GENPTOLOR((metsCh[0])); |
941 |
+ |
if (verbose_) std::cout <<" METCharged "<< hbbInfo->metCh.metSig <<" " << hbbInfo->metCh.sumEt<<std::endl; |
942 |
+ |
} |
943 |
+ |
|
944 |
+ |
// type 1 corr met |
945 |
+ |
edm::Handle<edm::View<reco::MET> > pfmetType1corrHandle; |
946 |
+ |
iEvent.getByLabel("patType1CorrectedPFMet",pfmetType1corrHandle); |
947 |
+ |
edm::View<reco::MET> pfmetsType1corr = *pfmetType1corrHandle; |
948 |
+ |
if(pfmetsType1corr.size()){ |
949 |
+ |
hbbInfo->pfmetType1corr.sumEt=(pfmetsType1corr[0]).sumEt(); |
950 |
+ |
hbbInfo->pfmetType1corr.metSig=metSignificance(& (pfmetsType1corr[0])); |
951 |
+ |
hbbInfo->pfmetType1corr.eLong=(pfmetsType1corr[0]).e_longitudinal(); |
952 |
+ |
hbbInfo->pfmetType1corr.p4=GENPTOLOR((pfmetsType1corr[0])); |
953 |
+ |
if (verbose_) std::cout <<" type 1 corrected pfMET "<< hbbInfo->pfmetType1corr.metSig <<" " << hbbInfo->pfmetType1corr.sumEt<<std::endl; |
954 |
+ |
} |
955 |
+ |
|
956 |
+ |
|
957 |
+ |
// type 1 + 2 corr met |
958 |
+ |
edm::Handle<edm::View<reco::MET> > pfmetType1p2corrHandle; |
959 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMet",pfmetType1p2corrHandle); |
960 |
+ |
edm::View<reco::MET> pfmetsType1p2corr = *pfmetType1p2corrHandle; |
961 |
+ |
if(pfmetsType1p2corr.size()){ |
962 |
+ |
hbbInfo->pfmetType1p2corr.sumEt=(pfmetsType1p2corr[0]).sumEt(); |
963 |
+ |
hbbInfo->pfmetType1p2corr.metSig=metSignificance(& (pfmetsType1p2corr[0])); |
964 |
+ |
hbbInfo->pfmetType1p2corr.eLong=(pfmetsType1p2corr[0]).e_longitudinal(); |
965 |
+ |
hbbInfo->pfmetType1p2corr.p4=GENPTOLOR((pfmetsType1p2corr[0])); |
966 |
+ |
if (verbose_) std::cout <<" type 1 +2 corrected pfMET "<< hbbInfo->pfmetType1p2corr.metSig <<" " << hbbInfo->pfmetType1p2corr.sumEt<<std::endl; |
967 |
+ |
} |
968 |
+ |
|
969 |
+ |
// type 1 corr met NoPU |
970 |
+ |
/* edm::Handle<edm::View<reco::MET> > pfmetNoPUType1corrHandle; |
971 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetNoPU",pfmetNoPUType1corrHandle); |
972 |
+ |
edm::View<reco::MET> pfmetsNoPUType1corr = *pfmetNoPUType1corrHandle; |
973 |
+ |
if(pfmetsNoPUType1corr.size()){ |
974 |
+ |
hbbInfo->pfmetNoPUType1corr.sumEt=(pfmetsNoPUType1corr[0]).sumEt(); |
975 |
+ |
hbbInfo->pfmetNoPUType1corr.metSig=metSignificance(& (pfmetsNoPUType1corr[0])); |
976 |
+ |
hbbInfo->pfmetNoPUType1corr.eLong=(pfmetsNoPUType1corr[0]).e_longitudinal(); |
977 |
+ |
hbbInfo->pfmetNoPUType1corr.p4=GENPTOLOR((pfmetsNoPUType1corr[0])); |
978 |
+ |
if (verbose_) std::cout <<" type 1 corrected pfMET NoPU"<< hbbInfo->pfmetNoPUType1corr.metSig <<" " << hbbInfo->pfmetNoPUType1corr.sumEt<<std::endl; |
979 |
+ |
} |
980 |
+ |
|
981 |
+ |
|
982 |
+ |
// type 1 + 2 corr met |
983 |
+ |
edm::Handle<edm::View<reco::MET> > pfmetNoPUType1p2corrHandle; |
984 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetNoPU",pfmetNoPUType1p2corrHandle); |
985 |
+ |
edm::View<reco::MET> pfmetsNoPUType1p2corr = *pfmetNoPUType1p2corrHandle; |
986 |
+ |
if(pfmetsNoPUType1p2corr.size()){ |
987 |
+ |
hbbInfo->pfmetNoPUType1p2corr.sumEt=(pfmetsNoPUType1p2corr[0]).sumEt(); |
988 |
+ |
hbbInfo->pfmetNoPUType1p2corr.metSig=metSignificance(& (pfmetsNoPUType1p2corr[0])); |
989 |
+ |
hbbInfo->pfmetNoPUType1p2corr.eLong=(pfmetsNoPUType1p2corr[0]).e_longitudinal(); |
990 |
+ |
hbbInfo->pfmetNoPUType1p2corr.p4=GENPTOLOR((pfmetsNoPUType1p2corr[0])); |
991 |
+ |
if (verbose_) std::cout <<" type 1 +2 corrected pfMET "<< hbbInfo->pfmetNoPUType1p2corr.metSig <<" " << hbbInfo->pfmetNoPUType1p2corr.sumEt<<std::endl; |
992 |
+ |
} |
993 |
+ |
|
994 |
+ |
*/ |
995 |
+ |
|
996 |
+ |
/* |
997 |
+ |
// MET uncertainty vector |
998 |
+ |
vector<pat::MET> "patType1CorrectedPFMet" "" "VH" |
999 |
+ |
vector<pat::MET> "patType1CorrectedPFMetElectronEnDown" "" "VH" |
1000 |
+ |
vector<pat::MET> "patType1CorrectedPFMetElectronEnUp" "" "VH" |
1001 |
+ |
vector<pat::MET> "patType1CorrectedPFMetJetEnDown" "" "VH" |
1002 |
+ |
vector<pat::MET> "patType1CorrectedPFMetJetEnUp" "" "VH" |
1003 |
+ |
vector<pat::MET> "patType1CorrectedPFMetJetResDown" "" "VH" |
1004 |
+ |
vector<pat::MET> "patType1CorrectedPFMetJetResUp" "" "VH" |
1005 |
+ |
vector<pat::MET> "patType1CorrectedPFMetMuonEnDown" "" "VH" |
1006 |
+ |
vector<pat::MET> "patType1CorrectedPFMetMuonEnUp" "" "VH" |
1007 |
+ |
vector<pat::MET> "patType1CorrectedPFMetNoPU" "" "VH" |
1008 |
+ |
vector<pat::MET> "patType1CorrectedPFMetTauEnDown" "" "VH" |
1009 |
+ |
vector<pat::MET> "patType1CorrectedPFMetTauEnUp" "" "VH" |
1010 |
+ |
vector<pat::MET> "patType1CorrectedPFMetUnclusteredEnDown" "" "VH" |
1011 |
+ |
vector<pat::MET> "patType1CorrectedPFMetUnclusteredEnUp" "" "VH" |
1012 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMet" "" "VH" |
1013 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetElectronEnDown" "" "VH" |
1014 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetElectronEnUp" "" "VH" |
1015 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetJetEnDown" "" "VH" |
1016 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetJetEnUp" "" "VH" |
1017 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetJetResDown" "" "VH" |
1018 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetJetResUp" "" "VH" |
1019 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetMuonEnDown" "" "VH" |
1020 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetMuonEnUp" "" "VH" |
1021 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetNoPU" "" "VH" |
1022 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetTauEnDown" "" "VH" |
1023 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetTauEnUp" "" "VH" |
1024 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetUnclusteredEnDown" "" "VH" |
1025 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetUnclusteredEnUp" "" "VH" |
1026 |
+ |
*/ |
1027 |
+ |
|
1028 |
+ |
VHbbEvent::METInfo metunc; |
1029 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetElectronEnDownHandle; |
1030 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetElectronEnDown",patType1CorrectedPFMetElectronEnDownHandle); |
1031 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsElectronEnDown = *patType1CorrectedPFMetElectronEnDownHandle; |
1032 |
+ |
if(patType1CorrectedPFMetsElectronEnDown.size()){ |
1033 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsElectronEnDown[0]).sumEt(); |
1034 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsElectronEnDown[0])); |
1035 |
+ |
metunc.eLong=(patType1CorrectedPFMetsElectronEnDown[0]).e_longitudinal(); |
1036 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsElectronEnDown[0])); |
1037 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1038 |
+ |
} |
1039 |
+ |
|
1040 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetElectronEnUpHandle; |
1041 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetElectronEnUp",patType1CorrectedPFMetElectronEnUpHandle); |
1042 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsElectronEnUp = *patType1CorrectedPFMetElectronEnUpHandle; |
1043 |
+ |
if(patType1CorrectedPFMetsElectronEnUp.size()){ |
1044 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsElectronEnUp[0]).sumEt(); |
1045 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsElectronEnUp[0])); |
1046 |
+ |
metunc.eLong=(patType1CorrectedPFMetsElectronEnUp[0]).e_longitudinal(); |
1047 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsElectronEnUp[0])); |
1048 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1049 |
+ |
} |
1050 |
+ |
|
1051 |
+ |
|
1052 |
+ |
|
1053 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetMuonEnDownHandle; |
1054 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetMuonEnDown",patType1CorrectedPFMetMuonEnDownHandle); |
1055 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsMuonEnDown = *patType1CorrectedPFMetMuonEnDownHandle; |
1056 |
+ |
if(patType1CorrectedPFMetsMuonEnDown.size()){ |
1057 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsMuonEnDown[0]).sumEt(); |
1058 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsMuonEnDown[0])); |
1059 |
+ |
metunc.eLong=(patType1CorrectedPFMetsMuonEnDown[0]).e_longitudinal(); |
1060 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsMuonEnDown[0])); |
1061 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1062 |
+ |
} |
1063 |
+ |
|
1064 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetMuonEnUpHandle; |
1065 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetMuonEnUp",patType1CorrectedPFMetMuonEnUpHandle); |
1066 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsMuonEnUp = *patType1CorrectedPFMetMuonEnUpHandle; |
1067 |
+ |
if(patType1CorrectedPFMetsMuonEnUp.size()){ |
1068 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsMuonEnUp[0]).sumEt(); |
1069 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsMuonEnUp[0])); |
1070 |
+ |
metunc.eLong=(patType1CorrectedPFMetsMuonEnUp[0]).e_longitudinal(); |
1071 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsMuonEnUp[0])); |
1072 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1073 |
+ |
} |
1074 |
+ |
|
1075 |
+ |
|
1076 |
+ |
|
1077 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetTauEnDownHandle; |
1078 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetTauEnDown",patType1CorrectedPFMetTauEnDownHandle); |
1079 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsTauEnDown = *patType1CorrectedPFMetTauEnDownHandle; |
1080 |
+ |
if(patType1CorrectedPFMetsTauEnDown.size()){ |
1081 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsTauEnDown[0]).sumEt(); |
1082 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsTauEnDown[0])); |
1083 |
+ |
metunc.eLong=(patType1CorrectedPFMetsTauEnDown[0]).e_longitudinal(); |
1084 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsTauEnDown[0])); |
1085 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1086 |
+ |
} |
1087 |
+ |
|
1088 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetTauEnUpHandle; |
1089 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetTauEnUp",patType1CorrectedPFMetTauEnUpHandle); |
1090 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsTauEnUp = *patType1CorrectedPFMetTauEnUpHandle; |
1091 |
+ |
if(patType1CorrectedPFMetsTauEnUp.size()){ |
1092 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsTauEnUp[0]).sumEt(); |
1093 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsTauEnUp[0])); |
1094 |
+ |
metunc.eLong=(patType1CorrectedPFMetsTauEnUp[0]).e_longitudinal(); |
1095 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsTauEnUp[0])); |
1096 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1097 |
+ |
} |
1098 |
+ |
|
1099 |
+ |
|
1100 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetJetEnDownHandle; |
1101 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetJetEnDown",patType1CorrectedPFMetJetEnDownHandle); |
1102 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsJetEnDown = *patType1CorrectedPFMetJetEnDownHandle; |
1103 |
+ |
if(patType1CorrectedPFMetsJetEnDown.size()){ |
1104 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsJetEnDown[0]).sumEt(); |
1105 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsJetEnDown[0])); |
1106 |
+ |
metunc.eLong=(patType1CorrectedPFMetsJetEnDown[0]).e_longitudinal(); |
1107 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsJetEnDown[0])); |
1108 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1109 |
+ |
} |
1110 |
+ |
|
1111 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetJetEnUpHandle; |
1112 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetJetEnUp",patType1CorrectedPFMetJetEnUpHandle); |
1113 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsJetEnUp = *patType1CorrectedPFMetJetEnUpHandle; |
1114 |
+ |
if(patType1CorrectedPFMetsJetEnUp.size()){ |
1115 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsJetEnUp[0]).sumEt(); |
1116 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsJetEnUp[0])); |
1117 |
+ |
metunc.eLong=(patType1CorrectedPFMetsJetEnUp[0]).e_longitudinal(); |
1118 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsJetEnUp[0])); |
1119 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1120 |
+ |
} |
1121 |
+ |
|
1122 |
+ |
|
1123 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetJetResDownHandle; |
1124 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetJetResDown",patType1CorrectedPFMetJetResDownHandle); |
1125 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsJetResDown = *patType1CorrectedPFMetJetResDownHandle; |
1126 |
+ |
if(patType1CorrectedPFMetsJetResDown.size()){ |
1127 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsJetResDown[0]).sumEt(); |
1128 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsJetResDown[0])); |
1129 |
+ |
metunc.eLong=(patType1CorrectedPFMetsJetResDown[0]).e_longitudinal(); |
1130 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsJetResDown[0])); |
1131 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1132 |
+ |
} |
1133 |
+ |
|
1134 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetJetResUpHandle; |
1135 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetJetResUp",patType1CorrectedPFMetJetResUpHandle); |
1136 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsJetResUp = *patType1CorrectedPFMetJetResUpHandle; |
1137 |
+ |
if(patType1CorrectedPFMetsJetResUp.size()){ |
1138 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsJetResUp[0]).sumEt(); |
1139 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsJetResUp[0])); |
1140 |
+ |
metunc.eLong=(patType1CorrectedPFMetsJetResUp[0]).e_longitudinal(); |
1141 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsJetResUp[0])); |
1142 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1143 |
+ |
} |
1144 |
+ |
|
1145 |
+ |
|
1146 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetUnclusteredEnDownHandle; |
1147 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetUnclusteredEnDown",patType1CorrectedPFMetUnclusteredEnDownHandle); |
1148 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsUnclusteredEnDown = *patType1CorrectedPFMetUnclusteredEnDownHandle; |
1149 |
+ |
if(patType1CorrectedPFMetsUnclusteredEnDown.size()){ |
1150 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsUnclusteredEnDown[0]).sumEt(); |
1151 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsUnclusteredEnDown[0])); |
1152 |
+ |
metunc.eLong=(patType1CorrectedPFMetsUnclusteredEnDown[0]).e_longitudinal(); |
1153 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsUnclusteredEnDown[0])); |
1154 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1155 |
+ |
} |
1156 |
+ |
|
1157 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetUnclusteredEnUpHandle; |
1158 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetUnclusteredEnUp",patType1CorrectedPFMetUnclusteredEnUpHandle); |
1159 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsUnclusteredEnUp = *patType1CorrectedPFMetUnclusteredEnUpHandle; |
1160 |
+ |
if(patType1CorrectedPFMetsUnclusteredEnUp.size()){ |
1161 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsUnclusteredEnUp[0]).sumEt(); |
1162 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsUnclusteredEnUp[0])); |
1163 |
+ |
metunc.eLong=(patType1CorrectedPFMetsUnclusteredEnUp[0]).e_longitudinal(); |
1164 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsUnclusteredEnUp[0])); |
1165 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1166 |
+ |
} |
1167 |
+ |
|
1168 |
+ |
|
1169 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetElectronEnDownHandle; |
1170 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetElectronEnDown",patType1p2CorrectedPFMetElectronEnDownHandle); |
1171 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsElectronEnDown = *patType1p2CorrectedPFMetElectronEnDownHandle; |
1172 |
+ |
if(patType1p2CorrectedPFMetsElectronEnDown.size()){ |
1173 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsElectronEnDown[0]).sumEt(); |
1174 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsElectronEnDown[0])); |
1175 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsElectronEnDown[0]).e_longitudinal(); |
1176 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsElectronEnDown[0])); |
1177 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1178 |
+ |
} |
1179 |
+ |
|
1180 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetElectronEnUpHandle; |
1181 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetElectronEnUp",patType1p2CorrectedPFMetElectronEnUpHandle); |
1182 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsElectronEnUp = *patType1p2CorrectedPFMetElectronEnUpHandle; |
1183 |
+ |
if(patType1p2CorrectedPFMetsElectronEnUp.size()){ |
1184 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsElectronEnUp[0]).sumEt(); |
1185 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsElectronEnUp[0])); |
1186 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsElectronEnUp[0]).e_longitudinal(); |
1187 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsElectronEnUp[0])); |
1188 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1189 |
+ |
} |
1190 |
+ |
|
1191 |
+ |
|
1192 |
+ |
|
1193 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetMuonEnDownHandle; |
1194 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetMuonEnDown",patType1p2CorrectedPFMetMuonEnDownHandle); |
1195 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsMuonEnDown = *patType1p2CorrectedPFMetMuonEnDownHandle; |
1196 |
+ |
if(patType1p2CorrectedPFMetsMuonEnDown.size()){ |
1197 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsMuonEnDown[0]).sumEt(); |
1198 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsMuonEnDown[0])); |
1199 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsMuonEnDown[0]).e_longitudinal(); |
1200 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsMuonEnDown[0])); |
1201 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1202 |
+ |
} |
1203 |
+ |
|
1204 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetMuonEnUpHandle; |
1205 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetMuonEnUp",patType1p2CorrectedPFMetMuonEnUpHandle); |
1206 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsMuonEnUp = *patType1p2CorrectedPFMetMuonEnUpHandle; |
1207 |
+ |
if(patType1p2CorrectedPFMetsMuonEnUp.size()){ |
1208 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsMuonEnUp[0]).sumEt(); |
1209 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsMuonEnUp[0])); |
1210 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsMuonEnUp[0]).e_longitudinal(); |
1211 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsMuonEnUp[0])); |
1212 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1213 |
+ |
} |
1214 |
+ |
|
1215 |
+ |
|
1216 |
+ |
|
1217 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetTauEnDownHandle; |
1218 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetTauEnDown",patType1p2CorrectedPFMetTauEnDownHandle); |
1219 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsTauEnDown = *patType1p2CorrectedPFMetTauEnDownHandle; |
1220 |
+ |
if(patType1p2CorrectedPFMetsTauEnDown.size()){ |
1221 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsTauEnDown[0]).sumEt(); |
1222 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsTauEnDown[0])); |
1223 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsTauEnDown[0]).e_longitudinal(); |
1224 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsTauEnDown[0])); |
1225 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1226 |
+ |
} |
1227 |
+ |
|
1228 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetTauEnUpHandle; |
1229 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetTauEnUp",patType1p2CorrectedPFMetTauEnUpHandle); |
1230 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsTauEnUp = *patType1p2CorrectedPFMetTauEnUpHandle; |
1231 |
+ |
if(patType1p2CorrectedPFMetsTauEnUp.size()){ |
1232 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsTauEnUp[0]).sumEt(); |
1233 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsTauEnUp[0])); |
1234 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsTauEnUp[0]).e_longitudinal(); |
1235 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsTauEnUp[0])); |
1236 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1237 |
+ |
} |
1238 |
+ |
|
1239 |
+ |
|
1240 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetJetEnDownHandle; |
1241 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetJetEnDown",patType1p2CorrectedPFMetJetEnDownHandle); |
1242 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsJetEnDown = *patType1p2CorrectedPFMetJetEnDownHandle; |
1243 |
+ |
if(patType1p2CorrectedPFMetsJetEnDown.size()){ |
1244 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsJetEnDown[0]).sumEt(); |
1245 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsJetEnDown[0])); |
1246 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsJetEnDown[0]).e_longitudinal(); |
1247 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsJetEnDown[0])); |
1248 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1249 |
+ |
} |
1250 |
+ |
|
1251 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetJetEnUpHandle; |
1252 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetJetEnUp",patType1p2CorrectedPFMetJetEnUpHandle); |
1253 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsJetEnUp = *patType1p2CorrectedPFMetJetEnUpHandle; |
1254 |
+ |
if(patType1p2CorrectedPFMetsJetEnUp.size()){ |
1255 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsJetEnUp[0]).sumEt(); |
1256 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsJetEnUp[0])); |
1257 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsJetEnUp[0]).e_longitudinal(); |
1258 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsJetEnUp[0])); |
1259 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1260 |
+ |
} |
1261 |
+ |
|
1262 |
+ |
|
1263 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetJetResDownHandle; |
1264 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetJetResDown",patType1p2CorrectedPFMetJetResDownHandle); |
1265 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsJetResDown = *patType1p2CorrectedPFMetJetResDownHandle; |
1266 |
+ |
if(patType1p2CorrectedPFMetsJetResDown.size()){ |
1267 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsJetResDown[0]).sumEt(); |
1268 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsJetResDown[0])); |
1269 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsJetResDown[0]).e_longitudinal(); |
1270 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsJetResDown[0])); |
1271 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1272 |
+ |
} |
1273 |
+ |
|
1274 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetJetResUpHandle; |
1275 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetJetResUp",patType1p2CorrectedPFMetJetResUpHandle); |
1276 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsJetResUp = *patType1p2CorrectedPFMetJetResUpHandle; |
1277 |
+ |
if(patType1p2CorrectedPFMetsJetResUp.size()){ |
1278 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsJetResUp[0]).sumEt(); |
1279 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsJetResUp[0])); |
1280 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsJetResUp[0]).e_longitudinal(); |
1281 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsJetResUp[0])); |
1282 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1283 |
+ |
} |
1284 |
+ |
|
1285 |
+ |
|
1286 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetUnclusteredEnDownHandle; |
1287 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetUnclusteredEnDown",patType1p2CorrectedPFMetUnclusteredEnDownHandle); |
1288 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsUnclusteredEnDown = *patType1p2CorrectedPFMetUnclusteredEnDownHandle; |
1289 |
+ |
if(patType1p2CorrectedPFMetsUnclusteredEnDown.size()){ |
1290 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsUnclusteredEnDown[0]).sumEt(); |
1291 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsUnclusteredEnDown[0])); |
1292 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsUnclusteredEnDown[0]).e_longitudinal(); |
1293 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsUnclusteredEnDown[0])); |
1294 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1295 |
+ |
} |
1296 |
+ |
|
1297 |
+ |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetUnclusteredEnUpHandle; |
1298 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetUnclusteredEnUp",patType1p2CorrectedPFMetUnclusteredEnUpHandle); |
1299 |
+ |
edm::View<reco::MET> patType1p2CorrectedPFMetsUnclusteredEnUp = *patType1p2CorrectedPFMetUnclusteredEnUpHandle; |
1300 |
+ |
if(patType1p2CorrectedPFMetsUnclusteredEnUp.size()){ |
1301 |
+ |
metunc.sumEt =(patType1p2CorrectedPFMetsUnclusteredEnUp[0]).sumEt(); |
1302 |
+ |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsUnclusteredEnUp[0])); |
1303 |
+ |
metunc.eLong=(patType1p2CorrectedPFMetsUnclusteredEnUp[0]).e_longitudinal(); |
1304 |
+ |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsUnclusteredEnUp[0])); |
1305 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1306 |
+ |
} |
1307 |
+ |
|
1308 |
+ |
|
1309 |
|
|
1310 |
|
// |
1311 |
|
// met is calomet |
1316 |
|
edm::View<pat::MET> metsTC = *metTCHandle; |
1317 |
|
if(metsTC.size()){ |
1318 |
|
hbbInfo->tcmet.sumEt=(metsTC[0]).sumEt(); |
1319 |
< |
hbbInfo->tcmet.metSig=(metsTC[0]).mEtSig(); |
1319 |
> |
hbbInfo->tcmet.metSig=metSignificance(&(metsTC[0])); |
1320 |
|
hbbInfo->tcmet.eLong=(metsTC[0]).e_longitudinal(); |
1321 |
|
hbbInfo->tcmet.p4=GENPTOLOR((metsTC[0])); |
1322 |
|
if (verbose_) std::cout <<" METTC "<< hbbInfo->tcmet.metSig <<" " << hbbInfo->tcmet.sumEt<<std::endl; |
1323 |
|
} |
1324 |
|
|
1325 |
+ |
edm::Handle<edm::View<reco::MET> > pfMETNoPUHandle; |
1326 |
+ |
iEvent.getByLabel("pfMETNoPU",pfMETNoPUHandle); |
1327 |
+ |
edm::View<reco::MET> metspfMETNoPU = *pfMETNoPUHandle; |
1328 |
+ |
if(metspfMETNoPU.size()){ |
1329 |
+ |
hbbInfo->metNoPU.sumEt=(metspfMETNoPU[0]).sumEt(); |
1330 |
+ |
hbbInfo->metNoPU.metSig=metSignificance(&(metspfMETNoPU[0])); |
1331 |
+ |
hbbInfo->metNoPU.eLong=(metspfMETNoPU[0]).e_longitudinal(); |
1332 |
+ |
hbbInfo->metNoPU.p4=GENPTOLOR((metspfMETNoPU[0])); |
1333 |
+ |
if (verbose_) std::cout <<" pfMETNoPU "<< hbbInfo->metNoPU.metSig <<" " << hbbInfo->metNoPU.sumEt<<std::endl; |
1334 |
+ |
} |
1335 |
+ |
|
1336 |
+ |
edm::Handle<edm::View<reco::MET> > mHTHandle; |
1337 |
+ |
iEvent.getByLabel("patMETsHT",mHTHandle); |
1338 |
+ |
edm::View<reco::MET> metsHT = *mHTHandle; |
1339 |
+ |
if(metsHT.size()){ |
1340 |
+ |
hbbInfo->mht.sumEt=(metsHT[0]).sumEt(); |
1341 |
+ |
hbbInfo->mht.metSig=metSignificance(&(metsHT[0])); |
1342 |
+ |
hbbInfo->mht.eLong=(metsHT[0]).e_longitudinal(); |
1343 |
+ |
hbbInfo->mht.p4=GENPTOLOR((metsHT[0])); |
1344 |
+ |
if (verbose_) std::cout <<" METHT "<< hbbInfo->mht.metSig <<" " << hbbInfo->mht.sumEt<<std::endl; |
1345 |
+ |
} |
1346 |
+ |
|
1347 |
+ |
edm::Handle<edm::View<reco::MET> > metHandle; |
1348 |
+ |
iEvent.getByLabel(metLabel_,metHandle); |
1349 |
+ |
edm::View<reco::MET> mets = *metHandle; |
1350 |
+ |
|
1351 |
|
if(mets.size()){ |
1352 |
|
hbbInfo->calomet.sumEt=(mets[0]).sumEt(); |
1353 |
< |
hbbInfo->calomet.metSig=(mets[0]).mEtSig(); |
1353 |
> |
hbbInfo->calomet.metSig=metSignificance(&(mets[0])); |
1354 |
|
hbbInfo->calomet.eLong=(mets[0]).e_longitudinal(); |
1355 |
|
hbbInfo->calomet.p4=GENPTOLOR((mets[0])); |
1356 |
< |
if (verbose_) std::cout <<" METTC "<< hbbInfo->calomet.metSig <<" " << hbbInfo->calomet.sumEt<<std::endl; |
1356 |
> |
if (verbose_) std::cout <<" METCALO "<< hbbInfo->calomet.metSig <<" " << hbbInfo->calomet.sumEt<<std::endl; |
1357 |
|
} |
713 |
– |
|
1358 |
|
|
1359 |
|
edm::Handle<edm::View<pat::MET> > metPFHandle; |
1360 |
< |
iEvent.getByLabel("patMETsPF",metPFHandle); |
1360 |
> |
iEvent.getByLabel("patMETs",metPFHandle); |
1361 |
|
edm::View<pat::MET> metsPF = *metPFHandle; |
1362 |
< |
|
1362 |
> |
|
1363 |
|
if(metsPF.size()){ |
1364 |
|
hbbInfo->pfmet.sumEt=(metsPF[0]).sumEt(); |
1365 |
< |
hbbInfo->pfmet.metSig=(metsPF[0]).mEtSig(); |
1365 |
> |
hbbInfo->pfmet.metSig=metSignificance(&(metsPF[0])); |
1366 |
|
hbbInfo->pfmet.eLong=(metsPF[0]).e_longitudinal(); |
1367 |
|
hbbInfo->pfmet.p4=GENPTOLOR((metsPF[0])); |
1368 |
< |
if (verbose_) std::cout <<" METTC "<< hbbInfo->pfmet.metSig <<" " << hbbInfo->pfmet.sumEt<<std::endl; |
1368 |
> |
if (verbose_) std::cout <<" METPF "<< hbbInfo->pfmet.metSig <<" " << hbbInfo->pfmet.sumEt<<std::endl; |
1369 |
|
} |
1370 |
< |
|
1371 |
< |
|
1370 |
> |
|
1371 |
> |
|
1372 |
|
if(verbose_){ |
1373 |
< |
std::cout << "METs: calomet "<<mets.size()<<" tcmet "<<metsTC.size()<<" pfmet "<<metsPF.size()<<std::endl; |
1373 |
> |
std::cout << "METs: calomet "<<mets.size()<<" tcmet"<<metsTC.size()<<" pfmet "<<metsPF.size()<<" MHT" <<metsHT.size()<<std::endl; |
1374 |
|
} |
1375 |
|
|
1376 |
< |
std::cout << " INPUT MUONS "<<muons.size()<<std::endl; |
1376 |
> |
if(verbose_) |
1377 |
> |
std::cout << " INPUT MUONS "<<muons.size()<<std::endl; |
1378 |
|
|
1379 |
|
for(edm::View<pat::Muon>::const_iterator mu = muons.begin(); mu!=muons.end(); ++mu){ |
1380 |
|
VHbbEvent::MuonInfo mf; |
1383 |
|
mf.tIso=mu->trackIso(); |
1384 |
|
mf.eIso=mu->ecalIso(); |
1385 |
|
mf.hIso=mu->hcalIso(); |
1386 |
+ |
mf.pfChaIso=mu->chargedHadronIso(); |
1387 |
+ |
mf.pfChaPUIso=mu->puChargedHadronIso(); //userIso(5); |
1388 |
+ |
mf.pfPhoIso=mu->photonIso(); |
1389 |
+ |
mf.pfNeuIso=mu->neutralHadronIso(); |
1390 |
|
Geom::Phi<double> deltaphi(mu->phi()-atan2(mf.p4.Px(), mf.p4.Py())); |
1391 |
|
double acop = deltaphi.value(); |
1392 |
|
mf.acop=acop; |
1393 |
|
|
1394 |
+ |
mf.emEnergy = mu->calEnergy().em; |
1395 |
+ |
mf.hadEnergy = mu->calEnergy().had; |
1396 |
+ |
|
1397 |
+ |
mf.nMatches = mu->numberOfMatches(); |
1398 |
+ |
|
1399 |
|
mf.ipDb=mu->dB(); |
1400 |
|
mf.ipErrDb=mu->edB(); |
1401 |
< |
if(mu->isGlobalMuon()) mf.cat=1; |
1402 |
< |
else if(mu->isTrackerMuon()) mf.cat=2; |
1403 |
< |
else mf.cat=3; |
1401 |
> |
mf.cat=0; |
1402 |
> |
|
1403 |
> |
if(mu->isGlobalMuon()) mf.cat|=1; |
1404 |
> |
if(mu->isTrackerMuon()) mf.cat|=2; |
1405 |
> |
if(mu->isStandAloneMuon()) mf.cat|=4; |
1406 |
|
TrackRef trkMu1Ref = mu->get<TrackRef>(); |
1407 |
|
if(trkMu1Ref.isNonnull()){ |
1408 |
|
const Track* MuTrk1 = mu->get<TrackRef>().get(); |
1413 |
|
TrackRef iTrack1 = mu->innerTrack(); |
1414 |
|
const reco::HitPattern& p1 = iTrack1->hitPattern(); |
1415 |
|
mf.nPixelHits=p1.pixelLayersWithMeasurement(); |
1416 |
< |
} |
1416 |
> |
|
1417 |
> |
mf.nValidTracker = p1.numberOfValidTrackerHits(); |
1418 |
> |
mf.nValidPixel = p1.numberOfValidPixelHits(); |
1419 |
> |
mf.nValidLayers = p1.trackerLayersWithMeasurement(); |
1420 |
> |
mf.isPF = mu->isPFMuon(); |
1421 |
> |
|
1422 |
> |
|
1423 |
> |
|
1424 |
> |
} |
1425 |
|
if(mu->isGlobalMuon()){ |
1426 |
|
TrackRef gTrack = mu->globalTrack(); |
1427 |
|
const reco::HitPattern& q = gTrack->hitPattern(); |
1428 |
|
mf.globChi2=gTrack.get()->normalizedChi2(); |
1429 |
|
mf.globNHits=q.numberOfValidMuonHits(); |
1430 |
< |
mf. validMuStations = q. muonStationsWithValidHits(); |
1430 |
> |
mf.validMuStations = q.muonStationsWithValidHits(); |
1431 |
|
}else{ |
1432 |
|
mf.globChi2=-99; |
1433 |
|
mf.globNHits=-99; |
1434 |
|
} |
1435 |
+ |
|
1436 |
+ |
//Muon trigger matching |
1437 |
+ |
for (int itrig = 0; itrig != ntrigs; ++itrig){ |
1438 |
+ |
std::string trigName=triggerNames_.triggerName(itrig); |
1439 |
+ |
if( (mu->triggerObjectMatchesByPath(trigName,false,false).size() != 0) ){ |
1440 |
+ |
mf.hltMatchedBits.push_back(itrig); |
1441 |
+ |
if(verbose_){ |
1442 |
+ |
std::clog << "Trigger Matching box" << std::endl; |
1443 |
+ |
std::clog << "+++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; |
1444 |
+ |
std::clog << "Matching parameters are defined in the cfg" << std::endl; |
1445 |
+ |
std::clog << "Trigger bit = " << itrig << std::endl; |
1446 |
+ |
std::clog << "Trigger name = " << trigName << std::endl; |
1447 |
+ |
std::clog << "Trigger object matched collection size = " << mu->triggerObjectMatchesByPath(trigName,false,false).size() << std::endl; |
1448 |
+ |
std::clog << "Pat Muon pt = " << mf.p4.Pt() << " HLT object matched = " << mu->triggerObjectMatch(0)->p4().Pt() << std::endl; |
1449 |
+ |
std::clog << "+++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; |
1450 |
+ |
} |
1451 |
+ |
} |
1452 |
+ |
} |
1453 |
|
// |
1454 |
+ |
|
1455 |
|
// add stamuon |
1456 |
|
|
1457 |
|
// if (mu->isStandAloneMuon()) { |
1473 |
|
hbbInfo->muInfo.push_back(mf); |
1474 |
|
} |
1475 |
|
|
1476 |
< |
std::cout << " INPUT electrons "<<electrons.size()<<std::endl; |
1476 |
> |
if(verbose_) |
1477 |
> |
std::cout << " INPUT electrons "<<electrons.size()<<std::endl; |
1478 |
> |
InputTag reducedEBRecHitCollection(string("reducedEcalRecHitsEB")); |
1479 |
> |
InputTag reducedEERecHitCollection(string("reducedEcalRecHitsEE")); |
1480 |
> |
EcalClusterLazyTools lazyTools(iEvent, iSetup, reducedEBRecHitCollection, reducedEERecHitCollection); |
1481 |
> |
edm::ESHandle<TransientTrackBuilder> builder; |
1482 |
> |
iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder", builder); |
1483 |
> |
const TransientTrackBuilder & transientTrackBuilder= *(builder.product()); |
1484 |
> |
|
1485 |
|
for(edm::View<pat::Electron>::const_iterator elec = electrons.begin(); elec!=electrons.end(); ++elec){ |
1486 |
|
VHbbEvent::ElectronInfo ef; |
1487 |
|
ef.p4=GENPTOLORP(elec); |
1492 |
|
ef.tIso=elec->trackIso(); |
1493 |
|
ef.eIso=elec->ecalIso(); |
1494 |
|
ef.hIso=elec->hcalIso(); |
1495 |
< |
Geom::Phi<double> deltaphi(elec->superCluster()->phi()-atan2(hbbInfo->calomet.p4.Py(),hbbInfo->calomet.p4.Px())); |
1495 |
> |
ef.pfChaIso=elec->chargedHadronIso(); |
1496 |
> |
ef.pfChaPUIso=elec->puChargedHadronIso();//userIso(5); |
1497 |
> |
ef.pfPhoIso=elec->photonIso(); |
1498 |
> |
ef.pfNeuIso=elec->neutralHadronIso(); |
1499 |
> |
|
1500 |
> |
// |
1501 |
> |
// ip info |
1502 |
> |
// |
1503 |
> |
|
1504 |
> |
ef.ipDb=elec->dB(); |
1505 |
> |
ef.ipErrDb=elec->edB(); |
1506 |
> |
|
1507 |
> |
|
1508 |
> |
|
1509 |
> |
Geom::Phi<double> deltaphi(elec->superCluster()->phi()-atan2(hbbInfo->pfmet.p4.Py(),hbbInfo->pfmet.p4.Px())); |
1510 |
|
ef.acop = deltaphi.value(); |
1511 |
|
// |
1512 |
+ |
ef.sihih = elec->sigmaIetaIeta(); |
1513 |
+ |
ef.Dphi = elec->deltaPhiSuperClusterTrackAtVtx(); |
1514 |
+ |
ef.Deta = elec->deltaEtaSuperClusterTrackAtVtx(); |
1515 |
+ |
ef.HoE = elec->hadronicOverEm(); |
1516 |
+ |
ef.convDist = elec->convDist(); |
1517 |
+ |
ef.convDcot = elec->convDcot(); |
1518 |
+ |
if(elec->gsfTrack().isNonnull()) ef.innerHits = elec->gsfTrack()->trackerExpectedHitsInner().numberOfHits(); |
1519 |
+ |
ef.isEB = elec->isEB(); |
1520 |
+ |
ef.isEE = elec->isEE(); |
1521 |
+ |
/* 2012 ELEID*/ |
1522 |
+ |
|
1523 |
+ |
const pat::Electron & ele = *elec; |
1524 |
+ |
bool validKF= false; |
1525 |
+ |
reco::TrackRef myTrackRef = ele.closestCtfTrackRef(); |
1526 |
+ |
validKF = (myTrackRef.isAvailable()); |
1527 |
+ |
validKF = (myTrackRef.isNonnull()); |
1528 |
+ |
|
1529 |
+ |
// Pure tracking variables |
1530 |
+ |
ef.fMVAVar_fbrem = ele.fbrem(); |
1531 |
+ |
ef.fMVAVar_kfchi2 = (validKF) ? myTrackRef->normalizedChi2() : 0 ; |
1532 |
+ |
ef.fMVAVar_kfhits = (validKF) ? myTrackRef->hitPattern().trackerLayersWithMeasurement() : -1. ; |
1533 |
+ |
// fMVAVar_kfhitsall = (validKF) ? myTrackRef->numberOfValidHits() : -1. ; // save also this in your ntuple as possible alternative |
1534 |
+ |
ef.fMVAVar_gsfchi2 = ele.gsfTrack()->normalizedChi2(); |
1535 |
+ |
|
1536 |
+ |
|
1537 |
+ |
// Geometrical matchings |
1538 |
+ |
ef.fMVAVar_deta = ele.deltaEtaSuperClusterTrackAtVtx(); |
1539 |
+ |
ef.fMVAVar_dphi = ele.deltaPhiSuperClusterTrackAtVtx(); |
1540 |
+ |
ef.fMVAVar_detacalo = ele.deltaEtaSeedClusterTrackAtCalo(); |
1541 |
+ |
// fMVAVar_dphicalo = ele.deltaPhiSeedClusterTrackAtCalo(); // save also this in your ntuple |
1542 |
+ |
|
1543 |
+ |
|
1544 |
+ |
// Pure ECAL -> shower shapes |
1545 |
+ |
ef.fMVAVar_see = ele.sigmaIetaIeta(); //EleSigmaIEtaIEta |
1546 |
+ |
std::vector<float> vCov = lazyTools.localCovariances(*(ele.superCluster()->seed())) ; |
1547 |
+ |
if (!isnan(vCov[2])) ef.fMVAVar_spp = sqrt (vCov[2]); //EleSigmaIPhiIPhi |
1548 |
+ |
else ef.fMVAVar_spp = 0.; |
1549 |
+ |
// fMVAVar_sigmaIEtaIPhi = vCov[1]; // save also this in your ntuple |
1550 |
+ |
|
1551 |
+ |
ef.fMVAVar_etawidth = ele.superCluster()->etaWidth(); |
1552 |
+ |
ef.fMVAVar_phiwidth = ele.superCluster()->phiWidth(); |
1553 |
+ |
ef.fMVAVar_e1x5e5x5 = (ele.e5x5()) !=0. ? 1.-(ele.e1x5()/ele.e5x5()) : -1. ; |
1554 |
+ |
ef.fMVAVar_R9 = lazyTools.e3x3(*(ele.superCluster()->seed())) / ele.superCluster()->rawEnergy(); |
1555 |
+ |
//fMVAVar_nbrems = fabs(ele.numberOfBrems()); // save also this in your ntuple |
1556 |
+ |
|
1557 |
+ |
// Energy matching |
1558 |
+ |
ef.fMVAVar_HoE = ele.hadronicOverEm(); |
1559 |
+ |
ef.fMVAVar_EoP = ele.eSuperClusterOverP(); |
1560 |
+ |
// fMVAVar_IoEmIoP = (1.0/(ele.superCluster()->energy())) - (1.0 / ele.p()); // in the future to be changed with ele.gsfTrack()->p() |
1561 |
+ |
ef.fMVAVar_IoEmIoP = (1.0/ele.ecalEnergy()) - (1.0 / ele.p()); // in the future to be changed with ele.gsfTrack()->p() // 24/04/2012 changed to correctly access the corrected supercluster energy from CMSSW_52X |
1562 |
+ |
|
1563 |
+ |
ef.fMVAVar_eleEoPout = ele.eEleClusterOverPout(); |
1564 |
+ |
ef.fMVAVar_PreShowerOverRaw= ele.superCluster()->preshowerEnergy() / ele.superCluster()->rawEnergy(); |
1565 |
+ |
// fMVAVar_EoPout = ele.eSeedClusterOverPout(); // save also this in your ntuple |
1566 |
+ |
|
1567 |
+ |
|
1568 |
+ |
// Spectators |
1569 |
+ |
ef.fMVAVar_eta = ele.superCluster()->eta(); |
1570 |
+ |
ef.fMVAVar_pt = ele.pt(); |
1571 |
+ |
|
1572 |
+ |
//additional for cut based |
1573 |
+ |
ef.dxy = elec->gsfTrack()->dxy(vertex.position()); |
1574 |
+ |
ef.dz = elec->gsfTrack()->dz(vertex.position()); |
1575 |
+ |
|
1576 |
+ |
|
1577 |
+ |
//d0 |
1578 |
+ |
if (ele.gsfTrack().isNonnull()) { |
1579 |
+ |
ef.fMVAVar_d0 = (-1.0)*ele.gsfTrack()->dxy(vertex.position()); |
1580 |
+ |
} else if (ele.closestCtfTrackRef().isNonnull()) { |
1581 |
+ |
ef.fMVAVar_d0 = (-1.0)*ele.closestCtfTrackRef()->dxy(vertex.position()); |
1582 |
+ |
} else { |
1583 |
+ |
ef.fMVAVar_d0 = -9999.0; |
1584 |
+ |
|
1585 |
+ |
//default values for IP3D |
1586 |
+ |
ef.fMVAVar_ip3d = -999.0; |
1587 |
+ |
// fMVAVar_ip3dSig = 0.0; |
1588 |
+ |
if (ele.gsfTrack().isNonnull()) { |
1589 |
+ |
const double gsfsign = ( (-ele.gsfTrack()->dxy(vertex.position())) >=0 ) ? 1. : -1.; |
1590 |
+ |
|
1591 |
+ |
const reco::TransientTrack &tt = transientTrackBuilder.build(ele.gsfTrack()); |
1592 |
+ |
const std::pair<bool,Measurement1D> &ip3dpv = IPTools::absoluteImpactParameter3D(tt,vertex); |
1593 |
+ |
if (ip3dpv.first) { |
1594 |
+ |
double ip3d = gsfsign*ip3dpv.second.value(); |
1595 |
+ |
//double ip3derr = ip3dpv.second.error(); |
1596 |
+ |
ef.fMVAVar_ip3d = ip3d; |
1597 |
+ |
// fMVAVar_ip3dSig = ip3d/ip3derr; |
1598 |
+ |
} |
1599 |
+ |
} |
1600 |
+ |
} |
1601 |
+ |
|
1602 |
+ |
|
1603 |
+ |
/* end of 2012 ELEID*/ |
1604 |
+ |
|
1605 |
+ |
// |
1606 |
|
// fill eleids |
1607 |
|
// |
1608 |
< |
ef.id95 = elec->electronID("simpleEleId95cIso"); |
1608 |
> |
/* ef.id95 = elec->electronID("simpleEleId95cIso"); |
1609 |
|
ef.id85 = elec->electronID("simpleEleId85cIso"); |
1610 |
|
ef.id70 = elec->electronID("simpleEleId70cIso"); |
1611 |
|
ef.id95r = elec->electronID("simpleEleId95relIso"); |
1612 |
|
ef.id70r = elec->electronID("simpleEleId70relIso"); |
1613 |
|
ef.id85r = elec->electronID("simpleEleId85relIso"); |
1614 |
+ |
*/ |
1615 |
+ |
ef.id95 =elec->electronID("eidVBTFCom95"); |
1616 |
+ |
ef.id95r=elec->electronID("eidVBTFRel95"); |
1617 |
+ |
ef.id85 =elec->electronID("eidVBTFCom85"); |
1618 |
+ |
ef.id85r=elec->electronID("eidVBTFRel85"); |
1619 |
+ |
ef.id80 =elec->electronID("eidVBTFCom80"); |
1620 |
+ |
ef.id80r=elec->electronID("eidVBTFRel80"); |
1621 |
+ |
ef.id70 =elec->electronID("eidVBTFCom70"); |
1622 |
+ |
ef.id70r=elec->electronID("eidVBTFRel70"); |
1623 |
+ |
ef.mvaOut=elec->electronID("mvaNonTrigV0"); |
1624 |
+ |
ef.mvaOutTrig=elec->electronID("mvaTrigV0"); |
1625 |
+ |
|
1626 |
+ |
//Electron trigger matching |
1627 |
+ |
for (int itrig = 0; itrig != ntrigs; ++itrig){ |
1628 |
+ |
std::string trigName=triggerNames_.triggerName(itrig); |
1629 |
+ |
if( (elec->triggerObjectMatchesByPath(trigName).size() != 0) ){ |
1630 |
+ |
ef.hltMatchedBits.push_back(itrig); |
1631 |
+ |
if(verbose_){ |
1632 |
+ |
std::clog << "Trigger Matching box" << std::endl; |
1633 |
+ |
std::clog << "+++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; |
1634 |
+ |
std::clog << "Matching parameters are defined in the cfg" << std::endl; |
1635 |
+ |
std::clog << "Trigger bit = " << itrig << std::endl; |
1636 |
+ |
std::clog << "Trigger name = " << trigName << std::endl; |
1637 |
+ |
std::clog << "Trigger object matched collection size = " << elec->triggerObjectMatchesByPath(trigName).size() << std::endl; |
1638 |
+ |
std::clog << "Pat Electron pt = " << ef.p4.Pt() << " HLT object matched = " << elec->triggerObjectMatch(0)->p4().Pt() << std::endl; |
1639 |
+ |
std::clog << "+++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; |
1640 |
+ |
} |
1641 |
+ |
} |
1642 |
+ |
} |
1643 |
|
|
1644 |
|
if(runOnMC_){ |
1645 |
|
const GenParticle* elecMc = elec->genLepton(); |
1652 |
|
hbbInfo->eleInfo.push_back(ef); |
1653 |
|
} |
1654 |
|
|
1655 |
< |
|
1656 |
< |
std::cout << " INPUT taus "<<taus.size()<<std::endl; |
1655 |
> |
if(verbose_) |
1656 |
> |
std::cout << " INPUT taus "<<taus.size()<<std::endl; |
1657 |
|
for(edm::View<pat::Tau>::const_iterator tau = taus.begin(); tau!=taus.end(); ++tau){ |
1658 |
|
VHbbEvent::TauInfo tf; |
1659 |
|
tf.p4=GENPTOLORP(tau); |
1661 |
|
tf.tIso=tau->trackIso(); |
1662 |
|
tf.eIso=tau->ecalIso(); |
1663 |
|
tf.hIso=tau->hcalIso(); |
1664 |
< |
Geom::Phi<double> deltaphi(tau->phi()-atan2(hbbInfo->calomet.p4.Py(),hbbInfo->calomet.p4.Px())); |
1664 |
> |
Geom::Phi<double> deltaphi(tau->phi()-atan2(hbbInfo->pfmet.p4.Py(),hbbInfo->pfmet.p4.Px())); |
1665 |
|
double acop = deltaphi.value(); |
1666 |
|
tf.acop=acop; |
1667 |
< |
tf.idbyIso=tau->tauID("byIsolation"); |
1668 |
< |
tf.idbyTrackIso=tau->tauID("trackIsolation"); |
1669 |
< |
tf.idbyTaNCfrOnePercent=tau->tauID("byTaNCfrOnePercent"); |
1670 |
< |
tf.idbyTaNCfrHalfPercent=tau->tauID("byTaNCfrHalfPercent"); |
1671 |
< |
tf.idbyTaNCfrQuarterPercent=tau->tauID("byTaNCfrQuarterPercent"); |
1672 |
< |
tf.idbyTaNCfrTenthPercent=tau->tauID("byTaNCfrTenthPercent"); |
1673 |
< |
tf.idbyTaNC=tau->tauID("byTaNC"); |
1667 |
> |
if (tau->isTauIDAvailable("againstElectronLoose")) tf.againstElectronLoose=tau->tauID("againstElectronLoose"); |
1668 |
> |
if (tau->isTauIDAvailable("againstElectronMedium")) tf.againstElectronMedium=tau->tauID("againstElectronMedium"); |
1669 |
> |
if (tau->isTauIDAvailable("againstElectronTight")) tf.againstElectronTight=tau->tauID("againstElectronTight"); |
1670 |
> |
if (tau->isTauIDAvailable("againstMuonLoose")) tf.againstMuonLoose=tau->tauID("againstMuonLoose"); |
1671 |
> |
if (tau->isTauIDAvailable("againstMuonTight")) tf.againstMuonTight=tau->tauID("againstMuonTight"); |
1672 |
> |
if (tau->isTauIDAvailable("byLooseIsolation")) tf.byLooseIsolation=tau->tauID("byLooseIsolation"); |
1673 |
> |
if (tau->isTauIDAvailable("byMediumIsolation")) tf.byMediumIsolation=tau->tauID("byMediumIsolation"); |
1674 |
> |
if (tau->isTauIDAvailable("byTightIsolation")) tf.byTightIsolation=tau->tauID("byTightIsolation"); |
1675 |
> |
if (tau->isTauIDAvailable("byVLooseIsolation")) tf.byVLooseIsolation=tau->tauID("byVLooseIsolation"); |
1676 |
> |
if (tau->isTauIDAvailable("decayModeFinding")) tf.decayModeFinding=tau->tauID("decayModeFinding"); |
1677 |
> |
if (tau->isTauIDAvailable("byIsolation")) tf.byIsolation=tau->tauID("byIsolation"); |
1678 |
> |
if (tau->isTauIDAvailable("trackIsolation")) tf.trackIsolation=tau->tauID("trackIsolation"); |
1679 |
> |
if (tau->isTauIDAvailable("byTaNCfrOnePercent")) tf.byTaNCfrOnePercent=tau->tauID("byTaNCfrOnePercent"); |
1680 |
> |
if (tau->isTauIDAvailable("byTaNCfrHalfPercent")) tf.byTaNCfrHalfPercent=tau->tauID("byTaNCfrHalfPercent"); |
1681 |
> |
if (tau->isTauIDAvailable("byTaNCfrQuarterPercent")) tf.byTaNCfrQuarterPercent=tau->tauID("byTaNCfrQuarterPercent"); |
1682 |
> |
if (tau->isTauIDAvailable("byTaNCfrTenthPercent")) tf.byTaNCfrTenthPercent=tau->tauID("byTaNCfrTenthPercent"); |
1683 |
> |
if (tau->isTauIDAvailable("byTaNC")) tf.byTaNC=tau->tauID("byTaNC"); |
1684 |
> |
if (tau->isTauIDAvailable("byLooseCombinedIsolationDeltaBetaCorr")) tf.byLooseCombinedIsolationDeltaBetaCorr=tau->tauID("byLooseCombinedIsolationDeltaBetaCorr"); |
1685 |
> |
if (tau->isTauIDAvailable("againstElectronMVA")) tf.againstElectronMVA=tau->tauID("againstElectronMVA"); |
1686 |
> |
if (tau->isPFTau()) { |
1687 |
> |
tf.isolationPFChargedHadrCandsPtSum = tau->isolationPFChargedHadrCandsPtSum(); |
1688 |
> |
tf.isolationPFGammaCandsEtSum = tau->isolationPFGammaCandsEtSum(); |
1689 |
> |
if (tau->leadPFChargedHadrCand().isAvailable()) tf.leadPFChargedHadrCandPt = tau->leadPFChargedHadrCand()->pt(); |
1690 |
> |
tf.NsignalPFChargedHadrCands = tau->signalPFChargedHadrCands().size(); |
1691 |
> |
tf.NsignalPFGammaCands = tau->signalPFGammaCands().size(); |
1692 |
> |
} |
1693 |
|
hbbInfo->tauInfo.push_back(tf); |
1694 |
< |
} |
1695 |
< |
|
1696 |
< |
|
1697 |
< |
// dimuons and dielectrons |
1698 |
< |
|
1699 |
< |
for( size_t i = 0; i < dimuons->size(); i++ ) { |
1700 |
< |
VHbbEvent::DiMuonInfo df; |
1701 |
< |
const Candidate & dimuonCand = (*dimuons)[ i ]; |
1702 |
< |
df.p4= GENPTOLOR(dimuonCand); |
1703 |
< |
const Candidate * lep0 = dimuonCand.daughter( 0 ); |
1704 |
< |
const Candidate * lep1 = dimuonCand.daughter( 1 ); |
1705 |
< |
// needed to access specific methods of pat::Muon |
1706 |
< |
const pat::Muon & muonDau0 = dynamic_cast<const pat::Muon &>(*lep0->masterClone()); |
1707 |
< |
const pat::Muon & muonDau1 = dynamic_cast<const pat::Muon &>(*lep1->masterClone()); |
1708 |
< |
|
1709 |
< |
df.daughter1.p4=GENPTOLOR(muonDau0); |
1710 |
< |
df.daughter2.p4=GENPTOLOR(muonDau1); |
1711 |
< |
|
1712 |
< |
df.daughter1.tIso= muonDau0.trackIso(); |
1713 |
< |
df.daughter2.tIso= muonDau1.trackIso(); |
1714 |
< |
|
1715 |
< |
df.daughter1.eIso= muonDau0.ecalIso(); |
1716 |
< |
df.daughter2.eIso= muonDau1.ecalIso(); |
1717 |
< |
|
1718 |
< |
df.daughter1.hIso= muonDau0.hcalIso(); |
872 |
< |
df.daughter2.hIso= muonDau1.hcalIso(); |
873 |
< |
|
874 |
< |
df.daughter1.ipDb=muonDau0.dB(); |
875 |
< |
df.daughter2.ipDb=muonDau1.dB(); |
876 |
< |
|
877 |
< |
df.daughter1.ipErrDb=muonDau0.edB(); |
878 |
< |
df.daughter2.ipErrDb=muonDau1.edB(); |
879 |
< |
|
880 |
< |
|
881 |
< |
if(muonDau0.isGlobalMuon()) df.daughter1.cat =1; |
882 |
< |
else if(muonDau0.isTrackerMuon()) df.daughter1.cat=2; |
883 |
< |
else df.daughter1.cat=3; |
884 |
< |
if(muonDau1.isGlobalMuon()) df.daughter2.cat =1; |
885 |
< |
else if(muonDau1.isTrackerMuon()) df.daughter2.cat=2; |
886 |
< |
else df.daughter2.cat=3; |
887 |
< |
|
888 |
< |
TrackRef trkMu1Ref = muonDau0.get<TrackRef>(); |
889 |
< |
TrackRef trkMu2Ref = muonDau1.get<TrackRef>(); |
890 |
< |
|
891 |
< |
if(trkMu1Ref.isNonnull() && trkMu2Ref.isNonnull()){ |
892 |
< |
const Track* MuTrk1 = muonDau0.get<TrackRef>().get(); |
893 |
< |
const Track* MuTrk2 = muonDau1.get<TrackRef>().get(); |
894 |
< |
df.daughter1.zPVPt=MuTrk1->dz(RecVtxFirst.position()); |
895 |
< |
df.daughter1.zPVProb=MuTrk1->dz(RecVtx.position()); |
896 |
< |
df.daughter2.zPVPt=MuTrk2->dz(RecVtxFirst.position()); |
897 |
< |
df.daughter2.zPVProb=MuTrk2->dz(RecVtx.position()); |
898 |
< |
|
899 |
< |
df.daughter1.nHits = MuTrk1->numberOfValidHits(); |
900 |
< |
df.daughter2.nHits = MuTrk2->numberOfValidHits(); |
901 |
< |
|
902 |
< |
df.daughter1.chi2 = MuTrk1->normalizedChi2(); |
903 |
< |
df.daughter2.chi2 = MuTrk2->normalizedChi2(); |
904 |
< |
|
905 |
< |
TrackRef iTrack1 = muonDau0.innerTrack(); |
906 |
< |
const reco::HitPattern& p1 = iTrack1->hitPattern(); |
907 |
< |
TrackRef iTrack2 = muonDau1.innerTrack(); |
908 |
< |
const reco::HitPattern& p2 = iTrack2->hitPattern(); |
909 |
< |
|
910 |
< |
df.daughter1.nPixelHits = p1.pixelLayersWithMeasurement(); |
911 |
< |
df.daughter2.nPixelHits = p2.pixelLayersWithMeasurement(); |
912 |
< |
|
913 |
< |
if(muonDau0.isGlobalMuon()){ |
914 |
< |
TrackRef gTrack = muonDau0.globalTrack(); |
915 |
< |
const reco::HitPattern& q = gTrack->hitPattern(); |
916 |
< |
df.daughter1.globNHits=q.numberOfValidMuonHits(); |
917 |
< |
df.daughter1.globChi2=gTrack.get()->normalizedChi2(); |
918 |
< |
df.daughter1.validMuStations = q. muonStationsWithValidHits(); |
919 |
< |
} |
920 |
< |
if(muonDau1.isGlobalMuon()){ |
921 |
< |
TrackRef gTrack = muonDau1.globalTrack(); |
922 |
< |
const reco::HitPattern& q = gTrack->hitPattern(); |
923 |
< |
df.daughter2.globNHits=q.numberOfValidMuonHits(); |
924 |
< |
df.daughter2.globChi2=gTrack.get()->normalizedChi2(); |
925 |
< |
df.daughter2.validMuStations = q. muonStationsWithValidHits(); |
926 |
< |
} |
927 |
< |
|
1694 |
> |
if (verbose_) { |
1695 |
> |
std::cout << "SCZ DEBUG: againstElectronLoose is " << tf.againstElectronLoose << std::endl; |
1696 |
> |
std::cout << "SCZ DEBUG: againstElectronMedium is " << tf.againstElectronMedium << std::endl; |
1697 |
> |
std::cout << "SCZ DEBUG: againstElectronTight is " << tf.againstElectronTight << std::endl; |
1698 |
> |
std::cout << "SCZ DEBUG: againstMuonLoose is " << tf.againstMuonLoose << std::endl; |
1699 |
> |
std::cout << "SCZ DEBUG: againstMuonTight is " << tf.againstMuonTight << std::endl; |
1700 |
> |
std::cout << "SCZ DEBUG: byLooseIsolation is " << tf.byLooseIsolation << std::endl; |
1701 |
> |
std::cout << "SCZ DEBUG: byMediumIsolation is " << tf.byMediumIsolation << std::endl; |
1702 |
> |
std::cout << "SCZ DEBUG: byTightIsolation is " << tf.byTightIsolation << std::endl; |
1703 |
> |
std::cout << "SCZ DEBUG: byVLooseIsolation is " << tf.byVLooseIsolation << std::endl; |
1704 |
> |
std::cout << "SCZ DEBUG: decayModeFinding is " << tf.decayModeFinding << std::endl; |
1705 |
> |
std::cout << "SCZ DEBUG: byIsolation is " << tf.byIsolation<< std::endl; |
1706 |
> |
std::cout << "SCZ DEBUG: trackIsolation is " << tf.trackIsolation << std::endl; |
1707 |
> |
std::cout << "SCZ DEBUG: byTaNCfrOnePercent is " << tf.byTaNCfrOnePercent << std::endl; |
1708 |
> |
std::cout << "SCZ DEBUG: byTaNCfrHalfPercent is " << tf.byTaNCfrHalfPercent << std::endl; |
1709 |
> |
std::cout << "SCZ DEBUG: byTaNCfrQuarterPercent is " << tf.byTaNCfrQuarterPercent << std::endl; |
1710 |
> |
std::cout << "SCZ DEBUG: byTaNCfrTenthPercent is " << tf.byTaNCfrTenthPercent << std::endl; |
1711 |
> |
std::cout << "SCZ DEBUG: byTaNC is " << tf.byTaNC << std::endl; |
1712 |
> |
std::cout << "SCZ DEBUG: isolationPFChargedHadrCandsPtSum is " << tf.isolationPFChargedHadrCandsPtSum << std::endl; |
1713 |
> |
std::cout << "SCZ DEBUG: isolationPFGammaCandsEtSum is " << tf.isolationPFGammaCandsEtSum << std::endl; |
1714 |
> |
std::cout << "SCZ DEBUG: isolationPFGammaCandsEtSum is " << tf.leadPFChargedHadrCandPt << std::endl; |
1715 |
> |
std::cout << "SCZ DEBUG: NsignalPFChargedHadrCands is " << tf.NsignalPFChargedHadrCands << std::endl; |
1716 |
> |
std::cout << "SCZ DEBUG: NsignalPFGammaCands is " << tf.NsignalPFGammaCands << std::endl; |
1717 |
> |
std::cout << "SCZ DEBUG: byLooseCombinedIsolationDeltaBetaCorr is " << tf.byLooseCombinedIsolationDeltaBetaCorr << std::endl; |
1718 |
> |
std::cout << "SCZ DEBUG: againstElectronMVA is " << tf.againstElectronMVA << std::endl; |
1719 |
|
} |
929 |
– |
|
930 |
– |
hbbInfo->diMuonInfo.push_back(df); |
1720 |
|
} |
1721 |
|
|
1722 |
< |
for( size_t i = 0; i < dielectrons->size(); i++ ) { |
1723 |
< |
VHbbEvent::DiElectronInfo df; |
1724 |
< |
const Candidate & dielecCand = (*dielectrons)[ i ]; |
1722 |
> |
CompareJetPtMuons ptComparatorMu; |
1723 |
> |
CompareJetPtElectrons ptComparatorE; |
1724 |
> |
CompareJetPtTaus ptComparatorTau; |
1725 |
> |
|
1726 |
> |
std::sort(hbbInfo->muInfo.begin(), hbbInfo->muInfo.end(), ptComparatorMu); |
1727 |
> |
std::sort(hbbInfo->eleInfo.begin(), hbbInfo->eleInfo.end(), ptComparatorE); |
1728 |
> |
std::sort(hbbInfo->tauInfo.begin(), hbbInfo->tauInfo.end(), ptComparatorTau); |
1729 |
|
|
937 |
– |
df.p4=GENPTOLOR(dielecCand); |
1730 |
|
|
939 |
– |
// accessing the daughters of the dimuon candidate |
940 |
– |
const Candidate * lep0 = dielecCand.daughter( 0 ); |
941 |
– |
const Candidate * lep1 = dielecCand.daughter( 1 ); |
942 |
– |
// needed to access specific methods of pat::Muon |
943 |
– |
const pat::Electron & elecDau0 = dynamic_cast<const pat::Electron &>(*lep0->masterClone()); |
944 |
– |
const pat::Electron & elecDau1 = dynamic_cast<const pat::Electron &>(*lep1->masterClone()); |
945 |
– |
|
946 |
– |
df.daughter1.p4 = GENPTOLOR(elecDau0); |
947 |
– |
df.daughter2.p4= GENPTOLOR(elecDau1); |
948 |
– |
|
949 |
– |
df.daughter1.tIso = elecDau0.trackIso(); |
950 |
– |
df.daughter2.tIso = elecDau1.trackIso(); |
951 |
– |
|
952 |
– |
df.daughter1.eIso = elecDau0.ecalIso(); |
953 |
– |
df.daughter2.eIso = elecDau1.ecalIso(); |
954 |
– |
|
955 |
– |
df.daughter1.hIso = elecDau0.hcalIso(); |
956 |
– |
df.daughter2.hIso = elecDau1.hcalIso(); |
1731 |
|
|
1732 |
< |
// ids |
959 |
< |
df.daughter1.id95 = elecDau0.electronID("simpleEleId95cIso"); |
960 |
< |
df.daughter1.id85 = elecDau0.electronID ("simpleEleId85cIso"); |
961 |
< |
df.daughter1.id70 = elecDau0.electronID ("simpleEleId70cIso"); |
962 |
< |
df.daughter1.id95r = elecDau0.electronID ("simpleEleId95relIso"); |
963 |
< |
df.daughter1.id85r = elecDau0.electronID ("simpleEleId85relIso"); |
964 |
< |
df.daughter1.id70r = elecDau0.electronID ("simpleEleId70relIso"); |
965 |
< |
|
966 |
< |
|
967 |
< |
df.daughter2.id95 = elecDau1.electronID("simpleEleId95cIso"); |
968 |
< |
df.daughter2.id85 = elecDau1.electronID ("simpleEleId85cIso"); |
969 |
< |
df.daughter2.id70 = elecDau1.electronID ("simpleEleId70cIso"); |
970 |
< |
df.daughter2.id95r = elecDau1.electronID ("simpleEleId95relIso"); |
971 |
< |
df.daughter2.id85r = elecDau1.electronID ("simpleEleId85relIso"); |
972 |
< |
df.daughter2.id70r = elecDau1.electronID ("simpleEleId70relIso"); |
973 |
< |
|
974 |
< |
hbbInfo->diElectronInfo.push_back(df); |
975 |
< |
|
976 |
< |
} |
1732 |
> |
|
1733 |
|
if (verbose_){ |
1734 |
|
std::cout <<" Pushing hbbInfo "<<std::endl; |
1735 |
|
std::cout <<" SimpleJets1 = "<<hbbInfo->simpleJets.size()<<std::endl<< |
1736 |
|
" SimpleJets2 = "<<hbbInfo->simpleJets2.size()<<std::endl<< |
1737 |
|
" SubJets = "<<hbbInfo->subJets.size()<<std::endl<< |
1738 |
|
" HardJets = "<<hbbInfo->hardJets.size()<<std::endl<< |
1739 |
+ |
" FilterJets = "<<hbbInfo->filterJets.size()<<std::endl<< |
1740 |
|
" Muons = "<<hbbInfo->muInfo.size()<<std::endl<< |
1741 |
|
" Electrons = "<<hbbInfo->eleInfo.size()<<std::endl<< |
1742 |
|
" Taus = "<<hbbInfo->tauInfo.size()<<std::endl<< |
1749 |
|
iEvent.put(auxInfo); |
1750 |
|
|
1751 |
|
|
1752 |
+ |
delete jecUnc; |
1753 |
+ |
|
1754 |
|
} |
1755 |
|
|
1756 |
|
void |
1860 |
|
//re- |
1861 |
|
} |
1862 |
|
|
1863 |
+ |
|
1864 |
+ |
//Btagging scale factors |
1865 |
+ |
void HbbAnalyzerNew::fillScaleFactors(VHbbEvent::SimpleJet& sj, BTagSFContainer iSF){ |
1866 |
+ |
|
1867 |
+ |
|
1868 |
+ |
BinningPointByMap measurePoint; |
1869 |
+ |
//for a USDG |
1870 |
+ |
//for CB jets |
1871 |
+ |
//scale factor 1 for CB jets over 240GeV/c |
1872 |
+ |
if( TMath::Abs(sj.flavour) == 4 or TMath::Abs(sj.flavour) == 5 ){ |
1873 |
+ |
measurePoint.insert( BinningVariables::JetEt, sj.p4.Et() ); |
1874 |
+ |
measurePoint.insert( BinningVariables::JetAbsEta, fabs(sj.p4.Eta()) ); |
1875 |
+ |
if( iSF.BTAGSF_CSVL->isResultOk(PerformanceResult::BTAGBEFFCORR , measurePoint) ){ |
1876 |
+ |
sj.SF_CSVL = iSF.BTAGSF_CSVL->getResult(PerformanceResult::BTAGBEFFCORR , measurePoint); |
1877 |
+ |
sj.SF_CSVLerr = iSF.BTAGSF_CSVL->getResult(PerformanceResult::BTAGBERRCORR , measurePoint); |
1878 |
+ |
if(verbose_){ |
1879 |
+ |
std::clog << "C/B Jet flavour = " << sj.flavour << std::endl; |
1880 |
+ |
std::clog << "C/B Jet Et = " << sj.p4.Et() << std::endl; |
1881 |
+ |
std::clog << "C/B Jet eta = " << sj.p4.Eta() << std::endl; |
1882 |
+ |
std::clog << "C/B CSVL Scale Factor = " << sj.SF_CSVL << std::endl; |
1883 |
+ |
std::clog << "C/B CSVL Scale Factor error = " << sj.SF_CSVLerr << std::endl; |
1884 |
+ |
} |
1885 |
+ |
} |
1886 |
+ |
if( iSF.BTAGSF_CSVM->isResultOk(PerformanceResult::BTAGBEFFCORR , measurePoint) ){ |
1887 |
+ |
sj.SF_CSVM = iSF.BTAGSF_CSVM->getResult(PerformanceResult::BTAGBEFFCORR , measurePoint); |
1888 |
+ |
sj.SF_CSVMerr = iSF.BTAGSF_CSVM->getResult(PerformanceResult::BTAGBERRCORR , measurePoint); |
1889 |
+ |
} |
1890 |
+ |
if( iSF.BTAGSF_CSVT->isResultOk(PerformanceResult::BTAGBEFFCORR , measurePoint) ){ |
1891 |
+ |
sj.SF_CSVT = iSF.BTAGSF_CSVT->getResult(PerformanceResult::BTAGBEFFCORR , measurePoint); |
1892 |
+ |
sj.SF_CSVTerr = iSF.BTAGSF_CSVT->getResult(PerformanceResult::BTAGBERRCORR , measurePoint); |
1893 |
+ |
} |
1894 |
+ |
else{ |
1895 |
+ |
if(verbose_){ |
1896 |
+ |
std::cerr << "No SF found in the database for this jet" << std::endl; |
1897 |
+ |
std::clog << "No SF found: Jet flavour = " << sj.flavour << std::endl; |
1898 |
+ |
std::clog << "No SF found: Jet Et = " << sj.p4.Et() << std::endl; |
1899 |
+ |
std::clog << "No SF found: Jet eta = " << sj.p4.Eta() << std::endl; |
1900 |
+ |
} |
1901 |
+ |
} |
1902 |
+ |
} |
1903 |
+ |
else { |
1904 |
+ |
measurePoint.insert( BinningVariables::JetEt, sj.p4.Et() ); |
1905 |
+ |
measurePoint.insert( BinningVariables::JetAbsEta, fabs(sj.p4.Eta()) ); |
1906 |
+ |
if( iSF.MISTAGSF_CSVL->isResultOk(PerformanceResult::BTAGLEFFCORR , measurePoint) ){ |
1907 |
+ |
sj.SF_CSVL = iSF.MISTAGSF_CSVL->getResult(PerformanceResult::BTAGLEFFCORR , measurePoint); |
1908 |
+ |
sj.SF_CSVLerr = iSF.MISTAGSF_CSVL->getResult(PerformanceResult::BTAGLERRCORR , measurePoint); |
1909 |
+ |
if(verbose_){ |
1910 |
+ |
std::clog << "Light Jet flavour = " << sj.flavour << std::endl; |
1911 |
+ |
std::clog << "Light Jet Et = " << sj.p4.Et() << std::endl; |
1912 |
+ |
std::clog << "Light Jet eta = " << sj.p4.Eta() << std::endl; |
1913 |
+ |
std::clog << "Light CSVL Scale Factor = " << sj.SF_CSVL << std::endl; |
1914 |
+ |
std::clog << "Light CSVL Scale Factor error = " << sj.SF_CSVLerr << std::endl; |
1915 |
+ |
} |
1916 |
+ |
} |
1917 |
+ |
if( iSF.MISTAGSF_CSVM->isResultOk(PerformanceResult::BTAGLEFFCORR , measurePoint) ){ |
1918 |
+ |
sj.SF_CSVM = iSF.MISTAGSF_CSVM->getResult(PerformanceResult::BTAGLEFFCORR , measurePoint); |
1919 |
+ |
sj.SF_CSVMerr = iSF.MISTAGSF_CSVM->getResult(PerformanceResult::BTAGLERRCORR , measurePoint); |
1920 |
+ |
} |
1921 |
+ |
if( iSF.MISTAGSF_CSVT->isResultOk(PerformanceResult::BTAGLEFFCORR , measurePoint) ){ |
1922 |
+ |
sj.SF_CSVT = iSF.MISTAGSF_CSVT->getResult(PerformanceResult::BTAGLEFFCORR , measurePoint); |
1923 |
+ |
sj.SF_CSVTerr = iSF.MISTAGSF_CSVT->getResult(PerformanceResult::BTAGLERRCORR , measurePoint); |
1924 |
+ |
} |
1925 |
+ |
else{ |
1926 |
+ |
if(verbose_){ |
1927 |
+ |
std::cerr << "No SF found in the database for this jet" << std::endl; |
1928 |
+ |
std::clog << "No SF found: Jet flavour = " << sj.flavour << std::endl; |
1929 |
+ |
std::clog << "No SF found: Jet Et = " << sj.p4.Et() << std::endl; |
1930 |
+ |
std::clog << "No SF found: Jet eta = " << sj.p4.Eta() << std::endl; |
1931 |
+ |
} |
1932 |
+ |
} |
1933 |
+ |
} |
1934 |
+ |
|
1935 |
+ |
} |
1936 |
+ |
|
1937 |
+ |
void HbbAnalyzerNew::setJecUnc(VHbbEvent::SimpleJet& sj,JetCorrectionUncertainty* jecunc){ |
1938 |
+ |
// |
1939 |
+ |
// test |
1940 |
+ |
// |
1941 |
+ |
|
1942 |
+ |
// return; |
1943 |
+ |
double eta = sj.p4.Eta(); |
1944 |
+ |
double pt = sj.p4.Pt(); |
1945 |
+ |
|
1946 |
+ |
jecunc->setJetEta(eta); |
1947 |
+ |
jecunc->setJetPt(pt); // here you must use the CORRECTED jet pt |
1948 |
+ |
double unc = jecunc->getUncertainty(true); |
1949 |
+ |
sj.jecunc= unc; |
1950 |
+ |
} |
1951 |
+ |
|
1952 |
+ |
|
1953 |
+ |
void HbbAnalyzerNew ::fillSimpleJet (VHbbEvent::SimpleJet& sj, edm::View<pat::Jet>::const_iterator jet_iter){ |
1954 |
+ |
sj.flavour = jet_iter->partonFlavour(); |
1955 |
+ |
|
1956 |
+ |
sj.tche=jet_iter->bDiscriminator("trackCountingHighEffBJetTags"); |
1957 |
+ |
sj.tchp=jet_iter->bDiscriminator("trackCountingHighPurBJetTags"); |
1958 |
+ |
sj.jp=jet_iter->bDiscriminator("jetProbabilityBJetTags"); |
1959 |
+ |
sj.jpb=jet_iter->bDiscriminator("jetBProbabilityBJetTags"); |
1960 |
+ |
sj.ssvhe=jet_iter->bDiscriminator("simpleSecondaryVertexHighEffBJetTags"); |
1961 |
+ |
sj.csv=jet_iter->bDiscriminator("combinedSecondaryVertexBJetTags"); |
1962 |
+ |
sj.csvmva=jet_iter->bDiscriminator("combinedSecondaryVertexMVABJetTags"); |
1963 |
+ |
sj.csvivf=jet_iter->bDiscriminator("combinedInclusiveSecondaryVertexBJetTags"); |
1964 |
+ |
sj.cmva=jet_iter->bDiscriminator("combinedMVABJetTags"); |
1965 |
+ |
sj.charge=jet_iter->jetCharge(); |
1966 |
+ |
sj.ntracks=jet_iter->associatedTracks().size(); |
1967 |
+ |
sj.p4=GENPTOLORP(jet_iter); |
1968 |
+ |
// std::cout << " ECCO "<<sj.csv<< " "<< sj.p4.Pt()<<std::endl; |
1969 |
+ |
sj.chargedTracksFourMomentum=(getChargedTracksMomentum(&*(jet_iter))); |
1970 |
+ |
sj.SF_CSVL=1; |
1971 |
+ |
sj.SF_CSVM=1; |
1972 |
+ |
sj.SF_CSVT=1; |
1973 |
+ |
sj.SF_CSVLerr=0; |
1974 |
+ |
sj.SF_CSVMerr=0; |
1975 |
+ |
sj.SF_CSVTerr=0; |
1976 |
+ |
|
1977 |
+ |
|
1978 |
+ |
|
1979 |
+ |
|
1980 |
+ |
|
1981 |
+ |
if (jet_iter->isPFJet() == true) { |
1982 |
+ |
|
1983 |
+ |
sj.chargedHadronEFraction = jet_iter-> chargedHadronEnergyFraction(); |
1984 |
+ |
sj.neutralHadronEFraction = jet_iter-> neutralHadronEnergyFraction (); |
1985 |
+ |
sj.chargedEmEFraction = jet_iter-> chargedEmEnergyFraction (); |
1986 |
+ |
sj.neutralEmEFraction = jet_iter-> neutralEmEnergyFraction (); |
1987 |
+ |
sj.nConstituents = jet_iter->getPFConstituents().size(); |
1988 |
+ |
|
1989 |
+ |
} |
1990 |
+ |
sj.jetArea = jet_iter->jetArea(); |
1991 |
+ |
// |
1992 |
+ |
// addtaginfo for csv |
1993 |
+ |
// |
1994 |
+ |
|
1995 |
+ |
// if (jet_iter->hasTagInfo("SimpleSecondaryVertex")) { |
1996 |
+ |
|
1997 |
+ |
const reco::SecondaryVertexTagInfo * tf = jet_iter->tagInfoSecondaryVertex(); |
1998 |
+ |
if (tf){ |
1999 |
+ |
math::XYZTLorentzVectorD vertexSum; |
2000 |
+ |
for(size_t vi=0;vi< tf->nVertices();vi++) |
2001 |
+ |
{ |
2002 |
+ |
vertexSum+=tf->secondaryVertex(vi).p4(); |
2003 |
+ |
} |
2004 |
+ |
sj.vtxP4 = GENPTOLOR(vertexSum); |
2005 |
+ |
|
2006 |
+ |
if (tf->nVertices() >0){ |
2007 |
+ |
sj.vtxPosition = TVector3(tf->secondaryVertex(0).position().x(),tf->secondaryVertex(0).position().y(),tf->secondaryVertex(0).position().z()); |
2008 |
+ |
sj.vtxMass = tf->secondaryVertex(0).p4().mass(); |
2009 |
+ |
sj.vtxNTracks = tf->secondaryVertex(0).nTracks(); |
2010 |
+ |
std::vector<reco::TrackBaseRef >::const_iterator tit = tf->secondaryVertex(0).tracks_begin(); |
2011 |
+ |
for (; tit< tf->secondaryVertex(0).tracks_end(); ++tit){ |
2012 |
+ |
sj.vtxTrackIds.push_back(tit->key()); |
2013 |
+ |
} |
2014 |
+ |
Measurement1D m = tf->flightDistance(0); |
2015 |
+ |
sj.vtx3dL = m.value(); |
2016 |
+ |
sj.vtx3deL = m.error(); |
2017 |
+ |
} |
2018 |
+ |
} |
2019 |
+ |
|
2020 |
+ |
// CSV track info |
2021 |
+ |
const reco::SecondaryVertexTagInfo * svTagInfos = jet_iter->tagInfoSecondaryVertex(); |
2022 |
+ |
const reco::TrackIPTagInfo * ipTagInfos = jet_iter->tagInfoTrackIP(); |
2023 |
+ |
for (edm::RefVector<reco::TrackCollection>::const_iterator t = ipTagInfos->selectedTracks().begin(); t != ipTagInfos->selectedTracks().end(); t++){ |
2024 |
+ |
sj.btagTrackIds.push_back(t->key()); |
2025 |
+ |
}// all btag IP selected tracks |
2026 |
+ |
std::vector<const reco::BaseTagInfo*> tagInfos; |
2027 |
+ |
tagInfos.push_back(dynamic_cast<const reco::BaseTagInfo*>(ipTagInfos)); |
2028 |
+ |
tagInfos.push_back(dynamic_cast<const reco::BaseTagInfo*>(svTagInfos)); |
2029 |
+ |
JetTagComputer::TagInfoHelper helper(tagInfos); |
2030 |
+ |
reco::TaggingVariableList varList = computer->taggingVariables(helper); // computer for getting CSV variables |
2031 |
+ |
|
2032 |
+ |
for(reco::TaggingVariableList::const_iterator iter = varList.begin(); iter != varList.end(); ++iter) |
2033 |
+ |
{ |
2034 |
+ |
//std::cout << reco::TaggingVariableTokens[iter->first] << " = " << iter->second << std::endl; |
2035 |
+ |
for (edm::RefVector<reco::TrackCollection>::const_iterator t = ipTagInfos->selectedTracks().begin(); t != ipTagInfos->selectedTracks().end(); t++){ |
2036 |
+ |
|
2037 |
+ |
if (strcmp(reco::TaggingVariableTokens[iter->first], "trackMomentum") == 0 && (fabs((float)iter->second - (float)(*t)->p()) < 0.0001) ){ |
2038 |
+ |
sj.csvTrackIds.push_back(t->key()); |
2039 |
+ |
}// if tagged track |
2040 |
+ |
}// loop on IPtracks |
2041 |
+ |
}// loop on CSV variables |
2042 |
+ |
|
2043 |
+ |
|
2044 |
+ |
sj.btagNTracks= ipTagInfos->selectedTracks().size(); |
2045 |
+ |
sj.csvNTracks = sj.csvTrackIds.size(); |
2046 |
+ |
|
2047 |
+ |
// |
2048 |
+ |
// add tVector |
2049 |
+ |
// |
2050 |
+ |
sj.tVector = getTvect(&(*jet_iter)); |
2051 |
+ |
|
2052 |
+ |
sj.ptRaw = jet_iter->correctedJet(0).pt(); |
2053 |
+ |
|
2054 |
+ |
sj.ptLeadTrack =-9999.; |
2055 |
+ |
if (jet_iter->isPFJet() == true) { |
2056 |
+ |
std::vector <reco::PFCandidatePtr> constituents = jet_iter->getPFConstituents (); |
2057 |
+ |
for (unsigned ic = 0; ic < constituents.size (); ++ic) { |
2058 |
+ |
if ( constituents[ic]->particleId() > 3 ) continue; |
2059 |
+ |
reco::TrackRef trackRef = constituents[ic]->trackRef(); |
2060 |
+ |
if ( trackRef.isNonnull() ) { if(trackRef->pt() > sj.ptLeadTrack) sj.ptLeadTrack=trackRef->pt(); } |
2061 |
+ |
} |
2062 |
+ |
} |
2063 |
+ |
|
2064 |
+ |
|
2065 |
+ |
} |
2066 |
+ |
|
2067 |
+ |
float HbbAnalyzerNew::metSignificance(const reco::MET * met) |
2068 |
+ |
{ |
2069 |
+ |
double sigmaX2= met->getSignificanceMatrix()(0,0); |
2070 |
+ |
double sigmaY2= met->getSignificanceMatrix()(1,1); |
2071 |
+ |
double significance = 0; |
2072 |
+ |
try { |
2073 |
+ |
if(sigmaX2<1.e10 && sigmaY2<1.e10) significance = met->significance(); |
2074 |
+ |
} |
2075 |
+ |
catch(...) |
2076 |
+ |
{ |
2077 |
+ |
std::cout << "PROBLEM WITH MET SIGNIFICANCE sigma X2 and Y2 are: " << sigmaX2 << " " << sigmaY2 << std::endl; |
2078 |
+ |
} |
2079 |
+ |
return significance; |
2080 |
+ |
} |
2081 |
+ |
|
2082 |
+ |
|
2083 |
|
//define this as a plug-in |
2084 |
|
DEFINE_FWK_MODULE(HbbAnalyzerNew); |