Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add binding for G4MultiSensitiveDetector #28

Merged
merged 2 commits into from
Dec 8, 2024

Conversation

bnara
Copy link
Contributor

@bnara bnara commented Dec 2, 2024

My model needed G4MultiSensitiveDetector. I based this off the existing binding for G4MultiFunctionalDetector.

@HaarigerHarald
Copy link
Owner

Reading up on what this does now, I think this is for internal use only. When one passes multiple G4VSensitiveDetector to its G4VUserDetectorConstruction this will accommodate them automatically in a vector. Would you mind sharing how you intended to use it? And can you achieve a similar result by calling SetSensitiveDetector multiple times in a row with all G4VSensitiveDetectors you are planning to add to the logic volume?

@bnara
Copy link
Contributor Author

bnara commented Dec 6, 2024

Thanks for adding the iterator!

I am using G4MultiSensitiveDetector to effectively assign multiple instances of G4VSensitiveDetector to a single G4LogicalVolume.

I don't believe the same result can be achieved by calling SetSensitiveDetector multiple times:
G4LogicalVolume.cc#L478

@HaarigerHarald HaarigerHarald merged commit 4da3c84 into HaarigerHarald:main Dec 8, 2024
4 checks passed
@HaarigerHarald
Copy link
Owner

HaarigerHarald commented Dec 8, 2024

Ahh I see, you are adding it manually to the G4LogicalVolume via its member function. While I think this method is the preferred way G4VUserDetectorConstruction.cc#L217 and would automatically put multiple G4VSensitiveDetector in a G4MultiSensitiveDetector, I still think binding G4MultiSensitiveDetector might be useful when one tries to manipulate it later. Thanks

@bnara
Copy link
Contributor Author

bnara commented Dec 8, 2024

Thanks! I didn't know about G4VUserDetectorConstruction::SetSensitiveDetector(). In my model, I create and initialize the sensitive detectors at a later stage following geometry construction, so I ended up directly using G4MultiSensitiveDetector.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants