I am a bit confused about how to use accumulables. It’s not clear to me how to access and modify accumulables, for example, I want to increment a counter every time a particle leaves a specific volume per event in stepping action.
I tried to do something like this:
G4AccumulableManager* accumulableManager = G4AccumulableManager::Instance();
auto test = accumulableManager->GetAccumulable(“PMT1”);
test++;
G4cout <GetValue()<<"\n";
but this gives me either -1408678848 or 1701996900