in fact me, firstly for compile my code, I used the following command lines:
1- I create a folder inside where I will compile and execute my code;
2- Inside the folder build, I open a terminal where I run the following commande lines:
a) cmake -DGeant4_DIR=/home/ebode/Geant4/geant4.10.02.p02-install/lib64/Geant4-10.2.2 /home/ebode/EBODE/D1
b) make
here I have this answer:
Similar command is: ‘root’
[ebode@localhost build] cmake -DGeant4_DIR=/home/ebode/Geant4/geant4.10.02.p02-install/lib64/Geant4-10.2.2 /home/ebode/EBODE/D1
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ebode/EBODE/D1/build
[ebode@localhost build] make
Scanning dependencies of target exampleD1
[ 9%] Building CXX object CMakeFiles/exampleD1.dir/exampleD1.cc.o
[ 18%] Building CXX object CMakeFiles/exampleD1.dir/src/D1ActionInitialization.cc.o
[ 27%] Building CXX object CMakeFiles/exampleD1.dir/src/D1DetectorConstruction.cc.o
[ 36%] Building CXX object CMakeFiles/exampleD1.dir/src/D1EMPhysics.cc.o
[ 45%] Building CXX object CMakeFiles/exampleD1.dir/src/D1EventAction.cc.o
/home/ebode/EBODE/D1/src/D1EventAction.cc: In member function ‘void D1EventAction::PrintEventStatistics(G4double, G4double, G4double, G4double, G4double, G4double) const’:
/home/ebode/EBODE/D1/src/D1EventAction.cc:107:37: warning: left operand of comma operator has no effect [-Wunused-value]
<< std::setw(7) << (nOptical1, “opticalphoton”)
^
/home/ebode/EBODE/D1/src/D1EventAction.cc:114:37: warning: left operand of comma operator has no effect [-Wunused-value]
<< std::setw(7) << (nOptical2, “opticalphoton”)
^
[ 54%] Building CXX object CMakeFiles/exampleD1.dir/src/D1GeneralPhysics.cc.o
[ 63%] Building CXX object CMakeFiles/exampleD1.dir/src/D1MuonPhysics.cc.o
[ 72%] Building CXX object CMakeFiles/exampleD1.dir/src/D1PhysicsList.cc.o
[ 81%] Building CXX object CMakeFiles/exampleD1.dir/src/D1PrimaryGeneratorAction.cc.o
[ 90%] Building CXX object CMakeFiles/exampleD1.dir/src/D1RunAction.cc.o
[100%] Linking CXX executable exampleD1
[100%] Built target exampleD1
c) ./exampleD1
now I run the following command lines in the interface:
/gun/particle mu+
/gun/energy 2 GeV
/run/beamOn 1000D1.17.09.2018…tar.gz (323.0 KB)
I think that the problem in my code is located in my D1RunAction.cc and D1EvenAction.cc because in
when I compile my code, I have this answer for my D1EvenAction.cc:
[ 36%] Building CXX object CMakeFiles/exampleD1.dir/src/D1EMPhysics.cc.o
[ 45%] Building CXX object CMakeFiles/exampleD1.dir/src/D1EventAction.cc.o
/home/ebode/EBODE/D1/src/D1EventAction.cc: In member function ‘void D1EventAction::PrintEventStatistics(G4double, G4double, G4double, G4double, G4double, G4double) const’:
/home/ebode/EBODE/D1/src/D1EventAction.cc:107:37: warning: left operand of comma operator has no effect [-Wunused-value]
<< std::setw(7) << (nOptical1, “opticalphoton”)
^
/home/ebode/EBODE/D1/src/D1EventAction.cc:114:37: warning: left operand of comma operator has no effect [-Wunused-value]
<< std::setw(7) << (nOptical2, “opticalphoton”)
^
[ 54%] Building CXX object CMakeFiles/exampleD1.dir/src/
Please Professor, can you help at this step in order that I get my secondary particle histogram?
great thanks advance Professor. I have attached the code in order that you appreciates.