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) 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 BDSIMPORTANCEVOLUMESTORE_H
19#define BDSIMPORTANCEVOLUMESTORE_H
20
21#include "globals.hh"
22#include "G4GeometryCell.hh"
23#include "G4GeometryCellComp.hh"
24
25#include <iterator>
26#include <set>
27
28class G4VPhysicalVolume;
29
31typedef std::set<G4GeometryCell, G4GeometryCellComp> BDSSetGeometryCell;
32
40{
41public:
44
46 void AddPVolume(const G4GeometryCell &cell);
47
49 const G4VPhysicalVolume* GetPVolume(G4int index) const;
50
52 inline G4int size() const {return (G4int)geometryCells.size();}
53
55 typedef BDSSetGeometryCell::iterator iterator;
56 typedef BDSSetGeometryCell::const_iterator const_iterator;
57 iterator begin() {return geometryCells.begin();}
58 iterator end() {return geometryCells.end();}
59 const_iterator begin() const {return geometryCells.begin();}
60 const_iterator end() const {return geometryCells.end();}
61 G4bool empty() const {return geometryCells.empty();}
63
65 friend std::ostream& operator<< (std::ostream& out, BDSImportanceVolumeStore const& ivs);
66
67private:
69 BDSSetGeometryCell geometryCells;
70};
71
72#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.