Please read tips for efficient and successful posting and posting code
_ROOT Version:_6.30.04
Platform: Not Provided
Compiler: Not Provided
Hi experts,
I have formed a rootdataframe from a given root file. In this rootdataframe, i wanted to create a column of “PseudoJet” objects. I have used the following command but end up in having some errors-
using namespace ROOT;
using namespace std;
using namespace fastjet;
ROOT::RDataFrame df("events", "events_029930132.root");
std::vector<PseudoJet> particles;
auto rdf = df.Define("Particle_P4", "auto p = particles.push_back(PseudoJet(ReconstructedParticles.momentum.x, ReconstructedParticles.momentum.y, ReconstructedParticles.momentum.z, ReconstructedParticles.energy)); return p");
Also i have used the following compilation command:
g++ -I/home/ganeshh/FASTJET/fastjet-install/include `root-config --cflags` fastjet_fcc1.cc -lfastjet -L/home/ganeshh/FASTJET/fastjet-install/lib `root-config --glibs`
The error i am getting is the following:
fastjet_fcc1.cc: In function ‘void fastjet_fcc1()’:
fastjet_fcc1.cc:5:19: error: ‘ROOT’ is not a namespace-name
5 | using namespace ROOT;
| ^~~~
fastjet_fcc1.cc:7:19: error: ‘fastjet’ is not a namespace-name
7 | using namespace fastjet;
| ^~~~~~~
fastjet_fcc1.cc:9:3: error: ‘ROOT’ has not been declared
9 | ROOT::RDataFrame df("events", "events_029930132.root");
| ^~~~
fastjet_fcc1.cc:12:8: error: ‘vector’ is not a member of ‘std’
12 | std::vector<PseudoJet> particles;
| ^~~~~~
fastjet_fcc1.cc:1:1: note: ‘std::vector’ is defined in header ‘<vector>’; did you forget to ‘#include <vector>’?
+++ |+#include <vector>
1 | void fastjet_fcc1()
fastjet_fcc1.cc:12:15: error: ‘PseudoJet’ was not declared in this scope
12 | std::vector<PseudoJet> particles;
| ^~~~~~~~~
fastjet_fcc1.cc:12:26: error: ‘particles’ was not declared in this scope
12 | std::vector<PseudoJet> particles;
| ^~~~~~~~~
fastjet_fcc1.cc:18:14: error: ‘df’ was not declared in this scope; did you mean ‘df0’?
18 | auto df0 = df.Define("Particle_P4", "auto p = particles.push_back(PseudoJet(ReconstructedParticles.momentum.x, ReconstructedParticles.momentum.y, ReconstructedParticles.momentum.z, ReconstructedParticles.energy)); return p");
| ^~
| df0
How these errors can be fixed?