Issues with linking ExRootAnalysis libraries

I am running a macro to generate histograms. Previously I had no issues with it as I believe I set up the environment variables correctly. When I rebooted my system, the environment variables were reset. I was mainly working with ExRootTreeReader.h and ExRootResult.h headers in my include. The error log I get is:

maxim@DESKTOP-0B0G4G4:~/proca-main$ ./runanalysis_ym_p_p_y_ll.sh
./runanalysis_ym_p_p_y_ll.sh: 2: source: not found
./runanalysis_ym_p_p_y_ll.sh: 3: source: not found
root [0]
Processing /home/maxim/Delphes-3.5.0//examples/myexample.C("delphes_ymppzpm2_del2.root","plot_fab00c.root",10000)...
In file included from input_line_8:1:
/home/maxim/Delphes-3.5.0/examples/myexample.C:48:29: error: member access into incomplete type 'ExRootResult'
  plots->fSelection = result->AddHist1D("selection", "Event Selection", "", "number of events", 20, 0.0, 20.0);
                            ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:38:7: note: forward declaration of 'ExRootResult'
class ExRootResult;
      ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:49:31: error: member access into incomplete type 'ExRootResult'
  plots->histnleptons = result->AddHist1D("nleptons", "Number of leptons above 4 GeV", "number of leptons", "number of events", 10, 0.0, 10.0);
                              ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:38:7: note: forward declaration of 'ExRootResult'
class ExRootResult;
      ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:50:26: error: member access into incomplete type 'ExRootResult'
  plots->histMll = result->AddHist1D("mll", "M_(ll)", "mll", "number of events", 52, 0.0, 2600.0);
                         ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:38:7: note: forward declaration of 'ExRootResult'
class ExRootResult;
      ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:51:28: error: member access into incomplete type 'ExRootResult'
  plots->histMllpt = result->AddHist1D("mllpt", "Pt_(ll)", "mllpt", "number of events", 440, 0.0, 2200.0);
                           ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:38:7: note: forward declaration of 'ExRootResult'
class ExRootResult;
      ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:52:29: error: member access into incomplete type 'ExRootResult'
  plots->histMllpt2 = result->AddHist1D("mllpt2", "Pt_(ll)2", "mllpt2", "number of events", 440, 0.0, 2200.0);
                            ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:38:7: note: forward declaration of 'ExRootResult'
class ExRootResult;
      ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:53:29: error: member access into incomplete type 'ExRootResult'
  plots->histMllcut = result->AddHist1D("mllcut", "M_(ll)", "mllcut", "number of events", 190, 50., 1000.0);
                            ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:38:7: note: forward declaration of 'ExRootResult'
class ExRootResult;
      ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:54:26: error: member access into incomplete type 'ExRootResult'
  plots->fDeltaR = result->AddHist1D("deltaR", "dr lepton 1,2","DeltaR", "number of leptons",70, 0.0, 7.00);
                         ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:38:7: note: forward declaration of 'ExRootResult'
class ExRootResult;
      ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:55:28: error: member access into incomplete type 'ExRootResult'
  plots->fLeptonPT = result->AddHist1D("lepton_pt", "lepton P_{T}","lepton P_{T}, GeV/c", "number of leptons",50, 0.0, 1000.0);
                           ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:38:7: note: forward declaration of 'ExRootResult'
class ExRootResult;
      ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:56:31: error: member access into incomplete type 'ExRootResult'
  plots->fLeptonPTlow = result->AddHist1D("lepton_pt_low", "lepton P_{T}","lepton P_{T}, GeV/c", "number of leptons",510, -10.0, 500);
                              ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:38:7: note: forward declaration of 'ExRootResult'
class ExRootResult;
      ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:57:29: error: member access into incomplete type 'ExRootResult'
  plots->fLeptonEta = result->AddHist1D("lepton_eta", "lepton eta","lepton eta", "number of leptons",100, -5.0, 5.0);
                            ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:38:7: note: forward declaration of 'ExRootResult'
class ExRootResult;
      ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:58:36: error: member access into incomplete type 'ExRootResult'
  plots->fLeptonPT_lead[0] = result->AddHist1D("lepton_pt_0", "leading lepton P_{T}","lepton P_{T}, GeV/c", "number of leptons",190, 0.0, 5700.0);
                                   ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:38:7: note: forward declaration of 'ExRootResult'
class ExRootResult;
      ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:59:36: error: member access into incomplete type 'ExRootResult'
  plots->fLeptonPT_lead[1] = result->AddHist1D("lepton_pt_1", "2nd leading lepton P_{T}","lepton P_{T}, GeV/c", "number of leptons",190, 0.0, 5700.0);
                                   ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:38:7: note: forward declaration of 'ExRootResult'
class ExRootResult;
      ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:80:40: error: member access into incomplete type 'ExRootTreeReader'
  TClonesArray *branchMuon = treeReader->UseBranch("Muon");
                                       ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:39:7: note: forward declaration of 'ExRootTreeReader'
class ExRootTreeReader;
      ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:81:44: error: member access into incomplete type 'ExRootTreeReader'
  TClonesArray *branchElectron = treeReader->UseBranch("Electron");
                                           ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:39:7: note: forward declaration of 'ExRootTreeReader'
class ExRootTreeReader;
      ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:83:35: error: member access into incomplete type 'ExRootTreeReader'
  Long64_t allEntries = treeReader->GetEntries();
                                  ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:39:7: note: forward declaration of 'ExRootTreeReader'
class ExRootTreeReader;
      ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:90:3: error: unknown type name 'Muon'
  Muon *muon;
  ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:91:3: error: unknown type name 'Electron'
  Electron *electron;
  ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:93:10: error: use of undeclared identifier 'Muon'
  vector<Muon *> muons;
         ^
/home/maxim/Delphes-3.5.0/examples/myexample.C:93:16: error: expected expression
  vector<Muon *> muons;
               ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]

I set up my ROOT_INCLUDE_PATH=/home/maxim/root/include/:/home/maxim/Delphes-3.5.0/classes/:/home/maxim/Delphes-3.5.0/external/ExRootAnalysis/. My “include” lines are composed of these:

include “TH1.h”
#include “TSystem.h”

#ifdef __CLING_
R__LOAD_LIBRARY(libDelphes)
#include "/home/maxim/Delphes-3.5.0/classes/DelphesClasses.h"
#include "/home/maxim/Delphes-3.5.0/external/ExRootAnalysis/ExRootTreeReader.h"
#include "/home/maxim/Delphes-3.5.0/external/ExRootAnalysis/ExRootResult.h"
#endif

I read all the necessary topics for this issue but those were the same steps I made, maybe I am missing something.
I would appreciate any suggestion to resolve this issue.

Do you have typo here?
Should be: __CLING__

Oh, I copied this line wrong, but it was written correctly. I rewrote the directories in ROOT_INCLUDE_PATH, and now I receive this error:

Processing /home/maxim/Delphes-3.5.0//examples/myexample.C("/home/maxim/proca-main/delphes_ref.root","/home/maxim/proca-main/plot_refb.root",10000)...
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
   Missing FileEntry for ExRootAnalysis/ExRootTreeReader.h
   requested to autoload type ExRootTreeReader
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
   Missing FileEntry for ExRootAnalysis/ExRootTreeWriter.h
   requested to autoload type ExRootTreeWriter
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
   Missing FileEntry for ExRootAnalysis/ExRootTreeBranch.h
   requested to autoload type ExRootTreeBranch
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
   Missing FileEntry for ExRootAnalysis/ExRootResult.h
   requested to autoload type ExRootResult
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
   Missing FileEntry for ExRootAnalysis/ExRootClassifier.h
   requested to autoload type ExRootClassifier
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
   Missing FileEntry for ExRootAnalysis/ExRootFilter.h
   requested to autoload type ExRootFilter
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
   Missing FileEntry for ExRootAnalysis/ExRootProgressBar.h
   requested to autoload type ExRootProgressBar
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
   Missing FileEntry for ExRootAnalysis/ExRootConfReader.h
   requested to autoload type ExRootConfParam
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
   Missing FileEntry for ExRootAnalysis/ExRootConfReader.h
   requested to autoload type ExRootConfReader
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
   Missing FileEntry for ExRootAnalysis/ExRootTask.h
   requested to autoload type ExRootTask
In file included from ClassesDict dictionary payload:32:
/home/maxim/Delphes-3.5.0/classes/DelphesModule.h:30:10: fatal error: 'ExRootAnalysis/ExRootTask.h' file not found
#include "ExRootAnalysis/ExRootTask.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error in <TInterpreter::AutoParse>: Error parsing payload code for class Candidate with content:

#line 1 "ClassesDict dictionary payload"


#define _BACKWARD_BACKWARD_WARNING_H
// Inline headers
/*
 *  Delphes: a framework for fast simulation of a generic collider experiment
 *  Copyright (C) 2012-2014  Universite catholique de Louvain (UCL), Belgium
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */


/** ExRootAnalysisLinkDef
 *
 *  Lists classes to be included in cint dicitonary
 *
 *  \author P. Demin - UCL, Louvain-la-Neuve
 *
 */

#include "classes/DelphesModule.h"
#include "classes/DelphesFactory.h"

#include "classes/SortableObject.h"
#include "classes/DelphesClasses.h"

#ifdef __CINT__

#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ class DelphesModule+;
#pragma link C++ class DelphesFactory+;

#pragma link C++ class SortableObject+;

#pragma link C++ class Event+;
#pragma link C++ class LHCOEvent+;
#pragma link C++ class LHEFEvent+;
#pragma link C++ class LHEFWeight+;
#pragma link C++ class HepMCEvent+;
#pragma link C++ class GenParticle+;
#pragma link C++ class Vertex+;
#pragma link C++ class MissingET+;
#pragma link C++ class ScalarHT+;
#pragma link C++ class Rho+;
#pragma link C++ class Weight+;
#pragma link C++ class Photon+;
#pragma link C++ class Electron+;
#pragma link C++ class Muon+;
#pragma link C++ class Jet+;
#pragma link C++ class Track+;
#pragma link C++ class Tower+;
#pragma link C++ class ParticleFlowCandidate+;
#pragma link C++ class HectorHit+;

#pragma link C++ class Candidate+;

#endif


#undef  _BACKWARD_BACKWARD_WARNING_H

In file included from input_line_8:1:
In file included from /home/maxim/Delphes-3.5.0/examples/myexample.C:14:
/home/maxim/Delphes-3.5.0/classes/DelphesClasses.h:797:3: warning: ambiguous expansion of macro 'ClassDef' [-Wambiguous-macro]
  ClassDef(Candidate, 6)
  ^
/home/maxim/root/include/Rtypes.h:335:9: note: expanding this definition of 'ClassDef'
#define ClassDef(name,id)                            \
        ^
input_line_4:22:9: note: other definition of 'ClassDef'
#define ClassDef(name, id) \
        ^
ExRootAnalysisDict dictionary payload:14:10: fatal error: 'ExRootAnalysis/ExRootTreeReader.h' file not found
#include "ExRootAnalysis/ExRootTreeReader.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error in <TInterpreter::AutoParse>: Error parsing payload code for class ExRootTreeReader with content:

#line 1 "ExRootAnalysisDict dictionary payload"


#define _BACKWARD_BACKWARD_WARNING_H
// Inline headers

/** \class ExRootAnalysisLinkDef
 *
 *  Lists classes to be included in cint dicitonary
 *
 *  \author P. Demin - UCL, Louvain-la-Neuve
 *
 */

#include "ExRootAnalysis/ExRootTreeReader.h"
#include "ExRootAnalysis/ExRootTreeWriter.h"
#include "ExRootAnalysis/ExRootTreeBranch.h"
#include "ExRootAnalysis/ExRootResult.h"
#include "ExRootAnalysis/ExRootUtilities.h"
#include "ExRootAnalysis/ExRootClassifier.h"
#include "ExRootAnalysis/ExRootFilter.h"

#include "ExRootAnalysis/ExRootProgressBar.h"
#include "ExRootAnalysis/ExRootConfReader.h"
#include "ExRootAnalysis/ExRootTask.h"

#ifdef __CINT__

#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ class ExRootTreeReader+;
#pragma link C++ class ExRootTreeBranch+;
#pragma link C++ class ExRootTreeWriter+;
#pragma link C++ class ExRootResult+;
#pragma link C++ class ExRootClassifier+;
#pragma link C++ class ExRootFilter+;

#pragma link C++ class ExRootProgressBar+;
#pragma link C++ class ExRootConfReader+;
#pragma link C++ class ExRootConfParam+;
#pragma link C++ class ExRootTask+;

#pragma link C++ function HistStyle;
#pragma link C++ function FillChain;

#endif


#undef  _BACKWARD_BACKWARD_WARNING_H

In file included from input_line_8:1:
In file included from /home/maxim/Delphes-3.5.0/examples/myexample.C:15:
/home/maxim/Delphes-3.5.0/external/ExRootAnalysis/ExRootTreeReader.h:43:3: warning: ambiguous expansion of macro 'ClassDef' [-Wambiguous-macro]
  ClassDef(ExRootTreeReader, 1)
  ^
/home/maxim/root/include/Rtypes.h:335:9: note: expanding this definition of 'ClassDef'
#define ClassDef(name,id)                            \
        ^
input_line_4:22:9: note: other definition of 'ClassDef'
#define ClassDef(name, id) \
        ^
ExRootAnalysisDict dictionary payload:14:10: fatal error: 'ExRootAnalysis/ExRootTreeReader.h' file not found
#include "ExRootAnalysis/ExRootTreeReader.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error in <TInterpreter::AutoParse>: Error parsing payload code for class ExRootResult with content:

#line 1 "ExRootAnalysisDict dictionary payload"


#define _BACKWARD_BACKWARD_WARNING_H
// Inline headers

/** \class ExRootAnalysisLinkDef
 *
 *  Lists classes to be included in cint dicitonary
 *
 *  \author P. Demin - UCL, Louvain-la-Neuve
 *
 */

#include "ExRootAnalysis/ExRootTreeReader.h"
#include "ExRootAnalysis/ExRootTreeWriter.h"
#include "ExRootAnalysis/ExRootTreeBranch.h"
#include "ExRootAnalysis/ExRootResult.h"
#include "ExRootAnalysis/ExRootUtilities.h"
#include "ExRootAnalysis/ExRootClassifier.h"
#include "ExRootAnalysis/ExRootFilter.h"

#include "ExRootAnalysis/ExRootProgressBar.h"
#include "ExRootAnalysis/ExRootConfReader.h"
#include "ExRootAnalysis/ExRootTask.h"

#ifdef __CINT__

#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ class ExRootTreeReader+;
#pragma link C++ class ExRootTreeBranch+;
#pragma link C++ class ExRootTreeWriter+;
#pragma link C++ class ExRootResult+;
#pragma link C++ class ExRootClassifier+;
#pragma link C++ class ExRootFilter+;

#pragma link C++ class ExRootProgressBar+;
#pragma link C++ class ExRootConfReader+;
#pragma link C++ class ExRootConfParam+;
#pragma link C++ class ExRootTask+;

#pragma link C++ function HistStyle;
#pragma link C++ function FillChain;

#endif


#undef  _BACKWARD_BACKWARD_WARNING_H

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