Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4AblaDeexcitation.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
27#include "G4AblaDeexcitation.hh"
31#include "G4AblaInterface.hh"
33
34
36 : G4CascadeDeexciteBase( "G4AblaDeexcitation" ), theDeExcitation( nullptr ) {
37 // Access common instance of Abla instead of creating new one
39 // If not found, or cast fails, create a local instance
40 theDeExcitation = static_cast< G4AblaInterface* >( p );
41 if ( theDeExcitation == nullptr ) theDeExcitation = new G4AblaInterface;
42}
43
44
46
47
50 theDeExcitation->SetVerboseLevel( verbose );
51}
52
53
54void G4AblaDeexcitation::deExcite( const G4Fragment& fragment, G4CollisionOutput& globalOutput ) {
55 if ( verboseLevel ) G4cout << " >>> G4AblaDeexcitation::deExcite" << G4endl;
56 if ( verboseLevel > 1 ) G4cout << fragment << G4endl;
57 G4Fragment originalFragment( fragment );
58 G4ReactionProductVector* ablaProducts = theDeExcitation->DeExcite( originalFragment );
59 // Transfer output of de-excitation back into Bertini objects
60 if ( ablaProducts ) {
61 if ( verboseLevel > 1 ) {
62 G4cout << " Got " << ablaProducts->size() << " secondaries back from Abla:" << G4endl;
63 }
64 globalOutput.setVerboseLevel( verboseLevel );
65 globalOutput.addOutgoingParticles( ablaProducts );
66 globalOutput.setVerboseLevel( 0 );
67 for ( size_t i = 0; i < ablaProducts->size(); ++i ) {
68 delete (*ablaProducts)[ i ];
69 }
70 ablaProducts->clear();
71 delete ablaProducts;
72 }
73}
std::vector< G4ReactionProduct * > G4ReactionProductVector
int G4int
Definition G4Types.hh:85
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
void deExcite(const G4Fragment &fragment, G4CollisionOutput &globalOutput) override
void setVerboseLevel(G4int verbose) override
~G4AblaDeexcitation() override
virtual void setVerboseLevel(G4int verbose=0)
void setVerboseLevel(G4int verbose)
void addOutgoingParticles(const std::vector< G4InuclElementaryParticle > &particles)
G4HadronicInteraction * FindModel(const G4String &name)
static G4HadronicInteractionRegistry * Instance()
void SetVerboseLevel(G4int value)
virtual G4ReactionProductVector * DeExcite(G4Fragment &aFragment)=0