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

WIP: initialize the SD so that geant4 will invoke the correct Drift Chamber SD.

parent e185ef0a
No related branches found
No related tags found
No related merge requests found
...@@ -14,8 +14,8 @@ double BetheBlochEquationDedxSimTool::dedx(const G4Step* aStep) ...@@ -14,8 +14,8 @@ double BetheBlochEquationDedxSimTool::dedx(const G4Step* aStep)
G4Material* material = gTrack->GetMaterial(); G4Material* material = gTrack->GetMaterial();
G4double material_density = material->GetDensity() / (CLHEP::g/CLHEP::cm3); // conert from G4 unit. G4double material_density = material->GetDensity() / (CLHEP::g/CLHEP::cm3); // conert from G4 unit.
G4double material_Z = material->GetZ(); G4double material_Z = m_material_Z;
G4double material_A = material->GetA(); G4double material_A = m_material_A;
m_I = material_Z*10; // Approximate m_I = material_Z*10; // Approximate
......
...@@ -41,6 +41,8 @@ DriftChamberSensDetTool::createSD(const std::string& name) { ...@@ -41,6 +41,8 @@ DriftChamberSensDetTool::createSD(const std::string& name) {
if (name == "DriftChamber") { if (name == "DriftChamber") {
DriftChamberSensitiveDetector* dcsd = new DriftChamberSensitiveDetector(name, *dd4hep_geo); DriftChamberSensitiveDetector* dcsd = new DriftChamberSensitiveDetector(name, *dd4hep_geo);
dcsd->setDedxSimTool(m_dedx_simtool); dcsd->setDedxSimTool(m_dedx_simtool);
sd = dcsd;
} }
......
...@@ -46,6 +46,8 @@ DriftChamberSensitiveDetector::ProcessHits(G4Step* step, G4TouchableHistory*) { ...@@ -46,6 +46,8 @@ DriftChamberSensitiveDetector::ProcessHits(G4Step* step, G4TouchableHistory*) {
HitContribution contrib = dd4hep::sim::Geant4Hit::extractContribution(step); HitContribution contrib = dd4hep::sim::Geant4Hit::extractContribution(step);
// Now, invokes the dE/dx simulator // Now, invokes the dE/dx simulator
double dedx = 0.0; double dedx = 0.0;
dedx = m_dedx_simtool->dedx(step);
// G4cout << "-----> dedx: " << dedx << G4endl;
double de = hit_len * dedx; double de = hit_len * dedx;
// contrib.deposit = de; // if need the de from dedx simulator // contrib.deposit = de; // if need the de from dedx simulator
......
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