from /home/rudradeb/sim/action.cc:3,
from /home/rudradeb/sim/Sim.cc:13:
/home/rudradeb/sim/run.cc: At global scope:
/home/rudradeb/sim/run.cc:25:6: error: no declaration matches ‘void MyRunAction::EndOfRunAction(const G4Run*)’
25 | void MyRunAction::EndOfRunAction(const G4Run*)
| ^~~~~~~~~~~
/home/rudradeb/sim/run.cc:25:6: note: no functions named ‘void MyRunAction::EndOfRunAction(const G4Run*)’
In file included from /home/rudradeb/sim/action.hh:7,
from /home/rudradeb/sim/Sim.cc:12:
/home/rudradeb/sim/run.hh:8:7: note: ‘class MyRunAction’ defined here
8 | class MyRunAction : public G4UserRunAction
This issue seems unresolved and I dont seem to figure out where the problem is,
#include “run.hh”
MyRunAction::MyRunAction()
{}
MyRunAction::~MyRunAction()
{}
void MyRunAction::BeginOfRunAction(const G4Run*)
{
G4AnalysisManager *man = G4AnalysisManager::Instance();
man->OpenFile("output.root");
man->CreateNtuple("Hits","Hits");
man->CreateNtupleIColumn("fEvent");
man->CreateNtupleDColumn("fX");
man->CreateNtupleDColumn("fY");
man->CreateNtupleDColumn("fZ");
man->FinishNtuple(0);
}
void MyRunAction::EndOfRunAction(const G4Run*)
{
G4AnalysisManager *man = G4AnalysisManager::Instance();
man->Write();
man->CloseFile();
}
this is my run.cc
and
#ifndef RUN_HH
#define RUN_HH
#include “G4UserRunAction.hh”
#include “G4AnalysisManager.hh”
#include “globals.hh”
class MyRunAction : public G4UserRunAction
{
public:
MyRunAction();
~MyRunAction();
virtual void BeginOfRunAction(const G4Run*);
virtual void EnfOfRunAction(const G4Run*);
};
#endif
this is my run.hh
Please help.