Define a meniscus solid

Hi, in my application, I’ve 2 circular targets (i.e. 2 cilinders…) Now I must replace them by 2 meniscus targets … i.e. something like this

20170324102570017001

This is not a shape implemented in the Geant4 solids http://geant4-userdoc.web.cern.ch/geant4-userdoc/UsersGuides/ForApplicationDeveloper/html/Detector/Geometry/geomSolids.html

How can I define it?
Thank you

The meniscus can be defined using Boolean solids. If I understand the drawing correctly it should be something like:

G4Subtraction( G4Intersection(G4Tubs, G4Orb(R1)), G4Orb(R2) )

Thank you @evc

I tried to define de meniscus in this way

image


but I get this error

it says that there isn’t G4Substruction.hh
so what header should I include ?

Sorry, in previous message I’ve just gave an idea how the meniscus can be defined. What has been written can not be used in the code. The code that defines the meniscus should look like the following:

G4RotationMatrix identity; // identity (null) rotation
G4ThreeVector positionMenOrb1(…); // please defined a position of Orb1
G4ThreeVector positionMenOrb2(…); // please defined a position of Orb2
G4VSolid* MenTmp = new G4IntersectionSolid(“MenTmp”, MenTub, MenOrb1, &identity, positionMenOrb1);
G4VSolid* Meniscus = new G4SubtractionSolid(“Meniscus”, MenTmp, MenOrb2, &identity, positionMenOrb2);

Please note that the position of Orb1 and Orb2 should be defined relative to the position of the cylinder MenTub.

Thank you @evc…but unfortunately I still have a similiar problem…

In my detector construction I wrote:
image

but I get this error

but if I also include

image

I get this error


i.e. it doesn’t find G4Substraction.hh and G4Intersection.hh…so what should I include?

Thank you

You should include G4IntersectionSolid.hh and G4SubtractionSolid.hh. The example of the code has been corrected accordingly.

Thank you @evc now I can compile it! I’ve a last problem please…

I setted these values

and I get this visualization
image

you see…they looks like two rings…

Do you think it is just a problem of the values (for example the orbs position and radius etc)? Or something else?

Do you have idea of possible values to set? (Consider that my previus targerts were two cylinders having radius 0.75cm and thicknes 3mm…so the meniscus should have similiar dimensions)…

Yes, I think that it is a problem with the orbs position and radius. With Boolean solids the positioning sometimes is not obvious.

In you case the reference system of the Boolean solids is the reference system of the cylinder. In other words the cylinder is placed in the origin. To have a correct shape of the meniscus you should calculate the position and radius of the orbs.

I would suggest that you first try implement the intersection of the cylinder and the orb number one. After it will look OK, then add the subtraction.

BTW, you can try to draw all three solids separately, just for better understanding the relative positions of the solids.

Yes. You can “/vis/drawLogicalVolume <log-vol-name>” to see components.

thank you the both @evc and @allison I think that I can set these parameters

running the app I get this

Unfortunately, i can’t see in a good way because (As you cas see by the print screen) Geant4 open the visualization by using OpenGL and it is a very small picture and I can’t rotate it.
I have Qt Creator, but how can I open the visualization by Qt to see it better?

This is my vis.mac
vis.txt (4.0 KB)

When you compile Geant4 specify that it should be compiled together with Qt, for example:
-DCMAKE_PREFIX_PATH=/usr/local/Qt/5.5/clang_64

Relative to the parameters of the cylinder and orbs, the picture below gives an idea on their values.

Thank you @evc regarding of the meniscus parameters, tomorrow I will try to set them according to your paint.

Regarding of QT I tried to build Geant4 again so I wrote

cmake -DCMAKE_INSTALL_PREFIX="C:\Program Files\geant4_10_06-install" "C:\Program Files\geant4_10_06" -DCMAKE_PREFIX_PATH="C:\Qt\5.15.0\winrt_x64_msvc2019"

and it said

GEANT4_USE_QT: Build Geant4 with Qt support

but when I run the simulation it still open it by OpenGl (indeed, when I run it …Geant 4 just write it found opengl

I don’t know if it could depend on some warning (or erro that I see during the Geant4 building after I do the commands
cmake --build . --config Release
and
cmake --build . --config Release --target install
)

here the log

log.txt (643.4 KB)

but even if see these errors Geant4 looks like working but it still use opengl instead of Qt…
Should I write any command to open by QT?
Thank you

I am not an expert in MS Windows and it is difficult for me to figure out what went wrong when compiling Geant4 with Qt. Try to ask for assistance at the Getting Started category or at the Recording, Visualizing and Persisting Data category. There was already topics on that subject:

Thank you @evc I read the topic that you linked but it doesn’t look like my same problem…So I will try to open a new topic in Getting Start!
Thank you for your help !

Sorry @allison how should I use this command?

This is my Boolean solid definition

 G4double pi = 3.14159265358979323846;
  G4double pRMin = 0., pRMax = 0.75*cm, pDz = 1.5*mm, pSPhi = 0., pDPhi = 2*pi;
G4double pMenRmax1 = 0.75*cm, pMenRmax2 = 0.74*cm;
    G4Orb* MenOrb1 =    new G4Orb("MenOrb1", pMenRmax1);
    G4Orb* MenOrb2 =    new G4Orb("MenOrb2", pMenRmax2);
    G4Tubs* MenTub =    
    new G4Tubs("MenTube",                    //its name
        pRMin, pRMax, pDz, pSPhi, pDPhi);    //its size*/
    G4RotationMatrix identity;
	G4ThreeVector positionMenOrb1(0,0,0.65*cm);
	G4ThreeVector positionMenOrb2(0,0,0.8*cm);
	G4VSolid* MenTmp = new G4IntersectionSolid("MenTmp", MenTub, MenOrb1, &identity, positionMenOrb1);
	G4VSolid* Meniscus = new G4SubtractionSolid("Meniscus", MenTmp, MenOrb2, &identity, positionMenOrb2);
G4LogicalVolume* logicEnv =                         
    new G4LogicalVolume(Meniscus,            //its solid    //solidEnv
                        env_mat,             //its material
                        "Meniscus");         //its name
                        
    G4LogicalVolume* logicEnv2 =                         
    new G4LogicalVolume(Meniscus,            //its solid   //solidEvn2
                        env_mat,             //its material
                        "Meniscus2");         //its name
                   
  new G4PVPlacement(0,                       //no rotation
                    G4ThreeVector(),         //at (0,0,0)
                    logicEnv,                //its logical volume
                    "Meniscus",              //its name                               //Envelope
                    logicWorld,              //its mother  volume
                    false,                   //no boolean operation
                    0,                       //copy number
                    checkOverlaps);          //overlaps checking
                    
 new G4PVPlacement(0,                       //no rotation
                    G4ThreeVector(0,0,2.3*cm),         //at (0,0,2.15) 2.15= 0.15*cm+2*cm
                    logicEnv2,                //its logical volume
                    "Meniscus",              //its name                      //Envelope2
                    logicWorld,              //its mother  volume
                    false,                   //no boolean operation
                    0,                       //copy number
                    checkOverlaps);          //overlaps checking

but if I write in the vis.mac the command
/vis/drawLogicalVolume logicEnv
/vis/drawLogicalVolume logicEnv2

I get this error


and a similiar one for the loginEnv2

Your logical volume name is “Meniscus”.

Thank you @allison it worked

Sorry @evc I tried to follow your layout. Then I setted

 G4double pMenRmax1 = 1.85*cm, pMenRmax2 = 1.2*cm;
G4Orb* MenOrb1 =    new G4Orb("MenOrb1", pMenRmax1);
G4Orb* MenOrb2 =    new G4Orb("MenOrb2", pMenRmax2);
G4Tubs* MenTub =    
new G4Tubs("MenTube",                    //its name
    pRMin, pRMax, pDz, pSPhi, pDPhi);    //its size*/
G4RotationMatrix identity;
G4ThreeVector positionMenOrb1(0,0,1.7*cm);
G4ThreeVector positionMenOrb2(0,0,1.1*cm);
G4VSolid* MenTmp = new G4IntersectionSolid("MenTmp", MenTub, MenOrb1, &identity, positionMenOrb1);
	G4VSolid* Meniscus = new G4SubtractionSolid("Meniscus", MenTmp, MenOrb2, &identity, positionMenOrb2);

Here the visualization of the three solids by using the command tha @allison wrote me

And here the targets


Do you think that it is a good choise of the parameters, or should I change them?

Moreover, is there a way to write the dimension of the thickness?
I would like to get in the center a thickness 3mm …but I think it is lower
Thank you

G4double z1 = positionMenOrb1.z() - pMenRmax1;
G4double z2 = positionMenOrb2.z() - pMenRmax2;
G4double thickness = z2 - z1;

In your case thickness = (11 - 12) - (17 - 18.5) = 0.5 mm

Hi @evc , thank you !!!