# Can't open file TLorentzVector.h

**URL:** <https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043>\
**Category:** Newbie\
**Created:** [February 19, 2020, 9:07am UTC](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043 "2020-02-19T09:07:50Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![magdy-ayad](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/magdy-ayad/32/20959_2.png) [@magdy-ayad](https://root-forum.cern.ch/u/magdy-ayad)\
**Post date:** [February 19, 2020, 9:07am UTC](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043/1 "2020-02-19T09:07:50Z")

</div>

excuse me, i am trying to compile and run a C++ code using root and i get this error "can’t open TLorentzVector.h " However the TLorentzVector.h header exist in the include library file ! what should i do to fix this problem ?

---

<div class="post-metadata">

**Author:** ![chiara\_iannetta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/chiara_iannetta/32/20293_2.png) [@chiara\_iannetta](https://root-forum.cern.ch/u/chiara_iannetta)\
**Post date:** [February 19, 2020, 1:41pm UTC](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043/2 "2020-02-19T13:41:50Z")

</div>

Can you append your code or directly the macro that you are using?

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [February 20, 2020, 9:58pm UTC](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043/3 "2020-02-20T21:58:35Z")

</div>

Maybe add  
`root-config --cflags`  
to you compile line so that the compiler knows where to find the ROOT header files?

---

<div class="post-metadata">

**Author:** ![Audrey\_Spency](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/audrey_spency/32/20955_2.png) [@Audrey\_Spency](https://root-forum.cern.ch/u/Audrey_Spency)\
**Post date:** [February 21, 2020, 7:33am UTC](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043/4 "2020-02-21T07:33:10Z")

</div>

`TRotation r; v.Transform(r); or v *= r; // Attention v=M*v`

---

<div class="post-metadata">

**Author:** ![magdy-ayad](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/magdy-ayad/32/20959_2.png) [@magdy-ayad](https://root-forum.cern.ch/u/magdy-ayad)\
**Post date:** [February 21, 2020, 2:25pm UTC](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043/5 "2020-02-21T14:25:05Z")

</div>

i construct a four vector for di-leptons then i calculate the invariant mass of the system, but i get that error, the function as fellows:-

```cpp
#include "TLorentzVector.h"
-
-
-
//=== Methode to calculate the mass ===
float ZprimeMuMu_FR_MiniAod::Mass(float Pt1,float Eta1,float Phi1,float En1,
				  float Pt2,float Eta2,float Phi2,float En2)
{
  float MuMuMass = 0.0;
  TLorentzVector Mu1;
  TLorentzVector Mu2;
  Mu1.SetPtEtaPhiM(Pt1,Eta1,Phi1,En1);
  Mu2.SetPtEtaPhiM(Pt2,Eta2,Phi2,En2);
  MuMuMass = (Mu1 + Mu2).M();
  return MuMuMass;
}

```

---

<div class="post-metadata">

**Author:** ![magdy-ayad](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/magdy-ayad/32/20959_2.png) [@magdy-ayad](https://root-forum.cern.ch/u/magdy-ayad)\
**Post date:** [February 21, 2020, 2:26pm UTC](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043/6 "2020-02-21T14:26:42Z")

</div>

excuse me, can you clarify it  
where i have to compile this statment ?

---

<div class="post-metadata">

**Author:** ![magdy-ayad](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/magdy-ayad/32/20959_2.png) [@magdy-ayad](https://root-forum.cern.ch/u/magdy-ayad)\
**Post date:** [February 21, 2020, 2:29pm UTC](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043/7 "2020-02-21T14:29:20Z")

</div>

sorry, can you explain !

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [February 21, 2020, 5:04pm UTC](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043/8 "2020-02-21T17:04:41Z")

</div>

How to you “build/compile” your code? What is the step that is leading to an error? What is the exact wording of the error?

---

<div class="post-metadata">

**Author:** ![magdy-ayad](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/magdy-ayad/32/20959_2.png) [@magdy-ayad](https://root-forum.cern.ch/u/magdy-ayad)\
**Post date:** [February 21, 2020, 5:19pm UTC](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043/9 "2020-02-21T17:19:47Z")

</div>

Error : Can’t open TLorentzVector.h

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [February 21, 2020, 5:39pm UTC](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043/10 "2020-02-21T17:39:16Z")

</div>

You need to show the “command line” which you execute (the one that leads to this error).

---

<div class="post-metadata">

**Author:** ![magdy-ayad](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/magdy-ayad/32/20959_2.png) [@magdy-ayad](https://root-forum.cern.ch/u/magdy-ayad)\
**Post date:** [February 22, 2020, 9:09am UTC](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043/11 "2020-02-22T09:09:34Z")

</div>

[20] #include \<-----\>  
[21] #include \<TLorentzVector.h\>  
[22] #include \< -----\>

the compiler stops and give an error at line 22 as the following screenshot

 ![error](https://root-forum.cern.ch/uploads/default/original/3X/9/a/9a063f8dcd530423bff79cbc50d900623e5c3e51.png)

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [February 22, 2020, 9:23am UTC](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043/12 "2020-02-22T09:23:37Z")

</div>

Attach “ZprimeMuMu\_FR\_MiniAod.C” and “ZprimeMuMu\_FR\_MiniAod.h” for inspection.

BTW. There is no “compiler” involved. It is just the ROOT “interpreter”. Which ROOT version? Which operating system? What do you get from:

```bash
ls -al `root-config --incdir`/TLorentzVector.h

```

---

<div class="post-metadata">

**Author:** ![magdy-ayad](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/magdy-ayad/32/20959_2.png) [@magdy-ayad](https://root-forum.cern.ch/u/magdy-ayad)\
**Post date:** [February 22, 2020, 9:41am UTC](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043/13 "2020-02-22T09:41:08Z")

</div>

i use root 5.34  
linux - ubuntu

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [February 22, 2020, 9:46am UTC](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043/14 "2020-02-22T09:46:48Z")

</div>

Which Ubuntu version exactly?  
How did you install ROOT?

---

<div class="post-metadata">

**Author:** ![magdy-ayad](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/magdy-ayad/32/20959_2.png) [@magdy-ayad](https://root-forum.cern.ch/u/magdy-ayad)\
**Post date:** [February 22, 2020, 9:47am UTC](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043/15 "2020-02-22T09:47:23Z")

</div>

> [@Wile\_E\_Coyote](#):
>
> ls -al `root-config --incdir`/TLorentzVector.h

i get \> no such file or directory

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [February 22, 2020, 9:48am UTC](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043/16 "2020-02-22T09:48:02Z")

</div>

What do you get from: `root-config --incdir`

---

<div class="post-metadata">

**Author:** ![magdy-ayad](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/magdy-ayad/32/20959_2.png) [@magdy-ayad](https://root-forum.cern.ch/u/magdy-ayad)\
**Post date:** [February 22, 2020, 9:50am UTC](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043/17 "2020-02-22T09:50:42Z")

</div>

## /usr/include/root

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [February 22, 2020, 9:55am UTC](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043/18 "2020-02-22T09:55:36Z")

</div>

It seems to me that you use the very old Ubuntu provided ROOT version. You’d better get rid of it completely (e.g. execute “sudo apt-get purge root-system\* root-plugin\* libroot\*” and afterwards check that the “/usr/lib/i386-linux-gnu/root5.34” and the “/usr/lib/x86\_64-linux-gnu/root5.34” subdirectories disappeared completely).

[The ROOT team provides ready-to-use binary distributions for some systems, including various Ubuntu versions, which you just need to download and unpack (see “ **Using binaries** ” therein).](https://root.cern.ch/downloading-root)

---

<div class="post-metadata">

**Author:** ![magdy-ayad](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/magdy-ayad/32/20959_2.png) [@magdy-ayad](https://root-forum.cern.ch/u/magdy-ayad)\
**Post date:** [February 22, 2020, 10:19am UTC](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043/19 "2020-02-22T10:19:32Z")

</div>

when i excute the command to remove the root version wich i use i get :-  
E: The package libndp0 needs to be reinstalled, but I can’t find an archive for it.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [February 22, 2020, 10:37am UTC](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043/20 "2020-02-22T10:37:18Z")

</div>

Try something like:

```bash
sudo apt-get install --reinstall libndp0

```

[Next page](https://root-forum.cern.ch/t/cant-open-file-tlorentzvector-h/38043.md?page=2)
