1 #ifndef RecoPixelVertexing_PixelTriplets_src_CACell_h
2 #define RecoPixelVertexing_PixelTriplets_src_CACell_h
65 allStatus[
me].hasSameStateNeighbors = 0;
66 auto mystate = allStatus[
me].theCAState;
69 if (allStatus[oc].getCAState() == mystate) {
70 allStatus[
me].hasSameStateNeighbors = 1;
80 const float region_origin_x,
81 const float region_origin_y,
82 const float region_origin_radius,
85 const float hardPtCut,
86 std::vector<CACell::CAntuplet>* foundTriplets) {
87 int ncells = innerCells.size();
88 int constexpr VSIZE = 16;
94 unsigned int cellId =
this - &allCells.front();
95 auto loop = [&](
int i,
int vs) {
96 for (
int j = 0;
j < vs; ++
j) {
97 auto koc = innerCells[
i +
j];
98 auto& oc = allCells[koc];
99 r1[
j] = oc.getInnerR();
100 z1[
j] = oc.getInnerZ();
103 for (
int j = 0;
j < vs; ++
j)
105 for (
int j = 0;
j < vs; ++
j) {
106 auto koc = innerCells[
i +
j];
107 auto& oc = allCells[koc];
109 oc,
ptmin, region_origin_x, region_origin_y, region_origin_radius, phiCut, hardPtCut)) {
113 oc.tagAsOuterNeighbor(cellId);
118 auto lim = VSIZE * (ncells / VSIZE);
119 for (
int i = 0;
i < lim;
i += VSIZE)
121 loop(lim, ncells - lim);
127 const float region_origin_x,
128 const float region_origin_y,
129 const float region_origin_radius,
130 const float thetaCut,
132 const float hardPtCut) {
138 region_origin_radius,
146 std::vector<CACell::CAntuplet>& foundTriplets,
148 const float region_origin_x,
149 const float region_origin_y,
150 const float region_origin_radius,
151 const float thetaCut,
153 const float hardPtCut) {
159 region_origin_radius,
168 float distance_13_squared = radius_diff * radius_diff + (z1 - zo) * (z1 - zo);
172 float tan_12_13_half_mul_distance_13_squared =
174 return tan_12_13_half_mul_distance_13_squared *
pMin <= thetaCut * distance_13_squared * radius_diff;
181 const float region_origin_x,
182 const float region_origin_y,
183 const float region_origin_radius,
185 const float hardPtCut)
const {
195 float distance_13_squared = (
x1 - x3) * (
x1 - x3) + (
y1 - y3) * (
y1 - y3);
196 float tan_12_13_half_mul_distance_13_squared =
std::abs(
y1 * (
x2 - x3) +
y2 * (x3 -
x1) + y3 * (
x1 -
x2));
198 if (tan_12_13_half_mul_distance_13_squared *
ptmin <= 1.0
e-4
f * distance_13_squared) {
199 float distance_3_beamspot_squared =
200 (x3 - region_origin_x) * (x3 - region_origin_x) + (y3 - region_origin_y) * (y3 - region_origin_y);
202 float dot_bs3_13 = ((
x1 - x3) * (region_origin_x - x3) + (
y1 - y3) * (region_origin_y - y3));
203 float proj_bs3_on_13_squared = dot_bs3_13 * dot_bs3_13 / distance_13_squared;
205 float distance_13_beamspot_squared = distance_3_beamspot_squared - proj_bs3_on_13_squared;
207 return distance_13_beamspot_squared < (region_origin_radius + phiCut) * (region_origin_radius + phiCut);
213 float minRadius = hardPtCut * 87.f;
215 auto det = (
x1 -
x2) * (
y2 - y3) - (
x2 - x3) * (
y1 -
y2);
221 auto cd = (
offset - x3 * x3 - y3 * y3) * 0.5
f;
223 auto idet = 1.f / det;
225 auto x_center = (bc * (
y2 - y3) -
cd * (
y1 -
y2)) * idet;
226 auto y_center = (
cd * (
x1 -
x2) - bc * (
x2 - x3)) * idet;
233 auto centers_distance_squared = (x_center - region_origin_x) * (x_center - region_origin_x) +
234 (y_center - region_origin_y) * (y_center - region_origin_y);
235 auto region_origin_radius_plus_tolerance = region_origin_radius + phiCut;
236 auto minimumOfIntersectionRange =
237 (
radius - region_origin_radius_plus_tolerance) * (
radius - region_origin_radius_plus_tolerance);
239 if (centers_distance_squared >= minimumOfIntersectionRange) {
240 auto maximumOfIntersectionRange =
241 (
radius + region_origin_radius_plus_tolerance) * (
radius + region_origin_radius_plus_tolerance);
242 return centers_distance_squared <= maximumOfIntersectionRange;
252 std::vector<CAntuplet>& foundNtuplets,
254 const unsigned int minHitsPerNtuplet)
const {
260 if (tmpNtuplet.size() == minHitsPerNtuplet - 1) {
261 foundNtuplets.push_back(tmpNtuplet);
264 for (
unsigned int i = 0;
i < numberOfOuterNeighbors; ++
i) {
266 allCells[
theOuterNeighbors[
i]].findNtuplets(allCells, foundNtuplets, tmpNtuplet, minHitsPerNtuplet);
267 tmpNtuplet.pop_back();
282 #endif // RecoPixelVertexing_PixelTriplets_src_CACell_h