70 |
|
return vec; |
71 |
|
} |
72 |
|
|
73 |
+ |
float deltaPhi( float phi1, float phi2) { |
74 |
+ |
float result = phi1 - phi2; |
75 |
+ |
while (result > M_PI) result -= 2*M_PI; |
76 |
+ |
while (result <= -M_PI) result += 2*M_PI; |
77 |
+ |
return result; |
78 |
+ |
} |
79 |
+ |
|
80 |
|
// useful functions |
81 |
|
float deltaR( const TLorentzVector& v1, const TLorentzVector& v2 ) { |
82 |
|
// deltaR = sqrt ( deltaEta^2 + deltaPhi^2 ) |
83 |
< |
return sqrt(pow(v1.Eta() - v2.Eta(), 2) + pow(v1.Phi() - v2.Phi(), 2) ); |
83 |
> |
return sqrt(pow(v1.Eta() - v2.Eta(), 2) + pow(deltaPhi(v1.Phi(),v2.Phi()), 2) ); |
84 |
|
} |
85 |
|
|
86 |
|
float effectiveAreaElectron( float eta ) { |
309 |
|
|
310 |
|
bool loose_photon_barrel = thisphoton.pt>20 |
311 |
|
&& it->isEB() |
305 |
– |
&& it->passelectronveto |
312 |
|
&& it->hadTowOverEm<0.05 |
313 |
|
&& it->sigmaIetaIeta<0.012 |
314 |
|
&& thisphoton.chargedIso<2.6 |
316 |
|
&& thisphoton.photonIso<1.3+0.005*thisphoton.pt; |
317 |
|
bool loose_photon_endcap = thisphoton.pt > 20 |
318 |
|
&& it->isEE() |
313 |
– |
&& it->passelectronveto |
319 |
|
&& it->hadTowOverEm<0.05 |
320 |
|
&& it->sigmaIetaIeta<0.034 |
321 |
|
&& thisphoton.chargedIso<2.3 |