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

WIP: register the dummy fast sim tool.

parent 666145fa
No related branches found
No related tags found
No related merge requests found
......@@ -50,8 +50,13 @@
<vis name="VisibleGreen" alpha="1.0" r="0.0" g="1.0" b="0.0" drawingStyle="solid" lineStyle="solid" showDaughters="true" visible="true"/>
</display>
<regions>
<region name="DriftChamberRegion">
</region>
</regions>
<detectors>
<detector id="1" name="DriftChamber" type="DriftChamber" readout="DriftChamberHitsCollection" vis="VisibleBlue" sensitive="true">
<detector id="1" name="DriftChamber" type="DriftChamber" readout="DriftChamberHitsCollection" vis="VisibleBlue" sensitive="true" region="DriftChamberRegion">
<envelope vis="SeeThrough">
<shape type="BooleanShape" operation="Union" material="Air">
<shape type="Tube" rmin="SDT_inner_chamber_radius_min" rmax="SDT_inner_chamber_radius_max" dz="SDT_half_length" />
......
......@@ -56,13 +56,13 @@ CellID GridDriftChamber::cellID(const Vector3D& /*localPosition*/, const Vector3
_decoder->set(cID, m_phiID, lphi);
std::cout << "#######################################: "
<< " offset : " << m_offset
<< " offsetphi: " << offsetphi
<< " layerID: " << layerID
<< " r: " << _currentRadius
<< " layerphi: " << _currentLayerphi
<< std::endl;
// std::cout << "#######################################: "
// << " offset : " << m_offset
// << " offsetphi: " << offsetphi
// << " layerID: " << layerID
// << " r: " << _currentRadius
// << " layerphi: " << _currentLayerphi
// << std::endl;
return cID;
}
......
......@@ -117,6 +117,13 @@ if int(os.environ.get("VIS", 0)):
detsimalg.RunCmds = [
# "/tracking/verbose 1",
]
from Configurables import DummyFastSimG4Tool
dummy_fastsim_tool = DummyFastSimG4Tool("DummyFastSimG4Tool")
detsimalg.FastSimG4Tools = [
"DummyFastSimG4Tool"
]
detsimalg.AnaElems = [
# example_anatool.name()
# "ExampleAnaElemTool"
......
......@@ -43,7 +43,8 @@ DetSimAlg::initialize() {
// Detector Construction
m_root_detelem = ToolHandle<IDetElemTool>(m_root_det_elem.value());
for (auto fastsimname: m_fast_simtools) {
for (auto fastsimname: m_fast_simnames) {
info() << "Fast Sim Tool: " << fastsimname << endmsg;
m_fast_simtools.push_back(fastsimname);
}
......
......@@ -65,6 +65,8 @@ DetectorConstruction::Construct() {
// Associate Fast Simulation Model and Regions
// =======================================================================
for (auto fastsimtool: m_fast_simtools) {
G4cout << "Invoke CreateFastSimulationModel of fastsimtool instance "
<< m_fast_simtools << G4endl;
fastsimtool->CreateFastSimulationModel();
}
......
#include "DummyFastSimG4Tool.h"
#include "G4Region.hh"
#include "G4RegionStore.hh"
#include "G4VFastSimulationModel.hh"
#include "DummyFastSimG4Model.h"
DECLARE_COMPONENT(DummyFastSimG4Tool);
StatusCode DummyFastSimG4Tool::initialize() {
StatusCode sc;
......@@ -15,6 +21,20 @@ StatusCode DummyFastSimG4Tool::finalize() {
}
bool DummyFastSimG4Tool::CreateFastSimulationModel() {
// In this method:
// * Retrieve the G4Region
// * Create Model
// * Associate model and region
G4String model_name = "DummyFastSimG4Model";
G4String region_name = "DriftChamberRegion";
G4Region* aEnvelope = G4RegionStore::GetInstance()->GetRegion(region_name);
if (!aEnvelope) {
error() << "Failed to find G4Region '" << region_name << "'" << endmsg;
return false;
}
DummyFastSimG4Model* model = new DummyFastSimG4Model(model_name, aEnvelope);
info() << "Create Model " << model_name << " for G4Region " << region_name << endmsg;
return true;
}
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