1 #ifndef HelpfulWatchers_G4StepStatistics_h
2 #define HelpfulWatchers_G4StepStatistics_h
29 #include "G4VProcess.hh"
30 #include "G4ParticleDefinition.hh"
40 #include <TClonesArray.h>
75 if (theG4Step->GetPreStepPoint()->GetPhysicalVolume()) {
76 theG4RegionName = theG4Step->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetRegion()->GetName();
79 if (theG4Step->GetPreStepPoint()->GetProcessDefinedStep()){
80 theG4ProcessName = theG4Step->GetPreStepPoint()->GetProcessDefinedStep()->GetProcessName();
128 #define OBSERVES(type) public Observer<const type*>
129 #define UPDATE(type) void update(const type*) { std::cout <<"++ signal " #type<<std::endl; }
150 Region =
new TClonesArray(
"TObjString",100000);
152 Process =
new TClonesArray(
"TObjString",100000);
173 unsigned int* MyValue =
new unsigned int(1);
175 G4StatsMap.insert(std::make_pair(mysteptest, MyValue));
199 std::cout <<
"++ signal EndOfEvent " <<std::endl;
209 std::cout <<
" G4StatsMap step is: "<<
step->first.GetRegionName()<<
" "<<
step->first.GetProcessName()<<
" "<<
step->first.GetParticlePDGID();
210 std::cout <<
" Number of such steps: "<< *
step->second <<std::endl;
214 new ((*Region)[
index]) TObjString (
step->first.GetRegionName());
215 new ((*Process)[
index]) TObjString (
step->first.GetProcessName());
std::map< const StepID, unsigned int * > G4StatsMap
bool operator==(const StepID &id) const
G4StepStatistics(const edm::ParameterSet &pSet)
bool operator<(const StepID &id) const
T * make(const Args &...args) const
make new ROOT object
void update(const DDDWorld *)
This routine will be called when the appropriate signal arrives.
StepID(const G4Step *theG4Step)
G4String theG4ProcessName
G4String GetProcessName() const
bool operator>(const StepID &id) const
G4int GetParticlePDGID() const
volatile std::atomic< bool > shutdown_flag false
edm::Service< TFileService > fs
G4String GetRegionName() const