53 std::cout <<
"Starting ActsEvaluator::Init" << std::endl;
58 std::cout <<
"Error: Nodes not available in ActsEvaluator::Init"
67 std::cout <<
"Finished ActsEvaluator::Init" << std::endl;
82 std::vector<Acts::MultiTrajectoryTraits::IndexType>& trackTips,
90 std::cout <<
"Starting ActsEvaluator at event " <<
m_eventNr
99 std::cout <<
"Finished ActsEvaluator::process_event" << std::endl;
104 std::vector<Acts::MultiTrajectoryTraits::IndexType>& trackTips,
112 std::cout <<
"Evaluating Acts track fits" << std::endl;
115 if (trackTips.empty())
119 std::cout <<
"TrackTips empty in ActsEvaluator" << std::endl;
126 int iTrack = track->
get_id();
130 std::cout <<
"Starting trajectory with trackKey " << track->
get_id()
131 <<
" and corresponding to tpc track seed "
135 const auto& mj = tracks.trackStateContainer();
136 const auto& trackTip = trackTips.front();
141 std::cout <<
"beginning trackTip " << trackTip
142 <<
" corresponding to track " << iTrack
143 <<
" in trajectroy " << iTraj << std::endl;
148 std::cout <<
"Evaluating track key " << iTrack
149 <<
" for track tip " << trackTip << std::endl;
156 std::cout <<
"Analyzing SvtxTrack " << iTrack << std::endl;
158 std::cout <<
"TruthParticle : " << g4particle->
get_px()
159 <<
", " << g4particle->
get_py() <<
", "
160 << g4particle->
get_pz() <<
", " << g4particle->
get_e()
169 const auto& params = paramsMap.find(trackTip)->second;
174 std::cout <<
"Fitted params : "
179 std::cout <<
"Track has " << trajState.nMeasurements
180 <<
" measurements and " << trajState.nHoles
181 <<
" holes and " << trajState.nOutliers
182 <<
" outliers and " << trajState.nStates
183 <<
" states " << std::endl;
207 std::cout <<
"Finished track " << iTrack << std::endl;
212 std::cout <<
"Analyzed " << iTrack <<
" tracks in trajectory number "
213 << iTraj << std::endl;
218 std::cout <<
"Finished evaluating track fits" << std::endl;
231 const size_t& trackTip,
236 std::cout <<
"Begin visit track states" << std::endl;
242 auto typeFlags =
state.typeFlags();
251 auto geoID =
surface.geometryId();
258 std::cout <<
"Cluster volume : layer : sensitive " << geoID.volume()
259 <<
" : " << geoID.layer() <<
" : "
260 << geoID.sensitive() << std::endl;
262 auto sourceLink =
state.getUncalibratedSourceLink().template get<ActsSourceLink>();
263 const auto&
cluskey = sourceLink.cluskey();
268 std::visit([&](
const auto& meas) {
269 local(0) = meas.parameters()[0];
270 local(1) = meas.parameters()[1];
271 }, measurements[sourceLink.index()]);
283 auto cov =
state.effectiveCalibratedCovariance();
296 float gx = globalTruthPos(0);
297 float gy = globalTruthPos(1);
298 float gz = globalTruthPos(2);
301 const float r = sqrt(gx * gx + gy * gy + gz * gz);
304 auto vecResult =
surface.globalToLocal(
313 m_t_r.push_back(sqrt(gx * gx + gy * gy));
322 float truthTHETA = 0;
332 truthLOC0 = truthLocVec.x();
333 truthLOC1 = truthLocVec.y();
341 truthPHI =
phi(globalTruthUnitDir);
342 truthTHETA =
theta(globalTruthUnitDir);
352 m_t_eT.push_back(truthTIME);
355 bool predicted =
false;
356 if (
state.hasPredicted())
365 auto H =
state.effectiveProjector();
398 parameters[Acts::eBoundTheta] - truthTHETA);
406 sqrt(
covariance(Acts::eBoundLoc0, Acts::eBoundLoc0)));
408 sqrt(
covariance(Acts::eBoundLoc1, Acts::eBoundLoc1)));
410 sqrt(
covariance(Acts::eBoundPhi, Acts::eBoundPhi)));
412 sqrt(
covariance(Acts::eBoundTheta, Acts::eBoundTheta)));
414 sqrt(
covariance(Acts::eBoundQOverP, Acts::eBoundQOverP)));
416 sqrt(
covariance(Acts::eBoundTime, Acts::eBoundTime)));
420 (parameters[Acts::eBoundLoc0] - truthLOC0) /
421 sqrt(
covariance(Acts::eBoundLoc0, Acts::eBoundLoc0)));
423 (parameters[Acts::eBoundLoc1] - truthLOC1) /
424 sqrt(
covariance(Acts::eBoundLoc1, Acts::eBoundLoc1)));
426 (parameters[Acts::eBoundPhi] - truthPHI) /
427 sqrt(
covariance(Acts::eBoundPhi, Acts::eBoundPhi)));
429 (parameters[Acts::eBoundTheta] - truthTHETA) /
430 sqrt(
covariance(Acts::eBoundTheta, Acts::eBoundTheta)));
432 (parameters[Acts::eBoundQOverP] - truthQOP) /
433 sqrt(
covariance(Acts::eBoundQOverP, Acts::eBoundQOverP)));
435 (parameters[Acts::eBoundTime] - truthTIME) /
436 sqrt(
covariance(Acts::eBoundTime, Acts::eBoundTime)));
450 m_pT_prt.push_back(
p * std::hypot(freeParams[Acts::eFreeDir0],
451 freeParams[Acts::eFreeDir1]));
499 bool filtered =
false;
500 if (
state.hasFiltered())
505 auto parameter =
state.filtered();
530 sqrt(
covariance(Acts::eBoundLoc0, Acts::eBoundLoc0)));
532 sqrt(
covariance(Acts::eBoundLoc1, Acts::eBoundLoc1)));
534 sqrt(
covariance(Acts::eBoundPhi, Acts::eBoundPhi)));
536 sqrt(
covariance(Acts::eBoundTheta, Acts::eBoundTheta)));
538 sqrt(
covariance(Acts::eBoundQOverP, Acts::eBoundQOverP)));
540 sqrt(
covariance(Acts::eBoundTime, Acts::eBoundTime)));
544 (parameter[Acts::eBoundLoc0] - truthLOC0) /
545 sqrt(
covariance(Acts::eBoundLoc0, Acts::eBoundLoc0)));
547 (parameter[Acts::eBoundLoc1] - truthLOC1) /
548 sqrt(
covariance(Acts::eBoundLoc1, Acts::eBoundLoc1)));
550 (parameter[Acts::eBoundPhi] - truthPHI) /
551 sqrt(
covariance(Acts::eBoundPhi, Acts::eBoundPhi)));
553 (parameter[Acts::eBoundTheta] - truthTHETA) /
554 sqrt(
covariance(Acts::eBoundTheta, Acts::eBoundTheta)));
556 (parameter[Acts::eBoundQOverP] - truthQOP) /
557 sqrt(
covariance(Acts::eBoundQOverP, Acts::eBoundQOverP)));
559 (parameter[Acts::eBoundTime] - truthTIME) /
560 sqrt(
covariance(Acts::eBoundTime, Acts::eBoundTime)));
572 m_pT_flt.push_back(sqrt(
p * std::hypot(freeparams[Acts::eFreeDir0],
573 freeparams[Acts::eFreeDir1])));
574 m_eta_flt.push_back(
eta(freeparams.segment<3>(Acts::eFreeDir0)));
615 bool smoothed =
false;
616 if (
state.hasSmoothed())
621 auto parameter =
state.smoothed();
646 sqrt(
covariance(Acts::eBoundLoc0, Acts::eBoundLoc0)));
648 sqrt(
covariance(Acts::eBoundLoc1, Acts::eBoundLoc1)));
650 sqrt(
covariance(Acts::eBoundPhi, Acts::eBoundPhi)));
652 sqrt(
covariance(Acts::eBoundTheta, Acts::eBoundTheta)));
654 sqrt(
covariance(Acts::eBoundQOverP, Acts::eBoundQOverP)));
656 sqrt(
covariance(Acts::eBoundTime, Acts::eBoundTime)));
660 (parameter[Acts::eBoundLoc0] - truthLOC0) /
661 sqrt(
covariance(Acts::eBoundLoc0, Acts::eBoundLoc0)));
663 (parameter[Acts::eBoundLoc1] - truthLOC1) /
664 sqrt(
covariance(Acts::eBoundLoc1, Acts::eBoundLoc1)));
666 (parameter[Acts::eBoundPhi] - truthPHI) /
667 sqrt(
covariance(Acts::eBoundPhi, Acts::eBoundPhi)));
669 (parameter[Acts::eBoundTheta] - truthTHETA) /
670 sqrt(
covariance(Acts::eBoundTheta, Acts::eBoundTheta)));
672 (parameter[Acts::eBoundQOverP] - truthQOP) /
673 sqrt(
covariance(Acts::eBoundQOverP, Acts::eBoundQOverP)));
675 (parameter[Acts::eBoundTime] - truthTIME) /
676 sqrt(
covariance(Acts::eBoundTime, Acts::eBoundTime)));
688 m_pT_smt.push_back(sqrt(
p * std::hypot(freeparams[Acts::eFreeDir0],
689 freeparams[Acts::eFreeDir1])));
690 m_eta_smt.push_back(
eta(freeparams.segment<3>(Acts::eFreeDir0)));
731 m_prt.push_back(predicted);
732 m_flt.push_back(filtered);
733 m_smt.push_back(smoothed);
739 std::cout <<
"Finished track states" << std::endl;
758 gx = truth_cluster->getX();
759 gy = truth_cluster->getY();
760 gz = truth_cluster->getZ();
783 std::cout <<
"Filling proto track seed quantities" << std::endl;
821 for (
auto svtxseed : {siseed, tpcseed})
828 for (
auto clusIter = svtxseed->begin_cluster_keys();
829 clusIter != svtxseed->end_cluster_keys();
832 auto key = *clusIter;
837 cluster->getLocalY());
843 double zdriftlength = cluster->getLocalY() * drift_velocity;
844 double surfCenterZ = 52.89;
845 double zloc = surfCenterZ - zdriftlength;
847 if (side == 0) zloc = -zloc;
854 m_SLx.push_back(globalPos(0));
855 m_SLy.push_back(globalPos(1));
856 m_SLz.push_back(globalPos(2));
865 float gx = globalTruthPos(0);
866 float gy = globalTruthPos(1);
867 float gz = globalTruthPos(2);
870 const float r = sqrt(gx * gx + gy * gy + gz * gz);
903 std::cout <<
"Filled proto track" << std::endl;
908 const size_t& trackTip)
914 std::cout <<
"Filling fitted track parameters" << std::endl;
918 if (paramsMap.find(trackTip) != paramsMap.end())
921 const auto& boundParam = paramsMap.find(trackTip)->second;
922 const auto& parameter = boundParam.parameters();
923 const auto&
covariance = *boundParam.covariance();
941 m_px_fit = boundParam.momentum()(0);
942 m_py_fit = boundParam.momentum()(1);
943 m_pz_fit = boundParam.momentum()(2);
974 std::cout <<
"Finished fitted track params" << std::endl;
993 std::cout <<
"truth vertex : (" <<
m_t_vx <<
", " <<
m_t_vy
994 <<
", " <<
m_t_vz <<
")" << std::endl;
1026 m_tpcSeeds = findNode::getClass<TrackSeedContainer>(topNode,
"TpcTrackSeedContainer");
1027 m_siliconSeeds = findNode::getClass<TrackSeedContainer>(topNode,
"SiliconTrackSeedContainer");
1031 std::cout <<
PHWHERE <<
"Seed containers not found, cannot continue!"
1036 m_truthInfo = findNode::getClass<PHG4TruthInfoContainer>(topNode,
"G4TruthInfo");
1040 std::cout <<
PHWHERE <<
"PHG4TruthInfoContainer not found, cannot continue!"
1046 m_tGeometry = findNode::getClass<ActsGeometry>(topNode,
"ActsGeometry");
1050 std::cout <<
PHWHERE <<
"No Acts Tracking geometry on node tree. Bailing"
1056 m_trackMap = findNode::getClass<SvtxTrackMap>(topNode,
"SvtxTrackMap");
1060 std::cout <<
PHWHERE <<
"No SvtxTrackMap on node tree. Bailing."
1069 std::cout <<
PHWHERE <<
"No Acts proto tracks on node tree. Bailing."
1074 m_clusterContainer = findNode::getClass<TrkrClusterContainer>(topNode,
"TRKR_CLUSTER");
1077 std::cout <<
PHWHERE <<
"No clusters, bailing"
1250 m_trackTree =
new TTree(
"tracktree",
"A tree with Acts KF track information");
1252 m_trackTree->Branch(
"event_nr", &
m_eventNr);
1253 m_trackTree->Branch(
"traj_nr", &
m_trajNr);
1254 m_trackTree->Branch(
"track_nr", &
m_trackNr);
1255 m_trackTree->Branch(
"t_barcode", &
m_t_barcode,
"t_barcode/l");
1256 m_trackTree->Branch(
"t_charge", &
m_t_charge);
1257 m_trackTree->Branch(
"t_time", &
m_t_time);
1258 m_trackTree->Branch(
"t_vx", &
m_t_vx);
1259 m_trackTree->Branch(
"t_vy", &
m_t_vy);
1260 m_trackTree->Branch(
"t_vz", &
m_t_vz);
1261 m_trackTree->Branch(
"t_px", &
m_t_px);
1262 m_trackTree->Branch(
"t_py", &
m_t_py);
1263 m_trackTree->Branch(
"t_pz", &
m_t_pz);
1264 m_trackTree->Branch(
"t_theta", &
m_t_theta);
1265 m_trackTree->Branch(
"t_phi", &
m_t_phi);
1266 m_trackTree->Branch(
"t_eta", &
m_t_eta);
1267 m_trackTree->Branch(
"t_pT", &
m_t_pT);
1269 m_trackTree->Branch(
"t_x", &
m_t_x);
1270 m_trackTree->Branch(
"t_y", &
m_t_y);
1271 m_trackTree->Branch(
"t_z", &
m_t_z);
1272 m_trackTree->Branch(
"t_r", &
m_t_r);
1273 m_trackTree->Branch(
"t_dx", &
m_t_dx);
1274 m_trackTree->Branch(
"t_dy", &
m_t_dy);
1275 m_trackTree->Branch(
"t_dz", &
m_t_dz);
1276 m_trackTree->Branch(
"t_eLOC0", &
m_t_eLOC0);
1277 m_trackTree->Branch(
"t_eLOC1", &
m_t_eLOC1);
1278 m_trackTree->Branch(
"t_ePHI", &
m_t_ePHI);
1279 m_trackTree->Branch(
"t_eTHETA", &
m_t_eTHETA);
1280 m_trackTree->Branch(
"t_eQOP", &
m_t_eQOP);
1281 m_trackTree->Branch(
"t_eT", &
m_t_eT);
1284 m_trackTree->Branch(
"chi2_fit", &
m_chi2_fit);
1285 m_trackTree->Branch(
"quality", &
m_quality);
1286 m_trackTree->Branch(
"ndf_fit", &
m_ndf_fit);
1289 m_trackTree->Branch(
"ePHI_fit", &
m_ePHI_fit);
1291 m_trackTree->Branch(
"eQOP_fit", &
m_eQOP_fit);
1292 m_trackTree->Branch(
"eT_fit", &
m_eT_fit);
1300 m_trackTree->Branch(
"g_px_fit", &
m_px_fit);
1301 m_trackTree->Branch(
"g_py_fit", &
m_py_fit);
1302 m_trackTree->Branch(
"g_pz_fit", &
m_pz_fit);
1303 m_trackTree->Branch(
"g_x_fit", &
m_x_fit);
1304 m_trackTree->Branch(
"g_y_fit", &
m_y_fit);
1305 m_trackTree->Branch(
"g_z_fit", &
m_z_fit);
1306 m_trackTree->Branch(
"g_dca3Dxy_fit", &
m_dca3Dxy);
1307 m_trackTree->Branch(
"g_dca3Dz_fit", &
m_dca3Dz);
1309 m_trackTree->Branch(
"g_dca3Dz_cov", &
m_dca3DzCov);
1317 m_trackTree->Branch(
"g_protoTrackD0Cov", &
m_protoD0Cov);
1318 m_trackTree->Branch(
"g_protoTrackZ0Cov", &
m_protoZ0Cov);
1322 m_trackTree->Branch(
"g_SLx", &
m_SLx);
1323 m_trackTree->Branch(
"g_SLy", &
m_SLy);
1324 m_trackTree->Branch(
"g_SLz", &
m_SLz);
1325 m_trackTree->Branch(
"l_SLx", &
m_SL_lx);
1326 m_trackTree->Branch(
"l_SLy", &
m_SL_ly);
1327 m_trackTree->Branch(
"t_SL_lx", &
m_t_SL_lx);
1328 m_trackTree->Branch(
"t_SL_ly", &
m_t_SL_ly);
1329 m_trackTree->Branch(
"t_SL_gx", &
m_t_SL_gx);
1330 m_trackTree->Branch(
"t_SL_gy", &
m_t_SL_gy);
1331 m_trackTree->Branch(
"t_SL_gz", &
m_t_SL_gz);
1334 m_trackTree->Branch(
"nHoles", &
m_nHoles);
1336 m_trackTree->Branch(
"nStates", &
m_nStates);
1338 m_trackTree->Branch(
"volume_id", &
m_volumeID);
1339 m_trackTree->Branch(
"layer_id", &
m_layerID);
1340 m_trackTree->Branch(
"module_id", &
m_moduleID);
1341 m_trackTree->Branch(
"l_x_hit", &
m_lx_hit);
1342 m_trackTree->Branch(
"l_y_hit", &
m_ly_hit);
1343 m_trackTree->Branch(
"g_x_hit", &
m_x_hit);
1344 m_trackTree->Branch(
"g_y_hit", &
m_y_hit);
1345 m_trackTree->Branch(
"g_z_hit", &
m_z_hit);
1352 m_trackTree->Branch(
"dim_hit", &
m_dim_hit);
1355 m_trackTree->Branch(
"predicted", &
m_prt);
1358 m_trackTree->Branch(
"ePHI_prt", &
m_ePHI_prt);
1360 m_trackTree->Branch(
"eQOP_prt", &
m_eQOP_prt);
1361 m_trackTree->Branch(
"eT_prt", &
m_eT_prt);
1380 m_trackTree->Branch(
"g_x_prt", &
m_x_prt);
1381 m_trackTree->Branch(
"g_y_prt", &
m_y_prt);
1382 m_trackTree->Branch(
"g_z_prt", &
m_z_prt);
1383 m_trackTree->Branch(
"px_prt", &
m_px_prt);
1384 m_trackTree->Branch(
"py_prt", &
m_py_prt);
1385 m_trackTree->Branch(
"pz_prt", &
m_pz_prt);
1386 m_trackTree->Branch(
"eta_prt", &
m_eta_prt);
1387 m_trackTree->Branch(
"pT_prt", &
m_pT_prt);
1390 m_trackTree->Branch(
"filtered", &
m_flt);
1393 m_trackTree->Branch(
"ePHI_flt", &
m_ePHI_flt);
1395 m_trackTree->Branch(
"eQOP_flt", &
m_eQOP_flt);
1396 m_trackTree->Branch(
"eT_flt", &
m_eT_flt);
1415 m_trackTree->Branch(
"g_x_flt", &
m_x_flt);
1416 m_trackTree->Branch(
"g_y_flt", &
m_y_flt);
1417 m_trackTree->Branch(
"g_z_flt", &
m_z_flt);
1418 m_trackTree->Branch(
"px_flt", &
m_px_flt);
1419 m_trackTree->Branch(
"py_flt", &
m_py_flt);
1420 m_trackTree->Branch(
"pz_flt", &
m_pz_flt);
1421 m_trackTree->Branch(
"eta_flt", &
m_eta_flt);
1422 m_trackTree->Branch(
"pT_flt", &
m_pT_flt);
1423 m_trackTree->Branch(
"chi2", &
m_chi2);
1426 m_trackTree->Branch(
"smoothed", &
m_smt);
1429 m_trackTree->Branch(
"ePHI_smt", &
m_ePHI_smt);
1431 m_trackTree->Branch(
"eQOP_smt", &
m_eQOP_smt);
1432 m_trackTree->Branch(
"eT_smt", &
m_eT_smt);
1451 m_trackTree->Branch(
"g_x_smt", &
m_x_smt);
1452 m_trackTree->Branch(
"g_y_smt", &
m_y_smt);
1453 m_trackTree->Branch(
"g_z_smt", &
m_z_smt);
1454 m_trackTree->Branch(
"px_smt", &
m_px_smt);
1455 m_trackTree->Branch(
"py_smt", &
m_py_smt);
1456 m_trackTree->Branch(
"pz_smt", &
m_pz_smt);
1457 m_trackTree->Branch(
"eta_smt", &
m_eta_smt);
1458 m_trackTree->Branch(
"pT_smt", &
m_pT_smt);