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 |
477 |
|
|
478 |
|
tree::Particle thisGenParticle; |
479 |
|
for( std::vector<susy::Particle>::iterator it = event->genParticles.begin(); it != event->genParticles.end(); ++it ) { |
480 |
< |
if( it->status == 3 ) { // hard interaction |
481 |
< |
switch( std::abs(it->pdgId) ) { |
482 |
< |
thisGenParticle.pt = it->momentum.Pt(); |
483 |
< |
thisGenParticle.eta = it->momentum.Eta(); |
484 |
< |
thisGenParticle.phi = it->momentum.Phi(); |
485 |
< |
case 22: // photon |
486 |
< |
if( thisGenParticle.pt > 75 ) |
487 |
< |
genPhoton.push_back( thisGenParticle ); |
488 |
< |
case 11: // electron |
489 |
< |
if( thisGenParticle.pt > 20 ) // pt cut is lower to estimate fake rate in all pt bins |
490 |
< |
genElectron.push_back( thisGenParticle ); |
491 |
< |
} |
480 |
> |
if( it->momentum.Pt() < 20 ) continue; |
481 |
> |
thisGenParticle.pt = it->momentum.Pt(); |
482 |
> |
thisGenParticle.eta = it->momentum.Eta(); |
483 |
> |
thisGenParticle.phi = it->momentum.Phi(); |
484 |
> |
switch( std::abs(it->pdgId) ) { |
485 |
> |
case 22: // photon |
486 |
> |
genPhoton.push_back( thisGenParticle ); |
487 |
> |
break; |
488 |
> |
case 11: // electron |
489 |
> |
// Demand a W boson as mother particle of electron |
490 |
> |
if( abs(event->genParticles[it->motherIndex].pdgId) == 24 ) |
491 |
> |
genElectron.push_back( thisGenParticle ); |
492 |
> |
break; |
493 |
|
} |
494 |
|
} |
495 |
|
|