20 #include <display/EVEVisualization.h>
22 #include <display/VisualRepMap.h>
23 #include <display/EveGeometry.h>
24 #include <display/EveVisBField.h>
25 #include <display/ObjectInfo.h>
27 #include <vxd/geometry/GeoCache.h>
28 #include <klm/dataobjects/bklm/BKLMSimHitPosition.h>
29 #include <klm/dataobjects/bklm/BKLMHit2d.h>
30 #include <klm/bklm/geometry/GeometryPar.h>
31 #include <cdc/geometry/CDCGeometryPar.h>
32 #include <cdc/dataobjects/CDCRecoHit.h>
33 #include <cdc/translators/RealisticTDCCountTranslator.h>
34 #include <arich/dbobjects/ARICHGeometryConfig.h>
35 #include <simulation/dataobjects/MCParticleTrajectory.h>
36 #include <svd/reconstruction/SVDRecoHit.h>
37 #include <top/geometry/TOPGeometryPar.h>
39 #include <genfit/AbsMeasurement.h>
40 #include <genfit/PlanarMeasurement.h>
41 #include <genfit/SpacepointMeasurement.h>
42 #include <genfit/WireMeasurement.h>
43 #include <genfit/WireMeasurementNew.h>
44 #include <genfit/WirePointMeasurement.h>
45 #include <genfit/DetPlane.h>
46 #include <genfit/Exception.h>
47 #include <genfit/KalmanFitterInfo.h>
48 #include <genfit/GblFitterInfo.h>
50 #include <framework/dataobjects/DisplayData.h>
51 #include <framework/logging/Logger.h>
52 #include <framework/utilities/ColorPalette.h>
54 #include <TEveArrow.h>
57 #include <TEveManager.h>
58 #include <TEveGeoShape.h>
60 #include <TEvePointSet.h>
61 #include <TEveSelection.h>
62 #include <TEveStraightLineSet.h>
63 #include <TEveTriangleSet.h>
65 #include <TEveTrack.h>
66 #include <TEveTrackPropagator.h>
68 #include <TGeoMatrix.h>
69 #include <TGeoManager.h>
70 #include <TGeoSphere.h>
72 #include <TGLLogicalShape.h>
73 #include <TParticle.h>
77 #include <TMatrixDSymEigen.h>
79 #include <boost/math/special_functions/fpclassify.hpp>
80 #include <boost/scoped_ptr.hpp>
81 #include <boost/algorithm/string/find.hpp>
82 #include <boost/algorithm/string/trim.hpp>
83 #include <boost/algorithm/string/classification.hpp>
93 template <
class T>
void destroyEveElement(T*& el)
96 if (el->GetDenyDestroy() > 1)
97 B2WARNING(
"destroyEveElement(): Element " << el->GetName() <<
" has unexpected refcount " << el->GetDenyDestroy());
109 void fixGeoShapeRefCount(TEveGeoShape* eveshape)
111 TGeoShape* s = eveshape->GetShape();
113 if (gGeoManager->GetListOfShapes()->Last() == s)
114 gGeoManager->GetListOfShapes()->RemoveAt(gGeoManager->GetListOfShapes()->GetLast());
116 gGeoManager->GetListOfShapes()->Remove(s);
128 m_assignToPrimaries(false),
134 TGLLogicalShape::SetIgnoreSizeForCameraInterest(kTRUE);
160 m_calo3d =
new TEveCalo3D(NULL,
"ECLClusters");
162 m_calo3d->SetForwardEndCapPos(196.5);
163 m_calo3d->SetBackwardEndCapPos(-102.0);
165 m_calo3d->SetRnrFrame(
false,
false);
169 gEve->GetSelection()->IncDenyDestroy();
170 gEve->GetHighlight()->IncDenyDestroy();
200 bool drawHits =
false;
203 for (
size_t i = 0; i <
m_options.length(); i++) {
204 if (
m_options.at(i) ==
'H') drawHits =
true;
214 TEveStraightLineSet* lines =
new TEveStraightLineSet(
"RecoHits for " + label);
217 lines->SetMarkerStyle(6);
218 lines->SetMainTransparency(60);
235 TEveRecTrack rectrack;
236 rectrack.fP.Set(track_mom);
237 rectrack.fV.Set(track_pos);
240 track_lines->SetName(label);
243 track_lines->SetLineWidth(1);
249 track_lines->AddElement(lines);
259 bool drawHits =
false;
262 for (
size_t i = 0; i <
m_options.length(); i++) {
263 if (
m_options.at(i) ==
'H') drawHits =
true;
270 TEveLine* track =
new TEveLine();
271 std::vector<TVector3> posPoints;
272 track->SetName(label);
274 track->SetLineWidth(3);
276 track->SetSmooth(
true);
280 if (!recoHit->useInFit())
290 if (not fittedResult) {
291 B2WARNING(
"Skipping unfitted track point");
295 state.getPosMomCov(pos, mom, cov);
297 B2WARNING(
"Skipping state with strange pos, mom or cov");
301 posPoints.push_back(TVector3(pos.X(), pos.Y(), pos.Z()));
304 sort(posPoints.begin(), posPoints.end(),
305 [](
const TVector3 & a,
const TVector3 & b) ->
bool {
306 return a.X() * a.X() + a.Y() * a.Y() > b.X() * b.X() + b.Y() * b.Y();
308 for (
auto vec : posPoints) {
309 track->SetNextPoint(vec.X(), vec.Y(), vec.Z());
312 TEveStraightLineSet* lines =
new TEveStraightLineSet(
"RecoHits for " + label);
315 lines->SetMarkerStyle(6);
316 lines->SetMainTransparency(60);
333 track->AddElement(lines);
343 TVector3 track_pos = TVector3(0, 0, trgTrack.getZ0());
344 TVector3 track_mom = (trgTrack.getChargeSign() == 0) ?
345 trgTrack.getDirection() * 1000 :
346 trgTrack.getMomentum(1.5);
348 TEveRecTrack rectrack;
349 rectrack.fP.Set(track_mom);
350 rectrack.fV.Set(track_pos);
353 track_lines->SetName(label);
355 track_lines->SetLineColor(kOrange + 2);
356 track_lines->SetLineWidth(1);
358 TString::Format(
"\ncharge: %d, phi: %.2fdeg, pt: %.2fGeV, theta: %.2fdeg, z: %.2fcm",
359 trgTrack.getChargeSign(),
360 trgTrack.getPhi0() * 180 / M_PI,
361 trgTrack.getTransverseMomentum(1.5),
362 trgTrack.getDirection().Theta() * 180 / M_PI,
366 track_lines->SetCharge(trgTrack.getChargeSign());
369 if (trgTrack.getZ0() == 0 && trgTrack.getCotTheta() == 0)
370 track_lines->SetLineStyle(2);
382 B2ERROR(
"Track without TrackFitResult skipped.");
390 bool drawDetectors =
false;
391 bool drawHits =
false;
392 bool drawPlanes =
false;
395 for (
size_t i = 0; i <
m_options.length(); i++) {
396 if (
m_options.at(i) ==
'D') drawDetectors =
true;
397 if (
m_options.at(i) ==
'H') drawHits =
true;
398 if (
m_options.at(i) ==
'P') drawPlanes =
true;
406 bool isPruned = (track ==
nullptr);
409 TEveRecTrackD recTrack;
411 recTrack.fV.Set(poca);
413 const TVector3& poca_momentum = fitResult->
getMomentum();
414 if (std::isfinite(poca_momentum.Mag()))
415 recTrack.fP.Set(poca_momentum);
417 recTrack.fP.Set(fitResult->
getHelix().getDirection() * 1000);
421 eveTrack->SetName(label);
428 representation = track->getCardinalRepresentation();
429 B2DEBUG(100,
"Draw cardinal rep");
431 const auto& representations = track->getRepresentations();
432 if (representations.empty()) {
433 B2ERROR(
"No representations found in the reco track!");
436 B2DEBUG(100,
"Draw representation number 0.");
437 representation = representations.front();
440 if (!track->hasTrackFitStatus(representation)) {
441 B2ERROR(
"RecoTrack without FitStatus: will be skipped!");
459 const auto& hitPoints = track->getHitPointsWithMeasurement();
460 const unsigned int numpoints = hitPoints.size();
467 if (! tp->hasFitterInfo(representation)) {
468 B2ERROR(
"trackPoint has no fitterInfo for rep");
478 B2ERROR(
"Can only display KalmanFitterInfo or GblFitterInfo");
483 B2FATAL(
"AbsFitterInfo dynamic-casted to both KalmanFitterInfo and GblFitterInfo!");
486 if (fi && ! tp->hasRawMeasurements()) {
487 B2ERROR(
"trackPoint has no raw measurements");
491 if (fi && ! fi->hasPredictionsAndUpdates()) {
492 B2ERROR(
"KalmanFitterInfo does not have all predictions and updates");
500 fittedState = &(fi->getFittedState(
true));
502 B2ERROR(e.what() <<
" - can not get fitted state");
506 TVector3 track_pos = representation->
getPos(*fittedState);
509 if (prevFittedState != NULL) {
511 TEvePathMark::EType_e markType = TEvePathMark::kReference;
512 if (hitCounter + 1 ==
static_cast<int>(numpoints))
513 markType = TEvePathMark::kDecay;
524 makeLines(eveTrack, prevFi->getForwardUpdate(), fi->getForwardPrediction(), representation, markType,
m_drawErrors, 0);
526 makeLines(eveTrack, prevFi->getBackwardPrediction(), fi->getBackwardUpdate(), representation, markType,
m_drawErrors);
528 if (
m_drawRefTrack && fi->hasReferenceState() && prevFi->hasReferenceState())
529 makeLines(eveTrack, prevFi->getReferenceState(), fi->getReferenceState(), representation, markType,
false);
533 if (gfi && prevGFi) {
539 if (
m_drawRefTrack && gfi->hasReferenceState() && prevGFi->hasReferenceState()) {
542 makeLines(eveTrack, &prevSop, &sop, representation, markType,
false);
549 prevFittedState = fittedState;
553 const int numMeasurements = tp->getNumRawMeasurements();
554 for (
int iMeasurement = 0; iMeasurement < numMeasurements; iMeasurement++) {
557 TVectorT<double> hit_coords;
558 TMatrixTSym<double> hit_cov;
563 hit_coords.ResizeTo(mop->getState());
564 hit_cov.ResizeTo(mop->getCov());
565 hit_coords = mop->getState();
566 hit_cov = mop->getCov();
573 hit_coords.ResizeTo(gblMeas.getState());
574 hit_cov.ResizeTo(gblMeas.getCov());
575 hit_coords = gblMeas.getState();
576 hit_cov = gblMeas.getCov();
582 TVector3 o = fittedState->getPlane()->getO();
583 TVector3 u = fittedState->getPlane()->getU();
584 TVector3 v = fittedState->getPlane()->getV();
586 bool planar_hit =
false;
587 bool planar_pixel_hit =
false;
588 bool space_hit =
false;
589 bool wire_hit =
false;
590 bool wirepoint_hit =
false;
593 double_t plane_size = 4;
595 int hit_coords_dim = m->getDim();
599 if (hit_coords_dim == 1) {
600 hit_u = hit_coords(0);
601 }
else if (hit_coords_dim == 2) {
602 planar_pixel_hit =
true;
603 hit_u = hit_coords(0);
604 hit_v = hit_coords(1);
612 hit_u = fabs(hit_coords(0));
613 hit_v = v * (track_pos - o);
615 wirepoint_hit =
true;
616 hit_v = hit_coords(1);
619 B2ERROR(
"Hit " << hitCounter <<
", Measurement " << iMeasurement <<
": Unknown measurement type: skipping hit!");
626 if (drawPlanes || (drawDetectors && planar_hit)) {
627 TVector3 move(0, 0, 0);
628 if (wire_hit) move = v * (v * (track_pos - o));
629 TEveBox* box =
boxCreator(o + move, u, v, plane_size, plane_size, 0.01);
630 if (drawDetectors && planar_hit) {
631 box->SetMainColor(kCyan);
633 box->SetMainColor(kGray);
635 box->SetMainTransparency(50);
636 eveTrack->AddElement(box);
644 TEveGeoShape* det_shape =
new TEveGeoShape(
"det_shape");
645 det_shape->SetShape(
new TGeoTube(std::max(0., (
double)(hit_u - 0.0105 / 2.)), hit_u + 0.0105 / 2., plane_size));
646 fixGeoShapeRefCount(det_shape);
648 TVector3 norm = u.Cross(v);
649 TGeoRotation det_rot(
"det_rot", (u.Theta() * 180) / TMath::Pi(), (u.Phi() * 180) / TMath::Pi(),
650 (norm.Theta() * 180) / TMath::Pi(), (norm.Phi() * 180) / TMath::Pi(),
651 (v.Theta() * 180) / TMath::Pi(), (v.Phi() * 180) / TMath::Pi());
652 TVector3 move = v * (v * (track_pos - o));
653 TGeoCombiTrans det_trans(o(0) + move.X(),
657 det_shape->SetTransMatrix(det_trans);
658 det_shape->SetMainColor(kCyan);
659 det_shape->SetMainTransparency(25);
660 if ((drawHits && (hit_u + 0.0105 / 2 > 0)) || !drawHits) {
661 eveTrack->AddElement(det_shape);
672 if (!planar_pixel_hit) {
677 B2WARNING(
"SVD recohit couldn't be converted... ");
684 double hit_res_u = hit_cov(0, 0);
685 if (recoHit->
isU()) {
686 du = std::sqrt(hit_res_u);
687 dv = sensor.getLength();
690 du = sensor.getWidth();
691 dv = std::sqrt(hit_res_u);
694 double depth = sensor.getThickness();
695 TEveBox* hit_box =
boxCreator(a, u, v, du, dv, depth);
696 hit_box->SetName(
"SVDRecoHit");
698 hit_box->SetMainTransparency(0);
699 eveTrack->AddElement(hit_box);
703 TMatrixDSymEigen eigen_values(hit_cov);
704 TEveGeoShape* cov_shape =
new TEveGeoShape(
"PXDRecoHit");
705 const TVectorD& ev = eigen_values.GetEigenValues();
706 const TMatrixD& eVec = eigen_values.GetEigenVectors();
712 cov_shape->SetShape(
new TGeoEltu(pseudo_res_0, pseudo_res_1, 0.0105));
713 fixGeoShapeRefCount(cov_shape);
714 TVector3 pix_pos = o + hit_u * u + hit_v * v;
715 TVector3 u_semiaxis = (pix_pos + eVec(0, 0) * u + eVec(1, 0) * v) - pix_pos;
716 TVector3 v_semiaxis = (pix_pos + eVec(0, 1) * u + eVec(1, 1) * v) - pix_pos;
717 TVector3 norm = u.Cross(v);
721 TGeoRotation det_rot(
"det_rot", (u_semiaxis.Theta() * 180) / TMath::Pi(), (u_semiaxis.Phi() * 180) / TMath::Pi(),
722 (v_semiaxis.Theta() * 180) / TMath::Pi(), (v_semiaxis.Phi() * 180) / TMath::Pi(),
723 (norm.Theta() * 180) / TMath::Pi(), (norm.Phi() * 180) / TMath::Pi());
724 TGeoCombiTrans det_trans(pix_pos(0), pix_pos(1), pix_pos(2), &det_rot);
725 cov_shape->SetTransMatrix(det_trans);
729 cov_shape->SetMainTransparency(0);
730 eveTrack->AddElement(cov_shape);
739 TMatrixDSymEigen eigen_values(m->getRawHitCov());
740 TEveGeoShape* cov_shape =
new TEveGeoShape(
"SpacePoint Hit");
741 cov_shape->SetShape(
new TGeoSphere(0., 1.));
742 fixGeoShapeRefCount(cov_shape);
743 const TVectorD& ev = eigen_values.GetEigenValues();
744 const TMatrixD& eVec = eigen_values.GetEigenVectors();
745 TVector3 eVec1(eVec(0, 0), eVec(1, 0), eVec(2, 0));
746 TVector3 eVec2(eVec(0, 1), eVec(1, 1), eVec(2, 1));
747 TVector3 eVec3(eVec(0, 2), eVec(1, 2), eVec(2, 2));
748 TVector3 norm = u.Cross(v);
752 TGeoRotation det_rot(
"det_rot", (eVec1.Theta() * 180) / TMath::Pi(), (eVec1.Phi() * 180) / TMath::Pi(),
753 (eVec2.Theta() * 180) / TMath::Pi(), (eVec2.Phi() * 180) / TMath::Pi(),
754 (eVec3.Theta() * 180) / TMath::Pi(), (eVec3.Phi() * 180) / TMath::Pi());
763 TGeoGenTrans det_trans(o(0), o(1), o(2),
766 pseudo_res_0, pseudo_res_1, pseudo_res_2,
768 cov_shape->SetTransMatrix(det_trans);
772 cov_shape->SetMainTransparency(10);
773 eveTrack->AddElement(cov_shape);
779 const double cdcErrorScale = 1.0;
780 TEveGeoShape* cov_shape =
new TEveGeoShape(
"CDCRecoHit");
781 double pseudo_res_0 = cdcErrorScale * std::sqrt(hit_cov(0, 0));
782 double pseudo_res_1 = plane_size;
783 if (wirepoint_hit) pseudo_res_1 = cdcErrorScale * std::sqrt(hit_cov(1, 1));
785 cov_shape->SetShape(
new TGeoTube(std::max(0., (
double)(hit_u - pseudo_res_0)), hit_u + pseudo_res_0, pseudo_res_1));
786 fixGeoShapeRefCount(cov_shape);
787 TVector3 norm = u.Cross(v);
790 TGeoRotation det_rot(
"det_rot", (u.Theta() * 180) / TMath::Pi(), (u.Phi() * 180) / TMath::Pi(),
791 (norm.Theta() * 180) / TMath::Pi(), (norm.Phi() * 180) / TMath::Pi(),
792 (v.Theta() * 180) / TMath::Pi(), (v.Phi() * 180) / TMath::Pi());
793 TGeoCombiTrans det_trans(o(0) + hit_v * v.X(),
794 o(1) + hit_v * v.Y(),
795 o(2) + hit_v * v.Z(),
797 cov_shape->SetTransMatrix(det_trans);
801 cov_shape->SetMainTransparency(50);
802 eveTrack->AddElement(cov_shape);
810 auto& firstref = eveTrack->RefPathMarks().front();
811 auto& lastref = eveTrack->RefPathMarks().back();
812 double f = firstref.fV.Distance(recTrack.fV);
813 double b = lastref.fV.Distance(recTrack.fV);
814 if (f > 100 and f > b) {
815 B2WARNING(
"Decay vertex is much closer to POCA than first vertex, reversing order of track points... (this is intended for cosmic tracks, if you see this message in other context it might indicate a problem)");
817 lastref.fType = TEvePathMarkD::kReference;
818 firstref.fType = TEvePathMarkD::kDecay;
819 std::reverse(eveTrack->RefPathMarks().begin(), eveTrack->RefPathMarks().end());
822 eveTrack->SetTitle(TString::Format(
"%s\n"
827 isPruned ?
" yes" :
"no",
828 poca_momentum.Pt(), poca_momentum.Pz(),
832 eveTrack->SetLineStyle(1);
833 eveTrack->SetLineWidth(3.0);
853 TEveBox* box =
new TEveBox;
854 box->SetPickable(
true);
856 TVector3 norm = u.Cross(v);
859 norm *= (0.5 * depth);
862 for (
int k = 0; k < 8; ++k) {
865 int signU = ((k + 1) & 2) ? -1 : 1;
866 int signV = (k & 4) ? -1 : 1;
867 int signN = (k & 2) ? -1 : 1;
869 for (
int i = 0; i < 3; ++i) {
870 vertex[i] = o(i) + signU * u(i) + signV * v(i) + signN * norm(i);
872 box->SetVertex(k, vertex);
880 TEvePathMark::EType_e markType,
bool drawErrors,
int markerPos)
884 TVector3 pos, dir, oldPos, oldDir;
886 rep->
getPosDir(*prevState, oldPos, oldDir);
888 double distA = (pos - oldPos).Mag();
889 double distB = distA;
890 if ((pos - oldPos)*oldDir < 0)
892 if ((pos - oldPos)*dir < 0)
897 TEveVector(pos(0), pos(1), pos(2)),
898 TEveVector(dir(0), dir(1), dir(2))
900 eveTrack->AddPathMark(mark);
910 if (measuredState != NULL) {
915 eval = 0.2 * distA * oldDir;
917 eval = -0.2 * distB * dir;
922 TVector3 position, direction;
923 rep->
getPosMomCov(*measuredState, position, direction, cov);
926 TMatrixDSymEigen eigen_values(cov.GetSub(0, 2, 0, 2));
927 const TVectorD& ev = eigen_values.GetEigenValues();
928 const TMatrixD& eVec = eigen_values.GetEigenVectors();
929 TVector3 eVec1, eVec2;
931 static const double maxErr = 1000.;
932 double ev0 = std::min(ev(0), maxErr);
933 double ev1 = std::min(ev(1), maxErr);
934 double ev2 = std::min(ev(2), maxErr);
937 if (ev0 < ev1 && ev0 < ev2) {
938 eVec1.SetXYZ(eVec(0, 1), eVec(1, 1), eVec(2, 1));
940 eVec2.SetXYZ(eVec(0, 2), eVec(1, 2), eVec(2, 2));
942 }
else if (ev1 < ev0 && ev1 < ev2) {
943 eVec1.SetXYZ(eVec(0, 0), eVec(1, 0), eVec(2, 0));
945 eVec2.SetXYZ(eVec(0, 2), eVec(1, 2), eVec(2, 2));
948 eVec1.SetXYZ(eVec(0, 0), eVec(1, 0), eVec(2, 0));
950 eVec2.SetXYZ(eVec(0, 1), eVec(1, 1), eVec(2, 1));
954 if (eVec1.Cross(eVec2)*
eval < 0)
958 TVector3 oldEVec1(eVec1);
960 const int nEdges = 24;
961 std::vector<TVector3> vertices;
963 vertices.push_back(position);
966 for (
int i = 0; i < nEdges; ++i) {
967 const double angle = 2 * TMath::Pi() / nEdges * i;
968 vertices.push_back(position + cos(angle)*eVec1 + sin(angle)*eVec2);
974 newPlane->setO(position +
eval);
989 TMatrixDSymEigen eigen_values2(cov.GetSub(0, 2, 0, 2));
990 const TVectorD& eVal = eigen_values2.GetEigenValues();
991 const TMatrixD& eVect = eigen_values2.GetEigenVectors();
993 ev0 = std::min(eVal(0), maxErr);
994 ev1 = std::min(eVal(1), maxErr);
995 ev2 = std::min(eVal(2), maxErr);
998 if (ev0 < ev1 && ev0 < ev2) {
999 eVec1.SetXYZ(eVect(0, 1), eVect(1, 1), eVect(2, 1));
1001 eVec2.SetXYZ(eVect(0, 2), eVect(1, 2), eVect(2, 2));
1003 }
else if (ev1 < ev0 && ev1 < ev2) {
1004 eVec1.SetXYZ(eVect(0, 0), eVect(1, 0), eVect(2, 0));
1006 eVec2.SetXYZ(eVect(0, 2), eVect(1, 2), eVect(2, 2));
1009 eVec1.SetXYZ(eVect(0, 0), eVect(1, 0), eVect(2, 0));
1011 eVec2.SetXYZ(eVect(0, 1), eVect(1, 1), eVect(2, 1));
1012 } eVec2 *= sqrt(ev1);
1015 if (eVec1.Cross(eVec2)*
eval < 0)
1019 if (oldEVec1 * eVec1 < 0) {
1025 double angle0 = eVec1.Angle(oldEVec1);
1026 if (eVec1 * (
eval.Cross(oldEVec1)) < 0)
1028 for (
int i = 0; i < nEdges; ++i) {
1029 const double angle = 2 * TMath::Pi() / nEdges * i - angle0;
1030 vertices.push_back(position + cos(angle)*eVec1 + sin(angle)*eVec2);
1033 vertices.push_back(position);
1036 TEveTriangleSet* error_shape =
new TEveTriangleSet(vertices.size(), nEdges * 2);
1037 for (
unsigned int k = 0; k < vertices.size(); ++k) {
1038 error_shape->SetVertex(k, vertices[k].X(), vertices[k].Y(), vertices[k].Z());
1041 assert(vertices.size() == 2 * nEdges + 2);
1044 for (
int i = 0; i < nEdges; ++i) {
1046 error_shape->SetTriangle(iTri++, i + 1, i + 1 + nEdges, (i + 1) % nEdges + 1);
1047 error_shape->SetTriangle(iTri++, (i + 1) % nEdges + 1, i + 1 + nEdges, (i + 1) % nEdges + 1 + nEdges);
1054 error_shape->SetMainTransparency(25);
1055 eveTrack->AddElement(error_shape);
1067 const TVector3& global_pos = geo.
get(hit->getSensorID()).
pointToGlobal(hit->getPosIn());
1073 const TVector3& global_pos = geo.
get(hit->getSensorID()).
pointToGlobal(hit->getPosIn());
1078 TVector3 global_pos;
1080 if (p) global_pos = p->getPosition();
1085 const TVector3& global_pos = hit->getPosition();
1093 track->simhits->SetNextPoint(v.x(), v.y(), v.z());
1100 const TString pointsTitle(
"Unassigned SimHits");
1116 particle = particle->getMother();
1120 const TVector3& p = particle->getMomentum();
1121 const TVector3& vertex = particle->getProductionVertex();
1122 const int pdg = particle->getPDG();
1123 TParticle tparticle(pdg, particle->getStatus(),
1124 (particle->getMother() ? particle->getMother()->getIndex() : 0), 0, particle->getFirstDaughter(), particle->getLastDaughter(),
1125 p.x(), p.y(), p.z(), particle->getEnergy(),
1126 vertex.x(), vertex.y(), vertex.z(), particle->getProductionTime());
1127 TEveMCTrack mctrack;
1128 mctrack = tparticle;
1129 mctrack.fTDecay = particle->getDecayTime();
1130 mctrack.fVDecay.Set(particle->getDecayVertex());
1131 mctrack.fDecayed = !boost::math::isinf(mctrack.fTDecay);
1132 mctrack.fIndex = particle->getIndex();
1137 bool hasTrajectory(
false);
1138 for (
auto rel : mcTrajectories.relations()) {
1141 if (rel.weight <= 0)
continue;
1152 (&pt == &trajectory.
back()) ? TEvePathMark::kDecay : TEvePathMark::kReference,
1153 TEveVector(pt.x, pt.y, pt.z),
1154 TEveVector(pt.px, pt.py, pt.pz)
1158 hasTrajectory =
true;
1163 if (!hasTrajectory) {
1165 for (
int iDaughter = particle->getFirstDaughter(); iDaughter <= particle->getLastDaughter(); iDaughter++) {
1171 TEvePathMarkD refMark(TEvePathMarkD::kDaughter);
1172 refMark.fV.Set(daughter->getProductionVertex());
1173 refMark.fP.Set(daughter->getMomentum());
1174 refMark.fTime = daughter->getProductionTime();
1181 and mctrack.fDecayed) {
1182 TEvePathMarkD decayMark(TEvePathMarkD::kDecay);
1183 decayMark.fV.Set(particle->getDecayVertex());
1187 TString particle_name(mctrack.GetName());
1190 const MCParticle* mom = particle->getMother();
1197 if (!hasTrajectory) {
1200 title +=
"\n(track estimated from initial momentum)";
1246 MCTrack& mcTrack = mcTrackPair.second;
1247 if (mcTrack.
track) {
1248 if (mcTrack.
simhits->Size() > 0) {
1252 destroyEveElement(mcTrack.
simhits);
1259 parent = parentIt->second.track;
1262 parent->AddElement(mcTrack.
track);
1264 gEve->AddElement(mcTrack.
simhits);
1271 for (
size_t i = 0; i <
m_options.length(); i++) {
1278 m.SetMarkerStyle(1);
1310 if (groupPair.second.group)
1311 groupPair.second.visible = groupPair.second.group->GetRnrState();
1312 groupPair.second.group =
nullptr;
1324 float ecl_threshold = 0.01;
1326 ecl_threshold =
m_eclData->GetSliceThreshold(0);
1331 m_eclData->RefSliceInfo(0).Setup(
"ECL", ecl_threshold, kRed);
1337 gEve->GetSelection()->RemoveElements();
1338 gEve->GetHighlight()->RemoveElements();
1347 TVector3 v = vertex->getPos();
1352 vertexPoint->SetNextPoint(v.x(), v.y(), v.z());
1354 TMatrixDSymEigen eigen_values(vertex->getCov());
1356 det_shape->SetShape(
new TGeoSphere(0., 1.));
1357 fixGeoShapeRefCount(det_shape);
1358 const TVectorD& ev = eigen_values.GetEigenValues();
1359 const TMatrixD& eVec = eigen_values.GetEigenVectors();
1360 TVector3 eVec1(eVec(0, 0), eVec(1, 0), eVec(2,
1362 TVector3 eVec2(eVec(0, 1), eVec(1, 1), eVec(2,
1364 TVector3 eVec3(eVec(0, 2), eVec(1, 2), eVec(2, 2));
1368 TGeoRotation det_rot(
"det_rot", (eVec1.Theta() * 180) / TMath::Pi(), (eVec1.Phi() * 180) / TMath::Pi(),
1369 (eVec2.Theta() * 180) / TMath::Pi(), (eVec2.Phi() * 180) / TMath::Pi(),
1370 (eVec3.Theta() * 180) / TMath::Pi(), (eVec3.Phi() * 180) / TMath::Pi());
1374 double pseudo_res_0 = std::sqrt(ev(0));
1375 double pseudo_res_1 = std::sqrt(ev(1));
1376 double pseudo_res_2 = std::sqrt(ev(2));
1383 TGeoGenTrans det_trans(v(0), v(1), v(2), pseudo_res_0, pseudo_res_1, pseudo_res_2,
1385 det_shape->SetTransMatrix(det_trans);
1388 det_shape->SetMainColor(kOrange);
1389 det_shape->SetMainTransparency(0);
1391 vertexPoint->AddElement(det_shape);
1403 const float phi = cluster->getPhi();
1404 float dPhi = cluster->getUncertaintyPhi();
1405 float dTheta = cluster->getUncertaintyTheta();
1406 if (dPhi >= M_PI / 4 or dTheta >= M_PI / 4 or cluster->getUncertaintyEnergy() == 1.0) {
1407 B2WARNING(
"Found ECL cluster with broken errors (unit matrix or too large). Using 0.05 as error in phi/theta. The 3x3 error matrix previously was:");
1408 cluster->getCovarianceMatrix3x3().Print();
1409 dPhi = dTheta = 0.05;
1412 if (!std::isfinite(dPhi) or !std::isfinite(dTheta)) {
1413 B2ERROR(
"ECLCluster phi or theta error is NaN or infinite, skipping cluster!");
1419 thetaLow.SetPtThetaPhi(1.0, cluster->getTheta() - dTheta, phi);
1421 thetaHigh.SetPtThetaPhi(1.0, cluster->getTheta() + dTheta, phi);
1422 float etaLow = thetaLow.Eta();
1423 float etaHigh = thetaHigh.Eta();
1424 if (etaLow > etaHigh) {
1425 std::swap(etaLow, etaHigh);
1428 int id =
m_eclData->AddTower(etaLow, etaHigh, phi - dPhi, phi + dPhi);
1436 const double layerThicknessCm = 3.16;
1437 const double layerDistanceCm = 9.1 - layerThicknessCm;
1439 TVector3 startPos = cluster->getClusterPosition();
1442 bool isBarrel = (startPos.Z() > -175.0 and startPos.Z() < 270.0);
1445 b = TVector3(0, 0, 1);
1446 a = startPos.Cross(b).Unit();
1447 double c = M_PI / 4.0;
1448 double offset = c / 2.0 + M_PI;
1449 a.SetPhi(
int((a.Phi() + offset) / (c))*c - M_PI);
1450 TVector3 perp = b.Cross(a);
1452 const double barrelRadiusCm = 204.0;
1453 startPos.SetMag(barrelRadiusCm / perp.Dot(startPos.Unit()));
1455 dir = startPos.Unit();
1456 dir.SetMag((layerDistanceCm + layerThicknessCm) / perp.Dot(dir));
1459 b = TVector3(startPos.x(), startPos.y(), 0).Unit();
1460 a = startPos.Cross(b).Unit();
1461 double endcapStartZ = 284;
1462 if (startPos.z() < 0)
1463 endcapStartZ = -189.5;
1465 double scaleFac = endcapStartZ / startPos.z();
1466 startPos.SetMag(startPos.Mag() * scaleFac);
1468 dir = startPos.Unit();
1469 dir.SetMag((layerDistanceCm + layerThicknessCm) / fabs(dir.z()));
1472 for (
int i = 0; i < cluster->getLayers(); i++) {
1473 TVector3 layerPos = startPos;
1474 layerPos += (cluster->getInnermostLayer() + i) * dir;
1475 auto* layer =
boxCreator(layerPos, a, b, 20.0, 20.0, layerThicknessCm / 2);
1477 layer->SetMainTransparency(70);
1492 CLHEP::Hep3Vector global;
1499 CLHEP::Hep3Vector local = module->globalToLocal(global);
1504 double du = module->getPhiStripWidth() * Nphistrip;
1505 double dv = module->getZStripWidth() * Nztrip;
1508 CLHEP::Hep3Vector localU(local[0], local[1] + 1.0, local[2]);
1509 CLHEP::Hep3Vector localV(local[0], local[1], local[2] + 1.0);
1511 CLHEP::Hep3Vector globalU = module->localToGlobal(localU);
1512 CLHEP::Hep3Vector globalV = module->localToGlobal(localV);
1514 TVector3 o(global[0], global[1], global[2]);
1515 TVector3 u(globalU[0], globalU[1], globalU[2]);
1516 TVector3 v(globalV[0], globalV[1], globalV[2]);
1519 TEveBox* bklmbox =
boxCreator(o, u - o, v - o, du, dv, 1.0);
1521 bklmbox->SetMainColor(kGreen);
1523 bklmbox->SetName(
"BKLMHit2d");
1531 const double du = 2.0;
1532 const double dv = 2.0;
1534 TVector3 u(1.0, 0.0, 0.0);
1535 TVector3 v(0.0, 1.0, 0.0);
1536 TEveBox* eklmbox =
boxCreator(o, u, v, du, dv, 4.0);
1537 eklmbox->SetMainColor(kGreen);
1538 eklmbox->SetName(
"EKLMHit2d");
1547 VxdID sensorID = roi->getSensorID();
1550 double minU = aSensorInfo.
getUCellPosition(roi->getMinUid(), roi->getMinVid());
1552 double maxU = aSensorInfo.
getUCellPosition(roi->getMaxUid(), roi->getMaxVid());
1556 TVector3 localA(minU, minV, 0);
1557 TVector3 localB(minU, maxV, 0);
1558 TVector3 localC(maxU, minV, 0);
1564 TEveBox* ROIbox =
boxCreator((globalB + globalC) * 0.5 , globalB - globalA, globalC - globalA, 1, 1, 0.01);
1567 ROIbox->SetMainColor(kSpring - 9);
1568 ROIbox->SetMainTransparency(50);
1580 if (hit->isUCluster()) {
1581 const float u = hit->getPosition();
1582 a = sensor.pointToGlobal(TVector3(sensor.getBackwardWidth() / sensor.getWidth(0) * u, -0.5 * sensor.getLength(), 0.0));
1583 b = sensor.pointToGlobal(TVector3(sensor.getForwardWidth() / sensor.getWidth(0) * u, +0.5 * sensor.getLength(), 0.0));
1585 const float v = hit->getPosition();
1586 a = sensor.pointToGlobal(TVector3(-0.5 * sensor.getWidth(v), v, 0.0));
1587 b = sensor.pointToGlobal(TVector3(+0.5 * sensor.getWidth(v), v, 0.0));
1590 lines->AddLine(a.x(), a.y(), a.z(), b.x(), b.y(), b.z());
1600 lines->AddLine(wire_pos_f.x(), wire_pos_f.y(), wire_pos_f.z(), wire_pos_b.x(), wire_pos_b.y(), wire_pos_b.z());
1611 TEveGeoShape* cov_shape =
new TEveGeoShape(
"cov_shape");
1615 driftLengthRes = std::max(driftLengthRes, 0.005);
1616 const double lengthOfWireSection = 3.0;
1619 const TVector3 zaxis = wire_pos_b - wire_pos_f;
1620 const TVector3 xaxis = zaxis.Orthogonal();
1621 const TVector3 yaxis = xaxis.Cross(zaxis);
1624 const TVector3 midPoint = wire_pos_f - zaxis * (wire_pos_f.z() / zaxis.z());
1626 cov_shape->SetShape(
new TGeoTube(std::max(0., (
double)(driftLength - driftLengthRes)), driftLength + driftLengthRes,
1627 lengthOfWireSection));
1628 fixGeoShapeRefCount(cov_shape);
1630 TGeoRotation det_rot(
"det_rot",
1631 xaxis.Theta() * 180 / TMath::Pi(), xaxis.Phi() * 180 / TMath::Pi(),
1632 yaxis.Theta() * 180 / TMath::Pi(), yaxis.Phi() * 180 / TMath::Pi(),
1633 zaxis.Theta() * 180 / TMath::Pi(), zaxis.Phi() * 180 / TMath::Pi()
1636 TGeoCombiTrans det_trans(midPoint(0), midPoint(1), midPoint(2), &det_rot);
1637 cov_shape->SetTransMatrix(det_trans);
1640 bool isPartOfTS =
false;
1642 if (showTriggerHits && segments.size() > 0) {
1646 if (hit->getISuperLayer() % 2 == 0) {
1648 cov_shape->SetMainColor(kCyan + 3);
1650 cov_shape->SetMainColor(kCyan);
1653 cov_shape->SetMainColor(kPink + 6);
1655 cov_shape->SetMainColor(kPink + 7);
1658 cov_shape->SetMainTransparency(50);
1660 cov_shape->SetTitle(
ObjectInfo::getInfo(hit) + TString::Format(
"\nWire ID: %d\nADC: %d\nTDC: %d",
1661 hit->getID(), hit->getADCCount(), hit->getTDCCount()));
1666 addToGroup(
"CDCTriggerSegmentHits", cov_shape);
1667 for (
auto rel : segments.relations()) {
1676 TEveStraightLineSet* shape =
new TEveStraightLineSet();
1680 if (hit->getPriorityPosition() < 3) iL -= 1;
1682 unsigned iCenter = hit->getIWire();
1683 if (hit->getPriorityPosition() == 1) iCenter += 1;
1694 std::vector<int> layershift = { -2, -1, 0, 1, 2};
1695 std::vector<std::vector<float>> cellshift = {
1709 if (hit->getISuperLayer() == 0) {
1710 layershift = { 0, 1, 2, 3, 4};
1715 { -1.5, -0.5, 0.5, 1.5},
1721 for (
unsigned il = 0; il < layershift.size(); ++il) {
1722 for (
unsigned ic = 0; ic < cellshift[il].size(); ++ic) {
1723 TVector3 corners[2][2];
1724 for (
unsigned ir = 0; ir < 2; ++ir) {
1725 double r = cdcgeo.
fieldWireR(iL + layershift[il] - ir);
1726 double fz = cdcgeo.
fieldWireFZ(iL + layershift[il] - ir);
1727 double bz = cdcgeo.
fieldWireBZ(iL + layershift[il] - ir);
1728 for (
unsigned iphi = 0; iphi < 2; ++iphi) {
1729 double phib = (iCenter + cellshift[il][ic] + iphi - 0.5) * 2 * M_PI / nWires;
1730 double phif = phib + cdcgeo.
nShifts(iL + layershift[il]) * M_PI / nWires;
1732 TVector3 pos_f = TVector3(cos(phif) * r, sin(phif) * r, fz);
1733 TVector3 pos_b = TVector3(cos(phib) * r, sin(phib) * r, bz);
1734 TVector3 zaxis = pos_b - pos_f;
1735 corners[ir][iphi] = pos_f - zaxis * (pos_f.z() / zaxis.z());
1739 shape->AddLine(corners[0][0].x(), corners[0][0].y(), 0,
1740 corners[0][1].x(), corners[0][1].y(), 0);
1741 shape->AddLine(corners[0][1].x(), corners[0][1].y(), 0,
1742 corners[1][1].x(), corners[1][1].y(), 0);
1743 shape->AddLine(corners[1][1].x(), corners[1][1].y(), 0,
1744 corners[1][0].x(), corners[1][0].y(), 0);
1745 shape->AddLine(corners[1][0].x(), corners[1][0].y(), 0,
1746 corners[0][0].x(), corners[0][0].y(), 0);
1750 if (hit->getISuperLayer() % 2 == 0) {
1751 shape->SetMainColor(kCyan + 3);
1753 shape->SetMainColor(kPink + 6);
1758 TString::Format(
"\nPriority: %d\nLeft/Right: %d",
1759 hit->getPriorityPosition(), hit->getLeftRight()));
1768 int hitModule = hit->getModule();
1769 float fi = arichGeo->getDetectorPlane().getSlotPhi(hitModule);
1771 TVector3 centerPos3D = hit->getPosition();
1773 TVector3 channelX(1, 0, 0); channelX.RotateZ(fi);
1774 TVector3 channelY(0, 1, 0); channelY.RotateZ(fi);
1776 auto* arichbox =
boxCreator(centerPos3D, arichGeo->getMasterVolume().momentumToGlobal(channelX),
1777 arichGeo->getMasterVolume().momentumToGlobal(channelY), 0.49, 0.49, 0.05);
1778 arichbox->SetMainColor(kOrange + 10);
1779 arichbox->SetName((std::to_string(hitModule)).c_str());
1788 std::map<int, int> m_topSummary;
1789 for (
const TOPDigit& hit : digits) {
1790 int mod = hit.getModuleID();
1791 ++m_topSummary[mod];
1794 for (
auto modCountPair : m_topSummary) {
1795 if (modCountPair.second > maxcount)
1796 maxcount = modCountPair.second;
1798 for (
auto modCountPair : m_topSummary) {
1800 double phi = topmod.getPhi();
1801 double r_center = topmod.getRadius();
1802 double z = topmod.getZc();
1804 TVector3 centerPos3D;
1805 centerPos3D.SetMagThetaPhi(r_center, M_PI / 2, phi);
1806 centerPos3D.SetZ(z);
1808 TVector3 channelX(1, 0, 0); channelX.RotateZ(phi);
1809 TVector3 channelY(0, 1, 0); channelY.RotateZ(phi);
1812 auto* moduleBox =
boxCreator(centerPos3D, channelX, channelY,
1813 3.0 * topmod.getBarThickness(), topmod.getBarWidth() , topmod.getBarLength());
1814 moduleBox->SetMainColor(kAzure + 10);
1815 double weight = double(modCountPair.second) / maxcount;
1816 moduleBox->SetMainTransparency(90 - weight * 50);
1817 moduleBox->SetName((
"TOP module " + std::to_string(modCountPair.first)).c_str());
1818 moduleBox->SetTitle(TString::Format(
"#TOPDigits: %d ", modCountPair.second));
1822 for (
const TOPDigit& hit : digits) {
1823 if (modCountPair.first == hit.getModuleID())
1832 for (
const auto& labelPair : displayData.
m_labels) {
1833 TEveText* text =
new TEveText(labelPair.first.c_str());
1834 text->SetName(labelPair.first.c_str());
1835 text->SetTitle(labelPair.first.c_str());
1836 text->SetMainColor(kGray + 1);
1837 const TVector3& p = labelPair.second;
1838 text->PtrMainTrans()->SetPos(p.x(), p.y(), p.z());
1842 for (
const auto& pointPair : displayData.
m_pointSets) {
1843 TEvePointSet* points =
new TEvePointSet(pointPair.first.c_str());
1844 points->SetTitle(pointPair.first.c_str());
1845 points->SetMarkerStyle(7);
1846 points->SetMainColor(kGreen);
1847 for (
const TVector3& p : pointPair.second) {
1848 points->SetNextPoint(p.x(), p.y(), p.z());
1853 int randomColor = 2;
1854 for (
const auto& arrow : displayData.
m_arrows) {
1855 const TVector3 pos = arrow.start;
1856 const TVector3 dir = arrow.end - pos;
1857 TEveArrow* eveArrow =
new TEveArrow(dir.x(), dir.y(), dir.z(), pos.x(), pos.y(), pos.z());
1858 eveArrow->SetName(arrow.name.c_str());
1859 eveArrow->SetTitle(arrow.name.c_str());
1860 int arrowColor = arrow.color;
1861 if (arrowColor == -1) {
1862 arrowColor = randomColor;
1865 eveArrow->SetMainColor(arrowColor);
1868 TEveText* text =
new TEveText(arrow.name.c_str());
1869 text->SetMainColor(arrowColor);
1871 const TVector3& labelPos = pos + 0.5 * dir + 0.1 * dir.Orthogonal();
1872 text->PtrMainTrans()->SetPos(labelPos.x(), labelPos.y(), labelPos.z());
1873 eveArrow->AddElement(text);
1886 const std::string& groupName = boost::algorithm::trim_copy_if(name, boost::algorithm::is_any_of(
"/"));
1888 TEveElementList* group =
m_groups[groupName].group;
1890 group =
new TEveElementList(groupName.c_str(), groupName.c_str());
1891 group->SetRnrState(
m_groups[groupName].visible);
1896 auto lastSlash = boost::algorithm::find_last(groupName,
"/");
1898 const std::string parentGroup(groupName.begin(), lastSlash.begin());
1899 const std::string thisGroup(lastSlash.end(), groupName.end());
1900 group->SetElementName(thisGroup.c_str());
1903 gEve->AddElement(group);
1906 group->AddElement(elem);
Datastore class that holds photon hits. Input to the reconstruction.
Store one BKLM strip hit as a ROOT object.
int getLayer() const
Get layer number.
int getZStripMax() const
Get highest z-measuring strip number.
int getSection() const
Get section number.
int getSector() const
Get sector number.
int getPhiStripMin() const
Get lowest phi-measuring strip number.
int getZStripMin() const
Get lowest z-measuring strip number.
int getPhiStripMax() const
Get highest phi-measuring strip number.
TVector3 getGlobalPosition(void) const
Get 3D hit position in global coordinates.
Store one simulation hit's global position as a ROOT object.
Store one simulation hit as a ROOT object.
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
This class is used to transfer CDC information to the track fit.
Combination of several CDCHits to a track segment hit for the trigger.
Track created by the CDC trigger.
The Class for CDC Geometry Parameters.
const TVector3 wireBackwardPosition(int layerId, int cellId, EWirePosition set=c_Base) const
Returns the backward position of the input sense wire.
int nShifts(int layerId) const
Returns number shift.
const TVector3 wireForwardPosition(int layerId, int cellId, EWirePosition set=c_Base) const
Returns the forward position of the input sense wire.
double fieldWireR(int layerId) const
Returns radius of field wire in each layer.
unsigned nWiresInLayer(int layerId) const
Returns wire numbers in a layer.
double fieldWireBZ(int layerId) const
Returns backward z position of field wire in each layer.
double fieldWireFZ(int layerId) const
Returns forward z position of field wire in each layer.
static CDCGeometryPar & Instance(const CDCGeometry *=nullptr)
Static method to get a reference to the CDCGeometryPar instance.
Translator mirroring the realistic Digitization.
double getDriftLength(unsigned short tdcCount, const WireID &wireID=WireID(), double timeOfFlightEstimator=0, bool leftRight=false, double z=0, double alpha=0, double theta=static_cast< double >(TMath::Pi()/2.), unsigned short adcCount=0) override
Get Drift length.
double getDriftLengthResolution(double driftLength, const WireID &wireID=WireID(), bool leftRight=false, double z=0, double alpha=0, double=static_cast< double >(TMath::Pi()/2.)) override
Get position resolution^2 corresponding to the drift length from getDriftLength of this class.
static const ChargedStable pion
charged pion particle
Class for accessing objects in the database.
Add custom information to the display.
std::map< std::string, std::vector< TVector3 > > m_pointSets
name -> points map
std::vector< Arrow > m_arrows
List of arrows.
std::vector< std::pair< std::string, TVector3 > > m_labels
text labels (to be shown at a given position).
@ c_nPhotons
CR is split into n photons (N1)
Class for 2d hits handling.
TVector3 getPosition() const
Get hit global position.
Class EKLMSimHit stores information on particular Geant step; using information from TrackID and Pare...
void clearEvent()
clear event data.
void setOptions(const std::string &opts)
Set the display options.
static constexpr double c_minPCut
don't show MCParticles with momentum below this cutoff.
void addTrackCandidateImproved(const std::string &collectionName, const RecoTrack &recoTrack)
Add a RecoTrack, but use stored genfit track representation to make visualisation objects.
EveVisBField * m_bfield
The global magnetic field.
TEveStraightLineSet * m_unassignedRecoHits
Unassigned recohits.
static const int c_recoHitColor
Color for reco hits.
void addCDCHit(const CDCHit *hit, bool showTriggerHits=false)
show CDCHits directly.
std::map< const MCParticle *, MCTrack > m_mcparticleTracks
map MCParticles to MCTrack (so hits can be added to the correct track).
EVEVisualization()
Constructor.
void setErrScale(double errScale=1.)
Set the scaling factor for the visualization of track hit errors.
void addBKLMHit2d(const BKLMHit2d *bklm2dhit)
Add a reconstructed 2d hit in the BKLM.
bool m_drawRefTrack
Draw reference track in addTrack.
void addVertex(const genfit::GFRaveVertex *vertex)
Add a vertex point and its covariance matrix.
bool m_drawForward
draw forward in addTrack
TEveCalo3D * m_calo3d
Object for the energy bar visualisation.
bool m_drawCardinalRep
Draw cardinal representation in addTrack.
void addCDCTriggerTrack(const std::string &collectionName, const CDCTriggerTrack &track)
Add a CDCTriggerTrack.
void addCDCTriggerSegmentHit(const std::string &collectionName, const CDCTriggerSegmentHit *hit)
show outline of track segments.
TEveTrackPropagator * m_trackpropagator
Track propagator for MCParticles.
std::map< std::string, ElementGroup > m_groups
name -> grouping element.
void addSimHit(const CDCSimHit *hit, const MCParticle *particle)
Add a CDCSimHit.
void addECLCluster(const ECLCluster *cluster)
Add a reconstructed cluster in the ECL.
void addEKLMHit2d(const EKLMHit2d *bklm2dhit)
Add a reconstructed 2d hit in the EKLM.
TEveTrackList * m_tracklist
parent object for MC tracks.
void addToGroup(const std::string &name, TEveElement *elem)
Add 'elem' to the element group 'name' (created if necessary).
void makeTracks()
Create visual representation of all tracks.
void addRecoHit(const SomeVXDHit *hit, TEveStraightLineSet *lines)
adds given VXD hit to lines.
void addTrack(const Belle2::Track *belle2Track)
Add this genfit::Track to event data.
bool m_unassignedRecoHitsVisibility
is m_unassignedRecoHits visible?
static const int c_trackMarkerColor
Color for track markers.
TEveTrackPropagator * m_gftrackpropagator
Track propagator for genfit::Tracks (different mainly because of drawing options)
std::string m_options
Option string for genfit::Track visualisation.
static const int c_trackColor
Color for tracks.
static const int c_unassignedHitColor
Color for unassigned (reco)hits.
bool m_hideSecondaries
If true, secondary MCParticles (and hits created by them) will not be shown.
TEveBox * boxCreator(const TVector3 &o, TVector3 u, TVector3 v, float ud, float vd, float depth)
Create a box around o, oriented along u and v with widths ud, vd and depth and return a pointer to th...
void addARICHHit(const ARICHHit *hit)
Add recontructed hit in ARICH.
void showUserData(const DisplayData &displayData)
Add user-defined data (labels, points, etc.)
std::set< const TObject * > m_shownRecohits
List of shown recohits (PXDCluster, SVDCluster, CDCHit).
bool m_drawBackward
draw backward in addTrack
TEveTrackPropagator * m_consttrackpropagator
Track propagator for CDCTriggerTracks (uses constant B field)
bool m_assignToPrimaries
If true, hits created by secondary particles (e.g.
~EVEVisualization()
Destructor.
bool m_drawErrors
Draw errors in addTrack.
double m_errorScale
Rescale PXD/SVD errors with this factor to ensure visibility.
void addTOPDigits(const StoreArray< TOPDigit > &digits)
Add TOPDigits (shown aggregated per module).
void addROI(const ROIid *roi)
Add a Region Of Interest, computed by the PXDDataReduction module.
void addKLMCluster(const KLMCluster *cluster)
Add a reconstructed cluster in the KLM.
static const int c_klmClusterColor
Color for KLMCluster objects.
MCTrack * addMCParticle(const MCParticle *particle)
Return MCTrack for given particle, add it if it doesn't exist yet.
TEveCaloDataVec * m_eclData
ECL cluster data.
static const int c_recoTrackColor
Color for TrackCandidates.
void addTrackCandidate(const std::string &collectionName, const RecoTrack &recoTrack)
Add a RecoTrack, to evaluate track finding.
void addObject(const TObject *dataStoreObject, TEveElement *visualRepresentation)
Generic function to keep track of which objects have which visual representation.
void makeLines(TEveTrack *eveTrack, const genfit::StateOnPlane *prevState, const genfit::StateOnPlane *state, const genfit::AbsTrackRep *rep, TEvePathMark::EType_e markType, bool drawErrors, int markerPos=1)
Create hit visualisation for the given options, and add them to 'eveTrack'.
Provide magnetic field values for TEveTrackPropagator.
Class to save the full simulated trajectory of a particle.
const MCTrajectoryPoint & back() const
return reference to the last point
A Class to store the Monte Carlo particle information.
@ c_PrimaryParticle
bit 0: Particle is primary particle.
@ c_StoppedInDetector
bit 3: Particle was stopped in the detector (the simulation volume).
The PXD Cluster class This class stores all information about reconstructed PXD clusters The position...
Class PXDSimHit - Geant4 simulated hit for the PXD.
ROIid stores the U and V ids and the sensor id of the Region Of Interest.
This is the Reconstruction Event-Data Model Track.
std::vector< Belle2::RecoTrack::UsedSVDHit * > getSVDHitList() const
Return an unsorted list of svd hits.
std::vector< Belle2::RecoTrack::UsedPXDHit * > getPXDHitList() const
Return an unsorted list of pxd hits.
std::vector< Belle2::RecoTrack::UsedCDCHit * > getCDCHitList() const
Return an unsorted list of cdc hits.
TVector3 getMomentumSeed() const
Return the momentum seed stored in the reco track. ATTENTION: This is not the fitted momentum.
const genfit::TrackPoint * getCreatedTrackPoint(const RecoHitInformation *recoHitInformation) const
Get a pointer to the TrackPoint that was created from this hit.
std::vector< RecoHitInformation * > getRecoHitInformations(bool getSorted=false) const
Return a list of all RecoHitInformations associated with the RecoTrack.
TVector3 getPositionSeed() const
Return the position seed stored in the reco track. ATTENTION: This is not the fitted position.
short int getChargeSeed() const
Return the charge seed stored in the reco track. ATTENTION: This is not the fitted charge.
T * getRelated(const std::string &name="", const std::string &namedRelation="") const
Get the object to or from which this object has a relation.
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
SVDRecoHit - an extended form of SVDHit containing geometry information.
bool isU() const
Is the coordinate u or v?
VxdID getSensorID() const
Get the compact ID.
Class SVDSimHit - Geant4 simulated hit for the SVD.
Class to store TOP digitized hits (output of TOPDigitizer or raw data unpacker) relations to TOPSimHi...
const TOPGeometry * getGeometry() const
Returns pointer to geometry object using basf2 units.
static TOPGeometryPar * Instance()
Static method to obtain the pointer to its instance.
Values of the result of a track fit with a given particle hypothesis.
Helix getHelix() const
Conversion to framework Helix (without covariance).
short getChargeSign() const
Return track charge (1 or -1).
double getPValue() const
Getter for Chi2 Probability of the track fit.
TVector3 getMomentum() const
Getter for vector of momentum at closest approach of track in r/phi projection.
TVector3 getPosition() const
Getter for vector of position at closest approach of track in r/phi projection.
Class that bundles various TrackFitResults.
const TrackFitResult * getTrackFitResultWithClosestMass(const Const::ChargedStable &requestedType) const
Return the track fit for a fit hypothesis with the closest mass.
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
static GeoCache & getInstance()
Return a reference to the singleton instance.
static const SensorInfoBase & get(Belle2::VxdID id)
Return a reference to the SensorInfo of a given SensorID.
Base class to provide Sensor Information for PXD and SVD.
double getVCellPosition(int vID) const
Return the position of a specific strip/pixel in v direction.
double getUCellPosition(int uID, int vID=-1) const
Return the position of a specific strip/pixel in u direction.
TVector3 pointToGlobal(const TVector3 &local, bool reco=false) const
Convert a point from local to global coordinates.
void addCluster(const TObject *dataStoreObject, TEveCaloData *caloData, int towerID)
Selection inside TEveCalo* is complicated, use this to keep track of ECL clusters.
static VisualRepMap * getInstance()
get instance pointer.
void clear()
Remove all contents in map.
void add(const TObject *dataStoreObject, TEveElement *visualRepresentation)
Generic function to keep track of which objects have which visual representation.
Class to uniquely identify a any structure of the PXD and SVD.
Class to identify a wire inside the CDC.
unsigned short getICLayer() const
Getter for continuous layer numbering.
Provides BKLM geometry parameters for simulation, reconstruction etc (from Gearbox or DataBase)
const Module * findModule(int section, int sector, int layer) const
Get the pointer to the definition of a module.
static GeometryPar * instance(void)
Static method to get a reference to the singleton GeometryPar instance.
Define the geometry of a BKLM module Each sector [octant] contains Modules.
This class collects all information needed and produced by a specific AbsFitter and is specific to on...
Contains the measurement and covariance in raw detector coordinates.
Abstract base class for a track representation.
void getPosDir(const StateOnPlane &state, TVector3 &pos, TVector3 &dir) const
Get cartesian position and direction vector of a state.
virtual double extrapolateToPlane(StateOnPlane &state, const genfit::SharedPlanePtr &plane, bool stopAtBoundary=false, bool calcJacobianNoise=false) const =0
Extrapolates the state to plane, and returns the extrapolation length and, via reference,...
virtual TVector3 getPos(const StateOnPlane &state) const =0
Get the cartesian position of a state.
virtual void getPosMomCov(const MeasuredStateOnPlane &state, TVector3 &pos, TVector3 &mom, TMatrixDSym &cov) const =0
Translates MeasuredStateOnPlane into 3D position, momentum and 6x6 covariance.
Exception class for error handling in GENFIT (provides storage for diagnostic information)
Class where important numbers and properties of a fit can be stored.
bool isTrackPruned() const
Has the track been pruned after the fit?
Collects information needed and produced by a GblFitter/GBL and is specific to one AbsTrackRep of the...
const MeasuredStateOnPlane & getFittedState(bool afterKink=true) const override
Get the prediction at this point Always biased in GBL (global fit) There are 2 states,...
MeasurementOnPlane getMeasurement() const
Get the measurement on plane from stored measurement data (from last construction/update)
StateOnPlane getReferenceState() const
Returns (copy of) the stored reference 5D state at current plane with internal rep.
Collects information needed and produced by a AbsKalmanFitter implementations and is specific to one ...
#StateOnPlane with additional covariance matrix.
Measured coordinates on a plane.
Measurement class implementing a planar hit geometry (1 or 2D).
Class for measurements implementing a space point hit geometry.
A state with arbitrary dimension defined in a DetPlane.
Object containing AbsMeasurement and AbsFitterInfo objects.
AbsFitterInfo * getFitterInfo(const AbsTrackRep *rep=nullptr) const
Get fitterInfo for rep. Per default, use cardinal rep.
Class for measurements in wire detectors (Straw tubes and drift chambers) which do not measure the co...
Class for measurements in wire detectors (Straw tubes and drift chambers) which do not measure the co...
Class for measurements in wire detectors (Straw tubes and drift chambers) which can measure the coord...
const TOPGeoModule & getModule(int moduleID) const
Returns module.
double eval(const std::vector< double > &spl, const std::vector< double > &vals, double x)
Evaluate spline (zero order or first order) in point x.
double getMaxR()
find a point that is inside the top node.
TString getIdentifier(const TObject *obj)
Where is this object in the datastore?
TString getInfo(const TObject *obj)
Get object info HTML (e.g.
TString getTitle(const TObject *obj)
Get plain text for TEve object titles (shown on mouse-over).
Implements a colour palette, see http://sobac.com/sobac/tangocolors.htm.
int getTColorID(const std::string &tangoName, int tangoId=1)
Get TColor ID for given name in tango colour palette.
Abstract base class for different kinds of events.
Defines for I/O streams used for error and debug printing.
std::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.
Hold MC tracks and associated visualisation objects.
TEvePointSet * simhits
simhit positions.
const MCParticle * parentParticle
parent particle, or nullptr.
TEveTrack * track
the actual MC track.
Small struct to encode a position/momentum without additional overhead.