 |
DD4hep
1.37.0
Detector Description Toolkit for High Energy Physics
|
Go to the documentation of this file.
13 #ifndef DDG4_GEANT4OUTPUT2ROOT_H
14 #define DDG4_GEANT4OUTPUT2ROOT_H
41 using Branches = std::map<std::string, TBranch*>;
42 using Sections = std::map<std::string, TTree*>;
68 TTree*
section(
const std::string& nam);
70 int fill(
const std::string& nam,
const ComponentCast& type,
void* ptr);
75 void beginRun(
const G4Run* run)
override;
87 #endif // DDG4_GEANT4OUTPUT2ROOT_H
void saveEvent(OutputContext< G4Event > &ctxt) override
Callback to store the Geant4 event.
std::map< std::string, TTree * > Sections
Class of the Geant4 toolkit. See http://www-geant4.kek.jp/Reference.
Base class to output Geant4 event data to persistent media.
bool m_handleMCTruth
Property: Flag if Monte-Carlo truth should be followed and checked.
void commit(OutputContext< G4Event > &ctxt) override
Commit data at end of filling procedure.
Helper class for thread savety.
Geant4Output2ROOT(Geant4Context *context, const std::string &nam)
Standard constructor.
TTree * m_tree
Reference to the event data tree (owned by m_file)
int fill(const std::string &nam, const ComponentCast &type, void *ptr)
Fill single EVENT branch entry (Geant4 collection data)
std::map< std::string, TBranch * > Branches
std::unique_ptr< TFile > m_file
Reference to the ROOT file to open.
Branches m_branches
Branches in the event tree.
TTree * section(const std::string &nam)
Create/access tree by name for non collection user data.
Class to output Geant4 event data to ROOT files.
void saveCollection(OutputContext< G4Event > &ctxt, G4VHitsCollection *collection) override
Callback to store each Geant4 hit collection.
Sections m_sections
Known file sections.
std::vector< std::string > m_disabledCollections
Property: vector with disabled collections.
void beginRun(const G4Run *run) override
Callback to store the Geant4 run information.
std::string m_section
Property: name of the event tree.
bool m_disableParticles
Property: vector with disabled collections.
bool m_filesByRun
Property: Flag to create a new output file for each run.
Namespace for the AIDA detector description toolkit.
virtual void closeOutput()
Close current output file.
~Geant4Output2ROOT() override
Default destructor.
Generic context to extend user, run and event information.
Geant4Context * context() const
Access the context.