7 #include <TIntegerDatum.hxx>
8 #include <TRealDatum.hxx>
9 #include <TReconNode.hxx>
10 #include <TReconShower.hxx>
11 #include <TReconTrack.hxx>
13 #include <TComboHit.hxx>
14 #include <TG4HitSegment.hxx>
15 #include <TGeomInfo.hxx>
16 #include <TMultiHit.hxx>
17 #include <retrieveHitTruthInfo.hxx>
19 #include <TOARuntimeParams.hxx>
21 #include "ReconObjectUtils.hxx"
22 #include "TEventFolder.hxx"
23 #include "TRecPackManager.hxx"
24 #include "TValidationUtils.hxx"
26 #include <TFieldManager.hxx>
27 #include <TrackTruthInfo.hxx>
58 new TClonesArray(
"ND::TTrackerReconModule::TTrackerConstituent", 10);
59 TPC =
new TClonesArray(
"ND::TTrackerReconModule::TTPCTrack", 10);
60 FGD =
new TClonesArray(
"ND::TTrackerReconModule::TFGDTrack", 10);
61 Nodes =
new TClonesArray(
"ND::TTrackerReconModule::TTrackerNode", 10);
64 NTotalConstituents = 0;
65 Constituents->Clear();
83 Hits =
new TClonesArray(
"ND::TTrackerReconModule::TUnusedHit", 200);
106 fVertices =
new TClonesArray(
"ND::TTrackerReconModule::TTrackerVertex", 200);
108 fTracks =
new TClonesArray(
"ND::TTrackerReconModule::TTrackerResult", 200);
110 fFGDOther =
new TClonesArray(
"ND::TTrackerReconModule::TTrackOther", 200);
112 fTPCOther =
new TClonesArray(
"ND::TTrackerReconModule::TTrackOther", 200);
114 fTPCIso =
new TClonesArray(
"ND::TTrackerReconModule::TTPCTrack", 200);
116 fTPCUnused =
new TClonesArray(
"ND::TTrackerReconModule::TUnusedHit", 200);
118 fFGDUnused =
new TClonesArray(
"ND::TTrackerReconModule::TUnusedHit", 200);
121 new TClonesArray(
"ND::TTrackerReconModule::TTPCTrack", 200);
132 fMaxDrift = ND::TGeomInfo::Get().TPC().GetMaxDriftDistance(0, 0);
133 const TGeoNode* cath = ND::TGeomInfo::Get().TPC().GetCathode(0);
134 const TGeoVolume* cathvol = cath->GetVolume();
135 TGeoShape* cathshape = cathvol->GetShape();
136 TGeoBBox* box =
dynamic_cast<TGeoBBox*
>(cathshape);
145 "tpcRecon.TPCgas.DriftSpeed");
156 ->SetTitle(
"The number of added vertices ");
158 ->SetTitle(
"The number of trackerRecon results ");
160 ->SetTitle(
" The number of FGD tracks with no fit ");
162 ->SetTitle(
" The number of TPC tracks with no fit ");
164 ->SetTitle(
"The number of isolated TPC tracks with fits ");
166 ->SetTitle(
" The number of unused FGD hits");
168 ->SetTitle(
" The number of unused TPC hits ");
175 ->SetTitle(
" The vector of trackerRecon vertices");
177 ->SetTitle(
"The vector of overall trackerRecon results ");
179 ->SetTitle(
"The vector of FGD tracks with no fit ");
181 ->SetTitle(
"The vector of TPC tracks with no fit ");
183 ->SetTitle(
" The vector of isolated TPC tracks with fits");
185 ->SetTitle(
" The vector of unused TPC hits");
187 ->SetTitle(
" The number of unused FGD hits");
190 ->SetTitle(
"The vector of TPC tracks extrapolatedinto the FGD following Claudio's (2010a)method ");
197 "TTrackerReconModule",
199 <<
" has already written the config tree this run.");
202 configTree->Branch(
"MaxDrift", &
fMaxDrift,
"MaxDrift/D");
203 configTree->Branch(
"CathodeOffset", &
fCathodeOffset,
"CathodeOffset/D");
204 configTree->Branch(
"DriftVelocity", &
fDriftVelocity,
"DriftVelocity/D");
210 TClonesArray* out,
int idx) {
216 vertex->
Status = in->CheckStatus(in->kSuccess);
217 vertex->
Quality = in->GetQuality();
218 vertex->
NDOF = in->GetNDOF();
220 ND::THandle<ND::TVertexState> state = in->GetState();
222 vertex->
Position = state->GetPosition();
223 vertex->
Variance = state->GetPositionVariance();
225 vertex->
Position = TLorentzVector(0., 0., 0., 0.);
226 vertex->
Variance = TLorentzVector(0., 0., 0., 0.);
233 TClonesArray* out,
int idx) {
241 for (
int i = 0; i < 2; i++) {
242 if (in->UsesDetector(dets[i])) fgd->
Detector = i + 1;
245 fgd->
Ndof = in->GetNDOF();
246 fgd->
Chi2 = in->GetQuality();
247 ND::THandle<ND::TTrackState> state = in->GetState();
249 fgd->
Position = state->GetPosition();
251 fgd->
EDeposit = state->GetEDeposit();
254 fgd->
Position = TLorentzVector(0., 0., 0., 0.);
264 TClonesArray* out,
int idx) {
267 ND::TReconBase::Status dets[3] = {
272 for (
int i = 0; i < 3; i++) {
273 if (in->UsesDetector(dets[i])) tpc->
Detector = i + 1;
275 tpc->
Ndof = in->GetNDOF();
276 tpc->
Chi2 = in->GetQuality();
281 ND::THandle<ND::TPIDState> state = in->GetState();
283 tpc->
Momentum = state->GetMomentum();
284 tpc->
MomentumError = sqrt(fabs(state->GetMomentumVariance()));
285 tpc->
Charge = state->GetCharge();
286 tpc->
Position = state->GetPosition();
294 tpc->
Position = TLorentzVector(0., 0., 0., 0.);
300 if (in->Get<ND::TRealDatum>(
"tpcPid_NTrun"))
301 tpc->
NTrun = in->Get<ND::TRealDatum>(
"tpcPid_NTrun")->GetValue();
303 tpc->
NTrun = -0xABCDEF;
305 if (in->Get<ND::TRealDatum>(
"tpcPid_Ccorr"))
306 tpc->
Ccorr = in->Get<ND::TRealDatum>(
"tpcPid_Ccorr")->GetValue();
308 tpc->
Ccorr = -0xABCDEF;
310 if (in->Get<ND::TRealDatum>(
"tpcPid_PullEle"))
311 tpc->
PullEle = in->Get<ND::TRealDatum>(
"tpcPid_PullEle")->GetValue();
315 if (in->Get<ND::TRealDatum>(
"tpcPid_PullMuon"))
316 tpc->
PullMuon = in->Get<ND::TRealDatum>(
"tpcPid_PullMuon")->GetValue();
320 if (in->Get<ND::TRealDatum>(
"tpcPid_PullPion"))
321 tpc->
PullPion = in->Get<ND::TRealDatum>(
"tpcPid_PullPion")->GetValue();
325 if (in->Get<ND::TRealDatum>(
"tpcPid_PullKaon"))
326 tpc->
PullKaon = in->Get<ND::TRealDatum>(
"tpcPid_PullKaon")->GetValue();
330 if (in->Get<ND::TRealDatum>(
"tpcPid_PullProton"))
331 tpc->
PullProton = in->Get<ND::TRealDatum>(
"tpcPid_PullProton")->GetValue();
335 if (in->Get<ND::TRealDatum>(
"tpcPid_dEdxexpEle"))
336 tpc->
dEdxexpEle = in->Get<ND::TRealDatum>(
"tpcPid_dEdxexpEle")->GetValue();
340 if (in->Get<ND::TRealDatum>(
"tpcPid_dEdxexpMuon"))
342 in->Get<ND::TRealDatum>(
"tpcPid_dEdxexpMuon")->GetValue();
346 if (in->Get<ND::TRealDatum>(
"tpcPid_dEdxexpPion"))
348 in->Get<ND::TRealDatum>(
"tpcPid_dEdxexpPion")->GetValue();
352 if (in->Get<ND::TRealDatum>(
"tpcPid_dEdxexpKaon"))
354 in->Get<ND::TRealDatum>(
"tpcPid_dEdxexpKaon")->GetValue();
358 if (in->Get<ND::TRealDatum>(
"tpcPid_dEdxexpProton"))
360 in->Get<ND::TRealDatum>(
"tpcPid_dEdxexpProton")->GetValue();
364 if (in->Get<ND::TRealDatum>(
"tpcPid_SigmaEle"))
365 tpc->
SigmaEle = in->Get<ND::TRealDatum>(
"tpcPid_SigmaEle")->GetValue();
369 if (in->Get<ND::TRealDatum>(
"tpcPid_SigmaMuon"))
370 tpc->
SigmaMuon = in->Get<ND::TRealDatum>(
"tpcPid_SigmaMuon")->GetValue();
374 if (in->Get<ND::TRealDatum>(
"tpcPid_SigmaPion"))
375 tpc->
SigmaPion = in->Get<ND::TRealDatum>(
"tpcPid_SigmaPion")->GetValue();
379 if (in->Get<ND::TRealDatum>(
"tpcPid_SigmaKaon"))
380 tpc->
SigmaKaon = in->Get<ND::TRealDatum>(
"tpcPid_SigmaKaon")->GetValue();
384 if (in->Get<ND::TRealDatum>(
"tpcPid_SigmaProton"))
386 in->Get<ND::TRealDatum>(
"tpcPid_SigmaProton")->GetValue();
402 if (in->GetConstituents()) {
403 ND::THandle<ND::TReconTrack> track =
407 ND::THandle<ND::TTrackState> astate = track->GetState();
411 astate->GetCovarianceValue(astate->GetDirectionIndex(),
412 astate->GetDirectionIndex()),
413 astate->GetCovarianceValue(astate->GetDirectionIndex() + 1,
414 astate->GetDirectionIndex() + 1),
415 astate->GetCovarianceValue(astate->GetDirectionIndex() + 2,
416 astate->GetDirectionIndex() + 2));
420 astate->GetCurvatureIndex(), astate->GetCurvatureIndex());
422 if (track->Get<ND::TRealDatum>(
"Sigma0"))
423 tpc->
Sigma0 = track->Get<ND::TRealDatum>(
"Sigma0")->GetValue();
424 if (track->Get<ND::TRealDatum>(
"Sigma1"))
425 tpc->
Sigma1 = track->Get<ND::TRealDatum>(
"Sigma1")->GetValue();
426 if (track->Get<ND::TRealDatum>(
"Sigma2"))
427 tpc->
Sigma2 = track->Get<ND::TRealDatum>(
"Sigma2")->GetValue();
428 if (track->Get<ND::TRealDatum>(
"MeanDrift"))
429 tpc->
MeanDrift = track->Get<ND::TRealDatum>(
"MeanDrift")->GetValue();
436 void getTangents(ND::THandle<ND::TTrackState> state,
double& tx,
double& etx,
437 double& ty,
double& ety) {
438 tx = state->GetDirection()[0] / state->GetDirection()[2];
439 ty = state->GetDirection()[1] / state->GetDirection()[2];
441 CLHEP::HepMatrix Jacobian(2, 3, 0);
442 CLHEP::HepMatrix Covariance(3, 3, 0);
443 CLHEP::HepMatrix Cov(2, 2, 0);
445 for (
int i = 0; i < 3; i++)
446 for (
int j = 0; j < 3; j++) {
447 Covariance[i][j] = state->GetCovarianceValue(
448 state->GetDirectionIndex() + i, state->GetDirectionIndex() + j);
451 Jacobian[0][0] = 1. / state->GetDirection()[2];
453 Jacobian[0][2] = -tx / state->GetDirection()[2];
456 Jacobian[1][1] = 1. / state->GetDirection()[2];
457 Jacobian[1][2] = -ty / state->GetDirection()[2];
459 Cov = Jacobian * Covariance * Jacobian.T();
461 etx = TMath::Sqrt(Cov[0][0]);
462 ety = TMath::Sqrt(Cov[1][1]);
466 bool insideFGD1(
double zx,
double zy,
double xx,
double yy) {
467 return ((zx > 140) && (zy > 140) && (zx < 500) && (zy < 500) &&
468 (fabs(yy) < 800) && (fabs(xx) < 800));
471 bool insideFGD2(
double zx,
double zy,
double xx,
double yy) {
472 return ((zx > 1530) && (zy > 1530) && (zx < 1900) && (zy < 1900) &&
473 (fabs(yy) < 800) && (fabs(xx) < 800));
478 if ((pos.Y() < 850) && (pos.Y() > -800) && (pos.X() < 850)) ret =
false;
479 if (pos.Z() > 500) ret =
false;
480 if (fabs(pos.Z() - 120.85) < 0.0001) {
488 if ((pos.Y() < 850) && (pos.Y() > -800) && (fabs(pos.X()) < 850)) {
491 if (pos.Z() < 500) ret =
false;
492 if (fabs(pos.Z() - 1478.85) < 0.0001) ret =
true;
498 double curv,
bool isX) {
501 if ((fabs(curv) < 1.e-20) || (fabs(in.Z() - f.Z()) > 600) || (f.Z() > in.Z()))
504 double r1 = fabs(1. / curv);
505 double phi1 = atan(ty);
507 if (curv > 0) charge1 = -1.;
508 double zc1 = in.Z() - charge1 * r1 * sin(phi1);
509 double yc1 = in.Y() + charge1 * r1 * cos(phi1);
510 double delta = pow(r1, 2) - pow((zc1 - f.Z()), 2);
511 if (delta < 0)
return -9999.0;
512 double ySol1 = yc1 + sqrt(delta);
513 double ySol2 = yc1 - sqrt(delta);
515 if (fabs(ySol1 - in.Y()) > fabs(ySol2 - in.Y())) ySol = ySol2;
524 return f.X() - in.X() - tx * (f.Z() - in.Z());
530 ND::THandle<ND::TReconPID> in, TClonesArray* out,
int idx,
531 ND::THandle<ND::THitSelection> fgd) {
532 ND::THandle<ND::TReconTrack> track = in->GetConstituents()->front();
533 if (!track)
return false;
534 ND::TReconNodeContainer& nodes = track->GetNodes();
538 if (nodes.size() < 36)
return false;
542 ND::THandle<ND::TTrackState> frontstate = nodes.front()->GetState();
543 if (!frontstate)
return false;
544 if (!fgd)
return false;
546 double txin, tyin, etxin, etyin;
548 TVector3 pos = frontstate->GetPosition().Vect();
549 double curvature = track->GetCurvature();
552 double ExtrapolatedVertexXX = 9999;
553 double ExtrapolatedVertexZY = 9999;
554 double ExtrapolatedVertexZX = 9999;
555 double ExtrapolatedVertexYY = 9999;
562 for (ND::THitSelection::iterator hit = fgd->begin(); hit != fgd->end();
564 TVector3 fgdPos = (*hit)->GetPosition();
567 computeDistFGD(fgdPos, pos, txin, tyin, curvature, (*hit)->IsXHit());
568 if (fabs(dist) >= 30)
573 if ((*hit)->IsYHit() && fgdPos.Z() < ExtrapolatedVertexZY) {
574 ExtrapolatedVertexZY = fgdPos.Z();
575 ExtrapolatedVertexYY = fgdPos.Y();
578 if ((*hit)->IsXHit() && fgdPos.Z() < ExtrapolatedVertexZX) {
579 ExtrapolatedVertexZX = fgdPos.Z();
580 ExtrapolatedVertexXX = fgdPos.X();
584 if (ExtrapolatedVertexZX == 9999 || ExtrapolatedVertexZY == 9999)
587 bool EnteringFGD =
false;
589 if (
insideFGD1(ExtrapolatedVertexZX, ExtrapolatedVertexZY,
590 ExtrapolatedVertexXX, ExtrapolatedVertexYY)) {
591 for (ND::THitSelection::iterator hit = fgd->begin(); hit != fgd->end();
593 TVector3 fgdPos = (*hit)->GetPosition();
598 computeDistFGD(fgdPos, pos, txin, tyin, curvature, (*hit)->IsXHit());
599 if (fabs(dist) < 150) {
606 if (
insideFGD2(ExtrapolatedVertexZX, ExtrapolatedVertexZY,
607 ExtrapolatedVertexXX, ExtrapolatedVertexYY)) {
608 for (ND::THitSelection::iterator hit = fgd->begin(); hit != fgd->end();
610 TVector3 fgdPos = (*hit)->GetPosition();
615 computeDistFGD(fgdPos, pos, txin, tyin, curvature, (*hit)->IsXHit());
616 if (fabs(dist) < 150) {
626 if (!tpc)
return false;
645 ND::THandle<ND::TReconPID> in,
int& nconstit) {
646 ND::THandle<ND::TReconTrack> retval = in;
648 if (in->GetConstituents()) {
650 ND::TReconObjectContainer::const_iterator it;
651 for (it = in->GetConstituents()->begin();
652 it != in->GetConstituents()->end(); it++) {
654 ND::THandle<ND::TReconTrack> track = (*it);
655 ND::THandle<ND::TReconPID> pid = (*it);
658 ND::THandle<ND::TReconTrack> atrack =
664 if (retval && atrack) {
666 ND::THandle<ND::TTrackState> astate = atrack->GetState();
667 ND::THandle<ND::TTrackState> rstate = retval->GetState();
668 if (astate && !rstate) retval = atrack;
669 if (rstate && astate) {
670 double amom, amomerr;
671 double rmom, rmomerr;
674 if (amom > 0.0 && rmom <= 0.0) retval = atrack;
675 if (amom > 0.0 && rmom > 0.0 && amomerr / amom < rmomerr / rmom)
687 ND::THandle<ND::TTrackState> astate = track->GetState();
688 ND::THandle<ND::TTrackState> rstate = retval->GetState();
689 if (astate && !rstate) retval = track;
690 if (rstate && astate) {
691 double amom, amomerr;
692 double rmom, rmomerr;
695 if (amom > 0.0 && rmom <= 0.0) retval = track;
696 if (amom > 0.0 && rmom > 0.0 && amomerr / amom < rmomerr / rmom)
711 ND::THandle<ND::THitSelection> tpc) {
714 if (!tpc)
return ND::THandle<ND::THitSelection>();
716 ND::THandle<ND::THitSelection> hits(
new ND::THitSelection());
718 for (ND::THitSelection::const_iterator hsel = tpc->begin();
719 hsel != tpc->end(); hsel++) {
720 ND::THandle<ND::TComboHit> combo(*hsel);
722 for (ND::THitSelection::const_iterator cHit = combo->GetHits().begin();
723 cHit != combo->GetHits().end(); cHit++) {
724 if (*cHit) hits->push_back(*cHit);
734 TClonesArray* out,
int idx) {
737 ND::TReconBase::Status dets[5] = {
745 for (
int i = 0; i < 5; i++) {
746 if (in->UsesDetector(dets[i])) other->
Detector = i + 1;
750 double t0 = in->GetPosition().T();
756 TVector3 minpos(0, 0, 999999);
758 TVector3 maxpos(0, 0, -999999);
760 for (ND::THitSelection::const_iterator hsel = hits->begin();
761 hsel != hits->end(); hsel++) {
764 hit->
Position = (*hsel)->GetPosition();
765 hit->
Variance = (*hsel)->GetUncertainty();
767 hit->
TimeUnc = (*hsel)->GetTimeUncertainty();
770 double maxCharge = 0;
773 ND::THandle<ND::TMultiHit> mh = *hsel;
774 std::vector<ND::THandle<ND::TSingleHit> >::const_iterator mhit;
775 for (mhit = mh->begin(); mhit != mh->end(); mhit++) {
776 if (maxCharge < (*mhit)->GetCharge()) {
777 maxCharge = (*mhit)->GetCharge();
778 peakTime = (*mhit)->GetTime();
784 ND::TGeometryId geomId = (*hsel)->GetGeomId();
785 double t = peakTime - t0;
787 ND::TGeomInfo::Get().TPC().GetDriftSense(geomId);
803 other->
FrontPosition = TLorentzVector(minpos[0], minpos[1], minpos[2], mint);
804 other->
BackPosition = TLorentzVector(maxpos[0], maxpos[1], maxpos[2], maxt);
814 ND::THandle<ND::TReconPID> in,
820 std::string fDetName = std::string(in->ConvertDetector());
821 if (fDetName ==
"(TPC1)" || fDetName ==
"(TPC2)" || fDetName ==
"(TPC3)") {
834 constituent->
Status = in->CheckStatus(in->kSuccess);
835 constituent->
NDOF = in->GetNDOF();
836 constituent->
Chi2 = in->GetQuality();
837 if (constituent->
NDOF > 0)
838 constituent->
Quality = TMath::Prob(constituent->
Chi2, constituent->
NDOF);
843 ND::THandle<ND::TPIDState> state = in->GetState();
845 constituent->
Position = state->GetPosition();
846 constituent->
Variance = state->GetPositionVariance();
847 constituent->
Direction = state->GetDirection();
849 constituent->
Momentum = state->GetMomentum();
850 constituent->
MomentumError = sqrt(fabs(state->GetMomentumVariance()));
851 constituent->
Charge = state->GetCharge();
853 constituent->
Position = TLorentzVector(0., 0., 0., 0.);
854 constituent->
Variance = TLorentzVector(0., 0., 0., 0.);
855 constituent->
Direction = TVector3(0., 0., 0.);
859 constituent->
Charge = 0.0;
864 constituent->
NNodes = in->GetNodes().size();
865 if (constituent->
NNodes > 0) {
866 ND::THandle<ND::TPIDState> firstState = in->GetNodes()[0]->GetState();
867 ND::THandle<ND::TPIDState> lastState =
868 in->GetNodes()[in->GetNodes().size() - 1]->GetState();
872 constituent->
FrontVariance = firstState->GetPositionVariance();
884 constituent->
BackVariance = lastState->GetPositionVariance();
888 constituent->
BackPosition = TLorentzVector(0., 0., 0., 0.);
889 constituent->
BackVariance = TLorentzVector(0., 0., 0., 0.);
896 constituent->
NHits = 0;
904 if (in->GetConstituents()) {
905 ND::TReconObjectContainer::const_iterator it;
906 for (it = in->GetConstituents()->begin();
907 it != in->GetConstituents()->end(); it++) {
908 ND::THandle<ND::TReconTrack> track = (*it);
909 ND::THandle<ND::TReconPID> pid = (*it);
941 TTrackerResult* result, ND::THandle<ND::TReconTrack> in,
int& idx) {
945 std::string fDetName = std::string(in->ConvertDetector());
946 if (fDetName ==
"(TPC1)" || fDetName ==
"(TPC2)" || fDetName ==
"(TPC3)") {
951 if (fDetName ==
"(FGD1)" || fDetName ==
"(FGD2)") {
964 constituent->
Status = in->CheckStatus(in->kSuccess);
965 constituent->
NDOF = in->GetNDOF();
966 constituent->
Chi2 = in->GetQuality();
967 if (constituent->
NDOF > 0)
968 constituent->
Quality = TMath::Prob(constituent->
Chi2, constituent->
NDOF);
973 ND::THandle<ND::TTrackState> state = in->GetState();
975 constituent->
Position = state->GetPosition();
976 constituent->
Variance = state->GetPositionVariance();
977 constituent->
Direction = state->GetDirection();
982 constituent->
EDeposit = state->GetEDeposit();
984 constituent->
Position = TLorentzVector(0., 0., 0., 0.);
985 constituent->
Variance = TLorentzVector(0., 0., 0., 0.);
986 constituent->
Direction = TVector3(0., 0., 0.);
991 constituent->
Charge = 0.0;
995 constituent->
NNodes = in->GetNodes().size();
996 if (constituent->
NNodes > 0) {
997 ND::THandle<ND::TTrackState> firstState = in->GetNodes()[0]->GetState();
998 ND::THandle<ND::TTrackState> lastState =
999 in->GetNodes()[in->GetNodes().size() - 1]->GetState();
1003 constituent->
FrontVariance = firstState->GetPositionVariance();
1008 constituent->
FrontPosition = TLorentzVector(0., 0., 0., 0.);
1009 constituent->
FrontVariance = TLorentzVector(0., 0., 0., 0.);
1016 constituent->
BackVariance = lastState->GetPositionVariance();
1021 constituent->
BackPosition = TLorentzVector(0., 0., 0., 0.);
1022 constituent->
BackVariance = TLorentzVector(0., 0., 0., 0.);
1029 constituent->
NHits = 0;
1037 if (in->GetConstituents()) {
1038 ND::TReconObjectContainer::const_iterator it;
1039 for (it = in->GetConstituents()->begin();
1040 it != in->GetConstituents()->end(); it++) {
1041 ND::THandle<ND::TReconTrack> track = (*it);
1042 ND::THandle<ND::TReconPID> pid = (*it);
1071 ND::THandle<ND::TReconPID> reco) {
1075 ND::THandle<ND::TPIDState> state = reco->GetState();
1077 result->
Position = state->GetPosition();
1078 result->
Variance = state->GetPositionVariance();
1079 result->
Direction = state->GetDirection();
1082 result->
Momentum = state->GetMomentum();
1083 result->
MomentumError = sqrt(fabs(state->GetMomentumVariance()));
1084 result->
Charge = state->GetCharge();
1086 result->
Position = TLorentzVector(0., 0., 0., 0.);
1087 result->
Variance = TLorentzVector(0., 0., 0., 0.);
1088 result->
Direction = TVector3(0., 0., 0.);
1098 result->
NNodes = reco->GetNodes().size();
1099 if (result->
NNodes > 0) {
1101 for (
int inode = 0; inode < result->
NNodes; inode++) {
1102 ND::THandle<ND::TPIDState> iState = reco->GetNodes()[inode]->GetState();
1106 node->
Charge = iState->GetCharge();
1107 node->
Position = iState->GetPosition();
1108 node->
Variance = iState->GetPositionVariance();
1109 node->
Direction = iState->GetDirection();
1111 node->
Momentum = iState->GetMomentum();
1112 node->
MomentumError = sqrt(fabs(iState->GetMomentumVariance()));
1115 node->
Position = TLorentzVector(0., 0., 0., 0.);
1116 node->
Variance = TLorentzVector(0., 0., 0., 0.);
1127 ND::THandle<ND::TReconBase>
object = reco;
1128 bool ok = ND::converter().TReconBase_to_Trajectory(
object, traj);
1132 ok = ND::rpman().matching_svc().compute_length(traj, length);
1133 if (ok) result->
Length = length;
1141 result->
Likelihoods.push_back(reco->GetPIDWeight());
1142 result->
Pids.push_back(reco->GetParticleId());
1143 for (ND::TReconObjectContainer::const_iterator it =
1144 reco->GetAlternates().begin();
1145 it != reco->GetAlternates().end(); it++) {
1146 ND::THandle<ND::TReconPID> alter = *it;
1147 result->
Likelihoods.push_back(alter->GetPIDWeight());
1148 result->
Pids.push_back(alter->GetParticleId());
1155 std::string fDetName = std::string(reco->ConvertDetector());
1156 if (fDetName ==
"(TPC1)" || fDetName ==
"(TPC2)" || fDetName ==
"(TPC3)") {
1162 if (reco->GetConstituents()) {
1163 ND::TReconObjectContainer::const_iterator it;
1165 for (it = reco->GetConstituents()->begin();
1166 it != reco->GetConstituents()->end(); it++) {
1167 ND::THandle<ND::TReconTrack> track = (*it);
1168 ND::THandle<ND::TReconPID> pid = (*it);
1198 double& p,
double& ep) {
1202 double B = ND::TFieldManager::GetFieldValue(state->GetPosition()).Mag() /
1207 (state->GetCurvature() *
1208 TMath::Sqrt(1. - state->GetDirection()[0] * state->GetDirection()[0]));
1210 CLHEP::HepMatrix Jacobian(2, 2, 0);
1211 CLHEP::HepMatrix Covariance(2, 2, 0);
1212 CLHEP::HepMatrix Cov(2, 2, 0);
1214 Covariance[0][0] = state->GetCovarianceValue(state->GetDirectionIndex(),
1215 state->GetDirectionIndex());
1216 Covariance[0][1] = state->GetCovarianceValue(state->GetDirectionIndex(),
1217 state->GetCurvatureIndex());
1219 Covariance[1][0] = state->GetCovarianceValue(state->GetCurvatureIndex(),
1220 state->GetDirectionIndex());
1221 Covariance[1][1] = state->GetCovarianceValue(state->GetCurvatureIndex(),
1222 state->GetCurvatureIndex());
1224 Jacobian[0][0] = 1.;
1225 Jacobian[0][1] = 0.;
1227 Jacobian[1][0] = p /
1228 (1. - state->GetDirection()[0] * state->GetDirection()[0]) *
1229 TMath::Abs(state->GetDirection()[0]);
1230 Jacobian[1][1] = -p / state->GetCurvature();
1232 Cov = Jacobian * Covariance * Jacobian.T();
1234 ep = TMath::Sqrt(Cov[1][1]);
1244 double q = (state->GetCurvature() > 0.0 ? -1.0 : 1.0);
1245 if (state->GetDirection()[2] < 0.0) q *= -1.0;
1255 ND::THandle<ND::TTrackState> state = reco->GetState();
1257 result->
Position = state->GetPosition();
1258 result->
Variance = state->GetPositionVariance();
1259 result->
Direction = state->GetDirection();
1262 result->
EDeposit = state->GetEDeposit();
1268 result->
Position = TLorentzVector(0., 0., 0., 0.);
1269 result->
Variance = TLorentzVector(0., 0., 0., 0.);
1270 result->
Direction = TVector3(0., 0., 0.);
1279 result->
NNodes = reco->GetNodes().size();
1280 if (result->
NNodes > 0) {
1282 for (
int inode = 0; inode < result->
NNodes; inode++) {
1283 ND::THandle<ND::TTrackState> iState = reco->GetNodes()[inode]->GetState();
1286 node->
EDeposit = iState->GetEDeposit();
1287 node->
Position = iState->GetPosition();
1288 node->
Variance = iState->GetPositionVariance();
1289 node->
Direction = iState->GetDirection();
1297 node->
Position = TLorentzVector(0., 0., 0., 0.);
1298 node->
Variance = TLorentzVector(0., 0., 0., 0.);
1309 ND::THandle<ND::TReconBase>
object = reco;
1310 bool ok = ND::converter().TReconBase_to_Trajectory(
object, traj);
1314 ok = ND::rpman().matching_svc().compute_length(traj, length);
1315 if (ok) result->
Length = length;
1326 std::string fDetName = std::string(reco->ConvertDetector());
1327 if (fDetName ==
"(TPC1)" || fDetName ==
"(TPC2)" || fDetName ==
"(TPC3)") {
1332 }
else if (fDetName ==
"(FGD1)" || fDetName ==
"(FGD2)") {
1337 if (reco->GetConstituents()) {
1338 ND::TReconObjectContainer::const_iterator it;
1339 for (it = reco->GetConstituents()->begin();
1340 it != reco->GetConstituents()->end(); it++) {
1341 ND::THandle<ND::TReconTrack> track = (*it);
1342 ND::THandle<ND::TReconPID> pid = (*it);
1371 ND::THandle<ND::TReconBase>
object) {
1381 if (object->UsesDetector(ND::TReconBase::kDSECal)) det = det * 10 + 6;
1382 if (object->UsesDetector(ND::TReconBase::kTECal) ||
1383 object->UsesDetector(ND::TReconBase::kPECal))
1417 ND::THandle<ND::TAlgorithmResult> Result =
event.GetFit(
"trackerRecon");
1418 if (!Result)
return true;
1421 ND::THandle<ND::TReconObjectContainer>
final =
1422 Result->GetResultsContainer(
"final");
1423 ND::THandle<ND::TReconObjectContainer> fgdOther =
1424 Result->GetResultsContainer(
"FGD:other");
1425 ND::THandle<ND::TReconObjectContainer> tpcOther =
1426 Result->GetResultsContainer(
"TPC:other");
1427 ND::THandle<ND::TReconObjectContainer> tpcIso =
1428 Result->GetResultsContainer(
"TPC:IsoObjects");
1429 ND::THandle<ND::TReconObjectContainer> vertices =
1430 Result->GetResultsContainer(
"vertices");
1431 ND::THandle<ND::THitSelection> tpcUnused =
1432 Result->GetHitSelection(
"TPC:unused");
1433 ND::THandle<ND::THitSelection> fgdUnused =
1434 Result->GetHitSelection(
"FGD:unused");
1438 for (ND::TReconObjectContainer::iterator it = fgdOther->begin();
1439 it != fgdOther->end(); it++) {
1440 ND::THandle<ND::TReconTrack> track = (*it);
1450 for (ND::TReconObjectContainer::iterator it = tpcOther->begin();
1451 it != tpcOther->end(); it++) {
1452 ND::THandle<ND::TReconTrack> track = (*it);
1463 for (ND::TReconObjectContainer::iterator it = tpcIso->begin();
1464 it != tpcIso->end(); it++) {
1465 ND::THandle<ND::TReconPID> pid = (*it);
1476 for (ND::TReconObjectContainer::iterator it = vertices->begin();
1477 it != vertices->end(); it++) {
1478 ND::THandle<ND::TReconVertex> vert = (*it);
1488 for (ND::THitSelection::const_iterator hsel = fgdUnused->begin();
1489 hsel != fgdUnused->end(); hsel++) {
1492 hit->
Position = (*hsel)->GetPosition();
1493 hit->
Variance = (*hsel)->GetUncertainty();
1494 hit->
Time = (*hsel)->GetTime();
1495 hit->
TimeUnc = (*hsel)->GetTimeUncertainty();
1503 for (ND::TReconObjectContainer::iterator tt = final->begin();
1504 tt !=
final->end(); tt++) {
1505 ND::THandle<ND::TReconPID> pid = *tt;
1506 ND::THandle<ND::TReconTrack> track = *tt;
1507 ND::THandle<ND::TReconBase> reco = *tt;
1511 result->
UniqueID = reco->GetUniqueID();
1514 result->
Status = reco->CheckStatus(reco->kSuccess);
1515 result->
NDOF = reco->GetNDOF();
1516 result->
Chi2 = reco->GetQuality();
1520 if (result->
NDOF > 0)
1526 ND::THandle<ND::TPIDState> state = pid->GetState();
1528 t0avg += state->GetPosition().T();
1537 ND::TG4Trajectory* G4track;
1539 double pur = -0xABCDEF;
1540 double eff = -0xABCDEF;
1541 int G4TrkId = TrackTruthInfo::GetG4TrajectoryID(reco, eff, pur);
1542 ND::THandle<ND::TG4TrajectoryContainer> G4trajectories =
1543 event.Get<ND::TG4TrajectoryContainer>(
"truth/G4Trajectories");
1544 if (G4trajectories) {
1545 ND::TG4TrajectoryContainer::iterator trajIter =
1546 G4trajectories->begin();
1547 ND::TG4TrajectoryContainer::iterator trajEnd = G4trajectories->end();
1548 for (; trajIter != trajEnd; ++trajIter) {
1549 ND::TG4Trajectory* trajectory = &(trajIter->second);
1550 if (trajectory->GetTrackId() == G4TrkId) {
1551 G4track =
new ND::TG4Trajectory(*trajectory);
1556 if (G4track != NULL) {
1563 if (NT0) t0avg /= double(NT0);
1569 for (ND::THitSelection::const_iterator hsel = hstpc->begin();
1570 hsel != hstpc->end(); hsel++) {
1573 hit->
Position = (*hsel)->GetPosition();
1574 hit->
Variance = (*hsel)->GetUncertainty();
1576 hit->
TimeUnc = (*hsel)->GetTimeUncertainty();
1578 double peakTime = 0;
1579 double maxCharge = 0;
1582 ND::THandle<ND::TMultiHit> mh = *hsel;
1583 std::vector<ND::THandle<ND::TSingleHit> >::const_iterator mhit;
1584 for (mhit = mh->begin(); mhit != mh->end(); mhit++) {
1585 if (maxCharge < (*mhit)->GetCharge()) {
1586 maxCharge = (*mhit)->GetCharge();
1587 peakTime = (*mhit)->GetTime();
1593 ND::TGeometryId geomId = (*hsel)->GetGeomId();
1594 double t = peakTime - t0avg;
1596 ND::TGeomInfo::Get().TPC().GetDriftSense(geomId);
1605 ND::THandle<ND::TAlgorithmResult> TpcResult =
event.GetFit(
"tpcRecon");
1606 if (!TpcResult)
return true;
1608 ND::THandle<ND::TReconObjectContainer> TrackCont =
1609 TpcResult->GetResultsContainer(
"TPCPids");
1610 ND::THandle<ND::THitSelection> fgdHits =
event.GetHitSelection(
"fgd");
1611 if (TrackCont && fgdHits) {
1612 for (ND::TReconObjectContainer::iterator it = TrackCont->begin();
1613 it != TrackCont->end(); it++) {
1614 ND::THandle<ND::TReconPID> pid = *it;
1626 ND::TND280Event& event, ND::THandle<ND::TReconBase> reco) {
1627 ND::TG4Trajectory traj;
1628 ND::THandle<ND::THitSelection> hits = reco->GetHits();
1630 ND::THandle<ND::TG4TrajectoryContainer> trajectories =
1631 event.Get<ND::TG4TrajectoryContainer>(
"truth/G4Trajectories");
1632 if (!trajectories)
return ND::TG4Trajectory();
1633 std::vector<int> search;
1635 search.resize(trajectories->size());
1637 for (ND::THitSelection::const_iterator ht = hits->begin(); ht != hits->end();
1640 ND::THandle<ND::TComboHit> ch = *ht;
1643 for (ND::THitSelection::const_iterator ch_member = ch->GetHits().begin();
1644 ch_member != ch->GetHits().end(); ++ch_member) {
1645 ND::THandle<ND::TMultiHit> mh = *ch_member;
1648 std::vector<ND::TG4VHit*> contributors =
1649 HitTruthInfo::GetHitTruthInfo(*ch_member);
1651 for (std::vector<ND::TG4VHit*>::const_iterator h = contributors.begin();
1652 h != contributors.end(); ++h) {
1655 ND::TG4HitSegment* g4hitseg =
dynamic_cast<ND::TG4HitSegment*
>(*h);
1656 if (!g4hitseg)
continue;
1658 for (
unsigned int i = 0; i != g4hitseg->GetContributors().size();
1660 unsigned int vv = g4hitseg->GetContributors()[i];
1661 if (vv >= search.size()) search.resize(vv + 1);
1662 search[vv] = search[vv] + 1;
1666 for (ND::TMultiHit::iterator wfit = mh->begin(); wfit != mh->end();
1668 std::vector<ND::TG4VHit*> contributors =
1669 HitTruthInfo::GetHitTruthInfo(*wfit);
1671 for (std::vector<ND::TG4VHit*>::const_iterator h =
1672 contributors.begin();
1673 h != contributors.end(); ++h) {
1676 ND::TG4HitSegment* g4hitseg =
dynamic_cast<ND::TG4HitSegment*
>(*h);
1677 if (!g4hitseg)
continue;
1679 for (
unsigned int i = 0; i != g4hitseg->GetContributors().size();
1681 unsigned int vv = g4hitseg->GetContributors()[i];
1682 if (vv >= search.size()) search.resize(vv + 1);
1683 search[vv] = search[vv] + 1;
1694 for (
unsigned int i = 0; i < search.size(); i++) {
1695 if (search[i] > maxim) {
1702 return (*trajectories)[imax];
1704 std::cerr <<
" TRACK NOT FOUND " << hits->size() <<
" " << search.size()
1706 return ND::TG4Trajectory();
1712 ND::TG4Trajectory* G4track,
double pur,
double eff,
1717 trueParticle.
ID = G4track->GetTrackId();
1718 trueParticle.
Pur = pur;
1719 trueParticle.
Eff = eff;
1721 ND::TG4PrimaryVertex G4vertex;
1727 trueParticle.
ID = -1;
1729 ND::TG4PrimaryVertex G4vertex;
1737 ND::TG4Trajectory* G4track) {
1740 const ND::TND280Event&
event = *(ND::TEventFolder::GetCurrentEvent());
1741 ND::THandle<ND::TG4TrajectoryContainer> trajectories =
1742 event.Get<ND::TG4TrajectoryContainer>(
"truth/G4Trajectories");
1744 if (G4track->GetParentId() != 0) {
1745 ND::THandle<ND::TG4Trajectory> traj(
1746 new ND::TG4Trajectory(((*trajectories)[G4track->GetParentId()])));
1749 return ND::THandle<ND::TG4Trajectory>();
1754 ND::THandle<TG4Trajectory> G4track) {
1757 const ND::TND280Event&
event = *(ND::TEventFolder::GetCurrentEvent());
1758 ND::THandle<ND::TG4TrajectoryContainer> trajectories =
1759 event.Get<ND::TG4TrajectoryContainer>(
"truth/G4Trajectories");
1761 if (G4track->GetParentId() != 0) {
1762 ND::THandle<ND::TG4Trajectory> traj(
1763 new ND::TG4Trajectory(((*trajectories)[G4track->GetParentId()])));
1766 return ND::THandle<ND::TG4Trajectory>();
1771 bool found,
const ND::TG4PrimaryVertex& G4vertex,
double pur,
double eff,
1776 vertex.
Position = G4vertex.GetPosition();
1777 vertex.
ID = G4vertex.GetInteractionNumber();
1779 vertex.
Position = TLorentzVector(0, 0, 0, 0);
1786 ND::TG4PrimaryVertex& G4vertex) {
1789 const ND::TND280Event&
event = *(ND::TEventFolder::GetCurrentEvent());
1790 ND::THandle<ND::TG4PrimaryVertexContainer> vertices =
1791 event.Get<ND::TG4PrimaryVertexContainer>(
"truth/G4PrimVertex00");
1794 std::vector<ND::TG4PrimaryVertex>::iterator it1;
1795 for (it1 = vertices->begin(); it1 != vertices->end(); it1++) {
1796 const ND::TG4PrimaryParticleContainer& particles =
1797 it1->GetPrimaryParticles();
1799 std::vector<ND::TG4PrimaryParticle>::const_iterator it2;
1800 for (it2 = particles.begin(); it2 != particles.end(); it2++) {
1801 if (it2->GetTrackId() == G4track->GetTrackId()) {
1814 const ND::TG4PrimaryVertex& G4vertex, ND::TG4PrimaryParticle& incoming) {
1817 for (std::vector<ND::TG4PrimaryVertex>::const_iterator infoVtxIter =
1818 G4vertex.GetInfoVertex().begin();
1819 infoVtxIter != G4vertex.GetInfoVertex().end(); ++infoVtxIter) {
1820 std::vector<ND::TG4PrimaryParticle>::const_iterator particleIter;
1821 for (particleIter = infoVtxIter->GetPrimaryParticles().begin();
1822 particleIter != infoVtxIter->GetPrimaryParticles().end();
1824 Int_t pdg = particleIter->GetPDGCode();
1825 if (particleIter->GetTrackId() == -1) {
1827 if (TMath::Abs(pdg) == 12 || TMath::Abs(pdg) == 14 ||
1828 TMath::Abs(pdg) == 16) {
1829 incoming = *particleIter;
1841 ND::THandle<ND::TReconBase>
object) {
1845 if (object->GetHits())
1846 nHits += object->GetHits()->size();
1847 else if (object->GetConstituents()) {
1848 ND::TReconObjectContainer::const_iterator it;
1849 for (it = object->GetConstituents()->begin();
1850 it !=
object->GetConstituents()->end(); it++) {
1851 ND::THandle<ND::TReconBase> obj = (*it);
1869 ND::THandle<ND::TReconBase> fgdCons;
1870 ND::THandle<ND::TReconPID> fgdPid;
1871 ND::THandle<ND::TReconTrack> fgdTrack;
1880 ND::TReconObjectContainer::const_iterator it =
1881 fgdPid->GetConstituents()->begin();
1886 if (fgdTrack && fgdTrack->Has<ND::TIntegerDatum>(
"matchingFailure_flag"))
1888 fgdTrack->Get<ND::TIntegerDatum>(
"matchingFailure_flag")->GetValue();
1900 ND::TReconObjectContainer::const_iterator it =
1901 fgdPid->GetConstituents()->begin();
1906 if (fgdTrack && fgdTrack->Has<ND::TIntegerDatum>(
"matchingFailure_flag"))
1908 fgdTrack->Get<ND::TIntegerDatum>(
"matchingFailure_flag")->GetValue();
double ExtrapolatedVertexZY
for ybar vertex, this is z coordinate in mm
TClonesArray * fVertices
The vector of trackerRecon vertices (none ever?).
TClonesArray * fTPCUnused
The vector of unused TPC hits.
bool ExtrapolateTPC(ND::THandle< ND::TReconPID > in, TClonesArray *out, int idx, ND::THandle< ND::THitSelection > fgd)
Method to make a TPC object with extrapolated hit association information.
TTrueParticle TrueParticle
information about the true particleassociated with this track
double EDeposit
The deposited charge for the constituent object(number of pe's).
An object to describe a reconstructed trackerRecon result.
std::string AlgorithmName
The name of the algorithm that created this object.
Int_t fNTPCExtrapolation
The number of TPC tracks extrapolated into theFGD following Claudio's (2010a) method.
double Length
The total length of the object in mm.
int Detector
Detector used (1,2,3 for TPC, or 4,5 for FGD?)
double ExtrapolatedVertexXX
for xbar vertex, this is x coordinate in mm
int GetDetectorNumber(ND::THandle< ND::TReconBase > object)
Method to build an integer key that describes the detectors used to build the TRecon object...
virtual ~TTrackerVertex()
int Ndof
Number of degrees of freedom in FGD track fit.
TVector3 Direction
the FGD track direction vector (dx,dy,dz)
TVector3 Direction
direction vector
TLorentzVector BackVariance
The 4-vector position variance at theback of the track(var(x),var(y),var(z),var(t)) in mm^2...
Int_t NTotalConstituents
Number of all constituents, andconstituents-constituents...
double PullPion
Pull for TPC pid pion hypothesis.
double fCathodeOffset
TPC cathode offset used for tpc other hits.
UInt_t UniqueID
Unique ID number to allow matching to Global Reconobject.
double Quality
The quality of the fit.(probability)
TLorentzVector FrontPosition
The 4-vector position at the front ofthe track (x,y,z,t) in mm, ns.
void FillConfigTree(TTree *configTree)
double TrCurvature
track curvature, units are 1/mm
An object to describe a reconstructed track.
UInt_t UniqueID
Unique ID number to allow matching to Global Reconobject.
virtual ~TTrackerResult()
int Detectors
Detectors used.
bool GetG4Vertex(ND::TG4Trajectory *G4track, ND::TG4PrimaryVertex &G4vertex)
Method to find the best matching G4 vertex for a given G4 track.
double MomentumError
uncertainty in momentum MeV/c
int NHits
The number of hits.
double PullMuon
Pull for TPC pid muon hypothesis.
TClonesArray * FGD
FGD objects associated with track.
double Quality
The quality of the fit. Ie. the Prob(chi2,ndof)
int NDOF
The number of degrees of freedom.
ClassImp(ND::TBeamSummaryDataModule::TBeamSummaryData)
bool isForward
Sense of track.
TLorentzVector Position
Position 4-vector (at node) x,y,z,t in mm, ns.
TClonesArray * fTPCIso
The vector of isolated TPC tracks with fits.
Int_t NFGDs
Number of FGD Specific objects.
virtual void InitializeBranches()
Initialize the branches in the trackerRecon eventAnalysis tree.
std::string fDescription
A longish descrition of the analysis.
bool insideFGD1(double zx, double zy, double xx, double yy)
void FillFinalTrack(TTrackerResult *result, ND::THandle< ND::TReconTrack > reco)
Method to fill a trackerRecon result entry.
TLorentzVector Position
The position of the vertex.
An object to describe a reconstructed vertex.
ND::THandle< ND::TReconTrack > GetConstituentTrack(ND::THandle< ND::TReconPID > in, int &nconstit)
called recursively to look for bottom level track that built a PID.
ND::THandle< ND::TG4Trajectory > GetParent(ND::TG4Trajectory *G4track)
Method to get the parent G4 track for a given G4 track.
int NNodes
The number of nodes (fgd hits + tpc tracks)
double Charge
Charge from the TPC pid (+1, or -1)
Int_t fNFGDUnused
The number of unused FGD hits.
void FillTrueVertex(bool found, const ND::TG4PrimaryVertex &G4vertex, double pur, double eff, ND::TTrueVertex &vertex)
Method to fill the true vertex information from a given G4 vertex.
void FillFGD(ND::THandle< ND::TReconTrack > in, TClonesArray *out, int idx)
Method to fill trackerRecon tree with FGD information Input is a TReconPID of FGD fit information...
void FillVertex(ND::THandle< ND::TReconVertex > in, TClonesArray *out, int idx)
Method to fill trackerRecon tree with vertex information Input is a TReconVertex. ...
double ExtrapolatedVertexZX
for xbar vertex, this is z coordinate in mm
int Detectors
Detectors used.
double fMaxDrift
TPC maximum drift used for tpc other hits.
double SigmaPion
Sigma estimated width of TPC pid pion hypothesis.
int Status
The status for the fit.
std::string AlgorithmName
algorithm that created this object.
Int_t fNFGDOther
The number of FGD tracks with no fit (none ever?).
TLorentzVector Position
position 4-vector (x,y,z,t) in mm, ns
double MomentumError
Uncertainty in the Momentum in MeV/c from theTPC pid.
Int_t fNTPCOther
The number of TPC tracks with no fit.
bool borderFGD1(TVector3 pos)
An object to hold specific FGD track variables.
double EDeposit
The deposited charge for the object.
TLorentzVector FrontVariance
The 4-vector position variance at thefront of the track(var(x),var(y),var(z),var(t)) in mm^2...
int NHits
The number of hits.
bool HasExtrapolation
extrapolation method of vertex is calculated ornot
TClonesArray * fFGDUnused
The vector of unused TPC hits.
void FillTrueParticle(ND::TG4Trajectory *G4track, double pur, double eff, ND::TTrackerReconModule::TTrueParticle &trueParticle)
Method to fill the true particle information given a G4track.
double Charge
The Charge (+-1)
virtual Bool_t ProcessFirstEvent(ND::TND280Event &event)
Method for special handling of first event.
An object to describe the true G4 particle associated to the TTrackerResult.
TLorentzVector Position
The position of the vertex components [0]=x [1]=y [2]=z [3]=t x,y,z are in mm, t is in ns...
TLorentzVector Variance
Position variance 4-vector (at node)var(x),var(y),var(z),var(t) in mm^2, ns^2.
TLorentzVector PositionVariance
Variance in Position in mm^2, ns^2.
TVector3 Variance
The position variance in mm.
std::vector< int > Pids
the PID that goes with Likelihoods
int NConstituents
Number of constituents (probably 1, for track!)
Int_t ConstitIdx[2]
Index into Constituents inTTrackerResult::Constituents of this constituent'sconstituents.
TVector3 Direction
Direction vector (at node)
TVector3 Direction
TPC pid direction vector in mm.
double Pur
The purity for matching.
bool FillConstituentTrack(TTrackerResult *result, ND::THandle< ND::TReconTrack > in, int &idx)
Method to fill information about constituent tracks.
int matchingFailure_flag
Flag a object where the TPC-FGD matchingfailed.
double Charge
The Charge of this constituent (+-1)
TLorentzVector Position
Position at which kinematics are reported in mm, ns.
Int_t fBufferSize
Buffer Size for TBranch.
TVector3 DirectionVariance
direction variance vector
TVector3 DirectionVariance
TPC pid variance in vector direction in mm^2.
double EDeposit
the FGD track energy deposit (total number of pe's)
unsigned long Status
The status for the fit.
virtual ~TTrackerConstituent()
double FrontMomentum
the momentum at the front of the track in MeV/c
std::vector< double > Likelihoods
the PID likelihoods for combined PID for now this is the product of the three TPC PID probabilities T...
int NDOF
The number of degrees of freedom.
Int_t fNVertices
Tree Entries.
double Sigma0
TPC track diffusion parameters depend on diffusion model used Original TPC diffusion model was: sigma...
int GetNumberOfHits(ND::THandle< ND::TReconBase > object)
Method to find the total number of hits used to build the reconstructed track/pid/etc.
double MomentumError
Track Momentum uncertainty (at node) in MeV/c.
double SigmaMuon
Sigma estimated width of TPC pid muon hypothesis.
double dEdxexpKaon
Estimated dE/dx for kaon hypothesis.
TVector3 BackDirection
The direction vector at the back of the track.
void FillOther(ND::THandle< ND::TReconTrack > in, TClonesArray *out, int idx)
Method to fill trackerRecon tree with unfit track information Input is a TReconTrack that was not fit...
std::string AlgorithmName
The name of the algorithm that created this object.
double computeDistFGD(TVector3 f, TVector3 in, double tx, double ty, double curv, bool isX)
TLorentzVector Variance
The position of the vertex.
virtual void InitializeModule()
Method to initialize this module.
int NNodes
The number of nodes.
double Chi2
The chi2 of the fit.
TClonesArray * Constituents
All constituents, and constituents-constituents...
TTrackerReconModule(const char *name="Tracker", const char *title="Tracker Recon Module")
Constructor.
bool isForward
Sense of object.
std::string fCVSID
Defined if an official tagged version.
virtual ~TTrackerReconModule()
Destructor.
double Ccorr
Corrected truncated mean charge deposit in PID.
virtual bool FillTree(ND::TND280Event &)
Main call to fill all of the branches of the trackerRecon eventAnalysis tree for a given event...
double Chi2
Chi2 of the FGD track fit the FGD track starting position vector coordinates in order x...
Object to describe the fit parameters at a track node.
double EDeposit
The Energy Deposit (number of pe's)
TVector3 DirectionVariance
track direction variance
double Momentum
momentum MeV/c
double EDeposit
The deposited charge for the object (number of pe's)
double SigmaKaon
Sigma estimated width of TPC pid kaon hypothesis.
ND::TG4Trajectory GetTrajectory(ND::TND280Event &event, ND::THandle< ND::TReconBase > reco)
Method to get the G4 trajectory that best matches the TRecon object.
unsigned long Status
The status for the fit.
double dEdxexpMuon
Estimated dE/dx for muon hypothesis.
void CheckMatchingFailure(TTrackerResult *result, ND::THandle< ND::TReconBase > reco)
Method to find FGD constituent track from a matching object and fill matchingFailure_flag.
double PullEle
Pull for TPC pid electron hypothesis.
double Quality
The quality of the fit.(probability(chi2,ndof))
void SetNameTitle(char const *name, char const *title)
ND::TTrueVertex Vertex
True vertex associated to this TrueParticle.
TClonesArray * fFGDOther
The vector of FGD tracks with no fit.
double Momentum
Momentum of the TPC pid in MeV/c.
bool GetIncomingParticle(const ND::TG4PrimaryVertex &G4vertex, ND::TG4PrimaryParticle &incoming)
Method to find the incident particle (neutrino) that gave rise to a given G4 track.
int NHits
number of clusters used in TPC fit
TLorentzVector BackPosition
The 4-vector position of the back of thetrack (x,y,z,t) in mm, ns.
double Time
Time of the hit in ns.
double MomentumError
track momentum MeV/c
std::string AlgorithmName
The name of the algorithm that created this object.
double SigmaEle
Sigma estimated width of TPC pid electron hypothesis.
TLorentzVector BackPosition
The position of the track at itsdownstream-most end (x,y,z,t) in mm,ns.
TLorentzVector Position
track position 4-vector (x,y,z,t) in mm, ns
TVector3 DirectionVariance
Direction variance vector (at node)
Int_t NConstituents
The number of constituents this constituent ismade of.
bool FillConstituentPid(TTrackerResult *result, ND::THandle< ND::TReconPID > in, int &idx)
Method to fill information about constituent pids.
TVector3 TrDirectionVar
variance in track direction vector
int Ndof
Number of degrees of freedom in TPC fit.
TPC pid and track variables.
double ExtrapolatedVertexYY
for ybar vertex, this is y coordinate in mm
int Detector
FGD number 1 or 2.
double Chi2
TPC chi2 calculated after likelihood fit.
void getTangents(ND::THandle< ND::TTrackState > state, double &tx, double &etx, double &ty, double &ety)
TClonesArray * Hits
The hits.
double dEdxexpPion
Estimated dE/dx for pion hypothesis.
double Sigma1
TPC track diffusion sigma1 parameter.
TClonesArray * fTPCOther
The vector of TPC tracks with no fit.
Int_t fSplitLevel
Split Level for TBranch.
int NDOF
The number of degrees of freedom.
double BackMomentum
the momentum at the back of the track iin MeV/c
Int_t ID
The vertex ID from G4.
int NHits
The number of hits.
TVector3 Position
The position of the hit component 0=x 1=y 2=z in mm.
Int_t NTPCs
Number of TPC tracks used to build this track.
double Charge
The Charge (+-1)
double TimeUnc
Time Uncertainty of hit in ns.
bool borderFGD2(TVector3 pos)
double dEdxexpEle
Estimated dE/dx for electron hypothesis.
An object to describe a track that has no fit result.
Int_t fNTPCIso
The number of isolated TPC tracks with fits (none ever?)
std::string fCVSTagName
Defined if an official tagged version.
Int_t fNTPCUnused
The number of unused TPC hits.
An object to describe the true G4 vertex associated to the TGlobalVertex.
UInt_t UniqueID
Unique ID number to allow matching to Global Reconobject.
TClonesArray * fTracks
The vector of overall trackerRecon results.
Int_t NConstituents
The number of constituents (tracks and pids) usedto build this track.
bool insideFGD2(double zx, double zy, double xx, double yy)
double PullKaon
Pull for TPC pid kaon hypothesis.
double TrCurvatureVar
variance in track direction vector, units are(1mm)^2
double Eff
The efficiency for matching.
Int_t ConstitIdx[2]
Index into Constituents of the constituents usedto build this track.
TLorentzVector FrontPosition
The position of the track at itsupstream-most end (x,y,z,t) in mm, ns.
double SigmaProton
Sigma estimated width of TPC pid proton hypothesis.
TClonesArray * TPC
Information about the TPC pids/tracks used to buildthis track.
TClonesArray * fTPCExtrapolation
The vector of TPC tracks extrapolatedinto the FGD following Claudio's (2010a)method.
double dEdxexpProton
Estimated dE/dx for proton hypothesis.
An object to describe a constituent of a trackerRecon result.
void SetSplitLevel(Int_t splitlevel)
ROOT output parameters, usually no need to touch.
void GetMomentum(ND::THandle< ND::TTrackState > state, double &p, double &ep)
Helper method to convert TTrackState curvature information into momentum and momentum uncertainty...
double fDriftVelocity
TPC drift velocity used for tpc other hits.
double Momentum
track momentum MeV/c
double Chi2
The chi2 of the fit.
TClonesArray * Nodes
Kinematics of the track at each node in the track fit.
double GetCharge(ND::THandle< ND::TTrackState > state)
Helper method to convert TTrackState curvature information into track charge.
double Sigma2
TPC track diffusion sigma2 parameter.
void FillFinalPid(TTrackerResult *result, ND::THandle< ND::TReconPID > reco)
Method to fill a trackerRecon result entry.
TVector3 Direction
track direction vector
double PullProton
Pull for TPC pid proton hypothesis.
double NTrun
70% of the number of clusters
Int_t fNTracks
The number of trackerRecon results.
TLorentzVector Variance
track position variance 4-vectorvar(x),var(y),var(z),var(t) in mm^2, ns^2
ND::THandle< ND::THitSelection > GetHitsFromComboHits(ND::THandle< ND::THitSelection > tpc)
Method to get the tpc combo hits from the tpc hit selection (used for tpc other)
int Detector
TPC number 1, 2 or 3.
TVector3 TrDirection
track direction vector
TLorentzVector Variance
position variance 4-vector(var(x),var(y),var(z),var(t)) in mm^2, ns^2
TVector3 FrontDirection
The direction vector at the front of the track.
double MeanDrift
TPC track mean drift value used in diffusion model.
double TotalCharge
Deposited charge (the hit EDeposit)
double Momentum
Track Momentum (at node) in MeV/c.
void FillTPC(ND::THandle< ND::TReconPID > in, TClonesArray *out, int idx)
Method to fill trackerRecon tree with TPC information Input is a TReconPID of TPC fit information...
virtual void FillConfigTree(TTree *)