1 #ifndef HelpfulWatchers_G4StepStatistics_h
2 #define HelpfulWatchers_G4StepStatistics_h
30 #include "G4VProcess.hh"
31 #include "G4ParticleDefinition.hh"
41 #include <TClonesArray.h>
76 if (theG4Step->GetPreStepPoint()->GetPhysicalVolume()) {
77 theG4RegionName = theG4Step->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetRegion()->GetName();
80 if (theG4Step->GetPreStepPoint()->GetProcessDefinedStep()){
81 theG4ProcessName = theG4Step->GetPreStepPoint()->GetProcessDefinedStep()->GetProcessName();
129 #define OBSERVES(type) public Observer<const type*>
130 #define UPDATE(type) void update(const type*) { std::cout <<"++ signal " #type<<std::endl; }
151 Region =
new TClonesArray(
"TObjString",100000);
153 Process =
new TClonesArray(
"TObjString",100000);
174 unsigned int* MyValue =
new unsigned int(1);
176 G4StatsMap.insert(std::make_pair(mysteptest, MyValue));
200 std::cout <<
"++ signal EndOfEvent " <<std::endl;
210 std::cout <<
" G4StatsMap step is: "<<
step->first.GetRegionName()<<
" "<<
step->first.GetProcessName()<<
" "<<
step->first.GetParticlePDGID();
211 std::cout <<
" Number of such steps: "<< *
step->second <<std::endl;
215 new ((*Region)[
index]) TObjString (
step->first.GetRegionName());
216 new ((*Process)[
index]) TObjString (
step->first.GetProcessName());
void update(const G4Step *iStep)
std::map< const StepID, unsigned int * > G4StatsMap
bool operator==(const StepID &id) const
G4StepStatistics(const edm::ParameterSet &pSet)
bool operator<(const StepID &id) const
StepID(const G4Step *theG4Step)
G4String theG4ProcessName
G4String GetProcessName() const
bool operator>(const StepID &id) const
G4int GetParticlePDGID() const
T * make() const
make new ROOT object
edm::Service< TFileService > fs
G4String GetRegionName() const