|
| 1 | +--- |
| 2 | +title: "Reconstruction workflow" |
| 3 | +teaching: 25 |
| 4 | +exercises: 15 |
| 5 | +questions: |
| 6 | +- "Understand the EICrecon workflow" |
| 7 | +objectives: |
| 8 | +- "Hit digitization" |
| 9 | +- "data model" |
| 10 | +- "Reconstruction algorithms" |
| 11 | +keypoints: |
| 12 | +- "simulated hits--`EICrecon`--> reconstructed quantities" |
| 13 | +--- |
| 14 | + |
| 15 | + |
| 16 | +## Reconstruction workflow |
| 17 | +The ePIC reconsutrction framework `EICrecon` is maintained [on github](https://github.com/eic/eicrecon/). It process simulated hits from various detectors to reconstruct trajectory, PID, etc, and eventually reconstruct the simulated particle and physics observables at the vertex. |
| 18 | + |
| 19 | +Each reconstruction step involves 3 components: |
| 20 | +- the algorithm, |
| 21 | +- the JOmniFactory where algorithm and data type are declared. |
| 22 | +- the factory generator to excute the algorithm. |
| 23 | + |
| 24 | +> in this section, we will use __track reconstruction__ as an example. Please refer to the Lehigh reconstruction workfest [presentations](https://indico.bnl.gov/event/20727/sessions/7433/#20240725) for reconstruction workflow of other systems. |
| 25 | +
|
| 26 | + |
| 27 | +> - __Digitization__ |
| 28 | + All simualted detector hits are digitized to reflect certain detector specs e.g. spatial and time resolution, and energy threshold. For example, the `VertexBarrelHits` from simulation are digitized through the `SiliconTrackerDigi` factory in `EICrecon/src/detectors/BVTX/BVTX.cc`: |
| 29 | + ```console |
| 30 | + // Digitization |
| 31 | + app->Add(new JOmniFactoryGeneratorT<SiliconTrackerDigi_factory>( |
| 32 | + "SiBarrelVertexRawHits", // factory name |
| 33 | + { |
| 34 | + "VertexBarrelHits" // input |
| 35 | + }, |
| 36 | + { |
| 37 | + "SiBarrelVertexRawHits", // outputs |
| 38 | + "SiBarrelVertexRawHitAssociations" |
| 39 | + }, |
| 40 | + { |
| 41 | + .threshold = 0.54 * dd4hep::keV, // configurations |
| 42 | + }, |
| 43 | + app |
| 44 | + )); |
| 45 | + ``` |
| 46 | + The actual algorithm locates at `EICrecon/src/algorithms/digi/SiliconTrackerDigi.cc`, with its input and output specified in `SiliconTrackerDigi_factory.h`: |
| 47 | + |
| 48 | + ```console |
| 49 | + class SiliconTrackerDigi_factory : public JOmniFactory<SiliconTrackerDigi_factory, SiliconTrackerDigiConfig> { |
| 50 | + |
| 51 | + public: |
| 52 | + using AlgoT = eicrecon::SiliconTrackerDigi; |
| 53 | + private: |
| 54 | + std::unique_ptr<AlgoT> m_algo; |
| 55 | + |
| 56 | + PodioInput<edm4hep::SimTrackerHit> m_sim_hits_input {this}; |
| 57 | + |
| 58 | + PodioOutput<edm4eic::RawTrackerHit> m_raw_hits_output {this}; |
| 59 | + PodioOutput<edm4eic::MCRecoTrackerHitAssociation> m_assoc_output {this}; |
| 60 | + |
| 61 | + ParameterRef<double> m_threshold {this, "threshold", config().threshold}; |
| 62 | + ParameterRef<double> m_timeResolution {this, "timeResolution", config().timeResolution}; |
| 63 | + ... |
| 64 | + ``` |
| 65 | + By comparing the two blocks of code above, we can see that the digitized hits, `SiBarrelVertexRawHits`, are stored in the data type `RawTrackerHit` that is defined in the [edm4eic data model](https://github.com/eic/EDM4eic/blob/main/edm4eic.yaml): |
| 66 | + ```console |
| 67 | + edm4eic::RawTrackerHit: |
| 68 | + Description: "Raw (digitized) tracker hit" |
| 69 | + Author: "W. Armstrong, S. Joosten" |
| 70 | + Members: |
| 71 | + - uint64_t cellID // The detector specific (geometrical) cell id from segmentation |
| 72 | + - int32_t charge |
| 73 | + - int32_t timeStamp |
| 74 | + ``` |
| 75 | + In addition, the one-to-one relation between the sim hit and its digitized hit is stored as an `MCRecoTrackerHitAssociation` object: |
| 76 | + ```console |
| 77 | + edm4eic::MCRecoTrackerHitAssociation: |
| 78 | + Description: "Association between a RawTrackerHit and a SimTrackerHit" |
| 79 | + Author: "C. Dilks, W. Deconinck" |
| 80 | + Members: |
| 81 | + - float weight // weight of this association |
| 82 | + OneToOneRelations: |
| 83 | + - edm4eic::RawTrackerHit rawHit // reference to the digitized hit |
| 84 | + - edm4hep::SimTrackerHit simHit // reference to the simulated hit |
| 85 | + ``` |
| 86 | + which is filled in `SiliconTrackerDigi.cc`: |
| 87 | + ```console |
| 88 | + auto hitassoc = associations->create(); |
| 89 | + hitassoc.setWeight(1.0); |
| 90 | + hitassoc.setRawHit(item.second); |
| 91 | + hitassoc.setSimHit(sim_hit); |
| 92 | + ``` |
| 93 | + |
| 94 | +> Exercise 2.1: please find other detector systems that use `SiliconTrackerDigi` for digitization |
| 95 | +{: .challenge} |
| 96 | + |
| 97 | + |
| 98 | +> -__Track Reconstruction__ |
| 99 | + By default, we use the Combinatorial Kalman Filter from the ACTS library to handle track finding and fitting. This happens in the `CKFTracking` factory. |
| 100 | + |
| 101 | +> Exercise 2.2: please find the inputs and outputs of `CKFTracking`, and draw a flow chart from `CentralTrackerMeasurements` to `CentralTrackVertices`. |
| 102 | +{: .challenge} |
| 103 | + |
| 104 | +-__Reconstruction output__ |
| 105 | + - `events` tree: |
| 106 | + - `MCParticles` and detector sim hits are copied from simulation output to recon output |
| 107 | + - outputs from each step of recon algorithms must be either `edm4hep` or `edm4eic` object if you want to save them in recon output |
| 108 | + - the default list of saved objects in recon output is defined in `EICrecon/src/services/io/podio/JEventProcessorPODIO.cc`. It can be configured in command line. |
| 109 | + - `podio_metadata` tree: |
| 110 | + - `events___idTable` provides a lookup table between output collection name and IDs. |
| 111 | + |
| 112 | + |
| 113 | +> Exercise 2.3: |
| 114 | +> The __vector member__ or __relation__ of a given data collection is saved in a separate branch starts with "_". |
| 115 | + - use ```tree.keys(filter_name="_CentralCKFTrajectories*",recursive=False)``` to list those members in `CentralCKFTrajectories` |
| 116 | + - for a given event, the vector member `_CentralCKFTrajectories_measurementChi2` provides a list of chi2 for each meaurement hit respectively. If multiple trajectories are found for one event, you can use `CentralCKFTrajectories.measurementChi2_begin` to locate the start index of a given trajectory (subentry). |
| 117 | +{: .challenge} |
| 118 | + |
| 119 | +> Exercise 2.4: |
| 120 | +> `CentralTrackerMeasurements` saved all available space points for tracking as 2D meaurement attached to representing surfaces. |
| 121 | + - use the relation `_CentralTrackerMeasurements_hits` to trace back to the original detector hit collection (hint: use the collection ID lookup table), and obtain the 3D coordinate of the hit |
| 122 | +{: .challenge} |
| 123 | +{% include links.md %} |
| 124 | + |
| 125 | +## Future reading |
| 126 | +- Generate your own simulation and reconstruction rootfiles [tutorial](https://eic.github.io/tutorial-simulations-using-ddsim-and-geant4/) |
| 127 | +- Contribute to reconstruction algorithsm [tutorial](https://eic.github.io/tutorial-reconstruction-algorithms/) |
| 128 | +- Develop analysis benchmarks [tutorial](https://eic.github.io/tutorial-developing-benchmarks/) |
0 commit comments