Geant4 11.3.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4THitsVector< _Tp > Class Template Reference

#include <G4THitsVector.hh>

+ Inheritance diagram for G4THitsVector< _Tp >:

Public Types

using parent_type = G4VTHitsVector<_Tp, std::vector<_Tp *>>
 
- Public Types inherited from G4VTHitsVector< _Tp, std::vector< _Tp * > >
using this_type
 
using value_type
 
using vector_type
 
using iterator
 
using const_iterator
 
using store_type
 
using pair_t
 
using map_t
 
using uomap_t
 
using mmap_t
 
using uommap_t
 

Public Member Functions

 G4THitsVector (G4int init_size=0)
 
 G4THitsVector (const G4String &detName, const G4String &colName, G4int init_size=0)
 
this_typeoperator+= (const G4VTHitsVector< U, VectorU_t > &right) const
 
this_typeoperator+= (const G4VTHitsMap< U, MapU_t > &right) const
 
G4bool operator== (const this_type &rhs) const
 
_Tp * operator[] (G4int key) const
 
std::size_t add (const G4int &key, U *&aHit) const
 
std::size_t add (const G4int &key, U &aHit) const
 
iterator begin ()
 
const_iterator begin () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
void clear ()
 
void DrawAllHits () override
 
iterator end ()
 
const_iterator end () const
 
std::size_t entries () const
 
G4VHitGetHit (std::size_t) const override
 
map_tGetMap () const
 
std::size_t GetSize () const override
 
std::vector< _Tp * > * GetVector () const
 
vector_typeGetVector (const G4int &key) const
 
void PrintAllHits () override
 
std::size_t set (const G4int &key, U *&aHit) const
 
std::size_t set (const G4int &key, U &aHit) const
 
- Public Member Functions inherited from G4VTHitsVector< _Tp, std::vector< _Tp * > >
 G4VTHitsVector (G4int init_size=0)
 
 G4VTHitsVector (const G4String &detName, const G4String &colNam, G4int init_size=0)
 
 ~G4VTHitsVector () override
 
G4bool operator== (const this_type &rhs) const
 
void DrawAllHits () override
 
void PrintAllHits () override
 
std::vector< _Tp * > * GetContainer () const
 
std::vector< _Tp * >::size_type size ()
 
std::vector< _Tp * >::size_type GetIndex (iterator itr)
 
std::vector< _Tp * >::size_type GetIndex (const_iterator itr) const
 
_Tp * GetObject (G4int idx) const
 
_Tp * GetObject (iterator itr) const
 
const _Tp * GetObject (const_iterator itr) const
 
_Tp * GetObject (G4int idx) const
 
_Tp * GetObject (iterator itr) const
 
const _Tp * GetObject (const_iterator itr) const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
std::vector< _Tp * > * GetVector () const
 
std::size_t entries () const
 
void clear ()
 
G4VHitGetHit (std::size_t) const override
 
std::size_t GetSize () const override
 
map_tGetMap () const
 
store_type allocate () const
 
store_type allocate () const
 
store_type null () const
 
store_type allocate () const
 
store_type allocate () const
 
store_type null () const
 
this_typeoperator+= (const G4VTHitsVector< U, VectorU_t > &right) const
 
this_typeoperator+= (const G4VTHitsVector< U, VectorU_t > &right) const
 
this_typeoperator+= (const G4VTHitsMap< U, MapU_t > &right) const
 
this_typeoperator+= (const G4VTHitsMap< U, MapU_t > &right) const
 
std::size_t add (const G4int &key, U *&aHit) const
 
std::size_t add (const G4int &key, U *&aHit) const
 
std::size_t add (const G4int &key, U &aHit) const
 
std::size_t add (const G4int &key, U &aHit) const
 
std::size_t set (const G4int &key, U *&aHit) const
 
std::size_t set (const G4int &key, U *&aHit) const
 
std::size_t set (const G4int &key, U &aHit) const
 
std::size_t set (const G4int &key, U &aHit) const
 
_Tp * at (G4int key) const
 
_Tp * operator[] (G4int key) const
 
 G4VTHitsVector (G4int init_size=0)
 
 G4VTHitsVector (const G4String &detName, const G4String &colNam, G4int init_size=0)
 
 ~G4VTHitsVector () override
 
G4bool operator== (const this_type &rhs) const
 
void DrawAllHits () override
 
void PrintAllHits () override
 
std::vector< _Tp * > * GetContainer () const
 
std::vector< _Tp * >::size_type size ()
 
std::vector< _Tp * >::size_type GetIndex (iterator itr)
 
std::vector< _Tp * >::size_type GetIndex (const_iterator itr) const
 
_Tp * GetObject (G4int idx) const
 
_Tp * GetObject (iterator itr) const
 
const _Tp * GetObject (const_iterator itr) const
 
_Tp * GetObject (G4int idx) const
 
_Tp * GetObject (iterator itr) const
 
const _Tp * GetObject (const_iterator itr) const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
std::vector< _Tp * > * GetVector () const
 
std::size_t entries () const
 
void clear ()
 
G4VHitGetHit (std::size_t) const override
 
std::size_t GetSize () const override
 
map_tGetMap () const
 
store_type allocate () const
 
store_type allocate () const
 
store_type allocate () const
 
store_type allocate () const
 
store_type null () const
 
store_type null () const
 
this_typeoperator+= (const G4VTHitsVector< U, VectorU_t > &right) const
 
this_typeoperator+= (const G4VTHitsVector< U, VectorU_t > &right) const
 
this_typeoperator+= (const G4VTHitsMap< U, MapU_t > &right) const
 
this_typeoperator+= (const G4VTHitsMap< U, MapU_t > &right) const
 
std::size_t add (const G4int &key, U *&aHit) const
 
std::size_t add (const G4int &key, U *&aHit) const
 
std::size_t add (const G4int &key, U &aHit) const
 
std::size_t add (const G4int &key, U &aHit) const
 
std::size_t set (const G4int &key, U *&aHit) const
 
std::size_t set (const G4int &key, U *&aHit) const
 
std::size_t set (const G4int &key, U &aHit) const
 
std::size_t set (const G4int &key, U &aHit) const
 
_Tp * at (G4int key) const
 
_Tp * operator[] (G4int key) const
 
- Public Member Functions inherited from G4HitsCollection
 ~G4HitsCollection () override=default
 
G4bool operator== (const G4HitsCollection &right) const
 
 G4VHitsCollection ()=default
 
 G4VHitsCollection (const G4String &detName, const G4String &colNam)
 
- Public Member Functions inherited from G4VHitsCollection
 G4VHitsCollection ()=default
 
 G4VHitsCollection (const G4String &detName, const G4String &colNam)
 
virtual ~G4VHitsCollection ()=default
 
G4bool operator== (const G4VHitsCollection &right) const
 
const G4StringGetName () const
 
const G4StringGetSDname () const
 
void SetColID (G4int i)
 
G4int GetColID () const
 

Additional Inherited Members

- Protected Member Functions inherited from G4VTHitsVector< _Tp, std::vector< _Tp * > >
void resize (vector_type *&theHitsVector, const G4int &key) const
 
void resize (vector_type *&theHitsVector, const G4int &key) const
 
vector_typeGetVector (const G4int &key) const
 
void _assign (vector_type *&theHitsVector, const G4int &key, _Tp &val) const
 
void _assign (vector_type *&theHitsVector, const G4int &key, _Tp *&val) const
 
void _add (vector_type *&theHitsVector, const G4int &key, _Tp &val) const
 
void _add (vector_type *&theHitsVector, const G4int &key, _Tp *&val) const
 
void _add (vector_type *&theHitsVector, const G4int &key, V &val) const
 
void _add (vector_type *&theHitsVector, const G4int &key, V *&val) const
 
_Tp & get (U &val) const
 
void delete_contents (vector_type *&theHitsVector) const
 
_Tp & get_reference (U &val) const
 
void _assign (vector_type *&theHitsVector, const G4int &key, _Tp &val) const
 
void _assign (vector_type *&theHitsVector, const G4int &key, _Tp *&val) const
 
void _add (vector_type *&theHitsVector, const G4int &key, _Tp &val) const
 
void _add (vector_type *&theHitsVector, const G4int &key, _Tp *&val) const
 
void _add (vector_type *&theHitsVector, const G4int &key, V &val) const
 
void _add (vector_type *&theHitsVector, const G4int &key, V *&val) const
 
void delete_contents (vector_type *&) const
 
_Tp & get_reference (U &val) const
 
vector_typeGetVector (const G4int &key) const
 
void resize (vector_type *&theHitsVector, const G4int &key) const
 
void resize (vector_type *&theHitsVector, const G4int &key) const
 
void _assign (vector_type *&theHitsVector, const G4int &key, _Tp &val) const
 
void _assign (vector_type *&theHitsVector, const G4int &key, _Tp *&val) const
 
void _assign (vector_type *&theHitsVector, const G4int &key, _Tp &val) const
 
void _assign (vector_type *&theHitsVector, const G4int &key, _Tp *&val) const
 
void _add (vector_type *&theHitsVector, const G4int &key, _Tp &val) const
 
void _add (vector_type *&theHitsVector, const G4int &key, _Tp *&val) const
 
void _add (vector_type *&theHitsVector, const G4int &key, V &val) const
 
void _add (vector_type *&theHitsVector, const G4int &key, V *&val) const
 
void _add (vector_type *&theHitsVector, const G4int &key, _Tp &val) const
 
void _add (vector_type *&theHitsVector, const G4int &key, _Tp *&val) const
 
void _add (vector_type *&theHitsVector, const G4int &key, V &val) const
 
void _add (vector_type *&theHitsVector, const G4int &key, V *&val) const
 
_Tp & get (U &val) const
 
void delete_contents (vector_type *&theHitsVector) const
 
void delete_contents (vector_type *&) const
 
_Tp & get_reference (U &val) const
 
_Tp & get_reference (U &val) const
 
- Protected Attributes inherited from G4HitsCollection
void * theCollection = nullptr
 
- Protected Attributes inherited from G4VHitsCollection
G4String collectionName = "Unknown"
 
G4String SDname = "Unknown"
 
G4int colID = -1
 

Detailed Description

template<typename _Tp>
class G4THitsVector< _Tp >

Definition at line 648 of file G4THitsVector.hh.

Member Typedef Documentation

◆ parent_type

template<typename _Tp>
using G4THitsVector< _Tp >::parent_type = G4VTHitsVector<_Tp, std::vector<_Tp *>>

Definition at line 651 of file G4THitsVector.hh.

Constructor & Destructor Documentation

◆ G4THitsVector() [1/2]

template<typename _Tp>
G4THitsVector< _Tp >::G4THitsVector ( G4int init_size = 0)
inline

Definition at line 654 of file G4THitsVector.hh.

G4VTHitsVector< _Tp, std::vector< _Tp * > > parent_type

◆ G4THitsVector() [2/2]

template<typename _Tp>
G4THitsVector< _Tp >::G4THitsVector ( const G4String & detName,
const G4String & colName,
G4int init_size = 0 )
inline

Definition at line 655 of file G4THitsVector.hh.

Member Function Documentation

◆ add() [1/2]

template<typename _Tp>
std::size_t G4VTHitsVector< _Tp, std::vector< _Tp * > >::add ( const G4int & key,
U & aHit ) const
inline

Definition at line 304 of file G4THitsVector.hh.

305 {
308 return theHitsVector->size();
309 }
std::vector< _Tp * > * GetVector() const
void _add(vector_type *&theHitsVector, const G4int &key, _Tp &val) const
Vector_t::size_type size()

◆ add() [2/2]

template<typename _Tp>
std::size_t G4VTHitsVector< _Tp, std::vector< _Tp * > >::add ( const G4int & key,
U *& aHit ) const
inline

Definition at line 282 of file G4THitsVector.hh.

283 {
286 return theHitsVector->size();
287 }

◆ begin() [1/2]

template<typename _Tp>
iterator G4VTHitsVector< _Tp, std::vector< _Tp * > >::begin ( )
inline

Definition at line 150 of file G4THitsVector.hh.

150{ return GetContainer()->begin(); }
std::vector< _Tp * > * GetContainer() const

◆ begin() [2/2]

template<typename _Tp>
const_iterator G4VTHitsVector< _Tp, std::vector< _Tp * > >::begin ( ) const
inline

Definition at line 152 of file G4THitsVector.hh.

152{ return GetContainer()->begin(); }

◆ cbegin()

template<typename _Tp>
const_iterator G4VTHitsVector< _Tp, std::vector< _Tp * > >::cbegin ( ) const
inline

Definition at line 154 of file G4THitsVector.hh.

154{ return GetContainer()->cbegin(); }

◆ cend()

template<typename _Tp>
const_iterator G4VTHitsVector< _Tp, std::vector< _Tp * > >::cend ( ) const
inline

Definition at line 155 of file G4THitsVector.hh.

155{ return GetContainer()->cend(); }

◆ clear()

template<typename _Tp>
void G4VTHitsVector< _Tp, std::vector< _Tp * > >::clear ( )
inline

◆ DrawAllHits()

template<typename _Tp>
void G4VTHitsVector< _Tp, std::vector< _Tp * > >::DrawAllHits ( )
overridevirtual

Reimplemented from G4VHitsCollection.

◆ end() [1/2]

template<typename _Tp>
iterator G4VTHitsVector< _Tp, std::vector< _Tp * > >::end ( )
inline

Definition at line 151 of file G4THitsVector.hh.

151{ return GetContainer()->end(); }

◆ end() [2/2]

template<typename _Tp>
const_iterator G4VTHitsVector< _Tp, std::vector< _Tp * > >::end ( ) const
inline

Definition at line 153 of file G4THitsVector.hh.

153{ return GetContainer()->end(); }

◆ entries()

template<typename _Tp>
std::size_t G4VTHitsVector< _Tp, std::vector< _Tp * > >::entries ( ) const
inline

Definition at line 162 of file G4THitsVector.hh.

162{ return (scast(Vector_t*)(theCollection))->size(); }
#define scast(_Tp)

◆ GetHit()

template<typename _Tp>
G4VHit * G4VTHitsVector< _Tp, std::vector< _Tp * > >::GetHit ( std::size_t ) const
inlineoverridevirtual

Reimplemented from G4VHitsCollection.

Definition at line 167 of file G4THitsVector.hh.

167{ return nullptr; }

◆ GetMap()

template<typename _Tp>
map_t * G4VTHitsVector< _Tp, std::vector< _Tp * > >::GetMap ( ) const
inline

◆ GetSize()

template<typename _Tp>
std::size_t G4VTHitsVector< _Tp, std::vector< _Tp * > >::GetSize ( ) const
inlineoverridevirtual

Reimplemented from G4VHitsCollection.

Definition at line 168 of file G4THitsVector.hh.

168{ return (scast(Vector_t*)(theCollection))->size(); }

◆ GetVector() [1/2]

template<typename _Tp>
std::vector< _Tp * > * G4VTHitsVector< _Tp, std::vector< _Tp * > >::GetVector ( ) const
inline

Definition at line 158 of file G4THitsVector.hh.

158{ return scast(Vector_t*)(theCollection); }

◆ GetVector() [2/2]

template<typename _Tp>
vector_type * G4VTHitsVector< _Tp, std::vector< _Tp * > >::GetVector ( const G4int & key) const
inline

Definition at line 413 of file G4THitsVector.hh.

414 {
417 return theHitsVector;
418 }
void resize(vector_type *&theHitsVector, const G4int &key) const

◆ operator+=() [1/2]

template<typename _Tp>
this_type & G4VTHitsVector< _Tp, std::vector< _Tp * > >::operator+= ( const G4VTHitsMap< U, MapU_t > & right) const
inline

Definition at line 255 of file G4THitsVector.hh.

256 {
258 for (auto itr = aHitsMap->begin(); itr != aHitsMap->end(); ++itr)
259 add<U>(itr->first, *(itr->second));
260 return static_cast<this_type&>(*(const_cast<this_type*>(this)));
261 }
std::size_t add(const G4int &key, U *&aHit) const
iterator begin()
map_t * GetMap() const
G4VTHitsVector< _Tp, std::vector< _Tp * > > this_type

◆ operator+=() [2/2]

template<typename _Tp>
this_type & G4VTHitsVector< _Tp, std::vector< _Tp * > >::operator+= ( const G4VTHitsVector< U, VectorU_t > & right) const
inline

Definition at line 231 of file G4THitsVector.hh.

232 {
234 for (auto itr = aHitsVector->begin(); itr != aHitsVector->end(); ++itr) {
235 auto _ptr = (*itr) ? (*itr) : null();
237 }
238 return static_cast<this_type&>(*(const_cast<this_type*>(this)));
239 }

◆ operator==()

template<typename _Tp>
G4bool G4VTHitsVector< _Tp, std::vector< _Tp * > >::operator== ( const this_type & rhs) const

◆ operator[]()

template<typename _Tp>
_Tp * G4VTHitsVector< _Tp, std::vector< _Tp * > >::operator[] ( G4int key) const
inline

Definition at line 383 of file G4THitsVector.hh.

◆ PrintAllHits()

template<typename _Tp>
void G4VTHitsVector< _Tp, std::vector< _Tp * > >::PrintAllHits ( )
overridevirtual

Reimplemented from G4VHitsCollection.

◆ set() [1/2]

template<typename _Tp>
std::size_t G4VTHitsVector< _Tp, std::vector< _Tp * > >::set ( const G4int & key,
U & aHit ) const
inline

Definition at line 356 of file G4THitsVector.hh.

357 {
360 return theHitsVector->size();
361 }
void _assign(vector_type *&theHitsVector, const G4int &key, _Tp &val) const

◆ set() [2/2]

template<typename _Tp>
std::size_t G4VTHitsVector< _Tp, std::vector< _Tp * > >::set ( const G4int & key,
U *& aHit ) const
inline

Definition at line 329 of file G4THitsVector.hh.

330 {
333 return theHitsVector->size();
334 }

The documentation for this class was generated from the following file: