ATLAS Offline Software
Loading...
Searching...
No Matches
JGTowerHelper.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
6#include "TMath.h"
7#include "TVector2.h"
8
9namespace LVL1
10{
11 // Constructor
12 JGTowerHelper::JGTowerHelper(float eta, float deta, float phi, float dphi)
13 {
14 m_eta = eta;
15 m_deta = deta;
16 m_phi = phi;
17 m_dphi = dphi;
18 }
19
20 //Destructor
22
23 //Tools
24 bool JGTowerHelper::inBox(float eta1, float eta2, float deta, float phi1, float phi2, float dphi)
25 {
26
27 bool inEtaBox = std::abs(eta1 - eta2) < deta;
28 if (phi2 > TMath::Pi())
29 phi2 = phi2 - 2 * TMath::Pi();
30 float deltaPhi = std::abs(phi1 - phi2);
31 if (deltaPhi > TMath::Pi())
32 deltaPhi = 2 * TMath::Pi() - deltaPhi;
33 bool inPhiBox = deltaPhi < dphi;
34
35 return inEtaBox && inPhiBox;
36 }
37
38 bool JGTowerHelper::inBox(float eta, float phi) const
39 {
40 return inBox(Eta(), eta, dEta() / 2, Phi(), phi, dPhi() / 2);
41 }
42} // namespace LVL1
Scalar eta() const
pseudorapidity method
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
Scalar phi() const
phi method
float dPhi() const
float Eta() const
float dEta() const
float Phi() const
static bool inBox(float eta1, float eta2, float deta, float phi1, float phi2, float dphi)
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...