Message: Re: Cross Section problem Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Cross Section problem  

Forum: Hadronic Processes
Re: None Cross Section problem (yuchun zhang)
Date: 25 Dec, 2007
From: Vladimir IVANTCHENKO <>

On Tue, 25 Dec 2007, yuchun zhang wrote:

> *** Discussion title: Hadronic Processes
> Email replies to must include:
>   In-Reply-To: <"/hadronprocess/863">
>   Subject: ...change this to be about your reply.
> Hello,I am a novice at geant 4.,I simulate Gamma(2GEV) interaction with
> a target(C) in order to get pion using G4.9.0.and the very important
> things that I also want to get is the CrossSection information of this
> process! So I wrote the code as follows:
> #include "G4Material.hh"
> #include "G4CrossSectionDataStore.hh"
> #include "G4DynamicParticle.hh"
> #include "G4Gamma.hh"
> #include "G4ParticleTable.hh"
> G4double a, z;
> G4double density;
> G4Material* Al = new G4Material("Aliumn",z=13.,a=26.98*g/mole,density=2.702*g/cm3);
> G4CrossSectionDataStore *pcs=new G4CrossSectionDataStore;
> G4PhotoNuclearCrossSection*pcs_pn=new PhotoNuclearCrossSection(); pcs->AddDataSet(pcs_pn);
> G4ThreeVector aMomentumDirection = G4ThreeVector(0,0,-1*m);
> G4double aKineticEnergy=200*MeV ;
> G4DynamicParticle*pgamma=new 4DynamicParticle(G4Gamma::GammaDefinition(),aMomentumDirection,aKineticEnergy);
> G4cout<<"*******************************************************\n";
> while(aKineticEnergy <=1805) 
> {
>   aKineticEnergy += 10*MeV;
>   pgamma->SetKineticEnergy(aKineticEnergy);
>   G4cout<<aKineticEnergy<<"\t"<<(pcs->GetCrossSection(pgamma,Al))<<G4endl;
> }
> Indeed I got the the information of Cross Section.however I found it did
> not depended on G4ThreeVector(it may be use to control the degree of gun
> particle ). That is to say the Cross Section is constant . so I think
> this method may be wrong. Please could someone tell me exactly what the
> correct code is or how to solve it? thank you in advance.
> I would appreciate any help.... Best regards!!


Some comments:

a) you need to use the interface:
   G4double GetCrossSection(const G4DynamicParticle*,
                            const G4Element*)

so you need G4Element, not G4Material

b) you do not need create data_set, creat directly  

G4PhotoNuclearCrossSection pncs; 

c) momentum direction is wrongly defimed - it is not normalized to unit:
G4ThreeVector aMomentumDirection = G4ThreeVector(0,0,1);

the result must not depend on that, however, better to use a correct 

d) Printout also not optimal: we would suggest to have
G4cout<<"E(MeV)= " << aKineticEnergy/MeV<<"   Xsec(bn)= "


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

1 None: Re: Cross Section problem   (yuchun zhang - 25 Dec, 2007)
3 None: Re: Cross Section problem   (yuchun zhang - 25 Dec, 2007)
1 None: Re: Cross Section problem   (Vladimir IVANTCHENKO - 27 Dec, 2007)
 Add Message Add Message
to: "Re: Cross Section problem "

 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 ]