// // ******************************************************************** // * 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: G4VCrossSection.hh,v 1.1 2009-11-16 18:15:42 mkossov Exp $ // GEANT4 tag $Name: not supported by cvs2svn $ // // // GEANT4 virtual class: G4VCrossSection -- header file // M.V. Kossov, CERN-ITEP(Moscow), 4-FEB-2004 // The last update: M.V. Kossov, CERN/ITEP (Moscow) 27-Nov-04 // // This class has been extracted from the CHIPS model. // All the dependencies on CHIPS classes have been removed. // // Original description by M.K. follows. // Short description: this G4 virtual class is made for the cross section // classes of the CHIPS model, which calculate the cross section for the // particular Element (virtual GetCrossSection member function). Each of the // CHIPS cross section classes creates its own Dynamic Associative Memory // Data Base (DAMDB) for the already used isotopes. For all of them thay use the // same algorithm. Common member functions of this algorithm can be in this // basic virtual class. Any CHIPS cross section class MUST inherit from this virtual // G4VCrossSection class. In the G4QCollision class the general G4VCrossSection* // pointer is connected to this or that CHIPS cross section class (depending on the // projectile particle), so each of the CHIPS cross section class must be // an evolving singletone. The singletone nature can not be realized in the // virtual class. So each derived CS class must have // static G4VCrossSection* GetPointer(); // Gives a pointer to the singletone // static function, which is defined in the *.cc file as // // Returns Pointer to the G4VCrossSection class // G4VCrossSection* G4VCrossSection::GetPointer() // { // static G4QXCrossSection theCrossSection; //***Static body of the Cross Section*** // return &theCrossSection; // } // the line // //virtual static G4VCrossSection* GetPointer(); // Gives a pointer to the singletone // Reminds about this necesity, but in C++ the virtual static function can not be // realised, so the static function can not be realised in the interface. Developers // must take care of this themselves because this member fuction is called to get a pointer // to the singletone in the G4QCollision class. So there is an agreement to // make a separate CS class for each projectile particle, e.g. while the (pi-)d // and (pi+)d (as well as [n,z] and [z,n]) cross sections) are almost equal, // they must be calculated in different classes: G4QPiMinusCrossSection and // G4QPiPlusCrossSections. For the ion-nuclear cross sections there should exist only // one G4QIonCrossSection class with a huge (#0f isotopes times #of already produced // ions) DAMDB or a general analitic formula with parameters. --- December 2004 --- // ----------------------------------------------------------------------- // At present (25.11.04) for the test purposes this virtual class is created // for ohly G4QPhotonCrossSection, G4QElectronCrossSection, G4QMuonCrossSection, // G4QTauCrossSection and G4QProtonCrossSection (only for pp collisions now). // ----------------------------------------------------------------------- #ifndef G4VCrossSection_h #define G4VCrossSection_h 1 #include "G4ParticleTable.hh" #include "G4NucleiProperties.hh" #include #include "Randomize.hh" class G4VCrossSection { protected: G4VCrossSection() {;} // for each particle a separate instance of G4QCollision should be // used (and inside use a separate instance of G4Q*CrossSection) public: virtual ~G4VCrossSection() {;}// for each particle separate instance of G4QXCrossSection //@@ can be improved in future)// should be used and inside a separate istance of CS's // Set the new tolerance (abs(p_old/p_new-1)MP it means that the cross section is defined for all energies above // TH. All parameters and pointers to arrays MUST be stored (F=0), updated (F=1) and // retrieved (F=-1) by the derived class in the CalculateCrossSection(F,I,N,Z,P) // function. The parameters are used for the immediate result: if the cross section is // calculated for the same Z, N, and fabs(p-lastP)/lastP<.001 (? - a parameter), the same // cross section (lastCS) is returned, if p