G4NeutronHPChannel.hh

Go to the documentation of this file.
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  // Hadronic Process: Very Low Energy Neutron X-Sections
00030  // original by H.P. Wellisch, TRIUMF, 14-Feb-97
00031  // Builds and has the Cross-section data for one element and channel.
00032 //
00033 // Bug fixes and workarounds in the destructor, F.W.Jones 06-Jul-1999
00034 // 070612 Fix memory leaking by T. Koi
00035 //
00036 // 080520 Delete unnecessary dependencies by T. Koi
00037  
00038 #ifndef G4NeutronHPChannel_h
00039 #define G4NeutronHPChannel_h 1
00040 #include "globals.hh"
00041 #include "G4NeutronHPIsoData.hh"
00042 #include "G4NeutronHPVector.hh"
00043 #include "G4Material.hh"
00044 #include "G4HadProjectile.hh"
00045 //#include "G4NeutronInelasticProcess.hh"
00046 //#include "G4HadronFissionProcess.hh"
00047 //#include "G4HadronElasticProcess.hh"
00048 //#include "G4HadronCaptureProcess.hh"
00049 #include "G4StableIsotopes.hh"
00050 #include "G4NeutronHPCaptureFS.hh"
00051 #include "G4NeutronHPFinalState.hh"
00052 #include "G4Element.hh"
00053 
00054 class G4NeutronHPChannel
00055 {
00056 public:
00057 
00058   G4NeutronHPChannel()
00059   {
00060     theChannelData = new G4NeutronHPVector; 
00061     theBuffer = 0;
00062     theIsotopeWiseData = 0;
00063     theFinalStates = 0;
00064     active = 0;
00065     registerCount = -1;
00066   }
00067   
00068   ~G4NeutronHPChannel()
00069   {
00070     delete theChannelData; 
00071     // Following statement disabled to avoid SEGV
00072     // theBuffer is also deleted as "theChannelData" in
00073     // ~G4NeutronHPIsoData.  FWJ 06-Jul-1999
00074     //if(theBuffer != 0) delete theBuffer; 
00075     if(theIsotopeWiseData != 0) delete [] theIsotopeWiseData;
00076     // Deletion of FinalStates disabled to avoid endless looping
00077     // in the destructor heirarchy.  FWJ 06-Jul-1999
00078     //if(theFinalStates != 0)
00079     //{
00080     //  for(i=0; i<niso; i++)
00081     //  {
00082     //    delete theFinalStates[i];
00083     //  }
00084     //  delete [] theFinalStates;
00085     //}
00086     // FWJ experiment
00087     //if(active!=0) delete [] active;
00088 // T.K. 
00089    if ( theFinalStates != 0 )
00090    {
00091       for ( G4int i = 0 ; i < niso ; i++ )
00092       {
00093          delete theFinalStates[i];
00094       }
00095       delete [] theFinalStates;
00096    }
00097    if ( active != 0 ) delete [] active;
00098     
00099   }
00100   
00101   G4double GetXsec(G4double energy);
00102   
00103   G4double GetWeightedXsec(G4double energy, G4int isoNumber);
00104   
00105   G4double GetFSCrossSection(G4double energy, G4int isoNumber);
00106   
00107   inline G4bool IsActive(G4int isoNumber) { return active[isoNumber]; }
00108   
00109   inline G4bool HasFSData(G4int isoNumber) { return theFinalStates[isoNumber]->HasFSData(); }
00110   
00111   inline G4bool HasAnyData(G4int isoNumber) { return theFinalStates[isoNumber]->HasAnyData(); }
00112   
00113   G4bool Register(G4NeutronHPFinalState *theFS);
00114   
00115   void Init(G4Element * theElement, const G4String dirName); 
00116 
00117   void Init(G4Element * theElement, const G4String dirName, const G4String fsType); 
00118   
00119   //void UpdateData(G4int A, G4int Z, G4int index, G4double abundance);
00120   void UpdateData(G4int A, G4int Z, G4int index, G4double abundance) { G4int M = 0; UpdateData( A, Z, M, index, abundance); };
00121   void UpdateData(G4int A, G4int Z, G4int M, G4int index, G4double abundance);
00122   
00123   void Harmonise(G4NeutronHPVector *& theStore, G4NeutronHPVector * theNew);
00124 
00125   G4HadFinalState * ApplyYourself(const G4HadProjectile & theTrack, G4int isoNumber=-1);
00126     
00127   inline G4int GetNiso() {return niso;}
00128   
00129   inline G4double GetN(G4int i) {return theFinalStates[i]->GetN();}
00130   inline G4double GetZ(G4int i) {return theFinalStates[i]->GetZ();}
00131   
00132   inline G4bool HasDataInAnyFinalState()
00133   {
00134     G4bool result = false;
00135     G4int i;
00136     for(i=0; i<niso; i++)
00137     {
00138       if(theFinalStates[i]->HasAnyData()) result = true;
00139     }
00140     return result;
00141   }
00142   
00143 private:
00144   G4NeutronHPVector * theChannelData;  // total (element) cross-section for this channel
00145   G4NeutronHPVector * theBuffer;
00146   
00147   G4NeutronHPIsoData * theIsotopeWiseData; // these are the isotope-wise cross-sections for each final state.
00148   G4NeutronHPFinalState ** theFinalStates; // also these are isotope-wise pionters, parallel to the above.
00149   G4bool * active;
00150   G4int niso;
00151 
00152   G4StableIsotopes theStableOnes;
00153   
00154   G4String theDir;
00155   G4String theFSType;
00156   G4Element * theElement;
00157   
00158   G4int registerCount;
00159     
00160 };
00161 
00162 #endif

Generated on Mon May 27 17:48:59 2013 for Geant4 by  doxygen 1.4.7