82 if (
this == &rhs)
return *
this;
101 exceptionDescription <<
"No G4ITModelHandler was passed to the modelProcessor.";
102 G4Exception(
"G4ITModelProcessor::InitializeStepper",
"ITModelProcessor002",
105 const std::vector<std::vector<G4ITModelManager*> >* modelManager =
fpModelHandler
111 exceptionDescription <<
"No G4ITModelManager was register to G4ITModelHandler.";
112 G4Exception(
"G4ITModelProcessor::InitializeStepper",
"ITModelProcessor003",
116 int nbModels1 = modelManager->size() ;
127 for(
int i = 0 ; i < nbModels1 ; i++)
129 nbModels2 = (*modelManager)[i].size();
131 for(
int j = 0 ; j <= i ; j++)
133 modman = (*modelManager)[i][j];
135 if(modman == 0) continue ;
137 model = modman -> GetModel(currentGlobalTime);
141 stepper -> Prepare() ;
146 if(nbModels1 == 1 && nbModels2 ==1)
163 exceptionDescription <<
"No track was passed to the method (track == 0).";
164 G4Exception(
"G4ITModelProcessor::CalculateStep",
"ITModelProcessor004",
184 for(
int i =0 ; i < (int) model.size() ; i++)
186 if(model[i] == 0)
continue;
194 const double currentStepTime,
195 const double previousStepTime,
196 const bool reachedUserStepTimeLimit)
200 if(tracks == 0) return ;
204 std::map<G4Track*, G4TrackVectorHandle>::iterator tracks_i = tracks->begin();;
206 for(tracks_i = tracks->begin() ; tracks_i != tracks-> end() ; tracks_i ++)
209 G4Track* trackA = tracks_i->first;
211 if(trackA == 0)
continue;
213 std::map<const G4Track*, G4bool>::iterator it_hasReacted =
fHasReacted.find(trackA);
218 G4ITType ITypeA = ITA -> GetITType();
220 const std::vector<G4VITModel*> model =
fCurrentModel[ITypeA];
223 std::vector<G4Track*>::iterator trackB_i = trackB_vector->begin();
230 for(; trackB_i != trackB_vector->end() ; trackB_i++)
234 if(trackB == 0)
continue;
249 exceptionDescription <<
"The IT reaction process sent back a reaction between trackA and trackB. ";
250 exceptionDescription <<
"The problem is trackA == trackB";
251 G4Exception(
"G4ITModelProcessor::FindReaction",
"ITModelProcessor005",
256 G4ITType ITypeBtmp = ITB -> GetITType();
258 if(ITypeB != ITypeBtmp)
263 process = model[ITypeB]->GetReactionProcess();
266 if(process && process -> TestReactibility(*trackA, *trackB,
267 currentStepTime, previousStepTime,
268 reachedUserStepTimeLimit))
277 changes -> GetTrackA();
278 changes -> GetTrackB();
G4IT * GetIT(const G4Track *track)
const std::vector< std::vector< G4ITModelManager * > > * GetAllModelManager()
static std::map< const G4Track *, G4bool > fHasReacted
void CalculateTimeStep(const G4Track *, const G4double)
G4ITModelProcessor & operator=(const G4ITModelProcessor &other)
void FindReaction(std::map< G4Track *, G4TrackVectorHandle > *, const double currentStepTime, const double previousStepTime, const bool reachedUserStepTimeLimit)
void InitializeStepper(const G4double ¤tGlobalTime, const G4double &userMinTime)
G4ITModelManager * fpModelManager
void SetTrack(const G4Track *)
std::vector< G4ITReactionChange * > fReactionInfo
std::vector< std::vector< G4VITModel * > > fCurrentModel
G4ITModelHandler * fpModelHandler
virtual ~G4ITModelProcessor()
G4double fUserMinTimeStep
virtual const G4ITType GetITType() const =0
G4TrackStatus GetTrackStatus() const
G4VITTimeStepper * GetTimeStepper()
virtual G4ITReactionChange * MakeReaction(const G4Track &, const G4Track &)=0
static void SetTimes(const G4double &, const G4double &)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
std::ostringstream G4ExceptionDescription