Geant4  10.00.p01
G4PreCompoundDeexcitation.cc
Go to the documentation of this file.
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 // $Id: G4PreCompoundDeexcitation.cc 71942 2013-06-28 19:08:11Z mkelsey $
27 //
28 // Takes an arbitrary excited or unphysical nuclear state and produces
29 // a final state with evaporated particles and (possibly) a stable nucleus.
30 //
31 // 20100922 M. Kelsey -- Remove convertFragment() function, pass buffer
32 // instead of copying, clean up code somewhat
33 // 20100925 M. Kelsey -- Use new G4InuclNuclei->G4Fragment conversion, and
34 // G4ReactionProducts -> G4CollisionOutput convertor. Move Z==0
35 // explosion condition to base-class function.
36 // 20100926 M. Kelsey -- Move to new G4VCascadeDeexcitation base class,
37 // replace getDeexcitationFragments() with deExcite().
38 // 20110214 M. Kelsey -- Follow G4InuclParticle::Model enumerator migration
39 // 20110803 M. Kelsey -- Add post-deexcitation diagnostic messages
40 // 20120120 V. Ivanchenko -- Pre-compound model and its handler should not be deleted here
41 // 20130621 Replace collide() interface with deExcite() using G4Fragment ref
42 // 20130622 Inherit from G4CascadeDeexciteBase, add verbosity interface
43 // to pass to PreCompound
44 
46 #include "globals.hh"
48 #include "G4InuclNuclei.hh"
49 #include "G4InuclParticle.hh"
50 #include "G4InuclParticleNames.hh"
51 #include "G4PreCompoundModel.hh"
53 
54 using namespace G4InuclParticleNames;
55 
56 
57 // Constructor and destructor
58 
60  : G4CascadeDeexciteBase("G4PreCompoundDeexcitation"),
61  theExcitationHandler(new G4ExcitationHandler),
62  theDeExcitation(new G4PreCompoundModel(theExcitationHandler)) {}
63 
65  // Per V.I. -- do not delete locally; handled in hadronic registry
66  //delete theExcitationHandler;
67  //delete theDeExcitation;
68 }
69 
73  // NOTE: G4ExcitationHandler doesn't have verbosity
74 }
75 
76 
77 // Main processing
78 
80  G4CollisionOutput& globalOutput) {
81  if (verboseLevel)
82  G4cout << " >>> G4PreCompoundDeexcitation::deExcite" << G4endl;
83 
84  if (verboseLevel > 1) G4cout << fragment << G4endl;
85 
86  G4ReactionProductVector* precompoundProducts = 0;
87 
88  // FIXME: in principle, the explosion(...) stuff should also
89  // handle properly the case of Z=0 (neutron blob)
90  if (explosion(fragment) && theExcitationHandler) {
91  if (verboseLevel) G4cout << " calling BreakItUp" << G4endl;
92  precompoundProducts = theExcitationHandler->BreakItUp(fragment);
93  } else {
94  if (verboseLevel) G4cout << " calling DeExcite" << G4endl;
95  // NOTE: DeExcite() interface takes a *non-const* reference
96  precompoundProducts =
97  theDeExcitation->DeExcite(const_cast<G4Fragment&>(fragment));
98  }
99 
100  // Transfer output of de-excitation back into Bertini objects
101  if (precompoundProducts) {
102  if (verboseLevel>1) {
103  G4cout << " Got " << precompoundProducts->size()
104  << " secondaries back from PreCompound:" << G4endl;
105  }
106 
107  globalOutput.setVerboseLevel(verboseLevel); // For debugging
108  globalOutput.addOutgoingParticles(precompoundProducts);
109  globalOutput.setVerboseLevel(0);
110 
111  precompoundProducts->clear();
112  delete precompoundProducts;
113  }
114 }
void setVerboseLevel(G4int verbose)
virtual void setVerboseLevel(G4int verbose=0)
virtual G4ReactionProductVector * DeExcite(G4Fragment &aFragment)=0
virtual void deExcite(const G4Fragment &fragment, G4CollisionOutput &globalOutput)
int G4int
Definition: G4Types.hh:78
G4ReactionProductVector * BreakItUp(const G4Fragment &theInitialState) const
std::vector< G4ReactionProduct * > G4ReactionProductVector
G4GLOB_DLL std::ostream G4cout
virtual void setVerboseLevel(G4int verbose)
void addOutgoingParticles(const std::vector< G4InuclElementaryParticle > &particles)
virtual G4bool explosion(const G4Fragment &target) const
G4VPreCompoundModel * theDeExcitation
virtual void SetVerboseLevel(G4int value)
#define G4endl
Definition: G4ios.hh:61
G4ExcitationHandler * theExcitationHandler