Skip to content

Issue with PODIO in eic-shell on MAC #225

@Meatbally2

Description

@Meatbally2

Hi all,

There seems to be an issue when using PODIO in eic-shell to access EICrecon simulation campaign files on macOS. Below is a small test code:

R__LOAD_LIBRARY(libpodio.so)
R__LOAD_LIBRARY(libpodioRootIO.so)
R__LOAD_LIBRARY(libedm4hep.so)
R__LOAD_LIBRARY(libedm4hepDict.so)
R__LOAD_LIBRARY(libedm4hepUtils.so)
R__LOAD_LIBRARY(libedm4hepRDF.so)
R__LOAD_LIBRARY(libedm4eic.so)
R__LOAD_LIBRARY(libedm4eicDict.so)

#include "podio/Frame.h"
#include "podio/ROOTReader.h"
#include "edm4hep/MCParticleCollection.h"

void podio_test()
{
    
    podio::ROOTReader* reader = new podio::ROOTReader();
    reader->openFile("root://dtn-eic.jlab.org:1094//volatile/eic/EPIC//RECO/26.02.0/epic_craterlake/DIS/NC/18x275/minQ2=10/pythia8NCDIS_18x275_minQ2=10_beamEffects_xAngle=-0.025_hiDiv_1.0000.eicrecon.edm4eic.root");

    for( size_t ev = 0; ev < reader->getEntries("events"); ev++ )
    {   
        auto raw = reader->readEntry("events", ev);  // Use readEntry with index instead
        podio::Frame event(std::move(raw));

        edm4hep::MCParticleCollection meMC;
	    meMC.setSubsetCollection();

        for (const auto& mcp : event.get<edm4hep::MCParticleCollection>("MCParticles")) 
        {
        if ( mcp.getPDG() == 11 && mcp.getGeneratorStatus() == 1 ) 
            meMC.push_back(mcp);
        }
    }

    return;
}

When running this code with eic-shell on MAC, the following error is returned:

root [0] 
Processing podio_test.C...
In file included from input_line_8:1:
/Users/winl/eic/eicDIS/podio_test.C:27:20: error: call to deleted constructor of 'edm4hep::MCParticleCollection const'
        const auto mcparts = event.get<edm4hep::MCParticleCollection>("MCParticles");
                   ^         ~~~~~~~~~~~
libedm4hepDict dictionary payload:2377:3: note: 'MCParticleCollection' has been explicitly marked deleted here
  MCParticleCollection(const MCParticleCollection&) = delete;
  ^
In file included from input_line_8:1:
In file included from /Users/winl/eic/eicDIS/podio_test.C:10:
/opt/local/include/podio/Frame.h:398:12: error: reference to type 'const edm4hep::MCParticleCollection' could not bind to an lvalue of type 'const auto'
    return *coll;
           ^~~~~
/Users/winl/eic/eicDIS/podio_test.C:27:36: note: in instantiation of function template specialization 'podio::Frame::get<edm4hep::MCParticleCollection>' requested here
        const auto mcparts = event.get<edm4hep::MCParticleCollection>("MCParticles");
                                   ^

 * Break * segmentation violation

The issue does not occur when running the same code on non-MAC machines.

Environment: (where does this bug occur, have you tried other environments)

  • Which branch (often main for latest released): latest
  • Which version (or HEAD for the most recent on git): latest
  • Any specific OS or system where the issue occurs? MAC OS
  • Any special versions of ROOT or Geant4?

Steps to reproduce: (give a step by step account of how to trigger the bug)

  1. Run latest eic-shell ( or version after 25.12) on MAC
  2. Run the testing code above

Expected Result: (what do you expect when you execute the steps above)

Root macro runs without error.

Actual Result: (what do you get when you execute the steps above)

Root returns error as shown above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions