optical properties #93
Replies: 33 comments 81 replies
-
Thanks for reaching out, Currently optical properties is not supported, interested in adding support. I see https://geant4-forum.web.cern.ch/t/define-optical-properties-of-materials-in-gdml-files/1822 and this points to a G01 file that has the following definitions is solids
And
Do you know where I could find the full description of the options available? Would I be correct in that skinsurface applies to all surfaces of volume Detector? Unclear to me what a bordersurface is
Would the border surface be the y, z plane ? |
Beta Was this translation helpful? Give feedback.
-
(Ignoring bordersurface for now) Okay I have pushed a branch called Optical, it parses(imports) the G01 example, setting up the related optical values Not sure if I have the correct types, like for some I have assumed to be enumeration with just values as per the example. Next stage will to support export and then allocation of surface to volume, finally creation of values via Gui Do you have any sample GDML with optical properties you could test if they import okay with this branch. |
Beta Was this translation helpful? Give feedback.
-
Thank you very much. It would be great to have the optical examples in geant4 (OpNovice and OpNovice2: https://gitlab.cern.ch/geant4/geant4/-/tree/master/examples/extended/optical), I think those examples cover many of optical properties.. there is a sample GDML file in OpNovice |
Beta Was this translation helpful? Give feedback.
-
Not sure which OS you are using but to pick up the changes you need to switch to the branch Optical. If you go to the GDML directory in ...FreeCAD/Mod/GDML and run git. i.e. git status. To fetch the branch you should be able to do something like git fetch origin Optical, git checkout Optical. The Addon_Manager tool in FreeCAD 0.20 has the ability to switch branches, but when I tried the latest Release Candidate there were some regressions, due I think to Python 3.9. The current code will import, there is not any facility yet to create new definitions from scratch, so I would create the optical definitions in an XML file that can be imported i.e. on top of any existing definitions. You should be able to change things via the GUI. |
Beta Was this translation helpful? Give feedback.
-
Okay with latest version of Optical branch, Parts created by commands or icons should now have skinSurface property which can be changed. |
Beta Was this translation helpful? Give feedback.
-
"Is there any way that Freecad recognize the surfaces from a geometry that was created in part? like can we get six surfaces defined when we have a box?" Not easily, what I am working on at the moment is for bordersurface determine a common face, create a new GDML object, like GDMLBorderSurface, which has details and exports as bordersurface. Then plan is to offer an icon|command border surface that lets you select two GDMLObjects that it performs a common face for etc. At the moment finding a common face is quite complex for some shapes and I have to debug things, see post in FreeCAD forum https://forum.freecadweb.org/viewtopic.php?f=22&t=69382 Anyway enough developing for one day, maybe tomorrow. When you say created in part? do you mean Part or PartDesign |
Beta Was this translation helpful? Give feedback.
-
Okay latest version has updated enumeration for Surface Finish.~ FreeCAD 0.20 supported more sophisticated enumerations so this should be revisited and improved when it is finally released. Let me know if you get/see any problems |
Beta Was this translation helpful? Give feedback.
-
The code for setting Skin Surface currently assumes that Opticals is at the base level, I will look to change. |
Beta Was this translation helpful? Give feedback.
-
One note about the surface properties between two media, I think there should be a way to activate and deactivate the surface properties while material properties always needed for optical simulations, here is a quote from geant4 documents: |
Beta Was this translation helpful? Give feedback.
-
Hi, I just wonder if there has been any success in adding bordersurface properties to the GDML file. Thank you for your support |
Beta Was this translation helpful? Give feedback.
-
Okay you may want to try a new branch borderSurfaceIcon. It adds another icon ( currently just an X) If you select, one surface and two parts and then click on it, it will create a GDMLbordersurface definition at the base Document level. Minimum checking of subsequently exported GDML. If you think this is useful despite the lack of checking common face, then I will add support for importing existing GDML files with bordersurface definitions. By the way when looking at the files you have suggested, I find the cycle facility (first icon) useful, the cycle being between solid, wireframe hidden |
Beta Was this translation helpful? Give feedback.
-
Okay - there is now another new branch - bordersurfaceIconCF It has some code to try and find a common face i.e. Distance between centre of mass of faces is zero. If it does not find a common face it prompts with a dialog that allows you to override or cancel |
Beta Was this translation helpful? Give feedback.
-
Question on gdml file simpleLarTPC.gdml The box is 1000 x 1000 x 2000 So given origin at 0,0,0 the box coordinates on x axis are -500, 500 Now the various positions of the tubes are x = 475 So how can tubes and box have a bordersurface when they don't touch, have a common face? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hi Keith, I came up with an issue regarding the bordersurface definitions, it appears that "set border surface" does not work properly. I put the example here that I'm working on right now, I try to define ScintWrap between every Obj# and Det# that are defined, I'm just not able to select those objects to assign them neither using the icon nor just copying ScintWrap# and trying to change it... I would appreciate if you can take a look ... Thank you! |
Beta Was this translation helpful? Give feedback.
-
Hi Keith,
I will try to look at these issues after I get caught up on things;
being away for almost a month sets you back quite a bit! Congratulations
on the Masters degree! Enjoy time with the famiy.
Munther
…On 7/8/22 07:24, Keith Sloan wrote:
Hi @mhindi2 <https://github.com/mhindi2>,
Hope you had a good trip to Europe visiting family etc.
Sorry for landing you with this on your return
I am away this coming week and Masters graduation and visiting Friends
and Family the following week, so wondering if you can look at this
problem.
I am not seeing any unknown floating variable error ( FreeCAD 0.20 and
branch Main )
However I am seeing a number of errors on trying to load the exported
created GDML.
load_gdml.txt
<https://github.com/KeithSloan/GDML/files/9072749/load_gdml.txt>
Specifically
|G4GDML: VALIDATION ERROR! ID value 'Obj007' is not unique at line: 87
G4GDML: VALIDATION ERROR! ID value 'Obj006' is not unique at line: 102
G4GDML: VALIDATION ERROR! ID value 'Obj005' is not unique at line: 117
G4GDML: VALIDATION ERROR! ID value 'Obj004' is not unique at line: 132
G4GDML: VALIDATION ERROR! ID value 'Obj003' is not unique at line: 147
G4GDML: VALIDATION ERROR! ID value 'Obj002' is not unique at line: 162
G4GDML: VALIDATION ERROR! ID value 'Obj001' is not unique at line: 177
G4GDML: VALIDATION ERROR! ID value 'Obj' is not unique at line: 192
G4GDML: VALIDATION ERROR! element 'physvol' is not allowed for content
model
'(materialref,solidref,(physvol+|divisionvol|replicavol|paramvol),loop*,auxiliary*)'
at line: 245 G4GDML: VALIDATION ERROR! ID value 'skinNone' is not
unique at line: 249 G4GDML: VALIDATION ERROR! ID value 'skinNone' is
not unique at line: 252 G4GDML: VALIDATION ERROR! ID value 'skinNone'
is not unique at line: 255 G4GDML: VALIDATION ERROR! ID value
'skinNone' is not unique at line: 258 G4GDML: VALIDATION ERROR! ID
value 'skinNone' is not unique at line: 261 G4GDML: VALIDATION ERROR!
ID value 'skinNone' is not unique at line: 264 G4GDML: VALIDATION
ERROR! ID value 'skinNone' is not unique at line: 267 G4GDML:
VALIDATION ERROR! ID attribute 'G4_CESIUM_IODIDE' is referenced but
was never declared at line: 278 G4GDML: VALIDATION ERROR! ID attribute
'G4_AIR' is referenced but was never declared at line: 278 G4GDML:
VALIDATION ERROR! ID attribute 'G4_SILICON_DIOXIDE' is referenced but
was never declared at line: 278 G4GDML: VALIDATION ERROR! ID attribute
'None' is referenced but was never declared at line: 278 |
Not sure why my Geant4 installation is not finding G4_CESIUM_IODIDE,
G4_AIR, G4_SILICON_DIOXIDE.
It also goes on to Barf at a number of overlapping volumes.
Thanks
—
Reply to this email directly, view it on GitHub
<#93 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWV3NCBDKMJJYJMREN3NPIDVTA2ZHANCNFSM5YLCMEYA>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi Ami,
I have not had a chance yet to look at the full thread between you and
Keith. Is it possible to send me the FreeCAD file that is giving you
problems with arrays? At the time I developed arrays there was no
problem in duplicate names, so I would like to test your file against
the branch that I have. However, the branch I have does not contain
Keith's developments on optical surfaces, so if it is possible to have
something that gives problems with arrays without optical surfaces, I'd
like to have that, so I am not dealing with two developments
simultaneously (optical surfaces and arrays).
Thanks,
Munther
…On 7/8/22 22:13, amihashemi wrote:
Hi Munther,
Thanks very much for the suggestion, I think the problem in my case is
not exactly properties but the array of detectors that are located on
top of the crystals. Beside the array of detector, optical properties
definition for Freecad/GDML works based on the few cases that I tried.
The problem here is the detector array which can not be exported to
GDML and that sort of difficult to manually change in the GDML file or
.cc code...
Thanks for your help!
Ami
—
Reply to this email directly, view it on GitHub
<#93 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWV3NCETVGJFYCLZVHFH42LVTEDABANCNFSM5YLCMEYA>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
OK, I am seeing the 'float' object has no attribute 'x' error on export.
I will try to look at that. This is with my latest version, not Kieth's
Main. BTW, I am not sure who this reply is going to? Can I have private
addresses instead of the github ones please?
Munther
…On 7/8/22 22:13, amihashemi wrote:
Hi Munther,
Thanks very much for the suggestion, I think the problem in my case is
not exactly properties but the array of detectors that are located on
top of the crystals. Beside the array of detector, optical properties
definition for Freecad/GDML works based on the few cases that I tried.
The problem here is the detector array which can not be exported to
GDML and that sort of difficult to manually change in the GDML file or
.cc code...
Thanks for your help! Ami
— Reply to this email directly, view it on GitHub
<#93 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWV3NCETVGJFYCLZVHFH42LVTEDABANCNFSM5YLCMEYA>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi Keith and Munther, I've been working with the array functions in a last couple of days, and applied it to many different structures and problems. It works primarily well with Geant4 application except the renaming of the objects (I found that the rename of the object, detector or scintillator would not appear in the ScintWrap even when the bordersurface is defined by selection of renamed objects), this is a small bug but I thought worth reporting here. The bigger issue that I encounter is that the multiunion structure does not universally working in Geant4- and it appears that the multiUnion as a way of defining the structure has not been fully functional in all aspect of Geant4 particularly in new development regarding the optical simulation-- so I just wonder if I can change the array function definition in FreeCAD/GDML to a series of structural boxes and units rather than multiUnion definition, for e.g. if I have a panel array of 2*2 where the copy object is a box, then the output includes 4 box definition with transferred data points. I just wonder if this change is possible with the current GDML version where the output of the array function from GDML dump the series of copied/rotated objects. Thank you very much! Kind regards, |
Beta Was this translation helpful? Give feedback.
-
Hi Ami,
Could you please provide an example file illustrating the renaming
problem, or else a screenshot showing the problem.
Again, for the multiUnion, could you provide an example where it does
not work. Is this a FreeCAD/GDML Workbench problem or a Geant4 problem?
If it is the latter then this should be reported on the Geant4 forum. I
suppose we could in principle offer a preference setting that allows the
export of an array as separate volumes. I think, but I don't know for
sure, that Geant simulations with multiUnions run faster than the
equivalent simulations with individual placements, so I would hesitate
to change the export universally to be individual placements.
Thanks,
Munther
…On 7/27/22 11:56, amihashemi wrote:
Hi Keith and Munther,
I've been working with the array functions in last a couple of days,
and applied it to many different structure and problems. It works
primarily well with Geant4 application except the renaming of the
objects (I found that the rename of the object, detector or
scintillator would not appear in the ScintWrap even when the
bordersurface is defined by selection of renamed objects), this is a
small bug but I thought worth reporting here.
The bigger issue that I encounter is that the multiunion structure
does not universally working in Geant4- and it appears that the
multiUnion as a way of defining the structure has not been fully
functional in all aspect of Geant4 particularly in new development
regarding the optical simulation-- so I just wonder if I can change
the array function definition in FreeCAD/GDML to a series of
structural boxes and units rather than multiUnion definition, for e.g.
if I have a panel array of 2*2 where the copy object is a box, then
the output includes 4 box definition with transferred data points. I
just wonder if a change like that is possible with the current GDML
version where the output of the array function from GDML dump the
series of copied/rotated objects.
Thank you very much!
Kind regards,
Ami
—
Reply to this email directly, view it on GitHub
<#93 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWV3NCHD4EYGWG4UVHUOPO3VWGA5LANCNFSM5YLCMEYA>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
"I found that the rename of the object, detector or scintillator would not appear in the ScintWrap even when the bordersurface is defined by selection of renamed objects" Thanks for reporting. The bordersurface is currently saving the info on the objects as App::PropertyString so they are not updated if the object name is changed. I will change the code to save the info as a link to the object so that if the object name is changed it should be picked up, just need to also make the appropriate change for export. I would also like to change where the bordersurface objects 'ScintWrap(x)' are stored, namely the 'Opticals' group, say an additional group in Opticals, so Opticals becomes Matrix | Surface | Borders but would appreciate views on this - Thanks. Munther if you could concentrate on the multiUnion - Thanks |
Beta Was this translation helpful? Give feedback.
-
ASIDE"Geant4 has added a package named as G4Opticks where the structures are converted to a mesh components in order to run the optical simulations on high performance computing platforms." Interesting - there are lots of different ways objects can be meshed. Not optics related but numerous people have been using FreeCAD to import STEP files from various CAD software and meshing. Now I got Christophe Geuzaine one of the professors that developed Gmsh to add a function in Gmsh to create a minimum mesh from a CAD/STEP file. I have yet to add it to the GDML workbench but I think the function may now be in the released version of Gmsh rather than just a development snapshot. |
Beta Was this translation helpful? Give feedback.
-
Hi Ami,
I understand what you'd like to have, but it is not something that can
be implemented easily or quickly; exporting a separate solid instead of
a multiUnion node is easy; what is more tricky is now exporting for each
solid a separate volume and then making sure that, if the array was part
of a bordersurface, that also for each node a separate bordersurface is
also exported. The resulting file is going to be much larger.
Re meshing: in geant simulation tests that I have conducted using meshes
of otherwise simple geometrical solids the running times with meshes
were 2-5 times slower than running with the equivalent simple solid.
Running with clusters and/or GPUs would not reduce that time differential.
Did you check with the developers of G4Opticks to see when they might
support multiUnions? I'd rather not send a lot of time producing code
that is then obviated when G4Opticks starts to support multiUnions.
As a stop gap, may I suggest first trying to convert the array into a
mesh in FreeCAD (I believe both FreeCAD and the GDML workbench have
commands/icons to convert a shape into a mesh) and then exporting that
as a gdml file and see what G4Opticks does. (I don't have G4Opticks
installed and have never used it, so can't try the tests myself.)
Munther
…On 7/27/22 13:24, amihashemi wrote:
example could be: 1) the structure that is created with the set of
arrays/MultiUnion (GDML1) 2) the same structure only using the
rotation and translation/position reference (GDML2). So the idea is
can we come up with a way to convert the GDML 1 to GDML2?
Ami
—
Reply to this email directly, view it on GitHub
<#93 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWV3NCGT6BVZQJCFOTCP3HDVWGLIHANCNFSM5YLCMEYA>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Ami,
Please see the response I just posted.
Munther
…On 7/27/22 15:54, amihashemi wrote:
Hi Keith, Gmsh is useful for some FEM analysis at the current stage,
but the major optical simulation with Geant4 initiates a ray tracing
problem. In this context, the meshing of the structure means that
proxy objects are constructed based on the set of indexed triangles
that photon ray tracing will be performed on them. The mesh itself is
transferable to computational threads for high-performance computing
as the number of generated photons is substantially high (you may
check this
https://developer.nvidia.com/blog/creating-optimal-meshes-for-ray-tracing/).
There are many reasons for the current limitations, but at this point,
we don't have the tool in Geant4 to convert the MultiUnion arrays.
Combining Gmsh mesh with Geant4 is a kind of far fetch idea to me but
it is possible.
—
Reply to this email directly, view it on GitHub
<#93 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWV3NCH4GDBV2BHK7Z73IETVWG42BANCNFSM5YLCMEYA>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Ok, I think I've got it working. Am not sure I can attach the files to
this email. I will also send them to your gmail.
Munther
…On 7/27/22 16:10, amihashemi wrote:
Hi Munther,
Thank you very much for the response.
Yes, I have contacted with G4Opticks, and appears that the
"MultiUnion" ability may not be added in the near future, but probably
they will add it later. I think their idea is to focus more on getting
the high-performance simulation right, rather than generalizing the
input geometry.
Using mesh from FreeCAD is nice but not sure it feeds into a
G4Opticks, but I will give it a shot.
I totally understand it might be difficult to add it to the current
version of GDML. I think I would need to write my own c++ input code
for this set of problems or maybe write a wrapper to convert
MultiUnion from FreeCAD/GDML output to a new GDML file.
Thank you very much!
—
Reply to this email directly, view it on GitHub
<#93 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWV3NCGDP7O4TPCMPJ2GLLDVWG6X5ANCNFSM5YLCMEYA>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Some comments about #93.. Evaluating the CaTS example \Geant4-11.0.2\examples\advanced\CaTS\gdml\simpleLArTPC.gdml I have found that they keep all optical properties inside of GDML file. Anyway it has some drawback.... in some situations it requires many hand-work, because you should define wavelength dependent reflectivity, refraction, emission spectra of scintillators etc... In my simulations (with using standard Box, Tubes etc.. solids to define a setup geometry) I try to use the following approach: I define detector as: this additional service class "DetectorSurfaces" is used for surfaces definitions from hand-typed data and reading from files: #include <globals.hh> class G4OpticalSurface; class DetectorSurfaces
public: #endif //Get ENVIROMENT VARIABLE TO MATERIAL DATA //////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// polishedWhitePainted = new G4OpticalSurface("polishedWhitePainted"); G4MaterialPropertiesTable* polishedWhitePaintedProperty = new G4MaterialPropertiesTable(); std::vector dEJE; ////////////////////////////////////////////////////////////////// std::vector Cathode_energy; //I use home=made file reader for data in the following format: E(eV) Parameter(A.U.) std::vector vEngEff; PMTCathodeMaterial->SetMaterialPropertiesTable(PMTCathodeMaterialProperty); /////////////////////////////////////////////////////////////////////////////////////////////////// after that I can easily define any surface in my code (during detector construction) between any physical volumes: G4VPhysicalVolume * DetectorConstruction::constructDetector() new G4LogicalBorderSurface("grease2AirFaceBorderSurface", physiGrease, physiWorld, polishedAir); new G4LogicalBorderSurface("glass2CathodeBorderSurface", physiPMT, physiCathode, PMTCathodeMaterial); return physiWorld; So, I plan to test how it works with GDML because GDMLParser lets to get pointer to physical volume using its name... class G4GDMLParser So, theoretically it should be possible.... for some projects ;)) |
Beta Was this translation helpful? Give feedback.
-
@porosov If I understand correctly, what you are suggesting is an
approach where the geometry is defined through FreeCAD/GDML, but the
optical properties added in C++. This is a good approach, especially
that currently FreeCAD/GDML does not provide any means of editing the
Matrices that define the energy/wavelength tables. At present we assume
these have to read in from a GDML file, or cut and paste from some
external file. To the extent that one has to process detector response
in C++ at any rate, I see no harm in your approach. One can concentrate
in FreeCAD on constructing and visualizing the geometry, something that
is not easy (for complicated geometries, at any rate) to do in C++.
FreeCAD has some limited support for Spreadsheets. In the future I can
envision an addition to the GDML Workbench that takes a spreadsheet
containing the optical properties and adding it to the Optical
properties. FreeCAD can import excel spreadsheets.
Munther Hindi
…On 8/8/22 10:22, porosev wrote:
Some comments about #93
<#93>..
...
Evaluating the CaTS example
\Geant4-11.0.2\examples\advanced\CaTS\gdml\simpleLArTPC.gdml I have
found that they keep all optical properties inside of GDML file.
Anyway it has some drawback.... in some situations it requires many
hand-work, because you should define wavelength dependent
reflectivity, refraction, emission spectra of scintillators etc...
In my simulations (with using standard Box, Tubes etc.. solids to
define a setup geometry) I try to use the following approach:
I define detector as:
...
class DetectorConstruction : public G4VUserDetectorConstruction,
public DetectorSurfaces
...
this additional service class "DetectorSurfaces" is used for surfaces
definitions from hand-typed data and reading from files:
/////////////////////////////////// Surfaces_h
/////////////////////////////////////////////////
#ifndef Surfaces_h
#define Surfaces_h 1
#include <globals.hh>
class G4OpticalSurface;
class DetectorSurfaces
{
protected:
// standard surfaces
|G4OpticalSurface *polishedAir; // polished crystal surface, not
wrapped G4OpticalSurface* polishedWhitePainted; // polished crystal
surface painted white G4OpticalSurface *PMTCathodeMaterial; // surface
between window and cathode |
public:
DetectorSurfaces();
};
#endif
/////////////////////////////////// Surfaces_cc
/////////////////////////////////////////////////
...
DetectorSurfaces::DetectorSurfaces()
{
polishedAir = NULL;
polishedWhitePainted = NULL;
PMTCathodeMaterial = NULL;
//Get ENVIROMENT VARIABLE TO MATERIAL DATA
char* path = getenv("MY_G4DATA");
if (!path)
{
G4Exception("DetectorConstruction::defineSurfaces()", "",
FatalException, "MY_G4DATA environment variable not set.");
return;
}
////////////////////////////////////////////////////////////////////
//
polishedAir = new G4OpticalSurface("polishedAir", unified);
polishedAir->SetType(dielectric_dielectric);
polishedAir->SetModel(unified);
polishedAir->SetFinish(ground); // necessary even for polished
surfaces to enable UNIFIED code
polishedAir->SetSigmaAlpha(1.3 * degree); // Janecek2010
//////////////////////////////////////////////////////////////////
//
// COMMON PROPERTIES
G4double ener[2] = { .1*eV, 10.*eV };
G4double paintspecularlobe[2] = { 1.0, 1.0 };
G4double paintspecularspike[2] = { 0.0, 0.0 };
G4double paintbackscatter[2] = { 0.0, 0.0 };
//////////////////////////////////////////////////////////////////
// EJ-510
// https://eljentechnology.com/products/accessories/ej-510-ej-520
//
G4double paintrindex[2] = { 1.62, 1.62 };
polishedWhitePainted = new G4OpticalSurface("polishedWhitePainted");
polishedWhitePainted->SetType(dielectric_dielectric);
polishedWhitePainted->SetModel(unified);
polishedWhitePainted->SetFinish(polishedbackpainted);
polishedWhitePainted->SetSigmaAlpha(1.3 * degree);
G4MaterialPropertiesTable* polishedWhitePaintedProperty = new
G4MaterialPropertiesTable();
polishedWhitePaintedProperty->AddProperty("RINDEX", ener, paintrindex, 2);
polishedWhitePaintedProperty->AddProperty("SPECULARLOBECONSTANT",
ener, paintspecularlobe, 2);
polishedWhitePaintedProperty->AddProperty("SPECULARSPIKECONSTANT",
ener, paintspecularspike, 2);
polishedWhitePaintedProperty->AddProperty("BACKSCATTERCONSTANT", ener,
paintbackscatter, 2);
std::vector dEJE;
std::vector dEJR;
OptService::ReadParameters(path, "EJ-510_Reflectance.txt", dEJE, dEJR,
true, CLHEP::eV);
polishedWhitePaintedProperty->AddProperty("REFLECTIVITY", dEJE, dEJR);
polishedWhitePainted->SetMaterialPropertiesTable(polishedWhitePaintedProperty);
//////////////////////////////////////////////////////////////////
// R10233
PMTCathodeMaterial = new G4OpticalSurface("CathodeMaterial", unified);
PMTCathodeMaterial->SetType(dielectric_metal);
PMTCathodeMaterial->SetModel(unified);
PMTCathodeMaterial->SetFinish(polished);
PMTCathodeMaterial->SetSigmaAlpha(0.);
G4MaterialPropertiesTable *PMTCathodeMaterialProperty = new
G4MaterialPropertiesTable();
std::vector Cathode_energy;
std::vector Cathode_data;
//I use home=made file reader for data in the following format: E(eV)
Parameter(A.U.)
OptService::ReadParameters(path,
"R10233_TrueReflectanceWithoutGlass.txt", Cathode_energy,
Cathode_data, true, CLHEP::eV);
PMTCathodeMaterialProperty->AddProperty("REFLECTIVITY",
Cathode_energy, Cathode_data);
std::vector vEngEff;
std::vector vEff;
OptService::ReadParameters(path, "R10233_QE.txt", vEngEff, vEff, true,
CLHEP::eV);
PMTCathodeMaterialProperty->AddProperty("EFFICIENCY", vEngEff, vEff);
PMTCathodeMaterial->SetMaterialPropertiesTable(PMTCathodeMaterialProperty);
}
///////////////////////////////////////////////////////////////////////////////////////////////////
after that I can easily define any surface in my code (during detector
construction) between any physical volumes:
G4VPhysicalVolume * DetectorConstruction::constructDetector()
{
....
//-------------------------------------------------
// setup surfaces
//-------------------------------------------------
new G4LogicalBorderSurface("scint2AirFaceBorderSurface", physiScint,
physiWorld, polishedWhitePainted);
new G4LogicalBorderSurface("grease2AirFaceBorderSurface", physiGrease,
physiWorld, polishedAir);
new G4LogicalBorderSurface("glass2CathodeBorderSurface", physiPMT,
physiCathode, PMTCathodeMaterial);
return physiWorld;
}
So, I plan to test how it works with GDML because GDMLParser lets to
get pointer to physical volume using its name...
class G4GDMLParser
{
....
GetPhysVolume(const G4String& name)
..
}
So, theoretically it should be possible.... for some projects ;))
—
Reply to this email directly, view it on GitHub
<#93 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWV3NCDNQORIPJLCLSZES23VYE667ANCNFSM5YLCMEYA>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Okay I found there was a bug on import of bordersurface, also duplicate code in GDMLCommands.py, have updated branches Main and forAMI |
Beta Was this translation helpful? Give feedback.
-
I am playing around with converting the arrays to a tessellation. It is
a two-step process, first the array needs to be converted to a mesh (the
Create Mesh from Shape icon) and then convert the mesh to a Tessellation
(the Mesh 2 Tess icon). The material is NOT automatically copied, so it
has to be set AFTER the conversion. I am still having some problems with
assigning the materials correctly. Once I resolve that I will send you
the files to try with G4Opticks.
Munther
…On 7/27/22 16:10, amihashemi wrote:
Hi Munther,
Thank you very much for the response.
Yes, I have contacted with G4Opticks, and appears that the
"MultiUnion" ability may not be added in the near future, but probably
they will add it later. I think their idea is to focus more on getting
the high-performance simulation right, rather than generalizing the
input geometry.
Using mesh from FreeCAD is nice but not sure it feeds into a
G4Opticks, but I will give it a shot.
I totally understand it might be difficult to add it to the current
version of GDML. I think I would need to write my own c++ input code
for this set of problems or maybe write a wrapper to convert
MultiUnion from FreeCAD/GDML output to a new GDML file.
Thank you very much!
—
Reply to this email directly, view it on GitHub
<#93 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWV3NCGDP7O4TPCMPJ2GLLDVWG6X5ANCNFSM5YLCMEYA>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi Munther and Keith,
I look forward to checking the GDML with tessellation. It will be a great
step if that works for optical properties. G4Opticks has recently been
updated to G4CXOpticks and some of the structure definitions in GDML have
been added to the new version. I will check with the new and old versions.
Thank you very much,
Best regards,
Ami
On Tue, Oct 11, 2022 at 3:57 AM Munther Hindi ***@***.***>
wrote:
… I am playing around with converting the arrays to a tessellation. It is
a two-step process, first the array needs to be converted to a mesh (the
Create Mesh from Shape icon) and then convert the mesh to a Tessellation
(the Mesh 2 Tess icon). The material is NOT automatically copied, so it
has to be set AFTER the conversion. I am still having some problems with
assigning the materials correctly. Once I resolve that I will send you
the files to try with G4Opticks.
Munther
On 7/27/22 16:10, amihashemi wrote:
>
> Hi Munther,
>
> Thank you very much for the response.
>
> Yes, I have contacted with G4Opticks, and appears that the
> "MultiUnion" ability may not be added in the near future, but probably
> they will add it later. I think their idea is to focus more on getting
> the high-performance simulation right, rather than generalizing the
> input geometry.
>
> Using mesh from FreeCAD is nice but not sure it feeds into a
> G4Opticks, but I will give it a shot.
>
> I totally understand it might be difficult to add it to the current
> version of GDML. I think I would need to write my own c++ input code
> for this set of problems or maybe write a wrapper to convert
> MultiUnion from FreeCAD/GDML output to a new GDML file.
>
> Thank you very much!
>
> —
> Reply to this email directly, view it on GitHub
> <
#93 (reply in thread)>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AWV3NCGDP7O4TPCMPJ2GLLDVWG6X5ANCNFSM5YLCMEYA
>.
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
—
Reply to this email directly, view it on GitHub
<#93 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AH6QDXT4OCJBGIPCCGH6NO3WCUMX3ANCNFSM5YLCMEYA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm trying to use Freecad to create a GDML for optical simulation using geant4. I just wonder if there is anyway to assign the optical properties. I can easily create a geometry and export it to geant4 but I'm stuck on defining the optical properties, I would appreciate any help..
Best regards,
Ami
Beta Was this translation helpful? Give feedback.
All reactions