Message: Re: How to multiply the flux by a specific cross section ? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: How to multiply the flux by a specific cross section ? 

Forum: Biasing and Scoring
Re: Question How to multiply the flux by a specific cross section ? (sylvian kahane)
Date: 08 Feb, 2012
From: Pedro Arce <Pedro Arce>

Hi Sylvian,

Obtaning the inelastic cross sections is not a trivial thing. I can pass you a code I modified from another I used, I think it should work as I am giving it to you:

  G4ProcessManager* pmanager = G4Neutron::Neutron()->GetProcessManager();

  G4ProcessVector* pvect = pmanager->GetProcessList();
  int jj, sizproc = pvect->size();
  for( jj = 0; jj < sizproc; jj++ ) {
    G4VProcess* proc = (*pvect)[jj];
    if( proc->GetProcessType() != fHadronic ) continue;
    G4HadronicProcess* hadProc = dynamic_cast<G4HadronicProcess*>(proc);

      if( hadProc->GetProcessName() == "NeutronInelastic" ) {
   	  //--- loop to elements 
	  G4double XSSUM = 0;
	  for (size_t iele=0; iele<nelm; iele++) { 
	    G4Element* elem = (*elementVector)[iele];
	    G4int index = elem->GetIndex();

	    G4HadronicInteraction* hadInteraction = hadProc->ChooseHadronicInteraction(ener, material, elem );
	    G4NeutronHPInelastic* HPinelas = (G4NeutronHPInelastic*)(hadInteraction);

	    G4NeutronHPChannel ** HPChannels =  HPinelas->theInelastic[index].theChannels;

	    G4int nChannels = HPinelas->theInelastic[index].nChannels;
	    for(G4int ic=0; ic<nChannels; ic++) {  // one per isotope
 // You can check if it is the isotope that of interest by looking at FS->theBaseZ, FS->theBaseA
	      G4NeutronHPChannel* HPChannel = HPChannels[ic];

	      G4int numberOfIsos = HPChannel->GetNiso(); // all channels have the same number of isotopes
	      for( G4int ii = 0; ii < numberOfIsos; ii++ ) {
		  G4NeutronHPFinalState * FS = HPChannel->theFinalStates[ii];

		if( HPChannel->HasFSData(ii) ) {// one channel per isotope , one final state per isotope
		  G4double FSXS = HPChannel->GetFSCrossSection(ener, ii);

		    G4cout << "@@GAMOS SHPrintHadronicXSBRUA " << material->GetName() 
			   << " " << ener << " MeV" 
			   << " " << hadProc->GetProcessName() 
			   << " CHANNEL= " << HPChannel->theFSType << " " << GetChannelName(int(FS->theBaseZ), int(FS->theBaseA), HPChannel->theFSType.substr(0,3), "n" )
			   << " XS(micro)= " << FSXS << " barn" 
			   << G4endl;

		}

	      } // numberOfIsos 
	    } // numberOfChannels
	  }

	}
     }

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

1 None: Re: How to multiply the flux by a specific cross section ?   (sylvian kahane - 09 Feb, 2012)
(_ Feedback: Re: How to multiply the flux by a specific cross section ?   (Pedro Arce - 09 Feb, 2012)
(_ None: Re: How to multiply the flux by a specific cross section ?   (sylvian kahane - 10 Feb, 2012)
(_ None: Re: How to multiply the flux by a specific cross section ?   (Pedro Arce - 10 Feb, 2012)
 Add Message Add Message
to: "Re: How to multiply the flux by a specific cross section ?"

 Subscribe Subscribe

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