Can't open file TLorentzVector.h

Hi Rooters,
I have a similar problem.
TLorentzVector works fine when I compile from root CINT, but it complains when I try to compile using g++.
I get the following Error:
SignalEventList_b4Sim.cc:452:2: error: ‘TLorentzVector’ was not declared in this scope
TLorentzVector bJ1, bJ2, bJ3, bJ4;
After this, I included <TLorentzVector.h> and compiled again. This resulted in a big list of errors attached in log.txtlog.txt (30.1 KB)
I am using it along with fastJet. The source code and the compilation script is attached.
Also, ls -al root-config --incdir/TLorentzVector.h gives:
-rw-r–r-- 1 tamasi tamasi 19356 May 23 2019 /home/tamasi/build/include/TLorentzVector.h
and
locate TLorentzVector gives:SignalEventList_b4Sim.cc (16.4 KB) compileEventList_b4Sim.txt (145 Bytes)
/home/tamasi/build/include/TLorentzVector.h
/home/tamasi/build/math/physics/CMakeFiles/Physics.dir/src/TLorentzVector.cxx.o
/home/tamasi/root/math/physics/inc/TLorentzVector.h
/home/tamasi/root/math/physics/src/TLorentzVector.cxx

Can someone help me fix this?

Best Regards,
Tamasi

Try to remove (of course, you will then need to explicitly write “fastjet::ClusterSequence” and so on): “using namespace fastjet;

Hi,
Thanks a lot. I changed the order of the includes and it compiled. Instead of having the fastJet includes first, I added the root includes first followed by fastJet includes, and it worked. Why is the order of includes so important?
Cheers,
Tamasi

@Axel It seems there is a clash between the “void Error” function from ROOT’s “TError.h” and the “fastjet::Error” class from “fastjet/Error.hh”.

1 Like