G4LogicalBorderSurface

In the optical simulation, why do I display useless variables when I set the optical properties of the boundary?

   // ====== Reflector - sintillator surface ======
   G4OpticalSurface *OpRefCrySurface = new G4OpticalSurface("Ref-CrySurface");
   OpRefCrySurface->SetType(dielectric_metal);
   OpRefCrySurface->SetModel(glisur);
   OpRefCrySurface->SetFinish(polished);
   G4LogicalBorderSurface *RefCrySurface =
       new G4LogicalBorderSurface("RefCrySurface", physiCrystal, physiReflector, OpRefCrySurface);
   // ====Scintillator - PMT window surface=====
   G4OpticalSurface *OpCryPMTWinSurface = new G4OpticalSurface("Cry-PMTWinSurface");
   OpCryPMTWinSurface->SetType(dielectric_LUTDAVIS);
   OpCryPMTWinSurface->SetModel(DAVIS);
   OpCryPMTWinSurface->SetFinish(Rough_LUT);
   G4LogicalBorderSurface *CryPMTWinSurface =
       new G4LogicalBorderSurface("CryPMTWinSurface", physiCrystal, physiPMTWindow, OpCryPMTWinSurface);
   // ===PMT window - photocathode surface===
   G4OpticalSurface *OpPMTWinCathSurface = new G4OpticalSurface("PMTWin-CathSurface");
   OpPMTWinCathSurface->SetType(dielectric_dielectric);
   OpPMTWinCathSurface->SetModel(glisur);
   OpPMTWinCathSurface->SetFinish(polished);
   G4LogicalBorderSurface *PMTWinCathSurface =
       new G4LogicalBorderSurface("CathodeSurface", physiPMTWindow, physiCathode, OpPMTWinCathSurface);

You don’t need to assign the created surfaces to variables if you don’t want to. The surface objects must be allocated with new, because the geometry stores take ownership of them, but you could do that with a bare statement, like

// ====Scintillator - PMT window surface=====
   G4OpticalSurface *OpCryPMTWinSurface = new G4OpticalSurface("Cry-PMTWinSurface");
   OpCryPMTWinSurface->SetType(dielectric_LUTDAVIS);
   OpCryPMTWinSurface->SetModel(DAVIS);
   OpCryPMTWinSurface->SetFinish(Rough_LUT);
   new G4LogicalBorderSurface("CryPMTWinSurface", physiCrystal, physiPMTWindow, OpCryPMTWinSurface);

Assigning to a variable can make debugging easier in the future (you could set a breakpoint and inspect the variable in the debugger, for example).