00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef G4ITMODELPROCESSOR_H
00040 #define G4ITMODELPROCESSOR_H
00041
00042 #include <vector>
00043 #include "G4ITReactionChange.hh"
00044 #include "G4ITType.hh"
00045 #include "G4ITModelHandler.hh"
00046
00047 class G4VITTimeStepper;
00048 class G4VITReactionProcess;
00049 class G4ITModelHandler;
00050
00051 typedef G4ReferenceCountedHandle< std::vector<G4Track*> > G4TrackVectorHandle;
00052
00062 class G4ITModelProcessor
00063 {
00064 public:
00066 G4ITModelProcessor();
00068 virtual ~G4ITModelProcessor();
00069
00070
00071 inline void SetModelHandler(G4ITModelHandler*);
00072
00073 void Initialize();
00074
00079 inline void CleanProcessor();
00080
00081
00082
00083 void InitializeStepper(const G4double& currentGlobalTime,
00084 const G4double& userMinTime);
00085 protected :
00086
00087 inline void SetTrack(const G4Track*);
00088
00089 public :
00090 void CalculateTimeStep(const G4Track*, const G4double);
00091 void DoCalculateStep();
00092
00093
00094
00095 void FindReaction(std::map<G4Track*, G4TrackVectorHandle>*,
00096 const double currentStepTime,
00097 const double previousStepTime,
00098 const bool reachedUserStepTimeLimit) ;
00099
00100
00101
00102 inline const std::vector<std::vector<G4VITModel*> >* GetCurrentModel();
00103
00104 inline std::vector<G4ITReactionChange*>* GetReactionInfo()
00105 {
00106 return &fReactionInfo;
00107 }
00108
00109 const G4Track* GetTrack() const
00110 {
00111 return fpTrack;
00112 }
00113
00114
00115 protected:
00119 G4ITModelProcessor(const G4ITModelProcessor& other);
00124 G4ITModelProcessor& operator=(const G4ITModelProcessor& other);
00125
00126
00127
00128 G4bool fInitialized;
00129 G4ITModelHandler* fpModelHandler ;
00130
00131 const G4Track* fpTrack;
00132 G4double fUserMinTimeStep;
00133
00134
00135
00136 std::vector<std::vector<G4VITModel*> > fCurrentModel;
00137
00138
00139
00140 G4VITModel* fpModel;
00141 G4ITModelManager* fpModelManager;
00142
00143
00144 G4ITType fCurrentType1;
00145 G4ITType fCurrentType2;
00146
00147
00148 std::vector<G4ITReactionChange*> fReactionInfo ;
00149 static std::map<const G4Track*, G4bool> fHasReacted;
00150 };
00151
00153
00155
00156 inline void G4ITModelProcessor::SetTrack(const G4Track* track)
00157 {
00158 fpTrack = track;
00159 }
00160
00161 inline const std::vector<std::vector<G4VITModel*> >* G4ITModelProcessor::GetCurrentModel()
00162 {
00163 return &fCurrentModel ;
00164 }
00165
00166 inline void G4ITModelProcessor::SetModelHandler(G4ITModelHandler* modelHandler)
00167 {
00168 if(fInitialized == 1)
00169 {
00170 G4ExceptionDescription exceptionDescription ;
00171 exceptionDescription << "You are trying to set a new model while the model processor has alreaday be initialized";
00172 G4Exception("G4ITModelProcessor::SetModelHandler","ITModelProcessor001",
00173 FatalErrorInArgument,exceptionDescription);
00174 }
00175 fpModelHandler = modelHandler;
00176 }
00177
00178 inline void G4ITModelProcessor::CleanProcessor()
00179 {
00180 fpTrack = 0;
00181 }
00182 #endif // G4ITMODELPROCESSOR_H