1 #ifndef RecoTracker_PixelSeeding_src_CACell_h 2 #define RecoTracker_PixelSeeding_src_CACell_h 70 allStatus[
me].hasSameStateNeighbors = 0;
71 auto mystate = allStatus[
me].theCAState;
74 if (allStatus[oc].getCAState() == mystate) {
75 allStatus[
me].hasSameStateNeighbors = 1;
85 const float region_origin_x,
86 const float region_origin_y,
87 const float region_origin_radius,
91 std::vector<CACell::CAntuplet>* foundTriplets) {
92 int ncells = innerCells.size();
97 float thetaCut[VSIZE];
101 unsigned int cellId =
this - &allCells.front();
102 auto loop = [&](
int i,
int vs) {
103 for (
int j = 0;
j < vs; ++
j) {
104 auto koc = innerCells[
i +
j];
105 auto& oc = allCells[koc];
106 r1[
j] = oc.getInnerR();
107 z1[
j] = oc.getInnerZ();
108 thetaCut[
j] = thetaCutByInnerLayer.
at(oc.getInnerLayer());
109 phiCut[
j] = phiCutByInnerLayer.
at(oc.getInnerLayer());
112 for (
int j = 0;
j < vs; ++
j)
114 for (
int j = 0;
j < vs; ++
j) {
115 auto koc = innerCells[
i +
j];
116 auto& oc = allCells[koc];
118 oc,
ptmin, region_origin_x, region_origin_y, region_origin_radius, phiCut[
j],
hardPtCut)) {
122 oc.tagAsOuterNeighbor(cellId);
127 auto lim = VSIZE * (ncells / VSIZE);
128 for (
int i = 0;
i < lim;
i += VSIZE)
130 loop(lim, ncells - lim);
136 const float region_origin_x,
137 const float region_origin_y,
138 const float region_origin_radius,
147 region_origin_radius,
148 thetaCutByInnerLayer,
155 std::vector<CACell::CAntuplet>& foundTriplets,
157 const float region_origin_x,
158 const float region_origin_y,
159 const float region_origin_radius,
168 region_origin_radius,
169 thetaCutByInnerLayer,
177 float distance_13_squared = radius_diff * radius_diff + (z1 - zo) * (z1 - zo);
181 float tan_12_13_half_mul_distance_13_squared =
183 return tan_12_13_half_mul_distance_13_squared *
pMin <= thetaCut * distance_13_squared * radius_diff;
190 const float region_origin_x,
191 const float region_origin_y,
192 const float region_origin_radius,
204 float distance_13_squared = (
x1 - x3) * (
x1 - x3) + (
y1 - y3) * (
y1 - y3);
205 float tan_12_13_half_mul_distance_13_squared =
std::abs(
y1 * (
x2 - x3) +
y2 * (x3 -
x1) + y3 * (
x1 -
x2));
207 if (tan_12_13_half_mul_distance_13_squared *
ptmin <= 1.0
e-4
f * distance_13_squared) {
208 float distance_3_beamspot_squared =
209 (x3 - region_origin_x) * (x3 - region_origin_x) + (y3 - region_origin_y) * (y3 - region_origin_y);
211 float dot_bs3_13 = ((
x1 - x3) * (region_origin_x - x3) + (
y1 - y3) * (region_origin_y - y3));
212 float proj_bs3_on_13_squared = dot_bs3_13 * dot_bs3_13 / distance_13_squared;
214 float distance_13_beamspot_squared = distance_3_beamspot_squared - proj_bs3_on_13_squared;
216 return distance_13_beamspot_squared < (region_origin_radius + phiCut) * (region_origin_radius + phiCut);
224 auto det = (
x1 -
x2) * (
y2 - y3) - (
x2 - x3) * (
y1 -
y2);
230 auto cd = (
offset - x3 * x3 - y3 * y3) * 0.5
f;
232 auto idet = 1.f / det;
234 auto x_center = (bc * (
y2 - y3) -
cd * (
y1 -
y2)) * idet;
235 auto y_center = (
cd * (
x1 -
x2) - bc * (
x2 - x3)) * idet;
242 auto centers_distance_squared = (x_center - region_origin_x) * (x_center - region_origin_x) +
243 (y_center - region_origin_y) * (y_center - region_origin_y);
244 auto region_origin_radius_plus_tolerance = region_origin_radius + phiCut;
245 auto minimumOfIntersectionRange =
246 (
radius - region_origin_radius_plus_tolerance) * (
radius - region_origin_radius_plus_tolerance);
248 if (centers_distance_squared >= minimumOfIntersectionRange) {
249 auto maximumOfIntersectionRange =
250 (
radius + region_origin_radius_plus_tolerance) * (
radius + region_origin_radius_plus_tolerance);
251 return centers_distance_squared <= maximumOfIntersectionRange;
273 for (
unsigned int i = 0;
i < numberOfOuterNeighbors; ++
i) {
276 tmpNtuplet.pop_back();
291 #endif // RecoTracker_PixelSeeding_src_CACell_h
const HitDoublets * theDoublets
float getInnerPhi() const
void findNtuplets(CAColl &allCells, std::vector< CAntuplet > &foundNtuplets, CAntuplet &tmpNtuplet, const unsigned int minHitsPerNtuplet) const
int areAlignedRZ(float r1, float z1, float ro, float zo, const float ptmin, const float thetaCut) const
Hit const & hit(int i, layer l) const
int getInnerLayer() const
float x(int i, layer l) const
std::vector< CACellStatus > CAStatusColl
float getOuterPhi() const
void checkAlignmentAndPushTriplet(CAColl &allCells, CAntuple &innerCells, std::vector< CACell::CAntuplet > &foundTriplets, const float ptmin, const float region_origin_x, const float region_origin_y, const float region_origin_radius, const CACut::CAValuesByInnerLayerIds &thetaCutByInnerLayer, const CACut::CAValuesByInnerLayerIds &phiCutByInnerLayer, const float hardPtCut)
unsigned char getCAState() const
std::vector< unsigned int > CAntuple
void checkAlignmentAndTag(CAColl &allCells, CAntuple &innerCells, const float ptmin, const float region_origin_x, const float region_origin_y, const float region_origin_radius, const CACut::CAValuesByInnerLayerIds &thetaCutByInnerLayer, const CACut::CAValuesByInnerLayerIds &phiCutByInnerLayer, const float hardPtCut)
void tagAsOuterNeighbor(unsigned int otherCell)
void evolve(unsigned int me, CAStatusColl &allStatus)
Abs< T >::type abs(const T &t)
std::vector< CACell > CAColl
float rv(int i, layer l) const
BaseTrackerRecHit const * Hit
float z(int i, layer l) const
float phi(int i, layer l) const
auto const & foundNtuplets
std::vector< unsigned int > CAntuplet
Hit const & getOuterHit() const
CACell(const HitDoublets *doublets, int doubletId, const int innerHitId, const int outerHitId)
CAntuple theOuterNeighbors
bool isRootCell(const unsigned int minimumCAState) const
Hit const & getInnerHit() const
bool haveSimilarCurvature(const CACell &otherCell, const float ptmin, const float region_origin_x, const float region_origin_y, const float region_origin_radius, const float phiCut, const float hardPtCut) const
DetLayer const * detLayer(layer l) const
unsigned char hasSameStateNeighbors
void checkAlignmentAndAct(CAColl &allCells, CAntuple &innerCells, const float ptmin, const float region_origin_x, const float region_origin_y, const float region_origin_radius, const CACut::CAValuesByInnerLayerIds &thetaCutByInnerLayer, const CACut::CAValuesByInnerLayerIds &phiCutByInnerLayer, const float hardPtCut, std::vector< CACell::CAntuplet > *foundTriplets)
float at(int layerId) const
float y(int i, layer l) const
int getOuterLayer() const