ATLAS Offline Software
Loading...
Searching...
No Matches
JGTowerHelper.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRIGT1CALOFEXPERF_JGTOWERHELPER_H
6#define TRIGT1CALOFEXPERF_JGTOWERHELPER_H
7/*
8* Class : JGTowerHelper
9*
10* Author : Lin, Chiao-Ying (cylin@cern.ch)
11*
12* Date : May 2017 - Created class
13*
14* This class is built for JGTower algorithm in topology
15* including mapping to SC, eta/phi and granularity
16*
17*/
18
19#include <vector>
20#include <string>
21#include <cstdint>
22
23namespace LVL1
24{
26 {
27
28 public:
29 // constructors
30 JGTowerHelper() = delete;
31 JGTowerHelper(float eta, float deta, float phi, float dphi);
32
33 // destructor
34 virtual ~JGTowerHelper();
35
36 float Eta() const { return m_eta; };
37 float Phi() const { return m_phi; };
38 float dEta() const { return m_deta; };
39 float dPhi() const { return m_dphi; };
40 float sampling() const { return m_sampling; };
41 const std::vector<int>& GetSCIndices() const { return m_scellIndices; };
42 const std::vector<int>& GetTileIndices() const { return m_tileIndices; };
43 void SetSCIndices(int sc_id) { m_scellIndices.push_back(sc_id); };
44 void SetTileIndices(int tile_id) { m_tileIndices.push_back(tile_id); };
46
47 static bool inBox(float eta1, float eta2, float deta, float phi1, float phi2, float dphi);
48 bool inBox(float eta, float phi) const;
49
50 float area() const { return m_area; }
51 void setArea(float value) { m_area = value; }
52
53 // Notes on the tower relation indices:
54 // - These all return indices relating to the vectors held in the mapping makers
55 // - These are reliable in the central region where the towers are regular and grid-like.
56 // In the forward region this is much less reliable and should not be relied on
57 // - These are different to those in the JGTowerBase_IDs as the 'next' eta step always
58 // goes in increasing eta, rather than increasing |eta|.
59 // - These also stitch across region boundaries where the granularities allow
60
62 std::size_t previousEtaIndex() const { return m_prevEtaIndex; }
64 bool hasPreviousEta() const { return m_prevEtaIndex != SIZE_MAX; }
66 std::size_t nextEtaIndex() const { return m_nextEtaIndex; }
68 bool hasNextEta() const { return m_nextEtaIndex != SIZE_MAX; }
70 std::size_t previousPhiIndex() const { return m_prevPhiIndex; }
72 bool hasPreviousPhi() const { return m_prevPhiIndex != SIZE_MAX; }
74 std::size_t nextPhiIndex() const { return m_nextPhiIndex; }
76 bool hasNextPhi() const { return m_nextPhiIndex != SIZE_MAX; }
78 std::size_t indexInFront() const { return m_indexInFront; }
80 bool isFrontTower() const { return m_indexInFront == SIZE_MAX; }
82 std::size_t indexBehind() const { return m_indexBehind; }
84 bool isBackTower() const { return m_indexBehind == SIZE_MAX; }
85
86 void setPreviousEtaIndex(std::size_t value) { m_prevEtaIndex = value; }
87 void setNextEtaIndex(std::size_t value) { m_nextEtaIndex = value; }
88 void setPreviousPhiIndex(std::size_t value) { m_prevPhiIndex = value; }
89 void setNextPhiIndex(std::size_t value) { m_nextPhiIndex = value; }
90 void setIndexInFront(std::size_t value) { m_indexInFront = value; }
91 void setIndexBehind(std::size_t value) { m_indexBehind = value; }
92
93 private:
94 float m_eta{-999};
95 float m_deta{-999};
96 float m_phi{-999};
97 float m_dphi{-999};
98 int m_sampling{-999};
99 std::vector<int> m_scellIndices;
100 std::vector<int> m_tileIndices;
101 float m_area{-1};
102 std::size_t m_prevEtaIndex{SIZE_MAX};
103 std::size_t m_nextEtaIndex{SIZE_MAX};
104 std::size_t m_prevPhiIndex{SIZE_MAX};
105 std::size_t m_nextPhiIndex{SIZE_MAX};
106 std::size_t m_indexInFront{SIZE_MAX};
107 std::size_t m_indexBehind{SIZE_MAX};
108 };
109} // namespace LVL1
110#endif
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
float dPhi() const
void SetSampling(int sampling)
std::size_t nextEtaIndex() const
The index of the tower after this one in eta (SIZE_MAX if not valid)
void setArea(float value)
float sampling() const
bool hasPreviousEta() const
Whether there is a previous eta tower.
void setPreviousPhiIndex(std::size_t value)
bool hasPreviousPhi() const
Whether there is a previous phi tower.
void setIndexBehind(std::size_t value)
std::size_t indexBehind() const
The index of the tower behind this one.
float Eta() const
bool isBackTower() const
Whether there is a tower behind this one.
std::size_t previousPhiIndex() const
The index of the tower before this one in phi (SIZE_MAX if not valid)
float dEta() const
void setNextPhiIndex(std::size_t value)
std::size_t m_indexBehind
float Phi() const
const std::vector< int > & GetTileIndices() const
std::size_t indexInFront() const
The index of the tower in front of this one.
std::size_t m_indexInFront
void setIndexInFront(std::size_t value)
std::size_t m_prevEtaIndex
std::size_t m_nextPhiIndex
bool hasNextEta() const
Whether there is a next eta tower.
bool isFrontTower() const
Whether there is a tower in front of this one.
void SetTileIndices(int tile_id)
float area() const
static bool inBox(float eta1, float eta2, float deta, float phi1, float phi2, float dphi)
void setPreviousEtaIndex(std::size_t value)
const std::vector< int > & GetSCIndices() const
std::size_t m_nextEtaIndex
void SetSCIndices(int sc_id)
std::size_t nextPhiIndex() const
The index of the tower after this one in phi (SIZE_MAX if not valid)
std::size_t m_prevPhiIndex
std::size_t previousEtaIndex() const
The index of the tower before this one in eta (SIZE_MAX if not valid)
bool hasNextPhi() const
Whether there is a next phi tower.
std::vector< int > m_scellIndices
void setNextEtaIndex(std::size_t value)
std::vector< int > m_tileIndices
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...