44 std::cout <<
"PHTpcClusterMover:: layer = " <<
layer <<
" layer_radius " << GeoLayer->
get_radius() << std::endl;
83 _track = phtrk_iter->second;
87 std::cout << std::endl
89 <<
": Processing track itrack: " << phtrk_iter->first
90 <<
": nhits: " <<
_track-> size_cluster_keys()
97 std::vector<Acts::Vector3> globalClusterPositions;
98 std::map<TrkrDefs::cluskey, Acts::Vector3> tpc_clusters;
118 if( !cluster )
continue;
134 if(
Verbosity() > 2) std::cout <<
" layer " << layer <<
" distorted cluster position: " << global[0] <<
" " << global[1] <<
" " << global[2];
136 if(
Verbosity() > 2) std::cout <<
" corrected cluster position: " << global[0] <<
" " << global[1] <<
" " << global[2] << std::endl;
139 globalClusterPositions.push_back(global);
140 tpc_clusters.insert(std::make_pair(cluster_key, global));
145 if(globalClusterPositions.size() < 3)
147 if(
Verbosity() > 3) std::cout <<
PHWHERE <<
" -- skip this tpc track, not enough clusters: " << globalClusterPositions.size() << std::endl;
154 { std::cout <<
" Fitted circle has R " <<
R <<
" X0 " << X0 <<
" Y0 " <<
Y0 << std::endl; }
162 { std::cout <<
" Fitted line has A " <<
A <<
" B " << B << std::endl; }
165 for(
const auto& [
cluskey, global]:tpc_clusters )
177 double cluster_radius = sqrt(global[0] * global[0] + global[1] * global[1]);
205 std::cout <<
PHWHERE <<
"Failed to find surface for cluster " <<
cluskey << std::endl;
224 newclus->setSubSurfKey(subsurfkey);
241 double clusRadius = sqrt(xnew * xnew + ynew * ynew);
242 double clusphi = atan2(ynew, xnew);
243 double rClusPhi = clusRadius * clusphi;
244 double surfRadius = sqrt(center(0)*center(0) + center(1)*center(1));
245 double surfPhiCenter = atan2(center[1], center[0]);
246 double surfRphiCenter = surfPhiCenter * surfRadius;
247 double surfZCenter = center[2];
249 localPos(0) = rClusPhi - surfRphiCenter;
250 localPos(1) = znew - surfZCenter;
255 std::cout <<
"*** cluster_radius " << cluster_radius <<
" cluster x,y,z: " << global[0] <<
" " << global[1] <<
" " << global[2] << std::endl;
256 std::cout <<
" projection_radius " << target_radius <<
" proj x,y,z: " <<
_x_proj <<
" " <<
_y_proj <<
" " <<
_z_proj << std::endl;
257 std::cout <<
" traj_start_radius " << cluster_radius <<
" start x,y,z: "<<
_x_start <<
" " <<
_y_start <<
" " <<
_z_start << std::endl;
258 std::cout <<
" moved_clus_radius " << target_radius <<
" final x,y,z: "<< xnew <<
" " << ynew <<
" " << znew << std::endl;
262 newclus->setLocalX(localPos(0));
263 newclus->setLocalY(localPos(1));
282 _tpc_geom_container = findNode::getClass<PHG4TpcCylinderGeomContainer>(topNode,
"CYLINDERCELLGEOM_SVTX");
285 std::cout <<
PHWHERE <<
" ERROR: Can't find node CYLINDERCELLGEOM_SVTX" << std::endl;
289 _cluster_map = findNode::getClass<TrkrClusterContainer>(topNode,
"TRKR_CLUSTER");
292 std::cout <<
PHWHERE <<
" ERROR: Can't find node TRKR_CLUSTER" << std::endl;
296 _track_map = findNode::getClass<SvtxTrackMap>(topNode,
"SvtxTrackMap");
299 std::cout <<
PHWHERE <<
" ERROR: Can't find SvtxTrackMap: " << std::endl;
303 _tGeometry = findNode::getClass<ActsGeometry>(topNode,
"ActsGeometry");
306 std::cout <<
PHWHERE <<
"Error, can't find acts tracking geometry" << std::endl;
311 _dcc = findNode::getClass<TpcDistortionCorrectionContainer>(topNode,
"TpcDistortionCorrectionContainerStatic");
314 std::cout <<
"PHTpcClusterMover: found TPC distortion correction container" << std::endl;
321 std::cout <<
"Creating node CORRECTED_TRKR_CLUSTER" << std::endl;
329 std::cout <<
PHWHERE <<
"DST Node missing, doing nothing." << std::endl;
344 DetNode->
addNode(TrkrClusterContainerNode);
362 if(std::isnan(xplus))
366 std::cout <<
" circle/circle intersection calculation failed, skip this cluster" << std::endl;
367 std::cout <<
" target_radius " << target_radius <<
" fitted R " << R <<
" fitted X0 " << X0 <<
" fitted Y0 " << Y0 << std::endl;
373 if(fabs(xclus - xplus) < 5.0 && fabs(yclus - yplus) < 5.0)