Message: Re: Processing order Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

More Re: Processing order 

Forum: Event and Track Management
Re: Question Processing order (C Mos)
Re: Feedback Re: Processing order (Gumplinger Peter)
Re: Question Re: Processing order (C Mos)
Date: 04 Nov, 2012
From: C Mos <C Mos>

Hi

One more thing about secondary particles... Sorry to ask too many questions but I found this really helpful. I am doing the following:

  void APIdrdcTrackingAction::PostUserTrackingAction(const G4Track* aTrack)
  {
  G4TrackVector* secondaries = fpTrackingManager->GimmeSecondaries();
  if(secondaries)
  {
  //___________________________________________________________________________
    //FIRST CASE: CHECK IF ORIGINATOR OF THIS ROUND OF SECONDARIES WAS A NEUTRON.
    //TO THESE ASSIGN INFO FROM PARENT NEUTRON aka. INFO ABOUT THEIR ORIGINATOR 

    if(aTrack->GetDefinition()==G4Neutron::Definition()){
      APIdrdcTrackInformation* info =new APIdrdcTrackInformation(aTrack);
      size_t nSeco = secondaries->size();
      if(nSeco>0){
	for(size_t i=0;i<nSeco;i++){	  
	  //THIS NEXT could be REDUNDANT since all secondaries have info=0 and 
	  //elastic scattered neutrons do not get added to the secondary list
	  if((*secondaries)[i]->GetUserInformation()==0){ 

	    APIdrdcTrackInformation* infoNew = new   APIdrdcTrackInformation(info);
	    (*secondaries)[i]->SetUserInformation(infoNew);	  
            //QUESTION 1) The following G4cout is legal as to accessing secondaries' information?
            const G4VProcess* process = (*secondaries)[i]->GetCreatorProcess();
            G4ThreeVector *pos = (*secondaries)[i]->GetPosition();
            G4cout << "Position: " << G4BestUnit(pos, "length") << G4endl;
            G4cout << "Creator:  " << process->GetProcessName() << G4endl;
	  }
	}
      }
     }//END FIRST CASE
    }
  }

In the specific case of inelastic scattering where neutron scatters from carbon-12, the originator (parent neutron) disappears and the list of secondaries would have a new neutron and a excited recoiled carbon-12 (?). Then for the parent neutron's PostUserTrackingAction() processing would print:

  Position:  x  y  z   (Some pos in my geometry)
  Creator:   Inelastic

QUESTION 2: One last thing, is the PostUserTrackingAction() executed at the end of the particle's life? (in the case of inelastic scattering for neutrons, before the neutron is killed so to produce the secondaries -> a neutron and a C12[0.0]* ?

Thank you,

Chris

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Feedback: Re: Processing order   (Gumplinger Peter - 05 Nov, 2012)
 Add Message Add Message
to: "Re: Processing order"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]