46 |
|
|
47 |
|
return true; |
48 |
|
} |
49 |
+ |
|
50 |
+ |
double HTlep(const BaseCycleContainer *bcc){ |
51 |
+ |
|
52 |
+ |
double htlep=0; |
53 |
+ |
|
54 |
+ |
if(bcc->electrons){ |
55 |
+ |
for(unsigned int i=0; i<bcc->electrons->size(); ++i){ |
56 |
+ |
htlep += bcc->electrons->at(i).pt(); |
57 |
+ |
} |
58 |
+ |
} |
59 |
+ |
if(bcc->muons){ |
60 |
+ |
for(unsigned int i=0; i<bcc->muons->size(); ++i){ |
61 |
+ |
htlep += bcc->muons->at(i).pt(); |
62 |
+ |
} |
63 |
+ |
} |
64 |
+ |
if(bcc->met) htlep += bcc->met->pt(); |
65 |
+ |
|
66 |
+ |
return htlep; |
67 |
+ |
|
68 |
+ |
} |
69 |
+ |
|
70 |
+ |
Jet* nextJet(const Particle *p, std::vector<Jet> *jets){ |
71 |
+ |
|
72 |
+ |
double deltarmin = double_infinity(); |
73 |
+ |
Jet* nextjet=0; |
74 |
+ |
for(unsigned int i=0; i<jets->size();++i){ |
75 |
+ |
if(jets->at(i).deltaR(*p) < deltarmin){ |
76 |
+ |
deltarmin = jets->at(i).deltaR(*p); |
77 |
+ |
nextjet = &jets->at(i); |
78 |
+ |
} |
79 |
+ |
} |
80 |
+ |
|
81 |
+ |
return nextjet; |
82 |
+ |
} |
83 |
+ |
|
84 |
+ |
double pTrel(const Particle *p, std::vector<Jet> *jets){ |
85 |
+ |
|
86 |
+ |
double ptrel=0; |
87 |
+ |
|
88 |
+ |
Jet* nextjet = nextJet(p,jets); |
89 |
+ |
|
90 |
+ |
TVector3 p3(p->v4().Px(),p->v4().Py(),p->v4().Pz()); |
91 |
+ |
TVector3 jet3(nextjet->v4().Px(),nextjet->v4().Py(),nextjet->v4().Pz()); |
92 |
+ |
|
93 |
+ |
if(p3.Mag()!=0 && jet3.Mag()!=0){ |
94 |
+ |
double sin_alpha = (p3.Cross(jet3)).Mag()/p3.Mag()/jet3.Mag(); |
95 |
+ |
ptrel = p3.Mag()*sin_alpha; |
96 |
+ |
} |
97 |
+ |
else{ |
98 |
+ |
std::cout << "something strange happend in the ptrel calculation: either lepton or jet momentum is 0" <<std::endl; |
99 |
+ |
} |
100 |
+ |
|
101 |
+ |
return ptrel; |
102 |
+ |
} |
103 |
+ |
|
104 |
+ |
double deltaRmin(const Particle *p, std::vector<Jet> *jets){ |
105 |
+ |
return nextJet(p,jets)->deltaR(*p); |
106 |
+ |
} |
107 |
+ |
|
108 |
+ |
|
109 |
+ |
double double_infinity(){ |
110 |
+ |
return std::numeric_limits<double>::infinity() ; |
111 |
+ |
} |
112 |
+ |
|
113 |
+ |
int int_infinity(){ |
114 |
+ |
return std::numeric_limits<int>::max() ; |
115 |
+ |
} |