ATLAS Offline Software
GeoRegion.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ISF_FASTCALOGPU_GeoRegion_H
6 #define ISF_FASTCALOGPU_GeoRegion_H
7 
9 
10 # ifdef __CUDACC__
11 # define __HOSTDEV__ __host__ __device__
12 # else
13 # define __HOSTDEV__
14 # endif
15 
16 __HOSTDEV__ double Phi_mpi_pi( double );
17 
18 class GeoRegion {
19 public:
21  m_all_cells = 0;
23  m_index = 0;
24  m_cell_grid_eta = 0;
25  m_cell_grid_phi = 0;
26  m_mineta = 0;
27  m_maxeta = 0;
28  m_minphi = 0;
29  m_maxphi = 0;
30  m_mineta_raw = 0;
31  m_maxeta_raw = 0;
32  m_minphi_raw = 0;
33  m_maxphi_raw = 0;
38  m_deta = 0;
39  m_dphi = 0;
40  m_eta_correction = 0;
41  m_phi_correction = 0;
42  m_dphi_double = 0;
43  m_deta_double = 0;
44  m_cells = 0;
45  m_cells_g = 0;
46  };
47 
48  __HOSTDEV__ ~GeoRegion() { free( m_cells ); };
49 
52  __HOSTDEV__ void set_index( int i ) { m_index = i; };
55  __HOSTDEV__ void set_mineta( float f ) { m_mineta = f; };
56  __HOSTDEV__ void set_maxeta( float f ) { m_maxeta = f; };
57  __HOSTDEV__ void set_minphi( float f ) { m_minphi = f; };
58  __HOSTDEV__ void set_maxphi( float f ) { m_maxphi = f; };
59  __HOSTDEV__ void set_minphi_raw( float f ) { m_minphi_raw = f; };
60  __HOSTDEV__ void set_maxphi_raw( float f ) { m_maxphi_raw = f; };
61  __HOSTDEV__ void set_mineta_raw( float f ) { m_mineta_raw = f; };
62  __HOSTDEV__ void set_maxeta_raw( float f ) { m_maxeta_raw = f; };
69  __HOSTDEV__ void set_deta( float f ) { m_deta = f; };
70  __HOSTDEV__ void set_dphi( float f ) { m_dphi = f; };
73  __HOSTDEV__ void set_cell_grid( long long* cells ) { m_cells = cells; };
74  __HOSTDEV__ void set_cell_grid_g( long long* cells ) { m_cells_g = cells; };
75 
76  __HOSTDEV__ long long* cell_grid() const { return m_cells; };
77  __HOSTDEV__ long long* cell_grid_g() const { return m_cells_g; };
78  __HOSTDEV__ int cell_grid_eta() const { return m_cell_grid_eta; };
79  __HOSTDEV__ int cell_grid_phi() const { return m_cell_grid_phi; };
80  __HOSTDEV__ int index() const { return m_index; };
81  __HOSTDEV__ float mineta_raw() const { return m_mineta_raw; };
82  __HOSTDEV__ float minphi_raw() const { return m_minphi_raw; };
84  __HOSTDEV__ float maxeta() const { return m_maxeta; };
85  __HOSTDEV__ float mineta() const { return m_mineta; };
86  __HOSTDEV__ float maxphi() const { return m_maxphi; };
87  __HOSTDEV__ float minphi() const { return m_minphi; };
88 
89  __HOSTDEV__ int raw_eta_position_to_index( float eta_raw ) const {
90  return floor( ( eta_raw - m_mineta_raw ) / m_deta_double );
91  };
92  __HOSTDEV__ int raw_phi_position_to_index( float phi_raw ) const {
93  return floor( ( phi_raw - m_minphi_raw ) / m_dphi_double );
94  };
95 
96  __HOSTDEV__ bool index_range_adjust( int& ieta, int& iphi ) const;
97  __HOSTDEV__ float calculate_distance_eta_phi( const long long DDE, float eta, float phi, float& dist_eta0,
98  float& dist_phi0 ) const;
99 
100  __HOSTDEV__ long long getDDE( float eta, float phi, float* distance = 0, int* steps = 0 );
101 
102 protected:
103  long long* m_cells; // my cells array in the region HOST ptr
104  long long* m_cells_g; // my cells array in the region gpu ptr
105  CaloDetDescrElement_Gpu* m_all_cells; // all cells in GPU, stored in array.
106 
108  int m_index;
115 };
116 #endif
GeoRegion::all_cells
__HOSTDEV__ CaloDetDescrElement_Gpu * all_cells() const
Definition: GeoRegion.h:83
RunTileCalibRec.cells
cells
Definition: RunTileCalibRec.py:271
GeoRegion::m_cell_grid_eta
int m_cell_grid_eta
Definition: GeoRegion.h:109
GeoRegion::set_maxphi_correction
__HOSTDEV__ void set_maxphi_correction(float f)
Definition: GeoRegion.h:66
GeoRegion::calculate_distance_eta_phi
__HOSTDEV__ float calculate_distance_eta_phi(const long long DDE, float eta, float phi, float &dist_eta0, float &dist_phi0) const
Definition: GeoRegion.cxx:27
GeoRegion::m_maxphi_correction
float m_maxphi_correction
Definition: GeoRegion.h:112
GeoRegion::set_cell_grid_g
__HOSTDEV__ void set_cell_grid_g(long long *cells)
Definition: GeoRegion.h:74
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
GeoRegion::set_eta_correction
__HOSTDEV__ void set_eta_correction(float f)
Definition: GeoRegion.h:67
CaloDetDescrElement_Gpu
Definition: CaloDetDescrElement_g.h:10
GeoRegion::mineta
__HOSTDEV__ float mineta() const
Definition: GeoRegion.h:85
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
GeoRegion::m_maxeta_raw
float m_maxeta_raw
Definition: GeoRegion.h:111
GeoRegion::mineta_raw
__HOSTDEV__ float mineta_raw() const
Definition: GeoRegion.h:81
GeoRegion::m_eta_correction
float m_eta_correction
Definition: GeoRegion.h:113
GeoRegion::index_range_adjust
__HOSTDEV__ bool index_range_adjust(int &ieta, int &iphi) const
Definition: GeoRegion.cxx:13
GeoRegion::m_phi_correction
float m_phi_correction
Definition: GeoRegion.h:113
GeoRegion::maxeta
__HOSTDEV__ float maxeta() const
Definition: GeoRegion.h:84
GeoRegion::m_dphi_double
float m_dphi_double
Definition: GeoRegion.h:114
GeoRegion::set_cell_grid_eta
__HOSTDEV__ void set_cell_grid_eta(int i)
Definition: GeoRegion.h:53
GeoRegion::index
__HOSTDEV__ int index() const
Definition: GeoRegion.h:80
Phi_mpi_pi
__HOSTDEV__ double Phi_mpi_pi(double)
Definition: GeoRegion.cxx:7
GeoRegion::set_maxeta_raw
__HOSTDEV__ void set_maxeta_raw(float f)
Definition: GeoRegion.h:62
GeoRegion::m_minphi
float m_minphi
Definition: GeoRegion.h:110
GeoRegion::cell_grid_phi
__HOSTDEV__ int cell_grid_phi() const
Definition: GeoRegion.h:79
GeoRegion::m_mineta
float m_mineta
Definition: GeoRegion.h:110
GeoRegion::m_mineta_raw
float m_mineta_raw
Definition: GeoRegion.h:111
GeoRegion::cell_grid
__HOSTDEV__ long long * cell_grid() const
Definition: GeoRegion.h:76
GeoRegion::m_cells_g
long long * m_cells_g
Definition: GeoRegion.h:104
GeoRegion::raw_phi_position_to_index
__HOSTDEV__ int raw_phi_position_to_index(float phi_raw) const
Definition: GeoRegion.h:92
beamspotman.steps
int steps
Definition: beamspotman.py:505
GeoRegion::m_dphi
float m_dphi
Definition: GeoRegion.h:113
GeoRegion::set_dphi
__HOSTDEV__ void set_dphi(float f)
Definition: GeoRegion.h:70
CaloDetDescrElement_g.h
lumiFormat.i
int i
Definition: lumiFormat.py:85
GeoRegion::m_minphi_correction
float m_minphi_correction
Definition: GeoRegion.h:112
GeoRegion::set_minphi_raw
__HOSTDEV__ void set_minphi_raw(float f)
Definition: GeoRegion.h:59
GeoRegion::set_phi_correction
__HOSTDEV__ void set_phi_correction(float f)
Definition: GeoRegion.h:68
GeoRegion::m_maxphi
float m_maxphi
Definition: GeoRegion.h:110
GeoRegion::set_cell_grid_phi
__HOSTDEV__ void set_cell_grid_phi(int i)
Definition: GeoRegion.h:54
GeoRegion::m_minphi_raw
float m_minphi_raw
Definition: GeoRegion.h:111
hist_file_dump.f
f
Definition: hist_file_dump.py:135
GeoRegion::maxphi
__HOSTDEV__ float maxphi() const
Definition: GeoRegion.h:86
GeoRegion::~GeoRegion
__HOSTDEV__ ~GeoRegion()
Definition: GeoRegion.h:48
GeoRegion::set_mineta_correction
__HOSTDEV__ void set_mineta_correction(float f)
Definition: GeoRegion.h:63
GeoRegion::set_deta
__HOSTDEV__ void set_deta(float f)
Definition: GeoRegion.h:69
__HOSTDEV__
#define __HOSTDEV__
Definition: GeoRegion.h:13
GeoRegion::m_index
int m_index
Definition: GeoRegion.h:108
GeoRegion::m_maxeta
float m_maxeta
Definition: GeoRegion.h:110
GeoRegion::GeoRegion
__HOSTDEV__ GeoRegion()
Definition: GeoRegion.h:20
GeoRegion::raw_eta_position_to_index
__HOSTDEV__ int raw_eta_position_to_index(float eta_raw) const
Definition: GeoRegion.h:89
GeoRegion::set_dphi_double
__HOSTDEV__ void set_dphi_double(float f)
Definition: GeoRegion.h:72
GeoRegion::set_mineta
__HOSTDEV__ void set_mineta(float f)
Definition: GeoRegion.h:55
GeoRegion::minphi_raw
__HOSTDEV__ float minphi_raw() const
Definition: GeoRegion.h:82
GeoRegion::set_minphi
__HOSTDEV__ void set_minphi(float f)
Definition: GeoRegion.h:57
GeoRegion::set_maxeta
__HOSTDEV__ void set_maxeta(float f)
Definition: GeoRegion.h:56
GeoRegion::m_all_cells
CaloDetDescrElement_Gpu * m_all_cells
Definition: GeoRegion.h:105
GeoRegion::set_all_cells
__HOSTDEV__ void set_all_cells(CaloDetDescrElement_Gpu *c)
Definition: GeoRegion.h:50
GeoRegion
Definition: GeoRegion.h:18
GeoRegion::set_index
__HOSTDEV__ void set_index(int i)
Definition: GeoRegion.h:52
GeoRegion::m_cells
long long * m_cells
Definition: GeoRegion.h:103
GeoRegion::cell_grid_eta
__HOSTDEV__ int cell_grid_eta() const
Definition: GeoRegion.h:78
GeoRegion::set_maxphi
__HOSTDEV__ void set_maxphi(float f)
Definition: GeoRegion.h:58
GeoRegion::cell_grid_g
__HOSTDEV__ long long * cell_grid_g() const
Definition: GeoRegion.h:77
GeoRegion::set_cell_grid
__HOSTDEV__ void set_cell_grid(long long *cells)
Definition: GeoRegion.h:73
GeoRegion::set_maxeta_correction
__HOSTDEV__ void set_maxeta_correction(float f)
Definition: GeoRegion.h:64
GeoRegion::m_maxeta_correction
float m_maxeta_correction
Definition: GeoRegion.h:112
GeoRegion::set_minphi_correction
__HOSTDEV__ void set_minphi_correction(float f)
Definition: GeoRegion.h:65
GeoRegion::getDDE
__HOSTDEV__ long long getDDE(float eta, float phi, float *distance=0, int *steps=0)
Definition: GeoRegion.cxx:37
GeoRegion::set_maxphi_raw
__HOSTDEV__ void set_maxphi_raw(float f)
Definition: GeoRegion.h:60
GeoRegion::m_mineta_correction
float m_mineta_correction
Definition: GeoRegion.h:112
GeoRegion::minphi
__HOSTDEV__ float minphi() const
Definition: GeoRegion.h:87
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
python.compressB64.c
def c
Definition: compressB64.py:93
GeoRegion::m_deta_double
float m_deta_double
Definition: GeoRegion.h:114
GeoRegion::m_deta
float m_deta
Definition: GeoRegion.h:113
GeoRegion::set_xy_grid_adjustment_factor
__HOSTDEV__ void set_xy_grid_adjustment_factor(float f)
Definition: GeoRegion.h:51
GeoRegion::m_maxphi_raw
float m_maxphi_raw
Definition: GeoRegion.h:111
GeoRegion::set_mineta_raw
__HOSTDEV__ void set_mineta_raw(float f)
Definition: GeoRegion.h:61
GeoRegion::m_xy_grid_adjustment_factor
float m_xy_grid_adjustment_factor
Definition: GeoRegion.h:107
GeoRegion::set_deta_double
__HOSTDEV__ void set_deta_double(float f)
Definition: GeoRegion.h:71
GeoRegion::m_cell_grid_phi
int m_cell_grid_phi
Definition: GeoRegion.h:109