DD4hep - The AIDA detector description toolkit for high energy physics experiments
DD4hep
Rev:Unversioneddirectory
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
DDG4
src
Geant4InteractionMerger.cpp
Go to the documentation of this file.
1
// $Id: $
2
//==========================================================================
3
// AIDA Detector description implementation for LCD
4
//--------------------------------------------------------------------------
5
// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
6
// All rights reserved.
7
//
8
// For the licensing terms see $DD4hepINSTALL/LICENSE.
9
// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
10
//
11
// Author : M.Frank
12
//
13
//==========================================================================
14
15
// Framework include files
16
#include "
DD4hep/Printout.h
"
17
#include "
DD4hep/InstanceCount.h
"
18
#include "
DDG4/Geant4InputHandling.h
"
19
#include "
DDG4/Geant4InteractionMerger.h
"
20
21
using namespace
DD4hep::Simulation;
22
24
Geant4InteractionMerger::Geant4InteractionMerger
(
Geant4Context
* ctxt,
const
std::string& nam)
25
:
Geant4GeneratorAction
(ctxt,nam)
26
{
27
InstanceCount::increment
(
this
);
28
}
29
31
Geant4InteractionMerger::~Geant4InteractionMerger
() {
32
InstanceCount::decrement
(
this
);
33
}
34
36
void
Geant4InteractionMerger::operator()
(G4Event*
/* event */
) {
37
Geant4PrimaryEvent
* evt =
context
()->
event
().
extension
<
Geant4PrimaryEvent
>();
38
const
std::vector<Geant4PrimaryEvent::Interaction*>& inter = evt->
interactions
();
39
debug
(
"+++ Merging MC input record from %d interactions:"
,(
int
)inter.size());
40
mergeInteractions
(
this
,
context
());
41
}
DD4hep::Simulation::Geant4Context::event
Geant4Event & event() const
Access the geant4 event – valid only between BeginEvent() and EndEvent()!
Definition:
Geant4Context.cpp:82
DD4hep::Simulation::Geant4InteractionMerger::~Geant4InteractionMerger
virtual ~Geant4InteractionMerger()
Default destructor.
Definition:
Geant4InteractionMerger.cpp:31
Geant4InteractionMerger.h
DD4hep::InstanceCount::decrement
static void decrement(T *)
Decrement count according to type information.
Definition:
InstanceCount.h:102
Geant4InputHandling.h
DD4hep::Simulation::Geant4Action::context
Geant4Context * context() const
Access the context.
Definition:
Geant4Action.h:261
DD4hep::Simulation::Geant4PrimaryEvent
Class modelling a complete primary event with multiple interactions.
Definition:
Geant4Primary.h:144
DD4hep::Simulation::Geant4InteractionMerger::Geant4InteractionMerger
Geant4InteractionMerger(Geant4Context *context, const std::string &nam)
Standard constructor.
Definition:
Geant4InteractionMerger.cpp:24
DD4hep::Simulation::Geant4InteractionMerger::operator()
virtual void operator()(G4Event *event)
Event generation action callback.
Definition:
Geant4InteractionMerger.cpp:36
Printout.h
DD4hep::Simulation::Geant4Event::extension
T * extension(bool alert=true)
Access to type safe extension object. Exception is thrown if the object is invalid.
Definition:
Geant4Context.h:157
DD4hep::Simulation::Geant4GeneratorAction
Concrete implementation of the Geant4 generator action base class.
Definition:
Geant4GeneratorAction.h:48
InstanceCount.h
DD4hep::Simulation::mergeInteractions
int mergeInteractions(const Geant4Action *caller, const Geant4Context *context)
Merge all interactions present in the context.
Definition:
Geant4InputHandling.cpp:218
DD4hep::Simulation::Geant4PrimaryEvent::interactions
std::vector< Geant4PrimaryInteraction * > interactions() const
Retrieve all interactions.
Definition:
Geant4Primary.cpp:119
DD4hep::InstanceCount::increment
static void increment(T *)
Increment count according to type information.
Definition:
InstanceCount.h:98
DD4hep::Simulation::Geant4Context
Generic context to extend user, run and event information.
Definition:
Geant4Context.h:168
DD4hep::Simulation::Geant4Action::debug
void debug(const char *fmt,...) const
Support of debug messages.
Definition:
Geant4Action.cpp:209
Generated on Fri Dec 2 2016 12:31:08 for DD4hep by
1.8.6