30 #include <phfield/PHFieldUtility.h>
32 #include <phgenfit/Fitter.h>
33 #include <phgenfit/Measurement.h>
34 #include <phgenfit/PlanarMeasurement.h>
35 #include <phgenfit/SpacepointMeasurement.h>
36 #include <phgenfit/Track.h>
38 #include <phgeom/PHGeomUtility.h>
71 #include <GenFit/AbsMeasurement.h>
72 #include <GenFit/EventDisplay.h>
73 #include <GenFit/Exception.h>
74 #include <GenFit/GFRaveConverters.h>
75 #include <GenFit/GFRaveTrackParameters.h>
76 #include <GenFit/GFRaveVertex.h>
77 #include <GenFit/GFRaveVertexFactory.h>
78 #include <GenFit/KalmanFitterInfo.h>
79 #include <GenFit/MeasuredStateOnPlane.h>
80 #include <GenFit/RKTrackRep.h>
82 #include <GenFit/TrackPoint.h>
85 #include <rave/ConstantMagneticField.h>
86 #include <rave/VacuumPropagator.h>
87 #include <rave/VertexFactory.h>
89 #include <TClonesArray.h>
90 #include <TRotation.h>
94 #include <TMatrixDSymfwd.h>
95 #include <TMatrixFfwd.h>
97 #include <TMatrixTSym.h>
98 #include <TMatrixTUtils.h>
99 #include <TVectorDfwd.h>
100 #include <TVectorT.h>
111 namespace genfit {
class AbsTrackRep; }
113 #define LogDebug(exp) std::cout << "DEBUG: " << __FILE__ << ": " << __LINE__ << ": " << exp << std::endl
114 #define LogError(exp) std::cout << "ERROR: " << __FILE__ << ": " << __LINE__ << ": " << exp << std::endl
115 #define LogWarning(exp) std::cout << "WARNING: " << __FILE__ << ": " << __LINE__ << ": " << exp << std::endl
119 #define _DEBUG_MODE_ 0
129 template<
class T >
T square(
T x ) {
return x*
x; }
144 for (
int i = 0;
i < 6;
i++)
146 for (
int j =
i;
j < 6;
j++)
157 std::vector<TrkrDefs::cluskey>
out;
161 { std::copy(
seed->begin_cluster_keys(),
seed->end_cluster_keys(), std::back_inserter( out ) ); }
168 out <<
"(" << vector.x() <<
", " << vector.y() <<
", " << vector.z() <<
")";
235 std::cout <<
"PHGenFitTrkFitter::InitRun - m_fit_silicon_mms: " <<
m_fit_silicon_mms << std::endl;
236 std::cout <<
"PHGenFitTrkFitter::InitRun - m_use_micromegas: " <<
m_use_micromegas << std::endl;
242 { std::cout <<
PHWHERE <<
" Layer " <<
layer <<
" is disabled." << std::endl; }
259 { std::cout <<
PHWHERE <<
"Events processed: " <<
_event << std::endl; }
267 unsigned int trackid = 0;
275 if(siid == std::numeric_limits<unsigned int>::max())
continue;
277 if( !siseed )
continue;
281 if(crossing == SHRT_MAX)
continue;
286 if( !tpcseed )
continue;
289 auto svtxtrack = std::make_unique<SvtxTrack_v4>();
290 svtxtrack->set_id( trackid++ );
291 svtxtrack->set_silicon_seed( siseed );
292 svtxtrack->set_tpc_seed( tpcseed );
296 svtxtrack->set_x(siseed->get_x());
297 svtxtrack->set_y(siseed->get_y());
298 svtxtrack->set_z(siseed->get_z());
301 svtxtrack->set_charge( tpcseed->get_qOverR() > 0 ? 1 : -1);
304 svtxtrack->set_pz(tpcseed->get_pz());
312 vector<genfit::Track*> rf_gf_tracks;
313 vector<std::shared_ptr<PHGenFit::Track> > rf_phgf_tracks;
315 map<unsigned int, unsigned int> svtxtrack_genfittrack_map;
323 auto svtx_track = iter->second;
324 if (!svtx_track)
continue;
327 cout <<
" process SVTXTrack " << iter->first << endl;
328 svtx_track->identify();
331 if (!(svtx_track->get_pt() >
_fit_min_pT))
continue;
335 std::shared_ptr<PHGenFit::Track> rf_phgf_track =
ReFitTrack(topNode, svtx_track);
338 svtxtrack_genfittrack_map[svtx_track->get_id()] = rf_phgf_tracks.size();
339 rf_phgf_tracks.push_back(rf_phgf_track);
341 rf_gf_tracks.push_back(rf_phgf_track->getGenFitTrack());
342 if(
Verbosity() > 10) cout <<
"Done refitting input track" << svtx_track->get_id() <<
" or rf_phgf_track " << rf_phgf_tracks.size() << endl;
346 cout <<
"failed refitting input track# " << iter->first << endl;
358 vector<genfit::Track*> copy;
363 _fitter->getEventDisplay()->addEvent(copy);
367 std::vector<genfit::GFRaveVertex*> rave_vertices;
369 if (rf_gf_tracks.size() >= 2)
372 {cout <<
"Call Rave vertex finder" << endl;
373 cout <<
" rf_gf_tracks size " << rf_gf_tracks.size() << endl;
374 for(
long unsigned int i=0;
i<rf_gf_tracks.size();++
i)
376 cout <<
" track " <<
i <<
" num points " << rf_gf_tracks[
i]->getNumPointsWithMeasurement() << endl;
386 std::cout <<
PHWHERE <<
"GFRaveVertexFactory::findVertices failed!";
390 if(
Verbosity() > 10 && rave_vertices.size() == 0)
392 cout <<
PHWHERE <<
" Rave found no vertices - SvtxVertexMapRefit will be empty" << endl;
406 std::shared_ptr<PHGenFit::Track> rf_phgf_track;
409 unsigned int itrack =0;
410 if (svtxtrack_genfittrack_map.find(iter->second->get_id()) != svtxtrack_genfittrack_map.end())
413 svtxtrack_genfittrack_map[iter->second->get_id()];
414 rf_phgf_track = rf_phgf_tracks[itrack];
421 unsigned int ivert = 0;
428 if(
Verbosity() > 20) cout <<
PHWHERE <<
" gf track " << itrack <<
" will add to track: m_vertexMap_refit vertex " << ivert
429 <<
" with position x,y,z = " << vertex->
get_x() <<
" " << vertex->
get_y() <<
" " << vertex->
get_z() << endl;
431 std::shared_ptr<SvtxTrack> rf_track =
MakeSvtxTrack(iter->second, rf_phgf_track,
435 cout << __LINE__ << endl;
445 auto key = iter->first;
465 { iter->second->
CopyFrom( rf_track.get() ); }
471 auto key = iter->first;
482 cout << __LINE__ << endl;
488 rf_phgf_tracks.clear();
492 cout << __LINE__ << endl;
522 std::shared_ptr<PHGenFit::Track> rf_phgf_track =
ReFitTrack(topNode, svtx_track,
531 std::shared_ptr<SvtxTrack> rf_track =
MakeSvtxTrack(svtx_track,
532 rf_phgf_track, vertex);
547 LogError(
"No vertex in SvtxVertexMapRefit!");
551 cout << __LINE__ << endl;
557 rave_vertices.clear();
564 cout << __LINE__ << endl;
617 {
new ((*_tca_trackmap)[i++])(
SvtxTrack_v4)( *pair.second ); }
631 {
new ((*_tca_trackmap_refit)[i++])(
SvtxTrack_v4)(*pair.second); }
638 {
new ((*_tca_primtrackmap)[i++])(
SvtxTrack_v4)(*pair.second); }
676 _eval_tree =
new TTree(
"T",
"PHGenFitTrkFitter Evaluation");
730 cerr <<
PHWHERE <<
"DST Node missing, doing nothing." << endl;
740 dstNode->addNode(svtx_node);
742 cout <<
"SVTX node added" << endl;
746 m_trackMap = findNode::getClass<SvtxTrackMap>(topNode,
"SvtxTrackMap");
751 svtx_node->addNode(
node);
758 svtx_node->addNode(tracks_node);
760 { std::cout <<
"Svtx/SvtxTrackMapRefit node added" << std::endl; }
767 svtx_node->addNode(primary_tracks_node);
769 { std::cout <<
"Svtx/PrimaryTrackMap node added" << std::endl; }
775 svtx_node->addNode(vertexes_node);
777 { cout <<
"Svtx/SvtxVertexMapRefit node added" << endl; }
822 m_tgeometry = findNode::getClass<ActsGeometry>(topNode,
"ActsGeometry");
825 std::cout <<
"PHGenFitTrkFitter::GetNodes - No acts tracking geometry, can't proceed" << std::endl;
831 _truth_container = findNode::getClass<PHG4TruthInfoContainer>(topNode,
"G4TruthInfo");
834 m_clustermap = findNode::getClass<TrkrClusterContainer>(topNode,
"CORRECTED_TRKR_CLUSTER");
839 { std::cout <<
"PHGenFitTrkFitter::GetNodes - Using CORRECTED_TRKR_CLUSTER node " << std::endl; }
844 { std::cout <<
"PHGenFitTrkFitter::GetNodes - CORRECTED_TRKR_CLUSTER node not found, using TRKR_CLUSTER" << std::endl; }
845 m_clustermap = findNode::getClass<TrkrClusterContainer>(topNode,
"TRKR_CLUSTER");
851 cout <<
PHWHERE <<
"PHGenFitTrkFitter::GetNodes - TRKR_CLUSTER node not found on node tree" << endl;
856 m_seedMap = findNode::getClass<TrackSeedContainer>(topNode,
"SvtxTrackSeedContainer");
859 std::cout <<
"PHGenFitTrkFitter::GetNodes - No Svtx seed map on node tree. Exiting." << std::endl;
863 m_tpcSeeds = findNode::getClass<TrackSeedContainer>(topNode,
"TpcTrackSeedContainer");
866 std::cout <<
"PHGenFitTrkFitter::GetNodes - TpcTrackSeedContainer not on node tree. Bailing"
871 m_siliconSeeds = findNode::getClass<TrackSeedContainer>(topNode,
"SiliconTrackSeedContainer");
874 std::cout <<
"PHGenFitTrkFitter::GetNodes - SiliconTrackSeedContainer not on node tree. Bailing"
880 m_trackMap = findNode::getClass<SvtxTrackMap>(topNode,
"SvtxTrackMap");
883 cout <<
"PHGenFitTrkFitter::GetNodes - SvtxTrackMap node not found on node tree" << endl;
888 _vertexmap = findNode::getClass<SvtxVertexMap>(topNode,
"SvtxVertexMap");
891 cout <<
PHWHERE <<
" SvtxVertexrMap node not found on node tree"
900 "SvtxTrackMapRefit");
903 cout <<
PHWHERE <<
" SvtxTrackMapRefit node not found on node tree"
916 cout <<
PHWHERE <<
" PrimaryTrackMap node not found on node tree"
924 "SvtxVertexMapRefit");
927 cout <<
PHWHERE <<
" SvtxVertexMapRefit node not found on node tree"
933 m_dcc_static = findNode::getClass<TpcDistortionCorrectionContainer>(topNode,
"TpcDistortionCorrectionContainerStatic");
934 m_dcc_average = findNode::getClass<TpcDistortionCorrectionContainer>(topNode,
"TpcDistortionCorrectionContainerAverage");
935 m_dcc_fluctuation = findNode::getClass<TpcDistortionCorrectionContainer>(topNode,
"TpcDistortionCorrectionContainerFluctuation");
971 return globalPosition;
985 cerr <<
PHWHERE <<
" Input SvtxTrack is nullptr!" << endl;
989 auto geom_container_intt = findNode::getClass<PHG4CylinderGeomContainer>(topNode,
"CYLINDERGEOM_INTT");
990 assert( geom_container_intt );
992 auto geom_container_mvtx = findNode::getClass<PHG4CylinderGeomContainer>(topNode,
"CYLINDERGEOM_MVTX");
993 assert( geom_container_mvtx );
996 auto geom_container_micromegas = findNode::getClass<PHG4CylinderGeomContainer>(topNode,
"CYLINDERGEOM_MICROMEGAS_FULL");
1000 assert( crossing != SHRT_MAX );
1003 TVector3 seed_mom(100, 0, 0);
1004 TVector3 seed_pos(0, 0, 0);
1005 TMatrixDSym seed_cov(6);
1006 for (
int i = 0;
i < 6;
i++)
1008 for (
int j = 0;
j < 6;
j++)
1010 seed_cov[
i][
j] = 100.;
1015 std::vector<PHGenFit::Measurement*> measurements;
1018 const double vertex_chi2_over_dnf_cut = 1000;
1019 const double vertex_cov_element_cut = 10000;
1026 bool is_vertex_cov_sane =
true;
1027 for (
unsigned int i = 0;
i < 3;
i++)
1028 for (
unsigned int j = 0;
j < 3;
j++)
1035 is_vertex_cov_sane =
false;
1039 if (is_vertex_cov_sane)
1042 measurements.push_back(meas);
1045 meas->getMeasurement()->Print();
1052 std::map<float, TrkrDefs::cluskey> m_r_cluster_id;
1054 unsigned int n_silicon_clusters = 0;
1055 unsigned int n_micromegas_clusters = 0;
1064 ++n_silicon_clusters;
1068 ++n_micromegas_clusters;
1076 const auto globalPosition =
getGlobalPosition( cluster_key, cluster, crossing );
1078 float r = sqrt(
square( globalPosition.x() ) +
square( globalPosition.y() ));
1079 m_r_cluster_id.insert(std::pair<float, TrkrDefs::cluskey>(r, cluster_key));
1081 if(
Verbosity() > 10) cout <<
" Layer " << layer_out <<
" cluster " << cluster_key <<
" radius " << r << endl;
1087 if( n_silicon_clusters == 0 )
return nullptr;
1091 for (
auto iter = m_r_cluster_id.begin();
1092 iter != m_r_cluster_id.end();
1113 <<
": ID: " << cluster_key
1114 <<
": layer: " << output_layer
1118 const auto globalPosition_acts =
getGlobalPosition( cluster_key, cluster, crossing );
1120 const TVector3
pos(globalPosition_acts.x(), globalPosition_acts.y(), globalPosition_acts.z() );
1121 seed_mom.SetPhi(
pos.Phi());
1122 seed_mom.SetTheta(
pos.Theta());
1125 TVector3
n( globalPosition_acts.x(), globalPosition_acts.y(), 0 );
1133 double ladder_location[3] = {0.0, 0.0, 0.0};
1134 auto geom =
static_cast<CylinderGeom_Mvtx*
>(geom_container_mvtx->GetLayerGeom(layer));
1142 n.SetXYZ(ladder_location[0], ladder_location[1], 0);
1143 n.RotateZ(geom->get_stave_phi_tilt());
1149 auto geom =
static_cast<CylinderGeomIntt*
>(geom_container_intt->GetLayerGeom(layer));
1150 double hit_location[3] = {0.0, 0.0, 0.0};
1157 n.SetXYZ(hit_location[0], hit_location[1], 0);
1158 n.RotateZ(geom->get_strip_phi_tilt());
1166 assert( geom_container_micromegas );
1172 n = geom->get_world_from_local_vect( tileid,
m_tgeometry, TVector3( 0, 0, 1 ) );
1180 double cluster_z_error = cluster->
getZError();
1187 cout <<
"Add meas layer " << layer <<
" cluskey " << cluster_key
1188 <<
" pos.X " <<
pos.X() <<
" pos.Y " <<
pos.Y() <<
" pos.Z " <<
pos.Z()
1190 <<
" n.X " <<
n.X() <<
" n.Y " <<
n.Y()
1195 measurements.push_back(meas);
1210 std::shared_ptr<PHGenFit::Track> track(
new PHGenFit::Track(rep, seed_pos, seed_mom, seed_cov));
1213 track->addMeasurements(measurements);
1220 if (
_fitter->processTrack(track.get(),
false) != 0)
1231 cout <<
" track->getChisq() " << track->get_chi2() <<
" get_ndf " << track->get_ndf()
1232 <<
" mom.X " << track->get_mom().X()
1233 <<
" mom.Y " << track->get_mom().Y()
1234 <<
" mom.Z " << track->get_mom().Z()
1245 const std::shared_ptr<PHGenFit::Track>& phgf_track,
const SvtxVertex*
vertex)
1247 double chi2 = phgf_track->get_chi2();
1248 double ndf = phgf_track->get_ndf();
1250 TVector3 vertex_position(0, 0, 0);
1251 TMatrixF vertex_cov(3, 3);
1260 vertex_position.SetXYZ(first_point->
get_x(), first_point->
get_y(), first_point->
get_z());
1263 std::cout <<
PHWHERE <<
"Using: truth vertex: {" << vertex_position.X() <<
", " << vertex_position.Y() <<
", " << vertex_position.Z() <<
"} " << std::endl;
1266 std::cout <<
PHWHERE <<
"PHG4TruthInfoContainer not found. Cannot use truth vertex." << std::endl;
1271 vertex_position.SetXYZ(vertex->
get_x(), vertex->
get_y(),
1276 for (
int i = 0;
i < 3;
i++)
1277 for (
int j = 0;
j < 3;
j++)
1281 std::unique_ptr<genfit::MeasuredStateOnPlane> gf_state_beam_line_ca;
1284 gf_state_beam_line_ca.reset(phgf_track->extrapolateToLine(vertex_position,
1285 TVector3(0., 0., 1.)));
1292 if (!gf_state_beam_line_ca)
return nullptr;
1301 double u = gf_state_beam_line_ca->
getState()[3];
1302 double v = gf_state_beam_line_ca->
getState()[4];
1304 double du2 = gf_state_beam_line_ca->
getCov()[3][3];
1305 double dv2 = gf_state_beam_line_ca->
getCov()[4][4];
1310 auto out_track = std::make_shared<SvtxTrack_v4>(*svtx_track);
1313 out_track->clear_states();
1321 out_track->insert_state( &first );
1324 out_track->set_dca2d(u);
1325 out_track->set_dca2d_error(sqrt(du2 + dvr2));
1327 std::unique_ptr<genfit::MeasuredStateOnPlane> gf_state_vertex_ca;
1330 gf_state_vertex_ca.reset( phgf_track->extrapolateToPoint(vertex_position) );
1337 if (!gf_state_vertex_ca)
1343 TVector3 mom = gf_state_vertex_ca->
getMom();
1344 TVector3
pos = gf_state_vertex_ca->
getPos();
1351 u = gf_state_vertex_ca->
getState()[3];
1352 v = gf_state_vertex_ca->
getState()[4];
1354 du2 = gf_state_vertex_ca->
getCov()[3][3];
1355 dv2 = gf_state_vertex_ca->
getCov()[4][4];
1357 double dca3d = sqrt(u * u + v * v);
1358 double dca3d_error = sqrt(du2 + dv2 + dvr2 + dvz2);
1360 out_track->set_dca(dca3d);
1361 out_track->set_dca_error(dca3d_error);
1366 float dca3d_xy = NAN;
1367 float dca3d_z = NAN;
1368 float dca3d_xy_error = NAN;
1369 float dca3d_z_error = NAN;
1373 TMatrixF pos_in(3, 1);
1374 TMatrixF cov_in(3, 3);
1375 TMatrixF pos_out(3, 1);
1376 TMatrixF cov_out(3, 3);
1379 TMatrixDSym cov6(6, 6);
1383 TVector3 vn(state6[3], state6[4], state6[5]);
1386 pos_in[0][0] = state6[0] - vertex_position.X();
1387 pos_in[1][0] = state6[1] - vertex_position.Y();
1388 pos_in[2][0] = state6[2] - vertex_position.Z();
1390 for (
int i = 0;
i < 3; ++
i)
1392 for (
int j = 0;
j < 3; ++
j)
1394 cov_in[
i][
j] = cov6[
i][
j] + vertex_cov[
i][
j];
1403 cout <<
" vn.X " << vn.X() <<
" vn.Y " << vn.Y() <<
" vn.Z " << vn.Z() << endl;
1404 cout <<
" pos_in.X " << pos_in[0][0] <<
" pos_in.Y " << pos_in[1][0] <<
" pos_in.Z " << pos_in[2][0] << endl;
1405 cout <<
" pos_out.X " << pos_out[0][0] <<
" pos_out.Y " << pos_out[1][0] <<
" pos_out.Z " << pos_out[2][0] << endl;
1409 dca3d_xy = pos_out[0][0];
1410 dca3d_z = pos_out[2][0];
1411 dca3d_xy_error = sqrt(cov_out[0][0]);
1412 dca3d_z_error = sqrt(cov_out[2][2]);
1415 cout << __LINE__ <<
": Vertex: ----------------" << endl;
1416 vertex_position.Print();
1419 cout << __LINE__ <<
": State: ----------------" << endl;
1423 cout << __LINE__ <<
": Mean: ----------------" << endl;
1425 cout <<
"===>" << endl;
1428 cout << __LINE__ <<
": Cov: ----------------" << endl;
1430 cout <<
"===>" << endl;
1442 out_track->set_dca3d_xy(dca3d_xy);
1443 out_track->set_dca3d_z(dca3d_z);
1444 out_track->set_dca3d_xy_error(dca3d_xy_error);
1445 out_track->set_dca3d_z_error(dca3d_z_error);
1449 out_track->set_chisq(chi2);
1450 out_track->set_ndf(ndf);
1451 out_track->set_charge(phgf_track->get_charge());
1453 out_track->set_px(mom.Px());
1454 out_track->set_py(mom.Py());
1455 out_track->set_pz(mom.Pz());
1457 out_track->set_x(pos.X());
1458 out_track->set_y(pos.Y());
1459 out_track->set_z(pos.Z());
1461 for (
int i = 0;
i < 6;
i++)
1463 for (
int j =
i;
j < 6;
j++)
1465 out_track->set_error(
i,
j, cov[
i][
j]);
1470 cout << __LINE__ << endl;
1473 const genfit::Track* gftrack = phgf_track->getGenFitTrack();
1498 gf_state = &kfi->getFittedState(
true);
1515 auto state = create_track_state( pathlength, gf_state );
1516 out_track->insert_state( &
state );
1522 <<
": " << pathlength <<
" => "
1533 const auto crossing = svtx_track->get_crossing();
1534 assert( crossing != SHRT_MAX );
1536 unsigned int id_min = 0;
1547 const auto globalPosition =
getGlobalPosition( cluster_key, cluster, crossing );
1548 const TVector3
pos(globalPosition.x(), globalPosition.y(), globalPosition.z() );
1549 const float r_cluster = std::sqrt(
square(globalPosition.x()) +
square(globalPosition.y()) );
1553 unsigned int id = id_min;
1558 if (!trpoint)
continue;
1567 gf_state = &kfi->getFittedState(
true);
1572 {
LogWarning(
"Failed to get kf fitted state"); }
1576 if( !gf_state )
continue;
1579 if( r_track > r_cluster )
break;
1585 float pathlength = 0;
1588 if(
id > 0 ) id_min =
id-1;
1594 if( !trpoint )
continue;
1597 gf_state = *kfi->getForwardUpdate();
1599 auto tmp = *kfi->getBackwardUpdate();
1600 pathlength -=
tmp.extrapolateToPoint( vertex_position );
1603 { std::cerr <<
PHWHERE <<
"Failed to forward extrapolate from id " << id_min <<
" to disabled layer " <<
layer << std::endl; }
1609 if(
id > 0 && id < gftrack->getNumPointsWithMeasurement() )
1613 if( !trpoint )
continue;
1621 { std::cerr <<
PHWHERE <<
"Failed to backward extrapolate from id " <<
id <<
" to disabled layer " <<
layer << std::endl; }
1626 auto state = create_track_state( pathlength, &gf_state );
1627 out_track->insert_state( &
state );
1636 for(
auto&& iter = out_track->begin_states(); iter != out_track->end_states(); ++iter )
1638 const auto& [pathlength,
state] = *iter;
1640 const auto phi = std::atan2(
state->get_y(),
state->get_x() );
1641 std::cout <<
"PHGenFitTrkFitter::MakeSvtxTrack -"
1642 <<
" pathlength: " << pathlength
1645 <<
" z: " <<
state->get_z()
1649 std::cout << std::endl;
1658 const std::vector<genfit::GFRaveVertex*>& rave_vertices,
1659 const std::vector<genfit::Track*>& gf_tracks)
1662 if(
Verbosity()) cout <<
"Rave vertices size " << rave_vertices.size() << endl;
1663 if(rave_vertices.size() > 0)
1665 for (
unsigned int ivtx = 0; ivtx < rave_vertices.size(); ++ivtx)
1675 if(
Verbosity()) cout <<
" ivtx " << ivtx <<
" has Z = " << rave_vtx->
getPos().Z() << endl;
1684 for (
int i = 0;
i < 3;
i++)
1685 for (
int j = 0;
j < 3;
j++)
1693 for (
unsigned int j = 0;
j < gf_tracks.size();
j++)
1695 if (rave_track == gf_tracks[
j])
1699 if(
Verbosity()) cout <<
" rave vertex " << ivtx <<
" at Z " << svtx_vtx.
get_position(2) <<
" rave track " <<
i <<
" genfit track ID " << j << endl;
1706 if(
Verbosity()) cout <<
"insert svtx_vtx into m_vertexMap_refit " << endl;
1721 const TVector3&
n,
const TMatrixF& pos_in,
const TMatrixF& cov_in,
1722 TMatrixF& pos_out, TMatrixF& cov_out)
const
1724 if (pos_in.GetNcols() != 1 || pos_in.GetNrows() != 3)
1730 if (cov_in.GetNcols() != 3 || cov_in.GetNrows() != 3)
1738 TVector3
r = n.Cross(TVector3(0., 0., 1.));
1739 if (r.Mag() < 0.00001)
1752 float phi = -TMath::ATan2(r.Y(), r.X());
1754 R[0][1] = -sin(phi);
1773 pos_out.ResizeTo(3, 1);
1774 cov_out.ResizeTo(3, 3);
1776 pos_out = R * pos_in;
1777 cov_out = R * cov_in * R_T;