Import Geant4 7.0.0 source tree
This commit is contained in:
@@ -0,0 +1,123 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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 *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4eeToTwoPiModel.cc,v 1.2 2004/12/01 18:13:44 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// GEANT4 Class header file
|
||||
//
|
||||
//
|
||||
// File name: G4eeToTwoPiModel
|
||||
//
|
||||
// Author: Vladimir Ivanchenko
|
||||
//
|
||||
// Creation date: 25.10.2003
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "G4eeToTwoPiModel.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4PionPlus.hh"
|
||||
#include "G4PionMinus.hh"
|
||||
#include "G4DynamicParticle.hh"
|
||||
#include "G4PhysicsVector.hh"
|
||||
#include "G4PhysicsLinearVector.hh"
|
||||
#include "G4eeCrossSections.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
using namespace std;
|
||||
|
||||
G4eeToTwoPiModel::G4eeToTwoPiModel(G4eeCrossSections* cr):
|
||||
cross(cr)
|
||||
{
|
||||
Initialise();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4eeToTwoPiModel::~G4eeToTwoPiModel()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4eeToTwoPiModel::Initialise()
|
||||
{
|
||||
massPi = G4PionPlus::PionPlus()->GetPDGMass();
|
||||
massRho = 770.*MeV;
|
||||
highEnergy = 1.*GeV;
|
||||
cross = new G4eeCrossSections();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4PhysicsVector* G4eeToTwoPiModel::PhysicsVector(G4double emin,
|
||||
G4double emax) const
|
||||
{
|
||||
G4double tmin = max(emin, 2.0*massPi);
|
||||
G4double tmax = max(tmin, emax);
|
||||
G4int nbins = (G4int)((tmax - tmin)/MeV);
|
||||
G4PhysicsVector* v = new G4PhysicsLinearVector(emin,emax,nbins);
|
||||
return v;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
vector<G4DynamicParticle*>* G4eeToTwoPiModel::SampleSecondaries(
|
||||
G4double e, const G4ThreeVector& direction) const
|
||||
{
|
||||
vector<G4DynamicParticle*>* newp = new vector<G4DynamicParticle*>;
|
||||
G4double tkin = 0.5*e - massPi;
|
||||
if(tkin < 0.0) tkin = 0.0;
|
||||
G4double cost;
|
||||
do {
|
||||
cost = 2.0*G4UniformRand() - 1.0;
|
||||
} while( G4UniformRand() > 1.0 - cost*cost );
|
||||
|
||||
G4double sint = sqrt(1.0 - cost*cost);
|
||||
G4double phi = twopi * G4UniformRand();
|
||||
|
||||
G4ThreeVector dir(sint*cos(phi),sint*sin(phi), cost);
|
||||
dir.rotateUz(direction);
|
||||
|
||||
// create G4DynamicParticle object for delta ray
|
||||
G4DynamicParticle* pip =
|
||||
new G4DynamicParticle(G4PionPlus::PionPlus(),dir,tkin);
|
||||
G4DynamicParticle* pin =
|
||||
new G4DynamicParticle(G4PionMinus::PionMinus(),-dir,tkin);
|
||||
newp->push_back(pip);
|
||||
newp->push_back(pin);
|
||||
return newp;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
Reference in New Issue
Block a user