You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HepMC3.jl can be used with [JetReconstruction.jl](https://github.com/JuliaHEP/JetReconstruction.jl) by converting HepMC3 particles to `PseudoJet` objects. The `PseudoJet` struct is a generic data structure that can be used for both proton-proton (pp) and electron-positron (e⁺e⁻) events. The difference lies in the jet reconstruction algorithm used:
297
+
298
+
-**For pp events**: Use algorithms like `JetAlgorithm.AntiKt`, `JetAlgorithm.Kt`, or `JetAlgorithm.CA` (Cambridge/Aachen)
299
+
-**For e⁺e⁻ events**: Use algorithms like `JetAlgorithm.Durham` or `JetAlgorithm.EEKt` (generalized e⁺e⁻ kₜ)
300
+
301
+
This example demonstrates reading HepMC3 files and converting final state particles to the `PseudoJet` format:
println("e⁺e⁻ jets (Durham): $(length(jets_ee)) jets with pT > 5 GeV")
385
+
end
386
+
```
387
+
388
+
### Complete Pipeline Example
389
+
390
+
A complete workflow from HepMC3 file to jet analysis. Note that the same `PseudoJet` conversion works for both pp and e⁺e⁻ events; only the algorithm differs:
391
+
392
+
```julia
393
+
using HepMC3, JetReconstruction
394
+
395
+
# For pp events
396
+
function analyze_pp_jets_from_hepmc(filename::String; max_events::Int=10, R::Float64=0.4, ptmin::Float64=5.0)
1.**Final State Extraction**: Use `get_final_state_particles()` to extract only stable particles (status == 1) from HepMC3 events.
438
+
439
+
2.**PseudoJet Conversion**: The `PseudoJet` struct is a generic data structure that works for both pp and e⁺e⁻ events. Convert HepMC3 particle four-momenta to `PseudoJet` objects using the same conversion function regardless of event type.
440
+
441
+
3.**Algorithm Selection**: The choice of jet reconstruction algorithm depends on the event type:
442
+
-**pp events**: Use `JetAlgorithm.AntiKt`, `JetAlgorithm.Kt`, or `JetAlgorithm.CA` with an `R` parameter
443
+
-**e⁺e⁻ events**: Use `JetAlgorithm.Durham` or `JetAlgorithm.EEKt` (the `R` parameter is ignored for Durham)
444
+
445
+
4.**Compressed Files**: The `read_hepmc_file_with_compression()` function automatically handles both compressed (`.zst`) and uncompressed HepMC3 files.
446
+
447
+
5.**Event Processing**: The conversion function processes events one at a time, allowing for efficient memory usage with large files.
448
+
449
+
This example demonstrates how to convert HepMC3 event data to the `PseudoJet` format expected by JetReconstruction.jl. The same conversion works for both pp and e⁺e⁻ events; only the jet reconstruction algorithm differs.
450
+
294
451
## See Also
295
452
296
453
-[Getting Started](@ref) for installation and basics
297
454
-[Events](@ref) for event manipulation
298
455
-[Particles](@ref) for particle operations
299
456
-[File I/O](@ref) for reading and writing files
457
+
-[JetReconstruction.jl](https://github.com/JuliaHEP/JetReconstruction.jl) for jet finding algorithms
0 commit comments