19 #include <phfield/PHField.h>
20 #include <phfield/PHFieldConfigv2.h>
21 #include <phfield/PHFieldUtility.h>
23 #include <phgeom/PHGeomUtility.h>
39 #include <log4cpp/CategoryStream.hh>
43 #include <TMatrixDSymfwd.h>
44 #include <TMatrixTSym.h>
45 #include <TMatrixTUtils.h>
47 #include <TVectorDfwd.h>
65 , mTGeoManager(nullptr)
68 , mEnableVertexing(
false)
69 , mEnableJsonExport(
false)
109 LOG_INFO(
"tracking.PHTpcTracker.process_event") <<
"---- process event started -----";
122 LOG_ERROR_IF(
"tracking.PHTpcTracker.process_event", !
mTGeoManager) <<
"Cannot find TGeoManager, track propagation will fail";
132 std::vector<kdfinder::TrackCandidate<double>*> candidates;
134 LOG_INFO(
"tracking.PHTpcTracker.process_event") <<
"SeedFinder produced " << candidates.size() <<
" track seeds";
138 std::vector<PHGenFit2::Track*> gtracks;
140 LOG_INFO(
"tracking.PHTpcTracker.process_event") <<
"TrackFollower reconstructed " << gtracks.size() <<
" tracks";
143 for (
int i = 0, ilen = gtracks.size(); i < ilen; i++)
146 std::shared_ptr<SvtxTrack_v2> svtx_track(
new SvtxTrack_v2());
150 svtx_track->set_id(1);
152 TVectorD state = gtracks[i]->getGenFitTrack()->getStateSeed();
153 TVector3
pos(state(0), state(1), state(2));
154 TVector3
mom(state(3), state(4), state(5));
155 TMatrixDSym cov = gtracks[i]->getGenFitTrack()->getCovSeed();
158 double charge = gtracks[i]->get_charge();
160 svtx_track->set_charge(charge);
162 for (
int k = 0;
k < 6;
k++)
164 for (
int j = 0; j < 6; j++)
166 svtx_track->set_error(
k, j, cov[
k][j]);
170 svtx_track->set_px(mom.Px());
171 svtx_track->set_py(mom.Py());
172 svtx_track->set_pz(mom.Pz());
174 svtx_track->set_x(pos.X());
175 svtx_track->set_y(pos.Y());
176 svtx_track->set_z(pos.Z());
180 svtx_track->insert_cluster_key(cluster_key);
185 std::cout <<
PHWHERE <<
" track identify: " << std::endl;
186 svtx_track->identify();
194 for (
auto it = candidates.begin();
it != candidates.end(); ++
it)
200 for (
auto it = gtracks.begin();
it != gtracks.end(); ++
it)
208 LOG_INFO(
"tracking.PHTpcTracker.process_event") <<
"---- process event finished -----";
221 const double point[] = {0, 0, 0, 0};
222 double Bx = 0, By = 0,
Bz = 0;
223 double Bfield[] = {std::numeric_limits<double>::signaling_NaN(),
224 std::numeric_limits<double>::signaling_NaN(),
225 std::numeric_limits<double>::signaling_NaN(),
226 std::numeric_limits<double>::signaling_NaN(),
227 std::numeric_limits<double>::signaling_NaN(),
228 std::numeric_limits<double>::signaling_NaN()};
239 LOG_WARN(
"tracking.PHTpcTracker.process_event") <<
"No field found in file, using default Bz value = " << B <<
" Tesla";
246 double maxdistance2,
double tripletangle2,
size_t minhits2,
size_t nthreads)
249 maxdistance2, tripletangle2, minhits2, nthreads);