28 using namespace DD4hep::Simulation;
29 using namespace DD4hep::Simulation::Test;
44 Geant4TestBase::Geant4TestBase(
Geant4Action* a,
const std::string& typ)
69 PRINT(
"%s> calling Geant4TestGeneratorAction(event_id=%d Context: run=%p evt=%p)",
86 PRINT(
"%s> calling begin(run_id=%d,num_event=%d Context:%p)",
m_type.c_str(), run->GetRunID(),
87 run->GetNumberOfEventToBeProcessed(), &
context()->
run());
92 PRINT(
"%s> calling end(run_id=%d, num_event=%d Context:%p)",
93 m_type.c_str(), run->GetRunID(), run->GetNumberOfEvent(), &
context()->
run());
98 PRINT(
"%s> calling beginEvent(event_id=%d Context: run=%p evt=%p)",
104 PRINT(
"%s> calling endEvent(event_id=%d Context: run=%p evt=%p)",
120 PRINT(
"%s> calling begin(event_id=%d Context: run=%p (%d) evt=%p (%d))",
121 m_type.c_str(), evt->GetEventID(),
128 PRINT(
"%s> calling end(event_id=%d Context: run=%p (%d) evt=%p (%d))",
136 PRINT(
"%s> calling beginRun(run_id=%d,num_event=%d Context:%p)",
137 m_type.c_str(), run->GetRunID(),
143 PRINT(
"%s> calling endRun(run_id=%d, num_event=%d Context:%p)",
144 m_type.c_str(), run->GetRunID(),
160 PRINT(
"%s> calling begin(track=%d, parent=%d, position=(%f,%f,%f) Context: run=%p evt=%p)",
161 m_type.c_str(), trk->GetTrackID(),
162 trk->GetParentID(), trk->GetPosition().x(), trk->GetPosition().y(), trk->GetPosition().z(),
168 PRINT(
"%s> calling end(track=%d, parent=%d, position=(%f,%f,%f) Context: run=%p evt=%p)",
169 m_type.c_str(), trk->GetTrackID(),
170 trk->GetParentID(), trk->GetPosition().x(), trk->GetPosition().y(), trk->GetPosition().z(),
205 PRINT(
"%s> calling begin(num_coll=%d, coll=%s Context: run=%p evt=%p)",
206 m_type.c_str(), hce->GetNumberOfCollections(),
213 PRINT(
"%s> calling end(num_coll=%d, coll=%s Context: run=%p evt=%p)",
214 m_type.c_str(), hce->GetNumberOfCollections(),
221 PRINT(
"%s> calling process(track=%d, dE=%f, dT=%f len=%f, First,last in Vol=(%c,%c), coll=%s Context: run=%p evt=%p)",
222 m_type.c_str(), step->GetTrack()->GetTrackID(),
223 step->GetTotalEnergyDeposit(), step->GetDeltaTime(),
224 step->GetStepLength(), step->IsFirstStepInVolume() ?
'Y' :
'N',
225 step->IsLastStepInVolume() ?
'Y' :
'N',
virtual void begin(const G4Event *)
begin-of-event callback
Geant4TestSensitive(Geant4Context *c, const std::string &n, DetElement det, LCDD &lcdd)
Standard constructor with initializing arguments.
Geant4Event & event() const
Access the geant4 event – valid only between BeginEvent() and EndEvent()!
Geant4TestStepAction(Geant4Context *c, const std::string &n)
Standard constructor with initializing arguments.
virtual ~Geant4TestEventAction()
Default destructor.
HitCollection * collection(size_t which)
Retrieve the hits collection associated with this detector by its serial number.
static void decrement(T *)
Decrement count according to type information.
Common base class for test action.
Default base class for all geant 4 tracking actions used in DDG4.
virtual bool process(G4Step *, G4TouchableHistory *)
Method for generating hit(s) using the information of G4Step object.
const G4Run & run() const
Access the G4Event directly: Explicit G4Run accessor.
Concrete basic implementation of the Geant4 run action base class.
virtual ~Geant4TestGeneratorAction()
Default destructor.
Concrete basic implementation of the Geant4 event action.
void beginRun(const G4Run *)
begin-of-run callback
Geant4Context * context() const
Access the context.
Concrete implementation of the Geant4 stepping action sequence.
Geant4TestEventAction(Geant4Context *c, const std::string &n)
Standard constructor with initializing arguments.
virtual void begin(G4HCofThisEvent *)
Begin-of-tracking callback.
void endEvent(const G4Event *)
End-of-event callback.
Geant4TestGeneratorAction(Geant4Context *c, const std::string &n)
Standard constructor with initializing arguments.
HitCollection * collectionByID(size_t id)
Retrieve the hits collection associated with this detector by its collection identifier.
The base class for Geant4 sensitive detector actions implemented by users.
void beginEvent(const G4Event *)
begin-of-event callback
Geant4Run & run() const
Access the geant4 run – valid only between BeginRun() and EndRun()!
void begin(const G4Run *)
begin-of-run callback
virtual void end(G4HCofThisEvent *)
End-of-tracking callback.
void end(const G4Run *)
End-of-run callback.
Concrete implementation of the Geant4 generator action base class.
const G4Event & event() const
Access the G4Event directly: Explicit G4Event accessor.
Generic hit container class using Geant4HitWrapper objects.
void endRun(const G4Run *)
End-of-run callback.
void operator()(const G4Step *, G4SteppingManager *)
User stepping callback.
virtual void operator()(G4Event *)
Callback to generate primary particles.
virtual ~Geant4TestTrackAction()
Default destructor.
static void increment(T *)
Increment count according to type information.
Handle class describing a detector element.
Geant4Event * eventPtr() const
Access the geant4 event by ptr. Must be checked by clients!
Geant4TestTrackAction(Geant4Context *c, const std::string &n)
Standard constructor with initializing arguments.
virtual void end(const G4Event *)
End-of-event callback.
Generic context to extend user, run and event information.
Geant4TestRunAction(Geant4Context *c, const std::string &n)
Standard constructor with initializing arguments.
The main interface to the DD4hep detector description package.
virtual ~Geant4TestRunAction()
Default destructor.
virtual ~Geant4TestSensitive()
Default destructor.
virtual void begin(const G4Track *)
Begin-of-tracking callback.
Geant4Action & declareProperty(const std::string &nam, T &val)
Declare property.
virtual ~Geant4TestBase()
Default destructor.
virtual ~Geant4TestStepAction()
Default destructor.
Default base class for all Geant 4 actions and derivates thereof.
Geant4Run * runPtr() const
Access the geant4 run by ptr. Must be checked by clients!
virtual void end(const G4Track *)
End-of-tracking callback.