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 vector<int> *mus_charge =
new vector<int>;
55 vector<LorentzVector> *mus_p4 =
new vector<LorentzVector>;
59 vector<int> *mus_type =
new vector<int>;
65 vector<int> *els_charge =
new vector<int>;
69 vector<LorentzVector> *els_p4 =
new vector<LorentzVector>;
72 unsigned int nmus = mus_p4->size();
73 unsigned int nels = els_p4->size();
76 vector<LorentzVector> *jets_p4 =
new vector<LorentzVector>;
83 for(
unsigned int mus_index_1 = 0; mus_index_1 < nmus; mus_index_1++) {
84 for(
unsigned int mus_index_2 = 0; mus_index_2 < nmus; mus_index_2++) {
86 if(mus_index_1 == mus_index_2)
continue;
87 if(mus_index_2 < mus_index_1)
continue;
90 if(mus_type->at(mus_index_1) == 8)
continue;
91 if(mus_type->at(mus_index_2) == 8)
continue;
93 float mu_pt1 = mus_p4->at(mus_index_1).Pt();
94 float mu_pt2 = mus_p4->at(mus_index_2).Pt();
97 if(mu_pt1 < looseptcut || mu_pt2 < looseptcut)
continue;
100 if(mu_pt1 < tightptcut && mu_pt2 < tightptcut)
continue;
102 int tight_index = mus_index_1;
103 int loose_index = mus_index_2;
110 if(mu_pt1 < tightptcut && mu_pt2 > tightptcut) {
111 tight_index = mus_index_2;
112 loose_index = mus_index_1;
114 if(mu_pt2 < tightptcut && mu_pt1 > tightptcut) {
115 tight_index = mus_index_1;
116 loose_index = mus_index_2;
121 vector<int> temp_jets_idx;
122 vector<LorentzVector> temp_jets_p4;
125 for(
unsigned int i = 0;
i<jets_p4->size();
i++) {
128 bool overlapsWithLepton =
false;
130 overlapsWithLepton =
true;
132 overlapsWithLepton =
true;
134 double jet_eta = jets_p4->at(
i).eta();
135 double jet_pt = jets_p4->at(
i).Pt();
137 if( fabs(jet_eta) < hypJetMaxEtaCut && jet_pt > hypJetMinPtCut && !overlapsWithLepton) {
138 temp_jets_idx.push_back(
i);
139 temp_jets_p4 .push_back(jets_p4 ->
at(
i));
145 hww.
hyp_p4() .push_back(mus_p4->at(tight_index)+mus_p4->at(loose_index));
148 hww.
hyp_lt_id() .push_back(-13*(mus_charge ->
at(tight_index)));
149 hww.
hyp_lt_p4() .push_back(mus_p4 ->
at(tight_index) );
152 hww.
hyp_ll_id() .push_back(-13*(mus_charge ->
at(loose_index)));
153 hww.
hyp_ll_p4() .push_back(mus_p4 ->
at(loose_index) );
161 for(
unsigned int els_index_1 = 0; els_index_1 < nels; els_index_1++) {
162 for(
unsigned int els_index_2 = 0; els_index_2 < nels; els_index_2++) {
164 if(els_index_1 == els_index_2)
continue;
165 if(els_index_2 < els_index_1)
continue;
167 float el_pt1 = els_p4->at(els_index_1).Pt();
168 float el_pt2 = els_p4->at(els_index_2).Pt();
171 if(el_pt1 < looseptcut || el_pt2 < looseptcut)
continue;
174 if(el_pt1 < tightptcut && el_pt2 < tightptcut)
continue;
176 int tight_index = els_index_1;
177 int loose_index = els_index_2;
184 if(el_pt1 < tightptcut && el_pt2 > tightptcut) {
185 tight_index = els_index_2;
186 loose_index = els_index_1;
188 if(el_pt2 < tightptcut && el_pt1 > tightptcut) {
189 tight_index = els_index_1;
190 loose_index = els_index_2;
195 vector<int> temp_jets_idx;
196 vector<LorentzVector> temp_jets_p4;
199 for(
unsigned int i = 0;
i<jets_p4->size();
i++) {
202 bool overlapsWithLepton =
false;
204 overlapsWithLepton =
true;
206 overlapsWithLepton =
true;
208 double jet_eta = jets_p4->at(
i).eta();
209 double jet_pt = jets_p4->at(
i).Pt();
211 if( fabs(jet_eta) < hypJetMaxEtaCut && jet_pt > hypJetMinPtCut && !overlapsWithLepton) {
212 temp_jets_idx.push_back(
i);
213 temp_jets_p4 .push_back(jets_p4 ->
at(
i));
219 hww.
hyp_p4() .push_back(els_p4->at(tight_index)+els_p4->at(loose_index));
222 hww.
hyp_lt_id() .push_back(-11*(els_charge ->
at(tight_index)));
223 hww.
hyp_lt_p4() .push_back(els_p4 ->
at(tight_index) );
226 hww.
hyp_ll_id() .push_back(-11*(els_charge ->
at(loose_index)));
227 hww.
hyp_ll_p4() .push_back(els_p4 ->
at(loose_index) );
236 for(
unsigned int els_index = 0; els_index < nels; els_index++) {
237 for(
unsigned int mus_index = 0; mus_index < nmus; mus_index++) {
239 if(mus_type->at(mus_index) == 8)
continue;
241 float el_pt = els_p4->at(els_index).Pt();
242 float mu_pt = mus_p4->at(mus_index).Pt();
245 if(el_pt < looseptcut || mu_pt < looseptcut)
continue;
248 if(el_pt < tightptcut && mu_pt < tightptcut)
continue;
251 vector<int> temp_jets_idx;
252 vector<LorentzVector> temp_jets_p4;
255 for(
unsigned int i = 0;
i<jets_p4->size();
i++) {
258 bool overlapsWithLepton =
false;
260 overlapsWithLepton =
true;
262 overlapsWithLepton =
true;
264 double jet_eta = jets_p4->at(
i).eta();
265 double jet_pt = jets_p4->at(
i).Pt();
267 if( fabs(jet_eta) < hypJetMaxEtaCut && jet_pt > hypJetMinPtCut && !overlapsWithLepton) {
268 temp_jets_idx.push_back(
i);
269 temp_jets_p4 .push_back(jets_p4 ->
at(
i));
274 hww.
hyp_p4() .push_back(mus_p4->at(mus_index)+els_p4->at(els_index) );
276 if(el_pt < tightptcut && mu_pt > tightptcut) {
280 hww.
hyp_lt_id() .push_back(-13*(mus_charge ->
at(mus_index)));
281 hww.
hyp_lt_p4() .push_back(mus_p4 ->
at(mus_index) );
284 hww.
hyp_ll_id() .push_back(-11*(els_charge ->
at(els_index)));
285 hww.
hyp_ll_p4() .push_back(els_p4 ->
at(els_index) );
292 hww.
hyp_lt_id() .push_back(-11*(els_charge ->
at(els_index)));
293 hww.
hyp_lt_p4() .push_back(els_p4 ->
at(els_index) );
296 hww.
hyp_ll_id() .push_back(-13*(mus_charge ->
at(mus_index)));
297 hww.
hyp_ll_p4() .push_back(mus_p4 ->
at(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()