1 |
< |
// -*- C++ -*- |
2 |
< |
// |
3 |
< |
// Package: HbbAnalyzerNew |
4 |
< |
// Class: HbbAnalyzerNew |
5 |
< |
// |
1 |
> |
// -*- C++ -*- |
2 |
> |
// |
3 |
> |
// Package: HbbAnalyzerNew |
4 |
> |
// Class: HbbAnalyzerNew |
5 |
> |
// |
6 |
|
/**\class HbbAnalyzerNew HbbAnalyzerNew.cc Analysis/HbbAnalyzer/src/HbbAnalyzerNew.cc |
7 |
+ |
|
8 |
+ |
Description: <one line class summary> |
9 |
+ |
|
10 |
+ |
Implementation: |
11 |
+ |
<Notes on implementation> |
12 |
+ |
*/ |
13 |
+ |
// |
14 |
+ |
// Original Author: David Lopes Pegna,Address unknown,NONE, |
15 |
+ |
// Created: Thu Mar 5 13:51:28 EST 2009 |
16 |
+ |
// $Id$ |
17 |
+ |
// |
18 |
+ |
// |
19 |
|
|
8 |
– |
Description: <one line class summary> |
20 |
|
|
21 |
< |
Implementation: |
22 |
< |
<Notes on implementation> |
23 |
< |
*/ |
13 |
< |
// |
14 |
< |
// Original Author: David Lopes Pegna,Address unknown,NONE, |
15 |
< |
// Created: Thu Mar 5 13:51:28 EST 2009 |
16 |
< |
// $Id$ |
17 |
< |
// |
18 |
< |
// |
19 |
< |
|
20 |
< |
|
21 |
< |
//uncomment to save also jet collections 1 and 4 |
22 |
< |
//#define ENABLE_SIMPLEJETS1 |
23 |
< |
//#define ENABLE_SIMPLEJETS4 |
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" |
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 |
+ |
|
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 |
< |
} |
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 |
< |
} |
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 |
< |
} |
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 |
< |
jetLabel_(iConfig.getParameter<edm::InputTag>("jetTag")), |
81 |
< |
subjetLabel_(iConfig.getParameter<edm::InputTag>("subjetTag")), |
82 |
< |
simplejet1Label_(iConfig.getParameter<edm::InputTag>("simplejet1Tag")), |
83 |
< |
simplejet2Label_(iConfig.getParameter<edm::InputTag>("simplejet2Tag")), |
84 |
< |
simplejet3Label_(iConfig.getParameter<edm::InputTag>("simplejet3Tag")), |
85 |
< |
simplejet4Label_(iConfig.getParameter<edm::InputTag>("simplejet4Tag")), |
86 |
< |
tauLabel_(iConfig.getParameter<edm::InputTag>("tauTag")), |
87 |
< |
metLabel_(iConfig.getParameter<edm::InputTag>("metTag")), |
88 |
< |
phoLabel_(iConfig.getParameter<edm::InputTag>("photonTag")), |
89 |
< |
hltResults_(iConfig.getParameter<edm::InputTag>("hltResultsTag")), |
90 |
< |
runOnMC_(iConfig.getParameter<bool>("runOnMC")), verbose_(iConfig.getUntrackedParameter<bool>("verbose")) { |
91 |
< |
|
92 |
< |
// |
93 |
< |
// put the setwhatproduced etc etc |
94 |
< |
|
95 |
< |
produces<VHbbEvent>(); |
96 |
< |
produces<VHbbEventAuxInfo>(); |
97 |
< |
|
98 |
< |
|
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")), |
89 |
> |
simplejet4Label_(iConfig.getParameter<edm::InputTag>("simplejet4Tag")), |
90 |
> |
tauLabel_(iConfig.getParameter<edm::InputTag>("tauTag")), |
91 |
> |
metLabel_(iConfig.getParameter<edm::InputTag>("metTag")), |
92 |
> |
phoLabel_(iConfig.getParameter<edm::InputTag>("photonTag")), |
93 |
> |
hltResults_(iConfig.getParameter<edm::InputTag>("hltResultsTag")), |
94 |
> |
runOnMC_(iConfig.getParameter<bool>("runOnMC")), verbose_(iConfig.getUntrackedParameter<bool>("verbose")) { |
95 |
> |
|
96 |
> |
// |
97 |
> |
// put the setwhatproduced etc etc |
98 |
> |
|
99 |
> |
produces<VHbbEvent>(); |
100 |
> |
produces<VHbbEventAuxInfo>(); |
101 |
> |
|
102 |
> |
|
103 |
|
} |
104 |
|
|
105 |
|
|
106 |
|
HbbAnalyzerNew::~HbbAnalyzerNew(){ |
107 |
< |
|
108 |
< |
// do anything here that needs to be done at desctruction time |
109 |
< |
// (e.g. close files, deallocate resources etc.) |
110 |
< |
|
107 |
> |
|
108 |
> |
// do anything here that needs to be done at desctruction time |
109 |
> |
// (e.g. close files, deallocate resources etc.) |
110 |
> |
|
111 |
|
} |
112 |
|
|
113 |
|
|
114 |
< |
// |
115 |
< |
// member functions |
116 |
< |
// |
114 |
> |
// |
115 |
> |
// member functions |
116 |
> |
// |
117 |
|
|
118 |
< |
// ------------ method called to for each event ------------ |
118 |
> |
// ------------ method called to for each event ------------ |
119 |
|
void |
120 |
|
HbbAnalyzerNew::produce(edm::Event& iEvent, const edm::EventSetup& iSetup){ |
121 |
< |
using namespace edm; |
122 |
< |
using namespace reco; |
123 |
< |
|
124 |
< |
|
125 |
< |
// JEC Uncertainty |
126 |
< |
|
127 |
< |
// JetCorrectionUncertainty *jecUnc=0; |
128 |
< |
edm::ESHandle<JetCorrectorParametersCollection> JetCorParColl; |
129 |
< |
iSetup.get<JetCorrectionsRecord>().get("AK5PF",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 |
< |
|
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 |
< |
|
150 |
< |
// trigger |
151 |
< |
|
152 |
< |
// trigger |
153 |
< |
edm::Handle<edm::TriggerResults> hltresults; |
154 |
< |
//iEvent.getByLabel("TriggerResults", hltresults); |
155 |
< |
|
156 |
< |
//edm::InputTag tag("TriggerResults::HLT"); |
157 |
< |
// edm::InputTag tag("TriggerResults::HLT0"); |
158 |
< |
iEvent.getByLabel(hltResults_, hltresults); |
159 |
< |
|
160 |
< |
const edm::TriggerNames & triggerNames_ = iEvent.triggerNames(*hltresults); |
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; |
167 |
< |
iEvent.getByLabel("offlineBeamSpot",recoBeamSpotHandle); |
168 |
< |
vertexBeamSpot = *recoBeamSpotHandle; |
169 |
< |
/* |
170 |
< |
double BSx=vertexBeamSpot.x0(); |
171 |
< |
double BSy=vertexBeamSpot.y0(); |
172 |
< |
double BSz=vertexBeamSpot.z0(); |
173 |
< |
*/ |
174 |
< |
|
175 |
< |
double MinVtxProb=-999.; |
176 |
< |
int VtxIn=-99; |
177 |
< |
|
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()); |
186 |
< |
if(RecVtxProb>MinVtxProb){ |
187 |
< |
VtxIn=i; |
188 |
< |
MinVtxProb=RecVtxProb; |
189 |
< |
} |
190 |
< |
} |
191 |
< |
|
192 |
< |
const Vertex &RecVtx = (*recVtxs)[VtxIn]; |
193 |
< |
const Vertex &RecVtxFirst = (*recVtxs)[0]; |
194 |
< |
|
195 |
< |
auxInfo->pvInfo.firstPVInPT2 = TVector3(RecVtxFirst.x(), RecVtxFirst.y(), RecVtxFirst.z()); |
196 |
< |
auxInfo->pvInfo.firstPVInProb = TVector3(RecVtx.x(), RecVtx.y(), RecVtx.z()); |
197 |
< |
|
198 |
< |
|
199 |
< |
edm::Handle<double> rhoHandle; |
200 |
< |
iEvent.getByLabel(edm::InputTag("kt6PFJets", "rho"),rhoHandle); |
201 |
< |
auxInfo->puInfo.rho = *rhoHandle; |
202 |
< |
|
203 |
< |
edm::Handle<double> rho25Handle; |
204 |
< |
iEvent.getByLabel(edm::InputTag("kt6PFJets25", "rho"),rho25Handle); |
205 |
< |
auxInfo->puInfo.rho25 = *rho25Handle; |
206 |
< |
|
207 |
< |
edm::Handle<std::vector< PileupSummaryInfo> > puHandle; |
208 |
< |
|
209 |
< |
if (runOnMC_){ |
210 |
< |
iEvent.getByType(puHandle); |
211 |
< |
if (puHandle.isValid()){ |
212 |
< |
|
213 |
< |
std::vector< PileupSummaryInfo> pu = (*puHandle); |
214 |
< |
for (std::vector<PileupSummaryInfo>::const_iterator it= pu.begin(); it!=pu.end(); ++it){ |
215 |
< |
int bx = (*it).getBunchCrossing(); |
216 |
< |
unsigned int num = (*it).getPU_NumInteractions(); |
217 |
< |
// std::cout <<" PU PUSHING "<<bx<<" " <<num<<std::endl; |
218 |
< |
auxInfo->puInfo.pus[bx] =num; |
219 |
< |
} |
220 |
< |
} |
221 |
< |
} |
222 |
< |
|
223 |
< |
//// real start |
224 |
< |
|
225 |
< |
|
226 |
< |
Handle<GenParticleCollection> genParticles; |
227 |
< |
|
228 |
< |
bool printJet=0; |
229 |
< |
|
230 |
< |
|
231 |
< |
if(runOnMC_){ |
121 |
> |
using namespace edm; |
122 |
> |
using namespace reco; |
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 |
> |
|
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 |
> |
|
150 |
> |
// trigger |
151 |
> |
|
152 |
> |
// trigger |
153 |
> |
edm::Handle<edm::TriggerResults> hltresults; |
154 |
> |
//iEvent.getByLabel("TriggerResults", hltresults); |
155 |
> |
|
156 |
> |
//edm::InputTag tag("TriggerResults::HLT"); |
157 |
> |
// edm::InputTag tag("TriggerResults::HLT0"); |
158 |
> |
iEvent.getByLabel(hltResults_, hltresults); |
159 |
> |
|
160 |
> |
const edm::TriggerNames & triggerNames_ = iEvent.triggerNames(*hltresults); |
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; |
167 |
> |
iEvent.getByLabel("offlineBeamSpot",recoBeamSpotHandle); |
168 |
> |
vertexBeamSpot = *recoBeamSpotHandle; |
169 |
> |
/* |
170 |
> |
double BSx=vertexBeamSpot.x0(); |
171 |
> |
double BSy=vertexBeamSpot.y0(); |
172 |
> |
double BSz=vertexBeamSpot.z0(); |
173 |
> |
*/ |
174 |
> |
|
175 |
> |
double MinVtxProb=-999.; |
176 |
> |
int VtxIn=-99; |
177 |
> |
|
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()); |
186 |
> |
if(RecVtxProb>MinVtxProb){ |
187 |
> |
VtxIn=i; |
188 |
> |
MinVtxProb=RecVtxProb; |
189 |
> |
} |
190 |
> |
} |
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 |
> |
|
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); |
204 |
> |
auxInfo->puInfo.rho = *rhoHandle; |
205 |
> |
|
206 |
> |
edm::Handle<double> rho25Handle; |
207 |
> |
iEvent.getByLabel(edm::InputTag("kt6PFJets25", "rho"),rho25Handle); |
208 |
> |
auxInfo->puInfo.rho25 = *rho25Handle; |
209 |
> |
edm::Handle<double> rho25HandleIso; |
210 |
> |
iEvent.getByLabel(edm::InputTag("kt6PFJetsForIsolation", "rho"),rho25HandleIso); |
211 |
> |
auxInfo->puInfo.rho25Iso = *rho25HandleIso; |
212 |
> |
|
213 |
> |
edm::Handle<double> rhoNeutralHandle; |
214 |
> |
iEvent.getByLabel(edm::InputTag("kt6PFJetsCentralNeutral", "rho"),rhoNeutralHandle); |
215 |
> |
auxInfo->puInfo.rhoNeutral = *rhoNeutralHandle; |
216 |
> |
|
217 |
> |
|
218 |
> |
edm::Handle<std::vector< PileupSummaryInfo> > puHandle; |
219 |
> |
|
220 |
> |
if (runOnMC_){ |
221 |
> |
iEvent.getByType(puHandle); |
222 |
> |
if (puHandle.isValid()){ |
223 |
> |
|
224 |
> |
std::vector< PileupSummaryInfo> pu = (*puHandle); |
225 |
> |
for (std::vector<PileupSummaryInfo>::const_iterator it= pu.begin(); it!=pu.end(); ++it){ |
226 |
> |
int bx = (*it).getBunchCrossing(); |
227 |
> |
if(bx == 0) { auxInfo->puInfo.truePU = (*it).getTrueNumInteractions();} |
228 |
> |
unsigned int num = (*it).getPU_NumInteractions(); |
229 |
> |
// std::cout <<" PU PUSHING "<<bx<<" " <<num<<std::endl; |
230 |
> |
auxInfo->puInfo.pus[bx] =num; |
231 |
> |
} |
232 |
> |
} |
233 |
> |
} |
234 |
> |
|
235 |
> |
//// real start |
236 |
> |
|
237 |
> |
|
238 |
> |
Handle<GenParticleCollection> genParticles; |
239 |
> |
|
240 |
> |
bool printJet=0; |
241 |
|
|
210 |
– |
iEvent.getByLabel("genParticles", genParticles); |
242 |
|
|
212 |
– |
for(size_t i = 0; i < genParticles->size(); ++ i) { |
213 |
– |
|
214 |
– |
const GenParticle & p = (*genParticles)[i]; |
215 |
– |
int id = p.pdgId(); |
216 |
– |
int st = p.status(); |
217 |
– |
|
218 |
– |
if(id==25){ |
219 |
– |
|
220 |
– |
VHbbEventAuxInfo::ParticleMCInfo htemp; |
221 |
– |
htemp.status=st; |
222 |
– |
htemp.charge=p.charge(); |
223 |
– |
if(p.mother(0)!=0) htemp.momid=p.mother(0)->pdgId(); |
224 |
– |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) htemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
225 |
– |
htemp.p4 = GENPTOLOR(p); |
226 |
– |
|
227 |
– |
int ndau = p.numberOfDaughters(); |
228 |
– |
for(int j = 0; j < ndau; ++ j) { |
229 |
– |
const Candidate * Hdau = p.daughter( j ); |
230 |
– |
htemp.dauid.push_back(Hdau->pdgId()); |
231 |
– |
htemp.dauFourMomentum.push_back(GENPTOLORP(Hdau)); |
232 |
– |
} |
233 |
– |
(auxInfo->mcH).push_back(htemp); |
234 |
– |
} |
235 |
– |
|
236 |
– |
|
237 |
– |
if(abs(id)==24){ |
238 |
– |
|
239 |
– |
VHbbEventAuxInfo::ParticleMCInfo wtemp; |
240 |
– |
wtemp.status=st; |
241 |
– |
wtemp.charge=p.charge(); |
242 |
– |
if(p.mother(0)!=0) wtemp.momid=p.mother(0)->pdgId(); |
243 |
– |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) wtemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
244 |
– |
wtemp.p4=GENPTOLOR(p); |
245 |
– |
|
246 |
– |
int ndau = p.numberOfDaughters(); |
247 |
– |
for(int j = 0; j < ndau; ++ j) { |
248 |
– |
const Candidate * Wdau = p.daughter( j ); |
249 |
– |
wtemp.dauid.push_back(Wdau->pdgId()); |
250 |
– |
wtemp.dauFourMomentum.push_back(GENPTOLORP(Wdau)); |
251 |
– |
} |
252 |
– |
auxInfo->mcW.push_back(wtemp); |
253 |
– |
} |
254 |
– |
|
255 |
– |
if(abs(id)==23){ |
256 |
– |
|
257 |
– |
|
258 |
– |
VHbbEventAuxInfo::ParticleMCInfo ztemp; |
259 |
– |
ztemp.status=st; |
260 |
– |
ztemp.charge=p.charge(); |
261 |
– |
if(p.mother(0)!=0) ztemp.momid=p.mother(0)->pdgId(); |
262 |
– |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) ztemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
263 |
– |
ztemp.p4=GENPTOLOR(p); |
264 |
– |
|
265 |
– |
int ndau = p.numberOfDaughters(); |
266 |
– |
for(int j = 0; j < ndau; ++ j) { |
267 |
– |
const Candidate * Zdau = p.daughter( j ); |
268 |
– |
ztemp.dauid.push_back(Zdau->pdgId()); |
269 |
– |
ztemp.dauFourMomentum.push_back(GENPTOLOR(p)); |
270 |
– |
} |
271 |
– |
auxInfo->mcZ.push_back(ztemp); |
272 |
– |
} |
273 |
– |
// |
274 |
– |
// binfo |
275 |
– |
// |
276 |
– |
|
277 |
– |
|
278 |
– |
if(id==5){ |
279 |
– |
|
280 |
– |
VHbbEventAuxInfo::ParticleMCInfo btemp; |
281 |
– |
btemp.status=st; |
282 |
– |
btemp.charge=p.charge(); |
283 |
– |
if(p.mother(0)!=0) btemp.momid=p.mother(0)->pdgId(); |
284 |
– |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) btemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
285 |
– |
|
286 |
– |
btemp.p4=GENPTOLOR(p); |
287 |
– |
|
288 |
– |
int nHDaubdau = p.numberOfDaughters(); |
289 |
– |
for(int j = 0; j < nHDaubdau; ++ j) { |
290 |
– |
const Candidate * Bdau = p.daughter( j ); |
291 |
– |
btemp.dauid.push_back(Bdau->pdgId()); |
292 |
– |
} |
293 |
– |
auxInfo->mcB.push_back(btemp); |
294 |
– |
} |
295 |
– |
|
296 |
– |
if(id==-5){ |
297 |
– |
|
298 |
– |
VHbbEventAuxInfo::ParticleMCInfo bbtemp; |
299 |
– |
|
300 |
– |
bbtemp.status=st; |
301 |
– |
bbtemp.charge=p.charge(); |
302 |
– |
if(p.mother(0)!=0) bbtemp.momid=p.mother(0)->pdgId(); |
303 |
– |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) bbtemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
304 |
– |
|
305 |
– |
bbtemp.p4=GENPTOLOR(p); |
306 |
– |
|
307 |
– |
int nHDaubdau = p.numberOfDaughters(); |
308 |
– |
for(int j = 0; j < nHDaubdau; ++ j) { |
309 |
– |
const Candidate * Bdau = p.daughter( j ); |
310 |
– |
bbtemp.dauid.push_back(Bdau->pdgId()); |
311 |
– |
} |
312 |
– |
|
313 |
– |
|
314 |
– |
auxInfo->mcBbar.push_back(bbtemp); |
315 |
– |
} |
316 |
– |
|
317 |
– |
if(abs(id)==4){ |
318 |
– |
VHbbEventAuxInfo::ParticleMCInfo ctemp; |
319 |
– |
ctemp.status=st; |
320 |
– |
ctemp.charge=p.charge(); |
321 |
– |
if(p.mother(0)!=0) ctemp.momid=p.mother(0)->pdgId(); |
322 |
– |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) ctemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
323 |
– |
|
324 |
– |
ctemp.p4=GENPTOLOR(p); |
325 |
– |
|
326 |
– |
int nHDaubdau = p.numberOfDaughters(); |
327 |
– |
for(int j = 0; j < nHDaubdau; ++ j) { |
328 |
– |
const Candidate * Bdau = p.daughter( j ); |
329 |
– |
ctemp.dauid.push_back(Bdau->pdgId()); |
330 |
– |
} |
331 |
– |
|
332 |
– |
auxInfo->mcC.push_back(ctemp); |
333 |
– |
|
334 |
– |
} |
335 |
– |
|
336 |
– |
} |
337 |
– |
|
338 |
– |
} // isMC |
339 |
– |
|
340 |
– |
/////// end generator block |
341 |
– |
|
342 |
– |
|
343 |
– |
edm::Handle<edm::View<pat::Muon> > muonHandle; |
344 |
– |
iEvent.getByLabel(muoLabel_,muonHandle); |
345 |
– |
edm::View<pat::Muon> muons = *muonHandle; |
346 |
– |
|
347 |
– |
// hard jet |
348 |
– |
edm::Handle<edm::View<pat::Jet> > jetHandle; |
349 |
– |
iEvent.getByLabel(jetLabel_,jetHandle); |
350 |
– |
edm::View<pat::Jet> jets = *jetHandle; |
351 |
– |
|
352 |
– |
// sub jet |
353 |
– |
edm::Handle<edm::View<pat::Jet> > subjetHandle; |
354 |
– |
iEvent.getByLabel(subjetLabel_,subjetHandle); |
355 |
– |
edm::View<pat::Jet> subjets = *subjetHandle; |
356 |
– |
|
357 |
– |
// standard jets |
358 |
– |
|
359 |
– |
edm::Handle<edm::View<pat::Jet> > simplejet1Handle; |
360 |
– |
iEvent.getByLabel(simplejet1Label_,simplejet1Handle); |
361 |
– |
edm::View<pat::Jet> simplejets1 = *simplejet1Handle; |
362 |
– |
|
363 |
– |
edm::Handle<edm::View<pat::Jet> > simplejet2Handle; |
364 |
– |
iEvent.getByLabel(simplejet2Label_,simplejet2Handle); |
365 |
– |
edm::View<pat::Jet> simplejets2 = *simplejet2Handle; |
366 |
– |
|
367 |
– |
edm::Handle<edm::View<pat::Jet> > simplejet3Handle; |
368 |
– |
iEvent.getByLabel(simplejet3Label_,simplejet3Handle); |
369 |
– |
edm::View<pat::Jet> simplejets3 = *simplejet3Handle; |
370 |
– |
|
371 |
– |
edm::Handle<edm::View<pat::Jet> > simplejet4Handle; |
372 |
– |
iEvent.getByLabel(simplejet4Label_,simplejet4Handle); |
373 |
– |
edm::View<pat::Jet> simplejets4 = *simplejet4Handle; |
374 |
– |
|
375 |
– |
|
376 |
– |
edm::Handle<edm::View<pat::Electron> > electronHandle; |
377 |
– |
iEvent.getByLabel(eleLabel_,electronHandle); |
378 |
– |
edm::View<pat::Electron> electrons = *electronHandle; |
379 |
– |
|
380 |
– |
|
381 |
– |
// edm::Handle<edm::View<pat::Photon> > phoHandle; |
382 |
– |
// iEvent.getByLabel(phoLabel_,phoHandle); |
383 |
– |
// edm::View<pat::Photon> photons = *phoHandle; |
384 |
– |
|
385 |
– |
edm::Handle<edm::View<pat::Tau> > tauHandle; |
386 |
– |
iEvent.getByLabel(tauLabel_,tauHandle); |
387 |
– |
edm::View<pat::Tau> taus = *tauHandle; |
388 |
– |
|
389 |
– |
|
390 |
– |
//BTAGGING SCALE FACTOR FROM DATABASE |
391 |
– |
//Combined Secondary Vertex Loose |
392 |
– |
edm::ESHandle<BtagPerformance> bTagSF_CSVL_; |
393 |
– |
iSetup.get<BTagPerformanceRecord>().get("BTAGCSVL",bTagSF_CSVL_); |
394 |
– |
//Combined Secondary Vertex Medium |
395 |
– |
edm::ESHandle<BtagPerformance> bTagSF_CSVM_; |
396 |
– |
iSetup.get<BTagPerformanceRecord>().get("BTAGCSVM",bTagSF_CSVM_); |
397 |
– |
//Combined Secondary Vertex Tight |
398 |
– |
edm::ESHandle<BtagPerformance> bTagSF_CSVT_; |
399 |
– |
iSetup.get<BTagPerformanceRecord>().get("BTAGCSVT",bTagSF_CSVT_); |
400 |
– |
|
401 |
– |
edm::ESHandle<BtagPerformance> mistagSF_CSVL_; |
402 |
– |
iSetup.get<BTagPerformanceRecord>().get("MISTAGCSVL",mistagSF_CSVL_); |
403 |
– |
//Combined Secondary Vertex Medium |
404 |
– |
edm::ESHandle<BtagPerformance> mistagSF_CSVM_; |
405 |
– |
iSetup.get<BTagPerformanceRecord>().get("MISTAGCSVM",mistagSF_CSVM_); |
406 |
– |
//Combined Secondary Vertex Tight |
407 |
– |
edm::ESHandle<BtagPerformance> mistagSF_CSVT_; |
408 |
– |
iSetup.get<BTagPerformanceRecord>().get("MISTAGCSVT",mistagSF_CSVT_); |
409 |
– |
|
410 |
– |
BTagSFContainer btagSFs; |
411 |
– |
btagSFs.BTAGSF_CSVL = (bTagSF_CSVL_.product()); |
412 |
– |
btagSFs.BTAGSF_CSVM = (bTagSF_CSVM_.product()); |
413 |
– |
btagSFs.BTAGSF_CSVT = (bTagSF_CSVT_.product()); |
414 |
– |
btagSFs.MISTAGSF_CSVL = (mistagSF_CSVL_.product()); |
415 |
– |
btagSFs.MISTAGSF_CSVM = (mistagSF_CSVM_.product()); |
416 |
– |
btagSFs.MISTAGSF_CSVT = (mistagSF_CSVT_.product()); |
417 |
– |
|
418 |
– |
#ifdef ENABLE_SIMPLEJETS1 |
419 |
– |
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets1.begin(); jet_iter!=simplejets1.end(); ++jet_iter){ |
420 |
– |
// if(jet_iter->pt()>50) |
421 |
– |
// njetscounter++; |
422 |
– |
VHbbEvent::SimpleJet sj; |
423 |
– |
// std::cout <<" sj1"<<std::endl; |
424 |
– |
fillSimpleJet(sj,jet_iter); |
425 |
– |
// if(!runOnMC_) |
426 |
– |
|
427 |
– |
setJecUnc(sj,jecUnc); |
428 |
– |
|
429 |
– |
Particle::LorentzVector p4Jet = jet_iter->p4(); |
430 |
– |
|
243 |
|
if(runOnMC_){ |
244 |
< |
|
245 |
< |
fillScaleFactors(sj, btagSFs); |
246 |
< |
|
247 |
< |
//PAT genJet matching |
248 |
< |
//genJet |
249 |
< |
const reco::GenJet *gJ = jet_iter->genJet(); |
250 |
< |
//physical parton for mother info ONLY |
251 |
< |
if( (jet_iter->genParton()) ){ |
252 |
< |
sj.bestMCid = jet_iter->genParton()->pdgId(); |
253 |
< |
if( (jet_iter->genParton()->mother()) ) |
254 |
< |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
255 |
< |
} |
256 |
< |
TLorentzVector gJp4; |
257 |
< |
if(gJ){ |
258 |
< |
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
259 |
< |
sj.bestMCp4 = gJp4; |
260 |
< |
if(verbose_){ |
261 |
< |
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
262 |
< |
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
263 |
< |
std::clog << "genJet matched deltaR = " <<gJp4.DeltaR(sj.p4) << std::endl; |
264 |
< |
std::clog << "genJet matched mother id = " << sj.bestMCmomid << std::endl; |
265 |
< |
} |
266 |
< |
} |
267 |
< |
|
268 |
< |
} //isMC |
269 |
< |
hbbInfo->simpleJets.push_back(sj); |
244 |
> |
|
245 |
> |
iEvent.getByLabel("genParticles", genParticles); |
246 |
> |
|
247 |
> |
for(size_t i = 0; i < genParticles->size(); ++ i) { |
248 |
> |
|
249 |
> |
const GenParticle & p = (*genParticles)[i]; |
250 |
> |
int id = p.pdgId(); |
251 |
> |
int st = p.status(); |
252 |
> |
|
253 |
> |
if(id==25){ |
254 |
> |
|
255 |
> |
VHbbEventAuxInfo::ParticleMCInfo htemp; |
256 |
> |
htemp.status=st; |
257 |
> |
htemp.charge=p.charge(); |
258 |
> |
if(p.mother(0)!=0) htemp.momid=p.mother(0)->pdgId(); |
259 |
> |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) htemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
260 |
> |
htemp.p4 = GENPTOLOR(p); |
261 |
> |
|
262 |
> |
int ndau = p.numberOfDaughters(); |
263 |
> |
for(int j = 0; j < ndau; ++ j) { |
264 |
> |
const Candidate * Hdau = p.daughter( j ); |
265 |
> |
htemp.dauid.push_back(Hdau->pdgId()); |
266 |
> |
htemp.dauFourMomentum.push_back(GENPTOLORP(Hdau)); |
267 |
> |
} |
268 |
> |
(auxInfo->mcH).push_back(htemp); |
269 |
> |
} |
270 |
> |
|
271 |
> |
|
272 |
> |
if(abs(id)==24){ |
273 |
> |
|
274 |
> |
VHbbEventAuxInfo::ParticleMCInfo wtemp; |
275 |
> |
wtemp.status=st; |
276 |
> |
wtemp.charge=p.charge(); |
277 |
> |
if(p.mother(0)!=0) wtemp.momid=p.mother(0)->pdgId(); |
278 |
> |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) wtemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
279 |
> |
wtemp.p4=GENPTOLOR(p); |
280 |
> |
|
281 |
> |
int ndau = p.numberOfDaughters(); |
282 |
> |
for(int j = 0; j < ndau; ++ j) { |
283 |
> |
const Candidate * Wdau = p.daughter( j ); |
284 |
> |
wtemp.dauid.push_back(Wdau->pdgId()); |
285 |
> |
wtemp.dauFourMomentum.push_back(GENPTOLORP(Wdau)); |
286 |
> |
} |
287 |
> |
auxInfo->mcW.push_back(wtemp); |
288 |
> |
} |
289 |
> |
|
290 |
> |
if(abs(id)==15) { |
291 |
> |
VHbbEventAuxInfo::ParticleMCInfo tautemp; |
292 |
> |
tautemp.status=st; |
293 |
> |
tautemp.charge=p.charge(); |
294 |
> |
if(p.mother(0)!=0) tautemp.momid=p.mother(0)->pdgId(); |
295 |
> |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) tautemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
296 |
> |
tautemp.p4=GENPTOLOR(p); |
297 |
> |
|
298 |
> |
int ndau = p.numberOfDaughters(); |
299 |
> |
for(int j = 0; j < ndau; ++ j) { |
300 |
> |
const Candidate * Taudau = p.daughter( j ); |
301 |
> |
tautemp.dauid.push_back(Taudau->pdgId()); |
302 |
> |
tautemp.dauFourMomentum.push_back(GENPTOLORP(Taudau)); |
303 |
> |
} |
304 |
> |
auxInfo->mcTau.push_back(tautemp); |
305 |
> |
} |
306 |
> |
|
307 |
> |
if(abs(id)==23){ |
308 |
> |
|
309 |
> |
|
310 |
> |
VHbbEventAuxInfo::ParticleMCInfo ztemp; |
311 |
> |
ztemp.status=st; |
312 |
> |
ztemp.charge=p.charge(); |
313 |
> |
if(p.mother(0)!=0) ztemp.momid=p.mother(0)->pdgId(); |
314 |
> |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) ztemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
315 |
> |
ztemp.p4=GENPTOLOR(p); |
316 |
> |
|
317 |
> |
int ndau = p.numberOfDaughters(); |
318 |
> |
for(int j = 0; j < ndau; ++ j) { |
319 |
> |
const Candidate * Zdau = p.daughter( j ); |
320 |
> |
ztemp.dauid.push_back(Zdau->pdgId()); |
321 |
> |
ztemp.dauFourMomentum.push_back(GENPTOLORP(Zdau)); |
322 |
> |
} |
323 |
> |
auxInfo->mcZ.push_back(ztemp); |
324 |
> |
} |
325 |
> |
// |
326 |
> |
// binfo |
327 |
> |
// |
328 |
> |
|
329 |
> |
|
330 |
> |
if(id==5){ |
331 |
> |
|
332 |
> |
VHbbEventAuxInfo::ParticleMCInfo btemp; |
333 |
> |
btemp.status=st; |
334 |
> |
btemp.charge=p.charge(); |
335 |
> |
if(p.mother(0)!=0) btemp.momid=p.mother(0)->pdgId(); |
336 |
> |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) btemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
337 |
> |
|
338 |
> |
btemp.p4=GENPTOLOR(p); |
339 |
> |
|
340 |
> |
int nHDaubdau = p.numberOfDaughters(); |
341 |
> |
for(int j = 0; j < nHDaubdau; ++ j) { |
342 |
> |
const Candidate * Bdau = p.daughter( j ); |
343 |
> |
btemp.dauid.push_back(Bdau->pdgId()); |
344 |
> |
} |
345 |
> |
auxInfo->mcB.push_back(btemp); |
346 |
> |
} |
347 |
> |
|
348 |
> |
if(id==-5){ |
349 |
> |
|
350 |
> |
VHbbEventAuxInfo::ParticleMCInfo bbtemp; |
351 |
> |
|
352 |
> |
bbtemp.status=st; |
353 |
> |
bbtemp.charge=p.charge(); |
354 |
> |
if(p.mother(0)!=0) bbtemp.momid=p.mother(0)->pdgId(); |
355 |
> |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) bbtemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
356 |
> |
|
357 |
> |
bbtemp.p4=GENPTOLOR(p); |
358 |
> |
|
359 |
> |
int nHDaubdau = p.numberOfDaughters(); |
360 |
> |
for(int j = 0; j < nHDaubdau; ++ j) { |
361 |
> |
const Candidate * Bdau = p.daughter( j ); |
362 |
> |
bbtemp.dauid.push_back(Bdau->pdgId()); |
363 |
> |
} |
364 |
> |
|
365 |
> |
|
366 |
> |
auxInfo->mcBbar.push_back(bbtemp); |
367 |
> |
} |
368 |
> |
|
369 |
> |
if(abs(id)==4){ |
370 |
> |
VHbbEventAuxInfo::ParticleMCInfo ctemp; |
371 |
> |
ctemp.status=st; |
372 |
> |
ctemp.charge=p.charge(); |
373 |
> |
if(p.mother(0)!=0) ctemp.momid=p.mother(0)->pdgId(); |
374 |
> |
if(p.mother(0)!=0 && p.mother(0)->mother(0)!=0) ctemp.gmomid=p.mother(0)->mother(0)->pdgId(); |
375 |
> |
|
376 |
> |
ctemp.p4=GENPTOLOR(p); |
377 |
> |
|
378 |
> |
int nHDaubdau = p.numberOfDaughters(); |
379 |
> |
for(int j = 0; j < nHDaubdau; ++ j) { |
380 |
> |
const Candidate * Bdau = p.daughter( j ); |
381 |
> |
ctemp.dauid.push_back(Bdau->pdgId()); |
382 |
> |
} |
383 |
> |
|
384 |
> |
auxInfo->mcC.push_back(ctemp); |
385 |
> |
|
386 |
> |
} |
387 |
> |
|
388 |
> |
} |
389 |
> |
|
390 |
> |
} // isMC |
391 |
> |
|
392 |
> |
/////// end generator block |
393 |
> |
|
394 |
> |
/// photon used in isolation |
395 |
> |
edm::Handle<edm::View<reco::PFCandidate> > photonIsoH; |
396 |
> |
iEvent.getByLabel("pfAllPhotons",photonIsoH); |
397 |
> |
edm::View<reco::PFCandidate> photonsForIso = *photonIsoH; |
398 |
> |
|
399 |
> |
edm::Handle<edm::View<pat::Muon> > muonHandle; |
400 |
> |
iEvent.getByLabel(muoLabel_,muonHandle); |
401 |
> |
edm::View<pat::Muon> muons = *muonHandle; |
402 |
> |
|
403 |
> |
// hard jet |
404 |
> |
edm::Handle<edm::View<pat::Jet> > jetHandle; |
405 |
> |
iEvent.getByLabel(jetLabel_,jetHandle); |
406 |
> |
edm::View<pat::Jet> jets = *jetHandle; |
407 |
> |
|
408 |
> |
// sub jet |
409 |
> |
edm::Handle<edm::View<pat::Jet> > subjetHandle; |
410 |
> |
iEvent.getByLabel(subjetLabel_,subjetHandle); |
411 |
> |
edm::View<pat::Jet> subjets = *subjetHandle; |
412 |
> |
|
413 |
> |
// filter jet |
414 |
> |
edm::Handle<edm::View<pat::Jet> > filterjetHandle; |
415 |
> |
iEvent.getByLabel(filterjetLabel_,filterjetHandle); |
416 |
> |
edm::View<pat::Jet> filterjets = *filterjetHandle; |
417 |
> |
|
418 |
> |
// standard jets |
419 |
> |
|
420 |
> |
|
421 |
> |
edm::Handle<edm::View<pat::Jet> > simplejet2Handle; |
422 |
> |
iEvent.getByLabel(simplejet2Label_,simplejet2Handle); |
423 |
> |
edm::View<pat::Jet> simplejets2 = *simplejet2Handle; |
424 |
> |
|
425 |
> |
edm::Handle<edm::View<pat::Jet> > simplejet3Handle; |
426 |
> |
iEvent.getByLabel(simplejet3Label_,simplejet3Handle); |
427 |
> |
edm::View<pat::Jet> simplejets3 = *simplejet3Handle; |
428 |
> |
|
429 |
> |
|
430 |
> |
|
431 |
> |
edm::Handle<edm::View<pat::Electron> > electronHandle; |
432 |
> |
iEvent.getByLabel(eleLabel_,electronHandle); |
433 |
> |
edm::View<pat::Electron> electrons = *electronHandle; |
434 |
> |
|
435 |
> |
|
436 |
> |
// edm::Handle<edm::View<pat::Photon> > phoHandle; |
437 |
> |
// iEvent.getByLabel(phoLabel_,phoHandle); |
438 |
> |
// edm::View<pat::Photon> photons = *phoHandle; |
439 |
> |
|
440 |
> |
edm::Handle<edm::View<pat::Tau> > tauHandle; |
441 |
> |
iEvent.getByLabel(tauLabel_,tauHandle); |
442 |
> |
edm::View<pat::Tau> taus = *tauHandle; |
443 |
> |
|
444 |
> |
//Get the computer for the CSV |
445 |
> |
ESHandle<JetTagComputer> handle; |
446 |
> |
iSetup.get<JetTagComputerRecord>().get("combinedSecondaryVertex", handle); |
447 |
> |
computer = dynamic_cast<const GenericMVAJetTagComputer*>(handle.product()); |
448 |
> |
|
449 |
> |
//BTAGGING SCALE FACTOR FROM DATABASE |
450 |
> |
//Combined Secondary Vertex Loose |
451 |
> |
edm::ESHandle<BtagPerformance> bTagSF_CSVL_; |
452 |
> |
iSetup.get<BTagPerformanceRecord>().get("BTAGCSVL",bTagSF_CSVL_); |
453 |
> |
//Combined Secondary Vertex Medium |
454 |
> |
edm::ESHandle<BtagPerformance> bTagSF_CSVM_; |
455 |
> |
iSetup.get<BTagPerformanceRecord>().get("BTAGCSVM",bTagSF_CSVM_); |
456 |
> |
//Combined Secondary Vertex Tight |
457 |
> |
edm::ESHandle<BtagPerformance> bTagSF_CSVT_; |
458 |
> |
iSetup.get<BTagPerformanceRecord>().get("BTAGCSVT",bTagSF_CSVT_); |
459 |
|
|
460 |
< |
} |
460 |
> |
edm::ESHandle<BtagPerformance> mistagSF_CSVL_; |
461 |
> |
iSetup.get<BTagPerformanceRecord>().get("MISTAGCSVL",mistagSF_CSVL_); |
462 |
> |
//Combined Secondary Vertex Medium |
463 |
> |
edm::ESHandle<BtagPerformance> mistagSF_CSVM_; |
464 |
> |
iSetup.get<BTagPerformanceRecord>().get("MISTAGCSVM",mistagSF_CSVM_); |
465 |
> |
//Combined Secondary Vertex Tight |
466 |
> |
edm::ESHandle<BtagPerformance> mistagSF_CSVT_; |
467 |
> |
iSetup.get<BTagPerformanceRecord>().get("MISTAGCSVT",mistagSF_CSVT_); |
468 |
> |
|
469 |
> |
BTagSFContainer btagSFs; |
470 |
> |
btagSFs.BTAGSF_CSVL = (bTagSF_CSVL_.product()); |
471 |
> |
btagSFs.BTAGSF_CSVM = (bTagSF_CSVM_.product()); |
472 |
> |
btagSFs.BTAGSF_CSVT = (bTagSF_CSVT_.product()); |
473 |
> |
btagSFs.MISTAGSF_CSVL = (mistagSF_CSVL_.product()); |
474 |
> |
btagSFs.MISTAGSF_CSVM = (mistagSF_CSVM_.product()); |
475 |
> |
btagSFs.MISTAGSF_CSVT = (mistagSF_CSVT_.product()); |
476 |
> |
|
477 |
> |
#ifdef ENABLE_SIMPLEJETS1 |
478 |
> |
edm::Handle<edm::View<pat::Jet> > simplejet1Handle; |
479 |
> |
iEvent.getByLabel(simplejet1Label_,simplejet1Handle); |
480 |
> |
edm::View<pat::Jet> simplejets1 = *simplejet1Handle; |
481 |
> |
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets1.begin(); jet_iter!=simplejets1.end(); ++jet_iter){ |
482 |
> |
// if(jet_iter->pt()>50) |
483 |
> |
// njetscounter++; |
484 |
> |
VHbbEvent::SimpleJet sj; |
485 |
> |
// std::cout <<" sj1"<<std::endl; |
486 |
> |
fillSimpleJet(sj,jet_iter); |
487 |
> |
// if(!runOnMC_) |
488 |
> |
|
489 |
> |
setJecUnc(sj,jecUnc); |
490 |
> |
|
491 |
> |
Particle::LorentzVector p4Jet = jet_iter->p4(); |
492 |
> |
|
493 |
> |
if(runOnMC_){ |
494 |
> |
|
495 |
> |
fillScaleFactors(sj, btagSFs); |
496 |
> |
|
497 |
> |
//PAT genJet matching |
498 |
> |
//genJet |
499 |
> |
const reco::GenJet *gJ = jet_iter->genJet(); |
500 |
> |
//physical parton for mother info ONLY |
501 |
> |
if( (jet_iter->genParton()) ){ |
502 |
> |
sj.bestMCid = jet_iter->genParton()->pdgId(); |
503 |
> |
if( (jet_iter->genParton()->mother()) ) |
504 |
> |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
505 |
> |
} |
506 |
> |
TLorentzVector gJp4; |
507 |
> |
if(gJ){ |
508 |
> |
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
509 |
> |
sj.bestMCp4 = gJp4; |
510 |
> |
if(verbose_){ |
511 |
> |
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
512 |
> |
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
513 |
> |
std::clog << "genJet matched deltaR = " <<gJp4.DeltaR(sj.p4) << std::endl; |
514 |
> |
std::clog << "genJet matched mother id = " << sj.bestMCmomid << std::endl; |
515 |
> |
} |
516 |
> |
} |
517 |
> |
|
518 |
> |
} //isMC |
519 |
> |
hbbInfo->simpleJets.push_back(sj); |
520 |
> |
|
521 |
> |
} |
522 |
|
#endif //ENABLE_SIMPLEJETS1 |
461 |
– |
|
462 |
– |
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets3.begin(); jet_iter!=simplejets3.end(); ++jet_iter){ |
463 |
– |
// if(jet_iter->pt()>50) |
464 |
– |
// njetscounter++; |
465 |
– |
VHbbEvent::SimpleJet sj; |
466 |
– |
// std::cout <<" sj3"<<std::endl; |
467 |
– |
fillSimpleJet(sj,jet_iter); |
468 |
– |
// if(!runOnMC_) |
469 |
– |
setJecUnc(sj,jecUnc); |
470 |
– |
|
471 |
– |
|
472 |
– |
Particle::LorentzVector p4Jet = jet_iter->p4(); |
473 |
– |
|
474 |
– |
if(runOnMC_){ |
475 |
– |
|
476 |
– |
fillScaleFactors(sj, btagSFs); |
477 |
– |
|
478 |
– |
//PAT genJet matching |
479 |
– |
//genJet |
480 |
– |
const reco::GenJet *gJ = jet_iter->genJet(); |
481 |
– |
//physical parton for mother info ONLY |
482 |
– |
if( (jet_iter->genParton()) ){ |
483 |
– |
sj.bestMCid = jet_iter->genParton()->pdgId(); |
484 |
– |
if( (jet_iter->genParton()->mother()) ) |
485 |
– |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
486 |
– |
} |
487 |
– |
TLorentzVector gJp4; |
488 |
– |
if(gJ){ |
489 |
– |
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
490 |
– |
sj.bestMCp4 = gJp4; |
491 |
– |
if(verbose_){ |
492 |
– |
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
493 |
– |
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
494 |
– |
std::clog << "genJet matched deltaR = " <<gJp4.DeltaR(sj.p4) << std::endl; |
495 |
– |
std::clog << "genJet matched mother id = " << sj.bestMCmomid << std::endl; |
496 |
– |
} |
497 |
– |
} |
498 |
– |
|
499 |
– |
} //isMC |
500 |
– |
hbbInfo->simpleJets3.push_back(sj); |
523 |
|
|
524 |
< |
} |
525 |
< |
|
526 |
< |
#ifdef ENABLE_SIMPLEJETS4 |
527 |
< |
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets4.begin(); jet_iter!=simplejets4.end(); ++jet_iter){ |
528 |
< |
// if(jet_iter->pt()>50) |
529 |
< |
// njetscounter++; |
530 |
< |
VHbbEvent::SimpleJet sj; |
531 |
< |
// std::cout <<" sj4"<<std::endl; |
532 |
< |
fillSimpleJet(sj,jet_iter); |
533 |
< |
// if(!runOnMC_) |
534 |
< |
setJecUnc(sj,jecUnc); |
535 |
< |
|
536 |
< |
|
537 |
< |
Particle::LorentzVector p4Jet = jet_iter->p4(); |
538 |
< |
|
539 |
< |
if(runOnMC_){ |
540 |
< |
|
541 |
< |
fillScaleFactors(sj, btagSFs); |
542 |
< |
|
543 |
< |
//PAT genJet matching |
544 |
< |
//genJet |
545 |
< |
const reco::GenJet *gJ = jet_iter->genJet(); |
546 |
< |
//physical parton for mother info ONLY |
547 |
< |
if( (jet_iter->genParton()) ){ |
548 |
< |
sj.bestMCid = jet_iter->genParton()->pdgId(); |
549 |
< |
if( (jet_iter->genParton()->mother()) ) |
550 |
< |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
551 |
< |
} |
552 |
< |
TLorentzVector gJp4; |
553 |
< |
if(gJ){ |
554 |
< |
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
555 |
< |
sj.bestMCp4 = gJp4; |
556 |
< |
if(verbose_){ |
557 |
< |
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
558 |
< |
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
559 |
< |
std::clog << "genJet matched deltaR = " <<gJp4.DeltaR(sj.p4) << std::endl; |
560 |
< |
std::clog << "genJet matched mother id = " << sj.bestMCmomid << std::endl; |
561 |
< |
} |
562 |
< |
} |
563 |
< |
|
564 |
< |
} //isMC |
565 |
< |
hbbInfo->simpleJets4.push_back(sj); |
524 |
> |
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets3.begin(); jet_iter!=simplejets3.end(); ++jet_iter){ |
525 |
> |
// if(jet_iter->pt()>50) |
526 |
> |
// njetscounter++; |
527 |
> |
VHbbEvent::SimpleJet sj; |
528 |
> |
// std::cout <<" sj3"<<std::endl; |
529 |
> |
fillSimpleJet(sj,jet_iter); |
530 |
> |
// if(!runOnMC_) |
531 |
> |
setJecUnc(sj,jecUnc); |
532 |
> |
|
533 |
> |
Particle::LorentzVector p4Jet = jet_iter->p4(); |
534 |
> |
|
535 |
> |
if(runOnMC_){ |
536 |
> |
|
537 |
> |
fillScaleFactors(sj, btagSFs); |
538 |
> |
|
539 |
> |
//PAT genJet matching |
540 |
> |
//genJet |
541 |
> |
const reco::GenJet *gJ = jet_iter->genJet(); |
542 |
> |
//physical parton for mother info ONLY |
543 |
> |
if( (jet_iter->genParton()) ){ |
544 |
> |
sj.bestMCid = jet_iter->genParton()->pdgId(); |
545 |
> |
if( (jet_iter->genParton()->mother()) ) |
546 |
> |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
547 |
> |
} |
548 |
> |
TLorentzVector gJp4; |
549 |
> |
if(gJ){ |
550 |
> |
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
551 |
> |
sj.bestMCp4 = gJp4; |
552 |
> |
if(verbose_){ |
553 |
> |
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
554 |
> |
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
555 |
> |
std::clog << "genJet matched deltaR = " <<gJp4.DeltaR(sj.p4) << std::endl; |
556 |
> |
std::clog << "genJet matched mother id = " << sj.bestMCmomid << std::endl; |
557 |
> |
} |
558 |
> |
} |
559 |
> |
|
560 |
> |
} //isMC |
561 |
> |
// |
562 |
> |
|
563 |
> |
|
564 |
> |
hbbInfo->simpleJets3.push_back(sj); |
565 |
> |
|
566 |
> |
} |
567 |
|
|
568 |
< |
} |
568 |
> |
#ifdef ENABLE_SIMPLEJETS4 |
569 |
> |
edm::Handle<edm::View<pat::Jet> > simplejet4Handle; |
570 |
> |
iEvent.getByLabel(simplejet4Label_,simplejet4Handle); |
571 |
> |
edm::View<pat::Jet> simplejets4 = *simplejet4Handle; |
572 |
> |
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets4.begin(); jet_iter!=simplejets4.end(); ++jet_iter){ |
573 |
> |
// if(jet_iter->pt()>50) |
574 |
> |
// njetscounter++; |
575 |
> |
|
576 |
> |
VHbbEvent::SimpleJet sj; |
577 |
> |
// std::cout <<" sj4"<<std::endl; |
578 |
> |
fillSimpleJet(sj,jet_iter); |
579 |
> |
// if(!runOnMC_) |
580 |
> |
setJecUnc(sj,jecUnc); |
581 |
> |
|
582 |
> |
|
583 |
> |
|
584 |
> |
Particle::LorentzVector p4Jet = jet_iter->p4(); |
585 |
> |
|
586 |
> |
if(runOnMC_){ |
587 |
> |
|
588 |
> |
fillScaleFactors(sj, btagSFs); |
589 |
> |
|
590 |
> |
//PAT genJet matching |
591 |
> |
//genJet |
592 |
> |
const reco::GenJet *gJ = jet_iter->genJet(); |
593 |
> |
//physical parton for mother info ONLY |
594 |
> |
if( (jet_iter->genParton()) ){ |
595 |
> |
sj.bestMCid = jet_iter->genParton()->pdgId(); |
596 |
> |
if( (jet_iter->genParton()->mother()) ) |
597 |
> |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
598 |
> |
} |
599 |
> |
TLorentzVector gJp4; |
600 |
> |
if(gJ){ |
601 |
> |
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
602 |
> |
sj.bestMCp4 = gJp4; |
603 |
> |
if(verbose_){ |
604 |
> |
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
605 |
> |
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
606 |
> |
std::clog << "genJet matched deltaR = " <<gJp4.DeltaR(sj.p4) << std::endl; |
607 |
> |
std::clog << "genJet matched mother id = " << sj.bestMCmomid << std::endl; |
608 |
> |
} |
609 |
> |
} |
610 |
> |
|
611 |
> |
} //isMC |
612 |
> |
hbbInfo->simpleJets4.push_back(sj); |
613 |
> |
|
614 |
> |
} |
615 |
|
#endif //ENABLE SIMPLEJETS4 |
547 |
– |
|
548 |
– |
|
549 |
– |
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets2.begin(); jet_iter!=simplejets2.end(); ++jet_iter){ |
616 |
|
|
551 |
– |
VHbbEvent::SimpleJet sj; |
552 |
– |
// std::cout <<" sj2"<<std::endl; |
553 |
– |
fillSimpleJet(sj,jet_iter); |
554 |
– |
// if(!runOnMC_) |
555 |
– |
setJecUnc(sj,jecUnc); |
556 |
– |
/* sj.flavour = jet_iter->partonFlavour(); |
617 |
|
|
618 |
+ |
for(edm::View<pat::Jet>::const_iterator jet_iter = simplejets2.begin(); jet_iter!=simplejets2.end(); ++jet_iter){ |
619 |
+ |
|
620 |
+ |
|
621 |
+ |
|
622 |
+ |
VHbbEvent::SimpleJet sj; |
623 |
+ |
// std::cout <<" sj2"<<std::endl; |
624 |
+ |
fillSimpleJet(sj,jet_iter); |
625 |
+ |
|
626 |
+ |
///########### PU JET ID ################# |
627 |
+ |
// add puId... |
628 |
+ |
edm::Handle<edm::ValueMap<float> > puJetIdMVA; |
629 |
+ |
iEvent.getByLabel("puJetMva","fullDiscriminant", puJetIdMVA); |
630 |
+ |
|
631 |
+ |
edm::Handle<edm::ValueMap<int> > puJetIdFlag; |
632 |
+ |
iEvent.getByLabel("puJetMva", "fullId", puJetIdFlag); |
633 |
+ |
|
634 |
+ |
// cout << " pt " << jet_iter->pt() << " eta " << jet_iter->eta() << std::endl; |
635 |
+ |
unsigned int idx = jet_iter - simplejets2.begin(); |
636 |
+ |
|
637 |
+ |
|
638 |
+ |
|
639 |
+ |
sj.puJetIdMva = (*puJetIdMVA)[simplejets2.refAt(idx)]; |
640 |
+ |
int idflag = (*puJetIdFlag)[simplejets2.refAt(idx)]; |
641 |
+ |
|
642 |
+ |
|
643 |
+ |
// cout << " PU JetID MVA " << mva; |
644 |
+ |
if( PileupJetIdentifier::passJetId( idflag, PileupJetIdentifier::kLoose )) { |
645 |
+ |
//cout << " pass loose wp"; |
646 |
+ |
sj.puJetIdL =1; |
647 |
+ |
} |
648 |
+ |
if( PileupJetIdentifier::passJetId( idflag, PileupJetIdentifier::kMedium )) { |
649 |
+ |
// cout << " pass medium wp"; |
650 |
+ |
sj.puJetIdM =1; |
651 |
+ |
} |
652 |
+ |
if( PileupJetIdentifier::passJetId( idflag, PileupJetIdentifier::kTight )) { |
653 |
+ |
// cout << " pass tight wp"; |
654 |
+ |
sj.puJetIdT =1; |
655 |
+ |
} |
656 |
+ |
// cout << endl; |
657 |
+ |
// ############# END OF PU JET ID ###################### |
658 |
+ |
|
659 |
+ |
|
660 |
+ |
// if(!runOnMC_) |
661 |
+ |
setJecUnc(sj,jecUnc); |
662 |
+ |
/* sj.flavour = jet_iter->partonFlavour(); |
663 |
+ |
|
664 |
+ |
|
665 |
+ |
sj.tche=jet_iter->bDiscriminator("trackCountingHighEffBJetTags"); |
666 |
+ |
sj.tchp=jet_iter->bDiscriminator("trackCountingHighPurBJetTags"); |
667 |
+ |
sj.jp=jet_iter->bDiscriminator("jetProbabilityBJetTags"); |
668 |
+ |
sj.jpb=jet_iter->bDiscriminator("jetBProbabilityBJetTags"); |
669 |
+ |
sj.ssvhe=jet_iter->bDiscriminator("simpleSecondaryVertexHighEffBJetTags"); |
670 |
+ |
sj.csv=jet_iter->bDiscriminator("combinedSecondaryVertexBJetTags"); |
671 |
+ |
sj.csvmva=jet_iter->bDiscriminator("combinedSecondaryVertexMVABJetTags"); |
672 |
+ |
sj.charge=jet_iter->jetCharge(); |
673 |
+ |
sj.ntracks=jet_iter->associatedTracks().size(); |
674 |
+ |
sj.p4=GENPTOLORP(jet_iter); |
675 |
+ |
sj.chargedTracksFourMomentum=(getChargedTracksMomentum(&*(jet_iter))); |
676 |
+ |
sj.SF_CSVL=1; |
677 |
+ |
sj.SF_CSVM=1; |
678 |
+ |
sj.SF_CSVT=1; |
679 |
+ |
sj.SF_CSVLerr=0; |
680 |
+ |
sj.SF_CSVMerr=0; |
681 |
+ |
sj.SF_CSVTerr=0; |
682 |
+ |
|
683 |
+ |
|
684 |
+ |
// |
685 |
+ |
// addtaginfo for csv |
686 |
+ |
// |
687 |
+ |
|
688 |
+ |
if (jet_iter->hasTagInfo("SimpleSecondaryVertex")) { |
689 |
+ |
|
690 |
+ |
const reco::SecondaryVertexTagInfo * tf = jet_iter->tagInfoSecondaryVertex(); |
691 |
+ |
sj.vtxMass = tf->secondaryVertex(0).p4().mass(); |
692 |
+ |
sj.vtxNTracks = tf->secondaryVertex(0).nTracks(); |
693 |
+ |
Measurement1D m = tf->flightDistance(0); |
694 |
+ |
sj.vtx3dL = m.value(); |
695 |
+ |
sj.vtx3deL = m.error(); |
696 |
+ |
} |
697 |
+ |
|
698 |
+ |
|
699 |
+ |
// |
700 |
+ |
// add tVector |
701 |
+ |
// |
702 |
+ |
sj.tVector = getTvect(&(*jet_iter)); |
703 |
+ |
*/ |
704 |
+ |
Particle::LorentzVector p4Jet = jet_iter->p4(); |
705 |
+ |
|
706 |
+ |
if(runOnMC_){ |
707 |
+ |
|
708 |
+ |
//BTV scale factors |
709 |
+ |
fillScaleFactors(sj, btagSFs); |
710 |
+ |
|
711 |
+ |
//PAT genJet matching |
712 |
+ |
//genJet |
713 |
+ |
const reco::GenJet *gJ = jet_iter->genJet(); |
714 |
+ |
//physical parton for mother info ONLY |
715 |
+ |
if( (jet_iter->genParton()) ){ |
716 |
+ |
sj.bestMCid = jet_iter->genParton()->pdgId(); |
717 |
+ |
if( (jet_iter->genParton()->mother()) ) |
718 |
+ |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
719 |
+ |
} |
720 |
+ |
TLorentzVector gJp4; |
721 |
+ |
if(gJ){ |
722 |
+ |
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
723 |
+ |
sj.bestMCp4 = gJp4; |
724 |
+ |
if(verbose_){ |
725 |
+ |
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
726 |
+ |
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
727 |
+ |
std::clog << "genJet matched deltaR = " << gJp4.DeltaR(sj.p4) << std::endl; |
728 |
+ |
std::clog << "genJet matched mother id = " << sj.bestMCmomid << std::endl; |
729 |
+ |
} |
730 |
+ |
} |
731 |
+ |
|
732 |
+ |
// add flag if a mc lepton is find inside a cone around the jets... |
733 |
+ |
iEvent.getByLabel("genParticles", genParticles); |
734 |
+ |
|
735 |
+ |
for(size_t i = 0; i < genParticles->size(); ++ i) { |
736 |
+ |
|
737 |
+ |
const GenParticle & p = (*genParticles)[i]; |
738 |
+ |
int id = 0; |
739 |
+ |
p.pt()> lep_ptCutForBjets_ ? id= p.pdgId(): 0; |
740 |
+ |
|
741 |
+ |
// std::cout<< "found a muon with pt " << mu->pt() << std::endl; |
742 |
+ |
if ((abs(id)==13 || abs(id)==11) && deltaR(p.eta(), p.phi(), sj.p4.Eta(), sj.p4.Phi() ) <0.5) sj.isSemiLeptMCtruth=1; |
743 |
+ |
} |
744 |
+ |
|
745 |
+ |
} //isMC |
746 |
+ |
|
747 |
+ |
// add flag if a reco lepton is find inside a cone around the jets... |
748 |
+ |
edm::Handle<edm::View<reco::Candidate> > muonNoCutsHandle; |
749 |
+ |
iEvent.getByLabel(muonoCutsLabel_,muonNoCutsHandle); |
750 |
+ |
edm::View<reco::Candidate> muonsNoCuts = *muonNoCutsHandle; |
751 |
+ |
|
752 |
+ |
|
753 |
+ |
|
754 |
+ |
for(edm::View<reco::Candidate>::const_iterator mu = muonsNoCuts.begin(); mu!=muonsNoCuts.end() && sj.isSemiLept!=1; ++mu){ |
755 |
+ |
// std::cout<< "found a muon with pt " << mu->pt() << std::endl; |
756 |
+ |
const pat::Muon& m = static_cast <const pat::Muon&> (*mu); |
757 |
+ |
float Smpt = m.pt(); |
758 |
+ |
float Smeta = m.eta(); |
759 |
+ |
float Smphi = m.phi(); |
760 |
+ |
|
761 |
+ |
float SmJdR = deltaR(Smeta, Smphi, sj.p4.Eta(), sj.p4.Phi()); |
762 |
+ |
|
763 |
+ |
if ( Smpt> lep_ptCutForBjets_ && SmJdR <0.5) { |
764 |
+ |
sj.isSemiLept=1; |
765 |
+ |
//isSemiLept(-99), isSemiLeptMCtruth(-99), SoftLeptPt(-99), SoftLeptdR(-99), SoftLeptptRel(-99), SoftLeptpdgId(-99), SoftLeptIdlooseMu(-99), SoftLeptId95(-99), SoftLeptRelCombIso(-99), |
766 |
+ |
sj.SoftLeptpdgId =13; |
767 |
+ |
sj.SoftLeptdR= SmJdR; |
768 |
+ |
sj.SoftLeptPt=Smpt; |
769 |
+ |
TVector3 mvec ( m.p4().Vect().X(), m.p4().Vect().Y(), m.p4().Vect().Z() ); |
770 |
+ |
sj.SoftLeptptRel= sj.p4.Perp( mvec ); |
771 |
+ |
sj.SoftLeptRelCombIso = (m.trackIso() + m.ecalIso() + m.hcalIso() ) / Smpt ; |
772 |
+ |
sj.SoftLeptIdlooseMu=m.muonID("TMLastStationLoose"); |
773 |
+ |
} |
774 |
+ |
} |
775 |
+ |
|
776 |
+ |
|
777 |
+ |
edm::Handle<edm::View<reco::Candidate> > eleNoCutsHandle; |
778 |
+ |
iEvent.getByLabel(elenoCutsLabel_,eleNoCutsHandle); |
779 |
+ |
edm::View<reco::Candidate> elesNoCuts = *eleNoCutsHandle; |
780 |
+ |
|
781 |
+ |
|
782 |
+ |
|
783 |
+ |
for(edm::View<reco::Candidate>::const_iterator ele = elesNoCuts.begin(); ele!=elesNoCuts.end() && sj.isSemiLept!=1; ++ele){ |
784 |
+ |
|
785 |
+ |
const pat::Electron& e = static_cast <const pat::Electron&> (*ele); |
786 |
+ |
float Smpt = e.pt(); |
787 |
+ |
float Smeta = e.eta(); |
788 |
+ |
float Smphi = e.phi(); |
789 |
+ |
|
790 |
+ |
float SmJdR = deltaR(Smeta, Smphi, sj.p4.Eta(), sj.p4.Phi()); |
791 |
+ |
if ( Smpt> lep_ptCutForBjets_ && SmJdR <0.5) { |
792 |
+ |
sj.isSemiLept=1; |
793 |
+ |
sj.SoftLeptpdgId =11; |
794 |
+ |
sj.SoftLeptdR= SmJdR; |
795 |
+ |
sj.SoftLeptPt=Smpt; |
796 |
+ |
TVector3 mvec ( e.p4().Vect().X(), e.p4().Vect().Y(), e.p4().Vect().Z() ); |
797 |
+ |
sj.SoftLeptptRel= sj.p4.Perp( mvec ); |
798 |
+ |
sj.SoftLeptRelCombIso = (e.trackIso() + e.ecalIso() + e.hcalIso() ) / Smpt ; |
799 |
+ |
// sj.SoftLeptId95=e.electronID("eidVBTFCom95"); |
800 |
+ |
//std::cout << "before ele id " << std::endl; |
801 |
+ |
// std::cout << " e.e.sigmaIetaIeta " << e.sigmaIetaIeta() << std::endl; |
802 |
+ |
//std::cout << " e.isEB() " << e.isEB() << std::endl; |
803 |
+ |
if ( |
804 |
+ |
( fabs(Smeta)<2.5 && !( abs(Smeta)>1.4442 && abs(Smeta)<1.566)) && |
805 |
+ |
|
806 |
+ |
(( abs(Smeta)>1.566 && (e.sigmaIetaIeta()<0.01) && ( e.deltaPhiSuperClusterTrackAtVtx()<0.8 && e.deltaPhiSuperClusterTrackAtVtx()>-0.8) && ( e.deltaEtaSuperClusterTrackAtVtx()<0.007 && e.deltaEtaSuperClusterTrackAtVtx()>-0.007 ) ) |
807 |
+ |
|| ( abs(Smeta)<1.4442 && (e.sigmaIetaIeta()<0.03) && ( e.deltaPhiSuperClusterTrackAtVtx()<0.7 && e.deltaPhiSuperClusterTrackAtVtx()>-0.7 ) && ( e.deltaEtaSuperClusterTrackAtVtx()<0.01 && e.deltaEtaSuperClusterTrackAtVtx()>-0.01 ) )) |
808 |
+ |
) |
809 |
+ |
sj.SoftLeptId95=1; |
810 |
+ |
} |
811 |
+ |
} |
812 |
+ |
|
813 |
+ |
|
814 |
+ |
|
815 |
+ |
|
816 |
+ |
|
817 |
+ |
hbbInfo->simpleJets2.push_back(sj); |
818 |
+ |
|
819 |
+ |
} |
820 |
|
|
821 |
< |
sj.tche=jet_iter->bDiscriminator("trackCountingHighEffBJetTags"); |
822 |
< |
sj.tchp=jet_iter->bDiscriminator("trackCountingHighPurBJetTags"); |
823 |
< |
sj.jp=jet_iter->bDiscriminator("jetProbabilityBJetTags"); |
824 |
< |
sj.jpb=jet_iter->bDiscriminator("jetBProbabilityBJetTags"); |
825 |
< |
sj.ssvhe=jet_iter->bDiscriminator("simpleSecondaryVertexHighEffBJetTags"); |
826 |
< |
sj.csv=jet_iter->bDiscriminator("combinedSecondaryVertexBJetTags"); |
827 |
< |
sj.csvmva=jet_iter->bDiscriminator("combinedSecondaryVertexMVABJetTags"); |
828 |
< |
sj.charge=jet_iter->jetCharge(); |
829 |
< |
sj.ntracks=jet_iter->associatedTracks().size(); |
830 |
< |
sj.p4=GENPTOLORP(jet_iter); |
831 |
< |
sj.chargedTracksFourMomentum=(getChargedTracksMomentum(&*(jet_iter))); |
832 |
< |
sj.SF_CSVL=1; |
833 |
< |
sj.SF_CSVM=1; |
834 |
< |
sj.SF_CSVT=1; |
835 |
< |
sj.SF_CSVLerr=0; |
836 |
< |
sj.SF_CSVMerr=0; |
837 |
< |
sj.SF_CSVTerr=0; |
838 |
< |
|
839 |
< |
// |
840 |
< |
// addtaginfo for csv |
841 |
< |
// |
842 |
< |
|
843 |
< |
if (jet_iter->hasTagInfo("SimpleSecondaryVertex")) { |
844 |
< |
|
845 |
< |
const reco::SecondaryVertexTagInfo * tf = jet_iter->tagInfoSecondaryVertex(); |
846 |
< |
sj.vtxMass = tf->secondaryVertex(0).p4().mass(); |
847 |
< |
sj.vtxNTracks = tf->secondaryVertex(0).nTracks(); |
848 |
< |
Measurement1D m = tf->flightDistance(0); |
849 |
< |
sj.vtx3dL = m.value(); |
850 |
< |
sj.vtx3deL = m.error(); |
821 |
> |
|
822 |
> |
/* const GenJet* jet1Mc = bjet1.genJet(); |
823 |
> |
const GenJet* jet2Mc = bjet2.genJet(); |
824 |
> |
if(jet1Mc!=0){ |
825 |
> |
MCbJet1MomId=jet1Mc->mother()->pdgId(); |
826 |
> |
MCbJet1GMomId=jet1Mc->mother()->mother()->pdgId(); |
827 |
> |
} |
828 |
> |
|
829 |
> |
if(jet2Mc!=0){ |
830 |
> |
MCbJet2MomId=jet2Mc->mother()->pdgId(); |
831 |
> |
MCbJet2GMomId=jet2Mc->mother()->mother()->pdgId(); |
832 |
> |
} |
833 |
> |
*/ |
834 |
> |
|
835 |
> |
////////////////////////////////////////////////////////////// |
836 |
> |
////////////////////////////////////////////////////////////// |
837 |
> |
////// Nhan's Jets |
838 |
> |
|
839 |
> |
// C A 1 2 R A W J E T |
840 |
> |
edm::Handle<edm::View<pat::Jet> > ca12jetHandle; |
841 |
> |
iEvent.getByLabel("selectedPatJetsCA12PF",ca12jetHandle); |
842 |
> |
edm::View<pat::Jet> ca12jets = *ca12jetHandle; |
843 |
> |
edm::Handle<edm::View<pat::Jet> > camdft12jetHandle; |
844 |
> |
iEvent.getByLabel("selectedPatJetsCA12MassDropFilteredPF",camdft12jetHandle); |
845 |
> |
edm::View<pat::Jet> camdft12jets = *camdft12jetHandle; |
846 |
> |
|
847 |
> |
edm::Handle<edm::View<pat::Jet> > camdft12subjetHandle; |
848 |
> |
iEvent.getByLabel("selectedPatJetsCA12MassDropFilteredSubjetsPF",camdft12subjetHandle); |
849 |
> |
edm::View<pat::Jet> camdft12subjets = *camdft12subjetHandle; |
850 |
> |
edm::Handle<edm::View<pat::Jet> > caft12subjetHandle; |
851 |
> |
iEvent.getByLabel("selectedPatJetsCA12FilteredSubjetsPF",caft12subjetHandle); |
852 |
> |
edm::View<pat::Jet> caft12subjets = *caft12subjetHandle; |
853 |
> |
edm::Handle<edm::View<pat::Jet> > capr12subjetHandle; |
854 |
> |
iEvent.getByLabel("selectedPatJetsCA12PrunedSubjetsPF",capr12subjetHandle); |
855 |
> |
edm::View<pat::Jet> capr12subjets = *capr12subjetHandle; |
856 |
> |
|
857 |
> |
int ctr = 0; |
858 |
> |
// C A 1 2 R A W J E T S |
859 |
> |
// std::cout << "Fill CA12 Raw jet!" << std::endl; |
860 |
> |
for(edm::View<pat::Jet>::const_iterator jet_iter = ca12jets.begin(); jet_iter!=ca12jets.end(); ++jet_iter){ |
861 |
> |
// std::cout << "jet # " << ctr << std::endl; |
862 |
> |
// std::cout << "size: " << jet_iter->getPFConstituents().size() << std::endl; |
863 |
> |
|
864 |
> |
std::vector<reco::PFCandidatePtr> constituents = jet_iter->getPFConstituents(); |
865 |
> |
VHbbEvent::RawJet rj; |
866 |
> |
rj.p4 = GENPTOLORP(jet_iter); |
867 |
> |
rj.Nconstituents = jet_iter->getPFConstituents().size(); |
868 |
> |
|
869 |
> |
for (unsigned int iJC = 0; iJC<constituents.size(); ++iJC ){ |
870 |
> |
|
871 |
> |
rj.constituents_px.push_back( jet_iter->getPFConstituents().at(iJC)->px() ); |
872 |
> |
rj.constituents_py.push_back( jet_iter->getPFConstituents().at(iJC)->py() ); |
873 |
> |
rj.constituents_pz.push_back( jet_iter->getPFConstituents().at(iJC)->pz() ); |
874 |
> |
rj.constituents_e.push_back( jet_iter->getPFConstituents().at(iJC)->energy() ); |
875 |
> |
rj.constituents_pdgId.push_back( jet_iter->getPFConstituents().at(iJC)->pdgId() ); |
876 |
> |
} |
877 |
> |
|
878 |
> |
hbbInfo->CA12wConstits.push_back( rj ); |
879 |
> |
ctr++; |
880 |
> |
|
881 |
|
} |
882 |
+ |
// C A 1 2 M A S S D R O P / F I L T E R E D J E T S |
883 |
+ |
// std::cout << "Fill CA12 MDFT jet!" << std::endl; |
884 |
+ |
|
885 |
+ |
for(edm::View<pat::Jet>::const_iterator jet_iter = camdft12jets.begin(); jet_iter!=camdft12jets.end(); ++jet_iter){ |
886 |
+ |
|
887 |
+ |
if(printJet) {std::cout << "Jet Pt: " << jet_iter->pt() << " E,M: " << jet_iter->p4().E() << " " << jet_iter->p4().M() << "\n";} |
888 |
+ |
|
889 |
+ |
reco::Jet::Constituents constituents = jet_iter->getJetConstituents(); |
890 |
+ |
// std::cout << "NsubJets: " << constituents.size() << "\n"; |
891 |
+ |
|
892 |
+ |
// if(printJet) {std::cout << "NsubJets: " << constituents.size() << "\n";} |
893 |
+ |
VHbbEvent::HardJet hj; |
894 |
+ |
hj.constituents=constituents.size(); |
895 |
+ |
hj.p4 =GENPTOLORP(jet_iter); |
896 |
+ |
|
897 |
+ |
for (unsigned int iJC(0); iJC<constituents.size(); ++iJC ){ |
898 |
+ |
Jet::Constituent icandJet = constituents[iJC]; |
899 |
+ |
|
900 |
+ |
if(printJet) {std::cout << "subJet Pt: " << icandJet->pt() << " subJet E,M,eta,phi: " << icandJet->p4().E() << "," |
901 |
+ |
<< icandJet->p4().M() << "," << icandJet->eta() << "," << icandJet->phi() << "\n"; } |
902 |
+ |
|
903 |
+ |
|
904 |
+ |
hj.subFourMomentum.push_back(GENPTOLORP(icandJet)); |
905 |
+ |
hj.etaSub.push_back(icandJet->eta()); |
906 |
+ |
hj.phiSub.push_back(icandJet->phi()); |
907 |
+ |
|
908 |
+ |
// std::cout << "subjet constituents: " << icandJet->getJetConstituents.size() << std::endl; |
909 |
+ |
|
910 |
+ |
} |
911 |
+ |
hbbInfo->CAmdft12.push_back(hj); |
912 |
+ |
} |
913 |
+ |
|
914 |
+ |
// C A 1 2 M A S S D R O P / F I L T E R E D S U B J E T S |
915 |
+ |
// std::cout << "Fill CA12 MDFT subjet!" << std::endl; |
916 |
+ |
for(edm::View<pat::Jet>::const_iterator subjet_iter = camdft12subjets.begin(); subjet_iter!=camdft12subjets.end(); ++subjet_iter){ |
917 |
+ |
VHbbEvent::SimpleJet sj; |
918 |
+ |
fillSimpleJet(sj,subjet_iter); |
919 |
+ |
// setJecUnc(sj,jecUnc); |
920 |
+ |
hbbInfo->CAmdft12_subjets.push_back(sj); |
921 |
+ |
} |
922 |
+ |
// C A 1 2 F I L T E R E D S U B J E T S |
923 |
+ |
// std::cout << "Fill CA12 FT subjet!" << std::endl; |
924 |
+ |
for(edm::View<pat::Jet>::const_iterator subjet_iter = caft12subjets.begin(); subjet_iter!=caft12subjets.end(); ++subjet_iter){ |
925 |
+ |
VHbbEvent::SimpleJet sj; |
926 |
+ |
fillSimpleJet(sj,subjet_iter); |
927 |
+ |
// setJecUnc(sj,jecUnc); |
928 |
+ |
hbbInfo->CAft12_subjets.push_back(sj); |
929 |
+ |
} |
930 |
+ |
// C A 1 2 P R U N E D S U B J E T S |
931 |
+ |
// std::cout << "Fill CA12 PR subjet!" << std::endl; |
932 |
+ |
for(edm::View<pat::Jet>::const_iterator subjet_iter = capr12subjets.begin(); subjet_iter!=capr12subjets.end(); ++subjet_iter){ |
933 |
+ |
VHbbEvent::SimpleJet sj; |
934 |
+ |
fillSimpleJet(sj,subjet_iter); |
935 |
+ |
// setJecUnc(sj,jecUnc); |
936 |
+ |
hbbInfo->CApr12_subjets.push_back(sj); |
937 |
+ |
} |
938 |
+ |
|
939 |
|
|
940 |
< |
|
941 |
< |
// |
593 |
< |
// add tVector |
594 |
< |
// |
595 |
< |
sj.tVector = getTvect(&(*jet_iter)); |
596 |
< |
*/ |
597 |
< |
Particle::LorentzVector p4Jet = jet_iter->p4(); |
598 |
< |
|
940 |
> |
// C A 1 2 R A W J E T G E N |
941 |
> |
// fill the GEN jet information too! |
942 |
|
if(runOnMC_){ |
943 |
< |
|
944 |
< |
//BTV scale factors |
945 |
< |
fillScaleFactors(sj, btagSFs); |
946 |
< |
|
947 |
< |
//PAT genJet matching |
948 |
< |
//genJet |
949 |
< |
const reco::GenJet *gJ = jet_iter->genJet(); |
950 |
< |
//physical parton for mother info ONLY |
951 |
< |
if( (jet_iter->genParton()) ){ |
952 |
< |
sj.bestMCid = jet_iter->genParton()->pdgId(); |
953 |
< |
if( (jet_iter->genParton()->mother()) ) |
954 |
< |
sj.bestMCmomid=jet_iter->genParton()->mother()->pdgId(); |
955 |
< |
} |
956 |
< |
TLorentzVector gJp4; |
957 |
< |
if(gJ){ |
958 |
< |
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
959 |
< |
sj.bestMCp4 = gJp4; |
960 |
< |
if(verbose_){ |
961 |
< |
std::clog << "genJet matched Pt = " << gJp4.Pt() << std::endl; |
962 |
< |
std::clog << "genJet matched eta = " << gJp4.Eta() << std::endl; |
963 |
< |
std::clog << "genJet matched deltaR = " << gJp4.DeltaR(sj.p4) << std::endl; |
964 |
< |
std::clog << "genJet matched mother id = " << sj.bestMCmomid << std::endl; |
965 |
< |
} |
966 |
< |
} |
967 |
< |
|
968 |
< |
} //isMC |
969 |
< |
|
970 |
< |
hbbInfo->simpleJets2.push_back(sj); |
971 |
< |
|
972 |
< |
} |
973 |
< |
|
974 |
< |
|
975 |
< |
/* const GenJet* jet1Mc = bjet1.genJet(); |
976 |
< |
const GenJet* jet2Mc = bjet2.genJet(); |
977 |
< |
if(jet1Mc!=0){ |
978 |
< |
MCbJet1MomId=jet1Mc->mother()->pdgId(); |
979 |
< |
MCbJet1GMomId=jet1Mc->mother()->mother()->pdgId(); |
980 |
< |
} |
981 |
< |
|
982 |
< |
if(jet2Mc!=0){ |
983 |
< |
MCbJet2MomId=jet2Mc->mother()->pdgId(); |
984 |
< |
MCbJet2GMomId=jet2Mc->mother()->mother()->pdgId(); |
985 |
< |
} |
986 |
< |
*/ |
987 |
< |
|
988 |
< |
|
989 |
< |
|
990 |
< |
/////// hard jet |
991 |
< |
|
992 |
< |
|
993 |
< |
double matEta[1000*30],matPhi[1000*30]; |
994 |
< |
for(int i=0;i<1000;i++){for(int j=0;j<30;j++){matEta[i*j]=-99.;matPhi[i*j]=-99.;}} |
995 |
< |
|
996 |
< |
for(edm::View<pat::Jet>::const_iterator jet_iter = jets.begin(); jet_iter!=jets.end(); ++jet_iter){ |
997 |
< |
|
998 |
< |
if(printJet) {std::cout << "Jet Pt: " << jet_iter->pt() << " E,M: " << jet_iter->p4().E() << " " << jet_iter->p4().M() << "\n";} |
999 |
< |
|
1000 |
< |
reco::Jet::Constituents constituents = jet_iter->getJetConstituents(); |
1001 |
< |
|
1002 |
< |
// if(printJet) {std::cout << "NsubJets: " << constituents.size() << "\n";} |
1003 |
< |
VHbbEvent::HardJet hj; |
1004 |
< |
hj.constituents=constituents.size(); |
1005 |
< |
hj.p4 =GENPTOLORP(jet_iter); |
1006 |
< |
|
1007 |
< |
for (unsigned int iJC(0); iJC<constituents.size(); ++iJC ){ |
1008 |
< |
Jet::Constituent icandJet = constituents[iJC]; |
1009 |
< |
|
1010 |
< |
if(printJet) {std::cout << "subJet Pt: " << icandJet->pt() << " subJet E,M,eta,phi: " << icandJet->p4().E() << "," |
1011 |
< |
<< icandJet->p4().M() << "," << icandJet->eta() << "," << icandJet->phi() << "\n"; } |
1012 |
< |
|
1013 |
< |
|
1014 |
< |
hj.subFourMomentum.push_back(GENPTOLORP(icandJet)); |
1015 |
< |
hj.etaSub.push_back(icandJet->eta()); |
1016 |
< |
hj.phiSub.push_back(icandJet->phi()); |
943 |
> |
|
944 |
> |
|
945 |
> |
edm::Handle<reco::GenJetCollection> genJets ; |
946 |
> |
iEvent.getByLabel("ca12GenJetsNoNu",genJets); |
947 |
> |
|
948 |
> |
for (reco::GenJetCollection::const_iterator moIter = genJets->begin(); moIter != genJets->end(); ++moIter) { |
949 |
> |
// std::cout << "jet eta: " << moIter->eta() << std::endl; |
950 |
> |
if (moIter->pt() > 80.){ |
951 |
> |
VHbbEvent::RawJet rgj; |
952 |
> |
rgj.p4 = TLorentzVector( moIter->px(), moIter->py(), moIter->pz(), moIter->energy() ); |
953 |
> |
rgj.Nconstituents = moIter->getGenConstituents().size(); |
954 |
> |
|
955 |
> |
for (unsigned int iJC = 0; iJC < moIter->getGenConstituents().size(); iJC++){ |
956 |
> |
rgj.constituents_px.push_back( moIter->getGenConstituents().at(iJC)->px() ); |
957 |
> |
rgj.constituents_py.push_back( moIter->getGenConstituents().at(iJC)->py() ); |
958 |
> |
rgj.constituents_pz.push_back( moIter->getGenConstituents().at(iJC)->pz() ); |
959 |
> |
rgj.constituents_e.push_back( moIter->getGenConstituents().at(iJC)->energy() ); |
960 |
> |
rgj.constituents_pdgId.push_back( moIter->getGenConstituents().at(iJC)->pdgId() ); |
961 |
> |
} |
962 |
> |
hbbInfo->CA12wConstitsGen.push_back( rgj ); |
963 |
> |
} |
964 |
> |
} |
965 |
> |
// edm::Handle<edm::View<reco::GenJet> > ca12genjetHandle; |
966 |
> |
// iEvent.getByLabel("ca12GenJetsNoNu",ca12genjetHandle); |
967 |
> |
// edm::View<pat::Jet> ca12genjets = *ca12genjetHandle; |
968 |
> |
// ctr = 0; |
969 |
> |
// for(edm::View<reco::GenJet>::const_iterator jet_iter = ca12genjets.begin(); jet_iter!=ca12genjets.end(); ++jet_iter){ |
970 |
> |
// std::cout << "jet # " << ctr << std::endl; |
971 |
> |
// std::coit << "jet pt = " << jet_iter->pt() << std::endl; |
972 |
> |
|
973 |
> |
// std::cout << "size: " << jet_iter->getPFConstituents().size() << std::endl; |
974 |
> |
// |
975 |
> |
// std::vector<reco::PFCandidatePtr> constituents = jet_iter->getPFConstituents(); |
976 |
> |
// VHbbEvent::RawJet rj; |
977 |
> |
// rj.p4 = GENPTOLORP(jet_iter); |
978 |
> |
// rj.Nconstituents = jet_iter->getPFConstituents().size(); |
979 |
> |
// |
980 |
> |
// for (unsigned int iJC = 0; iJC<constituents.size(); ++iJC ){ |
981 |
> |
// |
982 |
> |
// rj.constituents_px.push_back( jet_iter->getPFConstituents().at(iJC)->px() ); |
983 |
> |
// rj.constituents_py.push_back( jet_iter->getPFConstituents().at(iJC)->py() ); |
984 |
> |
// rj.constituents_pz.push_back( jet_iter->getPFConstituents().at(iJC)->pz() ); |
985 |
> |
// rj.constituents_e.push_back( jet_iter->getPFConstituents().at(iJC)->energy() ); |
986 |
> |
// rj.constituents_pdgId.push_back( jet_iter->getPFConstituents().at(iJC)->pdgId() ); |
987 |
> |
// } |
988 |
> |
// |
989 |
> |
// hbbInfo->rawJetsGen.push_back( rj ); |
990 |
> |
|
991 |
> |
// ctr++; |
992 |
> |
// |
993 |
> |
// } |
994 |
> |
|
995 |
> |
} |
996 |
> |
////////////////////////////////////////////////////////////// |
997 |
> |
////////////////////////////////////////////////////////////// |
998 |
> |
|
999 |
> |
/////// hard jet |
1000 |
> |
|
1001 |
> |
|
1002 |
> |
double matEta[1000*30],matPhi[1000*30]; |
1003 |
> |
for(int i=0;i<1000;i++){for(int j=0;j<30;j++){matEta[i*j]=-99.;matPhi[i*j]=-99.;}} |
1004 |
> |
|
1005 |
> |
for(edm::View<pat::Jet>::const_iterator jet_iter = jets.begin(); jet_iter!=jets.end(); ++jet_iter){ |
1006 |
> |
|
1007 |
> |
if(printJet) {std::cout << "Jet Pt: " << jet_iter->pt() << " E,M: " << jet_iter->p4().E() << " " << jet_iter->p4().M() << "\n";} |
1008 |
> |
|
1009 |
> |
reco::Jet::Constituents constituents = jet_iter->getJetConstituents(); |
1010 |
> |
std::cout << "NsubJets: " << constituents.size() << "\n"; |
1011 |
> |
// std::cout << "Nconstituents: " << jet_iter->getConstituents().size() << "\n"; |
1012 |
> |
|
1013 |
> |
// if(printJet) {std::cout << "NsubJets: " << constituents.size() << "\n";} |
1014 |
> |
VHbbEvent::HardJet hj; |
1015 |
> |
hj.constituents=constituents.size(); |
1016 |
> |
hj.p4 =GENPTOLORP(jet_iter); |
1017 |
> |
|
1018 |
> |
for (unsigned int iJC(0); iJC<constituents.size(); ++iJC ){ |
1019 |
> |
Jet::Constituent icandJet = constituents[iJC]; |
1020 |
> |
|
1021 |
> |
if(printJet) {std::cout << "subJet Pt: " << icandJet->pt() << " subJet E,M,eta,phi: " << icandJet->p4().E() << "," |
1022 |
> |
<< icandJet->p4().M() << "," << icandJet->eta() << "," << icandJet->phi() << "\n"; } |
1023 |
> |
|
1024 |
> |
|
1025 |
> |
hj.subFourMomentum.push_back(GENPTOLORP(icandJet)); |
1026 |
> |
hj.etaSub.push_back(icandJet->eta()); |
1027 |
> |
hj.phiSub.push_back(icandJet->phi()); |
1028 |
> |
|
1029 |
> |
// std::cout << "subjet constituents: " << icandJet->getJetConstituents.size() << std::endl; |
1030 |
> |
|
1031 |
> |
} |
1032 |
> |
hbbInfo->hardJets.push_back(hj); |
1033 |
> |
} |
1034 |
> |
|
1035 |
> |
// HardJetSubEta2.SetMatrixArray(matEta); |
1036 |
> |
// HardJetSubPhi2.SetMatrixArray(matPhi); |
1037 |
> |
// TMatrixDRow a1(HardJetSubEta2,0); |
1038 |
> |
// for(int i=0;i<30;i++){ |
1039 |
> |
// std::cout << "test: " << a1[i] << "\n"; |
1040 |
> |
// } |
1041 |
> |
|
1042 |
> |
// pat subJets with Btag |
1043 |
> |
|
1044 |
> |
|
1045 |
> |
for(edm::View<pat::Jet>::const_iterator subjet_iter = subjets.begin(); subjet_iter!=subjets.end(); ++subjet_iter){ |
1046 |
> |
|
1047 |
> |
if(printJet) {std::cout << "SubJetTagged Pt: " << subjet_iter->pt() << " E,M,eta,phi,Btag: " << subjet_iter->p4().E() |
1048 |
> |
<< "," << subjet_iter->p4().M() << "," << subjet_iter->eta() << "," << subjet_iter->phi() |
1049 |
> |
<< "," << subjet_iter->bDiscriminator("combinedSecondaryVertexBJetTags") << "\n";} |
1050 |
> |
|
1051 |
> |
VHbbEvent::SimpleJet sj; |
1052 |
> |
// std::cout <<" sub jet "<<std::endl; |
1053 |
> |
fillSimpleJet(sj,subjet_iter); |
1054 |
> |
// if(!runOnMC_) |
1055 |
> |
setJecUnc(sj,jecUnc); |
1056 |
> |
/* sj.flavour = subjet_iter->partonFlavour(); |
1057 |
> |
sj.tVector = getTvect(&(*subjet_iter)); |
1058 |
> |
sj.tche=subjet_iter->bDiscriminator("trackCountingHighEffBJetTags"); |
1059 |
> |
sj.tchp=subjet_iter->bDiscriminator("trackCountingHighPurBJetTags"); |
1060 |
> |
sj.jp=subjet_iter->bDiscriminator("jetProbabilityBJetTags"); |
1061 |
> |
sj.jpb=subjet_iter->bDiscriminator("jetBProbabilityBJetTags"); |
1062 |
> |
sj.ssvhe=subjet_iter->bDiscriminator("simpleSecondaryVertexHighEffBJetTags"); |
1063 |
> |
sj.csv=subjet_iter->bDiscriminator("combinedSecondaryVertexBJetTags"); |
1064 |
> |
sj.csvmva=subjet_iter->bDiscriminator("combinedSecondaryVertexMVABJetTags"); |
1065 |
> |
sj.charge=subjet_iter->jetCharge(); |
1066 |
> |
sj.ntracks=subjet_iter->associatedTracks().size(); |
1067 |
> |
sj.p4=GENPTOLORP(subjet_iter); |
1068 |
> |
sj.p4=(getChargedTracksMomentum(&*(subjet_iter))); |
1069 |
> |
|
1070 |
> |
// |
1071 |
> |
// addtaginfo for csv |
1072 |
> |
// |
1073 |
> |
|
1074 |
> |
if (subjet_iter->hasTagInfo("SimpleSecondaryVertex")) { |
1075 |
> |
|
1076 |
> |
const reco::SecondaryVertexTagInfo * tf = subjet_iter->tagInfoSecondaryVertex(); |
1077 |
> |
sj.vtxMass = tf->secondaryVertex(0).p4().mass(); |
1078 |
> |
sj.vtxNTracks = tf->secondaryVertex(0).nTracks(); |
1079 |
> |
Measurement1D m = tf->flightDistance(0); |
1080 |
> |
sj.vtx3dL = m.value(); |
1081 |
> |
sj.vtx3deL = m.error(); |
1082 |
> |
} |
1083 |
> |
*/ |
1084 |
> |
hbbInfo->subJets.push_back(sj); |
1085 |
> |
|
1086 |
> |
} |
1087 |
> |
|
1088 |
> |
for(edm::View<pat::Jet>::const_iterator filterjet_iter = filterjets.begin(); filterjet_iter!=filterjets.end(); ++filterjet_iter){ |
1089 |
> |
|
1090 |
> |
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";} |
1091 |
> |
|
1092 |
> |
VHbbEvent::SimpleJet fj; |
1093 |
> |
// std::cout <<" sub jet "<<std::endl; |
1094 |
> |
fillSimpleJet(fj,filterjet_iter); |
1095 |
> |
// if(!runOnMC_) |
1096 |
> |
setJecUnc(fj,jecUnc); |
1097 |
> |
|
1098 |
> |
if(runOnMC_){ |
1099 |
> |
|
1100 |
> |
//BTV scale factors |
1101 |
> |
// fillScaleFactors(sj, btagSFs); |
1102 |
> |
|
1103 |
> |
//PAT genJet matching |
1104 |
> |
//genJet |
1105 |
> |
const reco::GenJet *gJ = filterjet_iter->genJet(); |
1106 |
> |
//physical parton for mother info ONLY |
1107 |
> |
if( (filterjet_iter->genParton()) ){ |
1108 |
> |
fj.bestMCid = filterjet_iter->genParton()->pdgId(); |
1109 |
> |
if( (filterjet_iter->genParton()->mother()) ) |
1110 |
> |
fj.bestMCmomid=filterjet_iter->genParton()->mother()->pdgId(); |
1111 |
> |
} |
1112 |
> |
TLorentzVector gJp4; |
1113 |
> |
if(gJ){ |
1114 |
> |
gJp4.SetPtEtaPhiE(gJ->pt(),gJ->eta(),gJ->phi(),gJ->energy()); |
1115 |
> |
fj.bestMCp4 = gJp4; |
1116 |
> |
if(verbose_){ |
1117 |
> |
std::clog << "filter genJet matched Pt = " << gJp4.Pt() << std::endl; |
1118 |
> |
std::clog << "filter genJet matched eta = " << gJp4.Eta() << std::endl; |
1119 |
> |
std::clog << "filter genJet matched deltaR = " << gJp4.DeltaR(fj.p4) << std::endl; |
1120 |
> |
std::clog << "filter genJet matched mother id = " << fj.bestMCmomid << std::endl; |
1121 |
> |
} |
1122 |
> |
} |
1123 |
> |
} |
1124 |
> |
|
1125 |
> |
hbbInfo->filterJets.push_back(fj); |
1126 |
> |
|
1127 |
> |
|
1128 |
> |
} |
1129 |
> |
|
1130 |
> |
// |
1131 |
> |
// add charged met |
1132 |
> |
// |
1133 |
> |
|
1134 |
> |
edm::Handle<edm::View<reco::MET> > metChargedHandle; |
1135 |
> |
iEvent.getByLabel("pfMETNoPUCharge",metChargedHandle); |
1136 |
> |
edm::View<reco::MET> metsCh = *metChargedHandle; |
1137 |
> |
if(metsCh.size()){ |
1138 |
> |
hbbInfo->metCh.sumEt=(metsCh[0]).sumEt(); |
1139 |
> |
hbbInfo->metCh.metSig=metSignificance(& (metsCh[0])); |
1140 |
> |
hbbInfo->metCh.eLong=(metsCh[0]).e_longitudinal(); |
1141 |
> |
hbbInfo->metCh.p4=GENPTOLOR((metsCh[0])); |
1142 |
> |
if (verbose_) std::cout <<" METCharged "<< hbbInfo->metCh.metSig <<" " << hbbInfo->metCh.sumEt<<std::endl; |
1143 |
> |
} |
1144 |
> |
|
1145 |
> |
// type 1 corr met |
1146 |
> |
edm::Handle<edm::View<reco::MET> > pfmetType1corrHandle; |
1147 |
> |
iEvent.getByLabel("patType1CorrectedPFMet",pfmetType1corrHandle); |
1148 |
> |
edm::View<reco::MET> pfmetsType1corr = *pfmetType1corrHandle; |
1149 |
> |
if(pfmetsType1corr.size()){ |
1150 |
> |
hbbInfo->pfmetType1corr.sumEt=(pfmetsType1corr[0]).sumEt(); |
1151 |
> |
hbbInfo->pfmetType1corr.metSig=metSignificance(& (pfmetsType1corr[0])); |
1152 |
> |
hbbInfo->pfmetType1corr.eLong=(pfmetsType1corr[0]).e_longitudinal(); |
1153 |
> |
hbbInfo->pfmetType1corr.p4=GENPTOLOR((pfmetsType1corr[0])); |
1154 |
> |
if (verbose_) std::cout <<" type 1 corrected pfMET "<< hbbInfo->pfmetType1corr.metSig <<" " << hbbInfo->pfmetType1corr.sumEt<<std::endl; |
1155 |
> |
} |
1156 |
> |
|
1157 |
> |
|
1158 |
> |
// type 1 + 2 corr met |
1159 |
> |
edm::Handle<edm::View<reco::MET> > pfmetType1p2corrHandle; |
1160 |
> |
iEvent.getByLabel("patType1p2CorrectedPFMet",pfmetType1p2corrHandle); |
1161 |
> |
edm::View<reco::MET> pfmetsType1p2corr = *pfmetType1p2corrHandle; |
1162 |
> |
if(pfmetsType1p2corr.size()){ |
1163 |
> |
hbbInfo->pfmetType1p2corr.sumEt=(pfmetsType1p2corr[0]).sumEt(); |
1164 |
> |
hbbInfo->pfmetType1p2corr.metSig=metSignificance(& (pfmetsType1p2corr[0])); |
1165 |
> |
hbbInfo->pfmetType1p2corr.eLong=(pfmetsType1p2corr[0]).e_longitudinal(); |
1166 |
> |
hbbInfo->pfmetType1p2corr.p4=GENPTOLOR((pfmetsType1p2corr[0])); |
1167 |
> |
if (verbose_) std::cout <<" type 1 +2 corrected pfMET "<< hbbInfo->pfmetType1p2corr.metSig <<" " << hbbInfo->pfmetType1p2corr.sumEt<<std::endl; |
1168 |
> |
} |
1169 |
> |
|
1170 |
> |
// type 1 corr met NoPU |
1171 |
> |
/* edm::Handle<edm::View<reco::MET> > pfmetNoPUType1corrHandle; |
1172 |
> |
iEvent.getByLabel("patType1CorrectedPFMetNoPU",pfmetNoPUType1corrHandle); |
1173 |
> |
edm::View<reco::MET> pfmetsNoPUType1corr = *pfmetNoPUType1corrHandle; |
1174 |
> |
if(pfmetsNoPUType1corr.size()){ |
1175 |
> |
hbbInfo->pfmetNoPUType1corr.sumEt=(pfmetsNoPUType1corr[0]).sumEt(); |
1176 |
> |
hbbInfo->pfmetNoPUType1corr.metSig=metSignificance(& (pfmetsNoPUType1corr[0])); |
1177 |
> |
hbbInfo->pfmetNoPUType1corr.eLong=(pfmetsNoPUType1corr[0]).e_longitudinal(); |
1178 |
> |
hbbInfo->pfmetNoPUType1corr.p4=GENPTOLOR((pfmetsNoPUType1corr[0])); |
1179 |
> |
if (verbose_) std::cout <<" type 1 corrected pfMET NoPU"<< hbbInfo->pfmetNoPUType1corr.metSig <<" " << hbbInfo->pfmetNoPUType1corr.sumEt<<std::endl; |
1180 |
> |
} |
1181 |
> |
|
1182 |
|
|
1183 |
+ |
// type 1 + 2 corr met |
1184 |
+ |
edm::Handle<edm::View<reco::MET> > pfmetNoPUType1p2corrHandle; |
1185 |
+ |
iEvent.getByLabel("patType1p2CorrectedPFMetNoPU",pfmetNoPUType1p2corrHandle); |
1186 |
+ |
edm::View<reco::MET> pfmetsNoPUType1p2corr = *pfmetNoPUType1p2corrHandle; |
1187 |
+ |
if(pfmetsNoPUType1p2corr.size()){ |
1188 |
+ |
hbbInfo->pfmetNoPUType1p2corr.sumEt=(pfmetsNoPUType1p2corr[0]).sumEt(); |
1189 |
+ |
hbbInfo->pfmetNoPUType1p2corr.metSig=metSignificance(& (pfmetsNoPUType1p2corr[0])); |
1190 |
+ |
hbbInfo->pfmetNoPUType1p2corr.eLong=(pfmetsNoPUType1p2corr[0]).e_longitudinal(); |
1191 |
+ |
hbbInfo->pfmetNoPUType1p2corr.p4=GENPTOLOR((pfmetsNoPUType1p2corr[0])); |
1192 |
+ |
if (verbose_) std::cout <<" type 1 +2 corrected pfMET "<< hbbInfo->pfmetNoPUType1p2corr.metSig <<" " << hbbInfo->pfmetNoPUType1p2corr.sumEt<<std::endl; |
1193 |
+ |
} |
1194 |
+ |
|
1195 |
+ |
*/ |
1196 |
+ |
|
1197 |
+ |
/* |
1198 |
+ |
// MET uncertainty vector |
1199 |
+ |
vector<pat::MET> "patType1CorrectedPFMet" "" "VH" |
1200 |
+ |
vector<pat::MET> "patType1CorrectedPFMetElectronEnDown" "" "VH" |
1201 |
+ |
vector<pat::MET> "patType1CorrectedPFMetElectronEnUp" "" "VH" |
1202 |
+ |
vector<pat::MET> "patType1CorrectedPFMetJetEnDown" "" "VH" |
1203 |
+ |
vector<pat::MET> "patType1CorrectedPFMetJetEnUp" "" "VH" |
1204 |
+ |
vector<pat::MET> "patType1CorrectedPFMetJetResDown" "" "VH" |
1205 |
+ |
vector<pat::MET> "patType1CorrectedPFMetJetResUp" "" "VH" |
1206 |
+ |
vector<pat::MET> "patType1CorrectedPFMetMuonEnDown" "" "VH" |
1207 |
+ |
vector<pat::MET> "patType1CorrectedPFMetMuonEnUp" "" "VH" |
1208 |
+ |
vector<pat::MET> "patType1CorrectedPFMetNoPU" "" "VH" |
1209 |
+ |
vector<pat::MET> "patType1CorrectedPFMetTauEnDown" "" "VH" |
1210 |
+ |
vector<pat::MET> "patType1CorrectedPFMetTauEnUp" "" "VH" |
1211 |
+ |
vector<pat::MET> "patType1CorrectedPFMetUnclusteredEnDown" "" "VH" |
1212 |
+ |
vector<pat::MET> "patType1CorrectedPFMetUnclusteredEnUp" "" "VH" |
1213 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMet" "" "VH" |
1214 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetElectronEnDown" "" "VH" |
1215 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetElectronEnUp" "" "VH" |
1216 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetJetEnDown" "" "VH" |
1217 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetJetEnUp" "" "VH" |
1218 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetJetResDown" "" "VH" |
1219 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetJetResUp" "" "VH" |
1220 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetMuonEnDown" "" "VH" |
1221 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetMuonEnUp" "" "VH" |
1222 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetNoPU" "" "VH" |
1223 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetTauEnDown" "" "VH" |
1224 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetTauEnUp" "" "VH" |
1225 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetUnclusteredEnDown" "" "VH" |
1226 |
+ |
vector<pat::MET> "patType1p2CorrectedPFMetUnclusteredEnUp" "" "VH" |
1227 |
+ |
*/ |
1228 |
+ |
|
1229 |
+ |
VHbbEvent::METInfo metunc; |
1230 |
+ |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetElectronEnDownHandle; |
1231 |
+ |
iEvent.getByLabel("patType1CorrectedPFMetElectronEnDown",patType1CorrectedPFMetElectronEnDownHandle); |
1232 |
+ |
edm::View<reco::MET> patType1CorrectedPFMetsElectronEnDown = *patType1CorrectedPFMetElectronEnDownHandle; |
1233 |
+ |
if(patType1CorrectedPFMetsElectronEnDown.size()){ |
1234 |
+ |
metunc.sumEt =(patType1CorrectedPFMetsElectronEnDown[0]).sumEt(); |
1235 |
+ |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsElectronEnDown[0])); |
1236 |
+ |
metunc.eLong=(patType1CorrectedPFMetsElectronEnDown[0]).e_longitudinal(); |
1237 |
+ |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsElectronEnDown[0])); |
1238 |
+ |
hbbInfo->metUncInfo.push_back(metunc); |
1239 |
|
} |
676 |
– |
hbbInfo->hardJets.push_back(hj); |
677 |
– |
} |
1240 |
|
|
1241 |
< |
// HardJetSubEta2.SetMatrixArray(matEta); |
1242 |
< |
// HardJetSubPhi2.SetMatrixArray(matPhi); |
1243 |
< |
// TMatrixDRow a1(HardJetSubEta2,0); |
1244 |
< |
// for(int i=0;i<30;i++){ |
1245 |
< |
// std::cout << "test: " << a1[i] << "\n"; |
1246 |
< |
// } |
1247 |
< |
|
1248 |
< |
// pat subJets with Btag |
1249 |
< |
|
688 |
< |
|
689 |
< |
for(edm::View<pat::Jet>::const_iterator subjet_iter = subjets.begin(); subjet_iter!=subjets.end(); ++subjet_iter){ |
690 |
< |
|
691 |
< |
if(printJet) {std::cout << "SubJetTagged Pt: " << subjet_iter->pt() << " E,M,eta,phi,Btag: " << subjet_iter->p4().E() |
692 |
< |
<< "," << subjet_iter->p4().M() << "," << subjet_iter->eta() << "," << subjet_iter->phi() |
693 |
< |
<< "," << subjet_iter->bDiscriminator("combinedSecondaryVertexBJetTags") << "\n";} |
694 |
< |
|
695 |
< |
VHbbEvent::SimpleJet sj; |
696 |
< |
// std::cout <<" sub jet "<<std::endl; |
697 |
< |
fillSimpleJet(sj,subjet_iter); |
698 |
< |
// if(!runOnMC_) |
699 |
< |
setJecUnc(sj,jecUnc); |
700 |
< |
/* sj.flavour = subjet_iter->partonFlavour(); |
701 |
< |
sj.tVector = getTvect(&(*subjet_iter)); |
702 |
< |
sj.tche=subjet_iter->bDiscriminator("trackCountingHighEffBJetTags"); |
703 |
< |
sj.tchp=subjet_iter->bDiscriminator("trackCountingHighPurBJetTags"); |
704 |
< |
sj.jp=subjet_iter->bDiscriminator("jetProbabilityBJetTags"); |
705 |
< |
sj.jpb=subjet_iter->bDiscriminator("jetBProbabilityBJetTags"); |
706 |
< |
sj.ssvhe=subjet_iter->bDiscriminator("simpleSecondaryVertexHighEffBJetTags"); |
707 |
< |
sj.csv=subjet_iter->bDiscriminator("combinedSecondaryVertexBJetTags"); |
708 |
< |
sj.csvmva=subjet_iter->bDiscriminator("combinedSecondaryVertexMVABJetTags"); |
709 |
< |
sj.charge=subjet_iter->jetCharge(); |
710 |
< |
sj.ntracks=subjet_iter->associatedTracks().size(); |
711 |
< |
sj.p4=GENPTOLORP(subjet_iter); |
712 |
< |
sj.p4=(getChargedTracksMomentum(&*(subjet_iter))); |
713 |
< |
|
714 |
< |
// |
715 |
< |
// addtaginfo for csv |
716 |
< |
// |
717 |
< |
|
718 |
< |
if (subjet_iter->hasTagInfo("SimpleSecondaryVertex")) { |
719 |
< |
|
720 |
< |
const reco::SecondaryVertexTagInfo * tf = subjet_iter->tagInfoSecondaryVertex(); |
721 |
< |
sj.vtxMass = tf->secondaryVertex(0).p4().mass(); |
722 |
< |
sj.vtxNTracks = tf->secondaryVertex(0).nTracks(); |
723 |
< |
Measurement1D m = tf->flightDistance(0); |
724 |
< |
sj.vtx3dL = m.value(); |
725 |
< |
sj.vtx3deL = m.error(); |
726 |
< |
} |
727 |
< |
*/ |
728 |
< |
hbbInfo->subJets.push_back(sj); |
729 |
< |
|
730 |
< |
} |
731 |
< |
|
732 |
< |
|
733 |
< |
// |
734 |
< |
// met is calomet |
735 |
< |
// |
736 |
< |
|
737 |
< |
edm::Handle<edm::View<pat::MET> > metTCHandle; |
738 |
< |
iEvent.getByLabel("patMETsTC",metTCHandle); |
739 |
< |
edm::View<pat::MET> metsTC = *metTCHandle; |
740 |
< |
if(metsTC.size()){ |
741 |
< |
hbbInfo->tcmet.sumEt=(metsTC[0]).sumEt(); |
742 |
< |
hbbInfo->tcmet.metSig=(metsTC[0]).significance(); |
743 |
< |
hbbInfo->tcmet.eLong=(metsTC[0]).e_longitudinal(); |
744 |
< |
hbbInfo->tcmet.p4=GENPTOLOR((metsTC[0])); |
745 |
< |
if (verbose_) std::cout <<" METTC "<< hbbInfo->tcmet.metSig <<" " << hbbInfo->tcmet.sumEt<<std::endl; |
746 |
< |
} |
747 |
< |
|
748 |
< |
edm::Handle<edm::View<reco::MET> > pfMETNoPUHandle; |
749 |
< |
iEvent.getByLabel("pfMETNoPU",pfMETNoPUHandle); |
750 |
< |
edm::View<reco::MET> metspfMETNoPU = *pfMETNoPUHandle; |
751 |
< |
if(metspfMETNoPU.size()){ |
752 |
< |
hbbInfo->metNoPU.sumEt=(metspfMETNoPU[0]).sumEt(); |
753 |
< |
hbbInfo->metNoPU.metSig=(metspfMETNoPU[0]).significance(); |
754 |
< |
hbbInfo->metNoPU.eLong=(metspfMETNoPU[0]).e_longitudinal(); |
755 |
< |
hbbInfo->metNoPU.p4=GENPTOLOR((metspfMETNoPU[0])); |
756 |
< |
if (verbose_) std::cout <<" pfMETNoPU "<< hbbInfo->metNoPU.metSig <<" " << hbbInfo->metNoPU.sumEt<<std::endl; |
757 |
< |
} |
758 |
< |
|
759 |
< |
edm::Handle<edm::View<reco::MET> > mHTHandle; |
760 |
< |
iEvent.getByLabel("patMETsHT",mHTHandle); |
761 |
< |
edm::View<reco::MET> metsHT = *mHTHandle; |
762 |
< |
if(metsHT.size()){ |
763 |
< |
hbbInfo->mht.sumEt=(metsHT[0]).sumEt(); |
764 |
< |
hbbInfo->mht.metSig=(metsHT[0]).significance(); |
765 |
< |
hbbInfo->mht.eLong=(metsHT[0]).e_longitudinal(); |
766 |
< |
hbbInfo->mht.p4=GENPTOLOR((metsHT[0])); |
767 |
< |
if (verbose_) std::cout <<" METHT "<< hbbInfo->mht.metSig <<" " << hbbInfo->mht.sumEt<<std::endl; |
768 |
< |
} |
769 |
< |
|
770 |
< |
edm::Handle<edm::View<reco::MET> > metHandle; |
771 |
< |
iEvent.getByLabel(metLabel_,metHandle); |
772 |
< |
edm::View<reco::MET> mets = *metHandle; |
773 |
< |
|
774 |
< |
if(mets.size()){ |
775 |
< |
hbbInfo->calomet.sumEt=(mets[0]).sumEt(); |
776 |
< |
hbbInfo->calomet.metSig=(mets[0]).significance(); |
777 |
< |
hbbInfo->calomet.eLong=(mets[0]).e_longitudinal(); |
778 |
< |
hbbInfo->calomet.p4=GENPTOLOR((mets[0])); |
779 |
< |
if (verbose_) std::cout <<" METCALO "<< hbbInfo->calomet.metSig <<" " << hbbInfo->calomet.sumEt<<std::endl; |
780 |
< |
} |
781 |
< |
|
782 |
< |
edm::Handle<edm::View<pat::MET> > metPFHandle; |
783 |
< |
iEvent.getByLabel("patMETsPF",metPFHandle); |
784 |
< |
edm::View<pat::MET> metsPF = *metPFHandle; |
785 |
< |
|
786 |
< |
if(metsPF.size()){ |
787 |
< |
hbbInfo->pfmet.sumEt=(metsPF[0]).sumEt(); |
788 |
< |
hbbInfo->pfmet.metSig=(metsPF[0]).significance(); |
789 |
< |
hbbInfo->pfmet.eLong=(metsPF[0]).e_longitudinal(); |
790 |
< |
hbbInfo->pfmet.p4=GENPTOLOR((metsPF[0])); |
791 |
< |
if (verbose_) std::cout <<" METPF "<< hbbInfo->pfmet.metSig <<" " << hbbInfo->pfmet.sumEt<<std::endl; |
792 |
< |
} |
793 |
< |
|
794 |
< |
|
795 |
< |
if(verbose_){ |
796 |
< |
std::cout << "METs: calomet "<<mets.size()<<" tcmet"<<metsTC.size()<<" pfmet "<<metsPF.size()<<" MHT" <<metsHT.size()<<std::endl; |
797 |
< |
} |
798 |
< |
|
799 |
< |
if(verbose_) |
800 |
< |
std::cout << " INPUT MUONS "<<muons.size()<<std::endl; |
801 |
< |
|
802 |
< |
for(edm::View<pat::Muon>::const_iterator mu = muons.begin(); mu!=muons.end(); ++mu){ |
803 |
< |
VHbbEvent::MuonInfo mf; |
804 |
< |
mf.p4 =GENPTOLORP( mu); |
805 |
< |
mf.charge=mu->charge(); |
806 |
< |
mf.tIso=mu->trackIso(); |
807 |
< |
mf.eIso=mu->ecalIso(); |
808 |
< |
mf.hIso=mu->hcalIso(); |
809 |
< |
mf.pfChaIso=mu->chargedHadronIso(); |
810 |
< |
mf.pfChaPUIso=mu->userIso(5); |
811 |
< |
mf.pfPhoIso=mu->photonIso(); |
812 |
< |
mf.pfNeuIso=mu->neutralHadronIso(); |
813 |
< |
Geom::Phi<double> deltaphi(mu->phi()-atan2(mf.p4.Px(), mf.p4.Py())); |
814 |
< |
double acop = deltaphi.value(); |
815 |
< |
mf.acop=acop; |
816 |
< |
|
817 |
< |
mf.nMatches = mu->numberOfMatches(); |
818 |
< |
|
819 |
< |
mf.ipDb=mu->dB(); |
820 |
< |
mf.ipErrDb=mu->edB(); |
821 |
< |
mf.cat=0; |
822 |
< |
if(mu->isGlobalMuon()) mf.cat|=1; |
823 |
< |
if(mu->isTrackerMuon()) mf.cat|=2; |
824 |
< |
if(mu->isStandAloneMuon()) mf.cat|=4; |
825 |
< |
TrackRef trkMu1Ref = mu->get<TrackRef>(); |
826 |
< |
if(trkMu1Ref.isNonnull()){ |
827 |
< |
const Track* MuTrk1 = mu->get<TrackRef>().get(); |
828 |
< |
mf.zPVPt=MuTrk1->dz(RecVtxFirst.position()); |
829 |
< |
mf.zPVProb=MuTrk1->dz(RecVtx.position()); |
830 |
< |
mf.nHits=MuTrk1->numberOfValidHits(); |
831 |
< |
mf.chi2=MuTrk1->normalizedChi2(); |
832 |
< |
TrackRef iTrack1 = mu->innerTrack(); |
833 |
< |
const reco::HitPattern& p1 = iTrack1->hitPattern(); |
834 |
< |
mf.nPixelHits=p1.pixelLayersWithMeasurement(); |
835 |
< |
|
836 |
< |
mf.nValidTracker = p1.numberOfValidTrackerHits(); |
837 |
< |
mf.nValidPixel = p1.numberOfValidPixelHits(); |
838 |
< |
|
839 |
< |
|
840 |
< |
|
841 |
< |
} |
842 |
< |
if(mu->isGlobalMuon()){ |
843 |
< |
TrackRef gTrack = mu->globalTrack(); |
844 |
< |
const reco::HitPattern& q = gTrack->hitPattern(); |
845 |
< |
mf.globChi2=gTrack.get()->normalizedChi2(); |
846 |
< |
mf.globNHits=q.numberOfValidMuonHits(); |
847 |
< |
mf.validMuStations = q.muonStationsWithValidHits(); |
848 |
< |
}else{ |
849 |
< |
mf.globChi2=-99; |
850 |
< |
mf.globNHits=-99; |
851 |
< |
} |
852 |
< |
|
853 |
< |
//Muon trigger matching |
854 |
< |
for (int itrig = 0; itrig != ntrigs; ++itrig){ |
855 |
< |
std::string trigName=triggerNames_.triggerName(itrig); |
856 |
< |
if( (mu->triggerObjectMatchesByPath(trigName,false,false).size() != 0) ){ |
857 |
< |
mf.hltMatchedBits.push_back(itrig); |
858 |
< |
if(verbose_){ |
859 |
< |
std::clog << "Trigger Matching box" << std::endl; |
860 |
< |
std::clog << "+++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; |
861 |
< |
std::clog << "Matching parameters are defined in the cfg" << std::endl; |
862 |
< |
std::clog << "Trigger bit = " << itrig << std::endl; |
863 |
< |
std::clog << "Trigger name = " << trigName << std::endl; |
864 |
< |
std::clog << "Trigger object matched collection size = " << mu->triggerObjectMatchesByPath(trigName,false,false).size() << std::endl; |
865 |
< |
std::clog << "Pat Muon pt = " << mf.p4.Pt() << " HLT object matched = " << mu->triggerObjectMatch(0)->p4().Pt() << std::endl; |
866 |
< |
std::clog << "+++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; |
867 |
< |
} |
868 |
< |
} |
1241 |
> |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetElectronEnUpHandle; |
1242 |
> |
iEvent.getByLabel("patType1CorrectedPFMetElectronEnUp",patType1CorrectedPFMetElectronEnUpHandle); |
1243 |
> |
edm::View<reco::MET> patType1CorrectedPFMetsElectronEnUp = *patType1CorrectedPFMetElectronEnUpHandle; |
1244 |
> |
if(patType1CorrectedPFMetsElectronEnUp.size()){ |
1245 |
> |
metunc.sumEt =(patType1CorrectedPFMetsElectronEnUp[0]).sumEt(); |
1246 |
> |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsElectronEnUp[0])); |
1247 |
> |
metunc.eLong=(patType1CorrectedPFMetsElectronEnUp[0]).e_longitudinal(); |
1248 |
> |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsElectronEnUp[0])); |
1249 |
> |
hbbInfo->metUncInfo.push_back(metunc); |
1250 |
|
} |
1251 |
< |
// |
1252 |
< |
|
1253 |
< |
// add stamuon |
1254 |
< |
|
1255 |
< |
// if (mu->isStandAloneMuon()) { |
1256 |
< |
// reco::TrackRef sta = mu->standAloneMuon(); |
1257 |
< |
// |
1258 |
< |
// } |
1259 |
< |
|
1260 |
< |
|
1261 |
< |
// int muInfo[12]; |
1262 |
< |
// fillMuBlock(mu, muInfo); |
882 |
< |
if(runOnMC_){ |
883 |
< |
const GenParticle* muMc = mu->genLepton(); |
884 |
< |
if(muMc!=0){ |
885 |
< |
mf.mcId=muMc->pdgId(); |
886 |
< |
mf.mcFourMomentum=GENPTOLORP(muMc); |
887 |
< |
if(muMc->mother()!=0) mf.mcMomId=muMc->mother()->pdgId(); |
888 |
< |
if(muMc->mother()!=0 && muMc->mother()->mother()!=0) mf.mcgMomId=muMc->mother()->mother()->pdgId(); |
889 |
< |
} } |
890 |
< |
hbbInfo->muInfo.push_back(mf); |
891 |
< |
} |
892 |
< |
|
893 |
< |
if(verbose_) |
894 |
< |
std::cout << " INPUT electrons "<<electrons.size()<<std::endl; |
895 |
< |
for(edm::View<pat::Electron>::const_iterator elec = electrons.begin(); elec!=electrons.end(); ++elec){ |
896 |
< |
VHbbEvent::ElectronInfo ef; |
897 |
< |
ef.p4=GENPTOLORP(elec); |
898 |
< |
ef.scEta =elec->superCluster()->eta(); |
899 |
< |
ef.scPhi =elec->superCluster()->phi(); |
900 |
< |
// if(ElecEta[eleccont]!=0) ElecEt[eleccont]=elec->superCluster()->energy()/cosh(elec->superCluster()->eta()); |
901 |
< |
ef.charge=elec->charge(); |
902 |
< |
ef.tIso=elec->trackIso(); |
903 |
< |
ef.eIso=elec->ecalIso(); |
904 |
< |
ef.hIso=elec->hcalIso(); |
905 |
< |
ef.pfChaIso=elec->chargedHadronIso(); |
906 |
< |
ef.pfChaPUIso=elec->userIso(5); |
907 |
< |
ef.pfPhoIso=elec->photonIso(); |
908 |
< |
ef.pfNeuIso=elec->neutralHadronIso(); |
909 |
< |
|
910 |
< |
Geom::Phi<double> deltaphi(elec->superCluster()->phi()-atan2(hbbInfo->pfmet.p4.Py(),hbbInfo->pfmet.p4.Px())); |
911 |
< |
ef.acop = deltaphi.value(); |
912 |
< |
// |
913 |
< |
ef.sihih = elec->sigmaIetaIeta(); |
914 |
< |
ef.Dphi = elec->deltaPhiSuperClusterTrackAtVtx(); |
915 |
< |
ef.Deta = elec->deltaEtaSuperClusterTrackAtVtx(); |
916 |
< |
ef.HoE = elec->hadronicOverEm(); |
917 |
< |
ef.convDist = elec->convDist(); |
918 |
< |
ef.convDcot = elec->convDcot(); |
919 |
< |
if(elec->gsfTrack().isNonnull()) ef.innerHits = elec->gsfTrack()->trackerExpectedHitsInner().numberOfHits(); |
920 |
< |
ef.isEB = elec->isEB(); |
921 |
< |
ef.isEE = elec->isEE(); |
922 |
< |
// |
923 |
< |
// fill eleids |
924 |
< |
// |
925 |
< |
/* ef.id95 = elec->electronID("simpleEleId95cIso"); |
926 |
< |
ef.id85 = elec->electronID("simpleEleId85cIso"); |
927 |
< |
ef.id70 = elec->electronID("simpleEleId70cIso"); |
928 |
< |
ef.id95r = elec->electronID("simpleEleId95relIso"); |
929 |
< |
ef.id70r = elec->electronID("simpleEleId70relIso"); |
930 |
< |
ef.id85r = elec->electronID("simpleEleId85relIso"); |
931 |
< |
*/ |
932 |
< |
ef.id95 =elec->electronID("eidVBTFCom95"); |
933 |
< |
ef.id95r=elec->electronID("eidVBTFRel95"); |
934 |
< |
ef.id85 =elec->electronID("eidVBTFCom85"); |
935 |
< |
ef.id85r=elec->electronID("eidVBTFRel85"); |
936 |
< |
ef.id80 =elec->electronID("eidVBTFCom80"); |
937 |
< |
ef.id80r=elec->electronID("eidVBTFRel80"); |
938 |
< |
ef.id70 =elec->electronID("eidVBTFCom70"); |
939 |
< |
ef.id70r=elec->electronID("eidVBTFRel70"); |
940 |
< |
|
941 |
< |
//Electron trigger matching |
942 |
< |
for (int itrig = 0; itrig != ntrigs; ++itrig){ |
943 |
< |
std::string trigName=triggerNames_.triggerName(itrig); |
944 |
< |
if( (elec->triggerObjectMatchesByPath(trigName).size() != 0) ){ |
945 |
< |
ef.hltMatchedBits.push_back(itrig); |
946 |
< |
if(verbose_){ |
947 |
< |
std::clog << "Trigger Matching box" << std::endl; |
948 |
< |
std::clog << "+++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; |
949 |
< |
std::clog << "Matching parameters are defined in the cfg" << std::endl; |
950 |
< |
std::clog << "Trigger bit = " << itrig << std::endl; |
951 |
< |
std::clog << "Trigger name = " << trigName << std::endl; |
952 |
< |
std::clog << "Trigger object matched collection size = " << elec->triggerObjectMatchesByPath(trigName).size() << std::endl; |
953 |
< |
std::clog << "Pat Electron pt = " << ef.p4.Pt() << " HLT object matched = " << elec->triggerObjectMatch(0)->p4().Pt() << std::endl; |
954 |
< |
std::clog << "+++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; |
955 |
< |
} |
956 |
< |
} |
1251 |
> |
|
1252 |
> |
|
1253 |
> |
|
1254 |
> |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetMuonEnDownHandle; |
1255 |
> |
iEvent.getByLabel("patType1CorrectedPFMetMuonEnDown",patType1CorrectedPFMetMuonEnDownHandle); |
1256 |
> |
edm::View<reco::MET> patType1CorrectedPFMetsMuonEnDown = *patType1CorrectedPFMetMuonEnDownHandle; |
1257 |
> |
if(patType1CorrectedPFMetsMuonEnDown.size()){ |
1258 |
> |
metunc.sumEt =(patType1CorrectedPFMetsMuonEnDown[0]).sumEt(); |
1259 |
> |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsMuonEnDown[0])); |
1260 |
> |
metunc.eLong=(patType1CorrectedPFMetsMuonEnDown[0]).e_longitudinal(); |
1261 |
> |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsMuonEnDown[0])); |
1262 |
> |
hbbInfo->metUncInfo.push_back(metunc); |
1263 |
|
} |
958 |
– |
|
959 |
– |
if(runOnMC_){ |
960 |
– |
const GenParticle* elecMc = elec->genLepton(); |
961 |
– |
if(elecMc!=0){ |
962 |
– |
ef.mcId=elecMc->pdgId(); |
963 |
– |
ef.mcFourMomentum=GENPTOLORP(elecMc); |
964 |
– |
if(elecMc->mother()!=0) ef.mcMomId=elecMc->mother()->pdgId(); |
965 |
– |
if(elecMc->mother()!=0 && elecMc->mother()->mother()!=0) ef.mcgMomId=elecMc->mother()->mother()->pdgId(); |
966 |
– |
}} |
967 |
– |
hbbInfo->eleInfo.push_back(ef); |
968 |
– |
} |
969 |
– |
|
970 |
– |
if(verbose_) |
971 |
– |
std::cout << " INPUT taus "<<taus.size()<<std::endl; |
972 |
– |
for(edm::View<pat::Tau>::const_iterator tau = taus.begin(); tau!=taus.end(); ++tau){ |
973 |
– |
VHbbEvent::TauInfo tf; |
974 |
– |
tf.p4=GENPTOLORP(tau); |
975 |
– |
tf.charge=tau->charge(); |
976 |
– |
tf.tIso=tau->trackIso(); |
977 |
– |
tf.eIso=tau->ecalIso(); |
978 |
– |
tf.hIso=tau->hcalIso(); |
979 |
– |
Geom::Phi<double> deltaphi(tau->phi()-atan2(hbbInfo->pfmet.p4.Py(),hbbInfo->pfmet.p4.Px())); |
980 |
– |
double acop = deltaphi.value(); |
981 |
– |
tf.acop=acop; |
982 |
– |
tf.idbyIso=tau->tauID("byIsolation"); |
983 |
– |
tf.idbyTrackIso=tau->tauID("trackIsolation"); |
984 |
– |
tf.idbyTaNCfrOnePercent=tau->tauID("byTaNCfrOnePercent"); |
985 |
– |
tf.idbyTaNCfrHalfPercent=tau->tauID("byTaNCfrHalfPercent"); |
986 |
– |
tf.idbyTaNCfrQuarterPercent=tau->tauID("byTaNCfrQuarterPercent"); |
987 |
– |
tf.idbyTaNCfrTenthPercent=tau->tauID("byTaNCfrTenthPercent"); |
988 |
– |
tf.idbyTaNC=tau->tauID("byTaNC"); |
989 |
– |
hbbInfo->tauInfo.push_back(tf); |
990 |
– |
} |
991 |
– |
|
992 |
– |
CompareJetPtMuons ptComparatorMu; |
993 |
– |
CompareJetPtElectrons ptComparatorE; |
994 |
– |
CompareJetPtTaus ptComparatorTau; |
995 |
– |
|
996 |
– |
std::sort(hbbInfo->muInfo.begin(), hbbInfo->muInfo.end(), ptComparatorMu); |
997 |
– |
std::sort(hbbInfo->eleInfo.begin(), hbbInfo->eleInfo.end(), ptComparatorE); |
998 |
– |
std::sort(hbbInfo->tauInfo.begin(), hbbInfo->tauInfo.end(), ptComparatorTau); |
999 |
– |
|
1000 |
– |
|
1264 |
|
|
1265 |
< |
|
1266 |
< |
if (verbose_){ |
1267 |
< |
std::cout <<" Pushing hbbInfo "<<std::endl; |
1268 |
< |
std::cout <<" SimpleJets1 = "<<hbbInfo->simpleJets.size()<<std::endl<< |
1269 |
< |
" SimpleJets2 = "<<hbbInfo->simpleJets2.size()<<std::endl<< |
1270 |
< |
" SubJets = "<<hbbInfo->subJets.size()<<std::endl<< |
1271 |
< |
" HardJets = "<<hbbInfo->hardJets.size()<<std::endl<< |
1272 |
< |
" Muons = "<<hbbInfo->muInfo.size()<<std::endl<< |
1273 |
< |
" Electrons = "<<hbbInfo->eleInfo.size()<<std::endl<< |
1274 |
< |
" Taus = "<<hbbInfo->tauInfo.size()<<std::endl<< |
1275 |
< |
" Electrons = "<<hbbInfo->eleInfo.size()<<std::endl<< |
1276 |
< |
"--------------------- "<<std::endl; |
1277 |
< |
} |
1278 |
< |
|
1279 |
< |
|
1280 |
< |
iEvent.put(hbbInfo); |
1281 |
< |
iEvent.put(auxInfo); |
1282 |
< |
|
1283 |
< |
|
1265 |
> |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetMuonEnUpHandle; |
1266 |
> |
iEvent.getByLabel("patType1CorrectedPFMetMuonEnUp",patType1CorrectedPFMetMuonEnUpHandle); |
1267 |
> |
edm::View<reco::MET> patType1CorrectedPFMetsMuonEnUp = *patType1CorrectedPFMetMuonEnUpHandle; |
1268 |
> |
if(patType1CorrectedPFMetsMuonEnUp.size()){ |
1269 |
> |
metunc.sumEt =(patType1CorrectedPFMetsMuonEnUp[0]).sumEt(); |
1270 |
> |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsMuonEnUp[0])); |
1271 |
> |
metunc.eLong=(patType1CorrectedPFMetsMuonEnUp[0]).e_longitudinal(); |
1272 |
> |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsMuonEnUp[0])); |
1273 |
> |
hbbInfo->metUncInfo.push_back(metunc); |
1274 |
> |
} |
1275 |
> |
|
1276 |
> |
|
1277 |
> |
|
1278 |
> |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetTauEnDownHandle; |
1279 |
> |
iEvent.getByLabel("patType1CorrectedPFMetTauEnDown",patType1CorrectedPFMetTauEnDownHandle); |
1280 |
> |
edm::View<reco::MET> patType1CorrectedPFMetsTauEnDown = *patType1CorrectedPFMetTauEnDownHandle; |
1281 |
> |
if(patType1CorrectedPFMetsTauEnDown.size()){ |
1282 |
> |
metunc.sumEt =(patType1CorrectedPFMetsTauEnDown[0]).sumEt(); |
1283 |
> |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsTauEnDown[0])); |
1284 |
> |
metunc.eLong=(patType1CorrectedPFMetsTauEnDown[0]).e_longitudinal(); |
1285 |
> |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsTauEnDown[0])); |
1286 |
> |
hbbInfo->metUncInfo.push_back(metunc); |
1287 |
> |
} |
1288 |
> |
|
1289 |
> |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetTauEnUpHandle; |
1290 |
> |
iEvent.getByLabel("patType1CorrectedPFMetTauEnUp",patType1CorrectedPFMetTauEnUpHandle); |
1291 |
> |
edm::View<reco::MET> patType1CorrectedPFMetsTauEnUp = *patType1CorrectedPFMetTauEnUpHandle; |
1292 |
> |
if(patType1CorrectedPFMetsTauEnUp.size()){ |
1293 |
> |
metunc.sumEt =(patType1CorrectedPFMetsTauEnUp[0]).sumEt(); |
1294 |
> |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsTauEnUp[0])); |
1295 |
> |
metunc.eLong=(patType1CorrectedPFMetsTauEnUp[0]).e_longitudinal(); |
1296 |
> |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsTauEnUp[0])); |
1297 |
> |
hbbInfo->metUncInfo.push_back(metunc); |
1298 |
> |
} |
1299 |
> |
|
1300 |
> |
|
1301 |
> |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetJetEnDownHandle; |
1302 |
> |
iEvent.getByLabel("patType1CorrectedPFMetJetEnDown",patType1CorrectedPFMetJetEnDownHandle); |
1303 |
> |
edm::View<reco::MET> patType1CorrectedPFMetsJetEnDown = *patType1CorrectedPFMetJetEnDownHandle; |
1304 |
> |
if(patType1CorrectedPFMetsJetEnDown.size()){ |
1305 |
> |
metunc.sumEt =(patType1CorrectedPFMetsJetEnDown[0]).sumEt(); |
1306 |
> |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsJetEnDown[0])); |
1307 |
> |
metunc.eLong=(patType1CorrectedPFMetsJetEnDown[0]).e_longitudinal(); |
1308 |
> |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsJetEnDown[0])); |
1309 |
> |
hbbInfo->metUncInfo.push_back(metunc); |
1310 |
> |
} |
1311 |
> |
|
1312 |
> |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetJetEnUpHandle; |
1313 |
> |
iEvent.getByLabel("patType1CorrectedPFMetJetEnUp",patType1CorrectedPFMetJetEnUpHandle); |
1314 |
> |
edm::View<reco::MET> patType1CorrectedPFMetsJetEnUp = *patType1CorrectedPFMetJetEnUpHandle; |
1315 |
> |
if(patType1CorrectedPFMetsJetEnUp.size()){ |
1316 |
> |
metunc.sumEt =(patType1CorrectedPFMetsJetEnUp[0]).sumEt(); |
1317 |
> |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsJetEnUp[0])); |
1318 |
> |
metunc.eLong=(patType1CorrectedPFMetsJetEnUp[0]).e_longitudinal(); |
1319 |
> |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsJetEnUp[0])); |
1320 |
> |
hbbInfo->metUncInfo.push_back(metunc); |
1321 |
> |
} |
1322 |
> |
|
1323 |
> |
|
1324 |
> |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetJetResDownHandle; |
1325 |
> |
iEvent.getByLabel("patType1CorrectedPFMetJetResDown",patType1CorrectedPFMetJetResDownHandle); |
1326 |
> |
edm::View<reco::MET> patType1CorrectedPFMetsJetResDown = *patType1CorrectedPFMetJetResDownHandle; |
1327 |
> |
if(patType1CorrectedPFMetsJetResDown.size()){ |
1328 |
> |
metunc.sumEt =(patType1CorrectedPFMetsJetResDown[0]).sumEt(); |
1329 |
> |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsJetResDown[0])); |
1330 |
> |
metunc.eLong=(patType1CorrectedPFMetsJetResDown[0]).e_longitudinal(); |
1331 |
> |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsJetResDown[0])); |
1332 |
> |
hbbInfo->metUncInfo.push_back(metunc); |
1333 |
> |
} |
1334 |
> |
|
1335 |
> |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetJetResUpHandle; |
1336 |
> |
iEvent.getByLabel("patType1CorrectedPFMetJetResUp",patType1CorrectedPFMetJetResUpHandle); |
1337 |
> |
edm::View<reco::MET> patType1CorrectedPFMetsJetResUp = *patType1CorrectedPFMetJetResUpHandle; |
1338 |
> |
if(patType1CorrectedPFMetsJetResUp.size()){ |
1339 |
> |
metunc.sumEt =(patType1CorrectedPFMetsJetResUp[0]).sumEt(); |
1340 |
> |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsJetResUp[0])); |
1341 |
> |
metunc.eLong=(patType1CorrectedPFMetsJetResUp[0]).e_longitudinal(); |
1342 |
> |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsJetResUp[0])); |
1343 |
> |
hbbInfo->metUncInfo.push_back(metunc); |
1344 |
> |
} |
1345 |
> |
|
1346 |
> |
|
1347 |
> |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetUnclusteredEnDownHandle; |
1348 |
> |
iEvent.getByLabel("patType1CorrectedPFMetUnclusteredEnDown",patType1CorrectedPFMetUnclusteredEnDownHandle); |
1349 |
> |
edm::View<reco::MET> patType1CorrectedPFMetsUnclusteredEnDown = *patType1CorrectedPFMetUnclusteredEnDownHandle; |
1350 |
> |
if(patType1CorrectedPFMetsUnclusteredEnDown.size()){ |
1351 |
> |
metunc.sumEt =(patType1CorrectedPFMetsUnclusteredEnDown[0]).sumEt(); |
1352 |
> |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsUnclusteredEnDown[0])); |
1353 |
> |
metunc.eLong=(patType1CorrectedPFMetsUnclusteredEnDown[0]).e_longitudinal(); |
1354 |
> |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsUnclusteredEnDown[0])); |
1355 |
> |
hbbInfo->metUncInfo.push_back(metunc); |
1356 |
> |
} |
1357 |
> |
|
1358 |
> |
edm::Handle<edm::View<reco::MET> > patType1CorrectedPFMetUnclusteredEnUpHandle; |
1359 |
> |
iEvent.getByLabel("patType1CorrectedPFMetUnclusteredEnUp",patType1CorrectedPFMetUnclusteredEnUpHandle); |
1360 |
> |
edm::View<reco::MET> patType1CorrectedPFMetsUnclusteredEnUp = *patType1CorrectedPFMetUnclusteredEnUpHandle; |
1361 |
> |
if(patType1CorrectedPFMetsUnclusteredEnUp.size()){ |
1362 |
> |
metunc.sumEt =(patType1CorrectedPFMetsUnclusteredEnUp[0]).sumEt(); |
1363 |
> |
metunc.metSig=metSignificance(& (patType1CorrectedPFMetsUnclusteredEnUp[0])); |
1364 |
> |
metunc.eLong=(patType1CorrectedPFMetsUnclusteredEnUp[0]).e_longitudinal(); |
1365 |
> |
metunc.p4=GENPTOLOR((patType1CorrectedPFMetsUnclusteredEnUp[0])); |
1366 |
> |
hbbInfo->metUncInfo.push_back(metunc); |
1367 |
> |
} |
1368 |
> |
|
1369 |
> |
|
1370 |
> |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetElectronEnDownHandle; |
1371 |
> |
iEvent.getByLabel("patType1p2CorrectedPFMetElectronEnDown",patType1p2CorrectedPFMetElectronEnDownHandle); |
1372 |
> |
edm::View<reco::MET> patType1p2CorrectedPFMetsElectronEnDown = *patType1p2CorrectedPFMetElectronEnDownHandle; |
1373 |
> |
if(patType1p2CorrectedPFMetsElectronEnDown.size()){ |
1374 |
> |
metunc.sumEt =(patType1p2CorrectedPFMetsElectronEnDown[0]).sumEt(); |
1375 |
> |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsElectronEnDown[0])); |
1376 |
> |
metunc.eLong=(patType1p2CorrectedPFMetsElectronEnDown[0]).e_longitudinal(); |
1377 |
> |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsElectronEnDown[0])); |
1378 |
> |
hbbInfo->metUncInfo.push_back(metunc); |
1379 |
> |
} |
1380 |
> |
|
1381 |
> |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetElectronEnUpHandle; |
1382 |
> |
iEvent.getByLabel("patType1p2CorrectedPFMetElectronEnUp",patType1p2CorrectedPFMetElectronEnUpHandle); |
1383 |
> |
edm::View<reco::MET> patType1p2CorrectedPFMetsElectronEnUp = *patType1p2CorrectedPFMetElectronEnUpHandle; |
1384 |
> |
if(patType1p2CorrectedPFMetsElectronEnUp.size()){ |
1385 |
> |
metunc.sumEt =(patType1p2CorrectedPFMetsElectronEnUp[0]).sumEt(); |
1386 |
> |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsElectronEnUp[0])); |
1387 |
> |
metunc.eLong=(patType1p2CorrectedPFMetsElectronEnUp[0]).e_longitudinal(); |
1388 |
> |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsElectronEnUp[0])); |
1389 |
> |
hbbInfo->metUncInfo.push_back(metunc); |
1390 |
> |
} |
1391 |
> |
|
1392 |
> |
|
1393 |
> |
|
1394 |
> |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetMuonEnDownHandle; |
1395 |
> |
iEvent.getByLabel("patType1p2CorrectedPFMetMuonEnDown",patType1p2CorrectedPFMetMuonEnDownHandle); |
1396 |
> |
edm::View<reco::MET> patType1p2CorrectedPFMetsMuonEnDown = *patType1p2CorrectedPFMetMuonEnDownHandle; |
1397 |
> |
if(patType1p2CorrectedPFMetsMuonEnDown.size()){ |
1398 |
> |
metunc.sumEt =(patType1p2CorrectedPFMetsMuonEnDown[0]).sumEt(); |
1399 |
> |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsMuonEnDown[0])); |
1400 |
> |
metunc.eLong=(patType1p2CorrectedPFMetsMuonEnDown[0]).e_longitudinal(); |
1401 |
> |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsMuonEnDown[0])); |
1402 |
> |
hbbInfo->metUncInfo.push_back(metunc); |
1403 |
> |
} |
1404 |
> |
|
1405 |
> |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetMuonEnUpHandle; |
1406 |
> |
iEvent.getByLabel("patType1p2CorrectedPFMetMuonEnUp",patType1p2CorrectedPFMetMuonEnUpHandle); |
1407 |
> |
edm::View<reco::MET> patType1p2CorrectedPFMetsMuonEnUp = *patType1p2CorrectedPFMetMuonEnUpHandle; |
1408 |
> |
if(patType1p2CorrectedPFMetsMuonEnUp.size()){ |
1409 |
> |
metunc.sumEt =(patType1p2CorrectedPFMetsMuonEnUp[0]).sumEt(); |
1410 |
> |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsMuonEnUp[0])); |
1411 |
> |
metunc.eLong=(patType1p2CorrectedPFMetsMuonEnUp[0]).e_longitudinal(); |
1412 |
> |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsMuonEnUp[0])); |
1413 |
> |
hbbInfo->metUncInfo.push_back(metunc); |
1414 |
> |
} |
1415 |
> |
|
1416 |
> |
|
1417 |
> |
|
1418 |
> |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetTauEnDownHandle; |
1419 |
> |
iEvent.getByLabel("patType1p2CorrectedPFMetTauEnDown",patType1p2CorrectedPFMetTauEnDownHandle); |
1420 |
> |
edm::View<reco::MET> patType1p2CorrectedPFMetsTauEnDown = *patType1p2CorrectedPFMetTauEnDownHandle; |
1421 |
> |
if(patType1p2CorrectedPFMetsTauEnDown.size()){ |
1422 |
> |
metunc.sumEt =(patType1p2CorrectedPFMetsTauEnDown[0]).sumEt(); |
1423 |
> |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsTauEnDown[0])); |
1424 |
> |
metunc.eLong=(patType1p2CorrectedPFMetsTauEnDown[0]).e_longitudinal(); |
1425 |
> |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsTauEnDown[0])); |
1426 |
> |
hbbInfo->metUncInfo.push_back(metunc); |
1427 |
> |
} |
1428 |
> |
|
1429 |
> |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetTauEnUpHandle; |
1430 |
> |
iEvent.getByLabel("patType1p2CorrectedPFMetTauEnUp",patType1p2CorrectedPFMetTauEnUpHandle); |
1431 |
> |
edm::View<reco::MET> patType1p2CorrectedPFMetsTauEnUp = *patType1p2CorrectedPFMetTauEnUpHandle; |
1432 |
> |
if(patType1p2CorrectedPFMetsTauEnUp.size()){ |
1433 |
> |
metunc.sumEt =(patType1p2CorrectedPFMetsTauEnUp[0]).sumEt(); |
1434 |
> |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsTauEnUp[0])); |
1435 |
> |
metunc.eLong=(patType1p2CorrectedPFMetsTauEnUp[0]).e_longitudinal(); |
1436 |
> |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsTauEnUp[0])); |
1437 |
> |
hbbInfo->metUncInfo.push_back(metunc); |
1438 |
> |
} |
1439 |
> |
|
1440 |
> |
|
1441 |
> |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetJetEnDownHandle; |
1442 |
> |
iEvent.getByLabel("patType1p2CorrectedPFMetJetEnDown",patType1p2CorrectedPFMetJetEnDownHandle); |
1443 |
> |
edm::View<reco::MET> patType1p2CorrectedPFMetsJetEnDown = *patType1p2CorrectedPFMetJetEnDownHandle; |
1444 |
> |
if(patType1p2CorrectedPFMetsJetEnDown.size()){ |
1445 |
> |
metunc.sumEt =(patType1p2CorrectedPFMetsJetEnDown[0]).sumEt(); |
1446 |
> |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsJetEnDown[0])); |
1447 |
> |
metunc.eLong=(patType1p2CorrectedPFMetsJetEnDown[0]).e_longitudinal(); |
1448 |
> |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsJetEnDown[0])); |
1449 |
> |
hbbInfo->metUncInfo.push_back(metunc); |
1450 |
> |
} |
1451 |
> |
|
1452 |
> |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetJetEnUpHandle; |
1453 |
> |
iEvent.getByLabel("patType1p2CorrectedPFMetJetEnUp",patType1p2CorrectedPFMetJetEnUpHandle); |
1454 |
> |
edm::View<reco::MET> patType1p2CorrectedPFMetsJetEnUp = *patType1p2CorrectedPFMetJetEnUpHandle; |
1455 |
> |
if(patType1p2CorrectedPFMetsJetEnUp.size()){ |
1456 |
> |
metunc.sumEt =(patType1p2CorrectedPFMetsJetEnUp[0]).sumEt(); |
1457 |
> |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsJetEnUp[0])); |
1458 |
> |
metunc.eLong=(patType1p2CorrectedPFMetsJetEnUp[0]).e_longitudinal(); |
1459 |
> |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsJetEnUp[0])); |
1460 |
> |
hbbInfo->metUncInfo.push_back(metunc); |
1461 |
> |
} |
1462 |
> |
|
1463 |
> |
|
1464 |
> |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetJetResDownHandle; |
1465 |
> |
iEvent.getByLabel("patType1p2CorrectedPFMetJetResDown",patType1p2CorrectedPFMetJetResDownHandle); |
1466 |
> |
edm::View<reco::MET> patType1p2CorrectedPFMetsJetResDown = *patType1p2CorrectedPFMetJetResDownHandle; |
1467 |
> |
if(patType1p2CorrectedPFMetsJetResDown.size()){ |
1468 |
> |
metunc.sumEt =(patType1p2CorrectedPFMetsJetResDown[0]).sumEt(); |
1469 |
> |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsJetResDown[0])); |
1470 |
> |
metunc.eLong=(patType1p2CorrectedPFMetsJetResDown[0]).e_longitudinal(); |
1471 |
> |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsJetResDown[0])); |
1472 |
> |
hbbInfo->metUncInfo.push_back(metunc); |
1473 |
> |
} |
1474 |
> |
|
1475 |
> |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetJetResUpHandle; |
1476 |
> |
iEvent.getByLabel("patType1p2CorrectedPFMetJetResUp",patType1p2CorrectedPFMetJetResUpHandle); |
1477 |
> |
edm::View<reco::MET> patType1p2CorrectedPFMetsJetResUp = *patType1p2CorrectedPFMetJetResUpHandle; |
1478 |
> |
if(patType1p2CorrectedPFMetsJetResUp.size()){ |
1479 |
> |
metunc.sumEt =(patType1p2CorrectedPFMetsJetResUp[0]).sumEt(); |
1480 |
> |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsJetResUp[0])); |
1481 |
> |
metunc.eLong=(patType1p2CorrectedPFMetsJetResUp[0]).e_longitudinal(); |
1482 |
> |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsJetResUp[0])); |
1483 |
> |
hbbInfo->metUncInfo.push_back(metunc); |
1484 |
> |
} |
1485 |
> |
|
1486 |
> |
|
1487 |
> |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetUnclusteredEnDownHandle; |
1488 |
> |
iEvent.getByLabel("patType1p2CorrectedPFMetUnclusteredEnDown",patType1p2CorrectedPFMetUnclusteredEnDownHandle); |
1489 |
> |
edm::View<reco::MET> patType1p2CorrectedPFMetsUnclusteredEnDown = *patType1p2CorrectedPFMetUnclusteredEnDownHandle; |
1490 |
> |
if(patType1p2CorrectedPFMetsUnclusteredEnDown.size()){ |
1491 |
> |
metunc.sumEt =(patType1p2CorrectedPFMetsUnclusteredEnDown[0]).sumEt(); |
1492 |
> |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsUnclusteredEnDown[0])); |
1493 |
> |
metunc.eLong=(patType1p2CorrectedPFMetsUnclusteredEnDown[0]).e_longitudinal(); |
1494 |
> |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsUnclusteredEnDown[0])); |
1495 |
> |
hbbInfo->metUncInfo.push_back(metunc); |
1496 |
> |
} |
1497 |
> |
|
1498 |
> |
edm::Handle<edm::View<reco::MET> > patType1p2CorrectedPFMetUnclusteredEnUpHandle; |
1499 |
> |
iEvent.getByLabel("patType1p2CorrectedPFMetUnclusteredEnUp",patType1p2CorrectedPFMetUnclusteredEnUpHandle); |
1500 |
> |
edm::View<reco::MET> patType1p2CorrectedPFMetsUnclusteredEnUp = *patType1p2CorrectedPFMetUnclusteredEnUpHandle; |
1501 |
> |
if(patType1p2CorrectedPFMetsUnclusteredEnUp.size()){ |
1502 |
> |
metunc.sumEt =(patType1p2CorrectedPFMetsUnclusteredEnUp[0]).sumEt(); |
1503 |
> |
metunc.metSig=metSignificance(& (patType1p2CorrectedPFMetsUnclusteredEnUp[0])); |
1504 |
> |
metunc.eLong=(patType1p2CorrectedPFMetsUnclusteredEnUp[0]).e_longitudinal(); |
1505 |
> |
metunc.p4=GENPTOLOR((patType1p2CorrectedPFMetsUnclusteredEnUp[0])); |
1506 |
> |
hbbInfo->metUncInfo.push_back(metunc); |
1507 |
> |
} |
1508 |
> |
|
1509 |
> |
|
1510 |
> |
|
1511 |
> |
// |
1512 |
> |
// met is calomet |
1513 |
> |
// |
1514 |
> |
|
1515 |
> |
edm::Handle<edm::View<pat::MET> > metTCHandle; |
1516 |
> |
iEvent.getByLabel("patMETsTC",metTCHandle); |
1517 |
> |
edm::View<pat::MET> metsTC = *metTCHandle; |
1518 |
> |
if(metsTC.size()){ |
1519 |
> |
hbbInfo->tcmet.sumEt=(metsTC[0]).sumEt(); |
1520 |
> |
hbbInfo->tcmet.metSig=metSignificance(&(metsTC[0])); |
1521 |
> |
hbbInfo->tcmet.eLong=(metsTC[0]).e_longitudinal(); |
1522 |
> |
hbbInfo->tcmet.p4=GENPTOLOR((metsTC[0])); |
1523 |
> |
if (verbose_) std::cout <<" METTC "<< hbbInfo->tcmet.metSig <<" " << hbbInfo->tcmet.sumEt<<std::endl; |
1524 |
> |
} |
1525 |
> |
|
1526 |
> |
edm::Handle<edm::View<reco::MET> > pfMETNoPUHandle; |
1527 |
> |
iEvent.getByLabel("pfMETNoPU",pfMETNoPUHandle); |
1528 |
> |
edm::View<reco::MET> metspfMETNoPU = *pfMETNoPUHandle; |
1529 |
> |
if(metspfMETNoPU.size()){ |
1530 |
> |
hbbInfo->metNoPU.sumEt=(metspfMETNoPU[0]).sumEt(); |
1531 |
> |
hbbInfo->metNoPU.metSig=metSignificance(&(metspfMETNoPU[0])); |
1532 |
> |
hbbInfo->metNoPU.eLong=(metspfMETNoPU[0]).e_longitudinal(); |
1533 |
> |
hbbInfo->metNoPU.p4=GENPTOLOR((metspfMETNoPU[0])); |
1534 |
> |
if (verbose_) std::cout <<" pfMETNoPU "<< hbbInfo->metNoPU.metSig <<" " << hbbInfo->metNoPU.sumEt<<std::endl; |
1535 |
> |
} |
1536 |
> |
|
1537 |
> |
edm::Handle<edm::View<reco::MET> > mHTHandle; |
1538 |
> |
iEvent.getByLabel("patMETsHT",mHTHandle); |
1539 |
> |
edm::View<reco::MET> metsHT = *mHTHandle; |
1540 |
> |
if(metsHT.size()){ |
1541 |
> |
hbbInfo->mht.sumEt=(metsHT[0]).sumEt(); |
1542 |
> |
hbbInfo->mht.metSig=metSignificance(&(metsHT[0])); |
1543 |
> |
hbbInfo->mht.eLong=(metsHT[0]).e_longitudinal(); |
1544 |
> |
hbbInfo->mht.p4=GENPTOLOR((metsHT[0])); |
1545 |
> |
if (verbose_) std::cout <<" METHT "<< hbbInfo->mht.metSig <<" " << hbbInfo->mht.sumEt<<std::endl; |
1546 |
> |
} |
1547 |
> |
|
1548 |
> |
edm::Handle<edm::View<reco::MET> > metHandle; |
1549 |
> |
iEvent.getByLabel(metLabel_,metHandle); |
1550 |
> |
edm::View<reco::MET> mets = *metHandle; |
1551 |
> |
|
1552 |
> |
if(mets.size()){ |
1553 |
> |
hbbInfo->calomet.sumEt=(mets[0]).sumEt(); |
1554 |
> |
hbbInfo->calomet.metSig=metSignificance(&(mets[0])); |
1555 |
> |
hbbInfo->calomet.eLong=(mets[0]).e_longitudinal(); |
1556 |
> |
hbbInfo->calomet.p4=GENPTOLOR((mets[0])); |
1557 |
> |
if (verbose_) std::cout <<" METCALO "<< hbbInfo->calomet.metSig <<" " << hbbInfo->calomet.sumEt<<std::endl; |
1558 |
> |
} |
1559 |
> |
|
1560 |
> |
edm::Handle<edm::View<pat::MET> > metPFHandle; |
1561 |
> |
iEvent.getByLabel("patMETsPFlow",metPFHandle); |
1562 |
> |
edm::View<pat::MET> metsPF = *metPFHandle; |
1563 |
> |
|
1564 |
> |
if(metsPF.size()){ |
1565 |
> |
hbbInfo->pfmet.sumEt=(metsPF[0]).sumEt(); |
1566 |
> |
hbbInfo->pfmet.metSig=metSignificance(&(metsPF[0])); |
1567 |
> |
hbbInfo->pfmet.eLong=(metsPF[0]).e_longitudinal(); |
1568 |
> |
hbbInfo->pfmet.p4=GENPTOLOR((metsPF[0])); |
1569 |
> |
if (verbose_) std::cout <<" METPF "<< hbbInfo->pfmet.metSig <<" " << hbbInfo->pfmet.sumEt<<std::endl; |
1570 |
> |
} |
1571 |
> |
|
1572 |
> |
|
1573 |
> |
if(verbose_){ |
1574 |
> |
std::cout << "METs: calomet "<<mets.size()<<" tcmet"<<metsTC.size()<<" pfmet "<<metsPF.size()<<" MHT" <<metsHT.size()<<std::endl; |
1575 |
> |
} |
1576 |
> |
|
1577 |
> |
if(verbose_) |
1578 |
> |
std::cout << " INPUT MUONS "<<muons.size()<<std::endl; |
1579 |
> |
|
1580 |
> |
for(edm::View<pat::Muon>::const_iterator mu = muons.begin(); mu!=muons.end(); ++mu){ |
1581 |
> |
VHbbEvent::MuonInfo mf; |
1582 |
> |
mf.p4 =GENPTOLORP( mu); |
1583 |
> |
mf.charge=mu->charge(); |
1584 |
> |
mf.tIso=mu->trackIso(); |
1585 |
> |
mf.eIso=mu->ecalIso(); |
1586 |
> |
mf.hIso=mu->hcalIso(); |
1587 |
> |
mf.pfChaIso=mu->chargedHadronIso(); |
1588 |
> |
mf.pfChaPUIso=mu->puChargedHadronIso(); //userIso(5); |
1589 |
> |
mf.pfPhoIso=mu->photonIso(); |
1590 |
> |
mf.pfNeuIso=mu->neutralHadronIso(); |
1591 |
> |
Geom::Phi<double> deltaphi(mu->phi()-atan2(mf.p4.Px(), mf.p4.Py())); |
1592 |
> |
double acop = deltaphi.value(); |
1593 |
> |
mf.acop=acop; |
1594 |
> |
|
1595 |
> |
mf.emEnergy = mu->calEnergy().em; |
1596 |
> |
mf.hadEnergy = mu->calEnergy().had; |
1597 |
> |
|
1598 |
> |
mf.nMatches = mu->numberOfMatches(); |
1599 |
> |
|
1600 |
> |
mf.ipDb=mu->dB(); |
1601 |
> |
mf.ipErrDb=mu->edB(); |
1602 |
> |
mf.cat=0; |
1603 |
> |
|
1604 |
> |
if(mu->isGlobalMuon()) mf.cat|=1; |
1605 |
> |
if(mu->isTrackerMuon()) mf.cat|=2; |
1606 |
> |
if(mu->isStandAloneMuon()) mf.cat|=4; |
1607 |
> |
TrackRef trkMu1Ref = mu->get<TrackRef>(); |
1608 |
> |
if(trkMu1Ref.isNonnull()){ |
1609 |
> |
const Track* MuTrk1 = mu->get<TrackRef>().get(); |
1610 |
> |
mf.zPVPt=MuTrk1->dz(RecVtxFirst.position()); |
1611 |
> |
mf.zPVProb=MuTrk1->dz(RecVtx.position()); |
1612 |
> |
mf.nHits=MuTrk1->numberOfValidHits(); |
1613 |
> |
mf.chi2=MuTrk1->normalizedChi2(); |
1614 |
> |
TrackRef iTrack1 = mu->innerTrack(); |
1615 |
> |
const reco::HitPattern& p1 = iTrack1->hitPattern(); |
1616 |
> |
mf.nPixelHits=p1.pixelLayersWithMeasurement(); |
1617 |
> |
|
1618 |
> |
mf.nValidTracker = p1.numberOfValidTrackerHits(); |
1619 |
> |
mf.nValidPixel = p1.numberOfValidPixelHits(); |
1620 |
> |
mf.nValidLayers = p1.trackerLayersWithMeasurement(); |
1621 |
> |
mf.isPF = mu->isPFMuon(); |
1622 |
> |
|
1623 |
> |
|
1624 |
> |
|
1625 |
> |
} |
1626 |
> |
if(mu->isGlobalMuon()){ |
1627 |
> |
TrackRef gTrack = mu->globalTrack(); |
1628 |
> |
const reco::HitPattern& q = gTrack->hitPattern(); |
1629 |
> |
mf.globChi2=gTrack.get()->normalizedChi2(); |
1630 |
> |
mf.globNHits=q.numberOfValidMuonHits(); |
1631 |
> |
mf.validMuStations = q.muonStationsWithValidHits(); |
1632 |
> |
}else{ |
1633 |
> |
mf.globChi2=-99; |
1634 |
> |
mf.globNHits=-99; |
1635 |
> |
} |
1636 |
> |
|
1637 |
> |
//Muon trigger matching |
1638 |
> |
for (int itrig = 0; itrig != ntrigs; ++itrig){ |
1639 |
> |
std::string trigName=triggerNames_.triggerName(itrig); |
1640 |
> |
if( (mu->triggerObjectMatchesByPath(trigName,false,false).size() != 0) ){ |
1641 |
> |
mf.hltMatchedBits.push_back(itrig); |
1642 |
> |
if(verbose_){ |
1643 |
> |
std::clog << "Trigger Matching box" << std::endl; |
1644 |
> |
std::clog << "+++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; |
1645 |
> |
std::clog << "Matching parameters are defined in the cfg" << std::endl; |
1646 |
> |
std::clog << "Trigger bit = " << itrig << std::endl; |
1647 |
> |
std::clog << "Trigger name = " << trigName << std::endl; |
1648 |
> |
std::clog << "Trigger object matched collection size = " << mu->triggerObjectMatchesByPath(trigName,false,false).size() << std::endl; |
1649 |
> |
std::clog << "Pat Muon pt = " << mf.p4.Pt() << " HLT object matched = " << mu->triggerObjectMatch(0)->p4().Pt() << std::endl; |
1650 |
> |
std::clog << "+++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; |
1651 |
> |
} |
1652 |
> |
} |
1653 |
> |
} |
1654 |
> |
// |
1655 |
> |
|
1656 |
> |
// add stamuon |
1657 |
> |
|
1658 |
> |
// if (mu->isStandAloneMuon()) { |
1659 |
> |
// reco::TrackRef sta = mu->standAloneMuon(); |
1660 |
> |
// |
1661 |
> |
// } |
1662 |
> |
|
1663 |
> |
|
1664 |
> |
// int muInfo[12]; |
1665 |
> |
// fillMuBlock(mu, muInfo); |
1666 |
> |
if(runOnMC_){ |
1667 |
> |
const GenParticle* muMc = mu->genLepton(); |
1668 |
> |
if(muMc!=0){ |
1669 |
> |
mf.mcId=muMc->pdgId(); |
1670 |
> |
mf.mcFourMomentum=GENPTOLORP(muMc); |
1671 |
> |
if(muMc->mother()!=0) mf.mcMomId=muMc->mother()->pdgId(); |
1672 |
> |
if(muMc->mother()!=0 && muMc->mother()->mother()!=0) mf.mcgMomId=muMc->mother()->mother()->pdgId(); |
1673 |
> |
} } |
1674 |
> |
hbbInfo->muInfo.push_back(mf); |
1675 |
> |
} |
1676 |
> |
|
1677 |
> |
if(verbose_) |
1678 |
> |
std::cout << " INPUT electrons "<<electrons.size()<<std::endl; |
1679 |
> |
InputTag reducedEBRecHitCollection(string("reducedEcalRecHitsEB")); |
1680 |
> |
InputTag reducedEERecHitCollection(string("reducedEcalRecHitsEE")); |
1681 |
> |
EcalClusterLazyTools lazyTools(iEvent, iSetup, reducedEBRecHitCollection, reducedEERecHitCollection); |
1682 |
> |
edm::ESHandle<TransientTrackBuilder> builder; |
1683 |
> |
iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder", builder); |
1684 |
> |
const TransientTrackBuilder & transientTrackBuilder= *(builder.product()); |
1685 |
> |
|
1686 |
> |
for(edm::View<pat::Electron>::const_iterator elec = electrons.begin(); elec!=electrons.end(); ++elec){ |
1687 |
> |
VHbbEvent::ElectronInfo ef; |
1688 |
> |
ef.p4=GENPTOLORP(elec); |
1689 |
> |
ef.scEta =elec->superCluster()->eta(); |
1690 |
> |
ef.scPhi =elec->superCluster()->phi(); |
1691 |
> |
// if(ElecEta[eleccont]!=0) ElecEt[eleccont]=elec->superCluster()->energy()/cosh(elec->superCluster()->eta()); |
1692 |
> |
ef.charge=elec->charge(); |
1693 |
> |
ef.tIso=elec->trackIso(); |
1694 |
> |
ef.eIso=elec->ecalIso(); |
1695 |
> |
ef.hIso=elec->hcalIso(); |
1696 |
> |
ef.pfChaIso=elec->chargedHadronIso(); |
1697 |
> |
ef.pfChaPUIso=elec->puChargedHadronIso();//userIso(5); |
1698 |
> |
ef.pfPhoIso=elec->photonIso(); |
1699 |
> |
ef.pfPhoIsoDoubleCounted=0; |
1700 |
> |
|
1701 |
> |
/* Check if there are photons sharing the super cluster*/ |
1702 |
> |
for(size_t k=0;k<photonsForIso.size();k++) { |
1703 |
> |
if(deltaR(elec->eta(),elec->phi(),photonsForIso[k].eta(),photonsForIso[k].phi()) < 0.05 && abs(photonsForIso[k].pt()-elec->pt())/(photonsForIso[k].pt()+elec->pt()) < 0.05 ) { |
1704 |
> |
std::cout << "Double counting of supercluster!" << std::endl; |
1705 |
> |
ef.pfPhoIsoDoubleCounted+=photonsForIso[k].pt(); |
1706 |
> |
} |
1707 |
> |
} |
1708 |
> |
ef.pfNeuIso=elec->neutralHadronIso(); |
1709 |
> |
|
1710 |
> |
// |
1711 |
> |
// ip info |
1712 |
> |
// |
1713 |
> |
|
1714 |
> |
ef.ipDb=elec->dB(); |
1715 |
> |
ef.ipErrDb=elec->edB(); |
1716 |
> |
|
1717 |
> |
|
1718 |
> |
|
1719 |
> |
Geom::Phi<double> deltaphi(elec->superCluster()->phi()-atan2(hbbInfo->pfmet.p4.Py(),hbbInfo->pfmet.p4.Px())); |
1720 |
> |
ef.acop = deltaphi.value(); |
1721 |
> |
// |
1722 |
> |
ef.sihih = elec->sigmaIetaIeta(); |
1723 |
> |
ef.Dphi = elec->deltaPhiSuperClusterTrackAtVtx(); |
1724 |
> |
ef.Deta = elec->deltaEtaSuperClusterTrackAtVtx(); |
1725 |
> |
ef.HoE = elec->hadronicOverEm(); |
1726 |
> |
ef.convDist = elec->convDist(); |
1727 |
> |
ef.convDcot = elec->convDcot(); |
1728 |
> |
if(elec->gsfTrack().isNonnull()) |
1729 |
> |
{ |
1730 |
> |
ef.innerHits = elec->gsfTrack()->trackerExpectedHitsInner().numberOfHits(); |
1731 |
> |
} |
1732 |
> |
ef.isEB = elec->isEB(); |
1733 |
> |
ef.isEE = elec->isEE(); |
1734 |
> |
/* 2012 ELEID*/ |
1735 |
> |
|
1736 |
> |
const pat::Electron & ele = *elec; |
1737 |
> |
bool validKF= false; |
1738 |
> |
reco::TrackRef myTrackRef = ele.closestCtfTrackRef(); |
1739 |
> |
validKF = (myTrackRef.isAvailable()); |
1740 |
> |
validKF = (myTrackRef.isNonnull()); |
1741 |
> |
|
1742 |
> |
// Pure tracking variables |
1743 |
> |
ef.fMVAVar_fbrem = ele.fbrem(); |
1744 |
> |
ef.fMVAVar_kfchi2 = (validKF) ? myTrackRef->normalizedChi2() : 0 ; |
1745 |
> |
ef.fMVAVar_kfhits = (validKF) ? myTrackRef->hitPattern().trackerLayersWithMeasurement() : -1. ; |
1746 |
> |
// fMVAVar_kfhitsall = (validKF) ? myTrackRef->numberOfValidHits() : -1. ; // save also this in your ntuple as possible alternative |
1747 |
> |
ef.fMVAVar_gsfchi2 = ele.gsfTrack()->normalizedChi2(); |
1748 |
> |
|
1749 |
> |
|
1750 |
> |
// Geometrical matchings |
1751 |
> |
ef.fMVAVar_deta = ele.deltaEtaSuperClusterTrackAtVtx(); |
1752 |
> |
ef.fMVAVar_dphi = ele.deltaPhiSuperClusterTrackAtVtx(); |
1753 |
> |
ef.fMVAVar_detacalo = ele.deltaEtaSeedClusterTrackAtCalo(); |
1754 |
> |
// fMVAVar_dphicalo = ele.deltaPhiSeedClusterTrackAtCalo(); // save also this in your ntuple |
1755 |
> |
|
1756 |
> |
|
1757 |
> |
// Pure ECAL -> shower shapes |
1758 |
> |
ef.fMVAVar_see = ele.sigmaIetaIeta(); //EleSigmaIEtaIEta |
1759 |
> |
std::vector<float> vCov = lazyTools.localCovariances(*(ele.superCluster()->seed())) ; |
1760 |
> |
if (!isnan(vCov[2])) ef.fMVAVar_spp = sqrt (vCov[2]); //EleSigmaIPhiIPhi |
1761 |
> |
else ef.fMVAVar_spp = 0.; |
1762 |
> |
// fMVAVar_sigmaIEtaIPhi = vCov[1]; // save also this in your ntuple |
1763 |
> |
|
1764 |
> |
ef.fMVAVar_etawidth = ele.superCluster()->etaWidth(); |
1765 |
> |
ef.fMVAVar_phiwidth = ele.superCluster()->phiWidth(); |
1766 |
> |
ef.fMVAVar_e1x5e5x5 = (ele.e5x5()) !=0. ? 1.-(ele.e1x5()/ele.e5x5()) : -1. ; |
1767 |
> |
ef.fMVAVar_R9 = lazyTools.e3x3(*(ele.superCluster()->seed())) / ele.superCluster()->rawEnergy(); |
1768 |
> |
//fMVAVar_nbrems = fabs(ele.numberOfBrems()); // save also this in your ntuple |
1769 |
> |
|
1770 |
> |
// Energy matching |
1771 |
> |
ef.fMVAVar_HoE = ele.hadronicOverEm(); |
1772 |
> |
ef.fMVAVar_EoP = ele.eSuperClusterOverP(); |
1773 |
> |
// fMVAVar_IoEmIoP = (1.0/(ele.superCluster()->energy())) - (1.0 / ele.p()); // in the future to be changed with ele.gsfTrack()->p() |
1774 |
> |
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 |
1775 |
> |
|
1776 |
> |
ef.fMVAVar_eleEoPout = ele.eEleClusterOverPout(); |
1777 |
> |
ef.fMVAVar_PreShowerOverRaw= ele.superCluster()->preshowerEnergy() / ele.superCluster()->rawEnergy(); |
1778 |
> |
// fMVAVar_EoPout = ele.eSeedClusterOverPout(); // save also this in your ntuple |
1779 |
> |
|
1780 |
> |
|
1781 |
> |
// Spectators |
1782 |
> |
ef.fMVAVar_eta = ele.superCluster()->eta(); |
1783 |
> |
ef.fMVAVar_pt = ele.pt(); |
1784 |
> |
|
1785 |
> |
//additional for cut based |
1786 |
> |
ef.dxy = elec->gsfTrack()->dxy(vertex.position()); |
1787 |
> |
ef.dz = elec->gsfTrack()->dz(vertex.position()); |
1788 |
> |
|
1789 |
> |
|
1790 |
> |
//d0 |
1791 |
> |
if (ele.gsfTrack().isNonnull()) { |
1792 |
> |
ef.fMVAVar_d0 = (-1.0)*ele.gsfTrack()->dxy(vertex.position()); |
1793 |
> |
} else if (ele.closestCtfTrackRef().isNonnull()) { |
1794 |
> |
ef.fMVAVar_d0 = (-1.0)*ele.closestCtfTrackRef()->dxy(vertex.position()); |
1795 |
> |
} else { |
1796 |
> |
ef.fMVAVar_d0 = -9999.0; |
1797 |
> |
|
1798 |
> |
//default values for IP3D |
1799 |
> |
ef.fMVAVar_ip3d = -999.0; |
1800 |
> |
// fMVAVar_ip3dSig = 0.0; |
1801 |
> |
if (ele.gsfTrack().isNonnull()) { |
1802 |
> |
const double gsfsign = ( (-ele.gsfTrack()->dxy(vertex.position())) >=0 ) ? 1. : -1.; |
1803 |
> |
|
1804 |
> |
const reco::TransientTrack &tt = transientTrackBuilder.build(ele.gsfTrack()); |
1805 |
> |
const std::pair<bool,Measurement1D> &ip3dpv = IPTools::absoluteImpactParameter3D(tt,vertex); |
1806 |
> |
if (ip3dpv.first) { |
1807 |
> |
double ip3d = gsfsign*ip3dpv.second.value(); |
1808 |
> |
//double ip3derr = ip3dpv.second.error(); |
1809 |
> |
ef.fMVAVar_ip3d = ip3d; |
1810 |
> |
// fMVAVar_ip3dSig = ip3d/ip3derr; |
1811 |
> |
} |
1812 |
> |
} |
1813 |
> |
} |
1814 |
> |
|
1815 |
> |
|
1816 |
> |
/* end of 2012 ELEID*/ |
1817 |
> |
|
1818 |
> |
// |
1819 |
> |
// fill eleids |
1820 |
> |
// |
1821 |
> |
/* ef.id95 = elec->electronID("simpleEleId95cIso"); |
1822 |
> |
ef.id85 = elec->electronID("simpleEleId85cIso"); |
1823 |
> |
ef.id70 = elec->electronID("simpleEleId70cIso"); |
1824 |
> |
ef.id95r = elec->electronID("simpleEleId95relIso"); |
1825 |
> |
ef.id70r = elec->electronID("simpleEleId70relIso"); |
1826 |
> |
ef.id85r = elec->electronID("simpleEleId85relIso"); |
1827 |
> |
*/ |
1828 |
> |
ef.id95 =elec->electronID("eidVBTFCom95"); |
1829 |
> |
ef.id95r=elec->electronID("eidVBTFRel95"); |
1830 |
> |
ef.id85 =elec->electronID("eidVBTFCom85"); |
1831 |
> |
ef.id85r=elec->electronID("eidVBTFRel85"); |
1832 |
> |
ef.id80 =elec->electronID("eidVBTFCom80"); |
1833 |
> |
ef.id80r=elec->electronID("eidVBTFRel80"); |
1834 |
> |
ef.id70 =elec->electronID("eidVBTFCom70"); |
1835 |
> |
ef.id70r=elec->electronID("eidVBTFRel70"); |
1836 |
> |
ef.mvaOut=elec->electronID("mvaNonTrigV0"); |
1837 |
> |
ef.mvaOutTrig=elec->electronID("mvaTrigV0"); |
1838 |
> |
|
1839 |
> |
//Electron trigger matching |
1840 |
> |
for (int itrig = 0; itrig != ntrigs; ++itrig){ |
1841 |
> |
std::string trigName=triggerNames_.triggerName(itrig); |
1842 |
> |
if( (elec->triggerObjectMatchesByPath(trigName).size() != 0) ){ |
1843 |
> |
ef.hltMatchedBits.push_back(itrig); |
1844 |
> |
if(verbose_){ |
1845 |
> |
std::clog << "Trigger Matching box" << std::endl; |
1846 |
> |
std::clog << "+++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; |
1847 |
> |
std::clog << "Matching parameters are defined in the cfg" << std::endl; |
1848 |
> |
std::clog << "Trigger bit = " << itrig << std::endl; |
1849 |
> |
std::clog << "Trigger name = " << trigName << std::endl; |
1850 |
> |
std::clog << "Trigger object matched collection size = " << elec->triggerObjectMatchesByPath(trigName).size() << std::endl; |
1851 |
> |
std::clog << "Pat Electron pt = " << ef.p4.Pt() << " HLT object matched = " << elec->triggerObjectMatch(0)->p4().Pt() << std::endl; |
1852 |
> |
std::clog << "+++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; |
1853 |
> |
} |
1854 |
> |
} |
1855 |
> |
} |
1856 |
> |
|
1857 |
> |
if(runOnMC_){ |
1858 |
> |
const GenParticle* elecMc = elec->genLepton(); |
1859 |
> |
if(elecMc!=0){ |
1860 |
> |
ef.mcId=elecMc->pdgId(); |
1861 |
> |
ef.mcFourMomentum=GENPTOLORP(elecMc); |
1862 |
> |
if(elecMc->mother()!=0) ef.mcMomId=elecMc->mother()->pdgId(); |
1863 |
> |
if(elecMc->mother()!=0 && elecMc->mother()->mother()!=0) ef.mcgMomId=elecMc->mother()->mother()->pdgId(); |
1864 |
> |
}} |
1865 |
> |
hbbInfo->eleInfo.push_back(ef); |
1866 |
> |
} |
1867 |
> |
|
1868 |
> |
if(verbose_) |
1869 |
> |
std::cout << " INPUT taus "<<taus.size()<<std::endl; |
1870 |
> |
for(edm::View<pat::Tau>::const_iterator tau = taus.begin(); tau!=taus.end(); ++tau){ |
1871 |
> |
VHbbEvent::TauInfo tf; |
1872 |
> |
tf.p4=GENPTOLORP(tau); |
1873 |
> |
tf.charge=tau->charge(); |
1874 |
> |
tf.tIso=tau->trackIso(); |
1875 |
> |
tf.eIso=tau->ecalIso(); |
1876 |
> |
tf.hIso=tau->hcalIso(); |
1877 |
> |
Geom::Phi<double> deltaphi(tau->phi()-atan2(hbbInfo->pfmet.p4.Py(),hbbInfo->pfmet.p4.Px())); |
1878 |
> |
double acop = deltaphi.value(); |
1879 |
> |
tf.acop=acop; |
1880 |
> |
if (tau->isTauIDAvailable("againstElectronLoose")) tf.againstElectronLoose=tau->tauID("againstElectronLoose"); |
1881 |
> |
if (tau->isTauIDAvailable("againstElectronMedium")) tf.againstElectronMedium=tau->tauID("againstElectronMedium"); |
1882 |
> |
if (tau->isTauIDAvailable("againstElectronTight")) tf.againstElectronTight=tau->tauID("againstElectronTight"); |
1883 |
> |
if (tau->isTauIDAvailable("againstMuonLoose")) tf.againstMuonLoose=tau->tauID("againstMuonLoose"); |
1884 |
> |
if (tau->isTauIDAvailable("againstMuonTight")) tf.againstMuonTight=tau->tauID("againstMuonTight"); |
1885 |
> |
if (tau->isTauIDAvailable("byLooseIsolation")) tf.byLooseIsolation=tau->tauID("byLooseIsolation"); |
1886 |
> |
if (tau->isTauIDAvailable("byMediumIsolation")) tf.byMediumIsolation=tau->tauID("byMediumIsolation"); |
1887 |
> |
if (tau->isTauIDAvailable("byTightIsolation")) tf.byTightIsolation=tau->tauID("byTightIsolation"); |
1888 |
> |
if (tau->isTauIDAvailable("byVLooseIsolation")) tf.byVLooseIsolation=tau->tauID("byVLooseIsolation"); |
1889 |
> |
if (tau->isTauIDAvailable("decayModeFinding")) tf.decayModeFinding=tau->tauID("decayModeFinding"); |
1890 |
> |
if (tau->isTauIDAvailable("byIsolation")) tf.byIsolation=tau->tauID("byIsolation"); |
1891 |
> |
if (tau->isTauIDAvailable("trackIsolation")) tf.trackIsolation=tau->tauID("trackIsolation"); |
1892 |
> |
if (tau->isTauIDAvailable("byTaNCfrOnePercent")) tf.byTaNCfrOnePercent=tau->tauID("byTaNCfrOnePercent"); |
1893 |
> |
if (tau->isTauIDAvailable("byTaNCfrHalfPercent")) tf.byTaNCfrHalfPercent=tau->tauID("byTaNCfrHalfPercent"); |
1894 |
> |
if (tau->isTauIDAvailable("byTaNCfrQuarterPercent")) tf.byTaNCfrQuarterPercent=tau->tauID("byTaNCfrQuarterPercent"); |
1895 |
> |
if (tau->isTauIDAvailable("byTaNCfrTenthPercent")) tf.byTaNCfrTenthPercent=tau->tauID("byTaNCfrTenthPercent"); |
1896 |
> |
if (tau->isTauIDAvailable("byTaNC")) tf.byTaNC=tau->tauID("byTaNC"); |
1897 |
> |
if (tau->isTauIDAvailable("byLooseCombinedIsolationDeltaBetaCorr")) tf.byLooseCombinedIsolationDeltaBetaCorr=tau->tauID("byLooseCombinedIsolationDeltaBetaCorr"); |
1898 |
> |
if (tau->isTauIDAvailable("againstElectronMVA")) tf.againstElectronMVA=tau->tauID("againstElectronMVA"); |
1899 |
> |
if (tau->isPFTau()) { |
1900 |
> |
tf.isolationPFChargedHadrCandsPtSum = tau->isolationPFChargedHadrCandsPtSum(); |
1901 |
> |
tf.isolationPFGammaCandsEtSum = tau->isolationPFGammaCandsEtSum(); |
1902 |
> |
if (tau->leadPFChargedHadrCand().isAvailable()) tf.leadPFChargedHadrCandPt = tau->leadPFChargedHadrCand()->pt(); |
1903 |
> |
tf.NsignalPFChargedHadrCands = tau->signalPFChargedHadrCands().size(); |
1904 |
> |
tf.NsignalPFGammaCands = tau->signalPFGammaCands().size(); |
1905 |
> |
} |
1906 |
> |
hbbInfo->tauInfo.push_back(tf); |
1907 |
> |
if (verbose_) { |
1908 |
> |
std::cout << "SCZ DEBUG: againstElectronLoose is " << tf.againstElectronLoose << std::endl; |
1909 |
> |
std::cout << "SCZ DEBUG: againstElectronMedium is " << tf.againstElectronMedium << std::endl; |
1910 |
> |
std::cout << "SCZ DEBUG: againstElectronTight is " << tf.againstElectronTight << std::endl; |
1911 |
> |
std::cout << "SCZ DEBUG: againstMuonLoose is " << tf.againstMuonLoose << std::endl; |
1912 |
> |
std::cout << "SCZ DEBUG: againstMuonTight is " << tf.againstMuonTight << std::endl; |
1913 |
> |
std::cout << "SCZ DEBUG: byLooseIsolation is " << tf.byLooseIsolation << std::endl; |
1914 |
> |
std::cout << "SCZ DEBUG: byMediumIsolation is " << tf.byMediumIsolation << std::endl; |
1915 |
> |
std::cout << "SCZ DEBUG: byTightIsolation is " << tf.byTightIsolation << std::endl; |
1916 |
> |
std::cout << "SCZ DEBUG: byVLooseIsolation is " << tf.byVLooseIsolation << std::endl; |
1917 |
> |
std::cout << "SCZ DEBUG: decayModeFinding is " << tf.decayModeFinding << std::endl; |
1918 |
> |
std::cout << "SCZ DEBUG: byIsolation is " << tf.byIsolation<< std::endl; |
1919 |
> |
std::cout << "SCZ DEBUG: trackIsolation is " << tf.trackIsolation << std::endl; |
1920 |
> |
std::cout << "SCZ DEBUG: byTaNCfrOnePercent is " << tf.byTaNCfrOnePercent << std::endl; |
1921 |
> |
std::cout << "SCZ DEBUG: byTaNCfrHalfPercent is " << tf.byTaNCfrHalfPercent << std::endl; |
1922 |
> |
std::cout << "SCZ DEBUG: byTaNCfrQuarterPercent is " << tf.byTaNCfrQuarterPercent << std::endl; |
1923 |
> |
std::cout << "SCZ DEBUG: byTaNCfrTenthPercent is " << tf.byTaNCfrTenthPercent << std::endl; |
1924 |
> |
std::cout << "SCZ DEBUG: byTaNC is " << tf.byTaNC << std::endl; |
1925 |
> |
std::cout << "SCZ DEBUG: isolationPFChargedHadrCandsPtSum is " << tf.isolationPFChargedHadrCandsPtSum << std::endl; |
1926 |
> |
std::cout << "SCZ DEBUG: isolationPFGammaCandsEtSum is " << tf.isolationPFGammaCandsEtSum << std::endl; |
1927 |
> |
std::cout << "SCZ DEBUG: isolationPFGammaCandsEtSum is " << tf.leadPFChargedHadrCandPt << std::endl; |
1928 |
> |
std::cout << "SCZ DEBUG: NsignalPFChargedHadrCands is " << tf.NsignalPFChargedHadrCands << std::endl; |
1929 |
> |
std::cout << "SCZ DEBUG: NsignalPFGammaCands is " << tf.NsignalPFGammaCands << std::endl; |
1930 |
> |
std::cout << "SCZ DEBUG: byLooseCombinedIsolationDeltaBetaCorr is " << tf.byLooseCombinedIsolationDeltaBetaCorr << std::endl; |
1931 |
> |
std::cout << "SCZ DEBUG: againstElectronMVA is " << tf.againstElectronMVA << std::endl; |
1932 |
> |
} |
1933 |
> |
} |
1934 |
> |
|
1935 |
> |
CompareJetPtMuons ptComparatorMu; |
1936 |
> |
CompareJetPtElectrons ptComparatorE; |
1937 |
> |
CompareJetPtTaus ptComparatorTau; |
1938 |
> |
|
1939 |
> |
std::sort(hbbInfo->muInfo.begin(), hbbInfo->muInfo.end(), ptComparatorMu); |
1940 |
> |
std::sort(hbbInfo->eleInfo.begin(), hbbInfo->eleInfo.end(), ptComparatorE); |
1941 |
> |
std::sort(hbbInfo->tauInfo.begin(), hbbInfo->tauInfo.end(), ptComparatorTau); |
1942 |
> |
|
1943 |
> |
|
1944 |
> |
|
1945 |
> |
|
1946 |
> |
if (verbose_){ |
1947 |
> |
std::cout <<" Pushing hbbInfo "<<std::endl; |
1948 |
> |
std::cout <<" SimpleJets1 = "<<hbbInfo->simpleJets.size()<<std::endl<< |
1949 |
> |
" SimpleJets2 = "<<hbbInfo->simpleJets2.size()<<std::endl<< |
1950 |
> |
" SubJets = "<<hbbInfo->subJets.size()<<std::endl<< |
1951 |
> |
" HardJets = "<<hbbInfo->hardJets.size()<<std::endl<< |
1952 |
> |
" FilterJets = "<<hbbInfo->filterJets.size()<<std::endl<< |
1953 |
> |
" Muons = "<<hbbInfo->muInfo.size()<<std::endl<< |
1954 |
> |
" Electrons = "<<hbbInfo->eleInfo.size()<<std::endl<< |
1955 |
> |
" Taus = "<<hbbInfo->tauInfo.size()<<std::endl<< |
1956 |
> |
" Electrons = "<<hbbInfo->eleInfo.size()<<std::endl<< |
1957 |
> |
"--------------------- "<<std::endl; |
1958 |
> |
} |
1959 |
> |
|
1960 |
> |
|
1961 |
> |
iEvent.put(hbbInfo); |
1962 |
> |
iEvent.put(auxInfo); |
1963 |
> |
|
1964 |
> |
|
1965 |
> |
delete jecUnc; |
1966 |
> |
|
1967 |
|
} |
1968 |
< |
|
1968 |
> |
|
1969 |
|
void |
1970 |
|
HbbAnalyzerNew::fillMuBlock(edm::View<pat::Muon>::const_iterator mu, int muInfo[15]) |
1971 |
|
{ |
1972 |
< |
if(muon::isGoodMuon(*mu,muon::TMLastStationLoose)) muInfo[0]=1; |
1973 |
< |
if(muon::isGoodMuon(*mu,muon::TMLastStationTight)) muInfo[1]=1; |
1974 |
< |
if(muon::isGoodMuon(*mu,muon::TM2DCompatibilityLoose)) muInfo[2]=1; |
1975 |
< |
if(muon::isGoodMuon(*mu,muon::TM2DCompatibilityTight)) muInfo[3]=1; |
1976 |
< |
if(muon::isGoodMuon(*mu,muon::TMOneStationLoose)) muInfo[4]=1; |
1977 |
< |
if(muon::isGoodMuon(*mu,muon::TMOneStationTight)) muInfo[5]=1; |
1978 |
< |
if(muon::isGoodMuon(*mu,muon::TMLastStationOptimizedLowPtLoose)) muInfo[6]=1; |
1979 |
< |
if(muon::isGoodMuon(*mu,muon::TMLastStationOptimizedLowPtTight))muInfo[7]=1; |
1980 |
< |
if(muon::isGoodMuon(*mu,muon::TMOneStationAngLoose)) muInfo[8]=1; |
1981 |
< |
if(muon::isGoodMuon(*mu,muon::TMOneStationAngTight)) muInfo[9]=1; |
1982 |
< |
if(muon::isGoodMuon(*mu,muon::TMLastStationAngLoose)) muInfo[10]=1; |
1983 |
< |
if(muon::isGoodMuon(*mu,muon::TMLastStationAngTight)) muInfo[11]=1; |
1984 |
< |
if(muon::isGoodMuon(*mu,muon::GMTkChiCompatibility)) muInfo[12]=1; |
1985 |
< |
if(muon::isGoodMuon(*mu,muon::GMStaChiCompatibility)) muInfo[13]=1; |
1986 |
< |
if(muon::isGoodMuon(*mu,muon::GMTkKinkTight)) muInfo[14]=1; |
1972 |
> |
if(muon::isGoodMuon(*mu,muon::TMLastStationLoose)) muInfo[0]=1; |
1973 |
> |
if(muon::isGoodMuon(*mu,muon::TMLastStationTight)) muInfo[1]=1; |
1974 |
> |
if(muon::isGoodMuon(*mu,muon::TM2DCompatibilityLoose)) muInfo[2]=1; |
1975 |
> |
if(muon::isGoodMuon(*mu,muon::TM2DCompatibilityTight)) muInfo[3]=1; |
1976 |
> |
if(muon::isGoodMuon(*mu,muon::TMOneStationLoose)) muInfo[4]=1; |
1977 |
> |
if(muon::isGoodMuon(*mu,muon::TMOneStationTight)) muInfo[5]=1; |
1978 |
> |
if(muon::isGoodMuon(*mu,muon::TMLastStationOptimizedLowPtLoose)) muInfo[6]=1; |
1979 |
> |
if(muon::isGoodMuon(*mu,muon::TMLastStationOptimizedLowPtTight))muInfo[7]=1; |
1980 |
> |
if(muon::isGoodMuon(*mu,muon::TMOneStationAngLoose)) muInfo[8]=1; |
1981 |
> |
if(muon::isGoodMuon(*mu,muon::TMOneStationAngTight)) muInfo[9]=1; |
1982 |
> |
if(muon::isGoodMuon(*mu,muon::TMLastStationAngLoose)) muInfo[10]=1; |
1983 |
> |
if(muon::isGoodMuon(*mu,muon::TMLastStationAngTight)) muInfo[11]=1; |
1984 |
> |
if(muon::isGoodMuon(*mu,muon::GMTkChiCompatibility)) muInfo[12]=1; |
1985 |
> |
if(muon::isGoodMuon(*mu,muon::GMStaChiCompatibility)) muInfo[13]=1; |
1986 |
> |
if(muon::isGoodMuon(*mu,muon::GMTkKinkTight)) muInfo[14]=1; |
1987 |
|
} |
1988 |
|
|
1989 |
< |
// ------------ method called once each job just before starting event loop ------------ |
1989 |
> |
// ------------ method called once each job just before starting event loop ------------ |
1990 |
|
void |
1991 |
|
HbbAnalyzerNew::beginJob(){ |
1992 |
|
} |
1993 |
|
|
1994 |
|
|
1995 |
< |
// ------------ method called once each job just after ending the event loop ------------ |
1995 |
> |
// ------------ method called once each job just after ending the event loop ------------ |
1996 |
|
void |
1997 |
|
HbbAnalyzerNew::endJob() { |
1998 |
|
} |
1999 |
|
|
2000 |
|
TVector2 HbbAnalyzerNew::getTvect( const pat::Jet* patJet ){ |
2001 |
< |
|
2002 |
< |
TVector2 t_Vect(0,0); |
2003 |
< |
TVector2 null(0,0); |
2004 |
< |
TVector2 ci(0,0); |
2005 |
< |
TLorentzVector pi(0,0,0,0); |
2006 |
< |
TLorentzVector J(0,0,0,0); |
2007 |
< |
TVector2 r(0,0); |
2008 |
< |
double patJetpfcPt = 1e10; |
2009 |
< |
double r_mag = 1e10; |
2010 |
< |
unsigned int nOfconst = 0; |
2011 |
< |
|
2012 |
< |
|
2013 |
< |
if (patJet->isPFJet() == false) { |
2014 |
< |
return t_Vect; |
2015 |
< |
} |
2016 |
< |
|
2017 |
< |
|
2018 |
< |
//re-reconstruct the jet direction with the charged tracks |
2019 |
< |
std::vector<reco::PFCandidatePtr> |
2001 |
> |
|
2002 |
> |
TVector2 t_Vect(0,0); |
2003 |
> |
TVector2 null(0,0); |
2004 |
> |
TVector2 ci(0,0); |
2005 |
> |
TLorentzVector pi(0,0,0,0); |
2006 |
> |
TLorentzVector J(0,0,0,0); |
2007 |
> |
TVector2 r(0,0); |
2008 |
> |
double patJetpfcPt = 1e10; |
2009 |
> |
double r_mag = 1e10; |
2010 |
> |
unsigned int nOfconst = 0; |
2011 |
> |
|
2012 |
> |
|
2013 |
> |
if (patJet->isPFJet() == false) { |
2014 |
> |
return t_Vect; |
2015 |
> |
} |
2016 |
> |
|
2017 |
> |
|
2018 |
> |
//re-reconstruct the jet direction with the charged tracks |
2019 |
> |
std::vector<reco::PFCandidatePtr> |
2020 |
|
patJetpfc = patJet->getPFConstituents(); |
2021 |
< |
for(size_t idx = 0; idx < patJetpfc.size(); idx++){ |
2022 |
< |
if( patJetpfc.at(idx)->charge() != 0 ){ |
2023 |
< |
pi.SetPtEtaPhiE( patJetpfc.at(idx)->pt(), patJetpfc.at(idx)->eta(), patJetpfc.at(idx)->phi(), patJetpfc.at(idx)->energy() ); |
2024 |
< |
J += pi; |
2025 |
< |
nOfconst++; |
2026 |
< |
} |
2027 |
< |
} |
2028 |
< |
// if there are less than two charged tracks do not calculate the pull (there is not enough info). It returns a null vector |
2029 |
< |
|
2030 |
< |
if( nOfconst < 2 ) |
2031 |
< |
return null; |
2032 |
< |
|
2033 |
< |
|
2034 |
< |
|
2035 |
< |
TVector2 v_J( J.Rapidity(), J.Phi() ); |
2036 |
< |
//calculate TVector using only charged tracks |
2037 |
< |
for(size_t idx = 0; idx < patJetpfc.size(); idx++){ |
2038 |
< |
if( patJetpfc.at(idx)->charge() != 0 ){ |
2039 |
< |
patJetpfcPt = patJetpfc.at(idx)->pt(); |
2040 |
< |
pi.SetPtEtaPhiE( patJetpfc.at(idx)->pt(), patJetpfc.at(idx)->eta(), patJetpfc.at(idx)->phi(), patJetpfc.at(idx)->energy() ); |
2041 |
< |
r.Set( pi.Rapidity() - J.Rapidity(), Geom::deltaPhi( patJetpfc.at(idx)->phi(), J.Phi() ) ); |
2042 |
< |
r_mag = r.Mod(); |
2043 |
< |
t_Vect += ( patJetpfcPt / J.Pt() ) * r_mag * r; |
2044 |
< |
} |
2045 |
< |
} |
2046 |
< |
|
2047 |
< |
|
2048 |
< |
return t_Vect; |
2049 |
< |
|
2021 |
> |
for(size_t idx = 0; idx < patJetpfc.size(); idx++){ |
2022 |
> |
if( patJetpfc.at(idx)->charge() != 0 ){ |
2023 |
> |
pi.SetPtEtaPhiE( patJetpfc.at(idx)->pt(), patJetpfc.at(idx)->eta(), patJetpfc.at(idx)->phi(), patJetpfc.at(idx)->energy() ); |
2024 |
> |
J += pi; |
2025 |
> |
nOfconst++; |
2026 |
> |
} |
2027 |
> |
} |
2028 |
> |
// if there are less than two charged tracks do not calculate the pull (there is not enough info). It returns a null vector |
2029 |
> |
|
2030 |
> |
if( nOfconst < 2 ) |
2031 |
> |
return null; |
2032 |
> |
|
2033 |
> |
|
2034 |
> |
|
2035 |
> |
TVector2 v_J( J.Rapidity(), J.Phi() ); |
2036 |
> |
//calculate TVector using only charged tracks |
2037 |
> |
for(size_t idx = 0; idx < patJetpfc.size(); idx++){ |
2038 |
> |
if( patJetpfc.at(idx)->charge() != 0 ){ |
2039 |
> |
patJetpfcPt = patJetpfc.at(idx)->pt(); |
2040 |
> |
pi.SetPtEtaPhiE( patJetpfc.at(idx)->pt(), patJetpfc.at(idx)->eta(), patJetpfc.at(idx)->phi(), patJetpfc.at(idx)->energy() ); |
2041 |
> |
r.Set( pi.Rapidity() - J.Rapidity(), Geom::deltaPhi( patJetpfc.at(idx)->phi(), J.Phi() ) ); |
2042 |
> |
r_mag = r.Mod(); |
2043 |
> |
t_Vect += ( patJetpfcPt / J.Pt() ) * r_mag * r; |
2044 |
> |
} |
2045 |
> |
} |
2046 |
> |
|
2047 |
> |
|
2048 |
> |
return t_Vect; |
2049 |
> |
|
2050 |
|
} |
2051 |
|
|
2052 |
|
TLorentzVector HbbAnalyzerNew::getChargedTracksMomentum(const pat::Jet* patJet ){ |
2053 |
< |
// return TLorentzVector(); |
2054 |
< |
TLorentzVector pi(0,0,0,0); |
2055 |
< |
TLorentzVector v_j1(0,0,0,0); |
2056 |
< |
|
2057 |
< |
|
2058 |
< |
// std::cout <<"fff ECCCCCCOOOOO "<<patJet->isPFJet()<<std::endl; |
2059 |
< |
|
2060 |
< |
if (patJet->isPFJet() == false ){ |
2061 |
< |
v_j1 = GENPTOLORP(patJet); |
2062 |
< |
return v_j1; |
2063 |
< |
} |
2064 |
< |
std::vector<reco::PFCandidatePtr> |
2053 |
> |
// return TLorentzVector(); |
2054 |
> |
TLorentzVector pi(0,0,0,0); |
2055 |
> |
TLorentzVector v_j1(0,0,0,0); |
2056 |
> |
|
2057 |
> |
|
2058 |
> |
// std::cout <<"fff ECCCCCCOOOOO "<<patJet->isPFJet()<<std::endl; |
2059 |
> |
|
2060 |
> |
if (patJet->isPFJet() == false ){ |
2061 |
> |
v_j1 = GENPTOLORP(patJet); |
2062 |
> |
return v_j1; |
2063 |
> |
} |
2064 |
> |
std::vector<reco::PFCandidatePtr> |
2065 |
|
j1pfc = patJet->getPFConstituents(); |
2066 |
< |
for(size_t idx = 0; idx < j1pfc.size(); idx++){ |
2067 |
< |
if( j1pfc.at(idx)->charge() != 0 ){ |
2068 |
< |
pi.SetPtEtaPhiE( j1pfc.at(idx)->pt(), j1pfc.at(idx)->eta(), j1pfc.at(idx)->phi(), j1pfc.at(idx)->energy() ); |
2069 |
< |
v_j1 += pi; |
2070 |
< |
} |
2071 |
< |
} |
2072 |
< |
return v_j1; |
2073 |
< |
//re- |
2066 |
> |
for(size_t idx = 0; idx < j1pfc.size(); idx++){ |
2067 |
> |
if( j1pfc.at(idx)->charge() != 0 ){ |
2068 |
> |
pi.SetPtEtaPhiE( j1pfc.at(idx)->pt(), j1pfc.at(idx)->eta(), j1pfc.at(idx)->phi(), j1pfc.at(idx)->energy() ); |
2069 |
> |
v_j1 += pi; |
2070 |
> |
} |
2071 |
> |
} |
2072 |
> |
return v_j1; |
2073 |
> |
//re- |
2074 |
|
} |
2075 |
|
|
2076 |
|
|
2077 |
< |
//Btagging scale factors |
2077 |
> |
//Btagging scale factors |
2078 |
|
void HbbAnalyzerNew::fillScaleFactors(VHbbEvent::SimpleJet& sj, BTagSFContainer iSF){ |
2079 |
< |
|
2080 |
< |
|
2081 |
< |
BinningPointByMap measurePoint; |
2082 |
< |
//for a USDG |
2083 |
< |
//for CB jets |
2084 |
< |
//scale factor 1 for CB jets over 240GeV/c |
2085 |
< |
if( TMath::Abs(sj.flavour) == 4 or TMath::Abs(sj.flavour) == 5 ){ |
2086 |
< |
measurePoint.insert( BinningVariables::JetEt, sj.p4.Et() ); |
2087 |
< |
measurePoint.insert( BinningVariables::JetAbsEta, fabs(sj.p4.Eta()) ); |
2088 |
< |
if( iSF.BTAGSF_CSVL->isResultOk(PerformanceResult::BTAGBEFFCORR , measurePoint) ){ |
2089 |
< |
sj.SF_CSVL = iSF.BTAGSF_CSVL->getResult(PerformanceResult::BTAGBEFFCORR , measurePoint); |
2090 |
< |
sj.SF_CSVLerr = iSF.BTAGSF_CSVL->getResult(PerformanceResult::BTAGBERRCORR , measurePoint); |
2091 |
< |
if(verbose_){ |
2092 |
< |
std::clog << "C/B Jet flavour = " << sj.flavour << std::endl; |
2093 |
< |
std::clog << "C/B Jet Et = " << sj.p4.Et() << std::endl; |
2094 |
< |
std::clog << "C/B Jet eta = " << sj.p4.Eta() << std::endl; |
2095 |
< |
std::clog << "C/B CSVL Scale Factor = " << sj.SF_CSVL << std::endl; |
2096 |
< |
std::clog << "C/B CSVL Scale Factor error = " << sj.SF_CSVLerr << std::endl; |
2097 |
< |
} |
2098 |
< |
} |
2099 |
< |
if( iSF.BTAGSF_CSVM->isResultOk(PerformanceResult::BTAGBEFFCORR , measurePoint) ){ |
2100 |
< |
sj.SF_CSVM = iSF.BTAGSF_CSVM->getResult(PerformanceResult::BTAGBEFFCORR , measurePoint); |
2101 |
< |
sj.SF_CSVMerr = iSF.BTAGSF_CSVM->getResult(PerformanceResult::BTAGBERRCORR , measurePoint); |
2102 |
< |
} |
2103 |
< |
if( iSF.BTAGSF_CSVT->isResultOk(PerformanceResult::BTAGBEFFCORR , measurePoint) ){ |
2104 |
< |
sj.SF_CSVT = iSF.BTAGSF_CSVT->getResult(PerformanceResult::BTAGBEFFCORR , measurePoint); |
2105 |
< |
sj.SF_CSVTerr = iSF.BTAGSF_CSVT->getResult(PerformanceResult::BTAGBERRCORR , measurePoint); |
2106 |
< |
} |
2107 |
< |
else{ |
2108 |
< |
if(verbose_){ |
2109 |
< |
std::cerr << "No SF found in the database for this jet" << std::endl; |
2110 |
< |
std::clog << "No SF found: Jet flavour = " << sj.flavour << std::endl; |
2111 |
< |
std::clog << "No SF found: Jet Et = " << sj.p4.Et() << std::endl; |
2112 |
< |
std::clog << "No SF found: Jet eta = " << sj.p4.Eta() << std::endl; |
2113 |
< |
} |
2114 |
< |
} |
2115 |
< |
} |
2116 |
< |
else { |
2117 |
< |
measurePoint.insert( BinningVariables::JetEt, sj.p4.Et() ); |
2118 |
< |
measurePoint.insert( BinningVariables::JetAbsEta, fabs(sj.p4.Eta()) ); |
2119 |
< |
if( iSF.MISTAGSF_CSVL->isResultOk(PerformanceResult::BTAGLEFFCORR , measurePoint) ){ |
2120 |
< |
sj.SF_CSVL = iSF.MISTAGSF_CSVL->getResult(PerformanceResult::BTAGLEFFCORR , measurePoint); |
2121 |
< |
sj.SF_CSVLerr = iSF.MISTAGSF_CSVL->getResult(PerformanceResult::BTAGLERRCORR , measurePoint); |
2122 |
< |
if(verbose_){ |
2123 |
< |
std::clog << "Light Jet flavour = " << sj.flavour << std::endl; |
2124 |
< |
std::clog << "Light Jet Et = " << sj.p4.Et() << std::endl; |
2125 |
< |
std::clog << "Light Jet eta = " << sj.p4.Eta() << std::endl; |
2126 |
< |
std::clog << "Light CSVL Scale Factor = " << sj.SF_CSVL << std::endl; |
2127 |
< |
std::clog << "Light CSVL Scale Factor error = " << sj.SF_CSVLerr << std::endl; |
2128 |
< |
} |
2129 |
< |
} |
2130 |
< |
if( iSF.MISTAGSF_CSVM->isResultOk(PerformanceResult::BTAGLEFFCORR , measurePoint) ){ |
2131 |
< |
sj.SF_CSVM = iSF.MISTAGSF_CSVM->getResult(PerformanceResult::BTAGLEFFCORR , measurePoint); |
2132 |
< |
sj.SF_CSVMerr = iSF.MISTAGSF_CSVM->getResult(PerformanceResult::BTAGLERRCORR , measurePoint); |
2133 |
< |
} |
2134 |
< |
if( iSF.MISTAGSF_CSVT->isResultOk(PerformanceResult::BTAGLEFFCORR , measurePoint) ){ |
2135 |
< |
sj.SF_CSVT = iSF.MISTAGSF_CSVT->getResult(PerformanceResult::BTAGLEFFCORR , measurePoint); |
2136 |
< |
sj.SF_CSVTerr = iSF.MISTAGSF_CSVT->getResult(PerformanceResult::BTAGLERRCORR , measurePoint); |
2137 |
< |
} |
2138 |
< |
else{ |
2139 |
< |
if(verbose_){ |
2140 |
< |
std::cerr << "No SF found in the database for this jet" << std::endl; |
2141 |
< |
std::clog << "No SF found: Jet flavour = " << sj.flavour << std::endl; |
2142 |
< |
std::clog << "No SF found: Jet Et = " << sj.p4.Et() << std::endl; |
2143 |
< |
std::clog << "No SF found: Jet eta = " << sj.p4.Eta() << std::endl; |
2144 |
< |
} |
2079 |
> |
|
2080 |
> |
|
2081 |
> |
BinningPointByMap measurePoint; |
2082 |
> |
//for a USDG |
2083 |
> |
//for CB jets |
2084 |
> |
//scale factor 1 for CB jets over 240GeV/c |
2085 |
> |
if( TMath::Abs(sj.flavour) == 4 or TMath::Abs(sj.flavour) == 5 ){ |
2086 |
> |
measurePoint.insert( BinningVariables::JetEt, sj.p4.Et() ); |
2087 |
> |
measurePoint.insert( BinningVariables::JetAbsEta, fabs(sj.p4.Eta()) ); |
2088 |
> |
if( iSF.BTAGSF_CSVL->isResultOk(PerformanceResult::BTAGBEFFCORR , measurePoint) ){ |
2089 |
> |
sj.SF_CSVL = iSF.BTAGSF_CSVL->getResult(PerformanceResult::BTAGBEFFCORR , measurePoint); |
2090 |
> |
sj.SF_CSVLerr = iSF.BTAGSF_CSVL->getResult(PerformanceResult::BTAGBERRCORR , measurePoint); |
2091 |
> |
if(verbose_){ |
2092 |
> |
std::clog << "C/B Jet flavour = " << sj.flavour << std::endl; |
2093 |
> |
std::clog << "C/B Jet Et = " << sj.p4.Et() << std::endl; |
2094 |
> |
std::clog << "C/B Jet eta = " << sj.p4.Eta() << std::endl; |
2095 |
> |
std::clog << "C/B CSVL Scale Factor = " << sj.SF_CSVL << std::endl; |
2096 |
> |
std::clog << "C/B CSVL Scale Factor error = " << sj.SF_CSVLerr << std::endl; |
2097 |
> |
} |
2098 |
> |
} |
2099 |
> |
if( iSF.BTAGSF_CSVM->isResultOk(PerformanceResult::BTAGBEFFCORR , measurePoint) ){ |
2100 |
> |
sj.SF_CSVM = iSF.BTAGSF_CSVM->getResult(PerformanceResult::BTAGBEFFCORR , measurePoint); |
2101 |
> |
sj.SF_CSVMerr = iSF.BTAGSF_CSVM->getResult(PerformanceResult::BTAGBERRCORR , measurePoint); |
2102 |
> |
} |
2103 |
> |
if( iSF.BTAGSF_CSVT->isResultOk(PerformanceResult::BTAGBEFFCORR , measurePoint) ){ |
2104 |
> |
sj.SF_CSVT = iSF.BTAGSF_CSVT->getResult(PerformanceResult::BTAGBEFFCORR , measurePoint); |
2105 |
> |
sj.SF_CSVTerr = iSF.BTAGSF_CSVT->getResult(PerformanceResult::BTAGBERRCORR , measurePoint); |
2106 |
> |
} |
2107 |
> |
else{ |
2108 |
> |
if(verbose_){ |
2109 |
> |
std::cerr << "No SF found in the database for this jet" << std::endl; |
2110 |
> |
std::clog << "No SF found: Jet flavour = " << sj.flavour << std::endl; |
2111 |
> |
std::clog << "No SF found: Jet Et = " << sj.p4.Et() << std::endl; |
2112 |
> |
std::clog << "No SF found: Jet eta = " << sj.p4.Eta() << std::endl; |
2113 |
> |
} |
2114 |
> |
} |
2115 |
> |
} |
2116 |
> |
else { |
2117 |
> |
measurePoint.insert( BinningVariables::JetEt, sj.p4.Et() ); |
2118 |
> |
measurePoint.insert( BinningVariables::JetAbsEta, fabs(sj.p4.Eta()) ); |
2119 |
> |
if( iSF.MISTAGSF_CSVL->isResultOk(PerformanceResult::BTAGLEFFCORR , measurePoint) ){ |
2120 |
> |
sj.SF_CSVL = iSF.MISTAGSF_CSVL->getResult(PerformanceResult::BTAGLEFFCORR , measurePoint); |
2121 |
> |
sj.SF_CSVLerr = iSF.MISTAGSF_CSVL->getResult(PerformanceResult::BTAGLERRCORR , measurePoint); |
2122 |
> |
if(verbose_){ |
2123 |
> |
std::clog << "Light Jet flavour = " << sj.flavour << std::endl; |
2124 |
> |
std::clog << "Light Jet Et = " << sj.p4.Et() << std::endl; |
2125 |
> |
std::clog << "Light Jet eta = " << sj.p4.Eta() << std::endl; |
2126 |
> |
std::clog << "Light CSVL Scale Factor = " << sj.SF_CSVL << std::endl; |
2127 |
> |
std::clog << "Light CSVL Scale Factor error = " << sj.SF_CSVLerr << std::endl; |
2128 |
> |
} |
2129 |
> |
} |
2130 |
> |
if( iSF.MISTAGSF_CSVM->isResultOk(PerformanceResult::BTAGLEFFCORR , measurePoint) ){ |
2131 |
> |
sj.SF_CSVM = iSF.MISTAGSF_CSVM->getResult(PerformanceResult::BTAGLEFFCORR , measurePoint); |
2132 |
> |
sj.SF_CSVMerr = iSF.MISTAGSF_CSVM->getResult(PerformanceResult::BTAGLERRCORR , measurePoint); |
2133 |
> |
} |
2134 |
> |
if( iSF.MISTAGSF_CSVT->isResultOk(PerformanceResult::BTAGLEFFCORR , measurePoint) ){ |
2135 |
> |
sj.SF_CSVT = iSF.MISTAGSF_CSVT->getResult(PerformanceResult::BTAGLEFFCORR , measurePoint); |
2136 |
> |
sj.SF_CSVTerr = iSF.MISTAGSF_CSVT->getResult(PerformanceResult::BTAGLERRCORR , measurePoint); |
2137 |
> |
} |
2138 |
> |
else{ |
2139 |
> |
if(verbose_){ |
2140 |
> |
std::cerr << "No SF found in the database for this jet" << std::endl; |
2141 |
> |
std::clog << "No SF found: Jet flavour = " << sj.flavour << std::endl; |
2142 |
> |
std::clog << "No SF found: Jet Et = " << sj.p4.Et() << std::endl; |
2143 |
> |
std::clog << "No SF found: Jet eta = " << sj.p4.Eta() << std::endl; |
2144 |
> |
} |
2145 |
> |
} |
2146 |
|
} |
1200 |
– |
} |
2147 |
|
|
2148 |
|
} |
2149 |
|
|
2150 |
|
void HbbAnalyzerNew::setJecUnc(VHbbEvent::SimpleJet& sj,JetCorrectionUncertainty* jecunc){ |
2151 |
< |
// |
2152 |
< |
// test |
2153 |
< |
// |
2154 |
< |
|
2155 |
< |
// return; |
2156 |
< |
double eta = sj.p4.Eta(); |
2157 |
< |
double pt = sj.p4.Pt(); |
2158 |
< |
|
2159 |
< |
jecunc->setJetEta(eta); |
2160 |
< |
jecunc->setJetPt(pt); // here you must use the CORRECTED jet pt |
2161 |
< |
double unc = jecunc->getUncertainty(true); |
2162 |
< |
sj.jecunc= unc; |
2151 |
> |
// |
2152 |
> |
// test |
2153 |
> |
// |
2154 |
> |
|
2155 |
> |
// return; |
2156 |
> |
double eta = sj.p4.Eta(); |
2157 |
> |
double pt = sj.p4.Pt(); |
2158 |
> |
|
2159 |
> |
jecunc->setJetEta(eta); |
2160 |
> |
jecunc->setJetPt(pt); // here you must use the CORRECTED jet pt |
2161 |
> |
double unc = jecunc->getUncertainty(true); |
2162 |
> |
sj.jecunc= unc; |
2163 |
|
} |
2164 |
|
|
2165 |
|
|
2166 |
|
void HbbAnalyzerNew ::fillSimpleJet (VHbbEvent::SimpleJet& sj, edm::View<pat::Jet>::const_iterator jet_iter){ |
2167 |
< |
sj.flavour = jet_iter->partonFlavour(); |
2168 |
< |
|
2167 |
> |
sj.flavour = jet_iter->partonFlavour(); |
2168 |
> |
|
2169 |
|
sj.tche=jet_iter->bDiscriminator("trackCountingHighEffBJetTags"); |
2170 |
|
sj.tchp=jet_iter->bDiscriminator("trackCountingHighPurBJetTags"); |
2171 |
|
sj.jp=jet_iter->bDiscriminator("jetProbabilityBJetTags"); |
2172 |
|
sj.jpb=jet_iter->bDiscriminator("jetBProbabilityBJetTags"); |
2173 |
|
sj.ssvhe=jet_iter->bDiscriminator("simpleSecondaryVertexHighEffBJetTags"); |
2174 |
|
sj.csv=jet_iter->bDiscriminator("combinedSecondaryVertexBJetTags"); |
2175 |
< |
sj.csvmva=jet_iter->bDiscriminator("combinedSecondaryVertexMVABJetTags"); |
2175 |
> |
sj.csvmva=jet_iter->bDiscriminator("combinedSecondaryVertexMVABJetTags"); |
2176 |
> |
sj.csvivf=jet_iter->bDiscriminator("combinedInclusiveSecondaryVertexBJetTags"); |
2177 |
> |
sj.cmva=jet_iter->bDiscriminator("combinedMVABJetTags"); |
2178 |
|
sj.charge=jet_iter->jetCharge(); |
2179 |
|
sj.ntracks=jet_iter->associatedTracks().size(); |
2180 |
|
sj.p4=GENPTOLORP(jet_iter); |
2181 |
< |
// std::cout << " ECCO "<<sj.csv<< " "<< sj.p4.Pt()<<std::endl; |
2181 |
> |
// std::cout << " ECCO "<<sj.csv<< " "<< sj.p4.Pt()<<std::endl; |
2182 |
|
sj.chargedTracksFourMomentum=(getChargedTracksMomentum(&*(jet_iter))); |
2183 |
|
sj.SF_CSVL=1; |
2184 |
|
sj.SF_CSVM=1; |
2186 |
|
sj.SF_CSVLerr=0; |
2187 |
|
sj.SF_CSVMerr=0; |
2188 |
|
sj.SF_CSVTerr=0; |
2189 |
< |
|
2189 |
> |
|
2190 |
> |
|
2191 |
> |
|
2192 |
> |
|
2193 |
|
|
2194 |
|
if (jet_iter->isPFJet() == true) { |
2195 |
< |
|
2196 |
< |
sj.chargedHadronEFraction = jet_iter-> chargedHadronEnergyFraction(); |
2197 |
< |
sj.neutralHadronEFraction = jet_iter-> neutralHadronEnergyFraction (); |
2198 |
< |
sj.chargedEmEFraction = jet_iter-> chargedEmEnergyFraction (); |
2199 |
< |
sj.neutralEmEFraction = jet_iter-> neutralEmEnergyFraction (); |
2200 |
< |
sj.nConstituents = jet_iter->getPFConstituents().size(); |
2201 |
< |
|
2202 |
< |
} |
2203 |
< |
// |
2204 |
< |
// addtaginfo for csv |
2205 |
< |
// |
2206 |
< |
|
2207 |
< |
// if (jet_iter->hasTagInfo("SimpleSecondaryVertex")) { |
2208 |
< |
|
2195 |
> |
|
2196 |
> |
sj.chargedHadronEFraction = jet_iter-> chargedHadronEnergyFraction(); |
2197 |
> |
sj.neutralHadronEFraction = jet_iter-> neutralHadronEnergyFraction (); |
2198 |
> |
sj.chargedEmEFraction = jet_iter-> chargedEmEnergyFraction (); |
2199 |
> |
sj.neutralEmEFraction = jet_iter-> neutralEmEnergyFraction (); |
2200 |
> |
sj.nConstituents = jet_iter->getPFConstituents().size(); |
2201 |
> |
|
2202 |
> |
} |
2203 |
> |
sj.jetArea = jet_iter->jetArea(); |
2204 |
> |
// |
2205 |
> |
// addtaginfo for csv |
2206 |
> |
// |
2207 |
> |
|
2208 |
> |
// if (jet_iter->hasTagInfo("SimpleSecondaryVertex")) { |
2209 |
> |
|
2210 |
|
const reco::SecondaryVertexTagInfo * tf = jet_iter->tagInfoSecondaryVertex(); |
2211 |
< |
if (tf){ |
2212 |
< |
if (tf->nVertices() >0){ |
2213 |
< |
sj.vtxMass = tf->secondaryVertex(0).p4().mass(); |
2214 |
< |
sj.vtxNTracks = tf->secondaryVertex(0).nTracks(); |
2215 |
< |
std::vector<reco::TrackBaseRef >::const_iterator tit = tf->secondaryVertex(0).tracks_begin(); |
2216 |
< |
for (; tit< tf->secondaryVertex(0).tracks_end(); ++tit){ |
2217 |
< |
sj.vtxTrackIds.push_back(tit->key()); |
2218 |
< |
} |
2219 |
< |
Measurement1D m = tf->flightDistance(0); |
2220 |
< |
sj.vtx3dL = m.value(); |
2221 |
< |
sj.vtx3deL = m.error(); |
2222 |
< |
} |
2211 |
> |
if (tf){ |
2212 |
> |
math::XYZTLorentzVectorD vertexSum; |
2213 |
> |
for(size_t vi=0;vi< tf->nVertices();vi++) |
2214 |
> |
{ |
2215 |
> |
vertexSum+=tf->secondaryVertex(vi).p4(); |
2216 |
> |
} |
2217 |
> |
sj.vtxP4 = GENPTOLOR(vertexSum); |
2218 |
> |
|
2219 |
> |
if (tf->nVertices() >0){ |
2220 |
> |
sj.vtxPosition = TVector3(tf->secondaryVertex(0).position().x(),tf->secondaryVertex(0).position().y(),tf->secondaryVertex(0).position().z()); |
2221 |
> |
sj.vtxMass = tf->secondaryVertex(0).p4().mass(); |
2222 |
> |
sj.vtxNTracks = tf->secondaryVertex(0).nTracks(); |
2223 |
> |
std::vector<reco::TrackBaseRef >::const_iterator tit = tf->secondaryVertex(0).tracks_begin(); |
2224 |
> |
for (; tit< tf->secondaryVertex(0).tracks_end(); ++tit){ |
2225 |
> |
sj.vtxTrackIds.push_back(tit->key()); |
2226 |
> |
} |
2227 |
> |
Measurement1D m = tf->flightDistance(0); |
2228 |
> |
sj.vtx3dL = m.value(); |
2229 |
> |
sj.vtx3deL = m.error(); |
2230 |
> |
} |
2231 |
|
} |
2232 |
< |
// |
2233 |
< |
// add tVector |
2234 |
< |
// |
2232 |
> |
|
2233 |
> |
// CSV track info |
2234 |
> |
const reco::SecondaryVertexTagInfo * svTagInfos = jet_iter->tagInfoSecondaryVertex(); |
2235 |
> |
const reco::TrackIPTagInfo * ipTagInfos = jet_iter->tagInfoTrackIP(); |
2236 |
> |
for (edm::RefVector<reco::TrackCollection>::const_iterator t = ipTagInfos->selectedTracks().begin(); t != ipTagInfos->selectedTracks().end(); t++){ |
2237 |
> |
sj.btagTrackIds.push_back(t->key()); |
2238 |
> |
}// all btag IP selected tracks |
2239 |
> |
std::vector<const reco::BaseTagInfo*> tagInfos; |
2240 |
> |
tagInfos.push_back(dynamic_cast<const reco::BaseTagInfo*>(ipTagInfos)); |
2241 |
> |
tagInfos.push_back(dynamic_cast<const reco::BaseTagInfo*>(svTagInfos)); |
2242 |
> |
JetTagComputer::TagInfoHelper helper(tagInfos); |
2243 |
> |
reco::TaggingVariableList varList = computer->taggingVariables(helper); // computer for getting CSV variables |
2244 |
> |
|
2245 |
> |
for(reco::TaggingVariableList::const_iterator iter = varList.begin(); iter != varList.end(); ++iter) |
2246 |
> |
{ |
2247 |
> |
//std::cout << reco::TaggingVariableTokens[iter->first] << " = " << iter->second << std::endl; |
2248 |
> |
for (edm::RefVector<reco::TrackCollection>::const_iterator t = ipTagInfos->selectedTracks().begin(); t != ipTagInfos->selectedTracks().end(); t++){ |
2249 |
> |
|
2250 |
> |
if (strcmp(reco::TaggingVariableTokens[iter->first], "trackMomentum") == 0 && (fabs((float)iter->second - (float)(*t)->p()) < 0.0001) ){ |
2251 |
> |
sj.csvTrackIds.push_back(t->key()); |
2252 |
> |
}// if tagged track |
2253 |
> |
}// loop on IPtracks |
2254 |
> |
}// loop on CSV variables |
2255 |
> |
|
2256 |
> |
|
2257 |
> |
sj.btagNTracks= ipTagInfos->selectedTracks().size(); |
2258 |
> |
sj.csvNTracks = sj.csvTrackIds.size(); |
2259 |
> |
|
2260 |
> |
// |
2261 |
> |
// add tVector |
2262 |
> |
// |
2263 |
|
sj.tVector = getTvect(&(*jet_iter)); |
2264 |
+ |
|
2265 |
+ |
sj.ptRaw = jet_iter->correctedJet(0).pt(); |
2266 |
+ |
|
2267 |
+ |
sj.ptLeadTrack =-9999.; |
2268 |
+ |
if (jet_iter->isPFJet() == true) { |
2269 |
+ |
std::vector <reco::PFCandidatePtr> constituents = jet_iter->getPFConstituents (); |
2270 |
+ |
for (unsigned ic = 0; ic < constituents.size (); ++ic) { |
2271 |
+ |
if ( constituents[ic]->particleId() > 3 ) continue; |
2272 |
+ |
reco::TrackRef trackRef = constituents[ic]->trackRef(); |
2273 |
+ |
if ( trackRef.isNonnull() ) { if(trackRef->pt() > sj.ptLeadTrack) sj.ptLeadTrack=trackRef->pt(); } |
2274 |
+ |
} |
2275 |
+ |
} |
2276 |
+ |
|
2277 |
+ |
|
2278 |
+ |
} |
2279 |
+ |
|
2280 |
+ |
float HbbAnalyzerNew::metSignificance(const reco::MET * met) |
2281 |
+ |
{ |
2282 |
+ |
double sigmaX2= met->getSignificanceMatrix()(0,0); |
2283 |
+ |
double sigmaY2= met->getSignificanceMatrix()(1,1); |
2284 |
+ |
double significance = 0; |
2285 |
+ |
try { |
2286 |
+ |
if(sigmaX2<1.e10 && sigmaY2<1.e10) significance = met->significance(); |
2287 |
+ |
} |
2288 |
+ |
catch(...) |
2289 |
+ |
{ |
2290 |
+ |
std::cout << "PROBLEM WITH MET SIGNIFICANCE sigma X2 and Y2 are: " << sigmaX2 << " " << sigmaY2 << std::endl; |
2291 |
+ |
} |
2292 |
+ |
return significance; |
2293 |
|
} |
2294 |
|
|
2295 |
|
|
2296 |
< |
//define this as a plug-in |
2296 |
> |
//define this as a plug-in |
2297 |
|
DEFINE_FWK_MODULE(HbbAnalyzerNew); |