Message: Re: something wrong in LHEP_PRECO_HP physics list? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: something wrong in LHEP_PRECO_HP physics list? 

Forum: Physics List
Re: Question something wrong in LHEP_PRECO_HP physics list? (John)
Date: 23 Feb, 2006
From: John <azeng78@163.com>

hi, I found that it is the problem in my SteppingAction class. 

Do somebody know what is wrong?

void  SteppingAction::UserSteppingAction(const G4Step* aStep)
{
        G4Track* track= aStep->GetTrack();
	G4int parentId=track->GetParentID();
	G4int nbOfStep=track->GetCurrentStepNumber();
	G4String Name=track->GetDefinition()->GetParticleName();

        ....
        // set radidation weihgting factor
        if(nbOfStep==1)
	{
		if(parentId==0)
		{
			evtAction->SetWeightingFactor(5.0);
			evtAction->SetTypeOfRadiation(0);
		}
		if(parentId==1)//&&lvName.compare("OuterCabin")==0)
		{
			G4String lvName=track->GetLogicalVolumeAtVertex()->GetName();
			////G4cout<<" Logical Volume At Vertex is "<<lvName<<G4endl;
			if(lvName.compare("OuterCabin")==0)
			{  
                          if(Name.compare("proton")==0)
				{
					evtAction->SetWeightingFactor(5.0);
					evtAction->SetTypeOfRadiation(1);
					evtAction->GetSecondaryBin()->AddSecondaryOfEvent(1);
					//G4cout<<" Second proton : "<<track->GetVertexKineticEnergy()/MeV<<G4endl;
					
                                        //---------------------
					//if add the code below,it will be wrong.
					char  spfile[15];
					G4double sppe=evtAction->GetPrimaryEnergy();
					sprintf(spfile,"2ndProton.%f",sppe);
					ofstream sppfile;
					sppfile.open(spfile,ios::app);
					////G4cout<<" atomic name "<<atomicName<<" || process name : "<<createProcess<<G4endl;		
					sppfile<<track->GetVertexKineticEnergy()/MeV<<"\t"
						   <<track->GetCreatorProcess()->GetProcessName()
						   <<G4endl;						
					sppfile.close();
                                        //----------------------
				}
                                ......
                        }
              }
             .....
}

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

 Add Message Add Message
to: "Re: something wrong in LHEP_PRECO_HP physics list?"

 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 ]