BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
BDSPhysicalVolumeInfo.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2022.
4
5This file is part of BDSIM.
6
7BDSIM is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published
9by the Free Software Foundation version 3 of the License.
10
11BDSIM is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
18*/
19#ifndef BDSPHYSICALVOLUMEINFO_H
20#define BDSPHYSICALVOLUMEINFO_H
21
22#include "G4String.hh"
23#include "globals.hh" // geant4 types / globals
24
25class BDSBeamline;
26
39{
40public:
41 explicit BDSPhysicalVolumeInfo(G4double SPosAtMiddleOfElement);
42 BDSPhysicalVolumeInfo(G4String nameIn,
43 G4String placementNameIn,
44 G4double sPosIn,
45 G4int beamlineIndexIn = -1,
46 BDSBeamline* beamlineIn = nullptr);
48
50 friend std::ostream& operator<< (std::ostream &out, BDSPhysicalVolumeInfo const &info);
51
53 inline G4String GetName() const {return name;}
54
56 inline void SetName(G4String NameIn) {name = NameIn;}
57
59 inline G4String GetPlacementName() const {return placementName;}
60
62 inline void SetPlacementName(G4String placementNameIn)
63 {placementName = placementNameIn;}
64
66 inline G4double GetSPos() const {return spos;}
67
69 void SetSPos(G4double SPosIn) {spos = SPosIn;}
70
72 inline G4int GetBeamlineIndex() const {return beamlineIndex;}
73 inline BDSBeamline* GetBeamline() const {return beamline;}
77
78private:
80
81 G4String name;
82 G4String placementName;
83 G4double spos;
84 G4int beamlineIndex;
85 BDSBeamline* beamline;
86
91};
92
93
94#endif
A vector of BDSBeamlineElement instances - a beamline.
Definition: BDSBeamline.hh:61
A class holding any information pertaining to a particular physical volume in a BDSIM geant4 model.
BDSBeamline * GetBeamlineMassWorld() const
Accessor.
BDSBeamline * GetBeamline() const
Accessor.
friend std::ostream & operator<<(std::ostream &out, BDSPhysicalVolumeInfo const &info)
output stream
G4double GetSPos() const
Get the s position coordinate of the logical volume.
BDSBeamline * beamlineMassWorld
Corresponding mass world beam line - this may in fact be the same as the beam line.
G4int beamlineMassWorldIndex
Corresponding mass world beam line index - also may be the same as beamlineIndex.
G4int GetBeamlineMassWorldIndex() const
Accessor.
void SetName(G4String NameIn)
Set the name of the logical volume.
G4String GetName() const
Get the name of the logical volume.
G4int GetBeamlineIndex() const
Accessor.
void SetSPos(G4double SPosIn)
Set the s position coordinate of the logical volume.
G4String GetPlacementName() const
Get the name of the logical volume.
void SetPlacementName(G4String placementNameIn)
Set the name of the logical volume.