|
DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
Go to the documentation of this file.
22 #include <G4HCofThisEvent.hh>
57 G4HCofThisEvent* hce = evt->GetHCofThisEvent();
59 int nCol = hce->GetNumberOfCollections();
64 printout(WARNING,
name(),
"+++ [Event:%d] No valid MC truth info present. "
65 "Is a Particle handler installed ?",evt->GetEventID());
69 for (
int i = 0; i < nCol; ++i) {
75 printout(ERROR,
name(),
"+++ [Event:%d] Exception while saving event:%s",
76 evt->GetEventID(),e.what());
80 printout(ERROR,
name(),
"+++ [Event:%d] UNKNWON Exception while saving event",
87 printout(ERROR,
name(),
"+++ [Event:%d] Exception while saving event:%s",
88 evt->GetEventID(),e.what());
92 printout(ERROR,
name(),
"+++ [Event:%d] UNKNWON Exception while saving event",
99 printout(WARNING,
"Geant4OutputAction",
100 "+++ The value of G4HCofThisEvent is NULL. No collections saved!");
Geant4RunActionSequence & runAction() const
Access to the main run action sequence from the kernel object.
Geant4OutputAction()=delete
Inhibit default constructor.
virtual void endRun(const G4Run *run)
Callback to store the Geant4 run information.
virtual void saveRun(const G4Run *run)
Callback to store the Geant4 event.
virtual void configureFiber(Geant4Context *thread_context)
Set or update client for the use in a new thread fiber.
void exception(const std::string &src, const std::string &msg)
void callAtBegin(Q *p, void(T::*f)(const G4Run *))
Register begin-of-run callback. Types Q and T must be polymorph!
Class of the Geant4 toolkit. See http://www-geant4.kek.jp/Reference.
static void increment(T *)
Increment count according to type information.
Geant4Event & event() const
Access the geant4 event – valid only between BeginEvent() and EndEvent()!
void callAtEnd(Q *p, void(T::*f)(const G4Run *))
Register end-of-run callback. Types Q and T must be polymorph!
Helper class for thread savety.
Data structure to map particles produced during the generation and the simulation.
T * extension(bool alert=true)
Access to type safe extension object. Exception is thrown if the object is invalid.
Concrete basic implementation of the Geant4 event action.
virtual void commit(OutputContext< G4Event > &ctxt)
Commit data at end of filling procedure.
Geant4ParticleMap * m_truth
Reference to MC truth object.
Geant4Action & declareProperty(const std::string &nam, T &val)
Declare property.
static void decrement(T *)
Decrement count according to type information.
virtual void beginRun(const G4Run *run)
Callback to initialize storing the Geant4 information.
virtual void saveEvent(OutputContext< G4Event > &ctxt)
Callback to store the Geant4 event.
const std::string & name() const
Access name of the action.
virtual void end(const G4Event *event) override
End-of-event callback.
virtual void begin(const G4Event *event) override
begin-of-event callback
std::string m_output
Property: "Output" output destination.
Namespace for the Geant4 based simulation part of the AIDA detector description toolkit.
virtual ~Geant4OutputAction()
Default destructor.
virtual void saveCollection(OutputContext< G4Event > &ctxt, G4VHitsCollection *collection)
Callback to store each Geant4 hit collection.
bool isValid() const
Check if the particle map was ever filled (ie. some particle handler was present)
bool m_errorFatal
Property: "HandleErrorsAsFatal" Handle errors as fatal and rethrow eventual exceptions.
virtual void configureFiber(Geant4Context *ctxt) override
Set or update client for the use in a new thread fiber.
Generic context to extend user, run and event information.
Geant4Context * context() const
Access the context.