BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
BDSSurvey.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 BDSSURVEY_H
20#define BDSSURVEY_H
21
22#include "globals.hh" // geant4 types / globals
23
24#include <fstream>
25#include <vector>
26
27class BDSBeamline;
30
39{
40public:
41 explicit BDSSurvey(G4String filename);
42 ~BDSSurvey();
43
45 void Write(BDSBeamlineElement* beamlineElement);
46
48 void Write(BDSBeamline* beamline);
49
50private:
51 BDSSurvey() = delete;
52 BDSSurvey(const BDSSurvey&) = delete;
53 BDSSurvey& operator=(const BDSSurvey&) = delete;
54
56 void WriteHeader();
57
59 std::ofstream survey;
60
65
67 std::vector<G4String> magnetKeys;
68
69 const int gp;
70};
71
72#endif
A class that holds a fully constructed BDSAcceleratorComponent as well as any information relevant to...
A vector of BDSBeamlineElement instances - a beamline.
Definition: BDSBeamline.hh:61
Efficient storage of magnet strengths.
A class of functions to output Geant4/Mokka/BDSIM parameters for the beamline.
Definition: BDSSurvey.hh:39
const int gp
General precision - number of characters / item.
Definition: BDSSurvey.hh:69
BDSMagnetStrength const * nullStrength
Definition: BDSSurvey.hh:64
std::ofstream survey
Output file stream.
Definition: BDSSurvey.hh:59
std::vector< G4String > magnetKeys
Cache of all the possible magnet strength parameters.
Definition: BDSSurvey.hh:67
void WriteHeader()
Write header.
Definition: BDSSurvey.cc:54
void Write(BDSBeamlineElement *beamlineElement)
write line
Definition: BDSSurvey.cc:109