Sensitive Detector and Detector Construction classes not found though defined in header files

Hi everyone!
I am trying to build my detector based on the exampleB1, but with hits/sensitive detector classes added. However, my code doesn’t compile referring to undeclared identifiers C1DetectorConstruction and C1SensitiveDetector. I’ve already checked everything up: I have defined classes in header files, I have included those files into source files, and include and src paths links are present in the CMakeLists.txt file.

Any ideas? I feel like I’m missing some tiny important thing…

Thank you a lot in advance for suggestions!
Vasily


Did you call a SD manager pointer and add the new detector in logical volume ? `

  G4SDManager* SDman = G4SDManager::GetSDMpointer();
    G4String SDname;
    
    G4VSensitiveDetector* X = new TrackerSD(SDname="/X");
    SDman->AddNewDetector(X);
    logicalX->SetSensitiveDetector(X);

You can refer Example B2 and B5 for hits and sensitive detector.

The OP’s errors are compile-time, not runtime.

Are you sure that you have the right #include statements in your C1DetectorConstruction.cc file? That file must contain both

#include "C1DetectorConstruction.hh"
#include "C1SensitiveDetector.hh"
1 Like

Hi Michael! Thanks for your response! Yes, files were inside.
Apparently I assume there was some typo, since I re-wrote all the files and it compiled. Thanks