85 for (
auto iter = beginend.first; iter != beginend.second; ++iter)
99 m_iterationMap = findNode::getClass<TrkrClusterIterationMapv1>(topNode,
"CLUSTER_ITERATION_MAP");
102 std::cerr <<
PHWHERE <<
"Cluster Iteration Map missing, aborting." << std::endl;
120 std::function<std::pair<Acts::Vector3, Acts::Vector2>(
126 return std::make_pair(
position, variance);
131 spacePoints, create_coordinates);
134 std::cout <<
"Acts::OrthogonalSeeder found " << seeds.size()
135 <<
" seeds " << std::endl;
143 for (
auto&
seed : seeds)
145 auto siseed = std::make_unique<TrackSeed_v1>();
146 std::map<TrkrDefs::cluskey, Acts::Vector3>
positions;
148 for (
auto& spptr :
seed.sp())
150 auto ckey = spptr->Id();
151 siseed->insert_cluster_key(ckey);
155 positions.insert(std::make_pair(ckey, globalPosition));
158 siseed->circleFitByTaubin(positions, 0, 8);
159 siseed->lineFit(positions, 0, 8);
164 for (
const auto& [key,
pos] : positions)
168 siseed->insert_cluster_key(key);
176 std::cout <<
"Found seed" << std::endl;
185 std::map<TrkrDefs::cluskey, Acts::Vector3>&
clusters,
191 const float B = seed.
get_Z0();
204 double xplus = std::get<0>(cci);
205 double yplus = std::get<1>(cci);
206 double xminus = std::get<2>(cci);
207 double yminus = std::get<3>(cci);
210 if (std::isnan(xplus))
214 std::cout <<
"Circle intersection calc failed, skipping"
217 <<
" and circ rad " << R <<
" with center " << X0
218 <<
", " << Y0 << std::endl;
227 for (
const auto& [key,
pos] : clusters)
229 float lastclusglobr = sqrt(
square(lastclusglob(0)) +
square(lastclusglob(1)));
231 if (thisr > lastclusglobr) lastclusglob =
pos;
234 const double lastClusPhi = atan2(lastclusglob(1), lastclusglob(0));
235 const double plusPhi = atan2(yplus, xplus);
236 const double minusPhi = atan2(yminus, xminus);
238 if (fabs(lastClusPhi - plusPhi) < fabs(lastClusPhi - minusPhi))
240 xProj[
layer] = xplus;
241 yProj[
layer] = yplus;
245 xProj[
layer] = xminus;
246 yProj[
layer] = yminus;
253 std::cout <<
"Projected point is : " << xProj[
layer] <<
", "
254 << yProj[
layer] <<
", " << zProj[
layer] << std::endl;
262 std::map<TrkrDefs::cluskey, Acts::Vector3>&
clusters,
263 const double xProj[],
264 const double yProj[],
265 const double zProj[])
267 for (
int inttlayer = 0; inttlayer <
m_nInttLayers; inttlayer++)
269 const double projR = std::sqrt(
square(xProj[inttlayer]) +
square(yProj[inttlayer]));
270 const double projPhi = std::atan2(yProj[inttlayer], xProj[inttlayer]);
271 const double projRphi = projR * projPhi;
275 double ladderLocation[3] = {0., 0., 0.};
284 const double ladderphi = atan2(ladderLocation[1], ladderLocation[0]) + layerGeom->get_strip_phi_tilt();
285 const auto stripZSpacing = layerGeom->get_strip_z_spacing();
286 float dphi = ladderphi - projPhi;
291 else if (dphi < -1 * M_PI)
299 if (fabs(dphi) > 0.2)
304 TVector3 projectionLocal(0, 0, 0);
305 TVector3 projectionGlobal(xProj[inttlayer], yProj[inttlayer], zProj[inttlayer]);
307 projectionLocal = layerGeom->get_local_from_world_coords(
surf,
312 for (
auto clusIter = range.first; clusIter != range.second; ++clusIter)
314 const auto cluskey = clusIter->first;
315 const auto cluster = clusIter->second;
319 if (fabs(projectionLocal[1] - cluster->getLocalX()) <
m_rPhiSearchWin and
320 fabs(projectionLocal[2] - cluster->getLocalY()) < stripZSpacing / 2.)
325 clusters.insert(std::make_pair(
cluskey, globalPos));
329 std::cout <<
"Matched INTT cluster with cluskey " <<
cluskey
330 <<
" and position " << globalPos.transpose()
332 <<
" with projections rphi "
333 << projRphi <<
" and inttclus rphi " << cluster->getLocalX()
334 <<
" and proj z " << zProj[inttlayer] <<
" and inttclus z "
335 << cluster->getLocalY() <<
" in layer " << inttlayer
337 <<
" in rphi and strip z spacing " << stripZSpacing
348 std::vector<const SpacePoint*> spVec;
349 unsigned int numSiliconHits = 0;
354 for (
auto clusIter = range.first; clusIter != range.second; ++clusIter)
356 const auto cluskey = clusIter->first;
357 const auto cluster = clusIter->second;
381 std::cout <<
"Total number of silicon hits to seed find with is "
382 << numSiliconHits << std::endl;
404 float x = globalPos.x();
405 float y = globalPos.y();
406 float z = globalPos.z();
407 float r = std::sqrt(x * x + y * y);
422 auto scale = 2 / std::hypot(x, y);
444 std::cout <<
"Space point has "
445 << x <<
", " << y <<
", " << z <<
" with local coords "
446 << localPos.transpose()
447 <<
" with rphi/z variances " << localCov(0, 0)
448 <<
", " << localCov(1, 1) <<
" and rotated variances "
449 << var[0] <<
", " << var[1]
450 <<
" and cluster key "
451 << key <<
" and geo id "
452 << surf->geometryId() << std::endl;
466 m_geomContainerIntt = findNode::getClass<PHG4CylinderGeomContainer>(topNode,
"CYLINDERGEOM_INTT");
469 std::cout <<
PHWHERE <<
"CYLINDERGEOM_INTT node not found on node tree"
474 m_tGeometry = findNode::getClass<ActsGeometry>(topNode,
"ActsGeometry");
477 std::cout <<
PHWHERE <<
"No ActsGeometry on node tree. Bailing."
483 m_clusterMap = findNode::getClass<TrkrClusterContainer>(topNode,
484 "TRKR_CLUSTER_TRUTH");
486 m_clusterMap = findNode::getClass<TrkrClusterContainer>(topNode,
491 std::cout <<
PHWHERE <<
"No cluster container on the node tree. Bailing."
507 std::cerr <<
"DST node is missing, quitting" << std::endl;
508 throw std::runtime_error(
"Failed to find DST node in PHActsKDTreeSeeding::createNodes");
538 std::make_unique<Acts::SeedFilter<SpacePoint>>(