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

WIP: fix the typo when create SD.

parent aa93522d
No related branches found
No related tags found
No related merge requests found
......@@ -173,7 +173,7 @@ Edm4hepWriterAnaElemTool::EndOfEventAction(const G4Event* anEvent) {
}
dd4hep::sim::Geant4TrackerHit* trk_hit = dynamic_cast<dd4hep::sim::Geant4TrackerHit*>(h);
if (trk_hit) {
if (trk_hit && tracker_col_ptr) {
++n_trk_hit;
// auto edm_trk_hit = trackercols->create();
auto edm_trk_hit = tracker_col_ptr->create();
......@@ -192,10 +192,11 @@ Edm4hepWriterAnaElemTool::EndOfEventAction(const G4Event* anEvent) {
trk_hit->momentum.y()/CLHEP::GeV,
trk_hit->momentum.z()/CLHEP::GeV};
edm_trk_hit.setMomentum(edm4hep::Vector3f(mom));
}
dd4hep::sim::Geant4CalorimeterHit* cal_hit = dynamic_cast<dd4hep::sim::Geant4CalorimeterHit*>(h);
if (cal_hit) {
if (cal_hit && calo_col_ptr) {
++n_cal_hit;
auto edm_calo_hit = calo_col_ptr->create();
edm_calo_hit.setCellID(cal_hit->cellID);
......
......@@ -115,7 +115,7 @@ AnExampleDetElemTool::ConstructSDandField() {
m_driftchamber_sdtool = ToolHandle<ISensDetTool>("DriftChamberSensDetTool");
if (m_driftchamber_sdtool) {
info() << "Find the DriftChamberSensDetTool" << endmsg;
g4sd = m_calo_sdtool->createSD(nam);
g4sd = m_driftchamber_sdtool->createSD(nam);
} else {
warning() << "DriftChamberSensDetTool is not found. " << endmsg;
}
......
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