Skip to content
Snippets Groups Projects
CalorimeterSensDetTool.cpp 764 B
Newer Older
lintao@ihep.ac.cn's avatar
lintao@ihep.ac.cn committed
#include "CalorimeterSensDetTool.h"

#include "G4VSensitiveDetector.hh"

#include "DetSimSD/CaloSensitiveDetector.h"

#include "DD4hep/Detector.h"

lintao@ihep.ac.cn's avatar
lintao@ihep.ac.cn committed
DECLARE_COMPONENT(CalorimeterSensDetTool);

StatusCode
CalorimeterSensDetTool::initialize() {
    StatusCode sc;


    m_geosvc = service<IGeoSvc>("GeoSvc");
    if (!m_geosvc) {
        error() << "Failed to find GeoSvc." << endmsg;
        return StatusCode::FAILURE;
    }


lintao@ihep.ac.cn's avatar
lintao@ihep.ac.cn committed
    return sc;
}

StatusCode
CalorimeterSensDetTool::finalize() {
    StatusCode sc;

    return sc;
}

G4VSensitiveDetector*
CalorimeterSensDetTool::createSD(const std::string& name) {

    dd4hep::Detector* dd4hep_geo = m_geosvc->lcdd();

    G4VSensitiveDetector* sd = new CaloSensitiveDetector(name, *dd4hep_geo);