source: trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4VQCrossSection.cc @ 1055

Last change on this file since 1055 was 1055, checked in by garnier, 15 years ago

maj sur la beta de geant 4.9.3

File size: 5.2 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//
27// $Id: G4VQCrossSection.cc,v 1.16 2009/03/09 15:41:17 mkossov Exp $
28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
29//
30//
31// CHIPS virtual class: G4VQCrossSection for the collision cross sections
32// Created: M.V. Kossov, CERN/ITEP(Moscow), 10-OCT-04
33// The last update: M.V. Kossov, CERN/ITEP (Moscow) 27-Nov-04
34//
35//=========================================================================================
36// ****************************************************************************************
37// ********** This CLASS is temporary moved from the photolepton_hadron directory *********
38// ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ******
39// ****************************************************************************************
40// Short description: a basic class for all CHIPS reaction cross-sections.
41// -----------------------------------------------------------------------
42
43//#define debug
44#define edebug
45//#define pdebug
46//#define ppdebug
47//#define tdebug
48//#define sdebug
49
50#include "G4VQCrossSection.hh"
51
52// Initialization of the
53G4double  G4VQCrossSection::tolerance=.001;   // The relative tolarence for the same CrSec
54
55// Gives the threshold energy for different isotopes (can be improved in the derived class)
56G4double G4VQCrossSection::ThresholdEnergy(G4int , G4int, G4int) {return 0.;} // Fake use
57
58G4double G4VQCrossSection::GetDirectPart(G4double) {return 0.;} // Direct interaction
59
60G4double G4VQCrossSection::GetNPartons(G4double) {return 3.;} // Direct interaction
61
62G4double G4VQCrossSection::GetLastTOTCS() {return 0.;} // Get the last total CS
63
64G4double G4VQCrossSection::GetLastQELCS() {return 0.;} // Get the last quasi-elast CS
65
66G4double G4VQCrossSection::GetExchangeEnergy() {return 0.;}
67
68G4double G4VQCrossSection::GetExchangeQ2(G4double) {return 0.;}
69
70G4double G4VQCrossSection::GetSlope(G4int,G4int,G4int) {return 0.;}
71
72G4double G4VQCrossSection::GetExchangeT(G4int,G4int,G4int) {return 0.;}
73
74G4double G4VQCrossSection::GetHMaxT() {return 0.;}
75
76G4double G4VQCrossSection::GetQEL_ExchangeQ2() {return 0.;}
77
78G4double G4VQCrossSection::GetNQE_ExchangeQ2() {return 0.;}
79
80G4int G4VQCrossSection::GetExchangePDGCode() {return 0;}
81
82G4double G4VQCrossSection::GetVirtualFactor(G4double nu, G4double Q2) {return 0.*nu*Q2;}
83
84// This function finds  the linear approximation Y-point for the XN(N), YN(N) table
85G4double G4VQCrossSection::LinearFit(G4double X, G4int N, G4double* XN, G4double* YN)
86{
87  G4double Xj=XN[0];
88  G4double Xh=XN[N-1];
89  if(X<=Xj) return YN[0]; 
90  else if(X>=Xh) return YN[N-1];
91  G4double Xp=0.; G4int j=0; while (X>Xj && j<N) {j++; Xp=Xj; Xj=XN[j];}
92  return YN[j]-(Xj-X)*(YN[j]-YN[j-1])/(Xj-Xp);
93}
94
95// This function finds the linear approximation Y-point for equidistant bins: XI=X0+I*DX
96G4double G4VQCrossSection::EquLinearFit(G4double X, G4int N, G4double X0, G4double DX,
97                                        G4double* Y)
98{
99#ifdef pdebug
100  G4cout<<"G4VQCrossSection::EquLinearFit: ***Called*** X="<<X<<", N="<<N<<", X0="<<X0
101        <<", DX="<<DX<<G4endl;
102  G4cout<<"G4VQCrossSection::EquLinearFit: Y[0]="<<Y[0]<<", Y[N-1]="<<Y[N-1]<<G4endl;
103  //for(G4int i=1; i<N; i++)G4cout<<"-----G4VQCS::EquLinearFit: Y["<<i<<"]="<<Y[i]<<G4endl;
104#endif
105  if(DX<=0. || N<2)
106  {
107    G4cerr<<"***G4VQCrossSection::EquLinearFit: DX="<<DX<<", N="<<N<<G4endl;
108    return Y[0];
109  }
110  G4int    N2=N-2;
111  G4double d=(X-X0)/DX;
112  G4int         j=static_cast<int>(d);
113  if     (j<0)  j=0;
114  else if(j>N2) j=N2;
115  d-=j; // excess
116  G4double yi=Y[j];
117  G4double sigma=yi+(Y[j+1]-yi)*d;
118#ifdef pdebug
119  G4cout<<"G4VQCrossSection::EquLinearFit: CS="<<sigma<<G4endl;
120#endif
121  return sigma;
122}
Note: See TracBrowser for help on using the repository browser.