ROOT don't find SortableObject.h header

ROOT Version: root_v6.20.04
Platform: Linux Mint 19.3 Tricia
Compiler: gcc 7.5.0

Hi everybody.

I’m trying to use Delphes and ExRootAnalysis along side with ROOT, but I’m having sobre issues compiling the macro.

I’ve installed both Delphes and ExRootAnalysis using MadGraph, and so their directories are inside the main MadGraph directory:

When I tried to compile the macro, I receveid a error messagem saying that the ROOT was not able to find the headers Delphes.h, ExRootTreeReader.h and SortableObject.h, so I added this three files to the include directory of ROOT (in my computer this directory is at the location “/opt/ParticlePhysics/ROOT/root-6.20.04/build/include”) and then I added the headers to my macro:

#include <DelphesClasses.h>
#include <ExRootTreeReader.h>
#include <SortableObject.h>

After this, ROOT stopped showing error massages about Delphes.h and ExRootTreeReader.h headers but it’s still not finding SortableObject.h:

coweh@TARDIS:~/Codes/Jets$ root -l jet.cpp'("jet.root")' 
root [0] 
Processing jet.cpp("jet.root")...
In file included from input_line_103:1:
In file included from /home/coweh/Codes/Jets/jet.cpp:9:
/opt/ParticlePhysics/ROOT/root-6.20.04/build/include/DelphesClasses.h:39:10: fatal error: 'classes/SortableObject.h' file not found
#include "classes/SortableObject.h"

I’ve attached my macro, but the begining of my code is this:

#include "TROOT.h"
#include "TChain.h"
#include "TFile.h"
#include "TH1F.h"
#include "TCanvas.h"
#include <iostream>
#include <fstream>

#include <DelphesClasses.h>
#include <ExRootTreeReader.h>
#include <SortableObject.h>
//------------------------------------------------------------------------------

void jet(const char *inputFile)
{
  gSystem->Load("libDelphes.so");

  // Create chain of root trees
  TChain chain("Delphes");
  chain.Add(inputFile);

  // Create object of class ExRootTreeReader
  ExRootTreeReader *treeReader = new ExRootTreeReader(&chain);
  Long64_t numberOfEntries = treeReader->GetEntries();

Thank’s in advance

jet.cpp (2.1 KB)

Your macro seems to be prepared for ROOT 5 (it contains “gSystem->Load(...);” inside).
Ask your colleagues to give you a corresponding macro prepared for ROOT 6 (I guess it will contain some “R__ADD_LIBRARY_PATH(...)”, “R__LOAD_LIBRARY(...)” and “R__ADD_INCLUDE_PATH(...)” lines right in the beginning or / and you will get an appropriate “rootlogon.C” file).

Wile, thank you for your quickly answer!

I tried to write a rootlogon.C file but it also failed. I’m trying to understand by my own the usage of theses lines You’ve mentioned but I’m still not making the things right.

I read about the use of a rootmap file as a way to tell Root where the libraries are, but again, I’ve not find yet a post here clear enough about how to do it (I know cling is need to perform this)

with my best regards

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.