Problem 272 - I can't have the name of the process generating the step.
Summary: I can't have the name of the process generating the step.
Status: CLOSED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: digits_hits (show other problems)
Version: 1.0
Hardware: Sun Solaris
: P2 normal
Assignee: Makoto.Asai
URL:
Depends on:
Blocks:
 
Reported: 2001-07-06 07:10 CEST by Sabrina.Bouvet
Modified: 2012-02-15 05:27 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Sabrina.Bouvet 2001-07-06 07:10:03 CEST
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 ?
Comment 1 Makoto.Asai 2001-07-08 17:23:59 CEST
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
Comment 2 Makoto.Asai 2001-07-24 21:37:59 CEST
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.