guess Module
This module defines the initial guess for the parameters used in the ODE solving-fitting routines.
Guess
dataclass
Dataclass which is a simple container to hold initial guess info for solvers. Can be converted into ndarray (excluding direction)
Attributes:
Name | Type | Description |
---|---|---|
polar |
float
|
The polar angle in radians |
azimuthal |
float
|
The azimuthal angle in radians |
brho |
float
|
The magnetic rigidity in Tm |
vertex_x |
float
|
The vertex x-coordinate in mm |
vertex_y |
float
|
The vertex y-coordinate in mm |
vertex_z |
float
|
The vertex z-coordinate in mm |
direction |
Direction
|
The Direction of the trajectory |
Methods:
Name | Description |
---|---|
convert_to_array |
Converts the Guess to an ndarray, excluding the direction attribute |
Source code in src/spyral/solvers/guess.py
convert_to_array()
Converts the Guess to an ndarray, excluding the direction attribute
Returns:
Type | Description |
---|---|
numpy.ndarray:
|
Format of [polar, azimuthal, brho, vertex_x, vertex_y, vertex_z] |
Source code in src/spyral/solvers/guess.py
SolverResult
dataclass
Container for the results of solver algorithm with metadata
Attributes:
Name | Type | Description |
---|---|---|
event |
int
|
The event number |
cluster_index |
int
|
The cluster index |
cluster_label |
int
|
The label from the clustering algorithm |
orig_run |
int
|
The original run number |
orig_event |
int
|
The original event number |
vertex_x |
float
|
The vertex x position (m) |
sigma_vx |
float
|
The uncertainty of the vertex x position (m) |
vertex_y |
float
|
The vertex y position (m) |
sigma_vy |
float
|
The uncertainty of the vertex y position (m) |
vertex_z |
float
|
The vertex z position (m) |
sigma_vz |
float
|
The uncertainty of the vertex z position (m) |
brho |
float
|
The magnetic rigidity (Tm) |
sigma_brho |
float
|
The uncertainty of the magnetic rigidity (Tm) |
ke |
float
|
The kinetic energy (MeV) |
sigma_ke |
float
|
The uncertainty of the kinetic energy (MeV) |
polar |
float
|
The polar angle (radians) |
sigma_polar |
float
|
The uncertianty of the polar angle (radians) |
azimuthal |
float
|
The azimuthal angle (radians) |
sigma_azimuthal |
float
|
The uncertianty of the azimuthal angle (radians) |
redchisq |
float
|
The best-fit value of the objective function (in the case of least squares, the reduced chi-square) |
Source code in src/spyral/solvers/guess.py
create_params(guess, ejectile, det_params, solver_params)
Create lmfit parameters with appropriate bounds
Convert all values to correct units (meters, radians, etc.) as well
Parameters:
Name | Type | Description | Default |
---|---|---|---|
guess |
Guess
|
the initial values of the parameters |
required |
ejectile |
NucleusData
|
the data for the particle being tracked |
required |
det_params |
DetectorParameters
|
Configuration parameters for detector characteristics |
required |
solver_params |
SolverParameters
|
Configuration parameters for the solver |
required |
Returns:
Type | Description |
---|---|
Parameters
|
the lmfit parameters with bounds |
Source code in src/spyral/solvers/guess.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
|