G4LENDUsedTarget.cc

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 // Class Description
00027 // Container of LEND (Low Energy Nuclear Data) target (nucleus) 
00028 // LEND is Geant4 interface for GIDI (General Interaction Data Interface) 
00029 // which gives a discription of nuclear and atomic reactions, such as
00030 //    Binary collision cross sections
00031 //    Particle number multiplicity distributions of reaction products
00032 //    Energy and angular distributions of reaction products
00033 //    Derived calculational constants
00034 // GIDI is developped at Lawrence Livermore National Laboratory
00035 // Class Description - End
00036 
00037 // 071025 First implementation done by T. Koi (SLAC/SCCS)
00038 // 101118 Name modifications for release T. Koi (SLAC/PPA)
00039 
00040 #include "G4LENDUsedTarget.hh"
00041 #include "G4LENDManager.hh"
00042 
00043 void G4LENDUsedTarget::searchTarget()
00044 {
00045 
00046    G4LENDManager* lend_manager = G4LENDManager::GetInstance();
00047 
00048    target = NULL;
00049    target = lend_manager->GetLENDTarget( proj , wanted_Evaluation , wanted_Z , wanted_A , wanted_M );
00050 
00051    if ( target != NULL ) 
00052    {
00053       actual_Z = wanted_Z;
00054       actual_A = wanted_A;
00055       actual_M = wanted_M;
00056       actual_Evaluation = wanted_Evaluation; 
00057 
00058       return;
00059    }
00060 
00061    if ( allow_nat == true || allow_anything == true ) 
00062    {
00063       target = lend_manager->GetLENDTarget( proj , wanted_Evaluation , wanted_Z , 0 , wanted_M );
00064       if ( target != NULL ) 
00065       {
00066          actual_Z = wanted_Z;
00067          actual_A = 0;
00068          actual_M = wanted_M;
00069          actual_Evaluation = wanted_Evaluation; 
00070 
00071          return;  
00072       }
00073    }
00074 
00075    G4int iZ;
00076    G4int iA;
00077    G4int iM;
00078 
00079    if ( allow_anything == true ) 
00080    {
00081 
00082       // Loop Z
00083       G4int dZ = 0;
00084       G4int pZ = 1;
00085       while ( dZ < max_Z - min_Z )
00086       {
00087          iZ = wanted_Z + pZ*dZ; 
00088 
00089          // Loop A
00090          G4int dA = 0;
00091          G4int pA = 1;
00092          while ( dA < max_A - min_A )
00093          {
00094             iA = wanted_A + pA*dA; 
00095 
00096             // Loop M
00097             G4int pM = 1;
00098             G4int dM = 0;
00099             while ( dM < max_M - min_M )
00100             {
00101 
00102                iM = wanted_M + pM*dM;
00103 
00104                if ( iZ < min_Z ) iZ = min_Z;
00105                if ( iA < min_A ) iA = 0;
00106                if ( iM < min_M ) iM = min_M;
00107 
00108                if ( iZ > max_Z ) iZ = max_Z;
00109                if ( iA > max_A ) iA = max_A;
00110                if ( iM > max_M ) iM = max_M;
00111 
00112                //Loop Evaluations choice the first available
00113 
00114                if ( lend_manager->IsLENDTargetAvailable( proj , iZ , iA , iM ).size() > 0 ) 
00115                {
00116                   //Choice the first available
00117                   actual_Evaluation = lend_manager->IsLENDTargetAvailable( proj , iZ , iA , iM ).front();
00118          
00119                   actual_Z = iZ;
00120                   actual_A = iA;
00121                   actual_M = iM;
00122                   target = lend_manager->GetLENDTarget( proj , actual_Evaluation , iZ , iA , iM ); 
00123                   return;
00124                }
00125 
00126                if ( pM > 0 )  
00127                   pM = -1; 
00128                else
00129                   dM++;
00130             }
00131 
00132             if ( pA > 0 )  
00133                pA = -1; 
00134             else
00135                dA++;
00136          }       
00137 
00138          if ( pZ > 0 )  
00139             pZ = -1; 
00140          else
00141             dZ++;
00142       }
00143 
00144    }
00145 
00146 }

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