BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
BDSSamplerPlacementRecord.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 BDSSAMPLERPLACEMENTRECORD_H
20#define BDSSAMPLERPLACEMENTRECORD_H
21#include "BDSBeamlineElement.hh"
22#include "BDSSamplerType.hh"
23
24#include "globals.hh" // geant4 types / globals
25#include "G4Transform3D.hh"
26
27class BDSSampler;
28
47{
48public:
51 BDSSamplerPlacementRecord(const G4String& nameIn,
52 BDSSampler* samplerIn,
53 const G4Transform3D& transformIn,
54 G4double sPositionIn = -1000,
55 const BDSBeamlineElement* elementIn = nullptr,
56 const G4String& uniqueNameIn = "",
57 BDSSamplerType typeIn = BDSSamplerType::plane,
58 G4double radiusIn = 0);
59
61
63 inline G4String Name() const {return name;}
64 inline G4String UniqueName() const {return uniqueName;}
65 inline BDSSampler* Sampler() const {return sampler;}
66 inline G4Transform3D Transform() const {return transform;}
67 inline G4Transform3D TransformInverse() const {return transformInverse;}
68 inline G4double SPosition() const {return sPosition;}
69 inline const BDSBeamlineElement* Element() const {return element;}
70 inline G4int BeamlineIndex() const;
71 inline BDSSamplerType Type() const {return type;}
72 inline G4double Radius() const {return radius;}
74
75private:
76 G4String name;
78 G4Transform3D transform;
79 G4Transform3D transformInverse;
80 G4double sPosition;
82 G4String uniqueName;
83 BDSSamplerType type;
84 G4double radius;
85};
86
88{
89 return element ? element->GetIndex() : -1;
90}
91
92#endif
A class that holds a fully constructed BDSAcceleratorComponent as well as any information relevant to...
G4int GetIndex() const
Accessor.
Information about a registered sampler.
const BDSBeamlineElement * Element() const
Accessor.
BDSSamplerType Type() const
Accessor.
const BDSBeamlineElement * element
The beam line element to which this sampler pertains (if any).
G4int BeamlineIndex() const
Accessor.
G4Transform3D transform
The transform the sampler was placed with.
G4Transform3D Transform() const
Accessor.
G4String Name() const
Accessor.
G4String uniqueName
The name of the sampler but suffixed with a number - guaranteed to be unique.
G4double SPosition() const
Accessor.
G4double sPosition
The curvilinear S position of this sampler.
G4String name
The name of the sampler.
G4String UniqueName() const
Accessor.
BDSSampler * Sampler() const
Accessor.
G4Transform3D TransformInverse() const
Accessor.
BDSSampler * sampler
The sampler instance that this information pertains to.
G4Transform3D transformInverse
The calculated inverse of the transform the sampler was placed with.
BDSSamplerPlacementRecord()=delete
No default constructor.
G4double Radius() const
Accessor.
Base class and registry of sampler instances.
Definition: BDSSampler.hh:36