ROOT 6 does not recognize MissingET

Hi,
I am using ROOT 6.08 and running this script:

void copytree3(void) {

gSystem->Load("/home/amin/Documents/Delphes-3.3.3/libDelphes");

TChain chain("Delphes");
for(### iterating over ROOT files in directory ####)
{
    chain.Add(##ROOT FILES###);
}
Long64_t nentries = chain.GetEntries();
chain.SetBranchStatus("*",1);

TFile *newfile = new TFile("BB-4p-700-1300-v1510_14TEV_140PileUp.root","recreate");
TTree *newtree = chain.CloneTree(0,"fast");

TClonesArray *branchMissingET = 0;
chain.SetBranchAddress("MissingET",&branchMissingET);

for (Long64_t i=0; i<nentries; ++i) {
    chain.GetEntry(i);
    MissingET *met = (MissingET*) branchMissingET->At(0);

    if(met->MET>100) {
        newtree->Fill();
    }
}
newtree->Write();

}

ROOT returns this error when running:

In file included from input_line_8:1:
/home/amin/Documents/Backgrounds/copytree3.C:51:9: error: unknown type name 'MissingET’
MissingET met = (MissingET) branchMissingET->At(0);
^
/home/amin/Documents/Backgrounds/copytree3.C:51:27: error: use of undeclared identifier 'MissingET’
MissingET met = (MissingET) branchMissingET->At(0);
^
/home/amin/Documents/Backgrounds/copytree3.C:51:37: error: expected expression
MissingET met = (MissingET) branchMissingET->At(0);

Any idea why? ROOT 5 runs this script with out problems!

Thanks a lot.
Amin

Hi,

You are probably missing an #include for that delphes header.

And you might need to use R__LOAD_LIBRARY(/home/amin/Documents/Delphes-3.3.3/libDelphes) after the#include instead of gSystem->Load().

Cheers, Axel

Hi Axel,

Thanks. I added those lines:

#ifdef __CLING__
R__LOAD_LIBRARY(/home/amin/Documents/Delphes-3.3.3/libDelphes)
#include "classes/DelphesClasses.h"
#include "external/ExRootAnalysis/ExRootTreeReader.h"
#endif

It is still giving me error:

input_line_9:1:10: fatal error: '/home/amin/Documents/Delphes-3.3.3/libDelphes' file not found
#include "/home/amin/Documents/Delphes-3.3.3/libDelphes"
         ^
In file included from input_line_8:1:
/home/amin/Documents/Backgrounds/copytree3.C:3:10: fatal error: 'classes/DelphesClasses.h' file not found
#include "classes/DelphesClasses.h"
         ^
/home/amin/Documents/Backgrounds/copytree3.C:4:10: fatal error: 'external/ExRootAnalysis/ExRootTreeReader.h' file not found
#include "external/ExRootAnalysis/ExRootTreeReader.h"
         ^
/home/amin/Documents/Backgrounds/copytree3.C:60:9: error: unknown type name 'MissingET'
        MissingET *met = (MissingET*) branchMissingET->At(0);
        ^
/home/amin/Documents/Backgrounds/copytree3.C:60:27: error: use of undeclared identifier 'MissingET'
        MissingET *met = (MissingET*) branchMissingET->At(0);
                          ^
/home/amin/Documents/Backgrounds/copytree3.C:60:37: error: expected expression
        MissingET *met = (MissingET*) branchMissingET->At(0);

I also changed gSystem->Load() to R__LOAD_LIBRARY in the rootlogon.C file. But still didn’t solve the problem.

Hi again,

I fixed the path to libDelphes to become: /home/amin/Documents/Delphes-3.3.3/libDelphes.so
It seems it needs “.so” extension. However, I run into another problem now. It cannot find libCint.so and gives the error:

cling::DynamicLibraryManager::loadLibrary(): libCint.so: cannot open shared object file: No such file or directory
In file included from input_line_8:1:
/home/amin/Documents/Backgrounds/copytree3.C:3:10: fatal error: 'classes/DelphesClasses.h' file not found
#include "classes/DelphesClasses.h"
         ^
/home/amin/Documents/Backgrounds/copytree3.C:56:9: error: unknown type name 'MissingET'
        MissingET *met = (MissingET*) branchMissingET->At(0);
        ^
/home/amin/Documents/Backgrounds/copytree3.C:56:27: error: use of undeclared identifier 'MissingET'
        MissingET *met = (MissingET*) branchMissingET->At(0);
                          ^
/home/amin/Documents/Backgrounds/copytree3.C:56:37: error: expected expression
        MissingET *met = (MissingET*) branchMissingET->At(0);

In root/lib directory, the file libCint.so does not exist. However, it does exist in ROOT 5. I copied the file into the lib directory of ROOT 6 but it gave an error also:

cling::DynamicLibraryManager::loadLibrary(): /home/amin/Documents/Delphes-3.3.3/libDelphes.so: undefined symbol: _ZN8TFormula11ShowMembersER16TMemberInspector

Thank you!

Don’t copy libraries around, please :slight_smile: This will leave a mess of inconsistent libraries.

You should not load libCint. Do you know where this is coming from?

Where is the file DelphesClasses.h? Where do you run the script? You can use R__ADD_INCLUDE_PATH(/some/dir/) to help your script find the relevant headers. Similar to -I passed to a compiler.

Axel.

Thanks Axel.
The DelphesClasses.h is in the Delphes directory and, specifically, in the class subdirectory. I used R__ADD_INCLUDE_PATH to point the script to the place where the header files are. Now, I am no longer getting error from that, but from something else. This what I have now before the main():

#ifdef __CLING__
R__ADD_INCLUDE_PATH(/home/amin/Documents/Delphes-3.3.3/classes)
#include "DelphesClasses.h"
#endif

Now, in the main, I have:

R__ADD_INCLUDE_PATH(/home/amin/Documents/Delphes-3.3.3)
R__LOAD_LIBRARY(libDelphes.so);

In this case it is giving me errors and a lot of warnings. Here’s a sample of them:

/home/amin/Documents/Delphes-3.3.3/libDelphes.so:1:1: error: expected unqualified-id
<U+007F>ELF<U+0002><U+0001><U+0001><U+0003><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0003><U+0000>><U+0000><U+0001><U+0000><U+0000>...
^
/home/amin/Documents/Delphes-3.3.3/libDelphes.so:1:9: warning: null character ignored [-Wnull-character]
<U+007F>ELF<U+0002><U+0001><U+0001><U+0003><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0003><U+0000>><U+0000><U+0001><U+0000><U+0000>...

If I specify R__LOAD_LIBRARY(libDelphes), i.e. removing “.so”, it gives an error: libDelphes cannot be found.
Also, it starts loading libCint.so when I place R__LOAD_LIBRARY(libDelphes.so) before the main.

Thanks again.
Amin

I am using now Example2.C from the Delphes’ examples directory and I’m running it in ROOT 6.08 as .x Example2.C("filename.root").
If I load the library as R__LOAD_LIBRARY(libDelphes), I get:

input_line_10:1:10: fatal error: 'libDelphes' file not found
#include "libDelphes"

However, specifying “.so”, i.e. R__LOAD_LIBRARY(libDelphes.so) gives the same error I mentioned in the previous post.
I am attaching the file Example2.C so if you could, kindly, have a look at it.

Thanks,
Amin
Example2.C (4.9 KB)

Hi,

You only need #include, R__ADD_INCLUDE_PATH and R__LOAD_LIBRARY in front of main().

That’s bad - it means that libDelphes was built against ROOT 5. That won’t work; you need it to be built with ROOT 6.

And you can help cling find libDelphes using R__ADD_LIBRARY_PATH(/whereever/Delphes/lib/directory/is). Does that help?

I cannot reproduce that “ELF” error… Could you attach your libDelphes.so (you might have to zip it)?

Cheers, Axel.

Hi Axel,

I don’t have any lib directory in my Delphes. All there is is libDelphes.so which I am attaching here.
Also, what do you mean by building ROOT 6 against Delphes? I already have rootlogon.C file in ROOT 6 which points to where Delphes lives. Isn’t that enough?
Thanks for looking into this. Appreciate it.

Amin
libDelphes.so.tar.gz (1.3 MB)

Hi again,

I moved my ROOT file into the Delphes folder and executed Example2.C and it ran perfectly. It seems that R__ADD_INCLUDE_PATH was not enough so I had to set LD_LIBRARY_PATH in my .profile so it would catch libDelphes. Despite working perfectly inside Delphes directory, it is still giving me an error when running outside Delphes. However, the error did not prevent the histograms from being generated. The errors I am getting now are:

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

I tried setting PATH to ExRootAnalysis but it didn’t solve the problem. If I only had one ROOT file I would transfer it to the Delphes directory and work there with out any problem but I have over 200 ROOT files and I don’t want to transfer all of them there. Do you see a solution to that?

Thanks a lot.
Amin

Hi,

You’ll need to set ROOT_INCLUDE_PATH to point to the location of your Delphes headers.

Cheers, Axel.

Hi,

This is still not working. My path to Delphes is defined in .profile so why isn’t this enough?

#include "external/ExRootAnalysis/ExRootTreeReader.h"
#include "external/ExRootAnalysis/ExRootResult.h

Best,
Amin

I don’t understand that. What do you define in your .profile? I suspect it’s LD_LIBRARY_PATH. But that is for finding the library. You also need to find the headers - and that’s where ROOT_INCLUDE_PATH comes in.

Axel.

Yes the PATH is for the library.
Using ROOT_INCLUDE_PATH does not work for me. I will try to see what’s going on.
Thanks for all the help.

Best,
Amin

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