diff --git a/Simulation/DetSimAna/src/Edm4hepWriterAnaElemTool.cpp b/Simulation/DetSimAna/src/Edm4hepWriterAnaElemTool.cpp index 4d7c3406c..b6ab38e67 100644 --- a/Simulation/DetSimAna/src/Edm4hepWriterAnaElemTool.cpp +++ b/Simulation/DetSimAna/src/Edm4hepWriterAnaElemTool.cpp @@ -89,10 +89,6 @@ Edm4hepWriterAnaElemTool::BeginOfEventAction(const G4Event* anEvent) { m_track2primary.clear(); auto SimPIonCol = m_SimPrimaryIonizationCol.createAndPut(); - if(hasTrackHeedSimTool){ - debug() << "reset TrackHeedSimTool" << endmsg; - m_TrackHeedSimTool->reset(); - } } @@ -102,11 +98,7 @@ Edm4hepWriterAnaElemTool::EndOfEventAction(const G4Event* anEvent) { msg() << "mcCol size (after simulation) : " << mcCol->size() << endmsg; // save all data auto SimPrimaryIonizationCol = m_SimPrimaryIonizationCol.get(); - msg() << "SimPrimaryIonizationCol size ="<size()<endOfEvent(); - } + //msg() << "SimPrimaryIonizationCol size ="<size()<("TrackHeedSimTool",nullptr,false); - if(m_TrackHeedSimTool){ - msg() << "find TrackHeedSimTool" << endmsg; - hasTrackHeedSimTool = true; - } - return sc; } diff --git a/Simulation/DetSimAna/src/Edm4hepWriterAnaElemTool.h b/Simulation/DetSimAna/src/Edm4hepWriterAnaElemTool.h index 6aedbdc60..60cc930a4 100644 --- a/Simulation/DetSimAna/src/Edm4hepWriterAnaElemTool.h +++ b/Simulation/DetSimAna/src/Edm4hepWriterAnaElemTool.h @@ -16,7 +16,6 @@ #include "edm4hep/SimCalorimeterHitCollection.h" #include "edm4hep/CaloHitContributionCollection.h" #include "edm4hep/SimPrimaryIonizationClusterCollection.h" -#include class Edm4hepWriterAnaElemTool: public extends { @@ -156,8 +155,6 @@ class Edm4hepWriterAnaElemTool: public extends { double Z = 0; bool verboseOutput = false; - ToolHandle m_TrackHeedSimTool; - bool hasTrackHeedSimTool = false; }; #endif diff --git a/Simulation/DetSimDedx/src/TrackHeedSimTool.h b/Simulation/DetSimDedx/src/TrackHeedSimTool.h index 46a9bd89b..8696d4f66 100644 --- a/Simulation/DetSimDedx/src/TrackHeedSimTool.h +++ b/Simulation/DetSimDedx/src/TrackHeedSimTool.h @@ -102,19 +102,19 @@ class TrackHeedSimTool: public extends { Sensor* m_sensor; std::map m_particle_map; - int m_previous_track_ID; - float m_previous_KE; + int m_previous_track_ID=0; + float m_previous_KE=0; int m_current_track_ID; int m_current_Parent_ID; int m_pdg_code; G4StepPoint* m_pre_point; G4StepPoint* m_post_point; G4double m_total_range; - bool m_isFirst; + bool m_isFirst=true; bool m_change_track; edm4hep::MCParticle m_mc_paricle; - float m_tot_edep; - float m_tot_length; + float m_tot_edep=0; + float m_tot_length=0; float m_pa_KE; G4double m_pre_x ; diff --git a/Simulation/DetSimSD/src/DriftChamberSensDetTool.cpp b/Simulation/DetSimSD/src/DriftChamberSensDetTool.cpp index c911d4707..58c49d6c6 100644 --- a/Simulation/DetSimSD/src/DriftChamberSensDetTool.cpp +++ b/Simulation/DetSimSD/src/DriftChamberSensDetTool.cpp @@ -22,7 +22,6 @@ StatusCode DriftChamberSensDetTool::initialize() { error() << "Failed to find dedx simtoo." << endmsg; return StatusCode::FAILURE; } - return sc; } diff --git a/Simulation/DetSimSD/src/DriftChamberSensitiveDetector.cpp b/Simulation/DetSimSD/src/DriftChamberSensitiveDetector.cpp index c6ff3db08..c1d768021 100644 --- a/Simulation/DetSimSD/src/DriftChamberSensitiveDetector.cpp +++ b/Simulation/DetSimSD/src/DriftChamberSensitiveDetector.cpp @@ -71,5 +71,6 @@ DriftChamberSensitiveDetector::ProcessHits(G4Step* step, G4TouchableHistory*) { void DriftChamberSensitiveDetector::EndOfEvent(G4HCofThisEvent* HCE) { - + m_dedx_simtool->endOfEvent(); + m_dedx_simtool->reset(); }