| Summary: | I can't have the name of the process generating the step. | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | Sabrina.Bouvet |
| Component: | digits_hits | Assignee: | Makoto.Asai |
| Status: | CLOSED FIXED | ||
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | 1.0 | ||
| Hardware: | Sun | ||
| OS: | Solaris | ||
To: Hans-Peter, It seems the problem is in his sensitive detector code. I will take care. To: Sabrina.Bouvet@med.ge.com Could you please send me your EclipseCalorimeterSD.hh EclipseCalorimeterSD.cc and also EventAction class you implemented? Makoto Asai (SLAC) Run, Event & Detector Responses coordinator Given the "PostStepPoint" represents the end point of the current step, the pointer to the process which limits the current step is kept in "PostStepPoint". aStep->GetPreStepPoint()->GetProcessDefinedStep() should be aStep->GetPostStepPoint()->GetProcessDefinedStep() And, the G4String object "theName" is valid only within your if statement scope and thus you cannot get anything in your PrintAll method. |
I want to have the process which define a step. More precisely, I have a filter and when a particle reach it, I want to know the physics process when it go trough the filter. The program I wrote is : G4bool EclipseCalorimeterSD::ProcessHits(G4Step* aStep,G4TouchableHistory* ROhist) { .... G4TouchableHistory* theTouchable = (G4Touchable*)(aStep->GetPreStepPoint()- >GetTouchable()); G4PhysicalVolume* physVol = theTouchable->GetVolume(); NbPhotoElectric = 0; NbCompton = 0; NbRayleigh = 0; if (physVol==Detector ->GetFilter()) { G4VProcess* theProcess = (G4VProcess*)(aStep->GetPreStepPoint()- >GetProcessDefinedStep()); G4String theName = theProces->GetProcessName(); if ( theName == "phot" || the name == "LowEnPhotoElec") NbPhotoElectric = +1; if ( theName == "LowEnCompton") NbCompton = +1; } and I wrote : void EclipseCalorimeterSD::PrintAll() { .... G4cout << "NbPhotoElectric" << NbPhotoElectric << endl; G4cout << "NbCompton" << NbCompton << endl; G4cout << "theName" << theName; When I compile, there's no problem. But when I execute it, I have no name for "theName". Is it a problem ?