Skip to content
Snippets Groups Projects
Commit fba931eb authored by lintao@ihep.ac.cn's avatar lintao@ihep.ac.cn
Browse files

WIP: add the DriftChamberSensDetTool. The SD is not created yet.

parent a06eb391
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,8 @@ set(DetSimSD_srcs
src/DDG4SensitiveDetector.cpp
src/CaloSensitiveDetector.cpp
src/DriftChamberSensDetTool.cpp
)
gaudi_add_module(DetSimSD ${DetSimSD_srcs}
......
#include "DriftChamberSensDetTool.h"
#include "G4VSensitiveDetector.hh"
#include "DD4hep/Detector.h"
DECLARE_COMPONENT(DriftChamberSensDetTool);
StatusCode DriftChamberSensDetTool::initialize() {
StatusCode sc;
m_geosvc = service<IGeoSvc>("GeoSvc");
if (!m_geosvc) {
error() << "Failed to find GeoSvc." << endmsg;
return StatusCode::FAILURE;
}
return sc;
}
StatusCode DriftChamberSensDetTool::finalize() {
StatusCode sc;
return sc;
}
G4VSensitiveDetector*
DriftChamberSensDetTool::createSD(const std::string& name) {
dd4hep::Detector* dd4hep_geo = m_geosvc->lcdd();
G4VSensitiveDetector* sd = nullptr;
return sd;
}
#ifndef DriftChamberSensDetTool_h
#define DriftChamberSensDetTool_h
/*
* DriftChamberSensDetTool is used to create Drift Chamber SD.
*
* It will use DedxSimTool to give the dE/dx value.
*
* -- 17 Sept 2020, Tao Lin <lintao@ihep.ac.cn>
*/
#include "GaudiKernel/AlgTool.h"
#include "DetSimInterface/ISensDetTool.h"
#include "DetInterface/IGeoSvc.h"
class DriftChamberSensDetTool: public extends<AlgTool, ISensDetTool> {
public:
using extends::extends;
/// Overriding initialize and finalize
StatusCode initialize() override;
StatusCode finalize() override;
/// Override ISensDetTool
virtual G4VSensitiveDetector* createSD(const std::string& name) override;
private:
// in order to initialize SD, we need to get the lcdd()
SmartIF<IGeoSvc> m_geosvc;
};
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment