source: trunk/source/processes/electromagnetic/highenergy/src/G4eeToHadronsMultiModel.cc @ 836

Last change on this file since 836 was 819, checked in by garnier, 16 years ago

import all except CVS

File size: 4.7 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26// $Id: G4eeToHadronsMultiModel.cc,v 1.4 2007/05/23 08:50:41 vnivanch Exp $
27// GEANT4 tag $Name:  $
28//
29// -------------------------------------------------------------------
30//
31// GEANT4 Class file
32//
33//
34// File name:     G4eeToHadronsMultiModel
35//
36// Author:        Vladimir Ivanchenko on base of Michel Maire code
37//
38// Creation date: 02.08.2004
39//
40// Modifications:
41// 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivantchenko)
42// 08-04-05 Major optimisation of internal interfaces (V.Ivantchenko)
43//
44
45//
46// -------------------------------------------------------------------
47//
48//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
49//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
50
51#include "G4eeToHadronsMultiModel.hh"
52#include "G4eeToTwoPiModel.hh"
53#include "G4eeCrossSections.hh"
54
55//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
56
57using namespace std;
58
59G4eeToHadronsMultiModel::G4eeToHadronsMultiModel(G4int ver, const G4String& name)
60  : G4VEmModel(name),
61    csFactor(1.0),
62    nModels(0),
63    verbose(ver),
64    isInitialised(false)
65{}
66
67//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
68
69G4eeToHadronsMultiModel::~G4eeToHadronsMultiModel()
70{
71  G4int n = models.size();
72  if(n>0) {
73    for(G4int i=0; i<n; i++) {
74      delete models[i];
75    }
76  }
77  delete cross;
78}
79
80//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
81
82void G4eeToHadronsMultiModel::Initialise(const G4ParticleDefinition* p, const G4DataVector& v)
83{
84  if(!isInitialised) {
85    isInitialised = true;
86
87    thKineticEnergy = DBL_MAX;
88    maxKineticEnergy = HighEnergyLimit();
89
90    cross = new G4eeCrossSections();
91    G4eeToHadronsModel* model = 
92      new G4eeToHadronsModel(new G4eeToTwoPiModel(cross), verbose);
93    models.push_back(model);
94    model->SetHighEnergyLimit(maxKineticEnergy);
95    model->Initialise(p, v);
96    G4double emin = model->LowEnergyLimit();
97    if(emin < thKineticEnergy) thKineticEnergy = emin;
98    ekinMin.push_back(emin);
99    ekinMax.push_back(model->HighEnergyLimit());
100    ekinPeak.push_back(model->PeakEnergy());
101    cumSum.push_back(0.0);
102    nModels = 1;
103
104    if(pParticleChange)
105      fParticleChange =
106        reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange);
107    else
108      fParticleChange = new G4ParticleChangeForGamma();
109  }
110}
111
112//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
113
114void G4eeToHadronsMultiModel::PrintInfo()
115{
116  if(verbose > 0) {
117    G4cout << "      e+ annihilation into hadrons active above "
118           << thKineticEnergy/GeV << " GeV"
119           << G4endl;
120  }
121}
122
123//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
124
125void G4eeToHadronsMultiModel::SetCrossSecFactor(G4double fac)
126{
127  if(fac > 1.0) {
128    csFactor = fac;
129    if(verbose > 0)
130      G4cout << "### G4eeToHadronsMultiModel: The cross section for G4eeToHadronsMultiModel is  "
131             << "increased by the Factor= " << csFactor << G4endl;
132  }
133}
134
135//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Note: See TracBrowser for help on using the repository browser.