Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4HadTmpUtil.hh File Reference
#include "globals.hh"
#include <vector>
#include <algorithm>

Go to the source code of this file.

Classes

class  G4SortHelperPtr< A >
 
struct  G4Delete
 

Functions

G4String G4inttostring (int ai)
 
template<class A >
void G4PtrSort (std::vector< A * > *aList)
 

Function Documentation

◆ G4inttostring()

G4String G4inttostring ( int ai)

Definition at line 29 of file G4HadTmpUtil.cc.

30{
31 std::ostringstream ost;
32 ost << ai;
33 G4String result = ost.str();
34 return result;
35}

◆ G4PtrSort()

template<class A >
void G4PtrSort ( std::vector< A * > * aList)

Definition at line 47 of file G4HadTmpUtil.hh.

48{
49 std::vector<G4SortHelperPtr<A> > helper;
50 for(size_t i=0; i<aList->size(); i++) helper.push_back(aList->operator[](i));
51 std::sort(helper.begin(), helper.end());
52 for(size_t j=0; j<helper.size(); j++) aList->operator[](j)=&(*helper[j]);
53}