Surface wrap with hole


I am trying to simulate a tile wrapped in Tyvek with a fiber running trough it.

The Tyvek and the tile have holes drilled for the fiber, and obviously no Tyvek in the holes.

I simply added a surface to the logical volume of the tile:

G4OpticalSurface *tyvekWrap = new G4OpticalSurface("TyvekWrap");
    G4LogicalSkinSurface *tyvekSurface = new G4LogicalSkinSurface("TyvekSurface", LYSOLogical, tyvekWrap);
    new G4LogicalBorderSurface("TyvekWrap", LYSOPhysical, worldPhysical, tyvekWrap);

However, this obviously traps in all the light.

Anyone know the intended way to add holes to an optical surface?

I would like the photons generated in the tile to exit the surface that surrounds the fiber, so that they can enter the fiber. The fiber is a wavelength shifter.

EDIT: I tried adding a volume around the LYSO tile and assigning it the Tyvek surface properties, but the light is still trapped within the LYSO.

Thank you!

Why after 20+ years of development, is GEANT4 still so inefficiently and inadequately explained and supported. Is anyone in this collaboration interested in providing useful materials, examples, and support? I volunteer if no one else is willing!

Three comments.

  1. You know you want a G4OpticalSurface, so enter “G4OpticalSurface” in the search field (where it says “Search docs”) in the front page of the documenation. That should bring you to this page:
    Physics Processes — Geant4 Documentation 10.7 documentation (Discourse is hiding the link name: G4OpticalSurface#specifying-the-surface.) (There is a flaw in the search results, in that the link is to the top of a very long page. Use your browser to search within the page). From the text there, it should be apparent that you want one border surface between the tile and the tyvek, and another between the tile and the fiber. Or maybe one skin and one border surface would work, depending on the geometry. It is true that it is difficult for documentation to be pedagogical. And the optical documentation is dense. If you have specific recommendations to improve the documentation, please, let’s hear them.

  2. You are touching on what I think is a flaw in the Geant4 Discourse pages, namely that typically the only person who responds is the person responsible for the code in question. This creates a bottleneck, for example, when that person is away or otherwise unavailable. There must be 100s of people who could answer your original question and it doesn’t make sense that you should have to wait for me. You say you volunteer: great! Please answer other’s questions when you know the answer. Also, if you have any ideas to expand the pool of people answering questions, let’s hear them.

  3. Your code highlights a difficulty in maintaining code that someone else wrote. How should the Geant4 code deal with user code that is not as suggested in the documentation? In many cases there will be a valid use case, maybe even one the developers haven’t thought of. In your case there is both an obvious and a subtle error. For the tyvekWrap optical surface, you set the model to unified, but then choose a finish from a different model. (Again, this should be apparent from the documentation, reading on from the link above). Next, you’ve assigned the G4OpticalSurface tyvekWrap to both a LogicalSkinSurface and a LogicalBorderSurface. Maybe this is OK, but of course in your case you want different behavior at these two surfaces, so you’re going to want different G4OpticalSurfaces.

In addition to @dsawkey’s comment, note that we have a Discourse category especially for ideas/requirements/improvements where input is very welcome. There are also active Working Groups on Documentation, Basic/Extended Examples, and Advanced Examples and the convenors are always open to members who can actively contribute.

@dsawkey and @bmorgan

To be clear, regardless of my criticisms, I appreciate GREATLY that this software exists and the effort that goes in to its development, so please don’t misunderstand the aims of my critiques - which is to make this software used more readily by more people to accomplish more cool stuff more quickly.

But here’s the deal: I’ve been in HEP since 2003, and even then GEANT4 was known as one of the nine circles of hell, a reputation that is not inevitable in my view, though is fair to be frank.

And I became somewhat of a GEANT4 expert several years ago - but owing to the overall lack of intuitiveness inherent to its construction, I have completely forgotten nearly every nuance, even though I know exactly what I want to do in principle.

Furthermore, I recently participated in a test beam at Fermilab for a new detector prototype, and no one had simulated the detector yet because of the unnecessary complexity of the software and resulting scarcity of GEANT4 ‘experts’.

Thus I volunteered to develop a simulation, and here I am again wading through the particulars of this software, begging for help from the developers, who keep their secrets locked behind pages and pages and pages of ‘guides’, rather than via a set of simple, clear, limited, intuitive examples. There is no reason the optical examples need to be buried inside the absurdness of the LXe application.

I am clearly not an expert on GEANT4, however, I am an expert educator and teacher according to my students, and here is what I am willing to do:

It is 2021, GEANT4 should have a series of videos on YouTube or the like, of a screen share of someone demonstrating the correct way to program single features at a time, explaining how the simulation works while doing it.

Then, a developer can piece together the examples into whatever framework they need, and have confidence that they aren’t spinning their wheels.

I volunteer to produce these videos, as long as I can work with someone who is an expert to decide on which topics are most relevant, and who can verify that my implementations are correct.

Of course, the software changes as patches are released, and I would be more than willing to update the videos for the latest releases when they are released. Why? Because it will help me in my own application development.

I have a Ph.D. in physics, I do hard stuff well all the time. The difficulties inherent with developing for GEANT4 are 100% due to the lack of clarity by the developers to educate their users, and the lack of helpfulness and overall condescending nature of those who ‘help’ in this forum.

For example, you told me what I did wrong, but did not tell me the correct way to do it. So I am going to try something else, do it wrong again, come ask for help again, and you’re going to tell me it’s wrong, and to read the manual again, a manual, mind you, that is so poorly written it may as well not exist.

This is amazing software and it should be utilized by many more people, and take far fewer man-hours to help our breakthroughs occur faster.

Certainly I am not the only person to voice these concerns.

But aside from that, back to my example because it is still not clear to me what I should do:

I have a LYSO crystal with 5 holes in it.

I have a quartz capillary that goes through the hole, but is not in contact with the hole (air exists between the quartz and the LYSO).

I don’t want light to come out of the sides of the LYSO tile, but I do want light to come out of the holes drilled in the tile.

So I have a LYSOLogical, a LYSOPhysical, a quartzLogical and a quartzPhysical object, each with indices of refraction and optical properties defined.

Do I need to add a tyvekWrapLogical and physical object, and assign the surface to that object in order to accomplish this?

Thank you again for your consideration-

The topic of videos has often come up, but in many cases we simply haven’t had the manpower to implement this, so such a contribution would I’m sure be very welcome. As above please don’t hesitate to contact the convenors of the listed Working Groups to start this contribution, or to post on the Ideas/Requirements category with a more expansive list of what you think is needed.

I take your point about tone, and we’ll always try to be better here. We also ask the same from our users, sometimes understandable frustration notwithstanding, so if you are going to criticise, and we don’t shy away from this, please make this constructive. As above, outline what is felt to be lacking/unclear/needed, why is it so, and how this could be fixed (and I appreciate that you’ve done exactly this above). Doing this is precisely how I ended up contributing back in 2007 to the build/install/test system.

Please remember that like many software projects, Geant4 development may only be a fraction of our contributor’s work time. Again, this is not to say we can’t do better, just that a short, or slow, response, does not and should not be taken as lack of interest or condescention.

Please also encourage these people to get involved - voice these concerns to Geant4 directly, here, or through the Working Group convenors. The more input we have, and written down into concrete topics the better!

Define two optical surfaces. Make one capable of allowing photons through (e.g. dielectric-dielectric) and the other not (e.g. dielectric-metal). Assign the first to the holes, and the second to the holes. There are different ways of doing this. You could assign a border surface between the tile and the holes, and another border surface between the tile and what is outside the sides.

This is a genuine attempt to answer your specific technical question. If you still have questions, please start a new thread. I’m done with this one.

Please stop with the personal attacks.

@dsawkey please understand that constructive criticism is the best thing that can happen to a person in life.

Indeed since you are interested in answering the question, please understand that I am offering help of my own to improve the efficiency of these interactions.

For example, it would be helpful if you explained the big picture in addition to the relevant details for my application. Having that extra context is invaluable. This would be helpful for other users who came to this thread, too, and you would need less threads in general.

Here I try to show what I mean (which might be incorrect if others are reading this):

"You have your LYSO crystal’s logical volume, and you want your LYSO crystal to be modeled as wrapped in tyvek. So normally you just need to define a G4LogicalSkinSurface, and assign it to the LYSO logical volume:

    G4OpticalSurface *tyvekWrap = new G4OpticalSurface("TyvekWrap");
    G4LogicalSkinSurface *tyvekSurface = new G4LogicalSkinSurface("TyvekSurface", LYSOLogical, tyvekWrap);

But you have a wrinkle in that you have holes that need to allow the photons to travel out of, so this method is not preferred, though it is simple.

One approach would be to define a new logical volume that surrounds your LYSO volume, and assign the G4LogicalSkinSurface to that volume.

Define the LYSO logical volume:

    G4LogicalVolume* LYSOLogical = new G4LogicalVolume(LYSOWithBoreHoles, //solid
                                                       LYSOMaterial, // material
                                                       "LYSOLogical"); //name

Define the ‘wrapper’ volume:

    G4LogicalVolume* LYSOWrapperLogical
           = new G4LogicalVolume(LYSOWrapperSolid,      // solid
                                 worldMaterial,         // material
                                 "logic-LYSO-wrapper"); // name

And finally define the optical surface and assign it to the ‘skin’ of the wrapper logical volume:

    G4OpticalSurface *tyvekWrap = new G4OpticalSurface("TyvekWrap");

    G4LogicalSkinSurface *tyvekSurface = new G4LogicalSkinSurface("TyvekSurface", LYSOWrapperLogical, tyvekWrap);


@jwwetzel, as we have both already noted, tone is important so let’s all be mindful especially in an online discussion.

We do understand frustration with both support and documentation for Geant4, and it is something we are actively trying to address. Feedback and contribution from users is especially welcome here with the different perspectives it brings from experience levels and application use cases/new requirements.

You have already suggested some ideas for contributions that you’d be willing to make to this effort, and this would be extremely welcome. To capture this properly and go further, might I suggest that you outline these in a new thread under the Ideas/Requirements category? We can then go into detail with more people, and see how we can work together. Don’t hesitate to add any other ideas/comments either in that thread or if you think they warrant a separate thread, both now and in the future - our door is always open for all suggestions/contributions to improve Geant4 for everyone.