00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id$ 00028 // 00029 // 00030 // ------------------------------------------------------------ 00031 // GEANT 4 class header file 00032 // 00033 // History: first implementation, based on object model of 00034 // 12 Dec 1997 H.Kurashige 00035 // 00036 // Use std::vector 4 Apr. 2012 H.Kurashige 00037 // ------------------------------------------------------------ 00038 00039 #ifndef G4DecayProducts_h 00040 #define G4DecayProducts_h 1 00041 00042 #include "G4ios.hh" 00043 #include "globals.hh" 00044 #include "G4DynamicParticle.hh" 00045 #include <vector> 00046 00047 class G4DecayProducts 00048 { 00049 public: // With Description 00050 00051 // constructors 00052 G4DecayProducts(); 00053 G4DecayProducts(const G4DynamicParticle &aParticle); 00054 00055 public: 00056 // copy constructor and assignment operator 00057 // Deep copy: for G4DynamicParticle pointer 00058 G4DecayProducts(const G4DecayProducts &right); 00059 G4DecayProducts & operator=(const G4DecayProducts &right); 00060 00061 //destructor 00062 ~G4DecayProducts(); 00063 00064 // (un)equal operator 00065 G4int operator==(const G4DecayProducts &right) const; 00066 G4int operator!=(const G4DecayProducts &right) const; 00067 00068 public: // With Description 00069 // set-get methods for the parent particle 00070 // theParentPaticle is used to get information of parent particle 00071 // when decay products are filled 00072 // new G4DynamicParticle object is created in set methods 00073 const G4DynamicParticle* GetParentParticle() const {return theParentParticle;}; 00074 void SetParentParticle(const G4DynamicParticle &aParticle); 00075 00076 // boost all products 00077 void Boost(G4double totalEnergy, const G4ThreeVector &momentumDirection); 00078 void Boost(G4double betax, G4double betay, G4double betaz); 00079 00080 // push-pop methods for decay products pointer 00081 G4DynamicParticle* PopProducts(); 00082 G4int PushProducts(G4DynamicParticle *aParticle); 00083 00084 G4DynamicParticle* operator[](G4int anIndex) const; 00085 00086 G4int entries() const {return numberOfProducts;}; 00087 00088 // check energy/momentum of products 00089 G4bool IsChecked() const; 00090 00091 // 00092 void DumpInfo() const; 00093 00094 typedef std::vector<G4DynamicParticle*> G4DecayProductVector; 00095 protected: 00096 enum {MaxNumberOfProducts = 64}; 00097 00098 private: 00099 G4int numberOfProducts; 00100 G4DynamicParticle* theParentParticle; 00101 G4DecayProductVector* theProductVector; 00102 00103 }; 00104 00105 // ------------------------ 00106 // Inlined operators 00107 // ------------------------ 00108 00109 inline 00110 G4int G4DecayProducts::operator==(const G4DecayProducts &right) const 00111 { 00112 return (this == (G4DecayProducts *) &right); 00113 } 00114 00115 inline 00116 G4int G4DecayProducts::operator!=(const G4DecayProducts &right) const 00117 { 00118 return (this != (G4DecayProducts *) &right); 00119 } 00120 00121 #endif 00122