The detector fails to register any events after adding the geometry

_Geant4 Version: geant4-11-02-patch-02 [MT] (21-June-2024)
_Operating System: Ubuntu 64bit
_Compiler/Version:_g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
_CMake Version: 3.22.1

After implementing the CryoVacCavLV volume and integrating it into the hierarchy as shown below, the detector no longer registers any events.
When only the IR and IR_Cap components were in place, the detector responded correctly.
I would appreciate any guidance on whether there is a structural aspect I may have overlooked.
I have based the rest of the code on the rdecay02 example, so I believe there should be no major issues.

I have also performed overlap checks as shown below.

/geometry/test/verbosity    1           # ๊ฒน์นจ ๋ฉ”์‹œ์ง€ ON
  /geometry/test/resolution   100000      # ํฌ์ธํŠธ 10๋งŒ๊ฐœ๋กœ ๊ฒ€์‚ฌ ์ •๋ฐ€๋„ โ†‘
  /geometry/test/tolerance    0.0 mm      # 0 mm ์ดํ•˜ ๊ฒน์นจ๋„ ๋ชจ๋‘ ๋ณด๊ณ 
  /geometry/test/run                     # ์ „์ฒด ํŠธ๋ฆฌ ๊ฒ€์‚ฌ ์‹œ์ž‘
Running geometry overlaps check...
Checking overlaps for volume Target:0 (G4Box) ... OK! 
Checking overlaps for volume CryoVacCavPV:0 (G4Tubs) ... OK! 
Checking overlaps for volume IRShellPV:0 (G4SubtractionSolid) ... OK! 
Checking overlaps for volume VacCavPV:0 (G4Tubs) ... OK! 
Checking overlaps for volume Detector:0 (G4SubtractionSolid) ... OK! 
Checking overlaps for volume irCapPV:0 (G4Tubs) ... OK! 
Geometry overlaps check completed !
// Cleanup old geometry
  G4GeometryManager::GetInstance()->OpenGeometry();
  G4PhysicalVolumeStore::GetInstance()->Clean();
  G4LogicalVolumeStore::GetInstance()->Clean();
  G4SolidStore::GetInstance()->Clean();
  

  // 1) Y์ถ• 180ยฐ ํšŒ์ „ ๋งคํŠธ๋ฆญ์Šค ์ƒ์„ฑ
  auto rotY180 = new G4RotationMatrix();
  rotY180->rotateY(180.*deg);

  // World
  //
  
    
  G4Box* sWorld = new G4Box("World",                                 //name
    4*m, 4*m, 4*m); //dimensions  
                   
  G4LogicalVolume*
  lWorld = new G4LogicalVolume(sWorld,                  //shape
                             fWorldMater,               //material
                             "World");                  //name

  fPhysiWorld = new G4PVPlacement(0,                    //no rotation
                            G4ThreeVector(),            //at (0,0,0)
                            lWorld,                     //logical volume
                            "World",                    //name
                            0,                          //mother volume
                            false,                      //no boolean operation
                            0);                         //copy number
  //Target Box

  G4double thickness = 3.0 * mm;

// 2. ๋‚ด๋ถ€ ๋ฐ•์Šค (์†์ด ๋นˆ ๊ณต๊ฐ„ ํฌ๊ธฐ)
G4double innerX = 1.0 * m;
G4double innerY = (1.0 + 0.003) * m;
G4double innerZ = 1.0 * m;
G4Box* hollowBox = new G4Box("HollowBox", innerX / 2, innerY / 2, innerZ / 2);

// 3. ์™ธ๋ถ€ ๋ฐ•์Šค (์ฒ  ์žฌ์งˆ ๊ป๋ฐ๊ธฐ ํฌํ•จ ํฌ๊ธฐ)
G4double outerX = innerX + 2 * thickness;
G4double outerY = innerY + 2 * thickness;
G4double outerZ = innerZ + 2 * thickness;
G4Box* solidBox = new G4Box("SolidBox", outerX / 2, outerY / 2, outerZ / 2);

// 4. ๋‚ด๋ถ€ ๋ฐ•์Šค๋ฅผ ์œ„๋กœ 3mm ์˜ฌ๋ ค์„œ ๋šœ๊ป‘ ๋‘๊ป˜ ์ƒ์„ฑ
G4ThreeVector translation(0, 3 * mm, 0);

// 5. SubtractionSolid: solidBox - hollowBox = ์ฒ  ์ƒ์ž ๊ป๋ฐ๊ธฐ
G4SubtractionSolid* IronBoxSolid = new G4SubtractionSolid(
    "IronBox", solidBox, hollowBox, nullptr, translation);

// 6. ๋…ผ๋ฆฌ ๋ณผ๋ฅจ ์ƒ์„ฑ
G4LogicalVolume* logicIronBox = new G4LogicalVolume(IronBoxSolid, Iron, "LogicIronBox");
auto visIB = new G4VisAttributes(G4Colour(0.6, 0.6, 0.6));
visIB->SetForceSolid(true);
logicIronBox->SetVisAttributes(visIB);

// // 7. ์›”๋“œ์— ์ฒ  ์ƒ์ž ๋ฐฐ์น˜
// new G4PVPlacement(nullptr, G4ThreeVector(0, -3.0*mm, 0),
//                   logicIronBox, "IronBox", lWorld, false, 0, true);
                            



  // Target
  //
  G4Box* 
  sTarget = new G4Box("Target",                                   //name
    fTargetHalfX, fTargetHalfY, fTargetHalfZ); //dimensions


  fLogicTarget = new G4LogicalVolume(sTarget,           //shape
                             fTargetMater,              //material
                             "Target");                 //name
                               
           new G4PVPlacement(0,                         //no rotation
                           G4ThreeVector(),             //at (0,0,0)
                           fLogicTarget,                //logical volume
                           "Target",                    //name
                           lWorld,                      //mother  volume
                           false,                       //no boolean operation
                           0);                          //copy number

auto soilVis = new G4VisAttributes(G4Colour(0.6, 0.4, 0.2, 0.8));
soilVis->SetForceSolid(true);
fLogicTarget->SetVisAttributes(soilVis);

G4double CryoVacuumlR = 51.5*mm;
G4double CryoV_halfZ = 24.2*mm;


auto CryoVacCavSolid = new G4Tubs("CryoVacCav",
  0,         // inner R
  CryoVacuumlR,  // outer R = 49 mm
  CryoV_halfZ,  // half-height
  0*deg,360*deg);
auto CryoVacCavLV = new G4LogicalVolume(CryoVacCavSolid,
        VacuumMater,
        "CryoVacCavLV");
new G4PVPlacement(nullptr,
G4ThreeVector(0,0, 24.2*mm + fTargetHalfZ +200.0*mm),
CryoVacCavLV,
"CryoVacCavPV",
lWorld,
false,0,true);

auto Cryo_Vac = new G4VisAttributes(G4Colour(1.0, 1.0, 1.0, 0.3));
Cryo_Vac->SetForceSolid(true);
CryoVacCavLV->SetVisAttributes(Cryo_Vac);


// 1) ์…ธ ์ „์ฒด ๋†’์ด ๋ฐ ๋‘๊ป˜
G4double IRHeight = 44.9*mm;   // ์™ธํ˜• ๋†’์ด 45.9 - 0.6(Cap๋†’์ด)
G4double IR_thick   = 0.5*mm;    // IR ๋‘๊ป˜
G4double vacuumlR    = 49.0*mm;   // IR Vacuum ๋ฐ˜์ง€๋ฆ„

// 2) ์™ธ/๋‚ด๋ถ€ ๋ฐ˜๋†’์ด ๊ณ„์‚ฐ (shellHeight ๊ธฐ์ค€)
G4double IR_outerHalfZ = IRHeight/2.0;           // 44.4/2 = 22.2 mm
G4double IR_innerHalfZ =IR_outerHalfZ - IR_thick;    // 22.2 - 1 = 21.2 mm

// 3) ์™ธ๋ถ€ ์›๊ธฐ๋‘ฅ: ๋ฐ˜์ง€๋ฆ„ vacuumIR + IR_thick, ๋ฐ˜๋†’์ด IR_outerHalfZ
G4Tubs* IROuter = new G4Tubs(
  "IROuter",
  0.0,

  vacuumlR + IR_thick,  // 42.5 + 2.9 = 45.4 mm
  IR_outerHalfZ,            // 22.25 mm
  0.*deg, 360.*deg
);

// 4) ๋‚ด๋ถ€ ์›๊ธฐ๋‘ฅ(๋นˆ ๊ณต๊ฐ„): ๋ฐ˜์ง€๋ฆ„ crystalR, ๋ฐ˜๋†’์ด innerHalfZ
G4Tubs* IRInner = new G4Tubs(
  "IRInner",
  0.0,
  vacuumlR,       // 42.5 mm
  IR_innerHalfZ,     // 19.35 mm
  0.*deg, 360.*deg
);

// 5) SubtractionSolid ๋กœ ๋นˆ ์…ธ ์ƒ์„ฑ
auto IRShellSolid = new G4SubtractionSolid(
  "IRShell",
  IROuter,
  IRInner,
  nullptr,
  G4ThreeVector(0,0,0)
);

// 6) ๋…ผ๋ฆฌ ๋ณผ๋ฅจ ์ƒ์„ฑ (์ง„๊ณต ๋ฌผ์งˆ)
auto IRShellLogic = new G4LogicalVolume(
  IRShellSolid,
  Al_Material,    // G4NistManager::Instance()->FindOrBuildMaterial("G4_Galactic")
  "IRShellLV"
);

//7) ๋ฐฐ์น˜ (ํฌ๋ฆฌ์Šคํƒˆ๊ณผ ๊ฐ™์€ ์œ„์น˜/ํšŒ์ „)
new G4PVPlacement(
  rotY180,
  G4ThreeVector(0, 0, 1.75*mm ),
  IRShellLogic,
  "IRShellPV",
  CryoVacCavLV,
  false, 0, true
);

auto IR_Shell = new G4VisAttributes(G4Colour(1.0, 1.0, 1.0, 0.3));
IR_Shell->SetForceSolid(true);
IRShellLogic->SetVisAttributes(IR_Shell);

G4Tubs* irCap  = new G4Tubs("IRCap",
  0, vacuumlR + IR_thick, 1.0/2 * mm, 0.*deg,360.*deg);

  auto IRCapLogic = new G4LogicalVolume(
    irCap,
    Al_Material,    // G4NistManager::Instance()->FindOrBuildMaterial("G4_Galactic")
    "irCapLV"
  );

  new G4PVPlacement(
    0,
    G4ThreeVector(0, 0, -21.2*mm ),
    IRCapLogic,
    "irCapPV",
    CryoVacCavLV,
    false, 0, true
  );

auto IRCap_Shell = new G4VisAttributes(G4Colour(1.0, 1.0, 1.0, 0.3));
IRCap_Shell->SetForceSolid(true);
IRCapLogic->SetVisAttributes(IRCap_Shell);




G4double IR_halfZ = (43.9)/2*mm;

// IR ๊ป๋ฐ๊ธฐ ๋‚ด๋ถ€ โ€œ๋นˆ ๊ณต๊ฐ„โ€ ์›ํ†ต๋งŒ ๋งŒ๋“ฆ
auto vacCavSolid = new G4Tubs("VacCav",
  0,         // inner R
  vacuumlR,  // outer R = 49 mm
  IR_halfZ,  // half-height
  0*deg,360*deg);
auto vacCavLV = new G4LogicalVolume(vacCavSolid,
        VacuumMater,
        "VacCavLV");
new G4PVPlacement(nullptr,
G4ThreeVector(0,0,0),
vacCavLV,
"VacCavPV",
IRShellLogic,
false,0,true);

auto IR_Vac = new G4VisAttributes(G4Colour(1.0, 1.0, 1.0, 0.3));
IR_Vac->SetForceSolid(true);
vacCavLV->SetVisAttributes(IR_Vac);



  // Detector
  //
  G4double cry_r = fDetectorLength;
  G4double cry_h = fDetectorThickness;
  G4Tubs* crySolid = new G4Tubs("Detector",
                                0, cry_r, cry_h/2, 0.*deg,360.*deg);
  G4Tubs* core     = new G4Tubs("CoreSolid",
                                0, 3.5*mm,  9.0*mm, 0.*deg,360.*deg);
  auto cryFinal    = new G4SubtractionSolid(
                        "CrystalWithCore", crySolid, core,
                        nullptr, G4ThreeVector(0,0,-6.0*mm));
  fLogicDetector   = new G4LogicalVolume(cryFinal,
                                         fDetectorMater,
                                         "Detector");

  auto visCry      = new G4VisAttributes(G4Colour(0,1,1));
  visCry->SetForceSolid(true);
  fLogicDetector->SetVisAttributes(visCry);


   new G4PVPlacement(0,                         //rot180
                           G4ThreeVector(0, 0,  4.05*mm),             //at (0,0,0)
                           fLogicDetector,              //logical volume
                           "Detector",                  //name
                           vacCavLV,                      //mother  volume
                           false,                       //no boolean operation
                           0);                          //copy number


  PrintParameters();
  
  //always return the root volume
  //
  return fPhysiWorld;

What does your geometry look like in UI mode? As a first item to address would be to remove all subtraction solids and instead use mother-daughter relationships for your geometry. If a volume is fully enclosed in another make it a daughter of that volume. Subtraction solids can cause unpredictable behavior at the boundaries between volumes of different materials (that are not the world) because of floating point and rounding errors. These would not be caught by the geometry tests you ran.

1 Like

Thank you, Sir, as always, for your help. I, too, suspected that placing the boundary so tightly might be the cause, and thanks to you I was able to find a clear solution and resolve the issue successfully. I hope you have a wonderful day!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.