BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
__w
bdsim
bdsim
include
BDSArrayOperatorValueV.hh
1
/*
2
Beam Delivery Simulation (BDSIM) Copyright (C) BDSIM Collaboration, 2001 - 2026.
3
4
This file is part of BDSIM.
5
6
BDSIM is free software: you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published
8
by the Free Software Foundation version 3 of the License.
9
10
BDSIM is distributed in the hope that it will be useful, but
11
WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
14
15
You should have received a copy of the GNU General Public License
16
along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
#ifndef BDSARRAYOPERATORVALUEV_H
19
#define BDSARRAYOPERATORVALUEV_H
20
#include "BDSArrayOperatorValue.hh"
21
22
#include "G4Types.hh"
23
24
#include <vector>
25
32
class
BDSArrayOperatorValueV
:
public
BDSArrayOperatorValue
33
{
34
public
:
35
BDSArrayOperatorValueV
():
36
BDSArrayOperatorValue
(
"Vector( "
)
37
{;}
38
virtual
~BDSArrayOperatorValueV
()
39
{
40
for
(
auto
op : operators)
41
{
delete
op;}
42
}
43
45
void
push_back
(
BDSArrayOperatorValue
* operatorIn) {operators.push_back(operatorIn);}
46
48
virtual
G4String
Name
()
const
49
{
50
G4String result = name;
51
for
(
auto
op : operators)
52
{result += op->Name() +
" "
;}
53
result +=
" )"
;
54
return
result;
55
}
56
59
virtual
BDSFieldValue
Apply
(
BDSFieldValue
v,
60
G4int xInd,
61
G4int yInd = 0,
62
G4int zInd = 0,
63
G4int tInd = 0)
const
64
{
65
BDSFieldValue
tempV = v;
66
for
(
auto
op : operators)
67
{tempV = op->Apply(tempV, xInd, yInd, zInd, tInd);}
68
return
tempV;
69
}
70
71
std::vector<BDSArrayOperatorValue*> operators;
72
};
73
74
#endif
BDSArrayOperatorValueV
A vectorised version of BDSArrayOperatorValueV.
Definition
BDSArrayOperatorValueV.hh:33
BDSArrayOperatorValueV::Apply
virtual BDSFieldValue Apply(BDSFieldValue v, G4int xInd, G4int yInd=0, G4int zInd=0, G4int tInd=0) const
Definition
BDSArrayOperatorValueV.hh:59
BDSArrayOperatorValueV::push_back
void push_back(BDSArrayOperatorValue *operatorIn)
Append an operator to the vector.
Definition
BDSArrayOperatorValueV.hh:45
BDSArrayOperatorValueV::Name
virtual G4String Name() const
Return a name of the operator for feedback to the user in print out.
Definition
BDSArrayOperatorValueV.hh:48
BDSArrayOperatorValue
Interface for modifying field values.
Definition
BDSArrayOperatorValue.hh:32
BDSThreeVector< G4double >
Generated on Thu Nov 12 2026 21:36:59 for BDSIM by
1.9.8