ATLAS Offline Software
Loading...
Searching...
No Matches
CaloTowerContainer_v1.h
Go to the documentation of this file.
1// -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef XAODCALOEVENT_VERSIONS_CALOTOWERCONTAINER_V1_H
8#define XAODCALOEVENT_VERSIONS_CALOTOWERCONTAINER_V1_H
9
13
15
16namespace xAOD {
17
19
21 {
22 public:
23
34
53
54
57
70
71 bool configureGrid(int nEtaBins,double etaMin,double etaMax,int nPhiBins);
73
77 int nEtaBins() const;
78 double etaMin() const;
79 double etaMax() const;
80 double deltaEta() const;
81 int nPhiBins() const;
82 double phiMin() const;
83 double phiMax() const;
84 double deltaPhi() const;
85 int nTowers() const;
87
88
91 int index(double eta, double phi) const;
92 double eta(size_t index) const;
93 double phi(size_t index) const;
94
95 const CaloTower_v1* tower(double eta, double phi) const;
97
98 private:
99
100 bool configureGrid();
101
104 unsigned short m_nEtaBins;
105 double m_etaMin;
106 double m_etaMax;
107 unsigned short m_nPhiBins;
108 double m_deltaEta;
109 double m_deltaPhi;
110 bool m_isConfigured = false;
112 };
113}
114
139
140
141#include "xAODCore/BaseInfo.h"
142//SG_BASE(xAOD::CaloTowerContainer_v1, DataVector<xAOD::CaloTower_v1>);
144
148
149inline double xAOD::CaloTowerContainer_v1::etaMin() const { return m_etaMin; }
150inline double xAOD::CaloTowerContainer_v1::etaMax() const { return m_etaMax; }
151inline double xAOD::CaloTowerContainer_v1::deltaEta() const { return m_deltaEta; }
152
153inline double xAOD::CaloTowerContainer_v1::phiMin() const { return -M_PI; }
154inline double xAOD::CaloTowerContainer_v1::phiMax() const { return M_PI; }
155inline double xAOD::CaloTowerContainer_v1::deltaPhi() const { return m_deltaPhi; }
156
158 int idx=index(eta,phi);
159 if (idx>0 && idx<(int)this->size()) {
160 return (*this)[idx];
161 }
162
163 return nullptr;
164}
165
166#endif
#define M_PI
Scalar eta() const
pseudorapidity method
#define SG_BASE(D, B)
Declare that class D derives from class B.
An STL vector of pointers that by default owns its pointed-to elements.
#define DATAVECTOR_BASE(T, BASE)
Declare base class info to DataVector.
Definition DataVector.h:649
Derived DataVector<T>.
Definition DataVector.h:795
SG::OwnershipPolicy ownPolicy() const
size_type size() const noexcept
Basic container storing all information need for xAOD::CaloTower_v1 objects.
int nTowers() const
Returns grid size in
double phi(size_t index) const
double phiMin() const
Returns number of bins
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 deltaPhi() const
Returns upper boundary of range
double etaMax() const
Returns lower boundary of range
double phiMax() const
Returns lower boundary of range
double m_deltaEta
Number of bins in azimuth
double eta(size_t index) const
bool m_isConfigured
Bin width in azimuth
const CaloTower_v1 * tower(double eta, double phi) const
double m_etaMin
Number of pseudorapidity bins
double deltaEta() const
Returns upper boudnary of range
int nPhiBins() const
Returns grid size in
Class providing the definition of the 4-vector interface.
@ DEFAULT_TRACK_INDICES
Default value.
OwnershipPolicy
@ OWN_ELEMENTS
this data object owns its elements
Definition index.py:1
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
DataVector< CaloTower_v1 > CaloTowerContainerBase_v1