ATLAS Offline Software
Loading...
Searching...
No Matches
Coordinate.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4/***************************************************************************
5 Coordinate.cxx - description
6 -------------------
7 begin : 26/02/2002
8 email : e.moyse@qmul.ac.uk
9***************************************************************************/
10
11#include <cmath>
12
14
15namespace LVL1 {
16
17 const double Coordinate::m_twoPi = M_PI * 2.0;
18
19 Coordinate::Coordinate( double phi, double eta )
20 : m_phi( phi ), m_eta( eta ) {
21
23 }
24
26 : m_phi( 0.0 ), m_eta( 0.0 ) {
27
28 }
29
31 void Coordinate::setCoords( double phi, double eta ) {
32
33 m_phi = phi; m_eta = eta;
35 return;
36
37 }
38
40 double Coordinate::eta() const {
41 return m_eta;
42 }
43
45 double Coordinate::phi() const {
46 return m_phi;
47 }
48
53 if ( m_phi < 0 ) m_phi += m_twoPi;
54 if ( m_phi > m_twoPi ) m_phi -= m_twoPi;
55 return;
56 }
57
58} // namespace LVL1
59
61std::ostream& LVL1::operator<< ( std::ostream& theStream, const Coordinate& theCoord ) {
62 theStream << "(" << theCoord.phi() << ", " << theCoord.eta() << ")";
63 return theStream;
64}
65
67MsgStream& LVL1::operator<< ( MsgStream& theStream, const Coordinate& theCoord ) {
68 theStream << "(" << theCoord.phi() << ", " << theCoord.eta() << ")";
69 return theStream;
70}
#define M_PI
void checkBounds()
Ensure coords are sensible this could be done more intelligently, but at least it's readable!
void setCoords(double phi, double eta)
change coords of an existing Coordinate object
double phi() const
return phi
double eta() const
return eta
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
std::ostream & operator<<(std::ostream &os, const TrigConf::IsolationLegacy &iso)