Optical photons entering and exiting different materials/boundaries

Dear experts,

I am unable to setup my geometry (material properties and optical surfaces) to have optical photons crossing a given material. I try to explain better what I am trying to achieve in the following example.

I have multiple layers of material (aerogel) embedded in a common vessel volume (mother volume).
Both the aerogel layers and the vessel are made of materials with defined refractive index.
For the vessel case, the refractive index is set to 1 to inhibit Cherenkov radiation.
The aergel layer index is > 1, which is where I want Cherenkov photons to be generated.

In the way I have setup the geometry, I can produce Cherenkov photons in the aerogel layer.
They exit the aerogel-vessel boundary and are correctly propagated in the vessel.
The trouble is that when they encounter a following vessel-aerogel boundary they are absorbed instead of being propagated through the next aerogel layer, which is what I would like to achieve.

I believe this might have something to do with the way I defined the G4OpticalSurface and the G4LogicalBorderSurface, but I am unable to find the correct answer.

Here is a little snippet of the code

/** the vessel is a tube located in the world volume **/
auto vessel_pv = new G4PVPlacement(nullptr, G4ThreeVector(0., 0., 0), vessel_lv, 
			                       "vessel_pv", 
                                   world_lv, false, 0, false);  

/** the aerogel layers are tubes as well and are created in a loop **/
for (int ilayer ...) {

/** here we create the material, solid and logical volume 
    the volume placement is in the vessel.
    the aerogel and vessel physical volumes overlap **/

auto aerogel_pv = new G4PVPlacement(nullptr, G4ThreeVector(0., 0., 0), aerogel_lv, 
					                std::string("aerogel_pv") + std::to_string(ilayer),
	                   				vessel_lv, false, 0, false);  

/** for each aerogel volume we create an optical surface (see below this part) **/
auto aerogel_os = ConstructOpticalSurfaceAerogel(std::string("aerogel_os") + std::to_string(ilayer));

/** and for each aerogel volume we define a logical border surface between the aerogel and the vessel **/
auto aerogel_ls = new G4LogicalBorderSurface(std::string("aerogel_ls") + std::to_string(ilayer),
						                     vessel_pv,  aerogel_pv, aerogel_os);

}

/** optical surface is constructed such to have 100% transmittance and no reflectivity **/
G4OpticalSurface *
DetectorConstruction::ConstructOpticalSurfaceAerogel(std::string name)
{
  G4double energy[2] = { 1.2915 * eV, 5.166 * eV };
  G4double reflectivity[2] = {0., 0.};
  G4double transmittance[2] = {1., 1.};
  auto mpt = new G4MaterialPropertiesTable();
  mpt->AddProperty("REFLECTIVITY", energy, reflectivity, 2);
  mpt->AddProperty("TRANSMITTANCE", energy, reflectivity, 2);

  auto os = new G4OpticalSurface(name);
  os->SetType(dielectric_dielectric);
  os->SetFinish(polished);
  os->SetModel(glisur);
  os->SetMaterialPropertiesTable(mpt);

  return os;
}

Many thanks for any help.
Roberto

Hi, do you get any warnings about unused variables? This line is presumably wrong.

thanks. Indeed that line was wrong.
I was commenting here about that, but I don’t see my comment.
With the proper

mpt->AddProperty("TRANSMITTANCE", energy, transmittance, 2);

everything works fine.

And indeed, my bad that I should have checked warnings for unused variables.

Thanks and best regards,
Roberto