G4ITModelProcessor.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 // $Id: G4ITModelProcessor.hh 64057 2012-10-30 15:04:49Z gcosmo $
00027 //
00028 // Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
00029 //
00030 // WARNING : This class is released as a prototype.
00031 // It might strongly evolve or even disapear in the next releases.
00032 //
00033 // History:
00034 // -----------
00035 // 10 Oct 2011 M.Karamitros created
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     // Time stepper part
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     // Reaction process part
00095     void FindReaction(std::map<G4Track*, G4TrackVectorHandle>*,
00096                       const double currentStepTime,
00097                       const double previousStepTime,
00098                       const bool reachedUserStepTimeLimit) ;
00099 
00100     //____________________________________________________________
00101     // Get results
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     // Members
00128     G4bool fInitialized;
00129     G4ITModelHandler* fpModelHandler ;
00130 
00131     const G4Track* fpTrack;
00132     G4double fUserMinTimeStep;
00133 
00134     // Attributes for interaction between many IT types
00135     // eg : electron/proton
00136     std::vector<std::vector<G4VITModel*> >   fCurrentModel;
00137 
00138     // Attributes for interaction between one type of IT
00139     // eg : molecule/molecule or electron/electron
00140     G4VITModel*                 fpModel;
00141     G4ITModelManager*           fpModelManager;
00142 //    G4double                    fNextTimeChangeModel ;
00143 
00144     G4ITType    fCurrentType1;
00145     G4ITType    fCurrentType2;
00146 
00147     // Atribute for reactions
00148     std::vector<G4ITReactionChange*> fReactionInfo ;
00149     static std::map<const G4Track*, G4bool> fHasReacted;
00150 };
00151 
00153 // Inline methods
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

Generated on Mon May 27 17:48:41 2013 for Geant4 by  doxygen 1.4.7