ATLAS Offline Software
Loading...
Searching...
No Matches
CaloTowerContainer_v1.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5
7
9#include <cmath>
10
11
12
22
33
34
35
38
40{
41 // reject configuration update!
42 if ( m_isConfigured ) { return false; }
43 // store configuration
48 return this->configureGrid();
49}
50
52{
53 if (m_nEtaBins > 0 && m_etaMin < m_etaMax && m_nPhiBins > 0) {
56 m_isConfigured=true;
57 }
58 else
59 m_isConfigured=false;
60 return m_isConfigured;
61
62}
63
64
65int xAOD::CaloTowerContainer_v1::index(double eta, double phi) const {
68 }
70 // int iphi=(phi-m_phiMin)/m_deltaPhi;
71 int iphi=(phi+M_PI)/m_deltaPhi;
72 int ieta=(eta-m_etaMin)/m_deltaEta;
73 return ieta*m_nPhiBins+iphi;
74}
75
76
78
79 assert((int)index < m_nPhiBins * m_nEtaBins);
80
81 int ieta=index/m_nPhiBins;
82 return (0.5+ieta)*m_deltaEta+m_etaMin;
83}
84
85
87
88 assert((int)index < m_nPhiBins * m_nEtaBins);
89
90 int iphi=index % m_nPhiBins;
91 return (0.5 + iphi)*m_deltaPhi-M_PI;
92}
#define M_PI
CaloPhiRange class declaration.
static double fix(double phi)
SG::OwnershipPolicy ownPolicy() const
int index(double eta, double phi) const
double phi(size_t index) const
CaloTowerContainer_v1(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS, SG::IndexTrackingPolicy trackIndices=SG::DEFAULT_TRACK_INDICES)
Default constructor Constructs a tower container without structure (binning) or content.
unsigned short m_nPhiBins
Upper boundary pseudorapidity range
double etaMin() const
Returns number of bins
double m_etaMax
Lower boundary pseudorapidity range
double m_deltaPhi
Bin width in pseudorapidity
double etaMax() const
Returns lower boundary of range
double m_deltaEta
Number of bins in azimuth
double eta(size_t index) const
bool configureGrid(int nEtaBins, double etaMin, double etaMax, int nPhiBins)
bool m_isConfigured
Bin width in azimuth
double m_etaMin
Number of pseudorapidity bins
int nPhiBins() const
Returns grid size in
OwnershipPolicy
Definition index.py:1
DataVector< CaloTower_v1 > CaloTowerContainerBase_v1