Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/particles/management/src/G4DecayProducts.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 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 ]

Diff markup

Differences between /particles/management/src/G4DecayProducts.cc (Version 11.3.0) and /particles/management/src/G4DecayProducts.cc (Version 8.1.p2)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 // G4DecayProducts class implementation        << 
 27 //                                                 26 //
 28 // Author: H.Kurashige, 12 July 1996           <<  27 // $Id: G4DecayProducts.cc,v 1.14 2006/06/29 19:25:00 gunter Exp $
                                                   >>  28 // GEANT4 tag $Name: geant4-08-01-patch-01 $
                                                   >>  29 //
                                                   >>  30 // 
                                                   >>  31 // ------------------------------------------------------------
                                                   >>  32 //      GEANT 4 class implementation file
                                                   >>  33 //
                                                   >>  34 //      History: first implementation, based on object model of
                                                   >>  35 //      10 July 1996 H.Kurashige
                                                   >>  36 //      21 Oct  1996 H.Kurashige
                                                   >>  37 //      12 Dec 1997 H.Kurashige
 29 // -------------------------------------------     38 // ------------------------------------------------------------
 30                                                    39 
                                                   >>  40 #include "G4ios.hh"
                                                   >>  41 #include "globals.hh"
 31 #include "G4DecayProducts.hh"                      42 #include "G4DecayProducts.hh"
 32                                                    43 
 33 #include "G4LorentzRotation.hh"                << 
 34 #include "G4LorentzVector.hh"                      44 #include "G4LorentzVector.hh"
 35 #include "G4PhysicalConstants.hh"              <<  45 #include "G4LorentzRotation.hh"
 36 #include "G4SystemOfUnits.hh"                  <<  46 
 37 #include "G4ios.hh"                            <<  47 G4Allocator<G4DecayProducts> aDecayProductsAllocator;
 38 #include "globals.hh"                          <<  48 
 39                                                    49 
 40 G4DecayProducts::G4DecayProducts()                 50 G4DecayProducts::G4DecayProducts()
 41 {                                              <<  51                 :numberOfProducts(0),theParentParticle(0)
 42   theProductVector = new G4DecayProductVector( <<  52 { 
                                                   >>  53 
 43 }                                                  54 }
 44                                                    55 
 45 G4DecayProducts::G4DecayProducts(const G4Dynam <<  56 G4DecayProducts::G4DecayProducts(const G4DynamicParticle &aParticle)
                                                   >>  57                 :numberOfProducts(0),theParentParticle(0)
 46 {                                                  58 {
 47   theParentParticle = new G4DynamicParticle(aP     59   theParentParticle = new G4DynamicParticle(aParticle);
 48   theProductVector = new G4DecayProductVector( << 
 49 }                                                  60 }
 50                                                    61 
 51 G4DecayProducts::G4DecayProducts(const G4Decay <<  62 G4DecayProducts::G4DecayProducts(const G4DecayProducts &right) 
                                                   >>  63                 :numberOfProducts(0)
 52 {                                                  64 {
 53   theProductVector = new G4DecayProductVector( << 
 54                                                << 
 55   // copy parent (Deep Copy)                       65   // copy parent (Deep Copy)
 56   theParentParticle = new G4DynamicParticle(*r     66   theParentParticle = new G4DynamicParticle(*right.theParentParticle);
 57                                                    67 
 58   // copy daughters (Deep Copy)                <<  68   //copy daughters (Deep Copy)
 59   for (G4int index = 0; index < right.numberOf <<  69   for (G4int index=0; index < right.numberOfProducts; index++)
 60     G4DynamicParticle* daughter = right.thePro <<  70   {
 61     auto pDaughter = new G4DynamicParticle(*da <<  71     G4DynamicParticle* daughter = right.theProductVector[index];
 62                                                <<  72     const G4DecayProducts* pPreAssigned = daughter->GetPreAssignedDecayProducts();
 63     G4double properTime = daughter->GetPreAssi     73     G4double properTime = daughter->GetPreAssignedDecayProperTime();
 64     if (properTime > 0.0) pDaughter->SetPreAss <<  74     G4DynamicParticle* pDaughter =  new G4DynamicParticle(*daughter);
 65                                                    75 
 66     const G4DecayProducts* pPreAssigned = daug <<  76     if (pPreAssigned) {
 67     if (pPreAssigned != nullptr) {             <<  77       G4DecayProducts* pPA = new G4DecayProducts(*pPreAssigned);
 68       auto pPA = new G4DecayProducts(*pPreAssi << 
 69       pDaughter->SetPreAssignedDecayProducts(p     78       pDaughter->SetPreAssignedDecayProducts(pPA);
                                                   >>  79       if(properTime>0.0)
                                                   >>  80       { pDaughter->SetPreAssignedDecayProperTime(properTime); }
 70     }                                              81     }
 71     theProductVector->push_back(pDaughter);    <<  82 
                                                   >>  83     PushProducts( pDaughter );
 72   }                                                84   }
 73   numberOfProducts = right.numberOfProducts;   << 
 74 }                                                  85 }
 75                                                    86 
 76 G4DecayProducts& G4DecayProducts::operator=(co <<  87 G4DecayProducts & G4DecayProducts::operator=(const G4DecayProducts &right)
 77 {                                                  88 {
 78   G4int index;                                     89   G4int index;
 79                                                    90 
 80   if (this != &right) {                        <<  91   if (this != &right)
                                                   >>  92   { 
 81     // recreate parent                             93     // recreate parent
 82     delete theParentParticle;                  <<  94     if (theParentParticle != 0) delete theParentParticle;
 83     theParentParticle = new G4DynamicParticle(     95     theParentParticle = new G4DynamicParticle(*right.theParentParticle);
 84                                                    96 
 85     // delete G4DynamicParticle objects            97     // delete G4DynamicParticle objects
 86     for (index = 0; index < numberOfProducts;  <<  98     for (index=0; index < numberOfProducts; index++)
 87       delete theProductVector->at(index);      <<  99     {
                                                   >> 100       delete theProductVector[index];
 88     }                                             101     }
 89     theProductVector->clear();                 << 
 90                                                   102 
 91     // copy daughters (Deep Copy)              << 103     //copy daughters (Deep Copy)
 92     for (index = 0; index < right.numberOfProd << 104     for (index=0; index < right.numberOfProducts; index++) {
 93       G4DynamicParticle* daughter = right.theP << 105       PushProducts( new G4DynamicParticle(*right.theProductVector[index]) );
 94       auto pDaughter = new G4DynamicParticle(* << 106     } 
 95                                                << 
 96       G4double properTime = daughter->GetPreAs << 
 97       if (properTime > 0.0) pDaughter->SetPreA << 
 98                                                << 
 99       const G4DecayProducts* pPreAssigned = da << 
100       if (pPreAssigned != nullptr) {           << 
101         auto pPA = new G4DecayProducts(*pPreAs << 
102         pDaughter->SetPreAssignedDecayProducts << 
103       }                                        << 
104       theProductVector->push_back(pDaughter);  << 
105     }                                          << 
106     numberOfProducts = right.numberOfProducts;    107     numberOfProducts = right.numberOfProducts;
                                                   >> 108     
107   }                                               109   }
108   return *this;                                   110   return *this;
109 }                                                 111 }
110                                                   112 
111 G4DecayProducts::~G4DecayProducts()               113 G4DecayProducts::~G4DecayProducts()
112 {                                                 114 {
113   // delete parent                             << 115   //delete parent
114   delete theParentParticle;                    << 116   if (theParentParticle != 0) delete theParentParticle;
115   theParentParticle = nullptr;                 << 117   
116                                                << 
117   // delete G4DynamicParticle object              118   // delete G4DynamicParticle object
118   for (G4int index = 0; index < numberOfProduc << 119   for (G4int index=0; index < numberOfProducts; index++)
119     delete theProductVector->at(index);        << 120   {
                                                   >> 121       delete theProductVector[index];
120   }                                               122   }
121   theProductVector->clear();                   << 123   numberOfProducts = 0;    
122   numberOfProducts = 0;                        << 
123   delete theProductVector;                     << 
124   theProductVector = nullptr;                  << 
125 }                                                 124 }
126                                                   125 
127 G4DynamicParticle* G4DecayProducts::PopProduct    126 G4DynamicParticle* G4DecayProducts::PopProducts()
128 {                                                 127 {
129   if (numberOfProducts > 0) {                  << 128    if ( numberOfProducts >0 ) {
130     numberOfProducts -= 1;                     << 129      numberOfProducts -= 1;   
131     G4DynamicParticle* part = theProductVector << 130      return  theProductVector[numberOfProducts];
132     theProductVector->pop_back();              << 131    } else {
133     return part;                               << 132      return 0;
134   }                                            << 133    }
135                                                << 
136   return nullptr;                              << 
137 }                                                 134 }
138                                                   135 
139 G4int G4DecayProducts::PushProducts(G4DynamicP << 136 G4int G4DecayProducts::PushProducts(G4DynamicParticle *aParticle)
140 {                                              << 137 {
141   theProductVector->push_back(aParticle);      << 138    if ( numberOfProducts < MaxNumberOfProducts) {
142   numberOfProducts += 1;                       << 139      theProductVector[numberOfProducts]= aParticle;
143   return numberOfProducts;                     << 140      numberOfProducts += 1; 
                                                   >> 141    } else {
                                                   >> 142 #ifdef G4VERBOSE
                                                   >> 143      G4cout << "G4DecayProducts::PushProducts ";
                                                   >> 144      G4cout << " exceeds MaxNumberOfProducts(="
                                                   >> 145             << G4int(MaxNumberOfProducts) << ")";
                                                   >> 146      G4cout << G4endl;
                                                   >> 147 #endif
                                                   >> 148    }
                                                   >> 149    return numberOfProducts;
144 }                                                 150 }
145                                                   151 
146 G4DynamicParticle* G4DecayProducts::operator[]    152 G4DynamicParticle* G4DecayProducts::operator[](G4int anIndex) const
147 {                                                 153 {
148   if ((numberOfProducts > anIndex) && (anIndex << 154    if ((numberOfProducts > anIndex) && (anIndex >=0) ) {
149     return theProductVector->at(anIndex);      << 155      return  theProductVector[anIndex];
150   }                                            << 156    } else {
151                                                << 157      return 0;
152   return nullptr;                              << 158    }
153 }                                                 159 }
154                                                   160 
155 void G4DecayProducts::SetParentParticle(const  << 161 void  G4DecayProducts::SetParentParticle(const G4DynamicParticle &aParticle)
156 {                                                 162 {
157   delete theParentParticle;                    << 163   if (theParentParticle != 0) delete theParentParticle;
158   theParentParticle = new G4DynamicParticle(aP    164   theParentParticle = new G4DynamicParticle(aParticle);
159 }                                                 165 }
160                                                   166 
161 void G4DecayProducts::Boost(G4double totalEner << 167 
                                                   >> 168 void G4DecayProducts::Boost(G4double totalEnergy, const G4ThreeVector &momentumDirection)
162 {                                                 169 {
163   // calculate new beta                        << 170   // calcurate new beta
164   G4double mass = theParentParticle->GetMass() << 171   G4double   mass = theParentParticle->GetMass();
165   G4double totalMomentum(0);                   << 172   G4double   totalMomentum  = std::sqrt( (totalEnergy - mass)*(totalEnergy + mass) );
166   if (totalEnergy > mass) {                    << 173   G4double   betax = momentumDirection.x()*totalMomentum/totalEnergy;  
167     totalMomentum = std::sqrt((totalEnergy - m << 174   G4double   betay = momentumDirection.y()*totalMomentum/totalEnergy;  
168   }                                            << 175   G4double   betaz = momentumDirection.z()*totalMomentum/totalEnergy;  
169   G4double betax = momentumDirection.x() * tot << 176   this->Boost(betax, betay, betaz);
170   G4double betay = momentumDirection.y() * tot << 
171   G4double betaz = momentumDirection.z() * tot << 
172   Boost(betax, betay, betaz);                  << 
173 }                                                 177 }
174                                                   178 
175 void G4DecayProducts::Boost(G4double newbetax,    179 void G4DecayProducts::Boost(G4double newbetax, G4double newbetay, G4double newbetaz)
176 {                                              << 180 { 
177   G4double mass = theParentParticle->GetMass() << 181   G4double   mass = theParentParticle->GetMass();
178   G4double energy = theParentParticle->GetTota << 182   G4double   energy  = theParentParticle->GetTotalEnergy();
179   G4double momentum = 0.0;                     << 183   G4double   momentum  = 0.0;
180                                                   184 
181   G4ThreeVector direction(0.0, 0.0, 1.0);      << 185   G4ThreeVector direction(0.0,0.0,1.0);    
182   G4LorentzVector p4;                             186   G4LorentzVector p4;
183                                                   187 
184   if (energy - mass > DBL_MIN) {                  188   if (energy - mass > DBL_MIN) {
185     // calcurate  beta of initial state           189     // calcurate  beta of initial state
186     momentum = theParentParticle->GetTotalMome << 190     momentum  = theParentParticle->GetTotalMomentum();
187     direction = theParentParticle->GetMomentum    191     direction = theParentParticle->GetMomentumDirection();
188     G4double betax = -1.0 * direction.x() * mo << 192     G4double betax = -1.0*direction.x()*momentum/energy;  
189     G4double betay = -1.0 * direction.y() * mo << 193     G4double betay = -1.0*direction.y()*momentum/energy;  
190     G4double betaz = -1.0 * direction.z() * mo << 194     G4double betaz = -1.0*direction.z()*momentum/energy;  
191                                                << 195     
192     for (G4int index = 0; index < numberOfProd << 196     for (G4int index=0; index < numberOfProducts; index++) {
193       // make G4LorentzVector for secondaries  << 197        // make G4LorentzVector for secondaries
194       p4 = (theProductVector->at(index))->Get4 << 198        p4 = theProductVector[index]->Get4Momentum();
195                                                << 199 
196       // boost secondaries to theParentParticl << 200        // boost secondaries to theParentParticle's rest frame 
197       p4.boost(betax, betay, betaz);           << 201        p4.boost(betax, betay, betaz);
                                                   >> 202 
                                                   >> 203        // boost secondaries to  new frame 
                                                   >> 204        p4.boost(newbetax, newbetay, newbetaz);
                                                   >> 205 
                                                   >> 206        // change energy/momentum
                                                   >> 207        theProductVector[index]->Set4Momentum(p4);
                                                   >> 208      }
                                                   >> 209    } else {
                                                   >> 210      for (G4int index=0; index < numberOfProducts; index++) {
                                                   >> 211        // make G4LorentzVector for secondaries
                                                   >> 212        p4 = theProductVector[index]->Get4Momentum();
198                                                   213 
199       // boost secondaries to  new frame       << 214        // boost secondaries to  new frame 
200       p4.boost(newbetax, newbetay, newbetaz);  << 215        p4.boost(newbetax, newbetay, newbetaz);
201                                                << 
202       // change energy/momentum                << 
203       (theProductVector->at(index))->Set4Momen << 
204     }                                          << 
205   }                                            << 
206   else {                                       << 
207     for (G4int index = 0; index < numberOfProd << 
208       // make G4LorentzVector for secondaries  << 
209       p4 = (theProductVector->at(index))->Get4 << 
210                                                   216 
211       // boost secondaries to  new frame       << 217        // change energy/momentum
212       p4.boost(newbetax, newbetay, newbetaz);  << 218        theProductVector[index]->Set4Momentum(p4);
213                                                << 219       }
214       // change energy/momentum                << 220    }
215       (theProductVector->at(index))->Set4Momen << 221    // make G4LorentzVector for parent in its rest frame
216     }                                          << 222    mass = theParentParticle->GetMass();
217   }                                            << 223    G4LorentzVector parent4( 0.0, 0.0, 0.0, mass);
218                                                << 
219   // make G4LorentzVector for parent in its re << 
220   mass = theParentParticle->GetMass();         << 
221   G4LorentzVector parent4(0.0, 0.0, 0.0, mass) << 
222                                                   224 
223   // boost parent to new frame                 << 225    // boost parent to new frame 
224   parent4.boost(newbetax, newbetay, newbetaz); << 226    parent4.boost(newbetax, newbetay, newbetaz);
225                                                   227 
226   // change energy/momentum                    << 228    // change energy/momentum
227   theParentParticle->Set4Momentum(parent4);    << 229    theParentParticle->Set4Momentum(parent4);
228 }                                                 230 }
229                                                   231 
230 G4bool G4DecayProducts::IsChecked() const         232 G4bool G4DecayProducts::IsChecked() const
231 {                                                 233 {
232   G4bool returnValue = true;                      234   G4bool returnValue = true;
233                                                << 235   // check parent 
234   // check parent                              << 236   //   energy/momentum
235   // energy/momentum                           << 237   G4double   parent_energy  = theParentParticle->GetTotalEnergy();
236   G4double parent_energy = theParentParticle-> << 
237   G4ThreeVector direction = theParentParticle-    238   G4ThreeVector direction = theParentParticle->GetMomentumDirection();
238   G4ThreeVector parent_momentum = direction *  << 239   G4ThreeVector parent_momentum = direction*(theParentParticle->GetTotalMomentum());
239                                                << 240   // check momentum dirction is a unit vector
240   // check momentum direction is a unit vector << 241   if ( (parent_momentum.mag() >0.0) && (std::abs(direction.mag()-1.0) >1.0e-6 ) ) {
241   if ((parent_momentum.mag() > 0.0) && (std::f << 
242 #ifdef G4VERBOSE                                  242 #ifdef G4VERBOSE
243     G4cout << "G4DecayProducts::IsChecked()::  << 243     G4cout << " Momentum Direction Vector of Parent is not normalized ";
244            << " Momentum Direction Vector of P << 244     G4cout << "  (=" << direction.mag() << ")" << G4endl;
245            << "  (=" << direction.mag() << ")" << 
246 #endif                                            245 #endif
247     returnValue = false;                          246     returnValue = false;
248     parent_momentum = parent_momentum * (1. /  << 247     parent_momentum = parent_momentum * (1./direction.mag());
249   }                                               248   }
250                                                   249 
251   // daughters                                 << 250   //daughters
252   G4double mass, energy;                       << 251   G4double   mass, energy;
253   G4ThreeVector momentum;                         252   G4ThreeVector momentum;
254   G4double total_energy = parent_energy;       << 253   G4double   total_energy = parent_energy;
255   G4ThreeVector total_momentum = parent_moment << 254   G4ThreeVector total_momentum =  parent_momentum;
256                                                << 255   for (G4int index=0; index < numberOfProducts; index++) 
257   for (G4int index = 0; index < numberOfProduc << 256   {
258     G4DynamicParticle* part = theProductVector << 257     mass = theProductVector[index]->GetMass();
259     mass = part->GetMass();                    << 258     energy  = theProductVector[index]->GetTotalEnergy();
260     energy = part->GetTotalEnergy();           << 259     direction = theProductVector[index]->GetMomentumDirection();
261     direction = part->GetMomentumDirection();  << 260     momentum = direction*(theProductVector[index]->GetTotalMomentum());
262     momentum = direction * (part->GetTotalMome << 261     // check momentum dirction is a unit vector
263                                                << 262     if ( (momentum.mag()>0.0) && (std::abs(direction.mag()-1.0) > 1.0e-6)) {
264     // check momentum direction is a unit vect << 
265     if ((momentum.mag() > 0.0) && (std::fabs(d << 
266 #ifdef G4VERBOSE                                  263 #ifdef G4VERBOSE
267       G4cout << "G4DecayProducts::IsChecked(): << 264       G4cout << " Momentum Direction Vector of Daughter [" << index;
268              << " Momentum Direction Vector of << 265       G4cout << "]  is not normalized (=" << direction.mag() << ")" << G4endl;
269              << "]  is not normalized (=" << d << 
270 #endif                                            266 #endif
271       returnValue = false;                        267       returnValue = false;
272       momentum = momentum * (1. / direction.ma << 268       momentum = momentum * (1./direction.mag());
273     }                                             269     }
274     // whether daughter stops or not              270     // whether daughter stops or not
275     if (energy - mass < DBL_MIN) {             << 271     if (energy - mass < DBL_MIN ) {
276 #ifdef G4VERBOSE                                  272 #ifdef G4VERBOSE
277       G4cout << "G4DecayProducts::IsChecked(): << 273       G4cout << "Daughter [" << index << "] has no kinetic energy "<< G4endl;
278              << "  Daughter [" << index << "]  << 
279 #endif                                            274 #endif
280       returnValue = false;                        275       returnValue = false;
281     }                                             276     }
282     total_energy -= energy;                    << 277     total_energy -= energy; 
283     total_momentum -= momentum;                   278     total_momentum -= momentum;
284   }                                               279   }
285   // check energy/momentum conservation           280   // check energy/momentum conservation
286   if ((std::fabs(total_energy) > 1.0e-9 * MeV) << 281   if ( (std::abs(total_energy) >1.0e-6) || (total_momentum.mag() >1.0e-6 ) ){ 
287 #ifdef G4VERBOSE                                  282 #ifdef G4VERBOSE
288     G4cout << "G4DecayProducts::IsChecked()::  << 283     G4cout << " Energy/Momentum is not conserved   ";
289            << " Energy/Momentum is not conserv << 284     G4cout << total_energy << "  " << total_momentum << G4endl;
290     G4cout << " difference between parent ener << 
291            << "[MeV]  " << G4endl;             << 
292     G4cout << " difference between parent mome << 
293            << " x:" << total_momentum.getX() / << 
294            << " z:" << total_momentum.getZ() / << 
295 #endif                                            285 #endif
296     returnValue = false;                          286     returnValue = false;
297   }                                               287   }
298   return returnValue;                             288   return returnValue;
299 }                                                 289 }
300                                                   290 
301 void G4DecayProducts::DumpInfo() const            291 void G4DecayProducts::DumpInfo() const
302 {                                                 292 {
303   G4cout << " ----- List of DecayProducts  --- << 293    G4cout << " ----- List of DecayProducts  -----" << G4endl;
304   G4cout << " ------ Parent Particle --------- << 294    G4cout << " ------ Parent Particle ----------" << G4endl;
305   if (theParentParticle != nullptr) theParentP << 295    if (theParentParticle != 0) theParentParticle->DumpInfo();
306   G4cout << " ------ Daughter Particles  ----- << 296    G4cout << " ------ Daughter Particles  ------" << G4endl;  
307   for (G4int index = 0; index < numberOfProduc << 297    for (G4int index=0; index < numberOfProducts; index++) 
308     G4cout << " ----------" << index + 1 << "  << 298    {
309     (theProductVector->at(index))->DumpInfo(); << 299       G4cout << " ----------" << index+1 << " -------------" << G4endl;  
310   }                                            << 300       theProductVector[index]-> DumpInfo();
311   G4cout << " ----- End List of DecayProducts  << 301    }
312   G4cout << G4endl;                            << 302    G4cout << " ----- End List of DecayProducts  -----" << G4endl;
313 }                                              << 303    G4cout << G4endl;
                                                   >> 304 } 
314                                                   305