|
| 1 | +# Data Product Visualization in Mu2e Event Display |
| 2 | + |
| 3 | +This document outlines the purpose and key features of the core C++ functions used in the Mu2e event display to visualize **Monte Carlo (MC)** and **Reconstructed (Reco)** data products. These functions convert abstract data objects into graphical elements using the **ROOT REve** framework, enabling detailed event inspection. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## MC Data Visualization |
| 8 | + |
| 9 | +The following function displays simulated particle trajectories. |
| 10 | + |
| 11 | +### $\text{MCInterface::AddMCTrajectoryCollection}$ |
| 12 | + |
| 13 | +This function processes collections of $\text{MCTrajectory}$ objects and renders them as colored lines in the detector scene. |
| 14 | + |
| 15 | +| Feature | Description | |
| 16 | +| :--- | :--- | |
| 17 | +| **Input** | $\text{MCTrajectoryCollection}$ | |
| 18 | +| **Visualization** | **$\text{REveLine}$** for each trajectory. | |
| 19 | +| **Color Coding** | Line color is assigned based on the **particle's PDG ID** (e.g., electron is red, muon is black). | |
| 20 | +| **Filtering** | Draws only particles whose PDG ID is included in the user-defined $\text{particleIds}$ list. | |
| 21 | +| **Title Info** | Includes **Particle Name**, **SimParticle ID**, **Parent ID**, **Kinetic Energy**, and **Creation/Stopping Codes** for traceability. | |
| 22 | + |
| 23 | +### $\text{MCInterface::AddSurfaceStepCollection}$ |
| 24 | + |
| 25 | +This function visualizes points where a $\text{SimParticle}$ crosses a defined detector or virtual surface. |
| 26 | + |
| 27 | +| Feature | Description | |
| 28 | +| :--- | :--- | |
| 29 | +| **Input** | $\text{SurfaceStepCollection}$ | |
| 30 | +| **Visualization** | **$\text{REvePointSet}$** marker at the step's $\text{midPosition}$. | |
| 31 | +| **Color Coding** | Fixed to **kBlack** (in the current implementation) to distinguish them clearly from track lines. | |
| 32 | +| **Filtering** | Draws only steps made by particles whose PDG ID is in the user-defined $\text{particleIds}$ list. | |
| 33 | +| **Title Info** | Includes the **Surface ID name**, step **Position**, **Time**, **Momentum**, and **Energy Deposit** ($\text{edep}$). | |
| 34 | + |
| 35 | +--- |
| 36 | + |
| 37 | +## Reconstructed (Reco) Data Visualization |
| 38 | + |
| 39 | +These functions visualize the output of track fitting and hit clustering algorithms. |
| 40 | + |
| 41 | +### $\text{DataInterface::FillKinKalTrajectory}$ |
| 42 | + |
| 43 | +This is the main orchestration function for visualizing reconstructed tracks ($\text{KalSeed}$) and their associated products. |
| 44 | + |
| 45 | +| Feature | Description | |
| 46 | +| :--- | :--- | |
| 47 | +| **Input** | $\text{KalSeedPtrCollection}$ | |
| 48 | +| **Action** | Identifies the successful fit type ($\text{LoopHelix}$, $\text{CentralHelix}$, $\text{KinematicLine}$) and calls specialized functions to draw the trajectory and products. | |
| 49 | +| **Output** | Adds a **$\text{REveCompound}$** (**trackproducts**) to the scene, grouping all elements related to a single track. | |
| 50 | +| **Trajectory** | Uses $\text{AddKinKalTrajectory}$ to draw the path based on the chosen fit type. | |
| 51 | +| **Products** | Calls $\text{AddTrkStrawHit}$ (for hits) and $\text{AddKalIntersection}$ (for material/surface crossings). | |
| 52 | + |
| 53 | +### $\text{DataInterface::AddKinKalTrajectory}$ |
| 54 | + |
| 55 | +Renders the smooth, mathematical path of a **$\text{KinKal}$ track fit**. |
| 56 | + |
| 57 | +| Feature | Description | |
| 58 | +| :--- | :--- | |
| 59 | +| **Input** | $\text{KinKal}$ Trajectory ($\text{LoopHelix}$, $\text{CentralHelix}$, or $\text{KinematicLine}$) | |
| 60 | +| **Visualization** | **$\text{REveLine}$** generated by sampling the trajectory's equation across its time range at discrete steps ($\text{0.1}$ time units). | |
| 61 | +| **Title Info** | Includes **Particle Name**, **Momentum**, **Fit Parameters** ($\text{lam}$, $\text{rad}$, $\text{omega}$, $\text{d0}$, $\text{z0}$), and **Fit Consistency**. | |
| 62 | + |
| 63 | +### $\text{DataInterface::AddTrkStrawHit}$ |
| 64 | + |
| 65 | +Visualizes the individual $\text{Tracker}$ hits that contributed to a track fit. |
| 66 | + |
| 67 | +| Feature | Description | |
| 68 | +| :--- | :--- | |
| 69 | +| **Input** | $\text{TrkStrawHitSeed}$s from a $\text{KalSeed}$ | |
| 70 | +| **Visualization** | A **$\text{REveCompound}$** containing a **$\text{REvePointSet}$** (the hit position) and a **$\text{REveLine}$** (the $2\sigma$ error bar perpendicular to the track/wire). | |
| 71 | +| **Color Coding** | Uses **$\text{TrkHitColor}$** but switches to a **$\text{TrkNoHitColor}$** if the full drift constraint was *not* used in the fit. | |
| 72 | + |
| 73 | +### $\text{DataInterface::AddKalIntersection}$ |
| 74 | + |
| 75 | +Marks where the track crosses significant surfaces within the detector geometry. |
| 76 | + |
| 77 | +| Feature | Description | |
| 78 | +| :--- | :--- | |
| 79 | +| **Input** | $\text{KalIntersection}$ objects from a $\text{KalSeed}$ | |
| 80 | +| **Visualization** | **$\text{REvePointSet}$** marker. | |
| 81 | +| **Color Coding** | **kViolet** for intersections with material (where $\text{dMom} > 0.0$) and **kYellow** for intersections with virtual surfaces. | |
| 82 | +| **Title Info** | **Position**, **Time**, **Momentum/dMomentum**, and the name of the **Surface** intersected. | |
| 83 | + |
| 84 | +### $\text{DataInterface::AddTrkHits}$ |
| 85 | + |
| 86 | +Visually links reconstructed tracks to the original hit collections. |
| 87 | + |
| 88 | +| Feature | Description | |
| 89 | +| :--- | :--- | |
| 90 | +| **Input** | $\text{ComboHitCollection}$ and $\text{KalSeedPtrCollection}$ | |
| 91 | +| **Visualization** | **$\text{REvePointSet}$** at the position of each $\text{ComboHit}$. | |
| 92 | +| **Functionality** | **Filters** the $\text{ComboHits}$ by comparing their $\text{StrawId}$ against a set of $\text{StrawId}$s used in all $\text{KalSeeds}$. This highlights *only* the hits used for tracking. | |
| 93 | +| **Efficiency** | Uses a **$\text{std::set}$** to efficiently check $\text{StrawId}$ membership, preventing slow triple-nested loop searches. | |
| 94 | + |
| 95 | +### $\text{DataInterface::AddTimeClusters}$ |
| 96 | + |
| 97 | +Visually displays clusters of hits used to determine the initial time ($\text{t0}$) for track seeds. |
| 98 | + |
| 99 | +| Feature | Description | |
| 100 | +| :--- | :--- | |
| 101 | +| **Input** | $\text{TimeClusterCollection}$ | |
| 102 | +| **Visualization** | **$\text{REvePointSet}$** marker at the cluster's central position. | |
| 103 | +| **Title Info** | Cluster $\text{t0}$ and error. | |
| 104 | + |
| 105 | +### $\text{DataInterface::AddCosmicTrackFit}$ |
| 106 | + |
| 107 | +Draws the simple straight-line fit for cosmic ray data. |
| 108 | + |
| 109 | +| Feature | Description | |
| 110 | +| :--- | :--- | |
| 111 | +| **Input** | $\text{CosmicTrackSeedCollection}$ | |
| 112 | +| **Visualization** | **$\text{REveLine}$** segment. | |
| 113 | +| **Functionality** | Draws a line segment between the calculated track positions corresponding to the **first and last Y-coordinates** of the hits used in the fit. | |
0 commit comments