20 #include "TDatabasePDG.h" 23 #include "TPrincipal.h" 37 #include "art_root_io/TFileService.h" 67 const double* xyz1 = h1->
XYZ();
68 const double* xyz2 = h2->
XYZ();
69 return xyz1[2] < xyz2[2];
74 const double* xyz1 = h1->
XYZ();
75 const double* xyz2 = h2->
XYZ();
76 return xyz1[1] < xyz2[1];
81 const double* xyz1 = h1->
XYZ();
82 const double* xyz2 = h2->
XYZ();
83 return xyz1[0] < xyz2[0];
89 const unsigned int s1 = h1.
size();
90 const unsigned int s2 = h2.
size();
106 void rotationCov(TMatrixT<Double_t>& cov,
const TVector3& u,
const TVector3& v);
220 fPosErr = pset.get<std::vector<double>>(
"PosErr3");
221 fMomErr = pset.get<std::vector<double>>(
"MomErr3");
222 fMomStart = pset.get<std::vector<double>>(
"MomStart3");
223 fPerpLim = pset.get<
double>(
"PerpLimit", 1.e6);
224 fDoFit = pset.get<
bool>(
"DoFit",
true);
225 fNumIt = pset.get<
int>(
"NumIt", 5);
227 pset.get<
int>(
"MinNumSppts", 5);
228 fErrScaleS = pset.get<
double>(
"ErrScaleSim", 1.0);
229 fErrScaleM = pset.get<
double>(
"ErrScaleMeas", 1.0);
230 fDecimate = pset.get<
int>(
"DecimateC", 40);
231 fMaxUpdate = pset.get<
double>(
"MaxUpdateC", 0.1);
234 pset.get<
double>(
"DistanceU", 10.0);
235 fMaxUpdateU = pset.get<
double>(
"MaxUpdateU", 0.02);
236 fMomLow = pset.get<
double>(
"MomLow", 0.01);
237 fMomHigh = pset.get<
double>(
"MomHigh", 20.);
238 fPdg = pset.get<
int>(
"PdgCode", -13);
239 fChi2Thresh = pset.get<
double>(
"Chi2HitThresh", 12.0E12);
240 fSortDim = pset.get<std::string>(
"SortDirection",
"z");
241 fMaxPass = pset.get<
int>(
"MaxPass", 2);
243 if (pset.get_if_present(
"GenfPRINT", fGenfPRINT)) {
245 <<
"Parameter 'GenfPRINT' has been deprecated.\n" 246 "Please use the standard message facility to enable GenFit debug output.";
257 produces<std::vector<recob::Track>>();
258 produces<art::Assns<recob::Track, recob::Cluster>>();
259 produces<art::Assns<recob::Track, recob::SpacePoint>>();
260 produces<art::Assns<recob::Track, recob::Hit>>();
267 const double charge(1.0);
268 const double mEE(188.);
269 const double matZ(18.);
270 const double matA(40.);
271 const double matDensity(1.4);
272 const double me(0.000511);
274 double beta = p / std::sqrt(mass * mass + p * p);
275 double gammaSquare = 1. / (1.0 - beta * beta);
277 double dedx = 0.307075 * matDensity * matZ / matA / (beta * beta) * charge * charge;
278 double massRatio = me / mass;
280 double argument = gammaSquare * beta * beta * me * 1.E3 * 2. /
281 ((1.E-6 * mEE) * std::sqrt(1 + 2 * std::sqrt(gammaSquare) * massRatio +
282 massRatio * massRatio));
284 if (mass == 0.0)
return (0.0);
285 if (argument <= exp(beta * beta)) { dedx = 0.; }
287 dedx *= (log(argument) - beta * beta);
289 if (dedx < 0.) dedx = 0.;
296 TVector3 xhat(1.0, 0.0, 0.0);
297 TVector3 yhat(0.0, 1.0, 0.0);
298 TVector3 zhat(0.0, 0.0, 1.0);
299 TVector3
w(u.Cross(v));
301 TVector3 vprime(
w.Cross(xhat));
302 Double_t angle(v.Angle(vprime));
304 uprime.Rotate(angle,
w);
305 if (uprime * xhat < 0) {
306 uprime.Rotate(TMath::Pi(),
w);
307 vprime.Rotate(TMath::Pi(),
w);
308 angle += TMath::Pi();
311 double c = TMath::Cos(angle), s = TMath::Sin(angle);
312 TMatrixT<Double_t> rot(5, 5);
337 std::vector<double> v;
339 double mindist(100.0);
340 auto spptminIt(sppt);
341 while (sppt != s.
end()) {
342 if (((**sppt).XYZ() - loc).Mag() < mindist) {
343 double dist = ((**sppt).XYZ() - loc).Mag();
346 if (dist < mindist) {
349 if (mindist < 0.01)
break;
355 unsigned int ind(std::distance(s.
begin(), spptminIt));
357 std::vector<art::Ptr<recob::Hit>> hitlist = h.at(ind);
359 double wirePitch = 0.;
360 double angleToVert = 0;
366 ihit != hitlist.end();
370 auto const& plane = wireReadoutGeom.Plane(hit1.
WireID());
372 wirePitch = plane.WirePitch();
373 angleToVert = plane.Wire(0).ThetaZ(
false) - 0.5 * TMath::Pi();
377 TMath::Abs(TMath::Sin(angleToVert) * dir.Y() + TMath::Cos(angleToVert) * dir.Z());
379 v.push_back(charge / wirePitch / cosgamma);
390 stMCT =
new TMatrixT<Double_t>(5, 1);
391 covMCT =
new TMatrixT<Double_t>(5, 5);
392 stREC =
new TMatrixT<Double_t>(5, 1);
393 covREC =
new TMatrixT<Double_t>(5, 5);
397 fpREC =
new Float_t[4];
400 fCov0 =
new Float_t[25];
421 fPC1 =
new Float_t[3];
422 fPC2 =
new Float_t[3];
423 fPC3 =
new Float_t[3];
430 tree = tfs->make<TTree>(
"GENFITttree",
"GENFITttree");
435 tree->Branch(
"covMCT",
"TMatrixD", &covMCT, 64000, 0);
438 tree->Branch(
"covREC",
fCov0,
"covREC[25]/F");
443 tree->Branch(
"chi2", &
chi2,
"chi2/F");
444 tree->Branch(
"nfail", &
nfail,
"nfail/I");
445 tree->Branch(
"ndf", &
ndf,
"ndf/I");
446 tree->Branch(
"evtNo", &
evtt,
"evtNo/I");
450 tree->Branch(
"trkNo", &
nTrks,
"trkNo/I");
453 tree->Branch(
"shx",
fshx,
"shx[ptsNo]/F");
454 tree->Branch(
"shy",
fshy,
"shy[ptsNo]/F");
455 tree->Branch(
"shz",
fshz,
"shz[ptsNo]/F");
456 tree->Branch(
"sep",
fsep,
"sep[ptsNo]/F");
457 tree->Branch(
"dQdx",
fdQdx,
"dQdx[ptsNo]/F");
458 tree->Branch(
"eshx",
feshx,
"eshx[ptsNo]/F");
459 tree->Branch(
"eshy",
feshy,
"eshy[ptsNo]/F");
460 tree->Branch(
"eshz",
feshz,
"eshz[ptsNo]/F");
461 tree->Branch(
"eshyz",
feshyz,
"eshyz[ptsNo]/F");
462 tree->Branch(
"update",
fupdate,
"update[ptsNo]/F");
464 tree->Branch(
"th",
fth,
"th[ptsNo]/F");
465 tree->Branch(
"eth",
feth,
"eth[ptsNo]/F");
466 tree->Branch(
"edudw",
fedudw,
"edudw[ptsNo]/F");
467 tree->Branch(
"edvdw",
fedvdw,
"edvdw[ptsNo]/F");
468 tree->Branch(
"eu",
feu,
"eu[ptsNo]/F");
469 tree->Branch(
"ev",
fev,
"ev[ptsNo]/F");
474 tree->Branch(
"pcEvec1",
fPC1,
"pcEvec1[3]/F");
475 tree->Branch(
"pcEvec2",
fPC2,
"pcEvec2[3]/F");
476 tree->Branch(
"pcEvec3",
fPC3,
"pcEvec3[3]/F");
478 tree->Branch(
"pMCMom", fpMCMom,
"pMCMom[4]/F");
480 tree->Branch(
"pRECKalF",
fpREC,
"pRECKalF[4]/F");
481 tree->Branch(
"pRECKalL",
fpRECL,
"pRECKalL[4]/F");
533 std::unique_ptr<std::vector<recob::Track>> tcol(
new std::vector<recob::Track>);
534 std::unique_ptr<art::Assns<recob::Track, recob::SpacePoint>> tspassn(
536 std::unique_ptr<art::Assns<recob::Track, recob::Hit>> thassn(
539 unsigned int tcnt = 0;
558 for (
unsigned int ii = 0; ii < mctruthListHandle->size(); ++ii) {
564 std::vector<art::PtrVector<recob::SpacePoint>> spptIn(spptListHandle->begin(),
565 spptListHandle->end());
588 for (
unsigned int ii = 0; ii < mclist.
size(); ++ii) {
590 for (
int jj = 0; jj < mc->
NParticles(); ++jj) {
595 <<
"FROM MC TRUTH, the particle's pdg code is: " <<
part.PdgCode()
596 <<
" with energy = " <<
part.E() <<
", with energy = " <<
part.E()
599 <<
"\n (both in Global (not volTPC) coords)";
612 <<
" repMC, covMC are ... \n" 617 TParticlePDG*
part = TDatabasePDG::Instance()->GetParticle(
fPdg);
618 Double_t mass = part->Mass();
620 auto const& tpc = geom->
TPC({0, 0});
622 while (sppt != spptIn.end()) {
631 unsigned int nTailPoints = 0;
632 if (spacepoints.
size() < 5) {
639 <<
"\n\t found " << spacepoints.
size()
640 <<
" 3D spacepoint(s) for this element of std::vector<art:PtrVector> spacepoints. \n";
646 TPrincipal* principal =
new TPrincipal(3,
"ND");
658 for (
unsigned int point = 0; point < spacepointss.
size(); ++point) {
659 if (point < (spacepointss.
size() - nTailPoints)) {
660 principal->AddRow(spacepointss[point]->XYZ());
663 principal->MakePrincipals();
665 const TVectorD* evals = principal->GetEigenValues();
666 const TMatrixD* evecs = principal->GetEigenVectors();
667 const TVectorD* means = principal->GetMeanValues();
668 const TVectorD* sigmas = principal->GetSigmas();
670 Double_t
tmp[3], tmp2[3];
671 principal->X2P((Double_t*)(means->GetMatrixArray()), tmp);
672 principal->X2P((Double_t*)(sigmas->GetMatrixArray()), tmp2);
673 for (
unsigned int ii = 0; ii < 3; ++ii) {
676 fPCevals[ii] = (Float_t)(evals->GetMatrixArray())[ii];
681 evecs->ExtractRow(ii, 0, w);
686 Double_t tmp3[3], tmp4[3], tmp5[3];
687 principal->X2P((Double_t*)
fPC1, tmp3);
688 principal->X2P((Double_t*)
fPC2, tmp4);
689 principal->X2P((Double_t*)
fPC3, tmp5);
693 fMomStart[0] = spacepointss[spacepointss.
size() - 1]->XYZ()[0] - spacepointss[0]->XYZ()[0];
694 fMomStart[1] = spacepointss[spacepointss.
size() - 1]->XYZ()[1] - spacepointss[0]->XYZ()[1];
695 fMomStart[2] = spacepointss[spacepointss.
size() - 1]->XYZ()[2] - spacepointss[0]->XYZ()[2];
699 TVector3 mom(dEdx *
fMomStart[0], dEdx * fMomStart[1], dEdx * fMomStart[2]);
700 double pmag2 = pow(mom.Mag() + mass, 2. - mass * mass);
701 mom.SetMag(std::sqrt(pmag2));
703 mom.SetMag(1.0 * mom.Mag());
707 bool uncontained(
false);
709 double epsMag(0.001);
713 if (spacepointss[spacepointss.
size() - 1]->XYZ()[0] > (2. * tpc.HalfWidth() -
close) ||
714 spacepointss[spacepointss.
size() - 1]->XYZ()[0] < close ||
715 spacepointss[0]->XYZ()[0] > (2. * tpc.HalfWidth() -
close) ||
716 spacepointss[0]->XYZ()[0] < close ||
717 spacepointss[spacepointss.
size() - 1]->XYZ()[1] > (1. * tpc.HalfHeight() -
close) ||
718 (spacepointss[spacepointss.
size() - 1]->XYZ()[1] < -1. * tpc.HalfHeight() +
close) ||
719 spacepointss[0]->XYZ()[1] > (1. * tpc.HalfHeight() -
close) ||
720 spacepointss[0]->XYZ()[1] < (-1. * tpc.HalfHeight() +
close) ||
721 spacepointss[spacepointss.
size() - 1]->XYZ()[2] > (tpc.Length() -
close) ||
722 spacepointss[spacepointss.
size() - 1]->XYZ()[2] < close ||
723 spacepointss[0]->XYZ()[2] > (tpc.Length() -
close) || spacepointss[0]->XYZ()[2] <
close)
732 mom.SetMag(2.0 * mom.Mag());
733 MF_LOG_DEBUG(
"Track3DKalmanSPS_GenFit") <<
"Uncontained track ... ";
739 <<
"Contained track ... Run " << evt.
run() <<
" Event " << evt.
id().
event();
746 fcont = (int)(!uncontained);
749 unsigned short rePass = rePass0;
751 unsigned short tcnt1(0);
752 while (rePass <= maxPass) {
755 TVector3 momErrFit(momM[0] / 3.0, momM[1] / 3.0,
775 std::vector<unsigned int> spptSurvivedIndex;
776 std::vector<unsigned int> spptSkippedIndex;
777 unsigned int ppoint(0);
778 for (
unsigned int point = 0; point < spacepointss.
size(); ++point) {
784 principal->X2P((Double_t*)(spacepointss[point]->XYZ()), tmp);
785 sep = std::sqrt(tmp[1] * tmp[1] /
fPCevals[1] + tmp[2] * tmp[2] /
fPCevals[2]);
788 spptSkippedIndex.push_back(point);
793 TVector3 one(spacepointss[point]->XYZ());
794 TVector3 two(spacepointss[ppoint]->XYZ());
795 if (rePass == 2 && uncontained) {
798 fErrScaleMHere = 0.1;
804 else if (rePass == 2 && !uncontained) {}
806 ((one - two).Mag() < epsMag ||
807 ((one - two).Mag() > 8.0 && rePass == 1) ||
808 std::abs(spacepointss[point]->XYZ()[2] - spacepointss[ppoint]->XYZ()[2]) < epsZ ||
809 std::abs(spacepointss[point]->XYZ()[0] - spacepointss[ppoint]->XYZ()[0]) > epsX)) {
810 spptSkippedIndex.push_back(point);
815 point % fDecimateHere &&
824 TVector3 spt3 = (TVector3)(spacepointss[point]->XYZ());
825 std::vector<double> err3;
826 err3.push_back(spacepointss[point]->ErrXYZ()[0]);
827 err3.push_back(spacepointss[point]->ErrXYZ()[2]);
828 err3.push_back(spacepointss[point]->ErrXYZ()[4]);
829 err3.push_back(spacepointss[point]->ErrXYZ()[5]);
847 fth[
fptsNo] = (pointer.Unit()).Angle(pointerPrev.Unit());
858 <<
"ihit xyz..." << spt3[0] <<
"," << spt3[1] <<
"," << spt3[2];
863 spptSurvivedIndex.push_back(point);
871 <<
"Bailing cuz only " <<
fptsNo <<
" spacepoints.";
875 MF_LOG_DEBUG(
"Track3DKalmanSPS_GenFit") <<
"Fitting on " <<
fptsNo <<
" spacepoints.";
888 bool skipFill =
false;
889 std::vector<TMatrixT<double>> hitMeasCov;
890 std::vector<TMatrixT<double>> hitUpdate;
891 std::vector<TMatrixT<double>> hitCov;
892 std::vector<TMatrixT<double>> hitCov7x7;
893 std::vector<TMatrixT<double>> hitState;
894 std::vector<double> hitChi2;
895 std::vector<TVector3> hitPlaneXYZ;
896 std::vector<TVector3> hitPlaneUxUyUz;
897 std::vector<TVector3> hitPlaneU;
898 std::vector<TVector3> hitPlaneV;
905 <<
"just caught a cet::exception: " << e.what()
906 <<
"\nExceptions won't be further handled; skip filling big chunks of the TTree.";
914 std::ostringstream dbgmsg;
915 dbgmsg <<
"Original plane:";
916 planeG.
Print(dbgmsg);
918 dbgmsg <<
"Current (fit) reference Plane:";
921 dbgmsg <<
"Last reference Plane:";
925 dbgmsg <<
" => original hit plane (not surprisingly) not current reference Plane!";
927 MF_LOG_DEBUG(
"Track3DKalmanSPS_GenFit") << dbgmsg.str();
940 unsigned int totHits = hitState.size();
943 unsigned int jhit = 0;
944 for (
unsigned int ihit = totHits - 2 * totHits / (2 *
fNumIt);
945 ihit < (totHits - totHits / (2 *
fNumIt));
948 feth[jhit] = (Float_t)(hitMeasCov.at(ihit)[0][0]);
949 fedudw[jhit] = (Float_t)(hitMeasCov.at(ihit)[1][1]);
950 fedvdw[jhit] = (Float_t)(hitMeasCov.at(ihit)[2][2]);
951 feu[jhit] = (Float_t)(hitMeasCov.at(ihit)[3][3]);
952 fev[jhit] = (Float_t)(hitMeasCov.at(ihit)[4][4]);
953 fupdate[jhit] = (Float_t)(hitUpdate.at(ihit)[0][0]);
954 fchi2hit[jhit] = (Float_t)(hitChi2.at(ihit));
964 for (
unsigned int ii = 0; ii < 5; ii++) {
965 stREC->ExtractRow(ii, 0, dum);
967 covREC->ExtractRow(ii, 0, dum2);
968 for (
unsigned int jj = 0; jj < 5; jj++) {
969 fCov0[ii * 5 + jj] = dum2[jj];
979 ispptvec = 1 + std::distance(spptB, sppt);
984 <<
"Track3DKalmanSPS about to do tree->Fill(). Chi2/ndf is " <<
chi2 /
ndf <<
".";
986 for (
int ii = 0; ii < 3; ++ii) {
989 fpREC[ii] = hitPlaneUxUyUz.at(totHits - 2 * totHits / (2 *
fNumIt))[ii];
990 fpRECL[ii] = hitPlaneUxUyUz.at(totHits - totHits / (2 *
fNumIt) - 1)[ii];
994 nspptvec = (
unsigned int)spptListHandle->size();
997 std::vector<std::vector<double>> dQdx;
999 std::vector<TMatrixT<double>> hitCovLFP;
1000 std::vector<TVector3> hitPlaneXYZLFP;
1001 std::vector<TVector3> hitPlaneUxUyUzLFP;
1002 std::vector<TVector3> hitPlanePxPyPzLFP;
1003 std::vector<TVector3> hitPlaneULFP;
1004 std::vector<TVector3> hitPlaneVLFP;
1005 std::vector<double> pLFP;
1006 std::vector<TMatrixT<double>> c7x7LFP;
1009 for (
unsigned int ii = 0; ii < totHits / (2 *
fNumIt); ii++) {
1010 pLFP.push_back(1. / hitState.at(totHits - 2 * totHits / (2 *
fNumIt) + ii)[0][0]);
1012 c7x7LFP.push_back(hitCov7x7.at(totHits - 2 * totHits / (2 *
fNumIt) + ii));
1013 hitCovLFP.push_back(hitCov.at(totHits - 2 * totHits / (2 *
fNumIt) + ii));
1014 hitPlaneXYZLFP.push_back(hitPlaneXYZ.at(totHits - 2 * totHits / (2 *
fNumIt) + ii));
1015 hitPlaneUxUyUzLFP.push_back(
1016 hitPlaneUxUyUz.at(totHits - 2 * totHits / (2 *
fNumIt) + ii));
1017 hitPlanePxPyPzLFP.push_back(hitPlaneUxUyUzLFP.back() * pLFP.back());
1018 hitPlaneULFP.push_back(hitPlaneU.at(totHits - 2 * totHits / (2 *
fNumIt) + ii));
1019 hitPlaneVLFP.push_back(hitPlaneV.at(totHits - 2 * totHits / (2 *
fNumIt) + ii));
1025 rotationCov(hitCovLFP.back(), hitPlaneULFP.back(), hitPlaneVLFP.back());
1027 dQdxCalc(hitAssns, spacepointss, hitPlaneUxUyUzLFP.back(), hitPlaneXYZLFP.back()));
1028 fdQdx[ii] = dQdx.back().back();
1038 for (
unsigned int i = 0; i < 5; i++) {
1039 for (
unsigned int j = i; j < 5; j++) {
1040 covVtx(i, j) = hitCovLFP.front()(i, j);
1041 covEnd(i, j) = hitCovLFP.back()(i, j);
1055 if (rePass == 1) tcnt1++;
1056 if (rePass != 1 && tcnt1) tcol->pop_back();
1057 tcol->push_back(the3DTrack);
1060 for (
unsigned int ii = 0; ii < spacepointss.
size(); ++ii) {
1061 hits.
insert(hits.
end(), hitAssns.at(ii).begin(), hitAssns.at(ii).end());
1072 for (
unsigned int ind = 0; ind < spptSurvivedIndex.size(); ++ind) {
1081 spacepointss.
begin() + spptSurvivedIndex[ind];
1088 for (
unsigned int ind = 0; ind < spptSkippedIndex.size(); ++ind) {
1090 spacepointss.
begin() + spptSkippedIndex[ind];
1094 std::stable_sort(spacepointss.
begin(), spacepointss.
end());
1095 std::stable_sort(spacepointssExcise.
begin(), spacepointssExcise.
end());
1096 std::set_union(spacepointssExcise.
begin(),
1097 spacepointssExcise.
end(),
1098 spacepointssExcise.
begin(),
1099 spacepointssExcise.
end(),
1100 spacepointssExcise.
begin());
1103 std::set_difference(spacepointss.
begin(),
1105 spacepointssExcise.
begin(),
1106 spacepointssExcise.
end(),
1107 spacepointss.
begin());
1108 spacepointss.
erase(diffSpptIt, spacepointss.
end());
1119 if (uncontained) kick = 0.5;
1120 for (
int ii = 0; ii < 3; ++ii) {
1121 mom[ii] = momM[ii] * kick;
1124 else if (uncontained) {
1125 double unstick(1.0);
1127 for (
int ii = 0; ii < 3; ++ii) {
1128 mom[ii] = momM[ii] * unstick;
1132 for (
int ii = 0; ii < 3; ++ii) {
1133 mom[ii] = 1.1 * momM[ii];
1145 evt.
put(std::move(tcol));
1147 evt.
put(std::move(tspassn));
1150 evt.
put(std::move(thassn));
TMatrixT< Double_t > * stREC
unsigned int getNDF() const
std::vector< double > fMomErr
void setMomLow(Double_t f)
std::vector< TVector3 > getHitPlaneUxUyUz()
void setMaxUpdate(Double_t f)
geo::SigType_t SignalType() const
Signal type for the plane of the hit.
TMatrixT< Double_t > * stMCT
static bool sp_sort_3dz(const art::Ptr< recob::SpacePoint > &h1, const art::Ptr< recob::SpacePoint > &h2)
typename data_t::iterator iterator
const GFDetPlane & getReferencePlane() const
std::string fG4ModuleLabel
GFDetPlane getLastPlane() const
void rotationCov(TMatrixT< Double_t > &cov, const TVector3 &u, const TVector3 &v)
std::vector< Vector_t > convertCollToVector(std::vector< Vector > const &coll)
Declaration of signal hit object.
EDProducer(fhicl::ParameterSet const &pset)
genf::GFAbsTrackRep * rep
void setMomHigh(Double_t f)
iterator erase(iterator position)
TrackTrajectory::Flags_t Flags_t
std::string fGenieGenModuleLabel
std::vector< Double_t > getHitChi2()
constexpr auto abs(T v)
Returns the absolute value of the argument.
#define MF_LOG_ERROR(category)
std::vector< TMatrixT< Double_t > > getHitCov7x7()
ROOT::Math::SMatrix< Double32_t, 5, 5, ROOT::Math::MatRepSym< Double32_t, 5 >> SMatrixSym55
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
geo::WireID const & WireID() const
Initial tdc tick for hit.
std::vector< double > fPosErr
void Print(std::ostream &out=std::cout) const
const TMatrixT< Double_t > & getState() const
std::vector< TMatrixT< Double_t > > getHitState()
std::vector< TVector3 > getHitPlaneU()
std::string fSpptModuleLabel
static bool sp_sort_3dy(const art::Ptr< recob::SpacePoint > &h1, const art::Ptr< recob::SpacePoint > &h2)
std::string fClusterModuleLabel
void produce(art::Event &evt)
Base Class for genfit track representations. Defines interface for track parameterizations.
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
typename data_t::const_iterator const_iterator
std::vector< double > fMomStart
#define DEFINE_ART_MODULE(klass)
void push_back(Ptr< U > const &p)
virtual TVector3 getMom(const GFDetPlane &pl)=0
static bool sp_sort_3dx(const art::Ptr< recob::SpacePoint > &h1, const art::Ptr< recob::SpacePoint > &h2)
A trajectory in space reconstructed from hits.
enum geo::_plane_sigtype SigType_t
Enumerate the possible plane projections.
void setBlowUpFactor(double f)
Set the blowup factor (see blowUpCovs() )
static bool sp_sort_nsppts(const art::PtrVector< recob::SpacePoint > &h1, const art::PtrVector< recob::SpacePoint > &h2)
double energyLossBetheBloch(const double &mass, const double p)
void setNumIterations(Int_t i)
Set number of iterations for Kalman Filter.
int getFailedHits(int repId=-1)
return the number of failed Hits in track fit repId == -1 will use cardinal rep
TMatrixT< Double_t > * covREC
void processTrack(GFTrack *)
Performs fit on a GFTrack.
static GFFieldManager * getInstance()
TMatrixT< Double_t > * covMCT
const Double32_t * XYZ() const
std::vector< Point_t > convertCollToPoint(std::vector< Point > const &coll)
Declaration of cluster object.
const TMatrixT< Double_t > & getCov() const
std::vector< TVector3 > getHitPlaneV()
float dEdx(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, TP3D &tp3d)
std::string ROOTobjectToString(const ROOTOBJ &obj)
Shortcut to write one ROOT object into a string.
Encapsulate the geometry of a wire .
const simb::MCParticle & GetParticle(int i) const
bool CreateAssn(art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t index=UINT_MAX)
Creates a single one-to-one association.
iterator insert(iterator position, Ptr< U > const &p)
std::vector< double > dQdxCalc(const art::FindManyP< recob::Hit > &h, const art::PtrVector< recob::SpacePoint > &s, const TVector3 &p, const TVector3 &d)
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Utility object to perform functions of association.
Encapsulate the construction of a single detector plane .
double dist(const TReal *x, const TReal *y, const unsigned int dimension)
Provides recob::Track data product.
genf::GFAbsTrackRep * repMC
void setInitialDirection(int d)
Sets the inital direction of the track fit (1 for inner to outer, or -1 for outer to inner)...
void init(GFAbsBField *b)
set the magntic field here. Magnetic field classes must be derived from GFAbsBField ...
EventNumber_t event() const
std::vector< TMatrixT< Double_t > > getHitUpdate()
void setErrorScaleSTh(Double_t f)
2D representation of charge deposited in the TDC/wire plane
void addHit(GFAbsRecoHit *theHit)
deprecated!
std::vector< TMatrixT< Double_t > > getHitCov()
Track3DKalmanSPS(fhicl::ParameterSet const &pset)
#define MF_LOG_WARNING(category)
TPCGeo const & TPC(TPCID const &tpcid=details::tpc_zero) const
Returns the specified TPC.
std::vector< TMatrixT< Double_t > > getHitMeasuredCov()
art framework interface to geometry description
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
void setErrorScaleMTh(Double_t f)
cet::coded_exception< error, detail::translate > exception
Signal from collection planes.
std::vector< TVector3 > getHitPlaneXYZ()