-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for PODIO version < 0.17 (#4)
* Added read podio version * Fixes for legacy podio file structure * Fixed issues with collectionID == -2 * Protection for version < 1.10
- Loading branch information
Showing
7 changed files
with
167 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Revise | ||
using EDM4hep | ||
using EDM4hep.RootIO | ||
|
||
cd(@__DIR__) | ||
|
||
f = "root://eospublic.cern.ch//eos/experiment/fcc/ee/generation/DelphesEvents/winter2023/IDEA/p8_ee_ZZ_ecm240/events_000189367.root" | ||
#f = "/Users/mato/cernbox/Data/events_000189367.root" | ||
#f = "/Users/mato/cernbox/Data/events_078174375.root" | ||
#f = "../Output_REC_rntuple.root" | ||
|
||
reader = RootIO.Reader(f) | ||
events = RootIO.get(reader, "events") | ||
|
||
evt = events[1]; | ||
|
||
mcps = RootIO.get(reader, evt, "Particle"; register=false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using EDM4hep.RootIO | ||
|
||
@testset "TTreeReaderLegacy" begin | ||
f = "root://eospublic.cern.ch//eos/experiment/fcc/ee/generation/DelphesEvents/winter2023/IDEA/p8_ee_ZZ_ecm240/events_000189367.root" | ||
#f = "/Users/mato/cernbox/Data/events_000189367.root" | ||
|
||
reader = RootIO.Reader(f) | ||
events = RootIO.get(reader, "events") | ||
|
||
@test reader.isRNTuple == false | ||
@test length(reader.collectionIDs) == 16 | ||
@test length(reader.btypes) > 54 | ||
@test reader.btypes["Particle"] == MCParticle | ||
|
||
events = RootIO.get(reader, "events") | ||
@test length(events) == 100000 | ||
|
||
# Loop over MC particles | ||
for evt in events[1:100] | ||
recps = RootIO.get(reader, evt, "ReconstructedParticles"); | ||
tracks = RootIO.get(reader, evt, "EFlowTrack") | ||
pids = RootIO.get(reader, evt, "ParticleIDs") | ||
if VERSION >= v"1.10" # Seems to be working only for >= 1.10 | ||
muons = RootIO.get(reader, evt, "Muon#0") | ||
if length(muons) == 2 | ||
@test abs(sum(muons.charge)) <= 2.0f0 | ||
end | ||
end | ||
end | ||
|
||
end |