celeritas
celeritas copied to clipboard
Define new detector params class for managing Geant4 SD callbacks
This will (eventually) replace some components of the GeantSd and HitProcessor classes and prepare them for optical detectors. It should also replace part of the SimpleCalo class (basically could start as a refactoring of it). This should be used for #1746 and, more immediately, #1397.
Construction will be with list of canonical volume IDs and geo interface
DetectorParamsData:
Collection<DetectorId, W, M, VolumeId> detector_ids
Class interface:
class DetectorParams : public ParamsDataInterface<DetectorParamsData>- Member function to return DetectorId -> VolumeId
- Lives in
celeritas/user
Then:
- Add to optical core params
- CoreParamsData would have a
DetectorParamsData<Ownership::const_reference, M> detectors
Future work:
- Add to global core params
- Add thread-local DetectorId -> G4SD* mapping
- Replace components in GeantSd
See #1764
Add detectors to the inp::Model:
Detectorstruct- DetectorId moves to geocel/Types
- GeantGeoParams defines
G4SD* id_to_geant(DetectorId)andgeant_to_idfunctions (use code fromGeantSd::setup_volumesto map) - Add tests to GeantGeo.test.cc (model testing is implemented in
GenericGeoResults.{hh,cc} - Update
SDParamsto takeinp::Detectors - Construct SDParams in
setup::model - Add SDParams to global
CoreParams::Inputand store in CoreParams - Copy to optical core params via OpticalCollector
- Look up post-volume crossing in optical PostBoundaryExecutor, log and absorb if detector found
struct Detector
{
Label label;
std::vector<VolumeId> volumes;
};