Import Geant4 10.3.1 source tree
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4IT.hh 100802 2016-11-02 14:55:27Z gcosmo $
|
||||
// $Id: G4IT.hh 102637 2017-02-10 11:08:17Z gcosmo $
|
||||
//
|
||||
// Author: Mathieu Karamitros
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
#include "G4ITType.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4VUserTrackInformation.hh"
|
||||
#include "G4KDNode.hh"
|
||||
|
||||
///
|
||||
// To implement your own IT class, you should use
|
||||
@@ -60,6 +61,9 @@
|
||||
///
|
||||
|
||||
class G4IT;
|
||||
template<>
|
||||
G4KDNode<G4IT>::~G4KDNode();
|
||||
|
||||
class G4TrackingInformation;
|
||||
//template<typename PointT> class G4KDNode;
|
||||
class G4KDNode_Base;
|
||||
|
||||
@@ -163,7 +163,12 @@ public:
|
||||
|
||||
inline void PushToKill(G4Track* track)
|
||||
{
|
||||
G4TrackList::Pop(track);
|
||||
fToBeKilledList.push_back(track);
|
||||
|
||||
if(track->GetTrackStatus() != fKillTrackAndSecondaries){
|
||||
track->SetTrackStatus(fStopAndKill);
|
||||
}
|
||||
}
|
||||
|
||||
bool MergeNextTimeToMainList(double& time);
|
||||
|
||||
@@ -57,67 +57,67 @@ class G4KDNode_Base;
|
||||
class __1DSortOut
|
||||
{
|
||||
public :
|
||||
__1DSortOut(size_t dimension);
|
||||
__1DSortOut(const __1DSortOut& right);
|
||||
int GetDimension();
|
||||
G4KDNode_Base* GetMidle(int& /*G4KDNode_deque*/);
|
||||
__1DSortOut(size_t dimension);
|
||||
__1DSortOut(const __1DSortOut& right);
|
||||
int GetDimension();
|
||||
G4KDNode_Base* GetMidle(size_t& /*G4KDNode_deque*/);
|
||||
|
||||
std::deque<G4KDNode_Base*>::iterator Insert(G4KDNode_Base*);
|
||||
G4KDNode_Base* PopOutMiddle();
|
||||
void Sort();
|
||||
void Erase(std::deque<G4KDNode_Base*>::iterator &);
|
||||
size_t Size()
|
||||
{
|
||||
return fContainer.size();
|
||||
}
|
||||
std::deque<G4KDNode_Base*>::iterator Insert(G4KDNode_Base*);
|
||||
G4KDNode_Base* PopOutMiddle();
|
||||
void Sort();
|
||||
void Erase(std::deque<G4KDNode_Base*>::iterator &);
|
||||
size_t Size()
|
||||
{
|
||||
return fContainer.size();
|
||||
}
|
||||
|
||||
protected :
|
||||
struct sortOutNDim
|
||||
{
|
||||
sortOutNDim( size_t dimension)
|
||||
{
|
||||
fDimension = dimension;
|
||||
}
|
||||
bool operator() (G4KDNode_Base* const& lhs, G4KDNode_Base* const& rhs);
|
||||
size_t fDimension;
|
||||
};
|
||||
struct sortOutNDim
|
||||
{
|
||||
sortOutNDim( size_t dimension)
|
||||
{
|
||||
fDimension = dimension;
|
||||
}
|
||||
bool operator() (G4KDNode_Base* const& lhs, G4KDNode_Base* const& rhs);
|
||||
size_t fDimension;
|
||||
};
|
||||
|
||||
std::deque<G4KDNode_Base*> fContainer;
|
||||
sortOutNDim fSortOutNDim;
|
||||
std::deque<G4KDNode_Base*> fContainer;
|
||||
sortOutNDim fSortOutNDim;
|
||||
};
|
||||
|
||||
class G4KDMap
|
||||
{
|
||||
public:
|
||||
G4KDMap(size_t dimensions) : fSortOut(dimensions, __1DSortOut(dimensions))
|
||||
{
|
||||
G4KDMap(size_t dimensions): fSortOut(dimensions, __1DSortOut(dimensions))
|
||||
{
|
||||
fIsSorted = false;
|
||||
// for(size_t i = 0 ; i < dimensions ; i++)
|
||||
// {
|
||||
// fSortOut[i] = new __1DSortOut(i);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
void Insert(G4KDNode_Base* pos);
|
||||
void Sort();
|
||||
void Insert(G4KDNode_Base* pos);
|
||||
void Sort();
|
||||
|
||||
G4KDNode_Base* PopOutMiddle(size_t dimension);
|
||||
size_t GetDimension()
|
||||
{
|
||||
return fSortOut.size();
|
||||
}
|
||||
G4KDNode_Base* PopOutMiddle(size_t dimension);
|
||||
size_t GetDimension()
|
||||
{
|
||||
return fSortOut.size();
|
||||
}
|
||||
|
||||
size_t GetSize()
|
||||
{
|
||||
return fMap.size();
|
||||
}
|
||||
size_t GetSize()
|
||||
{
|
||||
return fMap.size();
|
||||
}
|
||||
|
||||
private:
|
||||
bool fIsSorted;
|
||||
std::vector<__1DSortOut> fSortOut;
|
||||
std::map<G4KDNode_Base*, std::vector<std::deque<G4KDNode_Base*>::iterator > > fMap;
|
||||
bool fIsSorted;
|
||||
std::vector<__1DSortOut> fSortOut;
|
||||
std::map<G4KDNode_Base*, std::vector<std::deque<G4KDNode_Base*>::iterator>> fMap;
|
||||
|
||||
// A mettre directement dans G4KDNode
|
||||
// A mettre directement dans G4KDNode
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4KDNode.hh 100802 2016-11-02 14:55:27Z gcosmo $
|
||||
// $Id: G4KDNode.hh 102637 2017-02-10 11:08:17Z gcosmo $
|
||||
//
|
||||
// Author: Mathieu Karamitros
|
||||
|
||||
@@ -51,7 +51,9 @@
|
||||
//#include <map>
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
#include <G4ThreeVector.hh>
|
||||
#include <ostream>
|
||||
|
||||
// geant4
|
||||
#include <G4Allocator.hh>
|
||||
|
||||
#include "globals.hh"
|
||||
@@ -63,7 +65,7 @@ class G4KDMap;
|
||||
class G4KDNode_Base
|
||||
{
|
||||
public:
|
||||
//________________________
|
||||
//----------------------------
|
||||
// For root node :
|
||||
// parent = 0, axis = 0, side = 0
|
||||
G4KDNode_Base(G4KDTree*, G4KDNode_Base* /*parent*/);
|
||||
@@ -72,25 +74,25 @@ public:
|
||||
virtual void InactiveNode();
|
||||
virtual bool IsValid() const{ return true; }
|
||||
|
||||
//________________________
|
||||
//----------------------------
|
||||
inline G4KDTree* GetTree() const {return fTree;}
|
||||
inline void SetTree(G4KDTree* tree) {fTree = tree;}
|
||||
|
||||
//________________________
|
||||
//----------------------------
|
||||
int GetDim() const;
|
||||
inline int GetAxis() const{return fAxis;}
|
||||
inline G4KDNode_Base* GetParent(){return fParent;}
|
||||
inline G4KDNode_Base* GetLeft(){return fLeft;}
|
||||
inline G4KDNode_Base* GetRight(){return fRight;}
|
||||
|
||||
//________________________
|
||||
//----------------------------
|
||||
template<typename Position>
|
||||
G4KDNode_Base* FindParent(const Position& x0);
|
||||
|
||||
template<typename PointT>
|
||||
G4KDNode_Base* Insert(PointT* point);
|
||||
template<typename PointT>
|
||||
G4KDNode_Base* Insert(const PointT& point);
|
||||
G4KDNode_Base* Insert(const PointT& point);
|
||||
int Insert(G4KDNode_Base* newNode);
|
||||
|
||||
void PullSubTree();
|
||||
@@ -98,8 +100,10 @@ public:
|
||||
|
||||
void Print(std::ostream& out, int level = 0) const;
|
||||
|
||||
// std::vector<std::deque<G4KDNode_Base* >::iterator >* GetIteratorsForSortingAlgo(G4KDMap*);
|
||||
// std::map<G4KDMap*, std::vector<std::deque<G4KDNode_Base* >::iterator > >* fpIteratorInSortingAlgo;
|
||||
// std::vector<std::deque<G4KDNode_Base*>::iterator>*
|
||||
// GetIteratorsForSortingAlgo(G4KDMap*);
|
||||
// std::map<G4KDMap*, std::vector<std::deque<G4KDNode_Base*>::iterator>>*
|
||||
// fpIteratorInSortingAlgo;
|
||||
|
||||
protected:
|
||||
//°°°°°°°°°°°
|
||||
@@ -132,7 +136,7 @@ template<typename PointT>
|
||||
class G4KDNode : public G4KDNode_Base
|
||||
{
|
||||
public:
|
||||
//________________________
|
||||
//----------------------------
|
||||
// For root node :
|
||||
// parent = 0, axis = 0, side = 0
|
||||
G4KDNode(G4KDTree*, PointT* /*point*/, G4KDNode_Base* /*parent*/);
|
||||
@@ -165,18 +169,18 @@ template<typename PointT>
|
||||
|
||||
protected:
|
||||
PointT* fPoint;
|
||||
G4bool fValid;
|
||||
bool fValid;
|
||||
|
||||
private:
|
||||
G4KDNode(const G4KDNode<PointT>& right);
|
||||
G4KDNode& operator=(const G4KDNode<PointT>& right);
|
||||
|
||||
static G4ThreadLocal G4Allocator<G4KDNode<PointT> >* fgAllocator;
|
||||
static G4ThreadLocal G4Allocator<G4KDNode<PointT>>* fgAllocator;
|
||||
};
|
||||
|
||||
template<typename PointT>
|
||||
G4ThreadLocal G4Allocator<G4KDNode<PointT> >* G4KDNode<PointT>::fgAllocator =
|
||||
0;
|
||||
G4ThreadLocal G4Allocator<G4KDNode<PointT>>*
|
||||
G4KDNode<PointT>::fgAllocator = 0;
|
||||
|
||||
template<typename PointT>
|
||||
void* G4KDNode<PointT>::operator new(size_t)
|
||||
@@ -191,17 +195,16 @@ template<typename PointT>
|
||||
fgAllocator->FreeSingle((G4KDNode<PointT> *) aNode);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* G4KDNode stores one entity in G4KDTree
|
||||
* This class is for internal use only
|
||||
*/
|
||||
|
||||
template<typename PointCopyT>
|
||||
class G4KDNodeCopy : public G4KDNode_Base
|
||||
class G4KDNodeCopy: public G4KDNode_Base
|
||||
{
|
||||
public:
|
||||
//________________________
|
||||
//----------------------------
|
||||
// For root node :
|
||||
// parent = 0, axis = 0, side = 0
|
||||
G4KDNodeCopy(G4KDTree* tree,
|
||||
@@ -254,9 +257,9 @@ template<typename PointCopyT>
|
||||
private:
|
||||
G4KDNodeCopy(const G4KDNodeCopy<PointCopyT>& right) :
|
||||
G4KDNode_Base(right), fPoint(0)
|
||||
{
|
||||
fValid = false;
|
||||
}
|
||||
{
|
||||
fValid = false;
|
||||
}
|
||||
|
||||
G4KDNodeCopy<PointCopyT>&
|
||||
operator=(const G4KDNodeCopy<PointCopyT>& right)
|
||||
@@ -276,8 +279,8 @@ template<typename PointCopyT>
|
||||
};
|
||||
|
||||
template<typename PointT>
|
||||
G4ThreadLocal G4Allocator<G4KDNodeCopy<PointT>>* G4KDNodeCopy<PointT>::fgAllocator =
|
||||
0;
|
||||
G4ThreadLocal G4Allocator<G4KDNodeCopy<PointT>>*
|
||||
G4KDNodeCopy<PointT>::fgAllocator = 0;
|
||||
|
||||
#include "G4KDNode.icc"
|
||||
|
||||
|
||||
@@ -190,6 +190,11 @@ public:
|
||||
{
|
||||
return fMaxTimeStep;
|
||||
}
|
||||
|
||||
inline G4ITTrackingManager* GetTrackingManager() const
|
||||
{
|
||||
return fpTrackingManager;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user