Hi Experts,
I want to make a geometry in that…
first i want to create a sphere of some radius and then one another sphere filled with different material just outside the sphere 1 of some thickness…and then one another sphere of some thickness filled with different material.
and for this i have done like this…
sphere 1 = Rmin= 0cm and Rmax = acm, material = air
sphere 2= Rmin = acm, Rmax = bcm , material = water
similarly for sphere 3 = Rmin= bcm , Rmax = ccm , and material = Al
then in this my doubt is will this material fill in the radius range only like if i am filling water in second sphere then it should only fill in the range of Rmin = acm & Rmax = bcm . (this i want) it should not be filled outside or inside the sphere (as outside and inside , there are other spheres of different materials so i want this only int this range as a thickness).
but i am not sure i have done right or not , how can i verify this ? also i am attaching the geometry i have created only for two spheres, will do more if my doubt is cleared.
any type of help will be appreciated.
Thanks in advance!
Priyanshu
I don’t see why your approach should not work, doesn’t the image look like what you describe? The volumes do not overlap if you have Rmax of one sphere equal to Rmin of the next… material is only specified for the volume within the sphere shell, so all good!
Otherwise you could have all spheres with Rmin = 0, and the place the largest sphere1 into the world, and then the next sphere2 into sphere1, and so on - with decreasing Rmax values.
you could verify that the shells are correct for example with a cutawayplane: see help /vis/viewer/set/cutawayPlane
or you attach scorers to the different volumes and obtain doses/volume fluxes/… and check if they are reasonable
means it will not fill the shell inside. actually i was not sure because i was just imaging a hollow ball (like a spherical shell with less thickness) , in this material will be in only shell part not inside but what will be there in this case ?
If you’re working interactively, help at the G4 prompt will get you a simple interface to navigate the command documentations. Go to the /vis section and keep navigating down. The specific command is /vis/geometry/set/colour but there’s a bunch of useful stuff in /vis/geometry/set/*.
You can also set the colors in your C++ code (we do that with our experiment simulation, to make sure everyone’s visualization is consistent and recognizable). See the G4LogicalVolume.hh header file to see how to set visualization attributes like color, transparency, wireframe, etc.
or interactively in the scene tree, there should
be a hierarchical list of all volumes. figure out how to click onto them the right way, I don’t know by heart
just make sure they look different…. you could also hide them in the scene tree with a single mouse click, geant4 is really powerful
inline void SetVisAttributes (const G4VisAttributes* pVA);
void SetVisAttributes (const G4VisAttributes& VA);
// Gets and sets visualization attributes. A copy of 'VA' on the heap
// will be made in the case the call with a const reference is used.
In your code, you can call it directly, for instance with
myLV->SetVisAttributes(G4Colour(0.8,0.,0.3));
(G4VisAttributes has an implicit cast constructor from G4Colour).
as you write this command , myLV is name of my logical volume, if i understood right ?
and this is my code in this, my logical volume name is logicEnv
see the attached code SS.
Look at the sequence of lines (including the one you commented out). C++ code is sequential: you cannot use a variable in the code before you have defined it.
Hi,
sorry for coming back to this question.
but when i am doing this, i am getting overlapping error ? so how can i resolve this problem ?
what will it affect ?
is there any problem with this warning ?
and is it something wrong when i run my application with this overlapping warning ?
i think , the geometry i am creating will give this warning because in my geometry , spheres are made for shielding that should be overlapped with one sphere to another like a sphere then inside this one another sphere and one more sphere inside the second sphere.
or is it the right way to create spheres like this ?
or should i create them in a different way. can you please suggest me .