Scintillation scorer

Hi everyone, I’m building a scintillator on my simulation and I added a reflective skin to it’s surface. I’m trying to use a scoring mesh to represent the SiPM I’ll use to measure energy deposition in the crystal. the problem I have is that the whole surface of the scintillator is reflective, therefore when the scoring mesh is touching the scintillator surface I get these errors:

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : OpBoun06
      issued by : G4OpBoundaryProcess
G4OpBoundaryProcess: Opticalphoton step length: 7.84205e-09 mm.
This is larger than the threshold 1e-09 mm to set status StepTooSmall.
Boundary scattering may be incorrect. 
*** Step size warnings stopped.

*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

Screenshot from 2023-07-16 17-38-27
You can see in the screenshot that the reflections are working well, no optical photons are getting out since I’ve set the reflectivity to 1 on the whole spectrum.

My question would then be: how can I make a hole on the scintillator skin so that photons can get out and hit my scorer? Also, I don’t know if this is the right way to do this kind of measurement, any ideas on how to improve this would be great. Thank you.

That warning message should only occur a few boundary interactions per thousand, and in this case can be ignored.

I’m not really sure what you would like to simulate. Do you want to have optical photons leave the scintillator volume and enter a different volume? Or is the scoring mesh intended to be in the same location as the scintillator?

My scoring mesh is supposed to act as the SiPM I have attached to my crystal. Therefore yes, I want to let photons out of the crystal and enter only that other volume. To do so I created a logical volume in my tracking world, to which I then assign my scoring mesh. I made sure that the optical boundaries let photons out of the crystal and into the SiPM. Here is the macro I’m using.

/run/numberOfThreads 1
/run/initialize

########################################
#using openGL to visualize
/vis/open OGL
/vis/viewer/set/upVector 0 0 1
/vis/viewer/set/viewpointVector 1 0.4 0.3
/vis/drawVolume

#showing the particles
/vis/viewer/set/autoRefresh true
/vis/viewer/set/background white
/vis/scene/add/trajectories smooth
/vis/scene/add/scale 5 cm y 0 0 0 manual 5 0 0 cm
/vis/scene/add/axes -10 -10 -10 20 cm
/vis/scene/add/eventID
#Acumulate all events on the screen
/vis/scene/endOfEventAction accumulate

#decorative text
/vis/scene/add/text2D 0.6 -.9 24 ! ! CosmicWatch

########################################
#define scoring mesh
/score/create/realWorldLogVol logicSiPM !

#adding particle filters and quantity measutements
/score/quantity/flatSurfaceCurrent SiPMcurrent 1 0 0 cm2
/score/filter/particle phot opticalphoton
/score/close

/score/list

########################################
#general particle source
#/vis/disable
/gps/particle mu-

/gps/pos/type Plane
/gps/pos/shape Square
/gps/pos/centre 0 0 10 cm
/gps/pos/halfx 2.5 cm
/gps/pos/halfy 2.5 cm

/gps/ene/type Mono
/gps/ene/mono 1 GeV
/gps/direction 0 0 -1

/run/beamOn 1
#/vis/enable

########################################
/score/colorMap/setMinMax ! 0. 800.
/score/drawProjection logicSiPM SiPMcurrent

########################################
#Dump scorers to a file
/score/dumpQuantityToFile logicSiPM SiPMcurrent SiPMcurrent.txt

However after running the current count is 0, even though in visualization I can see that photons entered the SiPM.