Hello,
I am trying to add an EventAction class just like in example B4d, however when I set the SensitiveDetectors in ConstructSDandField the particles doesn’t interact with the geometry of the detectors at all.
Here is a part of my code where I try to set my sensitive detectors, just like in example B4d
void MyDetectorConstruction::ConstructSDandField()
{
G4SDManager::GetSDMpointer()->SetVerboseLevel(1);
auto caloDec = new G4MultiFunctionalDetector("CalorimeterDetector");
G4SDManager::GetSDMpointer()->AddNewDetector(caloDec);
G4VPrimitiveScorer* primitive;
primitive = new G4PSEnergyDeposit("Edep");
caloDec->RegisterPrimitive(primitive);
primitive = new G4PSTrackLength("TrackLength");
auto charged = new G4SDChargedFilter("chargedFilter");
primitive->SetFilter(charged);
caloDec->RegisterPrimitive(primitive);
SetSensitiveDetector("caloDetector", caloDec);
auto posDec = new G4MultiFunctionalDetector("PositronDec");
G4SDManager::GetSDMpointer()->AddNewDetector(posDec);
primitive = new G4PSEnergyDeposit("Edep");
posDec->RegisterPrimitive(primitive);
primitive = new G4PSTrackLength("TrackLength");
primitive ->SetFilter(charged);
posDec->RegisterPrimitive(primitive);
SetSensitiveDetector("positronDetector", posDec);
Thank you.