Import Geant4 8.1.0 source tree
This commit is contained in:
@@ -1,28 +1,31 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * 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. *
|
||||
// * 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 intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// * 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: G4Cerenkov.cc,v 1.20 2005/08/17 17:30:39 gum Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
// $Id: G4Cerenkov.cc,v 1.21 2006/06/29 19:56:03 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Cerenkov Radiation Class Implementation
|
||||
|
||||
@@ -1,28 +1,31 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * 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. *
|
||||
// * 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 intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// * 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: G4ForwardXrayTR.cc,v 1.12 2004/12/02 08:31:07 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
// $Id: G4ForwardXrayTR.cc,v 1.13 2006/06/29 19:56:05 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
//
|
||||
// G4ForwardXrayTR class -- implementation file
|
||||
|
||||
|
||||
@@ -1,28 +1,31 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * 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. *
|
||||
// * 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 intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// * 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: G4GammaXTRadiator.cc,v 1.3 2004/12/02 08:31:07 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
// $Id: G4GammaXTRadiator.cc,v 1.5 2006/06/29 19:56:07 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
//
|
||||
|
||||
#include <complex>
|
||||
@@ -55,7 +58,7 @@ G4GammaXTRadiator::G4GammaXTRadiator(G4LogicalVolume* anEnvelope,
|
||||
fAlphaGas = alphaGas ;
|
||||
G4cout<<"fAlphaPlate = "<<fAlphaPlate<<" ; fAlphaGas = "<<fAlphaGas<<G4endl ;
|
||||
|
||||
BuildTable() ;
|
||||
// BuildTable() ;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -1,28 +1,31 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * 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. *
|
||||
// * 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 intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// * 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: G4RegularXTRadiator.cc,v 1.7 2005/08/06 13:59:35 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
// $Id: G4RegularXTRadiator.cc,v 1.9 2006/06/29 19:56:09 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
//
|
||||
|
||||
#include <complex>
|
||||
@@ -53,7 +56,7 @@ G4RegularXTRadiator::G4RegularXTRadiator(G4LogicalVolume *anEnvelope,
|
||||
fAlphaGas = 1000;
|
||||
G4cout<<"fAlphaPlate = "<<fAlphaPlate<<" ; fAlphaGas = "<<fAlphaGas<<G4endl ;
|
||||
|
||||
BuildTable() ;
|
||||
// BuildTable() ;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -1,28 +1,31 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * 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. *
|
||||
// * 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 intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// * 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: G4Scintillation.cc,v 1.25 2005/08/17 17:30:25 gum Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
// $Id: G4Scintillation.cc,v 1.26 2006/06/29 19:56:11 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Scintillation Light Class Implementation
|
||||
|
||||
@@ -1,28 +1,31 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * 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. *
|
||||
// * 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 intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// * 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: G4StrawTubeXTRadiator.cc,v 1.2 2005/08/06 13:59:35 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
// $Id: G4StrawTubeXTRadiator.cc,v 1.4 2006/06/29 19:56:13 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
//
|
||||
|
||||
#include <complex>
|
||||
@@ -84,7 +87,7 @@ G4StrawTubeXTRadiator::G4StrawTubeXTRadiator(G4LogicalVolume *anEnvelope,
|
||||
// Build energy and angular integral spectra of X-ray TR photons from
|
||||
// a radiator
|
||||
|
||||
BuildTable();
|
||||
// BuildTable();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -0,0 +1,412 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4SynchrotronRadiation.cc,v 1.5 2006/06/29 19:56:15 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
// CERN Geneva Switzerland
|
||||
//
|
||||
// History: first implementation,
|
||||
// 21-5-98 V.Grichine
|
||||
// 28-05-01, V.Ivanchenko minor changes to provide ANSI -wall compilation
|
||||
// 04.03.05, V.Grichine: get local field interface
|
||||
// 18-05-06 H. Burkhardt: Energy spectrum from function rather than table
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "G4SynchrotronRadiation.hh"
|
||||
// #include "G4Integrator.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
using namespace std;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Constructor
|
||||
//
|
||||
|
||||
G4SynchrotronRadiation::G4SynchrotronRadiation(const G4String& processName,
|
||||
G4ProcessType type):G4VDiscreteProcess (processName, type),
|
||||
theGamma (G4Gamma::Gamma() ),
|
||||
theElectron ( G4Electron::Electron() ),
|
||||
thePositron ( G4Positron::Positron() )
|
||||
{
|
||||
G4TransportationManager* transportMgr =
|
||||
G4TransportationManager::GetTransportationManager();
|
||||
|
||||
fFieldPropagator = transportMgr->GetPropagatorInField();
|
||||
|
||||
fLambdaConst = sqrt(3.0)*electron_mass_c2/
|
||||
(2.5*fine_structure_const*eplus*c_light) ;
|
||||
fEnergyConst = 1.5*c_light*c_light*eplus*hbar_Planck/electron_mass_c2 ;
|
||||
verboseLevel=1;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Destructor
|
||||
//
|
||||
|
||||
G4SynchrotronRadiation::~G4SynchrotronRadiation()
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
/////////////////////////////// METHODS /////////////////////////////////
|
||||
//
|
||||
//
|
||||
// Production of synchrotron X-ray photon
|
||||
// GEANT4 internal units.
|
||||
//
|
||||
|
||||
|
||||
G4double
|
||||
G4SynchrotronRadiation::GetMeanFreePath( const G4Track& trackData,
|
||||
G4double,
|
||||
G4ForceCondition* condition)
|
||||
{
|
||||
// gives the MeanFreePath in GEANT4 internal units
|
||||
G4double MeanFreePath;
|
||||
|
||||
const G4DynamicParticle* aDynamicParticle = trackData.GetDynamicParticle();
|
||||
|
||||
*condition = NotForced ;
|
||||
|
||||
G4double gamma = aDynamicParticle->GetTotalEnergy()/
|
||||
aDynamicParticle->GetMass();
|
||||
|
||||
G4double particleCharge = aDynamicParticle->GetDefinition()->GetPDGCharge();
|
||||
|
||||
if ( gamma < 1.0e3 ) MeanFreePath = DBL_MAX;
|
||||
else
|
||||
{
|
||||
|
||||
G4ThreeVector FieldValue;
|
||||
const G4Field* pField = 0;
|
||||
|
||||
G4FieldManager* fieldMgr=0;
|
||||
G4bool fieldExertsForce = false;
|
||||
|
||||
if( (particleCharge != 0.0) )
|
||||
{
|
||||
fieldMgr = fFieldPropagator->FindAndSetFieldManager( trackData.GetVolume() );
|
||||
|
||||
if ( fieldMgr != 0 )
|
||||
{
|
||||
// If the field manager has no field, there is no field !
|
||||
|
||||
fieldExertsForce = ( fieldMgr->GetDetectorField() != 0 );
|
||||
}
|
||||
}
|
||||
if ( fieldExertsForce )
|
||||
{
|
||||
pField = fieldMgr->GetDetectorField() ;
|
||||
G4ThreeVector globPosition = trackData.GetPosition();
|
||||
|
||||
G4double globPosVec[3], FieldValueVec[3];
|
||||
|
||||
globPosVec[0] = globPosition.x();
|
||||
globPosVec[1] = globPosition.y();
|
||||
globPosVec[2] = globPosition.z();
|
||||
|
||||
pField->GetFieldValue( globPosVec, FieldValueVec );
|
||||
|
||||
FieldValue = G4ThreeVector( FieldValueVec[0],
|
||||
FieldValueVec[1],
|
||||
FieldValueVec[2] );
|
||||
|
||||
|
||||
|
||||
G4ThreeVector unitMomentum = aDynamicParticle->GetMomentumDirection();
|
||||
G4ThreeVector unitMcrossB = FieldValue.cross(unitMomentum) ;
|
||||
G4double perpB = unitMcrossB.mag() ;
|
||||
|
||||
if( perpB > 0.0 ) MeanFreePath = fLambdaConst/perpB;
|
||||
else MeanFreePath = DBL_MAX;
|
||||
|
||||
static G4bool FirstTime=true;
|
||||
if(verboseLevel > 0 && FirstTime)
|
||||
{
|
||||
G4cout << "G4SynchrotronRadiation::GetMeanFreePath :" << '\n' << std::setprecision(4)
|
||||
<< " MeanFreePath = " << G4BestUnit(MeanFreePath, "Length")
|
||||
<< G4endl;
|
||||
if(verboseLevel > 1)
|
||||
{
|
||||
G4ThreeVector pvec=aDynamicParticle->GetMomentum();
|
||||
G4double Btot=FieldValue.getR();
|
||||
G4double ptot=pvec.getR();
|
||||
G4double rho= ptot / (MeV * c_light * Btot ); // full bending radius
|
||||
G4double Theta=unitMomentum.theta(FieldValue); // angle between particle and field
|
||||
G4cout
|
||||
<< " B = " << Btot/tesla << " Tesla"
|
||||
<< " perpB = " << perpB/tesla << " Tesla"
|
||||
<< " Theta = " << Theta << " sin(Theta)=" << sin(Theta) << '\n'
|
||||
<< " ptot = " << G4BestUnit(ptot,"Energy")
|
||||
<< " rho = " << G4BestUnit(rho,"Length")
|
||||
<< G4endl;
|
||||
}
|
||||
FirstTime=false;
|
||||
}
|
||||
}
|
||||
else MeanFreePath = DBL_MAX;
|
||||
|
||||
|
||||
}
|
||||
|
||||
return MeanFreePath;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
G4VParticleChange*
|
||||
G4SynchrotronRadiation::PostStepDoIt(const G4Track& trackData,
|
||||
const G4Step& stepData )
|
||||
|
||||
{
|
||||
aParticleChange.Initialize(trackData);
|
||||
|
||||
const G4DynamicParticle* aDynamicParticle=trackData.GetDynamicParticle();
|
||||
|
||||
G4double gamma = aDynamicParticle->GetTotalEnergy()/
|
||||
(aDynamicParticle->GetMass() );
|
||||
|
||||
if(gamma <= 1.0e3 )
|
||||
{
|
||||
return G4VDiscreteProcess::PostStepDoIt(trackData,stepData);
|
||||
}
|
||||
G4double particleCharge = aDynamicParticle->GetDefinition()->GetPDGCharge();
|
||||
|
||||
G4ThreeVector FieldValue;
|
||||
const G4Field* pField = 0 ;
|
||||
|
||||
G4FieldManager* fieldMgr=0;
|
||||
G4bool fieldExertsForce = false;
|
||||
|
||||
if( (particleCharge != 0.0) )
|
||||
{
|
||||
fieldMgr = fFieldPropagator->FindAndSetFieldManager( trackData.GetVolume() );
|
||||
if ( fieldMgr != 0 )
|
||||
{
|
||||
// If the field manager has no field, there is no field !
|
||||
|
||||
fieldExertsForce = ( fieldMgr->GetDetectorField() != 0 );
|
||||
}
|
||||
}
|
||||
if ( fieldExertsForce )
|
||||
{
|
||||
pField = fieldMgr->GetDetectorField() ;
|
||||
G4ThreeVector globPosition = trackData.GetPosition() ;
|
||||
G4double globPosVec[3], FieldValueVec[3] ;
|
||||
globPosVec[0] = globPosition.x() ;
|
||||
globPosVec[1] = globPosition.y() ;
|
||||
globPosVec[2] = globPosition.z() ;
|
||||
|
||||
pField->GetFieldValue( globPosVec, FieldValueVec ) ;
|
||||
FieldValue = G4ThreeVector( FieldValueVec[0],
|
||||
FieldValueVec[1],
|
||||
FieldValueVec[2] );
|
||||
|
||||
G4ThreeVector unitMomentum = aDynamicParticle->GetMomentumDirection();
|
||||
G4ThreeVector unitMcrossB = FieldValue.cross(unitMomentum);
|
||||
G4double perpB = unitMcrossB.mag() ;
|
||||
if(perpB > 0.0)
|
||||
{
|
||||
// M-C of synchrotron photon energy
|
||||
|
||||
G4double energyOfSR = GetRandomEnergySR(gamma,perpB);
|
||||
|
||||
// check against insufficient energy
|
||||
|
||||
if( energyOfSR <= 0.0 )
|
||||
{
|
||||
return G4VDiscreteProcess::PostStepDoIt(trackData,stepData);
|
||||
}
|
||||
G4double kineticEnergy = aDynamicParticle->GetKineticEnergy();
|
||||
G4ParticleMomentum
|
||||
particleDirection = aDynamicParticle->GetMomentumDirection();
|
||||
|
||||
// M-C of its direction
|
||||
|
||||
G4double Teta = G4UniformRand()/gamma ; // Very roughly
|
||||
|
||||
G4double Phi = twopi * G4UniformRand() ;
|
||||
|
||||
G4double dirx = sin(Teta)*cos(Phi) ,
|
||||
diry = sin(Teta)*sin(Phi) ,
|
||||
dirz = cos(Teta) ;
|
||||
|
||||
G4ThreeVector gammaDirection ( dirx, diry, dirz);
|
||||
gammaDirection.rotateUz(particleDirection);
|
||||
|
||||
// polarization of new gamma
|
||||
|
||||
// G4double sx = cos(Teta)*cos(Phi);
|
||||
// G4double sy = cos(Teta)*sin(Phi);
|
||||
// G4double sz = -sin(Teta);
|
||||
|
||||
G4ThreeVector gammaPolarization = FieldValue.cross(gammaDirection);
|
||||
gammaPolarization = gammaPolarization.unit();
|
||||
|
||||
// (sx, sy, sz);
|
||||
// gammaPolarization.rotateUz(particleDirection);
|
||||
|
||||
// create G4DynamicParticle object for the SR photon
|
||||
|
||||
G4DynamicParticle* aGamma= new G4DynamicParticle ( theGamma,
|
||||
gammaDirection,
|
||||
energyOfSR );
|
||||
aGamma->SetPolarization( gammaPolarization.x(),
|
||||
gammaPolarization.y(),
|
||||
gammaPolarization.z() );
|
||||
|
||||
|
||||
aParticleChange.SetNumberOfSecondaries(1);
|
||||
aParticleChange.AddSecondary(aGamma);
|
||||
|
||||
// Update the incident particle
|
||||
|
||||
G4double newKinEnergy = kineticEnergy - energyOfSR ;
|
||||
aParticleChange.ProposeLocalEnergyDeposit (0.);
|
||||
|
||||
if (newKinEnergy > 0.)
|
||||
{
|
||||
aParticleChange.ProposeMomentumDirection( particleDirection );
|
||||
aParticleChange.ProposeEnergy( newKinEnergy );
|
||||
}
|
||||
else
|
||||
{
|
||||
aParticleChange.ProposeEnergy( 0. );
|
||||
}
|
||||
}
|
||||
}
|
||||
return G4VDiscreteProcess::PostStepDoIt(trackData,stepData);
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
G4double G4SynchrotronRadiation::InvSynFracInt(G4double x)
|
||||
// direct generation
|
||||
{
|
||||
// from 0 to 0.7
|
||||
const G4double aa1=0 ,aa2=0.7;
|
||||
const G4int ncheb1=27;
|
||||
static const G4double cheb1[] =
|
||||
{ 1.22371665676046468821,0.108956475422163837267,0.0383328524358594396134,0.00759138369340257753721,
|
||||
0.00205712048644963340914,0.000497810783280019308661,0.000130743691810302187818,0.0000338168760220395409734,
|
||||
8.97049680900520817728e-6,2.38685472794452241466e-6,6.41923109149104165049e-7,1.73549898982749277843e-7,
|
||||
4.72145949240790029153e-8,1.29039866111999149636e-8,3.5422080787089834182e-9,9.7594757336403784905e-10,
|
||||
2.6979510184976065731e-10,7.480422622550977077e-11,2.079598176402699913e-11,5.79533622220841193e-12,
|
||||
1.61856011449276096e-12,4.529450993473807e-13,1.2698603951096606e-13,3.566117394511206e-14,1.00301587494091e-14,
|
||||
2.82515346447219e-15,7.9680747949792e-16};
|
||||
// from 0.7 to 0.9132260271183847
|
||||
const G4double aa3=0.9132260271183847;
|
||||
const G4int ncheb2=27;
|
||||
static const G4double cheb2[] =
|
||||
{ 1.1139496701107756,0.3523967429328067,0.0713849171926623,0.01475818043595387,0.003381255637322462,
|
||||
0.0008228057599452224,0.00020785506681254216,0.00005390169253706556,0.000014250571923902464,3.823880733161044e-6,
|
||||
1.0381966089136036e-6,2.8457557457837253e-7,7.86223332179956e-8,2.1866609342508474e-8,6.116186259857143e-9,
|
||||
1.7191233618437565e-9,4.852755117740807e-10,1.3749966961763457e-10,3.908961987062447e-11,1.1146253766895824e-11,
|
||||
3.1868887323415814e-12,9.134319791300977e-13,2.6211077371181566e-13,7.588643377757906e-14,2.1528376972619e-14,
|
||||
6.030906040404772e-15,1.9549163926819867e-15};
|
||||
// Chebyshev with exp/log scale
|
||||
// a = -Log[1 - SynFracInt[1]]; b = -Log[1 - SynFracInt[7]];
|
||||
const G4double aa4=2.4444485538746025480,aa5=9.3830728608909477079;
|
||||
const G4int ncheb3=28;
|
||||
static const G4double cheb3[] =
|
||||
{ 1.2292683840435586977,0.160353449247864455879,-0.0353559911947559448721,0.00776901561223573936985,
|
||||
-0.00165886451971685133259,0.000335719118906954279467,-0.0000617184951079161143187,9.23534039743246708256e-6,
|
||||
-6.06747198795168022842e-7,-3.07934045961999778094e-7,1.98818772614682367781e-7,-8.13909971567720135413e-8,
|
||||
2.84298174969641838618e-8,-9.12829766621316063548e-9,2.77713868004820551077e-9,-8.13032767247834023165e-10,
|
||||
2.31128525568385247392e-10,-6.41796873254200220876e-11,1.74815310473323361543e-11,-4.68653536933392363045e-12,
|
||||
1.24016595805520752748e-12,-3.24839432979935522159e-13,8.44601465226513952994e-14,-2.18647276044246803998e-14,
|
||||
5.65407548745690689978e-15,-1.46553625917463067508e-15,3.82059606377570462276e-16,-1.00457896653436912508e-16};
|
||||
const G4double aa6=33.122936966163038145;
|
||||
const G4int ncheb4=27;
|
||||
static const G4double cheb4[] =
|
||||
{1.69342658227676741765,0.0742766400841232319225,-0.019337880608635717358,0.00516065527473364110491,
|
||||
-0.00139342012990307729473,0.000378549864052022522193,-0.000103167085583785340215,0.0000281543441271412178337,
|
||||
-7.68409742018258198651e-6,2.09543221890204537392e-6,-5.70493140367526282946e-7,1.54961164548564906446e-7,
|
||||
-4.19665599629607704794e-8,1.13239680054166507038e-8,-3.04223563379021441863e-9,8.13073745977562957997e-10,
|
||||
-2.15969415476814981374e-10,5.69472105972525594811e-11,-1.48844799572430829499e-11,3.84901514438304484973e-12,
|
||||
-9.82222575944247161834e-13,2.46468329208292208183e-13,-6.04953826265982691612e-14,1.44055805710671611984e-14,
|
||||
-3.28200813577388740722e-15,6.96566359173765367675e-16,-1.294122794852896275e-16};
|
||||
|
||||
if(x<aa2) return x*x*x*Chebyshev(aa1,aa2,cheb1,ncheb1,x);
|
||||
else if(x<aa3) return Chebyshev(aa2,aa3,cheb2,ncheb2,x);
|
||||
else if(x<1-0.0000841363)
|
||||
{ G4double y=-log(1-x);
|
||||
return y*Chebyshev(aa4,aa5,cheb3,ncheb3,y);
|
||||
}
|
||||
else
|
||||
{ G4double y=-log(1-x);
|
||||
return y*Chebyshev(aa5,aa6,cheb4,ncheb4,y);
|
||||
}
|
||||
}
|
||||
|
||||
G4double G4SynchrotronRadiation::GetRandomEnergySR(G4double gamma, G4double perpB)
|
||||
{
|
||||
|
||||
G4double Ecr=fEnergyConst*gamma*gamma*perpB;
|
||||
|
||||
static G4bool FirstTime=true;
|
||||
if(verboseLevel > 0 && FirstTime)
|
||||
{ G4double Emean=8./(15.*sqrt(3.))*Ecr; // mean photon energy
|
||||
G4double E_rms=sqrt(211./675.)*Ecr; // rms of photon energy distribution
|
||||
G4cout << "G4SynchrotronRadiation::GetRandomEnergySR :" << '\n' << std::setprecision(4)
|
||||
<< " Ecr = " << G4BestUnit(Ecr,"Energy") << '\n'
|
||||
<< " Emean = " << G4BestUnit(Emean,"Energy") << '\n'
|
||||
<< " E_rms = " << G4BestUnit(E_rms,"Energy") << G4endl;
|
||||
FirstTime=false;
|
||||
}
|
||||
|
||||
G4double energySR=Ecr*InvSynFracInt(G4UniformRand());
|
||||
return energySR;
|
||||
}
|
||||
|
||||
|
||||
void G4SynchrotronRadiation::BuildPhysicsTable(const G4ParticleDefinition& part)
|
||||
{
|
||||
if(0 < verboseLevel && &part==theElectron ) PrintInfoDefinition();
|
||||
}
|
||||
|
||||
void G4SynchrotronRadiation::PrintInfoDefinition() // not yet called, usually called from BuildPhysicsTable
|
||||
{
|
||||
G4String comments ="Incoherent Synchrotron Radiation\n";
|
||||
G4cout << G4endl << GetProcessName() << ": " << comments
|
||||
<< " good description for long magnets at all energies" << G4endl;
|
||||
}
|
||||
|
||||
///////////////////// end of G4SynchrotronRadiation.cc
|
||||
@@ -0,0 +1,647 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4SynchrotronRadiationInMat.cc,v 1.2 2006/06/29 19:56:17 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
// CERN Geneva Switzerland
|
||||
//
|
||||
// History: first implementation,
|
||||
// 21-5-98 V.Grichine
|
||||
// 28-05-01, V.Ivanchenko minor changes to provide ANSI -wall compilation
|
||||
// 04.03.05, V.Grichine: get local field interface
|
||||
// 19-05-06, V.Ivanchenko rename from G4SynchrotronRadiation
|
||||
//
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "G4SynchrotronRadiationInMat.hh"
|
||||
#include "G4Integrator.hh"
|
||||
|
||||
using namespace std;
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Constant for calculation of mean free path
|
||||
//
|
||||
|
||||
const G4double
|
||||
G4SynchrotronRadiationInMat::fLambdaConst = sqrt(3.0)*electron_mass_c2/
|
||||
(2.5*fine_structure_const*eplus*c_light) ;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Constant for calculation of characterictic energy
|
||||
//
|
||||
|
||||
const G4double
|
||||
G4SynchrotronRadiationInMat::fEnergyConst = 1.5*c_light*c_light*eplus*hbar_Planck/
|
||||
electron_mass_c2 ;
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Array of integral probability of synchrotron photons:
|
||||
//
|
||||
// the corresponding energy = 0.0001*i*i*(characteristic energy)
|
||||
//
|
||||
|
||||
const G4double
|
||||
G4SynchrotronRadiationInMat::fIntegralProbabilityOfSR[200] =
|
||||
{
|
||||
1.000000e+00, 9.428859e-01, 9.094095e-01, 8.813971e-01, 8.565154e-01,
|
||||
8.337008e-01, 8.124961e-01, 7.925217e-01, 7.735517e-01, 7.554561e-01,
|
||||
7.381233e-01, 7.214521e-01, 7.053634e-01, 6.898006e-01, 6.747219e-01,
|
||||
6.600922e-01, 6.458793e-01, 6.320533e-01, 6.185872e-01, 6.054579e-01,
|
||||
5.926459e-01, 5.801347e-01, 5.679103e-01, 5.559604e-01, 5.442736e-01,
|
||||
5.328395e-01, 5.216482e-01, 5.106904e-01, 4.999575e-01, 4.894415e-01,
|
||||
4.791351e-01, 4.690316e-01, 4.591249e-01, 4.494094e-01, 4.398800e-01,
|
||||
4.305320e-01, 4.213608e-01, 4.123623e-01, 4.035325e-01, 3.948676e-01,
|
||||
3.863639e-01, 3.780179e-01, 3.698262e-01, 3.617858e-01, 3.538933e-01,
|
||||
3.461460e-01, 3.385411e-01, 3.310757e-01, 3.237474e-01, 3.165536e-01,
|
||||
3.094921e-01, 3.025605e-01, 2.957566e-01, 2.890784e-01, 2.825237e-01,
|
||||
2.760907e-01, 2.697773e-01, 2.635817e-01, 2.575020e-01, 2.515365e-01,
|
||||
2.456834e-01, 2.399409e-01, 2.343074e-01, 2.287812e-01, 2.233607e-01,
|
||||
2.180442e-01, 2.128303e-01, 2.077174e-01, 2.027040e-01, 1.977885e-01,
|
||||
1.929696e-01, 1.882457e-01, 1.836155e-01, 1.790775e-01, 1.746305e-01,
|
||||
1.702730e-01, 1.660036e-01, 1.618212e-01, 1.577243e-01, 1.537117e-01,
|
||||
1.497822e-01, 1.459344e-01, 1.421671e-01, 1.384791e-01, 1.348691e-01,
|
||||
1.313360e-01, 1.278785e-01, 1.244956e-01, 1.211859e-01, 1.179483e-01,
|
||||
1.147818e-01, 1.116850e-01, 1.086570e-01, 1.056966e-01, 1.028026e-01,
|
||||
9.997405e-02, 9.720975e-02, 9.450865e-02, 9.186969e-02, 8.929179e-02,
|
||||
8.677391e-02, 8.431501e-02, 8.191406e-02, 7.957003e-02, 7.728192e-02,
|
||||
7.504872e-02, 7.286944e-02, 7.074311e-02, 6.866874e-02, 6.664538e-02,
|
||||
6.467208e-02, 6.274790e-02, 6.087191e-02, 5.904317e-02, 5.726079e-02,
|
||||
5.552387e-02, 5.383150e-02, 5.218282e-02, 5.057695e-02, 4.901302e-02,
|
||||
4.749020e-02, 4.600763e-02, 4.456450e-02, 4.315997e-02, 4.179325e-02,
|
||||
4.046353e-02, 3.917002e-02, 3.791195e-02, 3.668855e-02, 3.549906e-02,
|
||||
3.434274e-02, 3.321884e-02, 3.212665e-02, 3.106544e-02, 3.003452e-02,
|
||||
2.903319e-02, 2.806076e-02, 2.711656e-02, 2.619993e-02, 2.531021e-02,
|
||||
2.444677e-02, 2.360897e-02, 2.279620e-02, 2.200783e-02, 2.124327e-02,
|
||||
2.050194e-02, 1.978324e-02, 1.908662e-02, 1.841151e-02, 1.775735e-02,
|
||||
1.712363e-02, 1.650979e-02, 1.591533e-02, 1.533973e-02, 1.478250e-02,
|
||||
1.424314e-02, 1.372117e-02, 1.321613e-02, 1.272755e-02, 1.225498e-02,
|
||||
1.179798e-02, 1.135611e-02, 1.092896e-02, 1.051609e-02, 1.011712e-02,
|
||||
9.731635e-03, 9.359254e-03, 8.999595e-03, 8.652287e-03, 8.316967e-03,
|
||||
7.993280e-03, 7.680879e-03, 7.379426e-03, 7.088591e-03, 6.808051e-03,
|
||||
6.537491e-03, 6.276605e-03, 6.025092e-03, 5.782661e-03, 5.549027e-03,
|
||||
5.323912e-03, 5.107045e-03, 4.898164e-03, 4.697011e-03, 4.503336e-03,
|
||||
4.316896e-03, 4.137454e-03, 3.964780e-03, 3.798649e-03, 3.638843e-03,
|
||||
3.485150e-03, 3.337364e-03, 3.195284e-03, 3.058715e-03, 2.927469e-03,
|
||||
2.801361e-03, 2.680213e-03, 2.563852e-03, 2.452110e-03, 2.344824e-03
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Constructor
|
||||
//
|
||||
|
||||
G4SynchrotronRadiationInMat::G4SynchrotronRadiationInMat(const G4String& processName,
|
||||
G4ProcessType type):G4VDiscreteProcess (processName, type),
|
||||
LowestKineticEnergy (10.*keV),
|
||||
HighestKineticEnergy (100.*TeV),
|
||||
TotBin(200),
|
||||
theGamma (G4Gamma::Gamma() ),
|
||||
theElectron ( G4Electron::Electron() ),
|
||||
thePositron ( G4Positron::Positron() ), fAlpha(0.0), fRootNumber(80),
|
||||
fVerboseLevel( verboseLevel )
|
||||
{
|
||||
G4TransportationManager* transportMgr = G4TransportationManager::GetTransportationManager();
|
||||
|
||||
fFieldPropagator = transportMgr->GetPropagatorInField();
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Destructor
|
||||
//
|
||||
|
||||
G4SynchrotronRadiationInMat::~G4SynchrotronRadiationInMat()
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////// METHODS /////////////////////////////////
|
||||
//
|
||||
//
|
||||
// Production of synchrotron X-ray photon
|
||||
// GEANT4 internal units.
|
||||
//
|
||||
|
||||
|
||||
G4double
|
||||
G4SynchrotronRadiationInMat::GetMeanFreePath( const G4Track& trackData,
|
||||
G4double,
|
||||
G4ForceCondition* condition)
|
||||
{
|
||||
// gives the MeanFreePath in GEANT4 internal units
|
||||
G4double MeanFreePath;
|
||||
|
||||
const G4DynamicParticle* aDynamicParticle = trackData.GetDynamicParticle();
|
||||
// G4Material* aMaterial = trackData.GetMaterial();
|
||||
|
||||
//G4bool isOutRange ;
|
||||
|
||||
*condition = NotForced ;
|
||||
|
||||
G4double gamma = aDynamicParticle->GetTotalEnergy()/
|
||||
aDynamicParticle->GetMass();
|
||||
|
||||
G4double particleCharge = aDynamicParticle->GetDefinition()->GetPDGCharge();
|
||||
|
||||
G4double KineticEnergy = aDynamicParticle->GetKineticEnergy();
|
||||
|
||||
if ( KineticEnergy < LowestKineticEnergy || gamma < 1.0e3 ) MeanFreePath = DBL_MAX;
|
||||
else
|
||||
{
|
||||
|
||||
G4ThreeVector FieldValue;
|
||||
const G4Field* pField = 0;
|
||||
|
||||
G4FieldManager* fieldMgr=0;
|
||||
G4bool fieldExertsForce = false;
|
||||
|
||||
if( (particleCharge != 0.0) )
|
||||
{
|
||||
fieldMgr = fFieldPropagator->FindAndSetFieldManager( trackData.GetVolume() );
|
||||
|
||||
if ( fieldMgr != 0 )
|
||||
{
|
||||
// If the field manager has no field, there is no field !
|
||||
|
||||
fieldExertsForce = ( fieldMgr->GetDetectorField() != 0 );
|
||||
}
|
||||
}
|
||||
if ( fieldExertsForce )
|
||||
{
|
||||
pField = fieldMgr->GetDetectorField() ;
|
||||
G4ThreeVector globPosition = trackData.GetPosition();
|
||||
|
||||
G4double globPosVec[3], FieldValueVec[3];
|
||||
|
||||
globPosVec[0] = globPosition.x();
|
||||
globPosVec[1] = globPosition.y();
|
||||
globPosVec[2] = globPosition.z();
|
||||
|
||||
pField->GetFieldValue( globPosVec, FieldValueVec );
|
||||
|
||||
FieldValue = G4ThreeVector( FieldValueVec[0],
|
||||
FieldValueVec[1],
|
||||
FieldValueVec[2] );
|
||||
|
||||
|
||||
|
||||
G4ThreeVector unitMomentum = aDynamicParticle->GetMomentumDirection();
|
||||
G4ThreeVector unitMcrossB = FieldValue.cross(unitMomentum) ;
|
||||
G4double perpB = unitMcrossB.mag() ;
|
||||
G4double beta = aDynamicParticle->GetTotalMomentum()/
|
||||
(aDynamicParticle->GetTotalEnergy() );
|
||||
|
||||
if( perpB > 0.0 ) MeanFreePath = fLambdaConst*beta/perpB;
|
||||
else MeanFreePath = DBL_MAX;
|
||||
}
|
||||
else MeanFreePath = DBL_MAX;
|
||||
}
|
||||
if(fVerboseLevel > 0)
|
||||
{
|
||||
G4cout<<"G4SynchrotronRadiationInMat::MeanFreePath = "<<MeanFreePath/m<<" m"<<G4endl;
|
||||
}
|
||||
return MeanFreePath;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
G4VParticleChange*
|
||||
G4SynchrotronRadiationInMat::PostStepDoIt(const G4Track& trackData,
|
||||
const G4Step& stepData )
|
||||
|
||||
{
|
||||
aParticleChange.Initialize(trackData);
|
||||
|
||||
const G4DynamicParticle* aDynamicParticle=trackData.GetDynamicParticle();
|
||||
|
||||
G4double gamma = aDynamicParticle->GetTotalEnergy()/
|
||||
(aDynamicParticle->GetMass() );
|
||||
|
||||
if(gamma <= 1.0e3 )
|
||||
{
|
||||
return G4VDiscreteProcess::PostStepDoIt(trackData,stepData);
|
||||
}
|
||||
G4double particleCharge = aDynamicParticle->GetDefinition()->GetPDGCharge();
|
||||
|
||||
G4ThreeVector FieldValue;
|
||||
const G4Field* pField = 0 ;
|
||||
|
||||
G4FieldManager* fieldMgr=0;
|
||||
G4bool fieldExertsForce = false;
|
||||
|
||||
if( (particleCharge != 0.0) )
|
||||
{
|
||||
fieldMgr = fFieldPropagator->FindAndSetFieldManager( trackData.GetVolume() );
|
||||
if ( fieldMgr != 0 )
|
||||
{
|
||||
// If the field manager has no field, there is no field !
|
||||
|
||||
fieldExertsForce = ( fieldMgr->GetDetectorField() != 0 );
|
||||
}
|
||||
}
|
||||
if ( fieldExertsForce )
|
||||
{
|
||||
pField = fieldMgr->GetDetectorField() ;
|
||||
G4ThreeVector globPosition = trackData.GetPosition() ;
|
||||
G4double globPosVec[3], FieldValueVec[3] ;
|
||||
globPosVec[0] = globPosition.x() ;
|
||||
globPosVec[1] = globPosition.y() ;
|
||||
globPosVec[2] = globPosition.z() ;
|
||||
|
||||
pField->GetFieldValue( globPosVec, FieldValueVec ) ;
|
||||
FieldValue = G4ThreeVector( FieldValueVec[0],
|
||||
FieldValueVec[1],
|
||||
FieldValueVec[2] );
|
||||
|
||||
G4ThreeVector unitMomentum = aDynamicParticle->GetMomentumDirection();
|
||||
G4ThreeVector unitMcrossB = FieldValue.cross(unitMomentum);
|
||||
G4double perpB = unitMcrossB.mag() ;
|
||||
if(perpB > 0.0)
|
||||
{
|
||||
// M-C of synchrotron photon energy
|
||||
|
||||
G4double energyOfSR = GetRandomEnergySR(gamma,perpB);
|
||||
|
||||
if(fVerboseLevel > 0)
|
||||
{
|
||||
G4cout<<"SR photon energy = "<<energyOfSR/keV<<" keV"<<G4endl;
|
||||
}
|
||||
// check against insufficient energy
|
||||
|
||||
if( energyOfSR <= 0.0 )
|
||||
{
|
||||
return G4VDiscreteProcess::PostStepDoIt(trackData,stepData);
|
||||
}
|
||||
G4double kineticEnergy = aDynamicParticle->GetKineticEnergy();
|
||||
G4ParticleMomentum
|
||||
particleDirection = aDynamicParticle->GetMomentumDirection();
|
||||
|
||||
// M-C of its direction
|
||||
|
||||
G4double Teta = G4UniformRand()/gamma ; // Very roughly
|
||||
|
||||
G4double Phi = twopi * G4UniformRand() ;
|
||||
|
||||
G4double dirx = sin(Teta)*cos(Phi) ,
|
||||
diry = sin(Teta)*sin(Phi) ,
|
||||
dirz = cos(Teta) ;
|
||||
|
||||
G4ThreeVector gammaDirection ( dirx, diry, dirz);
|
||||
gammaDirection.rotateUz(particleDirection);
|
||||
|
||||
// polarization of new gamma
|
||||
|
||||
// G4double sx = cos(Teta)*cos(Phi);
|
||||
// G4double sy = cos(Teta)*sin(Phi);
|
||||
// G4double sz = -sin(Teta);
|
||||
|
||||
G4ThreeVector gammaPolarization = FieldValue.cross(gammaDirection);
|
||||
gammaPolarization = gammaPolarization.unit();
|
||||
|
||||
// (sx, sy, sz);
|
||||
// gammaPolarization.rotateUz(particleDirection);
|
||||
|
||||
// create G4DynamicParticle object for the SR photon
|
||||
|
||||
G4DynamicParticle* aGamma= new G4DynamicParticle ( G4Gamma::Gamma(),
|
||||
gammaDirection,
|
||||
energyOfSR );
|
||||
aGamma->SetPolarization( gammaPolarization.x(),
|
||||
gammaPolarization.y(),
|
||||
gammaPolarization.z() );
|
||||
|
||||
|
||||
aParticleChange.SetNumberOfSecondaries(1);
|
||||
aParticleChange.AddSecondary(aGamma);
|
||||
|
||||
// Update the incident particle
|
||||
|
||||
G4double newKinEnergy = kineticEnergy - energyOfSR ;
|
||||
|
||||
if (newKinEnergy > 0.)
|
||||
{
|
||||
aParticleChange.ProposeMomentumDirection( particleDirection );
|
||||
aParticleChange.ProposeEnergy( newKinEnergy );
|
||||
aParticleChange.ProposeLocalEnergyDeposit (0.);
|
||||
}
|
||||
else
|
||||
{
|
||||
aParticleChange.ProposeEnergy( 0. );
|
||||
aParticleChange.ProposeLocalEnergyDeposit (0.);
|
||||
G4double charge = aDynamicParticle->GetDefinition()->GetPDGCharge();
|
||||
if (charge<0.)
|
||||
{
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
aParticleChange.ProposeTrackStatus(fStopButAlive) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return G4VDiscreteProcess::PostStepDoIt(trackData,stepData);
|
||||
}
|
||||
}
|
||||
return G4VDiscreteProcess::PostStepDoIt(trackData,stepData);
|
||||
}
|
||||
|
||||
|
||||
G4double
|
||||
G4SynchrotronRadiationInMat::GetPhotonEnergy( const G4Track& trackData,
|
||||
const G4Step& )
|
||||
|
||||
{
|
||||
G4int i ;
|
||||
G4double energyOfSR = -1.0 ;
|
||||
//G4Material* aMaterial=trackData.GetMaterial() ;
|
||||
|
||||
const G4DynamicParticle* aDynamicParticle=trackData.GetDynamicParticle();
|
||||
|
||||
G4double gamma = aDynamicParticle->GetTotalEnergy()/
|
||||
(aDynamicParticle->GetMass() ) ;
|
||||
|
||||
G4double particleCharge = aDynamicParticle->GetDefinition()->GetPDGCharge();
|
||||
|
||||
G4ThreeVector FieldValue;
|
||||
const G4Field* pField = 0 ;
|
||||
|
||||
G4FieldManager* fieldMgr=0;
|
||||
G4bool fieldExertsForce = false;
|
||||
|
||||
if( (particleCharge != 0.0) )
|
||||
{
|
||||
fieldMgr = fFieldPropagator->FindAndSetFieldManager( trackData.GetVolume() );
|
||||
if ( fieldMgr != 0 )
|
||||
{
|
||||
// If the field manager has no field, there is no field !
|
||||
|
||||
fieldExertsForce = ( fieldMgr->GetDetectorField() != 0 );
|
||||
}
|
||||
}
|
||||
if ( fieldExertsForce )
|
||||
{
|
||||
pField = fieldMgr->GetDetectorField();
|
||||
G4ThreeVector globPosition = trackData.GetPosition();
|
||||
G4double globPosVec[3], FieldValueVec[3];
|
||||
|
||||
globPosVec[0] = globPosition.x();
|
||||
globPosVec[1] = globPosition.y();
|
||||
globPosVec[2] = globPosition.z();
|
||||
|
||||
pField->GetFieldValue( globPosVec, FieldValueVec );
|
||||
FieldValue = G4ThreeVector( FieldValueVec[0],
|
||||
FieldValueVec[1],
|
||||
FieldValueVec[2] );
|
||||
|
||||
G4ThreeVector unitMomentum = aDynamicParticle->GetMomentumDirection();
|
||||
G4ThreeVector unitMcrossB = FieldValue.cross(unitMomentum) ;
|
||||
G4double perpB = unitMcrossB.mag();
|
||||
if( perpB > 0.0 )
|
||||
{
|
||||
// M-C of synchrotron photon energy
|
||||
|
||||
G4double random = G4UniformRand() ;
|
||||
for(i=0;i<200;i++)
|
||||
{
|
||||
if(random >= fIntegralProbabilityOfSR[i]) break ;
|
||||
}
|
||||
energyOfSR = 0.0001*i*i*fEnergyConst*gamma*gamma*perpB ;
|
||||
|
||||
// check against insufficient energy
|
||||
|
||||
if(energyOfSR <= 0.0)
|
||||
{
|
||||
return -1.0 ;
|
||||
}
|
||||
//G4double kineticEnergy = aDynamicParticle->GetKineticEnergy();
|
||||
//G4ParticleMomentum
|
||||
//particleDirection = aDynamicParticle->GetMomentumDirection();
|
||||
|
||||
// Gamma production cut in this material
|
||||
//G4double
|
||||
//gammaEnergyCut = (G4Gamma::GetCutsInEnergy())[aMaterial->GetIndex()];
|
||||
|
||||
// SR photon has energy more than the current material cut
|
||||
// M-C of its direction
|
||||
|
||||
//G4double Teta = G4UniformRand()/gamma ; // Very roughly
|
||||
|
||||
//G4double Phi = twopi * G4UniformRand() ;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1.0 ;
|
||||
}
|
||||
}
|
||||
return energyOfSR ;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
G4double G4SynchrotronRadiationInMat::GetRandomEnergySR(G4double gamma, G4double perpB)
|
||||
{
|
||||
G4int i, iMax;
|
||||
G4double energySR, random, position;
|
||||
|
||||
iMax = 200;
|
||||
random = G4UniformRand();
|
||||
|
||||
for( i = 0; i < iMax; i++ )
|
||||
{
|
||||
if( random >= fIntegralProbabilityOfSR[i] ) break;
|
||||
}
|
||||
if(i <= 0 ) position = G4UniformRand(); // 0.
|
||||
else if( i>= iMax) position = G4double(iMax);
|
||||
else position = i + G4UniformRand(); // -1
|
||||
//
|
||||
// it was in initial implementation:
|
||||
// energyOfSR = 0.0001*i*i*fEnergyConst*gamma*gamma*perpB ;
|
||||
|
||||
energySR = 0.0001*position*position*fEnergyConst*gamma*gamma*perpB;
|
||||
|
||||
if( energySR < 0. ) energySR = 0.;
|
||||
|
||||
return energySR;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// return
|
||||
|
||||
G4double G4SynchrotronRadiationInMat::GetProbSpectrumSRforInt( G4double t)
|
||||
{
|
||||
G4double result, hypCos2, hypCos=std::cosh(t);
|
||||
|
||||
hypCos2 = hypCos*hypCos;
|
||||
result = std::cosh(5.*t/3.)*std::exp(t-fKsi*hypCos); // fKsi > 0. !
|
||||
result /= hypCos2;
|
||||
return result;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// return the probability to emit SR photon with relative energy
|
||||
// energy/energy_c >= ksi
|
||||
// for ksi <= 0. P = 1., however the method works for ksi > 0 only!
|
||||
|
||||
G4double G4SynchrotronRadiationInMat::GetIntProbSR( G4double ksi)
|
||||
{
|
||||
if (ksi <= 0.) return 1.0;
|
||||
fKsi = ksi; // should be > 0. !
|
||||
G4int n;
|
||||
G4double result, a;
|
||||
|
||||
a = fAlpha; // always = 0.
|
||||
n = fRootNumber; // around default = 80
|
||||
|
||||
G4Integrator<G4SynchrotronRadiationInMat, G4double(G4SynchrotronRadiationInMat::*)(G4double)> integral;
|
||||
|
||||
result = integral.Laguerre(this,
|
||||
&G4SynchrotronRadiationInMat::GetProbSpectrumSRforInt, a, n);
|
||||
|
||||
result *= 3./5./pi;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// return an auxiliary function for K_5/3 integral representation
|
||||
|
||||
G4double G4SynchrotronRadiationInMat::GetProbSpectrumSRforEnergy( G4double t)
|
||||
{
|
||||
G4double result, hypCos=std::cosh(t);
|
||||
|
||||
result = std::cosh(5.*t/3.)*std::exp(t - fKsi*hypCos); // fKsi > 0. !
|
||||
result /= hypCos;
|
||||
return result;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// return the probability to emit SR photon energy with relative energy
|
||||
// energy/energy_c >= ksi
|
||||
// for ksi <= 0. P = 1., however the method works for ksi > 0 only!
|
||||
|
||||
G4double G4SynchrotronRadiationInMat::GetEnergyProbSR( G4double ksi)
|
||||
{
|
||||
if (ksi <= 0.) return 1.0;
|
||||
fKsi = ksi; // should be > 0. !
|
||||
G4int n;
|
||||
G4double result, a;
|
||||
|
||||
a = fAlpha; // always = 0.
|
||||
n = fRootNumber; // around default = 80
|
||||
|
||||
G4Integrator<G4SynchrotronRadiationInMat, G4double(G4SynchrotronRadiationInMat::*)(G4double)> integral;
|
||||
|
||||
result = integral.Laguerre(this,
|
||||
&G4SynchrotronRadiationInMat::GetProbSpectrumSRforEnergy, a, n);
|
||||
|
||||
result *= 9.*std::sqrt(3.)*ksi/8./pi;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
G4double G4SynchrotronRadiationInMat::GetIntegrandForAngleK( G4double t)
|
||||
{
|
||||
G4double result, hypCos=std::cosh(t);
|
||||
|
||||
result = std::cosh(fOrderAngleK*t)*std::exp(t - fEta*hypCos); // fEta > 0. !
|
||||
result /= hypCos;
|
||||
return result;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Return K 1/3 or 2/3 for angular distribution
|
||||
|
||||
G4double G4SynchrotronRadiationInMat::GetAngleK( G4double eta)
|
||||
{
|
||||
fEta = eta; // should be > 0. !
|
||||
G4int n;
|
||||
G4double result, a;
|
||||
|
||||
a = fAlpha; // always = 0.
|
||||
n = fRootNumber; // around default = 80
|
||||
|
||||
G4Integrator<G4SynchrotronRadiationInMat, G4double(G4SynchrotronRadiationInMat::*)(G4double)> integral;
|
||||
|
||||
result = integral.Laguerre(this,
|
||||
&G4SynchrotronRadiationInMat::GetIntegrandForAngleK, a, n);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Relative angle diff distribution for given fKsi, which is set externally
|
||||
|
||||
G4double G4SynchrotronRadiationInMat::GetAngleNumberAtGammaKsi( G4double gpsi)
|
||||
{
|
||||
G4double result, funK, funK2, gpsi2 = gpsi*gpsi;
|
||||
|
||||
fPsiGamma = gpsi;
|
||||
fEta = 0.5*fKsi*(1 + gpsi2)*std::sqrt(1 + gpsi2);
|
||||
|
||||
fOrderAngleK = 1./3.;
|
||||
funK = GetAngleK(fEta);
|
||||
funK2 = funK*funK;
|
||||
|
||||
result = gpsi2*funK2/(1 + gpsi2);
|
||||
|
||||
fOrderAngleK = 2./3.;
|
||||
funK = GetAngleK(fEta);
|
||||
funK2 = funK*funK;
|
||||
|
||||
result += funK2;
|
||||
result *= (1 + gpsi2)*fKsi;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
///////////////////// end of G4SynchrotronRadiationInMat.cc
|
||||
|
||||
@@ -1,28 +1,31 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * 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. *
|
||||
// * 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 intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// * 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: G4TransitionRadiation.cc,v 1.6 2005/07/28 23:58:01 gum Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
// $Id: G4TransitionRadiation.cc,v 1.7 2006/06/29 19:56:19 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
//
|
||||
// G4TransitionRadiation class -- implementation file
|
||||
|
||||
|
||||
@@ -1,28 +1,31 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * 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. *
|
||||
// * 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 intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// * 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: G4TransparentRegXTRadiator.cc,v 1.7 2005/08/06 13:59:35 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
// $Id: G4TransparentRegXTRadiator.cc,v 1.10 2006/06/29 19:56:21 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
//
|
||||
|
||||
#include <complex>
|
||||
@@ -52,7 +55,7 @@ G4TransparentRegXTRadiator::G4TransparentRegXTRadiator(G4LogicalVolume *anEnvelo
|
||||
fAlphaPlate = 10000;
|
||||
fAlphaGas = 1000;
|
||||
|
||||
BuildTable();
|
||||
// BuildTable();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
@@ -108,7 +111,7 @@ G4double G4TransparentRegXTRadiator::SpectralXTRdEdx(G4double energy)
|
||||
{
|
||||
tmp = pi*fPlateThick*(k + cof2)/(fPlateThick + fGasThick);
|
||||
result = (k - cof1)*(k - cof1)*(k + cof2)*(k + cof2);
|
||||
|
||||
// tmp = sin(tmp)*sin(tmp)*abs(k-cofMin)/result;
|
||||
if( k == kMin && kMin == G4int(cofMin) )
|
||||
{
|
||||
sum += 0.5*sin(tmp)*sin(tmp)*abs(k-cofMin)/result;
|
||||
@@ -117,11 +120,17 @@ G4double G4TransparentRegXTRadiator::SpectralXTRdEdx(G4double energy)
|
||||
{
|
||||
sum += sin(tmp)*sin(tmp)*abs(k-cofMin)/result;
|
||||
}
|
||||
// G4cout<<"k = "<<k<<"; sum = "<<sum<<G4endl;
|
||||
if(fVerbose > 2)
|
||||
{
|
||||
G4cout<<"k = "<<k<<"; tmp = "<<sin(tmp)*sin(tmp)*abs(k-cofMin)/result
|
||||
<<"; sum = "<<sum<<G4endl;
|
||||
}
|
||||
}
|
||||
result = 4*( cof1 + cof2 )*( cof1 + cof2 )*sum/energy;
|
||||
// result *= ( 1 - exp(-0.5*fPlateNumber*sigma) )/( 1 - exp(-0.5*sigma) ); // fPlateNumber;
|
||||
result *= fPlateNumber; // *exp(-0.5*fPlateNumber*sigma); // +1-exp(-0.5*fPlateNumber*sigma);
|
||||
// result *= ( 1 - exp(-0.5*fPlateNumber*sigma) )/( 1 - exp(-0.5*sigma) );
|
||||
// fPlateNumber;
|
||||
result *= fPlateNumber; // *exp(-0.5*fPlateNumber*sigma);
|
||||
// +1-exp(-0.5*fPlateNumber*sigma);
|
||||
/*
|
||||
fEnergy = energy;
|
||||
// G4Integrator<G4VXTRenergyLoss,G4double(G4VXTRenergyLoss::*)(G4double)> integral;
|
||||
|
||||
@@ -1,28 +1,31 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * 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. *
|
||||
// * 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 intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// * 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: G4VTransitionRadiation.cc,v 1.4 2005/07/28 23:57:37 gum Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
// $Id: G4VTransitionRadiation.cc,v 1.5 2006/06/29 19:56:23 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
//
|
||||
// G4VTransitionRadiation class -- implementation file
|
||||
|
||||
|
||||
@@ -1,28 +1,31 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * 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. *
|
||||
// * 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 intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// * 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: G4VXTRenergyLoss.cc,v 1.21 2005/10/11 14:24:34 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
// $Id: G4VXTRenergyLoss.cc,v 1.34 2006/06/29 19:56:25 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
//
|
||||
// History:
|
||||
// 2001-2002 R&D by V.Grichine
|
||||
@@ -46,32 +49,38 @@
|
||||
#include "G4AffineTransform.hh"
|
||||
|
||||
#include "G4PhysicsVector.hh"
|
||||
#include "G4PhysicsFreeVector.hh"
|
||||
#include "G4PhysicsLinearVector.hh"
|
||||
|
||||
using namespace std;
|
||||
|
||||
// Initialization of local constants
|
||||
|
||||
G4double G4XTRenergyLoss::fTheMinEnergyTR = 1.0*keV ;
|
||||
G4double G4XTRenergyLoss::fTheMaxEnergyTR = 100.0*keV ;
|
||||
G4double G4XTRenergyLoss::fTheMaxAngle = 1.0e-3 ;
|
||||
G4double G4XTRenergyLoss::fTheMinAngle = 5.0e-6 ;
|
||||
G4int G4XTRenergyLoss::fBinTR = 50 ;
|
||||
G4double G4XTRenergyLoss::fTheMinEnergyTR = 1.0*keV;
|
||||
G4double G4XTRenergyLoss::fTheMaxEnergyTR = 100.0*keV;
|
||||
G4double G4XTRenergyLoss::fTheMaxAngle = 1.0e-3;
|
||||
G4double G4XTRenergyLoss::fTheMinAngle = 5.0e-6;
|
||||
G4int G4XTRenergyLoss::fBinTR = 50;
|
||||
|
||||
G4double G4XTRenergyLoss::fMinProtonTkin = 100.0*GeV ;
|
||||
G4double G4XTRenergyLoss::fMaxProtonTkin = 100.0*TeV ;
|
||||
G4int G4XTRenergyLoss::fTotBin = 50 ;
|
||||
G4double G4XTRenergyLoss::fMinProtonTkin = 100.0*GeV;
|
||||
G4double G4XTRenergyLoss::fMaxProtonTkin = 100.0*TeV;
|
||||
G4int G4XTRenergyLoss::fTotBin = 50;
|
||||
// Proton energy vector initialization
|
||||
|
||||
G4PhysicsLogVector* G4XTRenergyLoss::
|
||||
fProtonEnergyVector = new G4PhysicsLogVector(fMinProtonTkin,
|
||||
fMaxProtonTkin,
|
||||
fTotBin ) ;
|
||||
fTotBin );
|
||||
|
||||
G4PhysicsLogVector* G4XTRenergyLoss::
|
||||
fXTREnergyVector = new G4PhysicsLogVector(fTheMinEnergyTR,
|
||||
fTheMaxEnergyTR,
|
||||
fBinTR );
|
||||
|
||||
G4double G4XTRenergyLoss::fPlasmaCof = 4.0*pi*fine_structure_const*
|
||||
hbarc*hbarc*hbarc/electron_mass_c2 ;
|
||||
hbarc*hbarc*hbarc/electron_mass_c2;
|
||||
|
||||
G4double G4XTRenergyLoss::fCofTR = fine_structure_const/pi ;
|
||||
G4double G4XTRenergyLoss::fCofTR = fine_structure_const/pi;
|
||||
|
||||
|
||||
|
||||
@@ -86,8 +95,16 @@ G4XTRenergyLoss::G4XTRenergyLoss(G4LogicalVolume *anEnvelope,
|
||||
G4double a, G4double b,
|
||||
G4int n,const G4String& processName,
|
||||
G4ProcessType type) :
|
||||
G4VDiscreteProcess(processName, type)
|
||||
// G4VContinuousProcess(processName, type)
|
||||
G4VDiscreteProcess(processName, type),
|
||||
// G4VContinuousProcess(processName, type),
|
||||
fGammaCutInKineticEnergy(0),
|
||||
fGammaTkinCut(0),
|
||||
fAngleDistrTable(0),
|
||||
fEnergyDistrTable(0),
|
||||
fPlatePhotoAbsCof(0),
|
||||
fGasPhotoAbsCof(0),
|
||||
fAngleForEnergyTable(0),
|
||||
fVerbose(0)
|
||||
{
|
||||
fEnvelope = anEnvelope ;
|
||||
// fPlateNumber = fEnvelope->GetNoDaughters() ;
|
||||
@@ -98,7 +115,11 @@ G4XTRenergyLoss::G4XTRenergyLoss(G4LogicalVolume *anEnvelope,
|
||||
G4Exception("No plates in X-ray TR radiator") ;
|
||||
}
|
||||
// default is XTR dEdx, not flux after radiator
|
||||
fExitFlux = false;
|
||||
|
||||
fExitFlux = false;
|
||||
fAngleRadDistr = false;
|
||||
fCompton = false;
|
||||
|
||||
fLambda = DBL_MAX;
|
||||
// Mean thicknesses of plates and gas gaps
|
||||
|
||||
@@ -255,6 +276,25 @@ G4double G4XTRenergyLoss::GetMeanFreePath(const G4Track& aTrack,
|
||||
return lambda;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Interface for build table from physics list
|
||||
|
||||
void G4XTRenergyLoss::BuildPhysicsTable(const G4ParticleDefinition& pd)
|
||||
{
|
||||
if(pd.GetPDGCharge() == 0.)
|
||||
{
|
||||
G4Exception("G4XTRenergyLoss::BuildPhysicsTable", "Notification", JustWarning,
|
||||
"XTR initialisation for neutral particle ?!" );
|
||||
}
|
||||
BuildTable();
|
||||
if (fAngleRadDistr)
|
||||
{
|
||||
G4cout<<"Build angle distribution according the transparent regular radiator"<<G4endl;
|
||||
BuildAngleTable();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -281,7 +321,7 @@ void G4XTRenergyLoss::BuildTable()
|
||||
G4Timer timer ;
|
||||
timer.Start() ;
|
||||
G4cout<<G4endl;
|
||||
G4cout<<"Lorentz Factor"<<"\t"<<"XTR photon number"<<G4endl;
|
||||
if (fVerbose) G4cout<<"Lorentz Factor"<<"\t"<<"XTR photon number"<<G4endl;
|
||||
G4cout<<G4endl;
|
||||
|
||||
for( iTkin = 0 ; iTkin < fTotBin ; iTkin++ ) // Lorentz factor loop
|
||||
@@ -329,13 +369,16 @@ G4Integrator<G4XTRenergyLoss,G4double(G4XTRenergyLoss::*)(G4double)> integral;
|
||||
energyVector->PutValue(iTR,energySum/fTotalDist);
|
||||
// angleVector ->PutValue(iTR,angleSum);
|
||||
}
|
||||
G4cout
|
||||
if(fVerbose)
|
||||
{
|
||||
G4cout
|
||||
// <<iTkin<<"\t"
|
||||
// <<"fGamma = "
|
||||
<<fGamma<<"\t" // <<" fMaxThetaTR = "<<fMaxThetaTR
|
||||
// <<"sumN = "
|
||||
<<energySum // <<" ; sumA = "<<angleSum
|
||||
<<G4endl;
|
||||
}
|
||||
iPlace = iTkin;
|
||||
fEnergyDistrTable->insertAt(iPlace,energyVector);
|
||||
// fAngleDistrTable->insertAt(iPlace,angleVector);
|
||||
@@ -360,11 +403,290 @@ void G4XTRenergyLoss::BuildEnergyTable()
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
// Build XTR angular distribution at given energy based on the model
|
||||
// of transparent regular radiator
|
||||
|
||||
void G4XTRenergyLoss::BuildAngleTable()
|
||||
{
|
||||
return ;
|
||||
G4int iTkin, iTR;
|
||||
G4double energy;
|
||||
|
||||
// G4double theta, result, tmp, cof1, cof2, cofMin, cofPHC, angleSum=0.;
|
||||
// G4int k, iTheta, kMax, kMin;
|
||||
|
||||
fGammaTkinCut = 0.0;
|
||||
|
||||
|
||||
// setting of min/max TR energies
|
||||
|
||||
if(fGammaTkinCut > fTheMinEnergyTR) fMinEnergyTR = fGammaTkinCut;
|
||||
else fMinEnergyTR = fTheMinEnergyTR;
|
||||
|
||||
if(fGammaTkinCut > fTheMaxEnergyTR) fMaxEnergyTR = 2.0*fGammaTkinCut;
|
||||
else fMaxEnergyTR = fTheMaxEnergyTR;
|
||||
|
||||
G4cout.precision(4);
|
||||
G4Timer timer;
|
||||
timer.Start();
|
||||
G4cout<<G4endl;
|
||||
if (fVerbose) G4cout<<"Lorentz Factor"<<"\t"<<"XTR photon number"<<G4endl;
|
||||
G4cout<<G4endl;
|
||||
|
||||
for( iTkin = 0 ; iTkin < fTotBin ; iTkin++ ) // Lorentz factor loop
|
||||
{
|
||||
|
||||
fGamma = 1.0 + (fProtonEnergyVector->
|
||||
GetLowEdgeEnergy(iTkin)/proton_mass_c2) ;
|
||||
|
||||
fMaxThetaTR = 25.0/(fGamma*fGamma) ; // theta^2
|
||||
|
||||
fTheMinAngle = 1.0e-3 ; // was 5.e-6, e-6 !!!, e-5, e-4
|
||||
|
||||
if( fMaxThetaTR > fTheMaxAngle ) fMaxThetaTR = fTheMaxAngle;
|
||||
else
|
||||
{
|
||||
if( fMaxThetaTR < fTheMinAngle ) fMaxThetaTR = fTheMinAngle;
|
||||
}
|
||||
|
||||
fAngleForEnergyTable = new G4PhysicsTable(fBinTR);
|
||||
|
||||
for( iTR = 0; iTR < fBinTR; iTR++ )
|
||||
{
|
||||
// energy = fMinEnergyTR*(iTR+1);
|
||||
|
||||
energy = fXTREnergyVector->GetLowEdgeEnergy(iTR);
|
||||
|
||||
G4PhysicsFreeVector* angleVector = new G4PhysicsFreeVector(fBinTR);
|
||||
|
||||
/*
|
||||
cofPHC = 4*pi*hbarc;
|
||||
tmp = (fSigma1 - fSigma2)/cofPHC/energy;
|
||||
cof1 = fPlateThick*tmp;
|
||||
cof2 = fGasThick*tmp;
|
||||
|
||||
cofMin = energy*(fPlateThick + fGasThick)/fGamma/fGamma;
|
||||
cofMin += (fPlateThick*fSigma1 + fGasThick*fSigma2)/energy;
|
||||
cofMin /= cofPHC;
|
||||
|
||||
kMin = G4int(cofMin);
|
||||
if (cofMin > kMin) kMin++;
|
||||
|
||||
kMax = kMin + fBinTR -1;
|
||||
|
||||
angleSum = 0.0;
|
||||
angleVector->PutValue(fBinTR-1,fMaxThetaTR, angleSum);
|
||||
|
||||
for( iTheta = fBinTR - 2 ; iTheta >= 0 ; iTheta-- )
|
||||
{
|
||||
|
||||
k = iTheta + kMin;
|
||||
|
||||
tmp = pi*fPlateThick*(k + cof2)/(fPlateThick + fGasThick);
|
||||
|
||||
result = (k - cof1)*(k - cof1)*(k + cof2)*(k + cof2);
|
||||
// tmp = sin(tmp)*sin(tmp)*abs(k-cofMin)/result;
|
||||
|
||||
if( k == kMin && kMin == G4int(cofMin) )
|
||||
{
|
||||
angleSum += 0.5*sin(tmp)*sin(tmp)*abs(k-cofMin)/result;
|
||||
}
|
||||
else
|
||||
{
|
||||
angleSum += sin(tmp)*sin(tmp)*abs(k-cofMin)/result;
|
||||
}
|
||||
theta = abs(k-cofMin)*cofPHC/energy/(fPlateThick + fGasThick);
|
||||
if(fVerbose)
|
||||
{
|
||||
G4cout<<"k = "<<k<<"; theta = "<<theta<<"; tmp = "
|
||||
<<sin(tmp)*sin(tmp)*abs(k-cofMin)/result
|
||||
<<"; angleSum = "<<angleSum<<G4endl;
|
||||
|
||||
}
|
||||
angleVector->PutValue( iTheta,
|
||||
theta,
|
||||
angleSum );
|
||||
|
||||
}
|
||||
*/
|
||||
angleVector = GetAngleVector(energy,fBinTR);
|
||||
// G4cout<<G4endl;
|
||||
|
||||
fAngleForEnergyTable->insertAt(iTR,angleVector) ;
|
||||
}
|
||||
|
||||
fAngleBank.push_back(fAngleForEnergyTable);
|
||||
}
|
||||
timer.Stop();
|
||||
G4cout.precision(6);
|
||||
G4cout<<G4endl;
|
||||
G4cout<<"total time for build XTR angle for given energy tables = "
|
||||
<<timer.GetUserElapsed()<<" s"<<G4endl;
|
||||
fGamma = 0.;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Vector of angles and angle integral distributions
|
||||
|
||||
G4PhysicsFreeVector* G4XTRenergyLoss::GetAngleVector(G4double energy, G4int n)
|
||||
{
|
||||
G4double theta=0., result, tmp=0., cof1, cof2, cofMin, cofPHC, angleSum = 0.;
|
||||
G4int iTheta, k, kMax, kMin;
|
||||
|
||||
G4PhysicsFreeVector* angleVector = new G4PhysicsFreeVector(n);
|
||||
|
||||
cofPHC = 4*pi*hbarc;
|
||||
tmp = (fSigma1 - fSigma2)/cofPHC/energy;
|
||||
cof1 = fPlateThick*tmp;
|
||||
cof2 = fGasThick*tmp;
|
||||
|
||||
cofMin = energy*(fPlateThick + fGasThick)/fGamma/fGamma;
|
||||
cofMin += (fPlateThick*fSigma1 + fGasThick*fSigma2)/energy;
|
||||
cofMin /= cofPHC;
|
||||
|
||||
kMin = G4int(cofMin);
|
||||
if (cofMin > kMin) kMin++;
|
||||
|
||||
kMax = kMin + fBinTR -1;
|
||||
if(fVerbose > 2)
|
||||
{
|
||||
G4cout<<"n-1 = "<<n-1<<"; theta = "
|
||||
<<std::sqrt(fMaxThetaTR)*fGamma<<"; tmp = "
|
||||
<<0.
|
||||
<<"; angleSum = "<<angleSum<<G4endl;
|
||||
}
|
||||
angleVector->PutValue(n-1,fMaxThetaTR, angleSum);
|
||||
|
||||
for( iTheta = n - 2 ; iTheta >= 1 ; iTheta-- )
|
||||
{
|
||||
|
||||
k = iTheta- 1 + kMin;
|
||||
|
||||
tmp = pi*fPlateThick*(k + cof2)/(fPlateThick + fGasThick);
|
||||
|
||||
result = (k - cof1)*(k - cof1)*(k + cof2)*(k + cof2);
|
||||
|
||||
tmp = sin(tmp)*sin(tmp)*abs(k-cofMin)/result;
|
||||
|
||||
if( k == kMin && kMin == G4int(cofMin) )
|
||||
{
|
||||
angleSum += 0.5*tmp; // 0.5*sin(tmp)*sin(tmp)*abs(k-cofMin)/result;
|
||||
}
|
||||
else
|
||||
{
|
||||
angleSum += tmp; // sin(tmp)*sin(tmp)*abs(k-cofMin)/result;
|
||||
}
|
||||
theta = abs(k-cofMin)*cofPHC/energy/(fPlateThick + fGasThick);
|
||||
if(fVerbose > 2)
|
||||
{
|
||||
G4cout<<"iTheta = "<<iTheta<<"; k = "<<k<<"; theta = "
|
||||
<<std::sqrt(theta)*fGamma<<"; tmp = "
|
||||
<<tmp // sin(tmp)*sin(tmp)*abs(k-cofMin)/result
|
||||
<<"; angleSum = "<<angleSum<<G4endl;
|
||||
}
|
||||
angleVector->PutValue( iTheta, theta, angleSum );
|
||||
}
|
||||
if (theta > 0.)
|
||||
{
|
||||
angleSum += 0.5*tmp;
|
||||
theta = 0.;
|
||||
}
|
||||
if(fVerbose > 2)
|
||||
{
|
||||
G4cout<<"iTheta = "<<iTheta<<"; theta = "
|
||||
<<std::sqrt(theta)*fGamma<<"; tmp = "
|
||||
<<tmp
|
||||
<<"; angleSum = "<<angleSum<<G4endl;
|
||||
}
|
||||
angleVector->PutValue( iTheta, theta, angleSum );
|
||||
|
||||
return angleVector;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Build XTR angular distribution based on the model of transparent regular radiator
|
||||
|
||||
void G4XTRenergyLoss::BuildGlobalAngleTable()
|
||||
{
|
||||
G4int iTkin, iTR, iPlace;
|
||||
G4double radiatorCof = 1.0; // for tuning of XTR yield
|
||||
G4double angleSum;
|
||||
fAngleDistrTable = new G4PhysicsTable(fTotBin);
|
||||
|
||||
fGammaTkinCut = 0.0;
|
||||
|
||||
// setting of min/max TR energies
|
||||
|
||||
if(fGammaTkinCut > fTheMinEnergyTR) fMinEnergyTR = fGammaTkinCut ;
|
||||
else fMinEnergyTR = fTheMinEnergyTR ;
|
||||
|
||||
if(fGammaTkinCut > fTheMaxEnergyTR) fMaxEnergyTR = 2.0*fGammaTkinCut ;
|
||||
else fMaxEnergyTR = fTheMaxEnergyTR ;
|
||||
|
||||
G4cout.precision(4) ;
|
||||
G4Timer timer ;
|
||||
timer.Start() ;
|
||||
G4cout<<G4endl;
|
||||
G4cout<<"Lorentz Factor"<<"\t"<<"XTR photon number"<<G4endl;
|
||||
G4cout<<G4endl;
|
||||
|
||||
for( iTkin = 0 ; iTkin < fTotBin ; iTkin++ ) // Lorentz factor loop
|
||||
{
|
||||
|
||||
fGamma = 1.0 + (fProtonEnergyVector->
|
||||
GetLowEdgeEnergy(iTkin)/proton_mass_c2) ;
|
||||
|
||||
fMaxThetaTR = 25.0/(fGamma*fGamma) ; // theta^2
|
||||
|
||||
fTheMinAngle = 1.0e-3 ; // was 5.e-6, e-6 !!!, e-5, e-4
|
||||
|
||||
if( fMaxThetaTR > fTheMaxAngle ) fMaxThetaTR = fTheMaxAngle;
|
||||
else
|
||||
{
|
||||
if( fMaxThetaTR < fTheMinAngle ) fMaxThetaTR = fTheMinAngle;
|
||||
}
|
||||
G4PhysicsLinearVector* angleVector = new G4PhysicsLinearVector(0.0,
|
||||
fMaxThetaTR,
|
||||
fBinTR );
|
||||
|
||||
angleSum = 0.0;
|
||||
|
||||
G4Integrator<G4XTRenergyLoss,G4double(G4XTRenergyLoss::*)(G4double)> integral;
|
||||
|
||||
|
||||
angleVector->PutValue(fBinTR-1,angleSum);
|
||||
|
||||
for( iTR = fBinTR - 2 ; iTR >= 0 ; iTR-- )
|
||||
{
|
||||
|
||||
angleSum += radiatorCof*fCofTR*integral.Legendre96(
|
||||
this,&G4XTRenergyLoss::AngleXTRdEdx,
|
||||
angleVector->GetLowEdgeEnergy(iTR),
|
||||
angleVector->GetLowEdgeEnergy(iTR+1) );
|
||||
|
||||
angleVector ->PutValue(iTR,angleSum);
|
||||
}
|
||||
G4cout
|
||||
// <<iTkin<<"\t"
|
||||
// <<"fGamma = "
|
||||
<<fGamma<<"\t" // <<" fMaxThetaTR = "<<fMaxThetaTR
|
||||
// <<"sumN = "<<energySum // <<" ; sumA = "
|
||||
<<angleSum
|
||||
<<G4endl;
|
||||
iPlace = iTkin;
|
||||
fAngleDistrTable->insertAt(iPlace,angleVector);
|
||||
}
|
||||
timer.Stop();
|
||||
G4cout.precision(6);
|
||||
G4cout<<G4endl;
|
||||
G4cout<<"total time for build X-ray TR angle tables = "
|
||||
<<timer.GetUserElapsed()<<" s"<<G4endl;
|
||||
fGamma = 0.;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -377,7 +699,7 @@ G4VParticleChange* G4XTRenergyLoss::PostStepDoIt( const G4Track& aTrack,
|
||||
const G4Step& aStep )
|
||||
{
|
||||
G4int iTkin, iPlace;
|
||||
G4double energyTR, theta, phi, dirX, dirY, dirZ;
|
||||
G4double energyTR, theta,theta2, phi, dirX, dirY, dirZ;
|
||||
|
||||
|
||||
fParticleChange.Initialize(aTrack);
|
||||
@@ -441,7 +763,14 @@ G4VParticleChange* G4XTRenergyLoss::PostStepDoIt( const G4Track& aTrack,
|
||||
{
|
||||
G4cout<<"energyTR = "<<energyTR/keV<<" keV"<<G4endl;
|
||||
}
|
||||
theta = fabs(G4RandGauss::shoot(0.0,pi/gamma));
|
||||
if (fAngleRadDistr)
|
||||
{
|
||||
// theta = fabs(G4RandGauss::shoot(0.0,pi/gamma));
|
||||
theta2 = GetRandomAngle(energyTR,iTkin);
|
||||
if(theta2 > 0.) theta = std::sqrt(theta2);
|
||||
else theta = theta2;
|
||||
}
|
||||
else theta = fabs(G4RandGauss::shoot(0.0,pi/gamma));
|
||||
|
||||
if( theta >= 0.1 ) theta = 0.1;
|
||||
|
||||
@@ -737,9 +1066,9 @@ G4complex G4XTRenergyLoss::OneInterfaceXTRdEdx( G4double energy,
|
||||
|
||||
G4double G4XTRenergyLoss::SpectralAngleXTRdEdx(G4double varAngle)
|
||||
{
|
||||
G4double result = GetStackFactor(fEnergy,fGamma,varAngle) ;
|
||||
if(result < 0.0) result = 0.0 ;
|
||||
return result ;
|
||||
G4double result = GetStackFactor(fEnergy,fGamma,varAngle);
|
||||
if(result < 0.0) result = 0.0;
|
||||
return result;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
@@ -748,18 +1077,40 @@ G4double G4XTRenergyLoss::SpectralAngleXTRdEdx(G4double varAngle)
|
||||
|
||||
G4double G4XTRenergyLoss::SpectralXTRdEdx(G4double energy)
|
||||
{
|
||||
fEnergy = energy ;
|
||||
G4Integrator<G4XTRenergyLoss,G4double(G4XTRenergyLoss::*)(G4double)> integral ;
|
||||
return integral.Legendre96(this,&G4XTRenergyLoss::SpectralAngleXTRdEdx,
|
||||
G4int i, iMax = 8;
|
||||
G4double result = 0.0;
|
||||
|
||||
G4double lim[8] = { 0.0, 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1.0 };
|
||||
|
||||
for( i = 0; i < iMax; i++ ) lim[i] *= fMaxThetaTR;
|
||||
|
||||
G4Integrator<G4XTRenergyLoss,G4double(G4XTRenergyLoss::*)(G4double)> integral;
|
||||
|
||||
fEnergy = energy;
|
||||
|
||||
for( i = 0; i < iMax-1; i++ )
|
||||
{
|
||||
result += integral.Legendre96(this,&G4XTRenergyLoss::SpectralAngleXTRdEdx,
|
||||
lim[i],lim[i+1]);
|
||||
// result += integral.Legendre10(this,&G4XTRenergyLoss::SpectralAngleXTRdEdx,
|
||||
// lim[i],lim[i+1]);
|
||||
}
|
||||
|
||||
/*
|
||||
result = integral.Legendre96(this,&G4XTRenergyLoss::SpectralAngleXTRdEdx,
|
||||
0.0,0.1*fMaxThetaTR) +
|
||||
integral.Legendre96(this,&G4XTRenergyLoss::SpectralAngleXTRdEdx,
|
||||
integral.Legendre96(this,&G4XTRenergyLoss::SpectralAngleXTRdEdx,
|
||||
0.1*fMaxThetaTR,0.2*fMaxThetaTR) +
|
||||
integral.Legendre96(this,&G4XTRenergyLoss::SpectralAngleXTRdEdx,
|
||||
integral.Legendre96(this,&G4XTRenergyLoss::SpectralAngleXTRdEdx,
|
||||
0.2*fMaxThetaTR,0.4*fMaxThetaTR) +
|
||||
integral.Legendre96(this,&G4XTRenergyLoss::SpectralAngleXTRdEdx,
|
||||
integral.Legendre96(this,&G4XTRenergyLoss::SpectralAngleXTRdEdx,
|
||||
0.4*fMaxThetaTR,0.7*fMaxThetaTR) +
|
||||
integral.Legendre96(this,&G4XTRenergyLoss::SpectralAngleXTRdEdx,
|
||||
0.7*fMaxThetaTR,fMaxThetaTR) ;
|
||||
integral.Legendre96(this,&G4XTRenergyLoss::SpectralAngleXTRdEdx,
|
||||
0.7*fMaxThetaTR,fMaxThetaTR);
|
||||
|
||||
*/
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -769,21 +1120,91 @@ G4Integrator<G4XTRenergyLoss,G4double(G4XTRenergyLoss::*)(G4double)> integral ;
|
||||
|
||||
G4double G4XTRenergyLoss::AngleSpectralXTRdEdx(G4double energy)
|
||||
{
|
||||
G4double result = GetStackFactor(energy,fGamma,fVarAngle) ;
|
||||
if(result < 0) result = 0.0 ;
|
||||
return result ;
|
||||
G4double result = GetStackFactor(energy,fGamma,fVarAngle);
|
||||
if(result < 0) result = 0.0;
|
||||
return result;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
// The XTR angular distribution based on transparent regular radiator
|
||||
|
||||
G4double G4XTRenergyLoss::AngleXTRdEdx(G4double varAngle)
|
||||
{
|
||||
fVarAngle = varAngle ;
|
||||
G4Integrator<G4XTRenergyLoss,G4double(G4XTRenergyLoss::*)(G4double)> integral ;
|
||||
return integral.Legendre10(this,&G4XTRenergyLoss::AngleSpectralXTRdEdx,
|
||||
fMinEnergyTR,fMaxEnergyTR) ;
|
||||
// G4cout<<"angle2 = "<<varAngle<<"; fGamma = "<<fGamma<<G4endl;
|
||||
|
||||
G4double result;
|
||||
G4double sum = 0., tmp1, tmp2, tmp=0., cof1, cof2, cofMin, cofPHC, energy1, energy2;
|
||||
G4int k, kMax, kMin, i;
|
||||
|
||||
cofPHC = twopi*hbarc;
|
||||
|
||||
cof1 = (fPlateThick + fGasThick)*(1./fGamma/fGamma + varAngle);
|
||||
cof2 = fPlateThick*fSigma1 + fGasThick*fSigma2;
|
||||
|
||||
// G4cout<<"cof1 = "<<cof1<<"; cof2 = "<<cof2<<"; cofPHC = "<<cofPHC<<G4endl;
|
||||
|
||||
cofMin = sqrt(cof1*cof2);
|
||||
cofMin /= cofPHC;
|
||||
|
||||
kMin = G4int(cofMin);
|
||||
if (cofMin > kMin) kMin++;
|
||||
|
||||
kMax = kMin + 9; // 9; // kMin + G4int(tmp);
|
||||
|
||||
// G4cout<<"cofMin = "<<cofMin<<"; kMin = "<<kMin<<"; kMax = "<<kMax<<G4endl;
|
||||
|
||||
for( k = kMin; k <= kMax; k++ )
|
||||
{
|
||||
tmp1 = cofPHC*k;
|
||||
tmp2 = sqrt(tmp1*tmp1-cof1*cof2);
|
||||
energy1 = (tmp1+tmp2)/cof1;
|
||||
energy2 = (tmp1-tmp2)/cof1;
|
||||
|
||||
for(i = 0; i < 2; i++)
|
||||
{
|
||||
if( i == 0 )
|
||||
{
|
||||
if (energy1 > fTheMaxEnergyTR || energy1 < fTheMinEnergyTR) continue;
|
||||
tmp1 = ( energy1*energy1*(1./fGamma/fGamma + varAngle) + fSigma1 )*fPlateThick/(4*hbarc*energy1);
|
||||
tmp2 = sin(tmp1);
|
||||
tmp = energy1*tmp2*tmp2;
|
||||
tmp2 = fPlateThick/(4*tmp1);
|
||||
tmp1 = hbarc*energy1/( energy1*energy1*(1./fGamma/fGamma + varAngle) + fSigma2 );
|
||||
tmp *= (tmp1-tmp2)*(tmp1-tmp2);
|
||||
tmp1 = cof1/(4*hbarc) - cof2/(4*hbarc*energy1*energy1);
|
||||
tmp2 = abs(tmp1);
|
||||
if(tmp2 > 0.) tmp /= tmp2;
|
||||
else continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (energy2 > fTheMaxEnergyTR || energy2 < fTheMinEnergyTR) continue;
|
||||
tmp1 = ( energy2*energy2*(1./fGamma/fGamma + varAngle) + fSigma1 )*fPlateThick/(4*hbarc*energy2);
|
||||
tmp2 = sin(tmp1);
|
||||
tmp = energy2*tmp2*tmp2;
|
||||
tmp2 = fPlateThick/(4*tmp1);
|
||||
tmp1 = hbarc*energy2/( energy2*energy2*(1./fGamma/fGamma + varAngle) + fSigma2 );
|
||||
tmp *= (tmp1-tmp2)*(tmp1-tmp2);
|
||||
tmp1 = cof1/(4*hbarc) - cof2/(4*hbarc*energy2*energy2);
|
||||
tmp2 = abs(tmp1);
|
||||
if(tmp2 > 0.) tmp /= tmp2;
|
||||
else continue;
|
||||
}
|
||||
sum += tmp;
|
||||
}
|
||||
// G4cout<<"k = "<<k<<"; energy1 = "<<energy1/keV<<" keV; energy2 = "<<energy2/keV
|
||||
// <<" keV; tmp = "<<tmp<<"; sum = "<<sum<<G4endl;
|
||||
}
|
||||
result = 4.*pi*fPlateNumber*sum*varAngle;
|
||||
result /= hbarc*hbarc;
|
||||
|
||||
// old code based on general numeric integration
|
||||
// fVarAngle = varAngle;
|
||||
// G4Integrator<G4XTRenergyLoss,G4double(G4XTRenergyLoss::*)(G4double)> integral;
|
||||
// result = integral.Legendre10(this,&G4XTRenergyLoss::AngleSpectralXTRdEdx,
|
||||
// fMinEnergyTR,fMaxEnergyTR);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -854,7 +1275,7 @@ void G4XTRenergyLoss::ComputePlatePhotoAbsCof()
|
||||
|
||||
fPlatePhotoAbsCof = new G4double*[fPlateIntervalNumber] ;
|
||||
|
||||
for(i=0;i<fPlateIntervalNumber;i++)
|
||||
for(i=0;i<=fPlateIntervalNumber;i++)
|
||||
{
|
||||
fPlatePhotoAbsCof[i] = new G4double[5] ;
|
||||
}
|
||||
@@ -971,7 +1392,7 @@ void G4XTRenergyLoss::ComputeGasPhotoAbsCof()
|
||||
|
||||
fGasPhotoAbsCof = new G4double*[fGasIntervalNumber] ;
|
||||
|
||||
for(i=0;i<fGasIntervalNumber;i++)
|
||||
for(i=0;i<=fGasIntervalNumber;i++)
|
||||
{
|
||||
fGasPhotoAbsCof[i] = new G4double[5] ;
|
||||
}
|
||||
@@ -1089,6 +1510,103 @@ void G4XTRenergyLoss::GetGasZmuProduct()
|
||||
return ;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Computes Compton cross section for plate material in 1/mm
|
||||
|
||||
G4double G4XTRenergyLoss::GetPlateCompton(G4double omega)
|
||||
{
|
||||
G4int i, numberOfElements;
|
||||
G4double xSection = 0., nowZ, sumZ = 0.;
|
||||
|
||||
static const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
|
||||
numberOfElements = (*theMaterialTable)[fMatIndex1]->GetNumberOfElements() ;
|
||||
|
||||
for( i = 0; i < numberOfElements; i++ )
|
||||
{
|
||||
nowZ = (*theMaterialTable)[fMatIndex1]->GetElement(i)->GetZ();
|
||||
sumZ += nowZ;
|
||||
xSection += GetComptonPerAtom(omega,nowZ); // *nowZ;
|
||||
}
|
||||
xSection /= sumZ;
|
||||
xSection *= (*theMaterialTable)[fMatIndex1]->GetElectronDensity();
|
||||
return xSection;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Computes Compton cross section for gas material in 1/mm
|
||||
|
||||
G4double G4XTRenergyLoss::GetGasCompton(G4double omega)
|
||||
{
|
||||
G4int i, numberOfElements;
|
||||
G4double xSection = 0., nowZ, sumZ = 0.;
|
||||
|
||||
static const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
|
||||
numberOfElements = (*theMaterialTable)[fMatIndex2]->GetNumberOfElements() ;
|
||||
|
||||
for( i = 0; i < numberOfElements; i++ )
|
||||
{
|
||||
nowZ = (*theMaterialTable)[fMatIndex2]->GetElement(i)->GetZ();
|
||||
sumZ += nowZ;
|
||||
xSection += GetComptonPerAtom(omega,nowZ); // *nowZ;
|
||||
}
|
||||
xSection /= sumZ;
|
||||
xSection *= (*theMaterialTable)[fMatIndex2]->GetElectronDensity();
|
||||
return xSection;
|
||||
}
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Computes Compton cross section per atom with Z electrons for gamma with
|
||||
// the energy GammaEnergy
|
||||
|
||||
G4double G4XTRenergyLoss::GetComptonPerAtom(G4double GammaEnergy, G4double Z)
|
||||
{
|
||||
G4double CrossSection = 0.0 ;
|
||||
if ( Z < 0.9999 ) return CrossSection;
|
||||
if ( GammaEnergy < 0.1*keV ) return CrossSection;
|
||||
if ( GammaEnergy > (100.*GeV/Z) ) return CrossSection;
|
||||
|
||||
static const G4double a = 20.0 , b = 230.0 , c = 440.0;
|
||||
|
||||
static const G4double
|
||||
d1= 2.7965e-1*barn, d2=-1.8300e-1*barn, d3= 6.7527 *barn, d4=-1.9798e+1*barn,
|
||||
e1= 1.9756e-5*barn, e2=-1.0205e-2*barn, e3=-7.3913e-2*barn, e4= 2.7079e-2*barn,
|
||||
f1=-3.9178e-7*barn, f2= 6.8241e-5*barn, f3= 6.0480e-5*barn, f4= 3.0274e-4*barn;
|
||||
|
||||
G4double p1Z = Z*(d1 + e1*Z + f1*Z*Z), p2Z = Z*(d2 + e2*Z + f2*Z*Z),
|
||||
p3Z = Z*(d3 + e3*Z + f3*Z*Z), p4Z = Z*(d4 + e4*Z + f4*Z*Z);
|
||||
|
||||
G4double T0 = 15.0*keV;
|
||||
if (Z < 1.5) T0 = 40.0*keV;
|
||||
|
||||
G4double X = max(GammaEnergy, T0) / electron_mass_c2;
|
||||
CrossSection = p1Z*std::log(1.+2.*X)/X
|
||||
+ (p2Z + p3Z*X + p4Z*X*X)/(1. + a*X + b*X*X + c*X*X*X);
|
||||
|
||||
// modification for low energy. (special case for Hydrogen)
|
||||
|
||||
if (GammaEnergy < T0)
|
||||
{
|
||||
G4double dT0 = 1.*keV;
|
||||
X = (T0+dT0) / electron_mass_c2 ;
|
||||
G4double sigma = p1Z*log(1.+2*X)/X
|
||||
+ (p2Z + p3Z*X + p4Z*X*X)/(1. + a*X + b*X*X + c*X*X*X);
|
||||
G4double c1 = -T0*(sigma-CrossSection)/(CrossSection*dT0);
|
||||
G4double c2 = 0.150;
|
||||
if (Z > 1.5) c2 = 0.375-0.0556*log(Z);
|
||||
G4double y = log(GammaEnergy/T0);
|
||||
CrossSection *= exp(-y*(c1+c2*y));
|
||||
}
|
||||
// G4cout << "e= " << GammaEnergy << " Z= " << Z << " cross= " << CrossSection << G4endl;
|
||||
return CrossSection;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// This function returns the spectral and angle density of TR quanta
|
||||
@@ -1290,6 +1808,70 @@ G4double G4XTRenergyLoss::GetXTRenergy( G4int iPlace,
|
||||
return result ;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Get XTR photon angle at given energy and Tkin
|
||||
|
||||
G4double G4XTRenergyLoss::GetRandomAngle( G4double energyXTR, G4int iTkin )
|
||||
{
|
||||
G4int iTR, iAngle;
|
||||
G4double position, angle;
|
||||
|
||||
if (iTkin == fTotBin) iTkin--;
|
||||
|
||||
fAngleForEnergyTable = fAngleBank[iTkin];
|
||||
|
||||
for( iTR = 0; iTR < fBinTR; iTR++ )
|
||||
{
|
||||
if( energyXTR < fXTREnergyVector->GetLowEdgeEnergy(iTR) ) break;
|
||||
}
|
||||
if (iTR == fBinTR) iTR--;
|
||||
|
||||
position = (*(*fAngleForEnergyTable)(iTR))(0)*G4UniformRand() ;
|
||||
|
||||
for(iAngle = 0;;iAngle++)
|
||||
{
|
||||
if(position >= (*(*fAngleForEnergyTable)(iTR))(iAngle)) break ;
|
||||
}
|
||||
angle = GetAngleXTR(iTR,position,iAngle);
|
||||
return angle;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Returns approximate position of X-ray photon angle at given energy during random sampling
|
||||
// over integral energy distribution
|
||||
|
||||
G4double G4XTRenergyLoss::GetAngleXTR( G4int iPlace,
|
||||
G4double position,
|
||||
G4int iTransfer )
|
||||
{
|
||||
G4double x1, x2, y1, y2, result ;
|
||||
|
||||
if(iTransfer == 0)
|
||||
{
|
||||
result = (*fAngleForEnergyTable)(iPlace)->GetLowEdgeEnergy(iTransfer) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
y1 = (*(*fAngleForEnergyTable)(iPlace))(iTransfer-1) ;
|
||||
y2 = (*(*fAngleForEnergyTable)(iPlace))(iTransfer) ;
|
||||
|
||||
x1 = (*fAngleForEnergyTable)(iPlace)->GetLowEdgeEnergy(iTransfer-1) ;
|
||||
x2 = (*fAngleForEnergyTable)(iPlace)->GetLowEdgeEnergy(iTransfer) ;
|
||||
|
||||
if ( x1 == x2 ) result = x2 ;
|
||||
else
|
||||
{
|
||||
if ( y1 == y2 ) result = x1 + (x2 - x1)*G4UniformRand() ;
|
||||
else
|
||||
{
|
||||
result = x1 + (position - y1)*(x2 - x1)/(y2 - y1) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result ;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
|
||||
@@ -1,23 +1,26 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * 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. *
|
||||
// * 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 intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
@@ -53,7 +56,7 @@ G4XTRGammaRadModel::G4XTRGammaRadModel(G4LogicalVolume* anEnvelope,
|
||||
fAlphaGas = alphaGas ;
|
||||
G4cout<<"fAlphaPlate = "<<fAlphaPlate<<" ; fAlphaGas = "<<fAlphaGas<<G4endl ;
|
||||
fExitFlux = true;
|
||||
BuildTable() ;
|
||||
// BuildTable() ;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -1,23 +1,26 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * 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. *
|
||||
// * 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 intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
@@ -47,7 +50,7 @@ G4XTRRegularRadModel::G4XTRRegularRadModel(G4LogicalVolume *anEnvelope,
|
||||
// Build energy and angular integral spectra of X-ray TR photons from
|
||||
// a radiator
|
||||
|
||||
BuildTable() ;
|
||||
// BuildTable() ;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -1,23 +1,26 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * 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. *
|
||||
// * 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 intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
@@ -49,7 +52,7 @@ G4XTRTransparentRegRadModel::G4XTRTransparentRegRadModel(G4LogicalVolume *anEnve
|
||||
fAlphaPlate = 10000;
|
||||
fAlphaGas = 1000;
|
||||
|
||||
BuildTable();
|
||||
// BuildTable();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
@@ -68,8 +71,17 @@ G4double G4XTRTransparentRegRadModel::SpectralXTRdEdx(G4double energy)
|
||||
G4double result, sum = 0., tmp, cof1, cof2, cofMin, cofPHC,aMa, bMb, sigma;
|
||||
G4int k, kMax, kMin;
|
||||
|
||||
aMa = fPlateThick*GetPlateLinearPhotoAbs(energy);
|
||||
bMb = fGasThick*GetGasLinearPhotoAbs(energy);
|
||||
aMa = GetPlateLinearPhotoAbs(energy);
|
||||
bMb = GetGasLinearPhotoAbs(energy);
|
||||
|
||||
if(fCompton)
|
||||
{
|
||||
aMa += GetPlateCompton(energy);
|
||||
bMb += GetGasCompton(energy);
|
||||
}
|
||||
aMa *= fPlateThick;
|
||||
bMb *= fGasThick;
|
||||
|
||||
sigma = aMa + bMb;
|
||||
|
||||
cofPHC = 4*pi*hbarc;
|
||||
@@ -95,7 +107,7 @@ G4double G4XTRTransparentRegRadModel::SpectralXTRdEdx(G4double energy)
|
||||
// kMax += kMin;
|
||||
|
||||
|
||||
kMax = kMin + 19; // 9; // kMin + G4int(tmp);
|
||||
kMax = kMin + 19; // 5; // 9; // kMin + G4int(tmp);
|
||||
|
||||
// tmp /= fGamma;
|
||||
// if( G4int(tmp) < kMin ) kMin = G4int(tmp);
|
||||
|
||||
Reference in New Issue
Block a user