Message: Re: Nested Param Access violation Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Nested Param Access violation 

Forum: Geometry
Re: Question Nested Param Access violation (Youming Yang)
Re: None Re: Nested Param Access violation (John Apostolakis)
Date: 20 Jun, 2012
From: Youming Yang <Youming Yang>

Hello John and thank you very much for your reply,

Fortunately, the error was located completely on the end-user (myself) side 
with respect to my implementation of the parameterization.
I had based my code off of a well-developed voxelization code that used an 
older version of Geant which did not use the GetMaterial function.  I ended 
up writing a ComputeMaterial and GetMaterial that would work together well 
during runtime for finding the constituents of any voxel, but it failed to 
return the correct materials during the physics initialization.
That turned out to be the reason why my material scanner did not pick up a 
majority of the materials that were actually used in the geometry.

My apologies for the confusion this may have caused.  I will update the 
forums accordingly as well C:

Thank you again,
Ming

-----Original Message----- 
From: John Apostolakis
Sent: Wednesday, June 20, 2012 9:00 AM
To: Youming Yang
Cc: geometry-g4hn@slac.stanford.edu
Subject: Re: Nested Param Access violation

Dear Ming,

It is difficult to diagnose the issue you report without further 
information.

In the most recent version of Geant4, in G4Transportation you will find the 
following code.

  if( pNewVol!=0 && pNewMaterialCutsCouple!=0 && 
pNewMaterialCutsCouple->GetMaterial()!=pNewMaterial )
  {
    // for parametrized volume
    //
    pNewMaterialCutsCouple =
      G4ProductionCutsTable::GetProductionCutsTable()
                             ->GetMaterialCutsCouple(pNewMaterial,
                               pNewMaterialCutsCouple->GetProductionCuts());
  }

Can you replace the code above with the following code, and run again.

  if( pNewVol!=0 && pNewMaterialCutsCouple!=0 && 
pNewMaterialCutsCouple->GetMaterial()!=pNewMaterial )
  {
    // for parametrized volume
    //
    pNewMaterialCutsCouple =
      G4ProductionCutsTable::GetProductionCutsTable()
                             ->GetMaterialCutsCouple(pNewMaterial,
                               pNewMaterialCutsCouple->GetProductionCuts());
    G4cout << " G4Transportation:  Obtained Cut Couple ptr=" << 
pNewMaterialCutsCouple << G4endl;
  } else {
    G4cout << " G4Transportation:  Did not request Cut Couple - ptr was = " 
<<  pNewMaterialCutsCouple;
    if ( pNewMaterialCutsCouple )
G4cout << "  Material of couple = " << 
pNewMaterialCutsCouple->GetMaterial()
              << "  previous material = " << pNewMaterial;
    G4cout << G4endl;
  }

This should identify which part of the code was responsible for the current 
value of the pointer.

Best regards,
John
===================================================
John Apostolakis, SFT (SoFTware) Group, PH Department, CERN
Email:  john.apostolakis@cern.ch       Office Tel:  +41-22-767-7239
------------------------------------------------------------------------------------------

On Jun 18, 2012, at 10:52 PM, Youming Yang wrote:

>
> *** Discussion title: Geometry
>
> Hello Geant4 Community,
>
> I am having an issue with particle transport within my Nested Param
> setup. I've tracked it down to the following: I will begin an event, and
> it will dig deeper into my nested volumes, from my planar slice, to my
> bar within the plane, to finally my parameterized voxel. When it hits
> that voxel, it will crash at:
>
> DefineMaterial(track.GetMaterialCutsCouple())
>
> -Track is defined
>
> -It is step 3 (makes sense)
>
> -Track has an XYZ coordinate
>
> -However the GetMaterialCutsCouple() function returns a null pointer 
> 0x00000000, which is then fed into DefineMaterial which crashes.
>
> I am wondering if anyone has experienced this issue before? I read
> something else in another thread regarding the DICOM example (which I
> have used as a framework for mine) that there were too mate MadeIDs or
> something in Geant 4.9.3, could that have something to do with this?
> It's a pretty low-level part of the code that I've traced my issue to,
> so I am not sure what tidbits of code are useful, if anyone is able to
> help please let me know what code to attach!
>
> Thanks in advance, Ming
>
> -------------------------------------------------------------
> Visit this GEANT4 at hypernews.slac.stanford.edu message (to reply or 
> unsubscribe) at:
> http://hypernews.slac.stanford.edu/HyperNews/geant4/get/geometry/1193.html

 Add Message Add Message
to: "Re: Nested Param Access violation"

 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 ]