Fork me on GitHub

Opened 10 years ago

Last modified 7 years ago

#444 new Bug

Issues running Delphes examples

Reported by: Vince Pascuzzi Owned by:
Priority: major Milestone:
Component: Delphes code Version: Delphes 3
Keywords: Cc:

Description

Hi,

I followed the README in order to install Delphes (simple enough). I then tried running a "Simple analysis using TTree::Draw" (also from README):

error: cannot use arrow operator on a type

I can open a TBrowser and everything is OK.

Furthermore, I cannot run any examples. When I try to run Example1.C as a macro, none of the Delphes externals can be found, e.g. ExRootTreeReader, nor the Delphes classes, e.g. Electron, Jet. The errors are:

allocation of incomplete type 'ExRootTreeReader/Jet/Electron'
member access into incomplete type '...

I have set my environment variables (at least I think they are correct), but I must be missing something. If any additional information is needed to diagnose the issues, please let me know.

All the best,

Vince.

Delphes-3.2.0
ROOT 6.02/05
OS X Yosemite 10.10.2

Attachments (2)

Screen Shot 2015-03-27 at 11.20.23 AM.png (61.3 KB ) - added by Vince Pascuzzi 10 years ago.
Empty ROOT plot from Example1.C
Screen Shot 2015-03-27 at 11.25.03 AM.png (60.9 KB ) - added by Vince Pascuzzi 10 years ago.
Example1.C run with my Delphes output.

Download all attachments as: .zip

Change History (20)

comment:1 by Vince Pascuzzi, 10 years ago

Type: How toBug

comment:2 by Vince Pascuzzi, 10 years ago

Furthermore, when I try to run Example1 that is compiled in the Delphes install directory, all appears OK as it outputs each jet pt and at the end gives:

Info in <TCanvas::MakeDefCanvas>: created default TCanvas with name c1

however, no plot is displayed. The program executes without any hiccups however no ROOT plot is drawn (nothing appears).

Please advise.

Vince

OS X Yosemite 10.10.2
ROOT 6.02/05
Delphes-3.2.0

comment:3 by Vince Pascuzzi, 10 years ago

Some output:

Vinces-MacBook-Pro:~ vincepascuzzi$ root -l /Users/vincepascuzzi/sw/MG5_aMC_v2_2_3/Delphes-3.2.0/examples/Example1.C'("/Users/vincepascuzzi/sw/MG5_aMC_v2_2_3/MY_PROCS/sm_pp_wpwm/Events/run_01/wpwm_ATLAS_7TeV_delphes_events.root")'
root [0] 
Processing /Users/vincepascuzzi/sw/MG5_aMC_v2_2_3/Delphes-3.2.0/examples/Example1.C("/Users/vincepascuzzi/sw/MG5_aMC_v2_2_3/MY_PROCS/sm_pp_wpwm/Events/run_01/wpwm_ATLAS_7TeV_delphes_events.root")...
In file included from input_line_24:1:
/Users/vincepascuzzi/sw/MG5_aMC_v2_2_3/Delphes-3.2.0/examples/Example1.C:20:3: error: unknown type
      name 'ExRootTreeReader'
  ExRootTreeReader *treeReader = new ExRootTreeReader(&chain);
  ^
/Users/vincepascuzzi/sw/MG5_aMC_v2_2_3/Delphes-3.2.0/examples/Example1.C:20:38: error: unknown type
      name 'ExRootTreeReader'
  ExRootTreeReader *treeReader = new ExRootTreeReader(&chain);
                                     ^
/Users/vincepascuzzi/sw/MG5_aMC_v2_2_3/Delphes-3.2.0/examples/Example1.C:41:7: error: unknown type
      name 'Jet'
      Jet *jet = (Jet*) branchJet->At(0);
      ^
/Users/vincepascuzzi/sw/MG5_aMC_v2_2_3/Delphes-3.2.0/examples/Example1.C:41:19: error: use of
      undeclared identifier 'Jet'
      Jet *jet = (Jet*) branchJet->At(0);
                  ^
/Users/vincepascuzzi/sw/MG5_aMC_v2_2_3/Delphes-3.2.0/examples/Example1.C:41:23: error: expected
      expression
      Jet *jet = (Jet*) branchJet->At(0);
                      ^
/Users/vincepascuzzi/sw/MG5_aMC_v2_2_3/Delphes-3.2.0/examples/Example1.C:50:5: error: unknown type
      name 'Electron'
    Electron *elec1, *elec2;
    ^
/Users/vincepascuzzi/sw/MG5_aMC_v2_2_3/Delphes-3.2.0/examples/Example1.C:56:16: error: use of
      undeclared identifier 'Electron'
      elec1 = (Electron *) branchElectron->At(0);
               ^
/Users/vincepascuzzi/sw/MG5_aMC_v2_2_3/Delphes-3.2.0/examples/Example1.C:56:26: error: expected
      expression
      elec1 = (Electron *) branchElectron->At(0);
                         ^
/Users/vincepascuzzi/sw/MG5_aMC_v2_2_3/Delphes-3.2.0/examples/Example1.C:57:7: error: use of
      undeclared identifier 'elec2'
      elec2 = (Electron *) branchElectron->At(1);
      ^
/Users/vincepascuzzi/sw/MG5_aMC_v2_2_3/Delphes-3.2.0/examples/Example1.C:57:16: error: use of
      undeclared identifier 'Electron'
      elec2 = (Electron *) branchElectron->At(1);
               ^
/Users/vincepascuzzi/sw/MG5_aMC_v2_2_3/Delphes-3.2.0/examples/Example1.C:57:26: error: expected
      expression
      elec2 = (Electron *) branchElectron->At(1);
                         ^
/Users/vincepascuzzi/sw/MG5_aMC_v2_2_3/Delphes-3.2.0/examples/Example1.C:60:40: error: use of
      undeclared identifier 'elec2'
      histMass->Fill(((elec1->P4()) + (elec2->P4())).M());

comment:4 by Pavel Demin, 10 years ago

Hi Vince,

Thanks for finding these problems.

All the examples were tested and are still working with ROOT 5. I did not test them with ROOT 6.

It looks like the command-line interface in ROOT 6 behaves very differently than in ROOT 5. It's less permissive and it's more verbose.

The example with Draw should now look like

root
gSystem->Load("libDelphes");

TFile::Open("delphes_output.root");
TTree *tree = (TTree *) gDirectory->Get("Delphes");
tree->Draw("Electron.PT");

At the moment, I don't see how to make Example1.C working. It seem that in ROOT 6 'gSystem->Load("libDelphes");' is not enough to make the Delphes classes appear in the list of classes known to ROOT.

The compiled version of Example1 is a quick demonstration of how to compile a ROOT macro that was requested in https://cp3.irmp.ucl.ac.be/projects/delphes/ticket/182

Cheers,

Pavel

Last edited 10 years ago by Pavel Demin (previous) (diff)

comment:5 by Pavel Demin, 10 years ago

I've just found a note confirming that the following code does not work in ROOT 6:

void f() {gSystem->Load("libEvent"); Event* e = new Event();}

Here is the link

https://root.cern.ch/drupal/content/way-root-6

Last edited 10 years ago by Pavel Demin (previous) (diff)

comment:6 by Vince Pascuzzi, 10 years ago

Hi Pavel,

Thank you for the input. I also added a post to the ROOT forum, perhaps a bit more detailed: https://root.cern.ch/phpBB3/viewtopic.php?f=3&t=19484&p=83255&hilit=Delphes%2FExRootAnalysis#p83255. Basically, I attempted to use ROOT5 but receive additional errors (found in link).

Please advise.

All the best,

Vince.

comment:7 by Pavel Demin, 10 years ago

Hi Vince,

The error message that you posted on the ROOT forum

Symbol not found: _gInterpreterMutex
  Expected in: /Users/vincepascuzzi/sw/root/lib/libCore.so

clearly indicates a problem with your ROOT 5 installation or ROOT 5 related environment variables.

Could you check if the ROOTSYS, PATH and LD_LIBRARY_PATH point to the right locations and they don't point to the ROOT 5 and ROOT 6 locations at the same time?

Cheers,

Pavel

comment:8 by Vince Pascuzzi, 10 years ago

Hi Pavel,

I included an env.txt in that post. Only a single version of ROOT is ever added to the environment at any time (as far as I can tell). Should a prebuilt binary of version 5 work? I do not compile in a very specific way, I only include pythia8.

Could it possibly be something else?

Thanks,

Vince.

comment:9 by Pavel Demin, 10 years ago

Hi Vince,

When you switch ROOT versions do you rebuild Delphes?

I've just tested Delphes 3.2.0 with the following per-built versions:

http://root.cern.ch/download/root_v5.34.28.macosx64-10.10-clang60.tar.gz

http://root.cern.ch/download/root_v6.02.05.macosx64-10.10-i386.tar.gz

Both seem to work. I can run

tar -zxf Delphes-3.2.0.tar.gz
cd Delphes-3.2.0
make -j 4
curl http://cp3.irmp.ucl.ac.be/~demin/test.hepmc.gz | gunzip | ./DelphesHepMC cards/delphes_card_CMS.tcl delphes_output.root
root -l examples/Example1.C'("delphes_output.root")'

with ROOT 5.34.28 without any error messages.

Cheers,

Pavel

comment:10 by Vince Pascuzzi, 10 years ago

Hi Pavel,

Well, that embarrassing...Could you kindly tell me whatever changes you made to your environment variables? Should it matter where Delphes is installed?

All the best,

Vince.

Last edited 10 years ago by Vince Pascuzzi (previous) (diff)

comment:11 by Pavel Demin, 10 years ago

Here are the ROOT related lines from my .profile:

#export ROOTSYS=$HOME/root/root_v6.02.05.macosx64-10.10-i386
export ROOTSYS=$HOME/root/root_v5.34.28.macosx64-10.10-clang60
export PATH=$ROOTSYS/bin:$PATH
export PYTHONPATH=$ROOTSYS/lib:$PYTHONPATH
export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH

comment:12 by Vince Pascuzzi, 10 years ago

Nothing to do with Delphes in your profile? I am giving it another shot now.

comment:13 by Pavel Demin, 10 years ago

Normally, I run all the Delphes programs directly from the Delphes directory, so I don't configure any environment variables for Delphes.

by Vince Pascuzzi, 10 years ago

Empty ROOT plot from Example1.C

comment:14 by Vince Pascuzzi, 10 years ago

Hi Pavel,

Adjusting my profile as you suggested I was able to run Example1.C, however the plot produced was empty (see attachment).

[EDIT]

That said, using my own Delphes output file the plot was populated. However, does the plot make sense? I'd like to be sure everything is copacetic before I move on past this. THAT said, I appreciate very much all your assistance and am happy to say I am much happier having this working.

Vince

Last edited 10 years ago by Vince Pascuzzi (previous) (diff)

by Vince Pascuzzi, 10 years ago

Example1.C run with my Delphes output.

comment:15 by Pavel Demin, 10 years ago

Great! It's good to know that you can now run the examples.

The file that I was using for tests does not contain any electrons. So, it's normal that the plot is empty.

comment:16 by Pavel Demin, 9 years ago

New version of the examples and EventDisplay now works with ROOT 6.04. It will be included in the next release.

comment:17 by Michael Albergo, 7 years ago

Hi there Pavel,

Sorry to revive this, but I am having the same issue with ROOT6 now. Has the capacity for including libraries through code like gSystem->Load("libDelphes") work in any newer ROOT 6?

Are there any series limitations in earlier versions of Delphes other than 3.4.1 that would prevent me from simply simulation qcd events in a detector? I ask because only older versions of delphes seem compatible with older root.

Thanks,
Michael

comment:18 by Pavel Demin, 7 years ago

Sorry to revive this, but I am having the same issue with ROOT6 now.

Please provide more details about your setup: OS version, C++ compiler version, ROOT version, how ROOT was installed, Delphes version.

Note: See TracTickets for help on using tickets.