Creating and Sorting Vectors of Collections

Okey dokey,
So the I/O error coupled with your explanation of compiling the libraries suggested that writing a custom class/struct was more complex than I had anticipated.

I spent a good (embarrassingly) long while trying to use ACLiC or rootcling or ROOT.gInterpreter.GenerateDictionary() to work with this simple example but nothing I tried seems to allow me to snapshot these custom structures. The code I tried can be found below.

Given this complexity I’m tempted to abandon the idea of using this form of object based EDM and instead try to understand the construction of the trees within the RDF programming model. If so perhaps I open a new thread on how to create trees with the appropriate structure.

All the best and thanks again!

//photon_struct.h
#ifndef PHOTON_H
#define PHOTON_H
struct photon {
  float pt;
  float eta;
  float phi;
  float m;

  photon(float init_pt=-999.0, float init_eta=0.0, float init_phi=0.0, float init_m=0.0)
      : pt(init_pt), eta(init_eta), phi(init_phi), m(init_m) {}
};

#endif

and compiled

> root
root[0] .L photon_struct.h+

and then used in my code above

ROOT.gInterpreter.Declare('#include "photon_struct.h"')
df = df.Define('photons','ROOT::VecOps::Construct<photon>(photon_pt, photon_eta, photon_phi, photon_E)')

gives

TypeError: can not resolve method template call for 'Define'
error: use of undeclared identifier 'photon'