BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSImportanceVolumeStore.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2023.
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 BDSIMPORTANCEVOLUMESTORE_H
20#define BDSIMPORTANCEVOLUMESTORE_H
21
22#include "globals.hh"
23#include "G4GeometryCell.hh"
24#include "G4GeometryCellComp.hh"
25
26#include <iterator>
27#include <set>
28
29class G4VPhysicalVolume;
30
32typedef std::set<G4GeometryCell, G4GeometryCellComp> BDSSetGeometryCell;
33
41{
42public:
45
47 void AddPVolume(const G4GeometryCell &cell);
48
50 const G4VPhysicalVolume* GetPVolume(G4int index) const;
51
53 inline G4int size() const {return (G4int)geometryCells.size();}
54
56 typedef BDSSetGeometryCell::iterator iterator;
57 typedef BDSSetGeometryCell::const_iterator const_iterator;
58 iterator begin() {return geometryCells.begin();}
59 iterator end() {return geometryCells.end();}
60 const_iterator begin() const {return geometryCells.begin();}
61 const_iterator end() const {return geometryCells.end();}
62 G4bool empty() const {return geometryCells.empty();}
64
66 friend std::ostream& operator<< (std::ostream& out, BDSImportanceVolumeStore const& ivs);
67
68private:
70 BDSSetGeometryCell geometryCells;
71};
72
73#endif
Registry of importance values.
const G4VPhysicalVolume * GetPVolume(G4int index) const
Get stores physical volume from index.
iterator end()
Iterator mechanics.
friend std::ostream & operator<<(std::ostream &out, BDSImportanceVolumeStore const &ivs)
Output stream.
const_iterator end() const
Iterator mechanics.
G4bool empty() const
Iterator mechanics.
iterator begin()
Iterator mechanics.
void AddPVolume(const G4GeometryCell &cell)
Add geometry cell to the store.
G4int size() const
Length of this store. Useful for debugging.
BDSSetGeometryCell::iterator iterator
Iterator mechanics.
BDSSetGeometryCell::const_iterator const_iterator
Iterator mechanics.
const_iterator begin() const
Iterator mechanics.
BDSSetGeometryCell geometryCells
std::set<G4GeometryCell, G4GeometryCellComp> from typedef above.