BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSSamplerPlacementRecord.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) BDSIM Collaboration, 2001 - 2026.
3
4This file is part of BDSIM.
5
6BDSIM is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published
8by the Free Software Foundation version 3 of the License.
9
10BDSIM is distributed in the hope that it will be useful, but
11WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef BDSSAMPLERPLACEMENTRECORD_H
19#define BDSSAMPLERPLACEMENTRECORD_H
20#include "BDSBeamlineElement.hh"
21#include "BDSSamplerType.hh"
22
23#include "globals.hh" // geant4 types / globals
24#include "G4Transform3D.hh"
25
26class BDSSampler;
27
46{
47public:
50 BDSSamplerPlacementRecord(const G4String& nameIn,
51 BDSSampler* samplerIn,
52 const G4Transform3D& transformIn,
53 G4double sPositionIn = -1000,
54 const BDSBeamlineElement* elementIn = nullptr,
55 const G4String& uniqueNameIn = "",
56 BDSSamplerType typeIn = BDSSamplerType::plane,
57 G4double radiusIn = 0);
58
60
62 inline G4String Name() const {return name;}
63 inline G4String UniqueName() const {return uniqueName;}
64 inline BDSSampler* Sampler() const {return sampler;}
65 inline G4Transform3D Transform() const {return transform;}
66 inline G4Transform3D TransformInverse() const {return transformInverse;}
67 inline G4double SPosition() const {return sPosition;}
68 inline const BDSBeamlineElement* Element() const {return element;}
69 inline G4int BeamlineIndex() const;
70 inline BDSSamplerType Type() const {return type;}
71 inline G4double Radius() const {return radius;}
73
74private:
75 G4String name;
77 G4Transform3D transform;
78 G4Transform3D transformInverse;
79 G4double sPosition;
81 G4String uniqueName;
82 BDSSamplerType type;
83 G4double radius;
84};
85
87{
88 return element ? element->GetIndex() : -1;
89}
90
91#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).
G4Transform3D transform
The transform the sampler was placed with.
G4Transform3D Transform() 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:35