83 if (
this == &rhs)
return *
this;
102 exceptionDescription <<
"No G4ITModelHandler was passed to the modelProcessor.";
103 G4Exception(
"G4ITModelProcessor::InitializeStepper",
"ITModelProcessor002",
106 const std::vector<std::vector<G4ITModelManager*> >* modelManager =
fpModelHandler
112 exceptionDescription <<
"No G4ITModelManager was register to G4ITModelHandler.";
113 G4Exception(
"G4ITModelProcessor::InitializeStepper",
"ITModelProcessor003",
117 int nbModels1 = modelManager->size() ;
128 for(
int i = 0 ; i < nbModels1 ; i++)
130 nbModels2 = (*modelManager)[i].size();
132 for(
int j = 0 ; j <= i ; j++)
134 modman = (*modelManager)[i][j];
136 if(modman == 0) continue ;
138 model = modman -> GetModel(currentGlobalTime);
142 stepper -> Prepare() ;
147 if(nbModels1 == 1 && nbModels2 ==1)
164 exceptionDescription <<
"No track was passed to the method (track == 0).";
165 G4Exception(
"G4ITModelProcessor::CalculateStep",
"ITModelProcessor004",
185 for(
int i =0 ; i < (
int) model.size() ; i++)
187 if(model[i] == 0)
continue;
195 const double currentStepTime,
196 const double previousStepTime,
197 const bool reachedUserStepTimeLimit)
201 if(tracks == 0) return ;
205 std::map<G4Track*, G4TrackVectorHandle>::iterator tracks_i = tracks->begin();;
207 for(tracks_i = tracks->begin() ; tracks_i != tracks-> end() ; tracks_i ++)
210 G4Track* trackA = tracks_i->first;
212 if(trackA == 0)
continue;
214 std::map<const G4Track*, G4bool>::iterator it_hasReacted =
fHasReacted->find(trackA);
219 G4ITType ITypeA = ITA -> GetITType();
224 std::vector<G4Track*>::iterator trackB_i = trackB_vector->begin();
231 for(; trackB_i != trackB_vector->end() ; trackB_i++)
235 if(trackB == 0)
continue;
250 exceptionDescription <<
"The IT reaction process sent back a reaction between trackA and trackB. ";
251 exceptionDescription <<
"The problem is trackA == trackB";
252 G4Exception(
"G4ITModelProcessor::FindReaction",
"ITModelProcessor005",
257 G4ITType ITypeBtmp = ITB -> GetITType();
259 if(ITypeB != ITypeBtmp)
264 process = model[ITypeB]->GetReactionProcess();
267 if(process && process -> TestReactibility(*trackA, *trackB,
268 currentStepTime, previousStepTime,
269 reachedUserStepTimeLimit))
276 (*fHasReacted)[trackA] =
true;
277 (*fHasReacted)[trackB] =
true;
278 changes -> GetTrackA();
279 changes -> GetTrackB();
const std::vector< std::vector< G4ITModelManager * > > * GetAllModelManager()
static G4ThreadLocal std::map< const G4Track *, G4bool > * fHasReacted
std::ostringstream G4ExceptionDescription
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
void SetTrack(const G4Track *)
std::vector< G4ITReactionChange * > fReactionInfo
G4TrackStatus GetTrackStatus() const
void CalculateTimeStep(const G4Track *, const G4double)
G4IT * GetIT(const G4Track *track)
G4double fUserMinTimeStep
const XML_Char XML_Content * model
virtual ~G4ITModelProcessor()
G4VITTimeStepper * GetTimeStepper()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4ITModelProcessor & operator=(const G4ITModelProcessor &other)
G4ITModelManager * fpModelManager
virtual const G4ITType GetITType() const =0
void FindReaction(std::map< G4Track *, G4TrackVectorHandle > *, const double currentStepTime, const double previousStepTime, const bool reachedUserStepTimeLimit)
void InitializeStepper(const G4double ¤tGlobalTime, const G4double &userMinTime)
static void SetTimes(const G4double &, const G4double &)
std::vector< std::vector< G4VITModel * > > fCurrentModel
virtual G4ITReactionChange * MakeReaction(const G4Track &, const G4Track &)=0
G4ITModelHandler * fpModelHandler