Geant4-11
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Types
G4THitsVector< _Tp > Class Template Reference

#include <G4THitsVector.hh>

Inheritance diagram for G4THitsVector< _Tp >:
G4VTHitsVector< _Tp, std::vector< _Tp * > > G4HitsCollection G4VHitsCollection

Public Types

typedef vector_type::const_iterator const_iterator
 
typedef vector_type::iterator iterator
 
typedef std::map< G4int, store_typemap_t
 
typedef std::multimap< G4int, store_typemmap_t
 
typedef std::pair< G4int, store_typepair_t
 
typedef G4VTHitsVector< _Tp, std::vector< _Tp * > > parent_type
 
typedef Vector_t::value_type store_type
 
typedef G4VTHitsVector< _Tp, std::vector< _Tp * > > this_type
 
typedef std::unordered_map< G4int, store_typeuomap_t
 
typedef std::unordered_multimap< G4int, store_typeuommap_t
 
typedef _Tp value_type
 
typedef std::vector< _Tp * > vector_type
 

Public Member Functions

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
 
store_type allocate () const
 
store_type allocate () const
 
store_type allocate () const
 
store_type allocate () const
 
_Tp * at (G4int key) const
 
iterator begin ()
 
const_iterator begin () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
void clear ()
 
virtual void DrawAllHits ()
 
iterator end ()
 
const_iterator end () const
 
std::size_t entries () const
 
 G4THitsVector (G4int init_size=0)
 
 G4THitsVector (G4String detName, G4String colName, G4int init_size=0)
 
G4int GetColID () const
 
std::vector< _Tp * > * GetContainer () const
 
virtual G4VHitGetHit (size_t) const
 
virtual G4VHitGetHit (std::size_t) const
 
Vector_t::size_type GetIndex (const_iterator itr) const
 
Vector_t::size_type GetIndex (iterator itr)
 
map_tGetMap () const
 
const G4StringGetName () const
 
const _Tp * GetObject (const_iterator itr) const
 
const _Tp * GetObject (const_iterator itr) const
 
_Tp * GetObject (G4int idx) const
 
_Tp * GetObject (G4int idx) const
 
_Tp * GetObject (iterator itr) const
 
_Tp * GetObject (iterator itr) const
 
const G4StringGetSDname () const
 
virtual std::size_t GetSize () const
 
std::vector< _Tp * > * GetVector () const
 
store_type null () const
 
store_type null () const
 
this_typeoperator+= (const G4VTHitsMap< U, MapU_t > &right) const
 
this_typeoperator+= (const G4VTHitsMap< U, MapU_t > &right) const
 
this_typeoperator+= (const G4VTHitsVector< U, VectorU_t > &right) const
 
this_typeoperator+= (const G4VTHitsVector< U, VectorU_t > &right) const
 
G4bool operator== (const G4HitsCollection &right) const
 
G4bool operator== (const G4VHitsCollection &right) const
 
G4bool operator== (const this_type &rhs) const
 
_Tp * operator[] (G4int key) const
 
virtual void PrintAllHits ()
 
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
 
void SetColID (G4int i)
 
Vector_t::size_type size ()
 

Protected Member Functions

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, _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, V *&val) const
 
void _add (vector_type *&theHitsVector, const G4int &key, V *&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 _assign (vector_type *&theHitsVector, const G4int &key, _Tp *&val) const
 
void delete_contents (vector_type *&) const
 
void delete_contents (vector_type *&theHitsVector) const
 
_Tp & get (U &val) const
 
_Tp & get_reference (U &val) 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
 

Protected Attributes

G4int colID
 
G4String collectionName
 
G4String SDname
 
void * theCollection
 

Private Types

using enable_if_t = typename std::enable_if< _Bp, _Tp >::type
 

Detailed Description

template<typename _Tp>
class G4THitsVector< _Tp >

Definition at line 688 of file G4THitsVector.hh.

Member Typedef Documentation

◆ const_iterator

typedef vector_type::const_iterator G4VTHitsVector< _Tp , std::vector< _Tp * > >::const_iterator
inherited

Definition at line 59 of file G4THitsVector.hh.

◆ enable_if_t

using G4VTHitsVector< _Tp , std::vector< _Tp * > >::enable_if_t = typename std::enable_if<_Bp, _Tp>::type
privateinherited

Definition at line 83 of file G4THitsVector.hh.

◆ iterator

typedef vector_type::iterator G4VTHitsVector< _Tp , std::vector< _Tp * > >::iterator
inherited

Definition at line 58 of file G4THitsVector.hh.

◆ map_t

typedef std::map<G4int, store_type> G4VTHitsVector< _Tp , std::vector< _Tp * > >::map_t
inherited

Definition at line 63 of file G4THitsVector.hh.

◆ mmap_t

typedef std::multimap<G4int, store_type> G4VTHitsVector< _Tp , std::vector< _Tp * > >::mmap_t
inherited

Definition at line 65 of file G4THitsVector.hh.

◆ pair_t

typedef std::pair<G4int, store_type> G4VTHitsVector< _Tp , std::vector< _Tp * > >::pair_t
inherited

Definition at line 62 of file G4THitsVector.hh.

◆ parent_type

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

Definition at line 691 of file G4THitsVector.hh.

◆ store_type

typedef Vector_t::value_type G4VTHitsVector< _Tp , std::vector< _Tp * > >::store_type
inherited

Definition at line 61 of file G4THitsVector.hh.

◆ this_type

typedef G4VTHitsVector<_Tp , std::vector< _Tp * > > G4VTHitsVector< _Tp , std::vector< _Tp * > >::this_type
inherited

Definition at line 55 of file G4THitsVector.hh.

◆ uomap_t

typedef std::unordered_map<G4int, store_type> G4VTHitsVector< _Tp , std::vector< _Tp * > >::uomap_t
inherited

Definition at line 64 of file G4THitsVector.hh.

◆ uommap_t

typedef std::unordered_multimap<G4int, store_type> G4VTHitsVector< _Tp , std::vector< _Tp * > >::uommap_t
inherited

Definition at line 66 of file G4THitsVector.hh.

◆ value_type

typedef _Tp G4VTHitsVector< _Tp , std::vector< _Tp * > >::value_type
inherited

Definition at line 56 of file G4THitsVector.hh.

◆ vector_type

typedef std::vector< _Tp * > G4VTHitsVector< _Tp , std::vector< _Tp * > >::vector_type
inherited

Definition at line 57 of file G4THitsVector.hh.

Constructor & Destructor Documentation

◆ G4THitsVector() [1/2]

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

Definition at line 694 of file G4THitsVector.hh.

695 : parent_type(init_size)
696 {}
G4VTHitsVector< _Tp, std::vector< _Tp * > > parent_type

◆ G4THitsVector() [2/2]

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

Definition at line 697 of file G4THitsVector.hh.

698 : parent_type(detName, colName, init_size)
699 {}

Member Function Documentation

◆ _add() [1/8]

void G4VTHitsVector< _Tp , std::vector< _Tp * > >::_add ( vector_type *&  theHitsVector,
const G4int key,
_Tp &  val 
) const
inlineprotectedinherited

Definition at line 467 of file G4THitsVector.hh.

468 {
469 *(*theHitsVector)[key] += val;
470 }

◆ _add() [2/8]

void G4VTHitsVector< _Tp , std::vector< _Tp * > >::_add ( vector_type *&  theHitsVector,
const G4int key,
_Tp &  val 
) const
inlineprotectedinherited

Definition at line 530 of file G4THitsVector.hh.

531 {
532 (*theHitsVector)[key] += val;
533 }

◆ _add() [3/8]

void G4VTHitsVector< _Tp , std::vector< _Tp * > >::_add ( vector_type *&  theHitsVector,
const G4int key,
_Tp *&  val 
) const
inlineprotectedinherited

Definition at line 473 of file G4THitsVector.hh.

474 {
475 *(*theHitsVector)[key] += *val;
476 }

◆ _add() [4/8]

void G4VTHitsVector< _Tp , std::vector< _Tp * > >::_add ( vector_type *&  theHitsVector,
const G4int key,
_Tp *&  val 
) const
inlineprotectedinherited

Definition at line 536 of file G4THitsVector.hh.

537 {
538 (*theHitsVector)[key] += *val;
539 }

◆ _add() [5/8]

void G4VTHitsVector< _Tp , std::vector< _Tp * > >::_add ( vector_type *&  theHitsVector,
const G4int key,
V &  val 
) const
inlineprotectedinherited

Definition at line 480 of file G4THitsVector.hh.

481 {
482 *(*theHitsVector)[key] += val;
483 }

◆ _add() [6/8]

void G4VTHitsVector< _Tp , std::vector< _Tp * > >::_add ( vector_type *&  theHitsVector,
const G4int key,
V &  val 
) const
inlineprotectedinherited

Definition at line 543 of file G4THitsVector.hh.

544 {
545 (*theHitsVector)[key] += val;
546 }

◆ _add() [7/8]

void G4VTHitsVector< _Tp , std::vector< _Tp * > >::_add ( vector_type *&  theHitsVector,
const G4int key,
V *&  val 
) const
inlineprotectedinherited

Definition at line 487 of file G4THitsVector.hh.

488 {
489 *(*theHitsVector)[key] += *val;
490 }

◆ _add() [8/8]

void G4VTHitsVector< _Tp , std::vector< _Tp * > >::_add ( vector_type *&  theHitsVector,
const G4int key,
V *&  val 
) const
inlineprotectedinherited

Definition at line 550 of file G4THitsVector.hh.

551 {
552 (*theHitsVector)[key] += *val;
553 }

◆ _assign() [1/4]

void G4VTHitsVector< _Tp , std::vector< _Tp * > >::_assign ( vector_type *&  theHitsVector,
const G4int key,
_Tp &  val 
) const
inlineprotectedinherited

Definition at line 453 of file G4THitsVector.hh.

454 {
455 delete(*theHitsVector)[key];
456 *(*theHitsVector)[key] = val;
457 }

◆ _assign() [2/4]

void G4VTHitsVector< _Tp , std::vector< _Tp * > >::_assign ( vector_type *&  theHitsVector,
const G4int key,
_Tp &  val 
) const
inlineprotectedinherited

Definition at line 517 of file G4THitsVector.hh.

518 {
519 (*theHitsVector)[key] = val;
520 }

◆ _assign() [3/4]

void G4VTHitsVector< _Tp , std::vector< _Tp * > >::_assign ( vector_type *&  theHitsVector,
const G4int key,
_Tp *&  val 
) const
inlineprotectedinherited

Definition at line 460 of file G4THitsVector.hh.

461 {
462 delete(*theHitsVector)[key];
463 (*theHitsVector)[key] = val;
464 }

◆ _assign() [4/4]

void G4VTHitsVector< _Tp , std::vector< _Tp * > >::_assign ( vector_type *&  theHitsVector,
const G4int key,
_Tp *&  val 
) const
inlineprotectedinherited

Definition at line 523 of file G4THitsVector.hh.

524 {
525 delete(*theHitsVector)[key];
526 (*theHitsVector)[key] = *val;
527 }

◆ add() [1/4]

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

Definition at line 326 of file G4THitsVector.hh.

327 {
328 vector_type* theHitsVector = GetVector(key);
329 _add(theHitsVector, key, aHit);
330 return theHitsVector->size();
331 }
void _add(vector_type *&theHitsVector, const G4int &key, _Tp &val) const
std::vector< _Tp * > * GetVector() const

◆ add() [2/4]

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

Definition at line 336 of file G4THitsVector.hh.

337 {
338 vector_type* theHitsVector = GetVector(key);
339 _add(theHitsVector, key, aHit);
340 return theHitsVector->size();
341 }

◆ add() [3/4]

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

Definition at line 304 of file G4THitsVector.hh.

305 {
306 vector_type* theHitsVector = GetVector(key);
307 _add(theHitsVector, key, *aHit);
308 return theHitsVector->size();
309 }

◆ add() [4/4]

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

Definition at line 314 of file G4THitsVector.hh.

315 {
316 vector_type* theHitsVector = GetVector(key);
317 store_type hit = allocate();
318 get_reference(hit) += *aHit;
319 _add(theHitsVector, key, *hit);
320 return theHitsVector->size();
321 }

◆ allocate() [1/4]

store_type G4VTHitsVector< _Tp , std::vector< _Tp * > >::allocate ( ) const
inlineinherited

Definition at line 191 of file G4THitsVector.hh.

192 {
193 return new T(0.);
194 }

◆ allocate() [2/4]

store_type G4VTHitsVector< _Tp , std::vector< _Tp * > >::allocate ( ) const
inlineinherited

Definition at line 200 of file G4THitsVector.hh.

201 {
202 return new T();
203 }

◆ allocate() [3/4]

store_type G4VTHitsVector< _Tp , std::vector< _Tp * > >::allocate ( ) const
inlineinherited

Definition at line 218 of file G4THitsVector.hh.

219 {
220 return T(0.);
221 }

◆ allocate() [4/4]

store_type G4VTHitsVector< _Tp , std::vector< _Tp * > >::allocate ( ) const
inlineinherited

Definition at line 226 of file G4THitsVector.hh.

227 {
228 return T();
229 }

◆ at()

_Tp * G4VTHitsVector< _Tp , std::vector< _Tp * > >::at ( G4int  key) const
inlineinherited

Definition at line 402 of file G4THitsVector.hh.

403 {
404 vector_type* theHitsVector = GetVector();
405 resize(theHitsVector, key);
406 return &get_reference((*theHitsVector)[key]);
407 }
void resize(vector_type *&theHitsVector, const G4int &key) const

◆ begin() [1/2]

iterator G4VTHitsVector< _Tp , std::vector< _Tp * > >::begin ( )
inlineinherited

Definition at line 156 of file G4THitsVector.hh.

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

◆ begin() [2/2]

const_iterator G4VTHitsVector< _Tp , std::vector< _Tp * > >::begin ( ) const
inlineinherited

Definition at line 158 of file G4THitsVector.hh.

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

◆ cbegin()

const_iterator G4VTHitsVector< _Tp , std::vector< _Tp * > >::cbegin ( ) const
inlineinherited

Definition at line 160 of file G4THitsVector.hh.

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

◆ cend()

const_iterator G4VTHitsVector< _Tp , std::vector< _Tp * > >::cend ( ) const
inlineinherited

Definition at line 161 of file G4THitsVector.hh.

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

◆ clear()

void G4VTHitsVector< _Tp , std::vector< _Tp * > >::clear
inlineinherited

Definition at line 174 of file G4THitsVector.hh.

673{
674 vector_type* theHitsVector = GetVector();
675 delete_contents(theHitsVector);
676 theHitsVector->clear();
677}
void delete_contents(vector_type *&theHitsVector) const

◆ delete_contents() [1/2]

void G4VTHitsVector< _Tp , std::vector< _Tp * > >::delete_contents ( vector_type *&  ) const
inlineprotectedinherited

Definition at line 556 of file G4THitsVector.hh.

557 {}

◆ delete_contents() [2/2]

void G4VTHitsVector< _Tp , std::vector< _Tp * > >::delete_contents ( vector_type *&  theHitsVector) const
inlineprotectedinherited

Definition at line 499 of file G4THitsVector.hh.

500 {
501 for(iterator itr = theHitsVector->begin(); itr != theHitsVector->end();
502 ++itr)
503 delete *itr;
504 }

◆ DrawAllHits()

void G4VTHitsVector< _Tp , std::vector< _Tp * > >::DrawAllHits
virtualinherited

Reimplemented from G4VHitsCollection.

Definition at line 95 of file G4THitsVector.hh.

644{
645 ;
646}

◆ end() [1/2]

iterator G4VTHitsVector< _Tp , std::vector< _Tp * > >::end ( )
inlineinherited

Definition at line 157 of file G4THitsVector.hh.

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

◆ end() [2/2]

const_iterator G4VTHitsVector< _Tp , std::vector< _Tp * > >::end ( ) const
inlineinherited

Definition at line 159 of file G4THitsVector.hh.

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

◆ entries()

std::size_t G4VTHitsVector< _Tp , std::vector< _Tp * > >::entries ( ) const
inlineinherited

Definition at line 168 of file G4THitsVector.hh.

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

◆ get()

_Tp & G4VTHitsVector< _Tp , std::vector< _Tp * > >::get ( U &  val) const
inlineprotectedinherited

Definition at line 493 of file G4THitsVector.hh.

494 {
495 return *val;
496 }

◆ get_reference() [1/2]

_Tp & G4VTHitsVector< _Tp , std::vector< _Tp * > >::get_reference ( U &  val) const
inlineprotectedinherited

Definition at line 507 of file G4THitsVector.hh.

508 {
509 return *val;
510 }

◆ get_reference() [2/2]

_Tp & G4VTHitsVector< _Tp , std::vector< _Tp * > >::get_reference ( U &  val) const
inlineprotectedinherited

Definition at line 560 of file G4THitsVector.hh.

561 {
562 return val;
563 }

◆ GetColID()

G4int G4VHitsCollection::GetColID ( ) const
inlineinherited

Definition at line 66 of file G4VHitsCollection.hh.

66{ return colID; }

References G4VHitsCollection::colID.

◆ GetContainer()

std::vector< _Tp * > * G4VTHitsVector< _Tp , std::vector< _Tp * > >::GetContainer ( ) const
inlineinherited

Definition at line 101 of file G4THitsVector.hh.

102 {
103 return scast(Vector_t*)(theCollection);
104 }

◆ GetHit() [1/2]

virtual G4VHit * G4VHitsCollection::GetHit ( size_t  ) const
inlinevirtualinherited

◆ GetHit() [2/2]

virtual G4VHit * G4VTHitsVector< _Tp , std::vector< _Tp * > >::GetHit ( std::size_t  ) const
inlinevirtualinherited

Definition at line 176 of file G4THitsVector.hh.

176{ return nullptr; }

◆ GetIndex() [1/2]

Vector_t::size_type G4VTHitsVector< _Tp , std::vector< _Tp * > >::GetIndex ( const_iterator  itr) const
inlineinherited

Definition at line 113 of file G4THitsVector.hh.

114 {
115 return std::distance(begin(), itr);
116 }

◆ GetIndex() [2/2]

Vector_t::size_type G4VTHitsVector< _Tp , std::vector< _Tp * > >::GetIndex ( iterator  itr)
inlineinherited

Definition at line 108 of file G4THitsVector.hh.

109 {
110 return std::distance(begin(), itr);
111 }

◆ GetMap()

G4VTHitsVector< _Tp , std::vector< _Tp * > >::map_t * G4VTHitsVector< _Tp , std::vector< _Tp * > >::GetMap
inlineinherited

Definition at line 182 of file G4THitsVector.hh.

628{
629 G4ThreadLocalStatic map_t* theHitsMap = new map_t();
630 theHitsMap->clear();
631 vector_type* theHitsVector = GetVector();
632 for(std::size_t i = 0; i < theHitsVector->size(); ++i)
633 {
634 store_type& _obj = (*theHitsVector)[i];
635 if(_obj)
636 (*theHitsMap)[i] = _obj;
637 }
638 return theHitsMap;
639}
std::map< G4int, store_type > map_t
#define G4ThreadLocalStatic
Definition: tls.hh:76

◆ GetName()

const G4String & G4VHitsCollection::GetName ( ) const
inlineinherited

Definition at line 63 of file G4VHitsCollection.hh.

63{ return collectionName; }

References G4VHitsCollection::collectionName.

Referenced by G4SDManager::GetCollectionID().

◆ GetObject() [1/6]

const _Tp * G4VTHitsVector< _Tp , std::vector< _Tp * > >::GetObject ( const_iterator  itr) const
inlineinherited

Definition at line 132 of file G4THitsVector.hh.

133 {
134 return (*itr);
135 }

◆ GetObject() [2/6]

const _Tp * G4VTHitsVector< _Tp , std::vector< _Tp * > >::GetObject ( const_iterator  itr) const
inlineinherited

Definition at line 151 of file G4THitsVector.hh.

152 {
153 return &(*itr);
154 }

◆ GetObject() [3/6]

_Tp * G4VTHitsVector< _Tp , std::vector< _Tp * > >::GetObject ( G4int  idx) const
inlineinherited

Definition at line 119 of file G4THitsVector.hh.

120 {
121 return (idx < (G4int) GetContainer()->size()) ? (*GetContainer())[idx]
122 : nullptr;
123 }
int G4int
Definition: G4Types.hh:85

◆ GetObject() [4/6]

_Tp * G4VTHitsVector< _Tp , std::vector< _Tp * > >::GetObject ( G4int  idx) const
inlineinherited

Definition at line 138 of file G4THitsVector.hh.

139 {
140 return (idx < (G4int) GetContainer()->size()) ? &(*GetContainer())[idx]
141 : nullptr;
142 }

◆ GetObject() [5/6]

_Tp * G4VTHitsVector< _Tp , std::vector< _Tp * > >::GetObject ( iterator  itr) const
inlineinherited

Definition at line 126 of file G4THitsVector.hh.

127 {
128 return (*itr);
129 }

◆ GetObject() [6/6]

_Tp * G4VTHitsVector< _Tp , std::vector< _Tp * > >::GetObject ( iterator  itr) const
inlineinherited

Definition at line 145 of file G4THitsVector.hh.

146 {
147 return &(*itr);
148 }

◆ GetSDname()

const G4String & G4VHitsCollection::GetSDname ( ) const
inlineinherited

Definition at line 64 of file G4VHitsCollection.hh.

64{ return SDname; }

References G4VHitsCollection::SDname.

Referenced by G4SDManager::GetCollectionID().

◆ GetSize()

virtual std::size_t G4VTHitsVector< _Tp , std::vector< _Tp * > >::GetSize ( void  ) const
inlinevirtualinherited

Reimplemented from G4VHitsCollection.

Definition at line 177 of file G4THitsVector.hh.

178 {
179 return (scast(Vector_t*)(theCollection))->size();
180 }

◆ GetVector() [1/2]

std::vector< _Tp * > * G4VTHitsVector< _Tp , std::vector< _Tp * > >::GetVector ( ) const
inlineinherited

Definition at line 164 of file G4THitsVector.hh.

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

◆ GetVector() [2/2]

vector_type * G4VTHitsVector< _Tp , std::vector< _Tp * > >::GetVector ( const G4int key) const
inlineprotectedinherited

Definition at line 441 of file G4THitsVector.hh.

442 {
443 vector_type* theHitsVector = GetVector();
444 resize(theHitsVector, key);
445 return theHitsVector;
446 }

◆ null() [1/2]

store_type G4VTHitsVector< _Tp , std::vector< _Tp * > >::null ( ) const
inlineinherited

Definition at line 207 of file G4THitsVector.hh.

208 {
209 return nullptr;
210 }

◆ null() [2/2]

store_type G4VTHitsVector< _Tp , std::vector< _Tp * > >::null ( ) const
inlineinherited

Definition at line 233 of file G4THitsVector.hh.

234 {
235 return store_type();
236 }

◆ operator+=() [1/4]

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

Definition at line 275 of file G4THitsVector.hh.

276 {
277 MapU_t* aHitsMap = right.GetMap();
278 for(auto itr = aHitsMap->begin(); itr != aHitsMap->end(); ++itr)
279 add<U>(itr->first, *(itr->second));
280 return static_cast<this_type&>(*(const_cast<this_type*>(this)));
281 }
Map_t * GetMap() const
Definition: G4THitsMap.hh:155
G4VTHitsVector< _Tp, std::vector< _Tp * > > this_type

◆ operator+=() [2/4]

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

Definition at line 286 of file G4THitsVector.hh.

287 {
288 MapU_t* aHitsMap = right.GetMap();
289 for(auto itr = aHitsMap->begin(); itr != aHitsMap->end(); ++itr)
290 add<U>(itr->first, itr->second);
291 return static_cast<this_type&>(*(const_cast<this_type*>(this)));
292 }

◆ operator+=() [3/4]

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

Definition at line 246 of file G4THitsVector.hh.

247 {
248 VectorU_t* aHitsVector = right.GetVector();
249 for(auto itr = aHitsVector->begin(); itr != aHitsVector->end(); ++itr)
250 {
251 auto _ptr = (*itr) ? (*itr) : null();
252 if(_ptr)
253 add<U>(std::distance(aHitsVector->begin(), itr), *_ptr);
254 }
255 return static_cast<this_type&>(*(const_cast<this_type*>(this)));
256 }

◆ operator+=() [4/4]

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

Definition at line 261 of file G4THitsVector.hh.

262 {
263 VectorU_t* aHitsVector = right.GetVector();
264 for(auto itr = aHitsVector->begin(); itr != aHitsVector->end(); ++itr)
265 {
266 auto _ptr = (*itr) ? (*itr) : allocate();
267 add<U>(std::distance(aHitsVector->begin(), itr), _ptr);
268 }
269 return static_cast<this_type&>(*(const_cast<this_type*>(this)));
270 }

◆ operator==() [1/3]

G4bool G4HitsCollection::operator== ( const G4HitsCollection right) const
inherited

Definition at line 61 of file G4THitsCollection.cc.

62{
65 return (collectionName == right.collectionName);
66}
G4Allocator< G4HitsCollection > *& anHCAllocator_G4MT_TLS_()

References anHCAllocator_G4MT_TLS_(), and G4VHitsCollection::collectionName.

◆ operator==() [2/3]

G4bool G4VHitsCollection::operator== ( const G4VHitsCollection right) const
inherited

Definition at line 49 of file G4VHitsCollection.cc.

50{
51 return ((collectionName == right.collectionName) && (SDname == right.SDname));
52}

References G4VHitsCollection::collectionName, and G4VHitsCollection::SDname.

◆ operator==() [3/3]

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

Definition at line 93 of file G4THitsVector.hh.

619{
620 return (collectionName == right.collectionName);
621}

◆ operator[]()

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

Definition at line 409 of file G4THitsVector.hh.

410 {
411 vector_type* theHitsVector = GetVector();
412 resize(theHitsVector, key);
413 return &get_reference((*theHitsVector)[key]);
414 }

◆ PrintAllHits()

void G4VTHitsVector< _Tp , std::vector< _Tp * > >::PrintAllHits
virtualinherited

Reimplemented from G4VHitsCollection.

Definition at line 96 of file G4THitsVector.hh.

652{
653 G4cout << "G4THitsVector " << SDname << " / " << collectionName << " --- "
654 << entries() << " entries" << G4endl;
655 /*----- commented out for the use-case where <T> cannot be initialized
656 to be zero or does not support += operator.
657 Vector_t * theHitsVector = GetVector();
658 typename Vector_t::iterator itr = theHitsVector->begin();
659 T sum = 0.;
660 for(; itr != theHitsVector->end(); ++itr) {
661 G4cout << " " << itr->first << " : "
662 << *(itr->second) << G4endl;
663 sum += *(itr->second);
664 }
665 G4cout << " Total : " << sum << G4endl;
666 ----------------------------------------------------------------------*/
667}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout

◆ resize() [1/2]

void G4VTHitsVector< _Tp , std::vector< _Tp * > >::resize ( vector_type *&  theHitsVector,
const G4int key 
) const
inlineprotectedinherited

Definition at line 419 of file G4THitsVector.hh.

420 {
421 // ensure the proper size
422 if(key >= (G4int) theHitsVector->size())
423 theHitsVector->resize(key + 1, null());
424
425 // if null pointer for vector entry: allocate
426 if(!theHitsVector->at(key))
427 {
428 store_type init = allocate();
429 _assign(theHitsVector, key, init);
430 }
431 }
void _assign(vector_type *&theHitsVector, const G4int &key, _Tp &val) const

◆ resize() [2/2]

void G4VTHitsVector< _Tp , std::vector< _Tp * > >::resize ( vector_type *&  theHitsVector,
const G4int key 
) const
inlineprotectedinherited

Definition at line 434 of file G4THitsVector.hh.

435 {
436 // ensure the proper size
437 if(key >= (G4int) theHitsVector->size())
438 theHitsVector->resize(key + 1, null());
439 }

◆ set() [1/4]

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

Definition at line 380 of file G4THitsVector.hh.

381 {
382 vector_type* theHitsVector = GetVector(key);
383 _assign(theHitsVector, key, &aHit);
384 return theHitsVector->size();
385 }

◆ set() [2/4]

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

Definition at line 390 of file G4THitsVector.hh.

391 {
392 vector_type* theHitsVector = GetVector(key);
393 store_type hit = allocate();
394 get_reference(hit) += aHit;
395 _assign(theHitsVector, key, &aHit);
396 return theHitsVector->size();
397 }

◆ set() [3/4]

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

Definition at line 352 of file G4THitsVector.hh.

353 {
354 vector_type* theHitsVector = GetVector(key);
355 _assign(theHitsVector, key, aHit);
356 return theHitsVector->size();
357 }

◆ set() [4/4]

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

Definition at line 362 of file G4THitsVector.hh.

363 {
364 vector_type* theHitsVector = GetVector(key);
365 store_type hit = allocate();
366 get_reference(hit) += *aHit;
367 _assign(theHitsVector, key, hit);
368 return theHitsVector->size();
369 }

◆ SetColID()

void G4VHitsCollection::SetColID ( G4int  i)
inlineinherited

Definition at line 65 of file G4VHitsCollection.hh.

65{ colID = i; }

References G4VHitsCollection::colID.

Referenced by G4HCofThisEvent::AddHitsCollection().

◆ size()

Vector_t::size_type G4VTHitsVector< _Tp , std::vector< _Tp * > >::size ( void  )
inlineinherited

Definition at line 106 of file G4THitsVector.hh.

106{ return GetContainer()->size(); }

Field Documentation

◆ colID

G4int G4VHitsCollection::colID
protectedinherited

◆ collectionName

G4String G4VHitsCollection::collectionName
protectedinherited

◆ SDname

G4String G4VHitsCollection::SDname
protectedinherited

◆ theCollection

void* G4HitsCollection::theCollection
protectedinherited

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