|
ATLAS Offline Software
|
|
__DEVICE__ long long | getDDE (GeoGpu *geo, int sampling, float eta, float phi) |
|
__DEVICE__ int | find_index_f (float *array, int size, float value) |
|
__DEVICE__ int | find_index_uint32 (uint32_t *array, int size, uint32_t value) |
|
__DEVICE__ void | rnd_to_fct2d (float &valuex, float &valuey, float rnd0, float rnd1, FH2D *hf2d) |
|
__DEVICE__ float | rnd_to_fct1d (float rnd, uint32_t *contents, float *borders, int nbins, uint32_t s_MaxValue) |
|
__DEVICE__ void | CenterPositionCalculation_d (Hit &hit, const Chain0_Args args) |
|
__DEVICE__ void | HistoLateralShapeParametrization_d (Hit &hit, unsigned long t, Chain0_Args args, bool reweight) |
|
__DEVICE__ void | HitCellMapping_d (Hit &hit, unsigned long, Chain0_Args args) |
|
__DEVICE__ void | HitCellMappingWiggle_d (Hit &hit, Chain0_Args args, unsigned long t) |
|
◆ CenterPositionCalculation_d()
◆ find_index_f()
__DEVICE__ int CaloGpuGeneral_fnc::find_index_f |
( |
float * |
array, |
|
|
int |
size, |
|
|
float |
value |
|
) |
| |
Definition at line 73 of file CaloGpuGeneral_fnc.cxx.
77 int m_index = ( high - low ) / 2;
78 while ( high != low ) {
83 m_index = ( high + low ) / 2;
◆ find_index_uint32()
__DEVICE__ int CaloGpuGeneral_fnc::find_index_uint32 |
( |
uint32_t * |
array, |
|
|
int |
size, |
|
|
uint32_t |
value |
|
) |
| |
Definition at line 90 of file CaloGpuGeneral_fnc.cxx.
94 int m_index = ( high - low ) / 2;
95 while ( high != low ) {
102 m_index = ( high - low ) / 2 + low;
◆ getDDE()
__DEVICE__ long long CaloGpuGeneral_fnc::getDDE |
( |
GeoGpu * |
geo, |
|
|
int |
sampling, |
|
|
float |
eta, |
|
|
float |
phi |
|
) |
| |
Definition at line 13 of file CaloGpuGeneral_fnc.cxx.
18 int MAX_SAMPLING =
geo->max_sample;
22 if ( sampling < 0 )
return -1;
23 if ( sampling >= MAX_SAMPLING )
return -1;
25 int sample_size = SampleIdx[sampling].
size;
26 unsigned int sample_index = SampleIdx[sampling].
index;
29 if ( sample_size == 0 )
return -1;
31 long long bestDDE = -1;
37 beststeps = ( *steps );
41 if ( sampling < 21 ) {
42 for (
int skip_range_check = 0; skip_range_check <= 1; ++skip_range_check ) {
43 for (
unsigned int j = sample_index; j < sample_index + sample_size; ++j ) {
44 if ( !skip_range_check ) {
45 if (
eta <
gr[j].mineta() )
continue;
46 if (
eta >
gr[j].maxeta() )
continue;
49 intsteps = ( *steps );
53 long long newDDE =
gr[j].getDDE(
eta,
phi, &newdist, &intsteps );
57 if (
steps ) beststeps = intsteps;
58 if ( newdist < -0.1 )
break;
61 if ( bestDDE >= 0 )
break;
◆ HistoLateralShapeParametrization_d()
__DEVICE__ void CaloGpuGeneral_fnc::HistoLateralShapeParametrization_d |
( |
Hit & |
hit, |
|
|
unsigned long |
t, |
|
|
Chain0_Args |
args, |
|
|
bool |
reweight |
|
) |
| |
Definition at line 167 of file CaloGpuGeneral_fnc.cxx.
178 float alpha,
r, rnd1, rnd2;
182 if (
args.is_phi_symmetric ) {
201 if ( center_eta < 0. ) delta_eta_mm = -delta_eta_mm;
204 if (
charge < 0. ) delta_phi_mm = -delta_phi_mm;
206 float dist000 = sqrt( center_r * center_r + center_z * center_z );
207 float eta_jakobi = abs( 2.0 *
exp( -center_eta ) / ( 1.0 +
exp( -2 * center_eta ) ) );
209 float delta_eta = delta_eta_mm / eta_jakobi / dist000;
210 float delta_phi = delta_phi_mm / center_r;
213 float* histocontents = (
args.fh1d)->h_contents;
214 float* histoborders = (
args.fh1d)->h_borders;
215 float* histoerrors= (
args.fh1d)->h_errors;
217 float delta_r_mm = sqrt( delta_eta_mm * delta_eta_mm + delta_phi_mm * delta_phi_mm );
219 if( ibin < 1 ) ibin = 1 ;
221 float weight = histocontents[ibin];
222 float rms = histoerrors[ibin];
224 float rnd1 =
args.rand[
t + 2 *
args.nhits -100 ];
225 float rnd2 =
args.rand[
t + 2 *
args.nhits -10 ];
◆ HitCellMapping_d()
Definition at line 237 of file CaloGpuGeneral_fnc.cxx.
241 if ( cellele < 0 ) printf(
"cellele not found %lld \n", cellele );
243 atomicAdd( &
args.cells_energy[cellele], hit.
E() );
◆ HitCellMappingWiggle_d()
Definition at line 248 of file CaloGpuGeneral_fnc.cxx.
250 int nhist = ( *(
args.fhs ) ).nhist;
251 float* bin_low_edge = ( *(
args.fhs ) ).low_edge;
253 float eta = fabs( hit.
eta() );
257 for (
int i = 0;
i < nhist + 1; ++
i ) {
258 if ( bin_low_edge[
i] >
eta ) {
266 unsigned int mxsz =
args.fhs->mxsz;
268 float* borders = &(
args.fhs->d_borders1D[
bin * mxsz] );
269 int h_size = ( *(
args.fhs ) ).h_szs[
bin];
272 float rnd =
args.rand[
t + 2 *
args.nhits];
276 float hit_phi_shifted = hit.
phi() + wiggle;
◆ rnd_to_fct1d()
__DEVICE__ float CaloGpuGeneral_fnc::rnd_to_fct1d |
( |
float |
rnd, |
|
|
uint32_t * |
contents, |
|
|
float * |
borders, |
|
|
int |
nbins, |
|
|
uint32_t |
s_MaxValue |
|
) |
| |
Definition at line 136 of file CaloGpuGeneral_fnc.cxx.
138 uint32_t int_rnd = s_MaxValue * rnd;
145 if ( ibin > 0 ) basecont =
contents[ibin - 1];
149 return borders[binx] + ( ( borders[binx + 1] - borders[binx] ) * ( int_rnd - basecont ) ) / dcont;
151 return borders[binx] + ( borders[binx + 1] - borders[binx] ) / 2;
◆ rnd_to_fct2d()
__DEVICE__ void CaloGpuGeneral_fnc::rnd_to_fct2d |
( |
float & |
valuex, |
|
|
float & |
valuey, |
|
|
float |
rnd0, |
|
|
float |
rnd1, |
|
|
FH2D * |
hf2d |
|
) |
| |
Definition at line 109 of file CaloGpuGeneral_fnc.cxx.
111 int nbinsx = ( *hf2d ).nbinsx;
112 int nbinsy = ( *hf2d ).nbinsy;
113 float* HistoContents = ( *hf2d ).h_contents;
114 float* HistoBorders = ( *hf2d ).h_bordersx;
115 float* HistoBordersy = ( *hf2d ).h_bordersy;
117 int ibin =
find_index_f( HistoContents, nbinsx * nbinsy, rnd0 );
119 int biny = ibin / nbinsx;
120 int binx = ibin - nbinsx * biny;
123 if ( ibin > 0 ) basecont = HistoContents[ibin - 1];
125 float dcont = HistoContents[ibin] - basecont;
127 valuex = HistoBorders[binx] + ( HistoBorders[binx + 1] - HistoBorders[binx] ) * ( rnd0 - basecont ) / dcont;
129 valuex = HistoBorders[binx] + ( HistoBorders[binx + 1] - HistoBorders[binx] ) / 2;
131 valuey = HistoBordersy[biny] + ( HistoBordersy[biny + 1] - HistoBordersy[biny] ) * rnd1;
Scalar phi() const
phi method
Scalar eta() const
pseudorapidity method
__DEVICE__ int find_index_uint32(uint32_t *array, int size, uint32_t value)
__DEVICE__ void HitCellMapping_d(Hit &hit, unsigned long, Chain0_Args args)
CUDA_HOSTDEV float & center_eta()
__HOSTDEV__ double Phi_mpi_pi(double)
CUDA_HOSTDEV float & center_z()
CUDA_HOSTDEV float & center_phi()
__DEVICE__ long long getDDE(GeoGpu *geo, int sampling, float eta, float phi)
void contents(std::vector< std::string > &keys, TDirectory *td, const std::string &directory, const std::string &pattern, const std::string &path)
CUDA_HOSTDEV float & phi()
double charge(const T &p)
__DEVICE__ void rnd_to_fct2d(float &valuex, float &valuey, float rnd0, float rnd1, FH2D *hf2d)
CUDA_HOSTDEV void setCenter_phi(float phi)
__DEVICE__ int find_index_f(float *array, int size, float value)
CUDA_HOSTDEV void setEtaPhiZE(float eta, float phi, float z, float E)
def delta_phi(phi1, phi2)
CUDA_HOSTDEV void setCenter_eta(float eta)
CUDA_HOSTDEV float & eta()
CUDA_HOSTDEV void setCenter_r(float r)
__DEVICE__ float rnd_to_fct1d(float rnd, uint32_t *contents, float *borders, int nbins, uint32_t s_MaxValue)
CUDA_HOSTDEV void setCenter_z(float z)
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
CUDA_HOSTDEV float & center_r()