Message: Re: bad alloc Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: bad alloc 

Forum: Hadronic Processes
Re: Question bad alloc (Eduardo Medinaceli)
Re: None Re: bad alloc (Vladimir IVANTCHENKO )
Re: None Re: bad alloc (Eduardo Medinaceli)
Date: 21 Jun, 2007
From: Vladimir IVANTCHENKO <vnivanch@mail.cern.ch>

On Thu, 21 Jun 2007, eduardo wrote:

> *** Discussion title: Hadronic Processes
> Email replies to PublicHyperNews@slac.stanford.edu must include:
>   In-Reply-To: <"/hadronprocess/719/1/1"@geant4-hn.slac.stanford.edu>
>   Subject: ...change this to be about your reply.
> 
> thanks for your unswer
> 
> Now to try to find the error I'm just using the Elastic Scattering
> 
>  void PhysiscsList::ElasticScattering(){
>   theParticleIterator->Reset();
>   while((*theParticleIterator())){
>    G4ParticleDefinition* particle = theParticleIterator->value();
>    G4ProcessManager* pmanager = particle->GetProcessManager();
> 
>    if(particleName == "neutron"){
>      G4UHadronElasticProcess* hadElastProc = new G4UHadronElasticProcess();
>      G4HadronElastic* elasticModel = new G4HadronElastic();
>      hadElastProc->RegisterMe(elasticModel);
>      pmanager->AddDiscreteProcess(hadElastProc); 
> 
>      G4NeutronHPElastic* theElasticNeutron = new G4NeutronHPElastic(); 
>      elasticModel->SetMinEnergy(1*MeV);
>      hadElastProc->RegisterMe(theElasticNeutron);
>      G4NeutronHPElasticData* theNeutronData = G4NeutronHPElasticData();
>      hadElastProc->AddDataSet(theNeutronData);
>      pmanager->AddDiscreteProcess(hasElastProc);
>    }
>   }
> }
> My prymari particle is a neutron of 5*Mev
> 
> The programm has no compiling errors, but when it runs, writtes down the
> information about primaries and then reports an bad alloc error
> 

Hello,

I would strongly recommend to use G4HadronElasticPhysics builder for 
your PHysics Lists. If you prefer to build Physics Lists by yourself, 
please, study this class, which is in the subdirectory:

$G4INSTALL/source/physics_lists/builders

regards,
VI

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

 Add Message Add Message
to: "Re: bad alloc"

 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 ]