# Need code for .lhe file reading and ploting graphs for eta and pt

**URL:** <https://root-forum.cern.ch/t/need-code-for-lhe-file-reading-and-ploting-graphs-for-eta-and-pt/49099>\
**Category:** Newbie\
**Created:** [March 9, 2022, 10:16am UTC](https://root-forum.cern.ch/t/need-code-for-lhe-file-reading-and-ploting-graphs-for-eta-and-pt/49099 "2022-03-09T10:16:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anees\_Khan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/anees_khan/32/28677_2.png) [@Anees\_Khan](https://root-forum.cern.ch/u/Anees_Khan)\
**Post date:** [March 9, 2022, 10:16am UTC](https://root-forum.cern.ch/t/need-code-for-lhe-file-reading-and-ploting-graphs-for-eta-and-pt/49099/1 "2022-03-09T10:16:38Z")

</div>

Hello.  
Anybody have macro for LHE file reading and plot particle eta and Pt ? If someone have please share.  
Thanks

---

<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:** [March 9, 2022, 10:26am UTC](https://root-forum.cern.ch/t/need-code-for-lhe-file-reading-and-ploting-graphs-for-eta-and-pt/49099/2 "2022-03-09T10:26:41Z")

</div>

You could try to start with (hopefully it is able to read `"lhef"` input files and write `"root"` output files): [HepMC3/examples/ConvertExample](https://gitlab.cern.ch/hepmc/HepMC3/-/tree/master/examples/ConvertExample)  
See also another [HepMC3/examples](https://gitlab.cern.ch/hepmc/HepMC3/-/tree/master/examples), e.g., [HepMC3/examples/ViewerExample](https://gitlab.cern.ch/hepmc/HepMC3/-/tree/master/examples/ViewerExample) and [HepMC3/examples/LHEFExample](https://gitlab.cern.ch/hepmc/HepMC3/-/tree/master/examples/LHEFExample)

---

<div class="post-metadata">

**Author:** ![Anees\_Khan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/anees_khan/32/28677_2.png) [@Anees\_Khan](https://root-forum.cern.ch/u/Anees_Khan)\
**Post date:** [March 9, 2022, 10:39am UTC](https://root-forum.cern.ch/t/need-code-for-lhe-file-reading-and-ploting-graphs-for-eta-and-pt/49099/3 "2022-03-09T10:39:17Z")

</div>

Thanks for sharing but I haven’t get any clue because my programing is not so good.
