1 #ifndef HelpfulWatchers_G4StepStatistics_h
2 #define HelpfulWatchers_G4StepStatistics_h
26 #include "G4ParticleDefinition.hh"
28 #include "G4VProcess.hh"
35 #include <TClonesArray.h>
41 #include <TObjString.h>
72 if (theG4Step->GetPreStepPoint()->GetPhysicalVolume()) {
73 theG4RegionName = theG4Step->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetRegion()->GetName();
75 std::cout <<
"Physical Volume" << std::endl;
76 if (theG4Step->GetPreStepPoint()->GetProcessDefinedStep()) {
77 theG4ProcessName = theG4Step->GetPreStepPoint()->GetProcessDefinedStep()->GetProcessName();
120 #define OBSERVES(type) \
122 Observer<const type *>
123 #define UPDATE(type) \
124 void update(const type *) override { std::cout << "++ signal " #type << std::endl; }
142 Region =
new TClonesArray(
"TObjString", 100000);
144 Process =
new TClonesArray(
"TObjString", 100000);
165 unsigned int *MyValue =
new unsigned int(1);
167 G4StatsMap.insert(std::make_pair(mysteptest, MyValue));
189 std::cout <<
"++ signal EndOfEvent " << std::endl;
200 std::cout <<
" G4StatsMap step is: " <<
step->first.GetRegionName() <<
" " <<
step->first.GetProcessName()
201 <<
" " <<
step->first.GetParticlePDGID();
202 std::cout <<
" Number of such steps: " << *
step->second << std::endl;
207 new ((*Region)[
index]) TObjString(
step->first.GetRegionName());
208 new ((*Process)[
index]) TObjString(
step->first.GetProcessName());