ATLAS Offline Software
Loading...
Searching...
No Matches
Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloGpu/ISF_FastCaloGpu/Hit.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_HIT_G_H
6#define ISF_FASTCALOGPU_HIT_G_H
7
8#ifndef CUDA_HOSTDEV
9# ifdef __CUDACC__
10# define CUDA_HOSTDEV __host__ __device__
11# else
12# define CUDA_HOSTDEV
13# endif
14#endif
15
16class Hit {
17public:
19 : m_eta_x( 0. )
20 , m_phi_y( 0. )
21 , m_z( 0. )
22 , m_E( 0. )
23 , m_useXYZ( false )
24 , m_center_r( 0. )
25 , m_center_z( 0. )
26 , m_center_eta( 0. )
27 , m_center_phi( 0. ){}; // for hits with the same energy, m_E should normalized to E(layer)/nhit
28 CUDA_HOSTDEV Hit( float eta, float phi, float E )
29 : m_eta_x( eta )
30 , m_phi_y( phi )
31 , m_E( E )
32 , m_useXYZ( false )
33 , m_center_r( 0. )
34 , m_center_z( 0. )
35 , m_center_eta( 0. )
36 , m_center_phi( 0. ){};
37 CUDA_HOSTDEV Hit( float x, float y, float z, float E )
38 : m_eta_x( x )
39 , m_phi_y( y )
40 , m_z( z )
41 , m_E( E )
42 , m_useXYZ( true )
43 , m_center_r( 0. )
44 , m_center_z( 0. )
45 , m_center_eta( 0. )
46 , m_center_phi( 0. ){};
47
48 CUDA_HOSTDEV inline void setEtaPhiZE( float eta, float phi, float z, float E ) {
49 m_eta_x = eta;
50 m_phi_y = phi;
51 m_z = z;
52 m_E = E;
53 m_useXYZ = false;
54 }
55 CUDA_HOSTDEV inline void setXYZE( float x, float y, float z, float E ) {
56 m_eta_x = x;
57 m_phi_y = y;
58 m_z = z;
59 m_E = E;
60 m_useXYZ = true;
61 }
62
63 CUDA_HOSTDEV inline void reset() {
64 m_eta_x = 0.;
65 m_phi_y = 0.;
66 m_z = 0.;
67 m_E = 0.;
68 m_useXYZ = false;
69 }
70
71 CUDA_HOSTDEV inline float& eta() { return m_eta_x; };
72 CUDA_HOSTDEV inline float& phi() { return m_phi_y; };
73 CUDA_HOSTDEV inline float& x() { return m_eta_x; };
74 CUDA_HOSTDEV inline float& y() { return m_phi_y; };
75 CUDA_HOSTDEV inline float& E() { return m_E; };
76 CUDA_HOSTDEV inline float& z() { return m_z; }
77 CUDA_HOSTDEV inline float r() {
78 if ( m_useXYZ )
79 return sqrt( m_eta_x * m_eta_x + m_phi_y * m_phi_y );
80 else
81 return m_z / sinh( m_eta_x );
82 }
83 CUDA_HOSTDEV inline float& center_r() { return m_center_r; }
84 CUDA_HOSTDEV inline float& center_z() { return m_center_z; }
85 CUDA_HOSTDEV inline float& center_eta() { return m_center_eta; }
86 CUDA_HOSTDEV inline float& center_phi() { return m_center_phi; }
87 CUDA_HOSTDEV inline void setCenter_r( float r ) { m_center_r = r; }
88 CUDA_HOSTDEV inline void setCenter_z( float z ) { m_center_z = z; }
89 CUDA_HOSTDEV inline void setCenter_eta( float eta ) { m_center_eta = eta; }
90 CUDA_HOSTDEV inline void setCenter_phi( float phi ) { m_center_phi = phi; }
91
92private:
93 float m_eta_x; // eta for barrel and end-cap, x for FCal
94 float m_phi_y; // phi for barrel and end-cap, y for FCal
95 float m_z;
96 float m_E;
98 // Variables used to store extrapolated position
103};
104
105#endif
CUDA_HOSTDEV Hit(float x, float y, float z, float E)
CUDA_HOSTDEV void setEtaPhiZE(float eta, float phi, float z, float E)
CUDA_HOSTDEV Hit(float eta, float phi, float E)
CUDA_HOSTDEV void setXYZE(float x, float y, float z, float E)