14 float lepphi = lepp4.Phi();
15 float jetphi = jetP4.Phi();
17 float lepeta = lepp4.Eta();
18 float jeteta = jetP4.Eta();
20 float dphi = lepphi - jetphi;
21 float deta = lepeta - jeteta;
24 double dR =
sqrt(dphi*dphi + deta*deta);
45 double looseptcut = 10.0;
46 double tightptcut = 20.0;
47 double hypJetMaxEtaCut = 5.0;
48 double hypJetMinPtCut = 30.0;
51 const vector<int> &mus_charge = hww.
mus_charge();
54 const vector<LorentzVector> &mus_p4 = hww.
mus_p4();
57 const vector<int> &mus_type = hww.
mus_type();
62 const vector<int> &els_charge =hww.
els_charge();
65 const vector<LorentzVector> &els_p4 = hww.
els_p4();
67 unsigned int nmus = mus_p4.size();
68 unsigned int nels = els_p4.size();
71 const vector<LorentzVector> &jets_p4 = hww.
pfjets_p4();
77 for(
unsigned int mus_index_1 = 0; mus_index_1 < nmus; mus_index_1++) {
78 for(
unsigned int mus_index_2 = 0; mus_index_2 < nmus; mus_index_2++) {
80 if(mus_index_1 == mus_index_2)
continue;
81 if(mus_index_2 < mus_index_1)
continue;
84 if(mus_type[mus_index_1] == 8)
continue;
85 if(mus_type[mus_index_2] == 8)
continue;
87 float mu_pt1 = mus_p4[mus_index_1].Pt();
88 float mu_pt2 = mus_p4[mus_index_2].Pt();
91 if(mu_pt1 < looseptcut || mu_pt2 < looseptcut)
continue;
94 if(mu_pt1 < tightptcut && mu_pt2 < tightptcut)
continue;
96 int tight_index = mus_index_1;
97 int loose_index = mus_index_2;
104 if(mu_pt1 < tightptcut && mu_pt2 > tightptcut) {
105 tight_index = mus_index_2;
106 loose_index = mus_index_1;
108 if(mu_pt2 < tightptcut && mu_pt1 > tightptcut) {
109 tight_index = mus_index_1;
110 loose_index = mus_index_2;
115 vector<int> temp_jets_idx;
116 vector<LorentzVector> temp_jets_p4;
119 for(
unsigned int i = 0;
i<jets_p4.size();
i++) {
122 bool overlapsWithLepton =
false;
124 overlapsWithLepton =
true;
126 overlapsWithLepton =
true;
128 double jet_eta = jets_p4[
i].eta();
129 double jet_pt = jets_p4[
i].Pt();
131 if( fabs(jet_eta) < hypJetMaxEtaCut && jet_pt > hypJetMinPtCut && !overlapsWithLepton) {
132 temp_jets_idx.push_back(i);
133 temp_jets_p4 .push_back(jets_p4[i]);
139 hww.
hyp_p4() .push_back(mus_p4[tight_index]+mus_p4[loose_index]);
142 hww.
hyp_lt_id() .push_back(-13*(mus_charge[tight_index]));
143 hww.
hyp_lt_p4() .push_back(mus_p4 [tight_index] );
146 hww.
hyp_ll_id() .push_back(-13*(mus_charge[loose_index]));
147 hww.
hyp_ll_p4() .push_back(mus_p4 [loose_index] );
155 for(
unsigned int els_index_1 = 0; els_index_1 < nels; els_index_1++) {
156 for(
unsigned int els_index_2 = 0; els_index_2 < nels; els_index_2++) {
158 if(els_index_1 == els_index_2)
continue;
159 if(els_index_2 < els_index_1)
continue;
161 float el_pt1 = els_p4[els_index_1].Pt();
162 float el_pt2 = els_p4[els_index_2].Pt();
165 if(el_pt1 < looseptcut || el_pt2 < looseptcut)
continue;
168 if(el_pt1 < tightptcut && el_pt2 < tightptcut)
continue;
170 int tight_index = els_index_1;
171 int loose_index = els_index_2;
178 if(el_pt1 < tightptcut && el_pt2 > tightptcut) {
179 tight_index = els_index_2;
180 loose_index = els_index_1;
182 if(el_pt2 < tightptcut && el_pt1 > tightptcut) {
183 tight_index = els_index_1;
184 loose_index = els_index_2;
189 vector<int> temp_jets_idx;
190 vector<LorentzVector> temp_jets_p4;
193 for(
unsigned int i = 0;
i<jets_p4.size();
i++) {
196 bool overlapsWithLepton =
false;
198 overlapsWithLepton =
true;
200 overlapsWithLepton =
true;
202 double jet_eta = jets_p4[
i].eta();
203 double jet_pt = jets_p4[
i].Pt();
205 if( fabs(jet_eta) < hypJetMaxEtaCut && jet_pt > hypJetMinPtCut && !overlapsWithLepton) {
206 temp_jets_idx.push_back(i);
207 temp_jets_p4 .push_back(jets_p4[i]);
213 hww.
hyp_p4() .push_back(els_p4[tight_index]+els_p4[loose_index]);
216 hww.
hyp_lt_id() .push_back(-11*(els_charge [tight_index]));
217 hww.
hyp_lt_p4() .push_back(els_p4 [tight_index] );
220 hww.
hyp_ll_id() .push_back(-11*(els_charge [loose_index]));
221 hww.
hyp_ll_p4() .push_back(els_p4 [loose_index] );
230 for(
unsigned int els_index = 0; els_index < nels; els_index++) {
231 for(
unsigned int mus_index = 0; mus_index < nmus; mus_index++) {
233 if(mus_type[mus_index] == 8)
continue;
235 float el_pt = els_p4[els_index].Pt();
236 float mu_pt = mus_p4[mus_index].Pt();
239 if(el_pt < looseptcut || mu_pt < looseptcut)
continue;
242 if(el_pt < tightptcut && mu_pt < tightptcut)
continue;
245 vector<int> temp_jets_idx;
246 vector<LorentzVector> temp_jets_p4;
249 for(
unsigned int i = 0;
i<jets_p4.size();
i++) {
252 bool overlapsWithLepton =
false;
254 overlapsWithLepton =
true;
256 overlapsWithLepton =
true;
258 double jet_eta = jets_p4[
i].eta();
259 double jet_pt = jets_p4[
i].Pt();
261 if( fabs(jet_eta) < hypJetMaxEtaCut && jet_pt > hypJetMinPtCut && !overlapsWithLepton) {
262 temp_jets_idx.push_back(i);
263 temp_jets_p4 .push_back(jets_p4[i]);
268 hww.
hyp_p4() .push_back(mus_p4[mus_index]+els_p4[els_index] );
270 if(el_pt < tightptcut && mu_pt > tightptcut) {
274 hww.
hyp_lt_id() .push_back(-13*(mus_charge[mus_index]));
275 hww.
hyp_lt_p4() .push_back(mus_p4 [mus_index] );
278 hww.
hyp_ll_id() .push_back(-11*(els_charge [els_index]));
279 hww.
hyp_ll_p4() .push_back(els_p4 [els_index] );
286 hww.
hyp_lt_id() .push_back(-11*(els_charge [els_index]));
287 hww.
hyp_lt_p4() .push_back(els_p4 [els_index] );
290 hww.
hyp_ll_id() .push_back(-13*(mus_charge[mus_index]));
291 hww.
hyp_ll_p4() .push_back(mus_p4 [mus_index] );
std::vector< int > & hyp_ll_id()
std::vector< int > & hyp_lt_index()
std::vector< LorentzVector > & mus_p4()
std::vector< int > & hyp_lt_charge()
std::vector< LorentzVector > & hyp_ll_p4()
std::vector< int > & mus_charge()
std::vector< std::vector< LorentzVector > > & hyp_jets_p4()
void SetVars(HWW &, const edm::Event &, const edm::EventSetup &)
std::vector< int > & hyp_type()
void Load_hyp_lt_charge()
void Load_hyp_ll_charge()
std::vector< LorentzVector > & els_p4()
bool testJetForLeptons(const LorentzVector &jetP4, const LorentzVector &lepp4)
std::vector< int > & els_charge()
std::vector< LorentzVector > & hyp_p4()
std::vector< int > & hyp_lt_id()
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< float > > LorentzVector
std::vector< LorentzVector > & hyp_lt_p4()
std::vector< int > & hyp_ll_charge()
std::vector< LorentzVector > & pfjets_p4()
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< float > > XYZTLorentzVectorF
Lorentz vector with cylindrical internal representation using pseudorapidity.
math::PtEtaPhiELorentzVectorF LorentzVector
std::vector< int > & mus_type()
std::vector< int > & hyp_ll_index()