Thank you for your quick reply, I tried installing HePMC3 with two methods:
Method 1:
I followed the steps mentioned in link : HepMC3 event record library: Building instructions
- Downloaded latest version of HepMC3(v3.2.5) and cd into the directory.
- Executed the command :
"cmake -DCMAKE_INSTALL_PREFIX=/home/dharmender/hepmc3 -DHEPMC3_ENABLE_ROOTIO=ON -DHEPMC3_ENABLE_PYTHON=OFF CMakeLists.txt "
- cmake --build .
- cmake --install .
- ctests.
The last command shows :
"31% tests passed, 29 tests failed out of 42
The following tests FAILED:
1 - testBoost (Not Run)
2 - testFourVector (Not Run)
3 - testMass (Not Run)
4 - testPrintBug (Not Run)
5 - testPolarization (Not Run)
6 - testUnits (Not Run)
7 - testMultipleCopies (Not Run)
8 - testWeights (Not Run)
9 - testLoops (Not Run)
10 - testDelete (Not Run)
11 - testSkip1 (Not Run)
12 - testIO1 (Not Run)
13 - testIO3 (Not Run)
14 - testIO6 (Not Run)
15 - testIO7 (Not Run)
16 - testIO8 (Not Run)
17 - testReaderFactory1 (Not Run)
18 - testSingleVertexHepMC2 (Not Run)
19 - testAttributes (Not Run)
20 - testHEPEVTWrapper1 (Not Run)
21 - testThreads1 (Not Run)
22 - testIO10 (Not Run)
23 - testIO9 (Not Run)
24 - testThreadssearch (Not Run)
25 - testIO2 (Not Run)
26 - testIO4 (Not Run)
27 - testReaderFactory2 (Not Run)
28 - testRoot300 (Not Run)
29 - testRootTree300 (Not Run)
"
Method 2 :
I followed the steps of link : HepMC / HepMC3 · GitLab
And did the following steps in my system
-
git clone HepMC / HepMC3 · GitLab
-
cmake -DHEPMC3_ENABLE_ROOTIO=ON -DROOT_DIR=path_to_ROOT6_installation
-DHEPMC3_BUILD_EXAMPLES=ON
-DHEPMC3_ENABLE_TEST=ON
-DCMAKE_INSTALL_PREFIX=…/hepmc3-install …/HepMC3
-
make
-
sudo make install (make install wasn’t working)
-
Then to test it I executed ‘ctest .’ which showed “100% tests passed, 0 tests failed out of 55”.
-
After following the script, I tried to run the examples by executing these commands:
‘cmake -DUSE_INSTALLED_HEPMC3=ON -DHepMC3_DIR=/home/dharmender/hepmc2root/hepmc3-install/share/HepMC3/cmake CMakeLists.txt’ in the ‘examples’ directory which terminated with error:
"-- Configuring done
CMake Error at Pythia6Example/CMakeLists.txt:8 (add_executable):
Cannot find source file:
/pythia6/include/Pythia6/Pythia6ToHepMC3.cc
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
.hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc
CMake Error at Pythia6Example/CMakeLists.txt:8 (add_executable):
No SOURCES given to target: pythia6_example.exe
CMake Generate step failed. Build files cannot be regenerated correctly."
- Then I tried to go into individual example directories and executed the same command:
‘cmake -DUSE_INSTALLED_HEPMC3=ON -DHepMC3_DIR=/home/dharmender/hepmc2root/hepmc3-install/share/HepMC3/cmake CMakeLists.txt’
(i) In the ‘BasicExamples’ directory; it worked fine and showed this in the end:
"Configuring done
– Generating done
CMake Warning:
Manually-specified variables were not used by the project:
HepMC3_DIR
– Build files have been written to: /home/dharmender/hepmc2root/HepMC3/examples/BasicExamples"
(ii) I didn’t go into the PythiaExample because i didn’t link with Pythia
(iii) For my purpose, I went into the ‘RootIOExample’ , ‘RootIOExample2’, ‘RootIOExample3’ directories and executed the same command: “cmake -DUSE_INSTALLED_HEPMC3=ON -DHepMC3_DIR=/home/dharmender/hepmc2root/hepmc3-install/share/HepMC3/cmake CMakeLists.txt”
But it ended with error:
"dharmender@dharmender-Inspiron-3521:~/hepmc2root/HepMC3/examples/RootIOExample$ cmake -DUSE_INSTALLED_HEPMC3=ON -DHepMC3_DIR=/home/dharmender/hepmc2root/hepmc3-install/share/HepMC3/cmake CMakeLists.txt
CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as
project(ProjectName)
near the top of the file, but after cmake_minimum_required().
CMake is pretending there is a “project(Project)” command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.
– The C compiler identification is GNU 11.2.0
– The CXX compiler identification is GNU 11.2.0
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working C compiler: /usr/bin/gcc - skipped
– Detecting C compile features
– Detecting C compile features - done
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Check for working CXX compiler: /usr/bin/g++ - skipped
– Detecting CXX compile features
– Detecting CXX compile features - done
CMake Error at CMakeLists.txt:25 (install):
install FILES given no DESTINATION!
CMake Error at CMakeLists.txt:26 (install):
install DIRECTORY given no DESTINATION!
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.22)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run “cmake --help-policy CMP0000”.
This warning is for project developers. Use -Wno-dev to suppress it.
– Configuring incomplete, errors occurred!
See also “/home/dharmender/hepmc2root/HepMC3/examples/RootIOExample/CMakeFiles/CMakeOutput.log”."
cmake --version : 3.22.1
My main purpose is to convert into .root file that have atleast eta, phi , PID, px, py branches.
Can you suggest some way to convert into .root file ; it’d be really helpful for me.
Also I know it might sound basic but can you simply explain how to run the HePMC3 examples??
Do i need to convert my .hepmc file into HePMC3 file first and then convert in into .root file??
If so, how can I do it??
Thank you in advance,
Dharmender