Ignore:
Timestamp:
Apr 6, 2009, 12:30:29 PM (15 years ago)
Author:
garnier
Message:

update processes

Location:
trunk/source/processes/hadronic/models/photolepton_hadron/muon_nuclear
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/hadronic/models/photolepton_hadron/muon_nuclear/History

    r819 r962  
    1 $Id: History,v 1.3 2006/11/04 22:21:09 dennis Exp $
     1$Id: History,v 1.8 2009/02/06 08:58:20 vnivanch Exp $
    22-------------------------------------------------------------------
    33
     
    1616     ---------------------------------------------------------------
    1717
    18  4 Nov 2006 Dennis Wright for V. Ivantchenko (hadr-munuclear-V08-01-00)
     1806 Feb 2009 V.Ivantchenko (hadr-munuclear-V09-02-01)
     19----------------------------------------------------
     20
     2124 Jan 2009 V.Ivantchenko (hadr-munuclear-V09-02-00)
     22----------------------------------------------------
     23- G4MuNuclearInteraction added deregistration of the process
     24
     25 4 Oct 2008 Dennis Wright (hadr-munuclear-V09-01-01)
     26----------------------------------------------------
     27- G4MuNuclearInteraction - include process type enum and change type from
     28  12 to fHadronInelastic
     29
     30 2 Sep 2008 V.Ivanchenko (hadr-munuclear-V09-01-00)
     31---------------------------------------------------
     32- G4MuNuclearInteraction added SubType and registration in the
     33                         G4HadronicProcessStore; added PreparePhysicsTable
     34                         method and cleanup for readability
     35
     36 4 Nov 2006 Dennis Wright for V.Ivanchenko (hadr-munuclear-V08-01-00)
    1937-----------------------------------------------------------------------
    2038- G4MuNuclearInteraction::ComputeMicroscopicCrossSection: prevent NaN
  • trunk/source/processes/hadronic/models/photolepton_hadron/muon_nuclear/include/G4MuNuclearInteraction.hh

    r819 r962  
    2525//
    2626//
    27 // $Id: G4MuNuclearInteraction.hh,v 1.4 2006/06/29 20:57:20 gunter Exp $
    28 // GEANT4 tag $Name: $
     27// $Id: G4MuNuclearInteraction.hh,v 1.6 2008/10/02 21:04:35 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// $Id:
     
    5555#include "G4PhysicsLogVector.hh"
    5656#include "G4ParametrizedHadronicVertex.hh"
     57#include "G4HadronicProcessType.hh"
    5758 
    5859class G4MuNuclearInteraction : public G4VDiscreteProcess
    5960 
    6061{
    61   public:
     62public:
    6263 
    63      G4MuNuclearInteraction(const G4String& processName = "muNuclear");
     64  G4MuNuclearInteraction(const G4String& processName = "muNuclear");
    6465 
    65     ~G4MuNuclearInteraction();
     66  virtual ~G4MuNuclearInteraction();
    6667
    67     G4bool IsApplicable(const G4ParticleDefinition&);
     68  virtual G4bool IsApplicable(const G4ParticleDefinition&);
    6869
    69      void SetPhysicsTableBining(G4double lowE, G4double highE, G4int nBins);
     70  void SetPhysicsTableBining(G4double lowE, G4double highE, G4int nBins);
    7071
    71      void BuildPhysicsTable(const G4ParticleDefinition& ParticleType);
     72  virtual void PreparePhysicsTable(const G4ParticleDefinition& ParticleType);
    7273
    73      void PrintInfoDefinition() ;
     74  virtual void BuildPhysicsTable(const G4ParticleDefinition& ParticleType);
    7475
    75      G4double GetMeanFreePath(const G4Track& track,
    76                               G4double previousStepSize,
    77                               G4ForceCondition* condition ) ;
     76  virtual void PrintInfoDefinition() ;
     77
     78  virtual G4double GetMeanFreePath(const G4Track& track,
     79                                   G4double previousStepSize,
     80                                   G4ForceCondition* condition ) ;
    7881 
    79     G4VParticleChange *PostStepDoIt(const G4Track& track,
    80                                      const G4Step& Step  ) ;
     82  virtual G4VParticleChange *PostStepDoIt(const G4Track& track,
     83                                          const G4Step& Step  ) ;
    8184
    82   protected:
     85protected:
    8386
    84     G4double ComputeMeanFreePath( const G4ParticleDefinition* ParticleType,
    85                                            G4double KineticEnergy,
    86                                            const G4Material* aMaterial);
     87  virtual G4double ComputeMeanFreePath( const G4ParticleDefinition* ParticleType,
     88                                        G4double KineticEnergy,
     89                                        const G4Material* aMaterial);
    8790
    88      void ComputePartialSumSigma(  const G4ParticleDefinition* ParticleType,
    89                                            G4double KineticEnergy,
    90                                            const G4Material* aMaterial);
     91  void ComputePartialSumSigma(  const G4ParticleDefinition* ParticleType,
     92                                G4double KineticEnergy,
     93                                const G4Material* aMaterial);
    9194
    92      virtual G4double ComputeMicroscopicCrossSection(
    93                                       const G4ParticleDefinition* ParticleType,
    94                                             G4double KineticEnergy,
    95                                             G4double AtomicNumber,
    96                                             G4double AtomicMass);
     95  virtual G4double ComputeMicroscopicCrossSection(
     96                                const G4ParticleDefinition* ParticleType,
     97                                G4double KineticEnergy,
     98                                G4double AtomicNumber,
     99                                G4double AtomicMass);
    97100
    98      virtual G4double ComputeDMicroscopicCrossSection(
    99                                       const G4ParticleDefinition* ParticleType,
    100                                             G4double KineticEnergy,
    101                                             G4double AtomicNumber,
    102                                             G4double AtomicMass,
    103                                             G4double epsilon);
     101  virtual G4double ComputeDMicroscopicCrossSection(
     102                                const G4ParticleDefinition* ParticleType,
     103                                G4double KineticEnergy,
     104                                G4double AtomicNumber,
     105                                G4double AtomicMass,
     106                                G4double epsilon);
    104107
    105   private:
     108private:
    106109
    107      G4MuNuclearInteraction & operator=(const G4MuNuclearInteraction &right);
    108      G4MuNuclearInteraction(const G4MuNuclearInteraction&);
     110  G4MuNuclearInteraction & operator=(const G4MuNuclearInteraction &right);
     111  G4MuNuclearInteraction(const G4MuNuclearInteraction&);
    109112
    110      G4Element* SelectRandomAtom(G4Material* aMaterial) const;
     113  G4Element* SelectRandomAtom(G4Material* aMaterial) const;
    111114
    112      void MakeSamplingTables( const G4ParticleDefinition* ParticleType );
     115  void MakeSamplingTables( const G4ParticleDefinition* ParticleType );
    113116
    114   private:
     117private:
    115118
    116      G4PhysicsTable* theMeanFreePathTable;
    117      G4PhysicsTable* theCrossSectionTable ;       
     119  G4PhysicsTable* theMeanFreePathTable;
     120  G4PhysicsTable* theCrossSectionTable ;       
    118121
    119      G4OrderedTable PartialSumSigma;     
     122  G4OrderedTable PartialSumSigma;     
    120123
    121      G4double LowestKineticEnergy; 
    122      G4double HighestKineticEnergy;   
    123      G4int TotBin;     
     124  G4double LowestKineticEnergy; 
     125  G4double HighestKineticEnergy;   
     126  G4int TotBin;     
    124127
    125      //cut from R.P. Kokoulin
    126      const G4double CutFixed ;
    127      // for the atomic weight conversion
    128      G4double GramPerMole ;
     128  //cut from R.P. Kokoulin
     129  const G4double CutFixed ;
     130  // for the atomic weight conversion
     131  G4double GramPerMole ;
    129132
    130      const G4MuonMinus* theMuonMinus;
    131      const G4MuonPlus* theMuonPlus;
    132      const G4PionZero* thePionZero;
     133  const G4MuonMinus* theMuonMinus;
     134  const G4MuonPlus* theMuonPlus;
     135  const G4PionZero* thePionZero;
    133136
    134      // tables for sampling ..............
    135      static G4int nzdat,ntdat,NBIN ;
    136      static G4double zdat[5],adat[5],tdat[8] ;
    137      static G4double ya[1001],proba[5][8][1001] ;
     137  // tables for sampling ..............
     138  static G4int nzdat,ntdat,NBIN ;
     139  static G4double zdat[5],adat[5],tdat[8] ;
     140  static G4double ya[1001],proba[5][8][1001] ;
    138141     
    139      // for the hadronic final state; use base cass * in next release
    140      G4ParametrizedHadronicVertex theHadronicVertex;
     142  G4ParametrizedHadronicVertex theHadronicVertex;
    141143};
    142144
  • trunk/source/processes/hadronic/models/photolepton_hadron/muon_nuclear/include/G4MuNuclearInteraction.icc

    r819 r962  
    2626//
    2727// $Id: G4MuNuclearInteraction.icc,v 1.3 2006/06/29 20:57:22 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// $Id:
  • trunk/source/processes/hadronic/models/photolepton_hadron/muon_nuclear/src/G4MuNuclearInteraction.cc

    r819 r962  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4MuNuclearInteraction.cc,v 1.7 2006/11/04 02:15:05 vnivanch Exp $
    28 // GEANT4 tag $Name:  $
     26// $Id: G4MuNuclearInteraction.cc,v 1.12 2009/01/24 11:59:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2928//
    3029// $Id:
     
    3837//      added simple model for hadronic vertex, J.P. Wellisch, November 1998
    3938// --------------------------------------------------------------
    40 // 26/10/98: new corr.s from R.Kokoulin + cleanup , L.Urban
     39// 26/10/1998: new corr.s from R.Kokoulin + cleanup , L.Urban
     40// 23/01/2009  V.Ivanchenko Add deregistration
    4141//
     42
    4243#include "G4MuNuclearInteraction.hh"
    4344#include "G4UnitsTable.hh"
     45#include "G4HadronicProcessStore.hh"
    4446
    4547// static members ........
     
    6668    theMuonPlus ( G4MuonPlus::MuonPlus() ),
    6769    thePionZero (G4PionZero::PionZero() )
    68 {  }
     70
     71  SetProcessSubType(fHadronInelastic);
     72  G4HadronicProcessStore::Instance()->RegisterExtraProcess(this);
     73}
    6974 
    7075G4MuNuclearInteraction::~G4MuNuclearInteraction()
    7176{
    72    if (theMeanFreePathTable) {
    73       theMeanFreePathTable->clearAndDestroy();
    74       delete theMeanFreePathTable;
    75    }
    76    if (theCrossSectionTable) {
    77       theCrossSectionTable->clearAndDestroy();
    78       delete theCrossSectionTable;
    79    }
    80 
    81    if (&PartialSumSigma) {
    82       PartialSumSigma.clearAndDestroy();
    83    }
     77  G4HadronicProcessStore::Instance()->DeRegisterExtraProcess(this);
     78
     79  if (theMeanFreePathTable) {
     80    theMeanFreePathTable->clearAndDestroy();
     81    delete theMeanFreePathTable;
     82  }
     83  if (theCrossSectionTable) {
     84    theCrossSectionTable->clearAndDestroy();
     85    delete theCrossSectionTable;
     86  }
     87
     88  if (&PartialSumSigma) {
     89    PartialSumSigma.clearAndDestroy();
     90  }
    8491}
    8592 
    8693void G4MuNuclearInteraction::SetPhysicsTableBining(G4double lowE,
    87                                                   G4double highE, G4int nBins)
     94                                                   G4double highE, G4int nBins)
    8895{
    8996  LowestKineticEnergy = lowE; HighestKineticEnergy = highE ; TotBin = nBins ;
     97}
     98
     99void G4MuNuclearInteraction::PreparePhysicsTable(
     100                                    const G4ParticleDefinition& aParticleType)
     101{
     102  G4HadronicProcessStore::Instance()
     103    ->RegisterParticleForExtraProcess(this, &aParticleType);
    90104}
    91105
     
    93107                                    const G4ParticleDefinition& aParticleType)
    94108{
     109  G4HadronicProcessStore::Instance()->PrintInfo(&aParticleType);
     110
    95111  G4double LowEdgeEnergy , Value;
    96112  G4PhysicsLogVector* ptrVector;
    97113   
    98114  if (theCrossSectionTable) {
    99       theCrossSectionTable->clearAndDestroy() ;
    100       delete theCrossSectionTable ;
     115    theCrossSectionTable->clearAndDestroy() ;
     116    delete theCrossSectionTable ;
    101117  }
    102118
     
    111127  {
    112128    ptrVector = new G4PhysicsLogVector(LowestKineticEnergy,
    113                                          HighestKineticEnergy,TotBin) ;
     129                                       HighestKineticEnergy,TotBin) ;
    114130    AtomicNumber = (*theElementTable )[J]->GetZ() ;
    115131    AtomicWeight = (*theElementTable )[J]->GetA() ;
     
    119135      LowEdgeEnergy = ptrVector->GetLowEdgeEnergy(i) ;
    120136      Value = ComputeMicroscopicCrossSection(&aParticleType,
    121                                                  LowEdgeEnergy,
    122                                                  AtomicNumber,AtomicWeight) ;
     137                                             LowEdgeEnergy,
     138                                             AtomicNumber,AtomicWeight) ;
    123139      ptrVector->PutValue(i,Value) ;
    124140    }
     
    130146  const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable() ;
    131147  if (theMeanFreePathTable) {
    132      theMeanFreePathTable->clearAndDestroy();
    133      delete theMeanFreePathTable;
     148    theMeanFreePathTable->clearAndDestroy();
     149    delete theMeanFreePathTable;
    134150  }
    135151  theMeanFreePathTable = new G4PhysicsTable(G4Material::GetNumberOfMaterials());
     
    142158  {
    143159    ptrVector = new G4PhysicsLogVector(LowestKineticEnergy,
    144                                          HighestKineticEnergy,
    145                                          TotBin ) ;
     160                                       HighestKineticEnergy,
     161                                       TotBin ) ;
    146162
    147163    const G4Material* material= (*theMaterialTable)[K];
     
    167183void G4MuNuclearInteraction::ComputePartialSumSigma(
    168184                                   const G4ParticleDefinition* ParticleType,
    169                                                G4double KineticEnergy,
    170                                                const G4Material* aMaterial)
     185                                   G4double KineticEnergy,
     186                                   const G4Material* aMaterial)
    171187
    172188// Build the table of cross section per element. The table is built for MATERIALS.
     
    183199
    184200   for ( G4int Ielem=0 ; Ielem < NbOfElements ; Ielem++ )
    185       {             
    186         SIGMA += theAtomNumDensityVector[Ielem] *
    187               ComputeMicroscopicCrossSection( ParticleType, KineticEnergy,
    188                                         (*theElementVector)[Ielem]->GetZ(),
    189                                         (*theElementVector)[Ielem]->GetA()) ;
    190         PartialSumSigma[Imate]->push_back(SIGMA);
    191       }
     201     {             
     202       SIGMA += theAtomNumDensityVector[Ielem] *
     203        ComputeMicroscopicCrossSection( ParticleType, KineticEnergy,
     204                                        (*theElementVector)[Ielem]->GetZ(),
     205                                        (*theElementVector)[Ielem]->GetA()) ;
     206       PartialSumSigma[Imate]->push_back(SIGMA);
     207     }
    192208}
    193209
     
    529545  // select randomly 1 element within the material
    530546
    531   const G4int Index = aMaterial->GetIndex();
    532   const G4int NumberOfElements = aMaterial->GetNumberOfElements();
     547  G4int Index = aMaterial->GetIndex();
     548  G4int NumberOfElements = aMaterial->GetNumberOfElements();
    533549  const G4ElementVector* theElementVector = aMaterial->GetElementVector();
     550  if(1 == NumberOfElements) return ((*theElementVector)[0]);
    534551
    535552  G4double rval = G4UniformRand()*((*PartialSumSigma[Index])[NumberOfElements-1]);
    536   for ( G4int i=0; i < NumberOfElements; i++ )
     553  for ( G4int i=0; i < NumberOfElements; i++ ) {
    537554    if (rval <= (*PartialSumSigma[Index])[i]) return ((*theElementVector)[i]);
    538   G4cout << " WARNING !!! - The Material '"<< aMaterial->GetName()
    539        << "' has no elements, NULL pointer returned." << G4endl;
    540   return 0;
    541 }
     555  }
     556  G4cout << "G4MuNuclearInteraction WARNING !!! no element selected for '"
     557         << aMaterial->GetName()
     558         << " 1st element returned." << G4endl;
     559  return ((*theElementVector)[0]);
     560}
     561
    542562void G4MuNuclearInteraction::PrintInfoDefinition()
    543563{
  • trunk/source/processes/hadronic/models/photolepton_hadron/muon_nuclear/src/G4MuonNucleusInteractionModel.cc

    r819 r962  
    2626//
    2727// $Id: G4MuonNucleusInteractionModel.cc,v 1.6 2006/06/29 20:57:36 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// --------------------------------------------------------------
  • trunk/source/processes/hadronic/models/photolepton_hadron/muon_nuclear/src/G4ParametrizedHadronicVertex.cc

    r819 r962  
    2626//
    2727// $Id: G4ParametrizedHadronicVertex.cc,v 1.6 2006/06/29 20:57:40 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// --------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.