1 #ifndef SPHENIX_SPHENIXSEEDFINDER_H
2 #define SPHENIX_SPHENIXSEEDFINDER_H
22 namespace SeamStress {
template <
class TClass>
class Pincushion; }
29 int a = (int) (
angle / twopi);
34 while (
angle >= twopi) {
45 static float absDiff(
float angle1,
float angle2) {
46 float diff = (angle1 - angle2);
50 while (diff < -
M_PI) {
71 vec.push_back(angind);
75 std::vector<AngleIndexPair*>& result) {
78 for (
unsigned int i = 0; i <
vec.size(); i++) {
80 result.push_back(&(
vec[i]));
86 std::vector<AngleIndexPair*>& result) {
88 int a = (int) (angle / twopi);
93 while (angle >= twopi) {
97 if (
vec.size() <= 4) {
105 unsigned int current = closest;
106 unsigned int lowest = 0;
107 unsigned int highest =
vec.size() - 1;
110 result.push_back(&(
vec[current]));
111 current = (current + 1) % (
vec.size());
112 if (current == closest) {
121 if (current <= closest) {
126 current = ((closest +
vec.size()) - 1) % (
vec.size());
128 if ((current == lowest) || (current == highest)) {
132 result.push_back(&(
vec[current]));
133 current = ((current +
vec.size()) - 1) % (
vec.size());
141 unsigned int upper) {
142 unsigned int closest = lower;
144 for (
unsigned int i = (lower + 1); i <= upper; i++) {
146 if (tempdiff < diff) {
156 if (
vec.size() <= 4) {
161 std::sort(
vec.begin(),
vec.end());
165 unsigned int lower = 0;
166 unsigned int upper =
vec.size() - 1;
167 unsigned int middle =
vec.size() / 2;
169 if ((upper - lower) <= 4) {
173 if (angle <=
vec[middle].angle) {
175 middle = (lower + upper) / 2;
178 middle = (lower + upper) / 2;
183 std::vector<AngleIndexPair>
vec;
199 std::vector<unsigned int>
hits;
208 unsigned int n_dzdl,
unsigned int n_z0,
211 std::vector<float>&
radius,
float Bfield);
214 std::vector<float>& material, std::vector<float>& radius,
215 float Bfield,
bool parallel =
false,
unsigned int num_threads = 1);
218 void finalize(std::vector<SimpleTrack3D>& input,
219 std::vector<SimpleTrack3D>& output);
221 void findTracks(std::vector<SimpleHit3D>& hits,
222 std::vector<SimpleTrack3D>& tracks,
const HelixRange& range);
225 std::vector<SimpleTrack3D>& tracks,
const HelixRange& range);
227 void initEvent(std::vector<SimpleHit3D>& hits,
unsigned int) {
228 int min_layer = 999999;
230 for (
unsigned int i = 0; i < hits.size(); ++i) {
231 if (hits[i].get_layer() < min_layer) {
232 min_layer = hits[i].get_layer();
234 if (hits[i].get_layer() > max_layer) {
235 max_layer = hits[i].get_layer();
269 unsigned int min_hits,
unsigned int max_hits,
270 std::vector<SimpleTrack3D>& tracks);
272 unsigned int min_hits,
unsigned int max_hits,
273 std::vector<SimpleTrack3D>& tracks);
281 float max_d,
float min_z0,
float max_z0,
float min_dzdl,
282 float max_dzdl,
bool pairvoting =
false);
284 float max_d,
float min_z0,
float max_z0,
float min_dzdl,
285 float max_dzdl,
bool pairvoting =
false);
315 float* x2_a,
float* y2_a,
float* z2_a,
float* x3_a,
float* y3_a,
316 float* z3_a,
float* dx1_a,
float* dy1_a,
float* dz1_a,
float* dx2_a,
317 float* dy2_a,
float* dz2_a,
float* dx3_a,
float* dy3_a,
318 float* dz3_a,
float* kappa_a,
float* dkappa_a,
float* ux_mid_a,
319 float* uy_mid_a,
float* ux_end_a,
float* uy_end_a,
float* dzdl_1_a,
320 float* dzdl_2_a,
float* ddzdl_1_a,
float* ddzdl_2_a);
322 float* x2_a,
float* y2_a,
float* z2_a,
float* x3_a,
float* y3_a,
323 float* z3_a,
float* dx1_a,
float* dy1_a,
float* dz1_a,
float* dx2_a,
324 float* dy2_a,
float* dz2_a,
float* dx3_a,
float* dy3_a,
325 float* dz3_a,
float* kappa_a,
float* dkappa_a,
float* ux_mid_a,
326 float* uy_mid_a,
float* ux_end_a,
float* uy_end_a,
float* dzdl_1_a,
327 float* dzdl_2_a,
float* ddzdl_1_a,
float* ddzdl_2_a,
328 float sinang_cut,
float cosang_diff_inv,
float* cur_kappa_a,
329 float* cur_dkappa_a,
float* cur_ux_a,
float* cur_uy_a,
330 float* cur_chi2_a,
float* chi2_a);
337 std::vector<SimpleTrack3D>& output, std::vector<bool>& usetrack,
338 std::vector<float>& next_best_chi2);
340 std::vector<SimpleTrack3D>& output, std::vector<bool>& usetrack,
341 std::vector<float>& next_best_chi2);
411 std::vector<SimpleHit3D> one_layer;
480 void initSplitting(std::vector<SimpleHit3D>& hits,
unsigned int min_hits,
481 unsigned int max_hits);
506 std::set<std::vector<unsigned int> >
combos;
544 std::vector<SeamStress::Seamstress*> *
vssp;
545 std::vector<SeamStress::Seamstress>
vss;