Import Geant4 10.0.0 source tree
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4AllITManager.hh 64057 2012-10-30 15:04:49Z gcosmo $
|
||||
// $Id: G4AllITManager.hh 71827 2013-06-25 15:58:24Z gcosmo $
|
||||
//
|
||||
// Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
|
||||
//
|
||||
@@ -101,7 +101,7 @@ public :
|
||||
|
||||
private :
|
||||
G4AllITManager();
|
||||
static std::auto_ptr<G4AllITManager> fInstance;
|
||||
static G4ThreadLocal G4AllITManager* fpInstance;
|
||||
std::map<G4ITType, G4VITManager*> fITSubManager ;
|
||||
|
||||
int fVerbose ;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4IT.hh 65022 2012-11-12 16:43:12Z gcosmo $
|
||||
// $Id: G4IT.hh 71125 2013-06-11 15:39:09Z gcosmo $
|
||||
//
|
||||
// Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
|
||||
//
|
||||
@@ -61,9 +61,9 @@ G4IT* GetIT(const G4Track* track) ;
|
||||
G4IT* GetIT(const G4Track& track) ;
|
||||
|
||||
#if defined G4EM_ALLOC_EXPORT
|
||||
extern G4DLLEXPORT G4Allocator<G4IT> aITAllocator;
|
||||
extern G4DLLEXPORT G4ThreadLocal G4Allocator<G4IT> *aITAllocator;
|
||||
#else
|
||||
extern G4DLLIMPORT G4Allocator<G4IT> aITAllocator;
|
||||
extern G4DLLIMPORT G4ThreadLocal G4Allocator<G4IT> *aITAllocator;
|
||||
#endif
|
||||
|
||||
class G4TrackListNode;
|
||||
@@ -89,7 +89,7 @@ public :
|
||||
inline void *operator new(size_t);
|
||||
inline void operator delete(void *aIT);
|
||||
|
||||
virtual void Print() const {}
|
||||
virtual void Print() const {;}
|
||||
virtual const G4String& GetName() const = 0 ;
|
||||
|
||||
///
|
||||
@@ -134,7 +134,7 @@ public :
|
||||
inline G4TrackingInformation* GetTrackingInfo(){return &fTrackingInformation;}
|
||||
|
||||
inline G4TrackListNode* GetTrackListNode(){return fpTrackNode;}
|
||||
inline void SetTrackListNode(G4TrackListNode* node){ fpTrackNode = node;}
|
||||
inline void SetTrackListNode(G4TrackListNode* node){fpTrackNode = node;}
|
||||
|
||||
virtual const G4ITType GetITType() const = 0 ;
|
||||
|
||||
@@ -161,13 +161,14 @@ private :
|
||||
///
|
||||
inline void* G4IT::operator new(size_t)
|
||||
{
|
||||
void *aIT;
|
||||
aIT = (void *) aITAllocator.MallocSingle();
|
||||
return aIT;
|
||||
if (!aITAllocator) aITAllocator = new G4Allocator<G4IT>;
|
||||
return (void *) aITAllocator->MallocSingle();
|
||||
}
|
||||
|
||||
inline void G4IT::operator delete(void *aIT)
|
||||
{ aITAllocator.FreeSingle((G4IT *) aIT);}
|
||||
{
|
||||
aITAllocator->FreeSingle((G4IT *) aIT);
|
||||
}
|
||||
|
||||
inline const G4ITBox* G4IT::GetITBox() const
|
||||
{
|
||||
@@ -261,6 +262,3 @@ inline G4KDNode* G4IT::GetNode() const
|
||||
return fpKDNode ;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4ITManager.hh 65022 2012-11-12 16:43:12Z gcosmo $
|
||||
// $Id: G4ITManager.hh 66872 2013-01-15 01:25:57Z japost $
|
||||
//
|
||||
// Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
|
||||
//
|
||||
@@ -150,7 +150,7 @@ public :
|
||||
template<typename T>
|
||||
class G4ITManager : public G4VITManager
|
||||
{
|
||||
static G4ITManager<T> * fInstance;
|
||||
static G4ThreadLocal G4ITManager<T> * fInstance;
|
||||
G4ITManager<T>();
|
||||
|
||||
typedef std::map<T,G4ITBox* > BoxMap;
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
TEMPLATE
|
||||
G4ITMANAGER * G4ITMANAGER::fInstance(0);
|
||||
G4ThreadLocal G4ITMANAGER * G4ITMANAGER::fInstance(0);
|
||||
|
||||
TEMPLATE
|
||||
G4ITMANAGER * G4ITMANAGER::Instance()
|
||||
@@ -118,15 +118,13 @@ void G4ITMANAGER::Push(G4Track* track)
|
||||
std::pair<typename BoxMap::iterator,bool> ret = fBox.insert(std::make_pair (T(key), itBox)) ;
|
||||
|
||||
typename BoxMap::iterator box_placement = ret.first;
|
||||
typename BoxMap::iterator previous_placement = ret.first;
|
||||
previous_placement--;
|
||||
typename BoxMap::iterator next_placement = ret.first;
|
||||
next_placement++;
|
||||
typename BoxMap::iterator last_placement = fBox.end();
|
||||
last_placement--;
|
||||
|
||||
if(box_placement != fBox.begin())
|
||||
{
|
||||
typename BoxMap::iterator previous_placement = ret.first;
|
||||
previous_placement--;
|
||||
G4ITBox* previous_box = previous_placement->second;
|
||||
if(previous_box)
|
||||
{
|
||||
@@ -136,6 +134,8 @@ void G4ITMANAGER::Push(G4Track* track)
|
||||
}
|
||||
if(box_placement != last_placement)
|
||||
{
|
||||
typename BoxMap::iterator next_placement = ret.first;
|
||||
next_placement++;
|
||||
G4ITBox* next_box = next_placement->second;
|
||||
if(next_box)
|
||||
{
|
||||
@@ -395,6 +395,14 @@ void G4ITMANAGER::UpdatePositionMap()
|
||||
position.y(),
|
||||
position.z(),
|
||||
currentIT);
|
||||
|
||||
// G4KDNode* node = currentTree->InsertMap(position.x(),
|
||||
// position.y(),
|
||||
// position.z(),
|
||||
// currentIT);
|
||||
|
||||
currentIT->SetNode(node);
|
||||
}
|
||||
|
||||
// currentTree->Build();
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4ITModelHandler.hh 64057 2012-10-30 15:04:49Z gcosmo $
|
||||
// $Id: G4ITModelHandler.hh 66881 2013-01-16 02:55:54Z adotti $
|
||||
//
|
||||
// Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
|
||||
//
|
||||
@@ -39,6 +39,7 @@
|
||||
#ifndef G4ITModelHandler_H
|
||||
#define G4ITModelHandler_H
|
||||
|
||||
#include "G4Types.hh"
|
||||
#include "G4ITType.hh"
|
||||
#include "G4ITModelManager.hh"
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4ITModelProcessor.hh 64057 2012-10-30 15:04:49Z gcosmo $
|
||||
// $Id: G4ITModelProcessor.hh 74551 2013-10-14 12:59:14Z gcosmo $
|
||||
//
|
||||
// Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
|
||||
//
|
||||
@@ -62,14 +62,10 @@ typedef G4ReferenceCountedHandle< std::vector<G4Track*> > G4TrackVectorHandle;
|
||||
class G4ITModelProcessor
|
||||
{
|
||||
public:
|
||||
/** Default constructor */
|
||||
G4ITModelProcessor();
|
||||
/** Default destructor */
|
||||
virtual ~G4ITModelProcessor();
|
||||
|
||||
|
||||
inline void SetModelHandler(G4ITModelHandler*);
|
||||
|
||||
void Initialize();
|
||||
|
||||
/**
|
||||
@@ -146,7 +142,7 @@ protected:
|
||||
|
||||
// Atribute for reactions
|
||||
std::vector<G4ITReactionChange*> fReactionInfo ;
|
||||
static std::map<const G4Track*, G4bool> fHasReacted;
|
||||
static G4ThreadLocal std::map<const G4Track*, G4bool> *fHasReacted;
|
||||
};
|
||||
|
||||
///
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ITNavigator.hh,v 1.34 2010-12-15 13:46:39 gcosmo Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
//
|
||||
//
|
||||
/// \brief { Class description:
|
||||
@@ -519,7 +518,6 @@ if(fpNavigatorState == 0) \
|
||||
exceptionDescription << "Either NewNavigatorStateAndLocate was not called "; \
|
||||
exceptionDescription << "or the provided navigator state was already NULL."; \
|
||||
G4Exception((G4String("G4Navigator")+G4String(__FUNCTION__)).c_str(),"NavigatorStateNotValid",FatalException,exceptionDescription); \
|
||||
exit(-1); \
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ITNavigator.icc,v 1.18 2010-12-15 13:46:39 gcosmo Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
//
|
||||
//
|
||||
// class G4ITNavigator Inline implementation
|
||||
@@ -131,7 +130,11 @@ inline
|
||||
void G4ITNavigator::ResetStackAndState()
|
||||
{
|
||||
G4cerr << "G4ITNavigator::ResetStackAndState not supported" << G4endl;
|
||||
exit(-1);
|
||||
|
||||
G4ExceptionDescription exceptionDescription;
|
||||
exceptionDescription << "G4ITNavigator::ResetStackAndState not supported";
|
||||
G4Exception((G4String("G4Navigator")+G4String(__FUNCTION__)).c_str(),"ITNavigator001,FatalException,exceptionDescription);
|
||||
|
||||
fpNavigatorState->fHistory.Reset();
|
||||
ResetState();
|
||||
// fpNavigatorState->Reset();
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4ITTrackHolder.hh 64374 2012-10-31 16:37:23Z gcosmo $
|
||||
// $Id: G4ITTrackHolder.hh 66881 2013-01-16 02:55:54Z adotti $
|
||||
//
|
||||
// Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
|
||||
//
|
||||
@@ -38,6 +38,8 @@
|
||||
#ifndef G4ITTRACKHOLDER_HH
|
||||
#define G4ITTRACKHOLDER_HH
|
||||
|
||||
#include "G4Types.hh"
|
||||
|
||||
class G4Track;
|
||||
|
||||
/**
|
||||
@@ -51,7 +53,7 @@ class G4ITTrackHolder
|
||||
protected :
|
||||
G4ITTrackHolder();
|
||||
virtual ~G4ITTrackHolder();
|
||||
static G4ITTrackHolder* fInstance;
|
||||
static G4ThreadLocal G4ITTrackHolder* fInstance;
|
||||
|
||||
public:
|
||||
static G4ITTrackHolder* Instance();
|
||||
|
||||
+3
-1
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4ITTrackingInteractivity.hh 64057 2012-10-30 15:04:49Z gcosmo $
|
||||
// $Id: G4ITTrackingInteractivity.hh 70171 2013-05-24 13:34:18Z gcosmo $
|
||||
//
|
||||
// Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
|
||||
//
|
||||
@@ -53,6 +53,8 @@ public:
|
||||
G4ITTrackingInteractivity(){;}
|
||||
virtual ~G4ITTrackingInteractivity(){;}
|
||||
|
||||
virtual void Initialize(){;}
|
||||
|
||||
virtual void StartTracking(G4Track*){;}
|
||||
virtual void AppendStep(G4Track* /*track*/, G4Step* /*step*/){;}
|
||||
virtual void EndTracking(G4Track*){;}
|
||||
|
||||
+2
-2
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4ITTransportationManager.hh 65022 2012-11-12 16:43:12Z gcosmo $
|
||||
// $Id: G4ITTransportationManager.hh 66872 2013-01-15 01:25:57Z japost $
|
||||
//
|
||||
/// \brief {Duplicated version of G4TransportationManager.
|
||||
/// This class just contains the pointer to the navigator object of the
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
private:
|
||||
G4ITTransportationManager();
|
||||
~G4ITTransportationManager();
|
||||
static G4ITTransportationManager* fpInstance;
|
||||
static G4ThreadLocal G4ITTransportationManager* fpInstance;
|
||||
void Initialize();
|
||||
G4ITNavigator* fpNavigator;
|
||||
};
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4ITType.hh 64057 2012-10-30 15:04:49Z gcosmo $
|
||||
// $Id: G4ITType.hh 74551 2013-10-14 12:59:14Z gcosmo $
|
||||
//
|
||||
// Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
|
||||
//
|
||||
@@ -40,6 +40,7 @@
|
||||
#define G4ITTYPE_HH 1
|
||||
|
||||
#include <cstddef>
|
||||
#include "G4Types.hh"
|
||||
|
||||
/**
|
||||
* Tag the G4IT
|
||||
@@ -83,16 +84,22 @@ inline G4ITType operator -(const G4ITType& left,const int& right) {
|
||||
class G4ITTypeManager
|
||||
{
|
||||
private:
|
||||
static G4ITTypeManager* fgInstance ;
|
||||
static /*G4ThreadLocal*/ G4ITTypeManager* fgInstance ;
|
||||
static G4ThreadLocal G4ITTypeManager* fgInstance_local ;
|
||||
G4ITType fLastType;
|
||||
G4ITTypeManager();
|
||||
virtual ~G4ITTypeManager();
|
||||
|
||||
size_t fRessource;
|
||||
|
||||
public :
|
||||
G4ITType NewType() ;
|
||||
size_t size() const;
|
||||
static G4ITTypeManager* Instance();
|
||||
static void DeleteInstance();
|
||||
|
||||
void ReserveRessource();
|
||||
void ReleaseRessource();
|
||||
};
|
||||
|
||||
#define ITDef(T)\
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef G4ITMAPROOM_HH
|
||||
#define G4ITMAPROOM_HH
|
||||
|
||||
#include <map>
|
||||
//#include <unordered_map>
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
#include <cmath>
|
||||
#include <iostream>
|
||||
|
||||
#include "G4KDNode.hh"
|
||||
|
||||
class __1DSortOut
|
||||
{
|
||||
public :
|
||||
__1DSortOut(int dimension);
|
||||
int GetDimension();
|
||||
G4KDNode *GetMidle(int& G4KDNode_deque);
|
||||
|
||||
//std::_Deque_iterator<G4KDNode*,G4KDNode*&,G4KDNode**> Insert(G4KDNode*);
|
||||
|
||||
std::deque<G4KDNode*>::iterator Insert(G4KDNode*);
|
||||
G4KDNode* PopOutMiddle();
|
||||
void Sort();
|
||||
//void Erase(std::_Deque_iterator<G4KDNode*,G4KDNode*&,G4KDNode**>&);
|
||||
void Erase(std::deque<G4KDNode*>::iterator &);
|
||||
|
||||
protected :
|
||||
struct sortOutNDim
|
||||
{
|
||||
sortOutNDim( int dimension)
|
||||
{
|
||||
fDimension = dimension;
|
||||
}
|
||||
|
||||
bool operator() (G4KDNode* const& lhs, G4KDNode* const& rhs) //const
|
||||
{
|
||||
return lhs->GetPosition()[fDimension] < rhs->GetPosition()[fDimension];
|
||||
}
|
||||
|
||||
int fDimension;
|
||||
};
|
||||
|
||||
std::deque<G4KDNode*> fContainer;
|
||||
sortOutNDim fSortOutNDim;
|
||||
};
|
||||
|
||||
class G4KDMap
|
||||
{
|
||||
public:
|
||||
G4KDMap(int dimensions) : fSortOut(dimensions)
|
||||
{
|
||||
fIsSorted = false;
|
||||
for(int i = 0 ; i < dimensions ; i++)
|
||||
{
|
||||
fSortOut[i] = new __1DSortOut(i);
|
||||
}
|
||||
}
|
||||
|
||||
void Insert(G4KDNode* pos);
|
||||
void Sort();
|
||||
|
||||
G4KDNode* PopOutMiddle(int dimension);
|
||||
int GetDimension()
|
||||
{
|
||||
return fSortOut.size();
|
||||
}
|
||||
|
||||
size_t GetSize()
|
||||
{
|
||||
return fMap.size();
|
||||
}
|
||||
|
||||
private:
|
||||
bool fIsSorted;
|
||||
std::vector<__1DSortOut*> fSortOut;
|
||||
// std::map<G4KDNode*, std::vector<std::_Deque_iterator<G4KDNode*,G4KDNode*&,G4KDNode**> > > fMap;
|
||||
|
||||
std::map<G4KDNode*, std::vector<std::deque<G4KDNode*>::iterator > > fMap;
|
||||
};
|
||||
|
||||
|
||||
#endif // G4ITMAPROOM_HH
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4KDTree.hh 64057 2012-10-30 15:04:49Z gcosmo $
|
||||
// $Id: G4KDTree.hh 70171 2013-05-24 13:34:18Z gcosmo $
|
||||
//
|
||||
// Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
|
||||
//
|
||||
@@ -42,6 +42,8 @@
|
||||
#include <vector>
|
||||
#include "G4KDTreeResult.hh"
|
||||
|
||||
class G4KDMap;
|
||||
|
||||
//__________________________________
|
||||
// Methods to act on kdnode
|
||||
// Methods defined in G4KDNode.cc :
|
||||
@@ -64,6 +66,7 @@ class G4KDTree
|
||||
struct HyperRect *fRect;
|
||||
void (*fDestr)(void*);
|
||||
int fNbNodes;
|
||||
G4KDMap* fKDMap;
|
||||
|
||||
protected :
|
||||
G4KDNode *fRoot;
|
||||
@@ -80,6 +83,10 @@ public :
|
||||
int GetNbNodes() { return fNbNodes; }
|
||||
G4KDNode* GetRoot() { return fRoot ; }
|
||||
|
||||
G4KDNode* InsertMap(const double& x, const double& y, const double& z, void *data);
|
||||
G4KDNode* InsertMap(const double *pos, void *data);
|
||||
void Build();
|
||||
|
||||
// Insert and attache the data to a node at the specified position
|
||||
// In return, it gives you the corresponding node
|
||||
G4KDNode* Insert(const double *pos, void *data);
|
||||
|
||||
+7
-7
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4UserReactionAction.hh 64057 2012-10-30 15:04:49Z gcosmo $
|
||||
// $Id: G4UserTimeStepAction.hh 74551 2013-10-14 12:59:14Z gcosmo $
|
||||
//
|
||||
// WARNING : This class is released as a prototype.
|
||||
// It might strongly evolve or even disapear in the next releases.
|
||||
@@ -44,19 +44,19 @@
|
||||
#include "G4TrackFastVector.hh"
|
||||
|
||||
/**
|
||||
* G4UserReactionAction is used by G4ITStepManager.
|
||||
* G4UserTimeStepAction is used by G4ITStepManager.
|
||||
* - StartProcessing called before processing
|
||||
* - TimeStepAction called at every global step
|
||||
* - UserReactionAction called when a reaction occurs
|
||||
* - EndProcessing called after processing
|
||||
*/
|
||||
|
||||
class G4UserReactionAction
|
||||
class G4UserTimeStepAction
|
||||
{
|
||||
public:
|
||||
G4UserReactionAction();
|
||||
G4UserReactionAction(const G4UserReactionAction& );
|
||||
virtual ~G4UserReactionAction();
|
||||
G4UserTimeStepAction();
|
||||
G4UserTimeStepAction(const G4UserTimeStepAction& );
|
||||
virtual ~G4UserTimeStepAction();
|
||||
|
||||
virtual void StartProcessing(){;}
|
||||
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
virtual void EndProcessing(){;}
|
||||
|
||||
private:
|
||||
G4UserReactionAction& operator=(const G4UserReactionAction& );
|
||||
G4UserTimeStepAction& operator=(const G4UserTimeStepAction& );
|
||||
};
|
||||
|
||||
#endif // G4VUSERITACTION_H
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VITProcess.hh 64057 2012-10-30 15:04:49Z gcosmo $
|
||||
// $Id: G4VITProcess.hh 74551 2013-10-14 12:59:14Z gcosmo $
|
||||
//
|
||||
// Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
|
||||
//
|
||||
@@ -140,14 +140,6 @@ protected: // with description
|
||||
|
||||
inline virtual void ClearInteractionTimeLeft();
|
||||
|
||||
//_________________________________________________
|
||||
// Redefine needed members and method of G4VProcess
|
||||
virtual void SubtractNumberOfInteractionLengthLeft(
|
||||
G4double previousStepSize
|
||||
);
|
||||
// subtract NumberOfInteractionLengthLeft by the value corresponding to
|
||||
// previousStepSize
|
||||
|
||||
inline virtual void ClearNumberOfInteractionLengthLeft();
|
||||
// clear NumberOfInteractionLengthLeft
|
||||
// !!! This method should be at the end of PostStepDoIt()
|
||||
@@ -163,10 +155,13 @@ protected: // with description
|
||||
G4bool fProposesTimeStep;
|
||||
|
||||
private :
|
||||
const size_t fProcessID; // During all the simulation will identify a
|
||||
// process, so if two identical process are created using a copy constructor
|
||||
// they will have the same fProcessID
|
||||
static size_t fNbProcess ;
|
||||
|
||||
size_t fProcessID;
|
||||
// During all the simulation will identify a process, so if two identical
|
||||
// processes are created using a copy constructor they will have the same
|
||||
// fProcessID. NOTE: due to MT, this cannot be "const".
|
||||
|
||||
static /*G4ThreadLocal*/ size_t *fNbProcess;
|
||||
|
||||
G4bool fInstantiateProcessState;
|
||||
//_________________________________________________
|
||||
@@ -206,6 +201,7 @@ inline G4bool G4VITProcess::ProposesTimeStep() const
|
||||
|
||||
inline const size_t& G4VITProcess::GetMaxProcessIndex()
|
||||
{
|
||||
return fNbProcess ;
|
||||
if (!fNbProcess) fNbProcess = new size_t ( 0);
|
||||
return *fNbProcess ;
|
||||
}
|
||||
#endif // G4VITProcess_H
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VITTimeStepper.hh 64057 2012-10-30 15:04:49Z gcosmo $
|
||||
// $Id: G4VITTimeStepper.hh 66872 2013-01-15 01:25:57Z japost $
|
||||
//
|
||||
// Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
|
||||
//
|
||||
@@ -85,8 +85,8 @@ public:
|
||||
inline const G4ITReactionTable* GetReactionTable();
|
||||
|
||||
protected :
|
||||
static G4double fCurrentGlobalTime ;
|
||||
static G4double fUserMinTimeStep ;
|
||||
static G4ThreadLocal G4double fCurrentGlobalTime ;
|
||||
static G4ThreadLocal G4double fUserMinTimeStep ;
|
||||
|
||||
G4double fSampledMinTimeStep ;
|
||||
G4TrackVectorHandle fReactants;
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/*
|
||||
* G4VTrackState.hh
|
||||
*
|
||||
* Created on: 8 avr. 2013
|
||||
* Author: kara
|
||||
*/
|
||||
|
||||
#ifndef G4VTRACKSTATE_HH_
|
||||
#define G4VTRACKSTATE_HH_
|
||||
|
||||
#include <CLHEP/Utility/memory.h>
|
||||
|
||||
class G4VTrackStateID
|
||||
{
|
||||
public :
|
||||
virtual int GetStateID() = 0;
|
||||
protected :
|
||||
G4VTrackStateID(){;}
|
||||
virtual ~G4VTrackStateID(){;}
|
||||
|
||||
static int fgLastID;
|
||||
};
|
||||
|
||||
class G4TrackState;
|
||||
|
||||
template <class T>
|
||||
class G4TrackStateID : public G4VTrackStateID
|
||||
{
|
||||
public :
|
||||
static CLHEP::shared_ptr<G4VTrackStateID> Get()
|
||||
{
|
||||
if(!fgTrackStateID)
|
||||
{
|
||||
new G4TrackStateID<T>;
|
||||
}
|
||||
|
||||
return fgTrackStateID;
|
||||
}
|
||||
|
||||
~G4TrackStateID<T>(){;}
|
||||
|
||||
virtual int GetStateID()
|
||||
{
|
||||
return fID;
|
||||
}
|
||||
|
||||
static int GetID()
|
||||
{
|
||||
if(fgTrackStateID)
|
||||
return fgTrackStateID->fID;
|
||||
else
|
||||
return -1; // TODO Exception
|
||||
}
|
||||
|
||||
private:
|
||||
G4TrackStateID<T>() : fID(fgLastID)
|
||||
{
|
||||
fgLastID++;
|
||||
fgTrackStateID = this;
|
||||
}
|
||||
|
||||
static CLHEP::shared_ptr<G4TrackStateID<T> > fgTrackStateID;
|
||||
const int fID;
|
||||
};
|
||||
|
||||
|
||||
class G4TrackState
|
||||
{
|
||||
public:
|
||||
template <class T> static G4TrackState* Create()
|
||||
{
|
||||
G4TrackState* output = new G4TrackState(G4TrackStateID<T>::Get());
|
||||
return output;
|
||||
}
|
||||
|
||||
int GetID()
|
||||
{
|
||||
return fpTrackStateID->GetStateID();
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual ~G4TrackState(){}
|
||||
|
||||
private :
|
||||
G4TrackState(CLHEP::shared_ptr<G4VTrackStateID> _trackStateID) : fpTrackStateID(_trackStateID)
|
||||
{}
|
||||
|
||||
CLHEP::shared_ptr<G4VTrackStateID> fpTrackStateID;
|
||||
};
|
||||
|
||||
#endif /* G4VTRACKSTATE_HH_ */
|
||||
Reference in New Issue
Block a user