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 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

  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 //
 28 // Hadronic Process: Nuclear De-excitations
 29 // by V. Lara
 30 
 31 #include "G4StatMFMicroManager.hh"
 32 #include "G4HadronicException.hh"
 33 
 34 // Copy constructor
 35 G4StatMFMicroManager::G4StatMFMicroManager(const G4StatMFMicroManager & )
 36 {
 37     throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMicroManager::copy_constructor meant to not be accessible");
 38 }
 39 
 40 // Operators
 41 
 42 G4StatMFMicroManager & G4StatMFMicroManager::
 43 operator=(const G4StatMFMicroManager & )
 44 {
 45     throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMicroManager::operator= meant to not be accessible");
 46     return *this;
 47 }
 48 
 49 
 50 G4bool G4StatMFMicroManager::operator==(const G4StatMFMicroManager & ) const
 51 {
 52     return false;
 53 }
 54  
 55 
 56 G4bool G4StatMFMicroManager::operator!=(const G4StatMFMicroManager & ) const
 57 {
 58     return true;
 59 }
 60 
 61 // constructor
 62 G4StatMFMicroManager::G4StatMFMicroManager(const G4Fragment & theFragment, 
 63              G4int multiplicity,
 64              G4double FreeIntE, G4double SCompNuc) : 
 65   _Normalization(0.0)
 66 {
 67   // Perform class initialization
 68   Initialize(theFragment,multiplicity,FreeIntE,SCompNuc);
 69 }
 70 
 71 // destructor
 72 G4StatMFMicroManager::~G4StatMFMicroManager() 
 73 {
 74   if (!_Partition.empty()) 
 75     {
 76       std::for_each(_Partition.begin(),_Partition.end(),
 77           DeleteFragment());
 78     }
 79 }
 80 
 81 void G4StatMFMicroManager::Initialize(const G4Fragment & theFragment, G4int im, 
 82               G4double FreeIntE, G4double SCompNuc) 
 83 {
 84   G4int i;
 85 
 86   G4double U = theFragment.GetExcitationEnergy();
 87 
 88   G4int A = theFragment.GetA_asInt();
 89   G4int Z = theFragment.GetZ_asInt();
 90   
 91   // Statistical weights
 92   _WW = 0.0;
 93 
 94   // Mean breakup multiplicity
 95   _MeanMultiplicity = 0.0;
 96 
 97   // Mean channel temperature
 98   _MeanTemperature = 0.0;
 99 
100   // Mean channel entropy
101   _MeanEntropy = 0.0; 
102   
103   // Keep fragment atomic numbers
104   //  G4int * FragmentAtomicNumbers = new G4int(static_cast<G4int>(A+0.5));
105   //  G4int * FragmentAtomicNumbers = new G4int(m);
106   G4int FragmentAtomicNumbers[4];
107   
108   // We distribute A nucleons between m fragments mantaining the order
109   // FragmentAtomicNumbers[m-1]>FragmentAtomicNumbers[m-2]>...>FragmentAtomicNumbers[0]
110   // Our initial distribution is 
111   // FragmentAtomicNumbers[m-1]=A, FragmentAtomicNumbers[m-2]=0, ..., FragmentAtomicNumbers[0]=0
112   FragmentAtomicNumbers[im-1] = A;
113   for (i = 0; i <  (im - 1); i++) FragmentAtomicNumbers[i] = 0;
114 
115   // We try to distribute A nucleons in partitions of m fragments
116   // MakePartition return true if it is possible 
117   // and false if it is not 
118 
119   // Loop checking, 05-Aug-2015, Vladimir Ivanchenko
120   while (MakePartition(im,FragmentAtomicNumbers)) {
121     // Allowed partitions are stored and its probability calculated
122       
123     G4StatMFMicroPartition * aPartition = new G4StatMFMicroPartition(A,Z);
124     G4double PartitionProbability = 0.0;
125       
126     for (i = im-1; i >= 0; i--) aPartition->SetPartitionFragment(FragmentAtomicNumbers[i]);
127     PartitionProbability = aPartition->CalcPartitionProbability(U,FreeIntE,SCompNuc);
128     _Partition.push_back(aPartition);
129       
130     _WW += PartitionProbability;
131     _MeanMultiplicity += im*PartitionProbability;
132     _MeanTemperature += aPartition->GetTemperature() * PartitionProbability;
133     if (PartitionProbability > 0.0) 
134       _MeanEntropy += PartitionProbability * aPartition->GetEntropy();
135   }
136 }
137 
138 G4bool G4StatMFMicroManager::MakePartition(G4int k, G4int * ANumbers)
139 // Distributes A nucleons between k fragments
140 // mantaining the order ANumbers[k-1] > ANumbers[k-2] > ... > ANumbers[0]
141 // If it is possible returns true. In other case returns false
142 {
143   G4int l = 1;
144   // Loop checking, 05-Aug-2015, Vladimir Ivanchenko
145   while (l < k) {
146     G4int tmp = ANumbers[l-1] + ANumbers[k-1];
147     ANumbers[l-1] += 1;
148     ANumbers[k-1] -= 1;
149     if (ANumbers[l-1] > ANumbers[l] || ANumbers[k-2] > ANumbers[k-1]) {
150       ANumbers[l-1] = 1;
151       ANumbers[k-1] = tmp - 1;
152       l++;
153     } else return true;
154   }
155   return false;
156 }
157 
158 void G4StatMFMicroManager::Normalize(G4double Norm)
159 {
160   _Normalization = Norm;
161   _WW /= Norm;
162   _MeanMultiplicity /= Norm;
163   _MeanTemperature /= Norm;
164   _MeanEntropy /= Norm; 
165   
166   return;
167 }
168 
169 G4StatMFChannel* 
170 G4StatMFMicroManager::ChooseChannel(G4int A0, G4int Z0, G4double MeanT)
171 {
172   G4double RandNumber = _Normalization * _WW * G4UniformRand();
173   G4double AccumWeight = 0.0;
174   
175   for (std::vector<G4StatMFMicroPartition*>::iterator i = _Partition.begin();
176        i != _Partition.end(); ++i)
177     {
178   AccumWeight += (*i)->GetProbability();
179   if (RandNumber < AccumWeight)
180     return (*i)->ChooseZ(A0,Z0,MeanT);
181     }
182 
183   throw G4HadronicException(__FILE__, __LINE__, 
184           "G4StatMFMicroCanonical::ChooseChannel: Couldn't find a channel.");
185   return 0;
186 }
187