File indexing completed on 2025-01-18 09:14:26
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #include <DD4hep/Printout.h>
0016 #include <DD4hep/InstanceCount.h>
0017 #include <DDG4/Geant4InputHandling.h>
0018 #include <DDG4/Geant4InteractionMerger.h>
0019
0020 using namespace dd4hep::sim;
0021
0022
0023 Geant4InteractionMerger::Geant4InteractionMerger(Geant4Context* ctxt, const std::string& nam)
0024 : Geant4GeneratorAction(ctxt,nam)
0025 {
0026 InstanceCount::increment(this);
0027 }
0028
0029
0030 Geant4InteractionMerger::~Geant4InteractionMerger() {
0031 InstanceCount::decrement(this);
0032 }
0033
0034
0035 void Geant4InteractionMerger::operator()(G4Event* ) {
0036 Geant4PrimaryEvent* evt = context()->event().extension<Geant4PrimaryEvent>();
0037 const std::vector<Geant4PrimaryEvent::Interaction*>& inter = evt->interactions();
0038 debug("+++ Merging MC input record from %d interactions:",(int)inter.size());
0039 mergeInteractions(this,context());
0040 }