DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Geant4InteractionVertexBoost.cpp
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : M.Frank
11 //
12 //==========================================================================
13 
14 // Framework include files
15 #include <DD4hep/Printout.h>
16 #include <DD4hep/InstanceCount.h>
19 
20 using namespace dd4hep::sim;
21 
24  : Geant4GeneratorAction(ctxt, nam)
25 {
27  declareProperty("Angle", m_angle = 0);
28  declareProperty("Mask", m_mask = 1);
29  m_needsControl = true;
30 }
31 
35 }
36 
38 void Geant4InteractionVertexBoost::boost(Interaction* inter) const {
39  if ( inter ) {
40  boostInteraction(this, inter, m_angle);
41  return;
42  }
43  print("+++ No interaction of type %d present.",m_mask);
44 }
45 
48  typedef std::vector<Geant4PrimaryInteraction*> _I;
50 
51  if ( m_mask >= 0 ) {
52  Interaction* inter = evt->get(m_mask);
53  boost(inter);
54  return;
55  }
56  _I interactions = evt->interactions();
57  for(_I::iterator i=interactions.begin(); i != interactions.end(); ++i)
58  boost(*i);
59 }
dd4hep::sim::Geant4InteractionVertexBoost::Geant4InteractionVertexBoost
Geant4InteractionVertexBoost()=delete
Inhibit default constructor.
dd4hep::sim::Geant4InteractionVertexBoost::boost
void boost(Interaction *interaction) const
Action routine to boost one single interaction according to the properties.
dd4hep::sim::Geant4PrimaryEvent
Class modelling a complete primary event with multiple interactions.
Definition: Geant4Primary.h:143
dd4hep::sim::Geant4PrimaryEvent::interactions
std::vector< Geant4PrimaryInteraction * > interactions() const
Retrieve all interactions.
Definition: Geant4Primary.cpp:113
dd4hep::sim::Geant4InteractionVertexBoost::Interaction
Geant4PrimaryInteraction Interaction
Interaction definition.
Definition: Geant4InteractionVertexBoost.h:48
dd4hep::sim::Geant4InteractionVertexBoost::m_mask
int m_mask
Property: Unique identifier of the interaction to be modified.
Definition: Geant4InteractionVertexBoost.h:54
dd4hep::InstanceCount::increment
static void increment(T *)
Increment count according to type information.
Definition: InstanceCount.h:98
dd4hep::sim::Geant4Context::event
Geant4Event & event() const
Access the geant4 event – valid only between BeginEvent() and EndEvent()!
Definition: Geant4Context.cpp:84
Geant4InputHandling.h
dd4hep::sim::Geant4Event::extension
T * extension(bool alert=true)
Access to type safe extension object. Exception is thrown if the object is invalid.
Definition: Geant4Context.h:151
dd4hep::sim::Geant4InteractionVertexBoost::~Geant4InteractionVertexBoost
virtual ~Geant4InteractionVertexBoost()
Default destructor.
dd4hep::InstanceCount::decrement
static void decrement(T *)
Decrement count according to type information.
Definition: InstanceCount.h:102
dd4hep::sim::Geant4GeneratorAction
Concrete implementation of the Geant4 generator action base class.
Definition: Geant4GeneratorAction.h:47
dd4hep::sim::Geant4InteractionVertexBoost::operator()
virtual void operator()(G4Event *event) override
Callback to generate primary particles.
dd4hep::sim::Geant4InteractionVertexBoost::m_angle
double m_angle
Property: The constant Lorentz transformation angle.
Definition: Geant4InteractionVertexBoost.h:52
dd4hep::sim::Geant4Action::print
void print(const char *fmt,...) const
Support for messages with variable output level using output level.
Definition: Geant4Action.cpp:144
dd4hep::sim
Namespace for the Geant4 based simulation part of the AIDA detector description toolkit.
Definition: Geant4Output2EDM4hep.cpp:49
dd4hep::sim::boostInteraction
int boostInteraction(const Geant4Action *caller, Geant4PrimaryEvent::Interaction *inter, double alpha)
Boost particles of one interaction identified by its mask.
Definition: Geant4InputHandling.cpp:257
InstanceCount.h
Printout.h
Geant4InteractionVertexBoost.h
dd4hep::sim::Geant4Context
Generic context to extend user, run and event information.
Definition: Geant4Context.h:201
dd4hep::sim::Geant4Action::context
Geant4Context * context() const
Access the context.
Definition: Geant4Action.h:270
dd4hep::sim::Geant4PrimaryEvent::get
Geant4PrimaryInteraction * get(int id) const
Retrieve an interaction by its ID.
Definition: Geant4Primary.cpp:107