1 |
anghel |
1.1 |
#include "TMath.h"
|
2 |
|
|
#include "TLorentzVector.h"
|
3 |
|
|
#include <iostream>
|
4 |
|
|
|
5 |
|
|
|
6 |
|
|
double getDeltaR(TLorentzVector a, TLorentzVector b) {
|
7 |
|
|
double dEta = (a.Eta())-(b.Eta());
|
8 |
|
|
double dPhi = (a.Phi())-(b.Phi());
|
9 |
|
|
if (dPhi < -(TMath::Pi())) dPhi = dPhi+2*(TMath::Pi());
|
10 |
|
|
if (dPhi > (TMath::Pi())) dPhi = dPhi-2*(TMath::Pi());
|
11 |
|
|
double calcDeltaR = sqrt(dEta*dEta+dPhi*dPhi);
|
12 |
|
|
double rootdeltaR = a.DeltaR(b);
|
13 |
|
|
return calcDeltaR;
|
14 |
|
|
}
|
15 |
|
|
|
16 |
|
|
double getDeltaPhi(TLorentzVector a, TLorentzVector b) {
|
17 |
|
|
double dPhi = (a.Phi())-(b.Phi());
|
18 |
|
|
if (dPhi < -(TMath::Pi())) dPhi = dPhi+2*(TMath::Pi());
|
19 |
|
|
if (dPhi > (TMath::Pi())) dPhi = dPhi-2*(TMath::Pi());
|
20 |
|
|
return dPhi;
|
21 |
|
|
}
|
22 |
|
|
|