1 #ifndef SPHENIX_SPHENIXTRACKER_H
2 #define SPHENIX_SPHENIXTRACKER_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;
199 sPHENIXTracker(
unsigned int n_phi,
unsigned int n_d,
unsigned int n_k,
200 unsigned int n_dzdl,
unsigned int n_z0,
205 sPHENIXTracker(std::vector<std::vector<unsigned int> >& zoom_profile,
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,
220 std::vector<SimpleTrack3D>& tracks,
223 void initEvent(std::vector<SimpleHit3D>& hits,
unsigned int ) {
224 int min_layer = 999999;
226 for (
unsigned int i = 0; i < hits.size(); ++i) {
227 if (hits[i].get_layer() < min_layer) {
228 min_layer = hits[i].get_layer();
230 if (hits[i].get_layer() > max_layer) {
231 max_layer = hits[i].get_layer();
265 unsigned int min_hits,
unsigned int max_hits,
266 std::vector<SimpleTrack3D>& tracks);
268 unsigned int min_hits,
269 unsigned int max_hits,
270 std::vector<SimpleTrack3D>& tracks);
278 float max_d,
float min_z0,
float max_z0,
float min_dzdl,
279 float max_dzdl,
bool pairvoting =
false);
281 float max_d,
float min_z0,
float max_z0,
float min_dzdl,
282 float max_dzdl,
bool pairvoting =
false);
302 float* x1_a,
float* y1_a,
float* z1_a,
float* x2_a,
float* y2_a,
303 float* z2_a,
float* x3_a,
float* y3_a,
float* z3_a,
float* dx1_a,
304 float* dy1_a,
float* dz1_a,
float* dx2_a,
float* dy2_a,
float* dz2_a,
305 float* dx3_a,
float* dy3_a,
float* dz3_a,
float* kappa_a,
float* dkappa_a,
306 float* ux_mid_a,
float* uy_mid_a,
float* ux_end_a,
float* uy_end_a,
307 float* dzdl_1_a,
float* dzdl_2_a,
float* ddzdl_1_a,
float* ddzdl_2_a);
309 float* x1_a,
float* y1_a,
float* z1_a,
float* x2_a,
float* y2_a,
310 float* z2_a,
float* x3_a,
float* y3_a,
float* z3_a,
float* dx1_a,
311 float* dy1_a,
float* dz1_a,
float* dx2_a,
float* dy2_a,
float* dz2_a,
312 float* dx3_a,
float* dy3_a,
float* dz3_a,
float* kappa_a,
float* dkappa_a,
313 float* ux_mid_a,
float* uy_mid_a,
float* ux_end_a,
float* uy_end_a,
314 float* dzdl_1_a,
float* dzdl_2_a,
float* ddzdl_1_a,
float* ddzdl_2_a,
315 float sinang_cut,
float cosang_diff_inv,
float* cur_kappa_a,
316 float* cur_dkappa_a,
float* cur_ux_a,
float* cur_uy_a,
float* cur_chi2_a,
324 std::vector<SimpleTrack3D>& output,
325 std::vector<bool>& usetrack,
326 std::vector<float>& next_best_chi2);
328 std::vector<SimpleTrack3D>& output,
329 std::vector<bool>& usetrack,
330 std::vector<float>& next_best_chi2);
398 std::vector<SimpleHit3D> one_layer;
465 void initSplitting(std::vector<SimpleHit3D>& hits,
unsigned int min_hits,
466 unsigned int max_hits);
491 std::set<std::vector<unsigned int> >
combos;
529 std::vector<SeamStress::Seamstress*> *
vssp;
530 std::vector<SeamStress::Seamstress>
vss;