Index: trunk/source/processes/electromagnetic/adjoint/include/G4AdjointIonIonisationModel.hh
===================================================================
--- trunk/source/processes/electromagnetic/adjoint/include/G4AdjointIonIonisationModel.hh	(revision 1197)
+++ trunk/source/processes/electromagnetic/adjoint/include/G4AdjointIonIonisationModel.hh	(revision 1197)
@@ -0,0 +1,152 @@
+//
+// ********************************************************************
+// * 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.          *
+// ********************************************************************
+//
+// $Id: G4AdjointIonIonisationModel.hh,v 1.2 2009/11/20 10:31:20 ldesorgh Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
+//
+/////////////////////////////////////////////////////////////////////////////////
+//      Class:		G4IonIonisationModel
+//	Author:       	L. Desorgher
+// 	Organisation: 	SpaceIT GmbH
+//	Contract:	ESA contract 21435/08/NL/AT
+// 	Customer:     	ESA/ESTEC
+/////////////////////////////////////////////////////////////////////////////////
+//
+// CHANGE HISTORY
+// --------------
+//      ChangeHistory: 
+//	 	26th August 2009 creation by L. Desorgher  		
+//
+//-------------------------------------------------------------
+//	Documentation:
+//		Adjoint EM model for discrete reverse ion ionisation
+//
+
+#ifndef G4AdjointIonIonisationModel_h
+#define G4AdjointIonIonisationModel_h 1
+
+#include "globals.hh"
+#include "G4DynamicParticle.hh"
+#include "G4ParticleDefinition.hh"
+#include "G4MaterialCutsCouple.hh"
+#include "G4Material.hh"
+#include "G4Element.hh"
+#include "G4ElementVector.hh"
+#include "Randomize.hh"
+#include "G4ParticleDefinition.hh"
+#include "G4VEmModel.hh"
+#include "G4Electron.hh"
+#include "G4Gamma.hh"
+#include "G4ProductionCutsTable.hh"
+#include "G4VEmAdjointModel.hh"
+class G4PhysicsTable;
+class G4Region;
+class G4VParticleChange;
+class G4ParticleChange;
+class G4Track;
+class G4AdjointCSMatrix;
+
+
+class G4AdjointIonIonisationModel: public G4VEmAdjointModel
+{
+
+public:
+
+  G4AdjointIonIonisationModel();
+
+  virtual ~G4AdjointIonIonisationModel();
+  
+  
+  virtual void SampleSecondaries(const G4Track& aTrack,
+                                G4bool IsScatProjToProjCase,
+				G4ParticleChange* fParticleChange);
+
+
+  virtual G4double DiffCrossSectionPerAtomPrimToSecond(
+                                      G4double kinEnergyProj,  // kinetic energy of the primary particle before the interaction 
+                                      G4double kinEnergyProd, // kinetic energy of the secondary particle 
+				      G4double Z, 
+                                      G4double A = 0.);
+  
+  virtual void CorrectPostStepWeight(G4ParticleChange* fParticleChange, 
+  				     G4double old_weight, 
+				     G4double adjointPrimKinEnergy, 
+				     G4double projectileKinEnergy,
+				     G4bool IsScatProjToProjCase);				      				      
+ 
+  //Set/Get methods
+  //------------------
+  
+  virtual G4double GetSecondAdjEnergyMaxForScatProjToProjCase(G4double PrimAdjEnergy);
+  virtual G4double GetSecondAdjEnergyMinForScatProjToProjCase(G4double PrimAdjEnergy,G4double Tcut=0);
+  virtual G4double GetSecondAdjEnergyMaxForProdToProjCase(G4double PrimAdjEnergy);
+  virtual G4double GetSecondAdjEnergyMinForProdToProjCase(G4double PrimAdjEnergy);
+  
+  inline void SetUseOnlyBragg(G4bool aBool){use_only_bragg =aBool;}
+  
+  
+  void SetIon(G4ParticleDefinition* adj_ion, G4ParticleDefinition* fwd_ion);
+ 
+
+private: //Methods
+     
+    
+  void DefineProjectileProperty();
+  
+  //projectile property
+  G4double mass;
+  G4double tlimit;
+  G4double spin;
+  G4double magMoment2;
+  G4double chargeSquare;
+  G4double massRatio;
+  
+  G4double ratio, ratio2; 
+  G4double one_plus_ratio_2;
+  G4double formfact;
+  G4double twoln10;
+  G4double bg2lim;
+  G4double taulim;
+  G4double corrFactor;
+  G4bool   isIon;
+  G4double one_minus_ratio_2;
+  
+  G4bool use_only_bragg;
+  
+  
+  G4VEmModel* theBraggIonDirectEMModel; 
+  G4VEmModel* theBetheBlochDirectEMModel;				    
+
+  
+
+   
+   
+
+  
+};
+
+
+#endif
+
Index: trunk/source/processes/electromagnetic/adjoint/include/G4AdjointProcessEquivalentToDirectProcess.hh
===================================================================
--- trunk/source/processes/electromagnetic/adjoint/include/G4AdjointProcessEquivalentToDirectProcess.hh	(revision 1197)
+++ trunk/source/processes/electromagnetic/adjoint/include/G4AdjointProcessEquivalentToDirectProcess.hh	(revision 1197)
@@ -0,0 +1,173 @@
+//
+// ********************************************************************
+// * 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.          *
+// ********************************************************************
+//
+// $Id: G4AdjointProcessEquivalentToDirectProcess.hh,v 1.2 2009/11/20 10:31:20 ldesorgh Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
+//
+/////////////////////////////////////////////////////////////////////////////////
+//      Class:		G4AdjointProcessEquivalentToDirectProcess
+//	Author:       	L. Desorgher
+// 	Organisation: 	SpaceIT GmbH
+//	Contract:	ESA contract 21435/08/NL/AT
+// 	Customer:     	ESA/ESTEC
+/////////////////////////////////////////////////////////////////////////////////
+//
+// CHANGE HISTORY
+// --------------
+//      ChangeHistory: 
+//	 	25 Sept. 2009 Created by L.Desorgher. Inspired from G4WrapperProcess  		
+//
+//-------------------------------------------------------------
+//	Documentation:
+//		Adjoint process equivalent to direct process, used for some multiple scattering
+//
+// 
+
+
+#ifndef G4AdjointProcessEquivalentToDirectProcess_h 
+#define G4AdjointProcessEquivalentToDirectProcess_h 1
+
+#include "globals.hh"
+#include "G4ios.hh"
+#include "G4VProcess.hh"
+
+class G4AdjointProcessEquivalentToDirectProcess : public G4VProcess
+{
+  //  A virtual class for wrapper process objects.
+
+  public: // with description
+  //  constructor requires the process name and type
+      G4AdjointProcessEquivalentToDirectProcess(const G4String& aName, G4VProcess* aProcess,G4ParticleDefinition* fwd_particle_def);
+
+ 
+
+  public: 
+  //  destructor 
+      virtual ~G4AdjointProcessEquivalentToDirectProcess();
+
+ 
+  public: // with description
+  ////////////////////////////
+  // DoIt    /////////////////
+  ///////////////////////////
+      virtual G4VParticleChange* PostStepDoIt(
+                             const G4Track& track,
+                             const G4Step&  stepData
+                            );
+
+      virtual G4VParticleChange* AlongStepDoIt(
+                             const G4Track& track,
+                             const G4Step& stepData
+                            );
+      virtual G4VParticleChange* AtRestDoIt(
+                             const G4Track& track,
+                             const G4Step& stepData
+                            );
+  //////////////////////////
+  // GPIL    //////////////
+  /////////////////////////  
+      virtual G4double AlongStepGetPhysicalInteractionLength(
+                             const G4Track& track,
+                             G4double  previousStepSize,
+                             G4double  currentMinimumStep,
+                             G4double& proposedSafety,
+                             G4GPILSelection* selection);
+
+      virtual G4double AtRestGetPhysicalInteractionLength(
+                             const G4Track& track,
+                             G4ForceCondition* condition
+                            );
+
+      virtual G4double PostStepGetPhysicalInteractionLength(
+                             const G4Track& track,
+                             G4double   previousStepSize,
+                             G4ForceCondition* condition
+                            ) ;
+  
+  ////////////////////// 
+      virtual G4bool IsApplicable(const G4ParticleDefinition&);
+      // Returns true if this process object is applicable to
+      // the particle type
+      // Process will not be registered to a particle if IsApplicable is false   
+
+      virtual void BuildPhysicsTable(const G4ParticleDefinition&);
+      // Messaged by the Particle definition (via the Process manager)
+      // whenever cross section tables have to be rebuilt (i.e. if new
+      // materials have been defined). 
+      // It is overloaded by individual processes when they need physics
+      // tables. 
+
+      // Processes which Build (for example in their
+      // constructors) physics tables independent of cuts
+      // should preferably use a
+      // private void BuildThePhysicsTable()
+      // function. Not another BuildPhysicsTable, please.
+ 
+      virtual void PreparePhysicsTable(const G4ParticleDefinition&);
+      // Messaged by the Particle definition (via the Process manager)
+      // whenever cross section tables have to be prepare for rebuilt 
+      // (i.e. if new materials have been defined). 
+      // It is overloaded by individual processes when they need physics
+      // tables. 
+
+      // Processes which Build physics tables independent of cuts
+      // (for example in their constructors)
+      // should preferably use private 
+      // void BuildThePhysicsTable() and void PreparePhysicsTable().
+      // Not another BuildPhysicsTable, please.
+
+
+      virtual G4bool StorePhysicsTable(const G4ParticleDefinition* ,
+                                       const G4String& directory, 
+                                       G4bool          ascii = false); 
+      // Store PhysicsTable in a file. 
+      // (return false in case of failure at I/O ) 
+ 
+      virtual G4bool RetrievePhysicsTable( const G4ParticleDefinition* ,
+                                           const G4String& directory, 
+                                           G4bool          ascii = false);
+      // Retrieve Physics from a file. 
+      // (return true if the Physics Table can be build by using file)
+      // (return false if the process has no functionality or in case of failure)
+      // File name should be defined by each process 
+      // and the file should be placed under the directory specifed by the argument. 
+  ////////////////////////////
+      virtual void StartTracking(G4Track*);
+      virtual void EndTracking();
+      // inform Start/End of tracking for each track to the physics process 
+ 
+ 
+  
+   public:
+      virtual void      ResetNumberOfInteractionLengthLeft();
+      // reset (determine the value of)NumberOfInteractionLengthLeft
+   private:
+      G4ParticleDefinition* theFwdParticleDef; 
+      G4VProcess* theDirectProcess;  
+
+};
+
+
+#endif
Index: trunk/source/processes/electromagnetic/adjoint/include/G4AdjointeIonisationModel.hh
===================================================================
--- trunk/source/processes/electromagnetic/adjoint/include/G4AdjointeIonisationModel.hh	(revision 1197)
+++ trunk/source/processes/electromagnetic/adjoint/include/G4AdjointeIonisationModel.hh	(revision 1197)
@@ -0,0 +1,85 @@
+//
+// ********************************************************************
+// * 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.          *
+// ********************************************************************
+//
+// $Id: G4AdjointeIonisationModel.hh,v 1.2 2009/11/20 10:31:20 ldesorgh Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
+//
+/////////////////////////////////////////////////////////////////////////////////
+//      Module:		G4AdjointeIonisationModel
+//	Author:       	L. Desorgher
+// 	Organisation: 	SpaceIT GmbH
+//	Contract:	ESA contract 21435/08/NL/AT
+// 	Customer:     	ESA/ESTEC
+/////////////////////////////////////////////////////////////////////////////////
+//
+// CHANGE HISTORY
+// --------------
+//      ChangeHistory: 
+//	 	 September 2009 creation by L. Desorgher. Separate the concrete ionisation stuff from G4VEMAdjointModel  		
+//
+//-------------------------------------------------------------
+//	Documentation:
+//		Adjoint EM model for discrete reverse e- ionisation
+//
+
+#ifndef G4AdjointeIonisationModel_h
+#define G4AdjointeIonisationModel_h 1
+
+#include "globals.hh"
+#include "G4VEmAdjointModel.hh"
+#include "G4PEEffectModel.hh"
+
+class G4AdjointeIonisationModel: public G4VEmAdjointModel
+{
+
+public: //methods
+
+//Constructor, destructor
+  G4AdjointeIonisationModel();
+
+  virtual ~G4AdjointeIonisationModel();
+
+//Concrete implementation or virtual methods
+  
+  virtual void SampleSecondaries(const G4Track& aTrack,
+                                G4bool IsScatProjToProjCase,
+				G4ParticleChange* fParticleChange);
+  
+  virtual G4double DiffCrossSectionPerAtomPrimToSecond(
+                                      G4double kinEnergyProj,  // kinetic energy of the primary particle before the interaction 
+                                      G4double kinEnergyProd, // kinetic energy of the secondary particle 
+				      G4double Z, 
+                                      G4double A = 0.);
+
+				
+private:  
+  G4double DiffCrossSectionMoller(G4double kinEnergyProj,G4double kinEnergyProd);
+private: //attributes   
+   G4bool WithRapidSampling;
+   
+
+};
+#endif
+
Index: trunk/source/processes/electromagnetic/adjoint/include/G4AdjointhIonisationModel.hh
===================================================================
--- trunk/source/processes/electromagnetic/adjoint/include/G4AdjointhIonisationModel.hh	(revision 1197)
+++ trunk/source/processes/electromagnetic/adjoint/include/G4AdjointhIonisationModel.hh	(revision 1197)
@@ -0,0 +1,142 @@
+//
+// ********************************************************************
+// * 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.          *
+// ********************************************************************
+//
+// $Id: G4AdjointhIonisationModel.hh,v 1.2 2009/11/20 10:31:20 ldesorgh Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
+//
+/////////////////////////////////////////////////////////////////////////////////
+//      Module:		G4AdjointhIonisationModel
+//	Author:       	L. Desorgher
+// 	Organisation: 	SpaceIT GmbH
+//	Contract:	ESA contract 21435/08/NL/AT
+// 	Customer:     	ESA/ESTEC
+/////////////////////////////////////////////////////////////////////////////////
+//
+// CHANGE HISTORY
+// --------------
+//      ChangeHistory: 
+//	 	13th February 2009 creation by L. Desorgher  
+//		10 November 2009   Implementation of the rapid sampling.  	 		
+//
+//-------------------------------------------------------------
+//	Documentation:
+//		Adjoint EM model for discrete reverse hadron ionisation. Tested at the moment only for protons.
+//
+
+#ifndef G4AdjointhIonisationModel_h
+#define G4AdjointhIonisationModel_h 1
+
+#include "globals.hh"
+#include "G4DynamicParticle.hh"
+#include "G4ParticleDefinition.hh"
+#include "G4MaterialCutsCouple.hh"
+#include "G4Material.hh"
+#include "G4Element.hh"
+#include "G4ElementVector.hh"
+#include "Randomize.hh"
+#include "G4ParticleDefinition.hh"
+#include "G4VEmModel.hh"
+#include "G4Electron.hh"
+#include "G4Gamma.hh"
+#include "G4ProductionCutsTable.hh"
+#include "G4VEmAdjointModel.hh"
+class G4PhysicsTable;
+class G4Region;
+class G4VParticleChange;
+class G4ParticleChange;
+class G4Track;
+class G4AdjointCSMatrix;
+
+
+class G4AdjointhIonisationModel: public G4VEmAdjointModel
+{
+
+public:
+
+  G4AdjointhIonisationModel(G4ParticleDefinition* projectileDefinition);
+
+  virtual ~G4AdjointhIonisationModel();
+
+  virtual void SampleSecondaries(const G4Track& aTrack,
+                                G4bool IsScatProjToProjCase,
+				G4ParticleChange* fParticleChange);
+  void RapidSampleSecondaries(const G4Track& aTrack,
+                                G4bool IsScatProjToProjCase,
+				G4ParticleChange* fParticleChange);
+  virtual G4double DiffCrossSectionPerAtomPrimToSecond(
+                                      G4double kinEnergyProj,  // kinetic energy of the primary particle before the interaction 
+                                      G4double kinEnergyProd, // kinetic energy of the secondary particle 
+				      G4double Z, 
+                                      G4double A = 0.);
+ 
+  virtual G4double AdjointCrossSection(const G4MaterialCutsCouple* aCouple,
+				             G4double primEnergy,
+				             G4bool IsScatProjToProjCase); 				      
+ 
+  //Set/Get methods
+  //------------------
+  
+  virtual G4double GetSecondAdjEnergyMaxForScatProjToProjCase(G4double PrimAdjEnergy);
+  virtual G4double GetSecondAdjEnergyMinForScatProjToProjCase(G4double PrimAdjEnergy,G4double Tcut=0);
+  virtual G4double GetSecondAdjEnergyMaxForProdToProjCase(G4double PrimAdjEnergy);
+  virtual G4double GetSecondAdjEnergyMinForProdToProjCase(G4double PrimAdjEnergy);
+ 
+
+private: //Methods
+     
+    
+  void DefineProjectileProperty();
+  
+  //projectile property
+  G4double mass;
+  G4double tlimit;
+  G4double spin;
+  G4double magMoment2;
+  G4double chargeSquare;
+  G4double ratio, ratio2; 
+  G4double one_plus_ratio_2;
+  G4double formfact;
+  G4double twoln10;
+  G4double bg2lim;
+  G4double taulim;
+  G4double corrFactor;
+  G4bool   isIon;
+  G4double one_minus_ratio_2;
+  
+  
+  G4VEmModel* theBraggDirectEMModel;	
+  G4double term_Cross1, term_Cross2;			    
+
+
+
+   
+   
+
+  
+};
+
+
+#endif
+
Index: trunk/source/processes/electromagnetic/adjoint/include/G4AdjointhMultipleScattering.hh
===================================================================
--- trunk/source/processes/electromagnetic/adjoint/include/G4AdjointhMultipleScattering.hh	(revision 1197)
+++ trunk/source/processes/electromagnetic/adjoint/include/G4AdjointhMultipleScattering.hh	(revision 1197)
@@ -0,0 +1,129 @@
+//
+// ********************************************************************
+// * 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.          *
+// ********************************************************************
+//
+// $Id: G4AdjointhMultipleScattering.hh,v 1.2 2009/11/20 10:31:20 ldesorgh Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
+//
+/////////////////////////////////////////////////////////////////////////////////
+//      Class:		G4AdjointhMultipleScattering
+//	Author:       	L. Desorgher
+// 	Organisation: 	SpaceIT GmbH
+//	Contract:	ESA contract 21435/08/NL/AT
+// 	Customer:     	ESA/ESTEC
+/////////////////////////////////////////////////////////////////////////////////
+//
+// GEANT4 Class header file
+//
+// File name:     G4AdjointhMultipleScattering
+//
+// Author:        Desorgher Laurent
+//
+// Creation date: 03.06.2009 cloned from G4hMultipleScattering by U.Laszlo with slight modification for adjoint_ion. 
+//
+//
+//------------------------------------------------------------------------------
+/////////////////////////////////////////////////////////////////////////////////
+//
+// CHANGE HISTORY
+// --------------
+//      ChangeHistory: 
+//	 	03.06.2009  Creation by L. Desorgher. Cloned from G4hMultipleScattering by U.Laszlo with slight modifications.	  		
+//		09.11.2009  Remove 	AlongStepGetPhysicalInteractionLength, to call the one of the base class.
+//-------------------------------------------------------------
+//	Documentation:
+//		The class simulates the multiple scattering for adjoint proton of charged particle. In this approximate implementation the reverse multiple scattering 
+//		is the same than the foward one. This should be changed in the future to have the MultipleScaterring computed for the energy  at the end of the step 
+//		and not before the step. 
+//
+
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#ifndef G4AdjointhMultipleScattering_h
+#define G4AdjointhMultipleScattering_h 1
+
+#include "G4VMultipleScattering.hh"
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+class G4VMscModel;
+
+class G4AdjointhMultipleScattering : public G4VMultipleScattering
+
+{
+public:    // with description
+
+  G4AdjointhMultipleScattering(const G4String& processName="msc");
+
+  virtual ~G4AdjointhMultipleScattering();
+
+  // returns true for charged particles, false otherwise
+  G4bool IsApplicable (const G4ParticleDefinition& p);
+
+  // PrG4int few lines of informations about the process: validity range,
+  void PrintInfo();
+
+  // geom. step length distribution should be sampled or not
+  void Setsamplez(G4bool value) { samplez = value;};
+
+  // to reduce the energy/step dependence
+  void Setdtrl(G4double value) { dtrl = value;};
+
+  // 'soften' step limitation above lambdalimit
+  void SetLambdalimit(G4double value) { lambdalimit = value;};
+
+ /* // The function overloads the corresponding function of the base
+  // class.It limits the step near to boundaries only
+  // and invokes the method GetMscContinuousStepLimit at every step.
+  G4double AlongStepGetPhysicalInteractionLength(
+                                            const G4Track&,
+					    G4double  previousStepSize,
+					    G4double  currentMinimalStep,
+					    G4double& currentSafety,
+					    G4GPILSelection* selection);
+	*/				    
+
+protected:
+
+  // This function initialise models
+  void InitialiseProcess(const G4ParticleDefinition*);
+
+private:        // data members
+
+  G4VMscModel* mscUrban;
+
+  G4double lambdalimit;
+  G4double dtrl;
+
+  G4bool   samplez;
+  G4bool   isInitialized;
+  G4bool   isIon;
+
+};
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#endif
Index: trunk/source/processes/electromagnetic/adjoint/include/G4IonInverseIonisation.hh
===================================================================
--- trunk/source/processes/electromagnetic/adjoint/include/G4IonInverseIonisation.hh	(revision 1197)
+++ trunk/source/processes/electromagnetic/adjoint/include/G4IonInverseIonisation.hh	(revision 1197)
@@ -0,0 +1,66 @@
+//
+// ********************************************************************
+// * 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.          *
+// ********************************************************************
+//
+// $Id: G4IonInverseIonisation.hh,v 1.2 2009/11/20 10:31:20 ldesorgh Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
+//
+/////////////////////////////////////////////////////////////////////////////////
+//      Module:		G4IonInverseIonisation
+//	Author:       	L. Desorgher
+// 	Organisation: 	SpaceIT GmbH
+//	Contract:	ESA contract 21435/08/NL/AT
+// 	Customer:     	ESA/ESTEC
+/////////////////////////////////////////////////////////////////////////////////
+//
+// CHANGE HISTORY
+// --------------
+//      ChangeHistory: 
+//	 	25 August 2009 creation by L. Desorgher  		
+//
+//-------------------------------------------------------------
+//	Documentation:
+//		Adjoint/reverse discrete ionisation for ions
+//
+
+#ifndef G4IonInverseIonisation_h
+#define G4IonInverseIonisation_h 1
+
+#include "G4VAdjointReverseReaction.hh"
+#include "globals.hh"
+#include "G4eIonisation.hh"
+#include "G4AdjointIonIonisationModel.hh"
+class G4IonInverseIonisation: public G4VAdjointReverseReaction
+
+{
+public:
+
+  G4IonInverseIonisation(G4bool whichScatCase, G4String process_name, G4AdjointIonIonisationModel* aEmAdjointModel);
+  ~G4IonInverseIonisation();
+  
+private:
+    
+};
+
+#endif
Index: trunk/source/processes/electromagnetic/adjoint/include/G4VAdjointReverseReaction.hh
===================================================================
--- trunk/source/processes/electromagnetic/adjoint/include/G4VAdjointReverseReaction.hh	(revision 1197)
+++ trunk/source/processes/electromagnetic/adjoint/include/G4VAdjointReverseReaction.hh	(revision 1197)
@@ -0,0 +1,127 @@
+//
+// ********************************************************************
+// * 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.          *
+// ********************************************************************
+//
+// $Id: G4VAdjointReverseReaction.hh,v 1.2 2009/11/20 10:31:20 ldesorgh Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
+//
+/////////////////////////////////////////////////////////////////////////////////
+//      Module:		G4VAdjointReverseReaction
+//	Author:       	L. Desorgher
+// 	Organisation: 	SpaceIT GmbH
+//	Contract:	ESA contract 21435/08/NL/AT
+// 	Customer:     	ESA/ESTEC
+/////////////////////////////////////////////////////////////////////////////////
+//
+// CHANGE HISTORY
+// --------------
+//      ChangeHistory: 
+//	 	1st April 2007 creation by L. Desorgher  		
+//
+//-------------------------------------------------------------
+//	Documentation:
+//		Abstract class for adjoint/reverse discrete scattering
+//
+
+#ifndef G4VAdjointReverseReaction_h
+#define G4VAdjointReverseReaction_h 1
+
+#include "globals.hh"
+#include "G4DynamicParticle.hh"
+#include "G4ParticleDefinition.hh"
+#include "G4MaterialCutsCouple.hh"
+#include "G4Material.hh"
+#include "G4Element.hh"
+#include "G4ElementVector.hh"
+#include "Randomize.hh"
+#include "G4ParticleDefinition.hh"
+#include "G4VDiscreteProcess.hh"
+
+
+
+class G4PhysicsTable;
+class G4Region;
+class G4VParticleChange;
+class G4ParticleChange;
+class G4Track;
+class G4VEmAdjointModel;
+class G4AdjointCSMatrix;
+class G4AdjointCSManager;
+class G4Material;
+class G4MaterialCutsCouple;
+
+
+class G4VAdjointReverseReaction : public G4VDiscreteProcess
+{
+
+public:
+
+  G4VAdjointReverseReaction(G4String process_name,G4bool whichScatCase);
+
+  virtual ~G4VAdjointReverseReaction();
+  
+public:
+  void PreparePhysicsTable(const G4ParticleDefinition&);
+  
+  void BuildPhysicsTable(const G4ParticleDefinition&);
+  
+  virtual G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&); 
+  inline void SetIntegralMode(G4bool aBool){IsIntegralModeUsed = aBool;}
+ 
+protected :// with description  
+	
+   virtual G4double GetMeanFreePath(const G4Track& track,
+                                         G4double previousStepSize,
+                                         G4ForceCondition* condition);
+
+protected:
+   G4VEmAdjointModel* theAdjointEMModel;	
+   G4ParticleChange* fParticleChange;
+   G4AdjointCSManager* theAdjointCSManager;
+   G4bool IsScatProjToProjCase;
+   
+  
+
+private:
+  G4Material*  currentMaterial;
+  G4MaterialCutsCouple* currentCouple;
+  size_t   currentMaterialIndex; 
+  G4double currentTcut;
+  G4double lastCS;
+  std::vector<G4double> CS_Vs_Element;
+  G4bool IsFwdCSUsed;
+  
+  //For integral mode
+  //------------------
+  G4bool IsIntegralModeUsed;
+  
+  
+  
+
+ 
+
+};  
+
+#endif
+
Index: trunk/source/processes/electromagnetic/adjoint/include/G4hInverseIonisation.hh
===================================================================
--- trunk/source/processes/electromagnetic/adjoint/include/G4hInverseIonisation.hh	(revision 1197)
+++ trunk/source/processes/electromagnetic/adjoint/include/G4hInverseIonisation.hh	(revision 1197)
@@ -0,0 +1,66 @@
+//
+// ********************************************************************
+// * 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.          *
+// ********************************************************************
+//
+// $Id: G4hInverseIonisation.hh,v 1.2 2009/11/20 10:31:20 ldesorgh Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
+//
+/////////////////////////////////////////////////////////////////////////////////
+//      Module:		G4hInverseIonisation.hh
+//	Author:       	L. Desorgher
+// 	Organisation: 	SpaceIT GmbH
+//	Contract:	ESA contract 21435/08/NL/AT
+// 	Customer:     	ESA/ESTEC
+/////////////////////////////////////////////////////////////////////////////////
+//
+// CHANGE HISTORY
+// --------------
+//      ChangeHistory: 
+//	 	15 February 2009 creation by L. Desorgher  		
+//
+//-------------------------------------------------------------
+//	Documentation:
+//		Adjoint/reverse discrete ionisation for proton
+//
+
+#ifndef G4hInverseIonisation_h
+#define G4hInverseIonisation_h 1
+
+#include "G4VAdjointReverseReaction.hh"
+#include "globals.hh"
+#include "G4eIonisation.hh"
+#include "G4AdjointhIonisationModel.hh"
+class G4hInverseIonisation: public G4VAdjointReverseReaction
+
+{
+public:
+
+  G4hInverseIonisation(G4bool whichScatCase, G4String process_name, G4AdjointhIonisationModel* aEmAdjointModel);
+  ~G4hInverseIonisation();
+  
+private:
+    
+};
+
+#endif
