Message: Re: getting zero cross section Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: getting zero cross section 

Forum: Hadronic Processes
Re: Question getting zero cross section (Summit)
Re: Idea Re: getting zero cross section (Vladimir Ivanchenko)
Date: 08 Jul, 2011
From: Summit <Summit>

Hello

Thanks for reply I have seen that example.

I have included in runaction.cc.

void RunAction::EndOfRunAction(const G4Run* aRun)
{
  G4int NbofEvents = aRun->GetNumberOfEvent();
  if (NbofEvents == 0) return;

  //run conditions
  //  
  G4Material* material = detector->GetAbsorMaterial();
  G4double density = material->GetDensity();

  G4String particle = kinematic->GetParticleGun()->GetParticleDefinition()
                      ->GetParticleName();    

  G4double energy = kinematic->GetParticleGun()->GetParticleEnergy();
  G4cout << "\n The run consists of " << NbofEvents << " "<< particle << " of "
         << G4BestUnit(energy,"Energy") << " through " 
	 << G4BestUnit(detector->GetAbsorSizeX(),"Length") << " of "
	 << material->GetName() << " (density: " 
	 << G4BestUnit(density,"Volumic Mass") << ")" << G4endl;
//***************************************************************************
G4HadronicProcessStore* store = G4HadronicProcessStore::Instance();
G4double ener, cs; 
ener=100*MeV;
const G4ParticleDefinition* particle_name = 
    G4ParticleTable::GetParticleTable()->FindParticle(particle);
G4cout<<"........................................................................\n";
G4cout<<std::setw(5) << "N" << std::setw(18)<<"Energy(MeV)"<<std::setw(18)<<"Cross section"<<"\n";
G4cout<<"........................................................................\n";
//****************************************************************************
for(int i=1; i<=500; i++)
{ 
	G4cout << std::setw(5) << i << std::setw(18) << ener;  
    	cs = store->GetInelasticCrossSectionPerVolume(particle_name,ener,material);
	G4cout<<std::setw(18)<<cs<<"\n";
	ener+=100*MeV;
}

  edeptot /= NbofEvents; 
  G4cout << " Total energy deposit= "<< G4BestUnit(edeptot,"Energy")
         << G4endl;

  //print dose in tallies
  //
  G4int tallyNumber = detector->GetTallyNumber();
  if (tallyNumber > 0) {
    G4double tallyMass = detector->GetTallyMass();
    G4double Ebeam = kinematic->GetEbeamCumul();
    G4cout << "\n---------------------------------------------------------\n";
    G4cout << " Cumulated Doses : \tEdep      \tEdep/Ebeam \tDose" << G4endl;
    for (G4int j=0; j<tallyNumber; j++) {
      G4double Edep = tallyEdep[j], ratio = 100*Edep/Ebeam;
      G4double Dose = Edep/tallyMass;
      G4cout << " tally " << j << ": \t \t"
             << G4BestUnit(Edep,"Energy") << "\t"
	     << ratio << " % \t"
	     << G4BestUnit(Dose,"Dose")   << G4endl;
    }
    G4cout << "\n---------------------------------------------------------\n";
    G4cout << G4endl; 
  }

  // show Rndm status
  CLHEP::HepRandom::showEngineStatus();
}

still I am getting zero cross section. Any suggestions ???

Thanks in advance, Summit

 Add Message Add Message
to: "Re: getting zero cross section"

 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 ]