Hi everyone,
particles entering a cylinder in the geometry world don’t pass the step fGeomBoundary, when a scoring mesh is placed on top.
Having a sensitive detector attached to cylinders in the first world:
G4RotationMatrix* filterRotation = new G4RotationMatrix();
filterRotation->rotateX(90.*deg);
G4Tubs* ssg = new G4Tubs("theName", 0, 32.*mm, 1.5*mm, 0, CLHEP::twopi);
auto l_ssg = new G4LogicalVolume(ssg, theMaterial, ssg->GetName());
new G4PVPlacement( filterRotation, position + sensorPosition1 + G4ThreeVector(0,170,0)*mm, l_ssg, ssg->GetName(), fWorldVolume, false, 0, checkOverlap);
new G4PVPlacement( filterRotation, position + sensorPosition2 - G4ThreeVector(0,170,0)*mm, l_ssg, ssg->GetName(), fWorldVolume, false, 1, checkOverlap);
and a cylinder mesh:
/score/create/cylinderMesh ssg1
/score/mesh/cylinderSize 32 5 mm
/score/mesh/translate/xyz -25 183.554 82.796 mm
/score/mesh/rotate/rotateX 90 deg
/score/mesh/nBin 11 100 31
/score/quantity/volumeFlux flux
/score/close
the sensitive detector:
G4bool fluxSD::ProcessHits(G4Step* aStep, G4TouchableHistory* /*touchables*/)
{
G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
G4cerr << "stepStatus: " << preStepPoint->GetStepStatus() << G4endl;
if (preStepPoint->GetStepStatus() == fGeomBoundary ) { // inbound particles only
if(aStep->GetTrack()->GetParticleDefinition() == G4Gamma::Gamma()) {
auto hit = new fluxHit();
hit->setEnergy(preStepPoint->GetKineticEnergy());
hit->setWeight(preStepPoint->GetWeight());
hit->setCopyNumber(preStepPoint->GetTouchableHandle()->GetCopyNumber(fDepth));
fHitsCollection->insert(hit);
}
}
return true;
}
without the cylinder mesh, I get events that pass the preStepPoint->GetStepStatus() == fGeomBoundary
check, but when I do have the cylinder mesh, the only stepStatus I obtain from the cylinder is 3 / fAlongStepDoItProc.
Is there something that I am missing? Thanks a lot in advance
Geant4 version Name: geant4-10-07-patch-02 [MT]
edits:
- same behavior with geant4-11-00-beta-01 [MT]
- setting the bin numbers to a different value (e.g.,
/score/mesh/nBin 11 99 31
) makes it work again like a charm. I think this might be a bug? Coinciding surfaces in parallel worlds should not obscure particles penetrating the surface of a sensitive detector, right?