Skip to content
Snippets Groups Projects
Commit 0cbb0430 authored by fangwx@ihep.ac.cn's avatar fangwx@ihep.ac.cn
Browse files

save the data in DriftChamberSensitiveDetector

parent 3aac1456
No related branches found
No related tags found
No related merge requests found
...@@ -89,10 +89,6 @@ Edm4hepWriterAnaElemTool::BeginOfEventAction(const G4Event* anEvent) { ...@@ -89,10 +89,6 @@ Edm4hepWriterAnaElemTool::BeginOfEventAction(const G4Event* anEvent) {
m_track2primary.clear(); m_track2primary.clear();
auto SimPIonCol = m_SimPrimaryIonizationCol.createAndPut(); auto SimPIonCol = m_SimPrimaryIonizationCol.createAndPut();
if(hasTrackHeedSimTool){
debug() << "reset TrackHeedSimTool" << endmsg;
m_TrackHeedSimTool->reset();
}
} }
...@@ -102,11 +98,7 @@ Edm4hepWriterAnaElemTool::EndOfEventAction(const G4Event* anEvent) { ...@@ -102,11 +98,7 @@ Edm4hepWriterAnaElemTool::EndOfEventAction(const G4Event* anEvent) {
msg() << "mcCol size (after simulation) : " << mcCol->size() << endmsg; msg() << "mcCol size (after simulation) : " << mcCol->size() << endmsg;
// save all data // save all data
auto SimPrimaryIonizationCol = m_SimPrimaryIonizationCol.get(); auto SimPrimaryIonizationCol = m_SimPrimaryIonizationCol.get();
msg() << "SimPrimaryIonizationCol size ="<<SimPrimaryIonizationCol->size()<<endmsg; //msg() << "SimPrimaryIonizationCol size ="<<SimPrimaryIonizationCol->size()<<endmsg;
if(hasTrackHeedSimTool){
debug() << "call endOfEvent() for TrackHeedSimTool" << endmsg;
m_TrackHeedSimTool->endOfEvent();
}
// create collections. // create collections.
auto trackercols = m_trackerCol.createAndPut(); auto trackercols = m_trackerCol.createAndPut();
auto calorimetercols = m_calorimeterCol.createAndPut(); auto calorimetercols = m_calorimeterCol.createAndPut();
...@@ -573,12 +565,6 @@ StatusCode ...@@ -573,12 +565,6 @@ StatusCode
Edm4hepWriterAnaElemTool::initialize() { Edm4hepWriterAnaElemTool::initialize() {
StatusCode sc; StatusCode sc;
m_TrackHeedSimTool = ToolHandle<IDedxSimTool>("TrackHeedSimTool",nullptr,false);
if(m_TrackHeedSimTool){
msg() << "find TrackHeedSimTool" << endmsg;
hasTrackHeedSimTool = true;
}
return sc; return sc;
} }
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "edm4hep/SimCalorimeterHitCollection.h" #include "edm4hep/SimCalorimeterHitCollection.h"
#include "edm4hep/CaloHitContributionCollection.h" #include "edm4hep/CaloHitContributionCollection.h"
#include "edm4hep/SimPrimaryIonizationClusterCollection.h" #include "edm4hep/SimPrimaryIonizationClusterCollection.h"
#include <DetSimInterface/IDedxSimTool.h>
class Edm4hepWriterAnaElemTool: public extends<AlgTool, IAnaElemTool> { class Edm4hepWriterAnaElemTool: public extends<AlgTool, IAnaElemTool> {
...@@ -156,8 +155,6 @@ private: ...@@ -156,8 +155,6 @@ private:
double Z = 0; double Z = 0;
bool verboseOutput = false; bool verboseOutput = false;
ToolHandle<IDedxSimTool> m_TrackHeedSimTool;
bool hasTrackHeedSimTool = false;
}; };
#endif #endif
...@@ -102,19 +102,19 @@ class TrackHeedSimTool: public extends<AlgTool, IDedxSimTool> { ...@@ -102,19 +102,19 @@ class TrackHeedSimTool: public extends<AlgTool, IDedxSimTool> {
Sensor* m_sensor; Sensor* m_sensor;
std::map<int, std::string> m_particle_map; std::map<int, std::string> m_particle_map;
int m_previous_track_ID; int m_previous_track_ID=0;
float m_previous_KE; float m_previous_KE=0;
int m_current_track_ID; int m_current_track_ID;
int m_current_Parent_ID; int m_current_Parent_ID;
int m_pdg_code; int m_pdg_code;
G4StepPoint* m_pre_point; G4StepPoint* m_pre_point;
G4StepPoint* m_post_point; G4StepPoint* m_post_point;
G4double m_total_range; G4double m_total_range;
bool m_isFirst; bool m_isFirst=true;
bool m_change_track; bool m_change_track;
edm4hep::MCParticle m_mc_paricle; edm4hep::MCParticle m_mc_paricle;
float m_tot_edep; float m_tot_edep=0;
float m_tot_length; float m_tot_length=0;
float m_pa_KE; float m_pa_KE;
G4double m_pre_x ; G4double m_pre_x ;
......
...@@ -22,7 +22,6 @@ StatusCode DriftChamberSensDetTool::initialize() { ...@@ -22,7 +22,6 @@ StatusCode DriftChamberSensDetTool::initialize() {
error() << "Failed to find dedx simtoo." << endmsg; error() << "Failed to find dedx simtoo." << endmsg;
return StatusCode::FAILURE; return StatusCode::FAILURE;
} }
return sc; return sc;
} }
......
...@@ -71,5 +71,6 @@ DriftChamberSensitiveDetector::ProcessHits(G4Step* step, G4TouchableHistory*) { ...@@ -71,5 +71,6 @@ DriftChamberSensitiveDetector::ProcessHits(G4Step* step, G4TouchableHistory*) {
void void
DriftChamberSensitiveDetector::EndOfEvent(G4HCofThisEvent* HCE) { DriftChamberSensitiveDetector::EndOfEvent(G4HCofThisEvent* HCE) {
m_dedx_simtool->endOfEvent();
m_dedx_simtool->reset();
} }
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