#ifndef __DMAGNETICFIELDSTEPPER_H__ #define __DMAGNETICFIELDSTEPPER_H__ #include #include "GPUMagneticField.cu" #define qBr2p 0.003 // conversion for converting q*B*r to GeV/c #define one_sixth 0.16666667 typedef struct{ float3 pos; float3 mom; // normalized float q_over_p; float mass; }state_t; typedef struct{ int Nsteps; int max_steps; state_t *steps; }trajectory_t; // Host routines void Swim(float q, float mass, float3 start_pos, float3 start_mom, trajectory_t *&traj); // Host callable device routines __global__ void GPU_Swim(float q, float mass, float3 start_pos, float3 start_mom, trajectory_t *traj); // Device only routines __device__ float GPU_GetStepSize(state_t &S); __device__ void GPU_Step(state_t &S); __device__ void GPU_TestStep(float h, state_t &Sstart, float4 &B, float3 *delta_pos, float3 *new_mom, float4 *Bmid=NULL, float h_frac=0.5); #endif // __DMAGNETICFIELDSTEPPER_H__