1 #ifndef SPHENIX_SPHENIXTRACKERTPC_H
2 #define SPHENIX_SPHENIXTRACKERTPC_H
21 namespace SeamStress {
template <
class TClass>
class Pincushion; }
32 while (
angle >= twopi) {
42 static float absDiff(
float angle1,
float angle2) {
43 float diff = (angle1 - angle2);
47 while (diff < -
M_PI) {
65 vec.push_back(angind);
69 std::vector<AngleIndexPair*>& result) {
72 for (
unsigned int i = 0; i <
vec.size(); i++) {
74 result.push_back(&(
vec[i]));
80 std::vector<AngleIndexPair*>& result) {
82 int a = (
int)(angle / twopi);
87 while (angle >= twopi) {
91 if (
vec.size() <= 4) {
99 unsigned int current = closest;
100 unsigned int lowest = 0;
101 unsigned int highest =
vec.size() - 1;
104 result.push_back(&(
vec[current]));
105 current = (current + 1) % (
vec.size());
106 if (current == closest) {
115 if (current <= closest) {
120 current = ((closest +
vec.size()) - 1) % (
vec.size());
122 if ((current == lowest) || (current == highest)) {
126 result.push_back(&(
vec[current]));
127 current = ((current +
vec.size()) - 1) % (
vec.size());
135 unsigned int upper) {
136 unsigned int closest = lower;
138 for (
unsigned int i = (lower + 1); i <= upper; i++) {
140 if (tempdiff < diff) {
150 if (
vec.size() <= 4) {
155 std::sort(
vec.begin(),
vec.end());
159 unsigned int lower = 0;
160 unsigned int upper =
vec.size() - 1;
161 unsigned int middle =
vec.size() / 2;
163 if ((upper - lower) <= 4) {
167 if (angle <=
vec[middle].angle) {
169 middle = (lower + upper) / 2;
172 middle = (lower + upper) / 2;
177 std::vector<AngleIndexPair>
vec;
191 std::vector<unsigned int>
hits;
200 unsigned int n_dzdl,
unsigned int n_z0,
207 std::vector<float>& material, std::vector<float>& radius,
208 float Bfield,
bool parallel =
false,
209 unsigned int num_threads = 1);
212 void finalize(std::vector<SimpleTrack3D>& input,
213 std::vector<SimpleTrack3D>& output);
216 std::vector<SimpleTrack3D>& tracks,
219 std::vector<SimpleTrack3D>& tracks,
221 void initEvent(std::vector<SimpleHit3D>& hits,
unsigned int ) {
223 int min_layer = 999999;
225 for (
unsigned int i = 0; i < hits.size(); ++i) {
226 if (hits[i].get_layer() < min_layer) {
227 min_layer = hits[i].get_layer();
229 if (hits[i].get_layer() > max_layer) {
230 max_layer = hits[i].get_layer();
267 float max_d,
float min_z0,
float max_z0,
float min_dzdl,
268 float max_dzdl,
bool pairvoting =
false);
270 float max_d,
float min_z0,
float max_z0,
float min_dzdl,
271 float max_dzdl,
bool pairvoting =
false);
276 std::vector<float>& chi2_hit,
294 float* x1_a,
float* y1_a,
float* z1_a,
float* x2_a,
float* y2_a,
295 float* z2_a,
float* x3_a,
float* y3_a,
float* z3_a,
float* dx1_a,
296 float* dy1_a,
float* dz1_a,
float* dx2_a,
float* dy2_a,
float* dz2_a,
297 float* dx3_a,
float* dy3_a,
float* dz3_a,
float* kappa_a,
float* dkappa_a,
298 float* ux_mid_a,
float* uy_mid_a,
float* ux_end_a,
float* uy_end_a,
299 float* dzdl_1_a,
float* dzdl_2_a,
float* ddzdl_1_a,
float* ddzdl_2_a);
301 float* x1_a,
float* y1_a,
float* z1_a,
float* x2_a,
float* y2_a,
302 float* z2_a,
float* x3_a,
float* y3_a,
float* z3_a,
float* dx1_a,
303 float* dy1_a,
float* dz1_a,
float* dx2_a,
float* dy2_a,
float* dz2_a,
304 float* dx3_a,
float* dy3_a,
float* dz3_a,
float* kappa_a,
float* dkappa_a,
305 float* ux_mid_a,
float* uy_mid_a,
float* ux_end_a,
float* uy_end_a,
306 float* dzdl_1_a,
float* dzdl_2_a,
float* ddzdl_1_a,
float* ddzdl_2_a,
307 float sinang_cut,
float cosang_diff_inv,
float* cur_kappa_a,
308 float* cur_dkappa_a,
float* cur_ux_a,
float* cur_uy_a,
float* cur_chi2_a,
312 std::vector<SimpleTrack3D>& output,
313 std::vector<bool>& usetrack,
314 std::vector<float>& next_best_chi2);
316 std::vector<SimpleTrack3D>& output,
317 std::vector<bool>& usetrack,
318 std::vector<float>& next_best_chi2);
395 std::vector<SimpleHit3D> one_layer;
462 void initSplitting(std::vector<SimpleHit3D>& hits,
unsigned int min_hits,
463 unsigned int max_hits);
479 std::vector<SimpleTrack3D>& tracks,
488 std::set<std::vector<unsigned int> >
combos;
526 std::vector<SeamStress::Seamstress*> *
vssp;
527 std::vector<SeamStress::Seamstress>
vss;