Public Member Functions | Private Attributes | List of all members
EDepSim::CombinationGenerator Class Reference

#include <EDepSimCombinationGenerator.hh>

Inheritance diagram for EDepSim::CombinationGenerator:

Public Member Functions

 CombinationGenerator (int src, int dest, bool relative)
 
virtual ~CombinationGenerator ()
 
virtual void GeneratePrimaryVertex (G4Event *evt)
 
G4String GetName ()
 Return the name of this generator. More...
 

Private Attributes

int fSource
 The index of the source vertex to copy from. More...
 
int fDestination
 The index of the destination vertex to copy to. More...
 
bool fRelative
 

Detailed Description

Definition at line 16 of file EDepSimCombinationGenerator.hh.

Constructor & Destructor Documentation

EDepSim::CombinationGenerator::CombinationGenerator ( int  src,
int  dest,
bool  relative 
)

Definition at line 8 of file EDepSimCombinationGenerator.cc.

10  : fSource(src), fDestination(dest), fRelative(relative) { }
int fSource
The index of the source vertex to copy from.
int fDestination
The index of the destination vertex to copy to.
EDepSim::CombinationGenerator::~CombinationGenerator ( void  )
virtual

Definition at line 12 of file EDepSimCombinationGenerator.cc.

12 {}

Member Function Documentation

void EDepSim::CombinationGenerator::GeneratePrimaryVertex ( G4Event *  evt)
virtual

A pure virtual method to generate the actual primary particles which must be implemented in each derived class.

Definition at line 14 of file EDepSimCombinationGenerator.cc.

14  {
15 
16  if (fSource < 0 || fSource >= evt->GetNumberOfPrimaryVertex()) {
17  abort();
18  }
19 
20  if (fDestination < 0 || fDestination >= evt->GetNumberOfPrimaryVertex()) {
21  abort();
22  }
23 
24  G4ThreeVector src = evt->GetPrimaryVertex(fSource)->GetPosition();
25  double srcTime = evt->GetPrimaryVertex(fSource)->GetT0();
26 
27  if (fRelative) {
28  G4ThreeVector dest = evt->GetPrimaryVertex(fDestination)->GetPosition();
29  double destTime = evt->GetPrimaryVertex(fDestination)->GetT0();
30  src = src + dest;
31  srcTime = srcTime + destTime;
32  }
33 
34  evt->GetPrimaryVertex(fDestination)->SetPosition(src.x(),src.y(),src.z());
35  evt->GetPrimaryVertex(fDestination)->SetT0(srcTime);
36 
37 }
int fSource
The index of the source vertex to copy from.
int fDestination
The index of the destination vertex to copy to.
TCEvent evt
Definition: DataStructs.cxx:7
G4String EDepSim::CombinationGenerator::GetName ( void  )

Return the name of this generator.

Definition at line 39 of file EDepSimCombinationGenerator.cc.

39  {
40  return "combination";
41 }

Member Data Documentation

int EDepSim::CombinationGenerator::fDestination
private

The index of the destination vertex to copy to.

Definition at line 33 of file EDepSimCombinationGenerator.hh.

bool EDepSim::CombinationGenerator::fRelative
private

A flag to indicate if the new vertex position is a direct copy of the source, or simply relative to the source.

Definition at line 37 of file EDepSimCombinationGenerator.hh.

int EDepSim::CombinationGenerator::fSource
private

The index of the source vertex to copy from.

Definition at line 30 of file EDepSimCombinationGenerator.hh.


The documentation for this class was generated from the following files: