ATLAS Offline Software
Classes | Public Member Functions | Public Attributes | List of all members
TrigFTF_GNN_EtaBin Class Reference

#include <GNN_DataStorage.h>

Collaboration diagram for TrigFTF_GNN_EtaBin:

Classes

struct  CompareNodesByPhi
 

Public Member Functions

 TrigFTF_GNN_EtaBin ()
 
 ~TrigFTF_GNN_EtaBin ()
 
void sortByPhi ()
 
void initializeNodes ()
 
bool empty () const
 
void generatePhiIndexing (float)
 
float getMinBinRadius () const
 
float getMaxBinRadius () const
 

Public Attributes

std::vector< const TrigFTF_GNN_Node * > m_vn
 
std::vector< std::pair< float, unsigned int > > m_vPhiNodes
 
std::vector< std::vector< unsigned int > > m_in
 
std::vector< std::array< float, 5 > > m_params
 
float m_minRadius
 
float m_maxRadius
 

Detailed Description

Definition at line 42 of file GNN_DataStorage.h.

Constructor & Destructor Documentation

◆ TrigFTF_GNN_EtaBin()

TrigFTF_GNN_EtaBin::TrigFTF_GNN_EtaBin ( )

Definition at line 17 of file GNN_DataStorage.cxx.

17  : m_minRadius(0), m_maxRadius(0) {
18 
19  m_in.clear();
20  m_vn.clear();
21  m_params.clear();
22  m_vn.reserve(1000);
23 }

◆ ~TrigFTF_GNN_EtaBin()

TrigFTF_GNN_EtaBin::~TrigFTF_GNN_EtaBin ( )

Definition at line 25 of file GNN_DataStorage.cxx.

25  {
26  m_in.clear();
27  m_vn.clear();
28  m_params.clear();
29 }

Member Function Documentation

◆ empty()

bool TrigFTF_GNN_EtaBin::empty ( ) const
inline

Definition at line 58 of file GNN_DataStorage.h.

58  {
59  return m_vn.empty();
60  }

◆ generatePhiIndexing()

void TrigFTF_GNN_EtaBin::generatePhiIndexing ( float  dphi)

Definition at line 80 of file GNN_DataStorage.cxx.

80  {
81 
82  for(unsigned int nIdx=0;nIdx<m_vn.size();nIdx++) {
83 
84  float phi = m_params[nIdx][2];
85  if(phi <= M_PI-dphi) continue;
86  m_vPhiNodes.push_back(std::pair<float, unsigned int>(phi - 2*M_PI, nIdx));
87 
88  }
89 
90  for(unsigned int nIdx=0;nIdx<m_vn.size();nIdx++) {
91  float phi = m_params[nIdx][2];
92  m_vPhiNodes.push_back(std::pair<float, unsigned int>(phi, nIdx));
93  }
94 
95  for(unsigned int nIdx=0;nIdx<m_vn.size();nIdx++) {
96 
97  float phi = m_params[nIdx][2];
98  if(phi >= -M_PI + dphi) break;
99  m_vPhiNodes.push_back(std::pair<float, unsigned int>(phi + 2*M_PI, nIdx));
100  }
101 
102 }

◆ getMaxBinRadius()

float TrigFTF_GNN_EtaBin::getMaxBinRadius ( ) const
inline

Definition at line 68 of file GNN_DataStorage.h.

68  {
69  return m_maxRadius;
70  }

◆ getMinBinRadius()

float TrigFTF_GNN_EtaBin::getMinBinRadius ( ) const
inline

Definition at line 64 of file GNN_DataStorage.h.

64  {
65  return m_minRadius;
66  }

◆ initializeNodes()

void TrigFTF_GNN_EtaBin::initializeNodes ( )

Definition at line 56 of file GNN_DataStorage.cxx.

56  {
57 
58  if(m_vn.empty()) return;
59 
60  m_params.resize(m_vn.size());
61 
62  m_in.resize(m_vn.size());
63 
64  for(unsigned int nIdx=0;nIdx<m_vn.size();nIdx++) {
65  m_in[nIdx].reserve(50);//reasonably high number of incoming edges per node
66  m_params[nIdx][0] = -100.0;//default cut on cot(theta)
67  m_params[nIdx][1] = 100.0; //default cut on cot(theta)
68  const TrigFTF_GNN_Node* pN = m_vn.at(nIdx);
69  m_params[nIdx][2] = pN->phi();
70  m_params[nIdx][3] = pN->r();
71  m_params[nIdx][4] = pN->z();
72  }
73 
74  auto [min_iter, max_iter] = std::minmax_element(m_vn.begin(), m_vn.end(),
75  [](const TrigFTF_GNN_Node* s, const TrigFTF_GNN_Node* s1) { return (s->r() < s1->r()); });
76  m_maxRadius = (*max_iter)->r();
77  m_minRadius = (*min_iter)->r();
78 }

◆ sortByPhi()

void TrigFTF_GNN_EtaBin::sortByPhi ( )

Definition at line 31 of file GNN_DataStorage.cxx.

31  {
32 
33  std::vector<std::pair<float, const TrigFTF_GNN_Node*> > phiBuckets[32];
34 
35  int nBuckets = 31;
36 
37  for(const auto& n : m_vn) {
38 
39  int bIdx = (int)(0.5*nBuckets*(n->phi()/(float)M_PI + 1.0f));
40  phiBuckets[bIdx].push_back(std::make_pair(n->phi(), n));
41  }
42 
43  for(auto& b : phiBuckets) {
44  std::sort(b.begin(), b.end());
45  }
46 
47  int idx = 0;
48  for(const auto& b : phiBuckets) {
49  for(const auto& p : b) {
50  m_vn[idx++] = p.second;
51  }
52  }
53 
54 }

Member Data Documentation

◆ m_in

std::vector<std::vector<unsigned int> > TrigFTF_GNN_EtaBin::m_in

Definition at line 74 of file GNN_DataStorage.h.

◆ m_maxRadius

float TrigFTF_GNN_EtaBin::m_maxRadius

Definition at line 77 of file GNN_DataStorage.h.

◆ m_minRadius

float TrigFTF_GNN_EtaBin::m_minRadius

Definition at line 77 of file GNN_DataStorage.h.

◆ m_params

std::vector<std::array<float,5> > TrigFTF_GNN_EtaBin::m_params

Definition at line 75 of file GNN_DataStorage.h.

◆ m_vn

std::vector<const TrigFTF_GNN_Node*> TrigFTF_GNN_EtaBin::m_vn

Definition at line 72 of file GNN_DataStorage.h.

◆ m_vPhiNodes

std::vector<std::pair<float, unsigned int> > TrigFTF_GNN_EtaBin::m_vPhiNodes

Definition at line 73 of file GNN_DataStorage.h.


The documentation for this class was generated from the following files:
ReadCellNoiseFromCoolCompare.s1
s1
Definition: ReadCellNoiseFromCoolCompare.py:378
TrigFTF_GNN_EtaBin::m_in
std::vector< std::vector< unsigned int > > m_in
Definition: GNN_DataStorage.h:74
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
TrigFTF_GNN_Node::phi
float phi() const
Definition: GNN_DataStorage.h:28
M_PI
#define M_PI
Definition: ActiveFraction.h:11
TrigFTF_GNN_EtaBin::m_minRadius
float m_minRadius
Definition: GNN_DataStorage.h:77
TrigFTF_GNN_Node
Definition: GNN_DataStorage.h:21
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
TrigFTF_GNN_EtaBin::m_vPhiNodes
std::vector< std::pair< float, unsigned int > > m_vPhiNodes
Definition: GNN_DataStorage.h:73
beamspotman.n
n
Definition: beamspotman.py:731
TrigFTF_GNN_EtaBin::m_maxRadius
float m_maxRadius
Definition: GNN_DataStorage.h:77
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
TrigFTF_GNN_Node::z
float z() const
Definition: GNN_DataStorage.h:29
TrigFTF_GNN_EtaBin::m_vn
std::vector< const TrigFTF_GNN_Node * > m_vn
Definition: GNN_DataStorage.h:72
TrigFTF_GNN_Node::r
float r() const
Definition: GNN_DataStorage.h:30
TrigFTF_GNN_EtaBin::m_params
std::vector< std::array< float, 5 > > m_params
Definition: GNN_DataStorage.h:75