Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4TheoFSGenerator Class Reference

#include <G4TheoFSGenerator.hh>

Inheritance diagram for G4TheoFSGenerator:
Collaboration diagram for G4TheoFSGenerator:

Public Member Functions

 G4TheoFSGenerator (const G4String &name="TheoFSGenerator")
 
 ~G4TheoFSGenerator ()
 
G4HadFinalStateApplyYourself (const G4HadProjectile &thePrimary, G4Nucleus &theNucleus)
 
void SetTransport (G4VIntraNuclearTransportModel *const value)
 
void SetHighEnergyGenerator (G4VHighEnergyGenerator *const value)
 
void SetQuasiElasticChannel (G4QuasiElasticChannel *const value)
 
virtual std::pair< G4double,
G4double
GetEnergyMomentumCheckLevels () const
 
void ModelDescription (std::ostream &outFile) const
 
- Public Member Functions inherited from G4HadronicInteraction
 G4HadronicInteraction (const G4String &modelName="HadronicModel")
 
virtual ~G4HadronicInteraction ()
 
virtual G4double SampleInvariantT (const G4ParticleDefinition *p, G4double plab, G4int Z, G4int A)
 
virtual G4bool IsApplicable (const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
 
G4double GetMinEnergy () const
 
G4double GetMinEnergy (const G4Material *aMaterial, const G4Element *anElement) const
 
void SetMinEnergy (G4double anEnergy)
 
void SetMinEnergy (G4double anEnergy, const G4Element *anElement)
 
void SetMinEnergy (G4double anEnergy, const G4Material *aMaterial)
 
G4double GetMaxEnergy () const
 
G4double GetMaxEnergy (const G4Material *aMaterial, const G4Element *anElement) const
 
void SetMaxEnergy (const G4double anEnergy)
 
void SetMaxEnergy (G4double anEnergy, const G4Element *anElement)
 
void SetMaxEnergy (G4double anEnergy, const G4Material *aMaterial)
 
G4int GetVerboseLevel () const
 
void SetVerboseLevel (G4int value)
 
const G4StringGetModelName () const
 
void DeActivateFor (const G4Material *aMaterial)
 
void ActivateFor (const G4Material *aMaterial)
 
void DeActivateFor (const G4Element *anElement)
 
void ActivateFor (const G4Element *anElement)
 
G4bool IsBlocked (const G4Material *aMaterial) const
 
G4bool IsBlocked (const G4Element *anElement) const
 
void SetRecoilEnergyThreshold (G4double val)
 
G4double GetRecoilEnergyThreshold () const
 
virtual const std::pair
< G4double, G4double
GetFatalEnergyCheckLevels () const
 
void SetEnergyMomentumCheckLevels (G4double relativeLevel, G4double absoluteLevel)
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void InitialiseModel ()
 

Additional Inherited Members

- Protected Member Functions inherited from G4HadronicInteraction
void SetModelName (const G4String &nam)
 
G4bool IsBlocked () const
 
void Block ()
 
- Protected Attributes inherited from G4HadronicInteraction
G4HadFinalState theParticleChange
 
G4int verboseLevel
 
G4double theMinEnergy
 
G4double theMaxEnergy
 
G4bool isBlocked
 

Detailed Description

Definition at line 53 of file G4TheoFSGenerator.hh.

Constructor & Destructor Documentation

G4TheoFSGenerator::G4TheoFSGenerator ( const G4String name = "TheoFSGenerator")

Definition at line 40 of file G4TheoFSGenerator.cc.

41  : G4HadronicInteraction(name)
42  , theTransport(0), theHighEnergyGenerator(0)
43  , theQuasielastic(0)
44  {
45  theParticleChange = new G4HadFinalState;
46 }
G4HadronicInteraction(const G4String &modelName="HadronicModel")
G4TheoFSGenerator::~G4TheoFSGenerator ( )

Definition at line 48 of file G4TheoFSGenerator.cc.

49 {
50  delete theParticleChange;
51 }

Member Function Documentation

G4HadFinalState * G4TheoFSGenerator::ApplyYourself ( const G4HadProjectile thePrimary,
G4Nucleus theNucleus 
)
virtual

Implements G4HadronicInteraction.

Definition at line 69 of file G4TheoFSGenerator.cc.

70 {
71  // init particle change
72  theParticleChange->Clear();
73  theParticleChange->SetStatusChange(stopAndKill);
74 
75  // check if models have been registered, and use default, in case this is not true @@
76 
77  const G4DynamicParticle aPart(thePrimary.GetDefinition(),thePrimary.Get4Momentum().vect());
78 
79  if ( theQuasielastic ) {
80 
81  if ( theQuasielastic->GetFraction(theNucleus, aPart) > G4UniformRand() )
82  {
83  //G4cout<<"___G4TheoFSGenerator: before Scatter (1) QE=" << theQuasielastic<<G4endl;
84  G4KineticTrackVector *result= theQuasielastic->Scatter(theNucleus, aPart);
85  //G4cout << "^^G4TheoFSGenerator: after Scatter (1) " << G4endl;
86  if (result)
87  {
88  for(unsigned int i=0; i<result->size(); i++)
89  {
90  G4DynamicParticle * aNew =
91  new G4DynamicParticle(result->operator[](i)->GetDefinition(),
92  result->operator[](i)->Get4Momentum().e(),
93  result->operator[](i)->Get4Momentum().vect());
94  theParticleChange->AddSecondary(aNew);
95  delete result->operator[](i);
96  }
97  delete result;
98 
99  } else
100  {
101  theParticleChange->SetStatusChange(isAlive);
102  theParticleChange->SetEnergyChange(thePrimary.GetKineticEnergy());
103  theParticleChange->SetMomentumChange(thePrimary.Get4Momentum().vect().unit());
104 
105  }
106  return theParticleChange;
107  }
108  }
109 
110  // get result from high energy model
111 
112  G4KineticTrackVector * theInitialResult =
113  theHighEnergyGenerator->Scatter(theNucleus, aPart);
114 
115 //#define DEBUG_initial_result
116  #ifdef DEBUG_initial_result
117  G4double E_out(0);
119  std::vector<G4KineticTrack *>::iterator ir_iter;
120  for(ir_iter=theInitialResult->begin(); ir_iter!=theInitialResult->end(); ir_iter++)
121  {
122  //G4cout << "TheoFS secondary, mom " << (*ir_iter)->GetDefinition()->GetParticleName() << " " << (*ir_iter)->Get4Momentum() << G4endl;
123  E_out += (*ir_iter)->Get4Momentum().e();
124  }
125  G4double init_mass= ionTable->GetIonMass(theNucleus.GetZ_asInt(),theNucleus.GetA_asInt());
126  G4double init_E=aPart.Get4Momentum().e();
127  // residual nucleus
128 
129  const std::vector<G4Nucleon> & thy = theHighEnergyGenerator->GetWoundedNucleus()->GetNucleons();
130 
131  G4int resZ(0),resA(0);
132  G4double delta_m(0);
133  for(size_t them=0; them<thy.size(); them++)
134  {
135  if(thy[them].AreYouHit()) {
136  ++resA;
137  if ( thy[them].GetDefinition() == G4Proton::Proton() ) {
138  ++resZ;
139  delta_m +=G4Proton::Proton()->GetPDGMass();
140  } else {
141  delta_m +=G4Neutron::Neutron()->GetPDGMass();
142  }
143  }
144  }
145 
146  G4double final_mass(0);
147  if ( theNucleus.GetA_asInt() ) {
148  final_mass=ionTable->GetIonMass(theNucleus.GetZ_asInt()-resZ,theNucleus.GetA_asInt()- resA);
149  }
150  G4double E_excit=init_mass + init_E - final_mass - E_out;
151  G4cout << " Corrected delta mass " << init_mass - final_mass - delta_m << G4endl;
152  G4cout << "initial E, mass = " << init_E << ", " << init_mass << G4endl;
153  G4cout << " final E, mass = " << E_out <<", " << final_mass << " excitation_E " << E_excit << G4endl;
154  #endif
155 
156  G4ReactionProductVector * theTransportResult = NULL;
157 
158 // Uzhi Nov. 2012
159  G4V3DNucleus* theProjectileNucleus = theHighEnergyGenerator->GetProjectileNucleus();
160 if(theProjectileNucleus == 0) // Uzhi Nov. 2012
161 { // Uzhi Nov. 2012
162 
163  G4int hitCount = 0;
164  const std::vector<G4Nucleon>& they = theHighEnergyGenerator->GetWoundedNucleus()->GetNucleons();
165  for(size_t them=0; them<they.size(); them++)
166  {
167  if(they[them].AreYouHit()) hitCount ++;
168  }
169  if(hitCount != theHighEnergyGenerator->GetWoundedNucleus()->GetMassNumber() )
170  {
171  theTransport->SetPrimaryProjectile(thePrimary); // For Bertini Cascade
172  theTransportResult =
173  theTransport->Propagate(theInitialResult, theHighEnergyGenerator->GetWoundedNucleus());
174  if ( !theTransportResult ) {
175  G4cout << "G4TheoFSGenerator: null ptr from transport propagate " << G4endl;
176  throw G4HadronicException(__FILE__, __LINE__, "Null ptr from transport propagate");
177  }
178  }
179  else
180  {
181  theTransportResult = theDecay.Propagate(theInitialResult, theHighEnergyGenerator->GetWoundedNucleus());
182  if ( !theTransportResult ) {
183  G4cout << "G4TheoFSGenerator: null ptr from decay propagate " << G4endl;
184  throw G4HadronicException(__FILE__, __LINE__, "Null ptr from decay propagate");
185  }
186  }
187 
188 } else // Uzhi Nov. 2012
189 { // Uzhi Nov. 2012
190  theTransport->SetPrimaryProjectile(thePrimary);
191  theTransportResult =
192  theTransport->PropagateNuclNucl(theInitialResult,
193  theHighEnergyGenerator->GetWoundedNucleus(),
194  theHighEnergyGenerator->GetProjectileNucleus());
195  if ( !theTransportResult ) {
196  G4cout << "G4TheoFSGenerator: null ptr from transport propagate " << G4endl;
197  throw G4HadronicException(__FILE__, __LINE__, "Null ptr from transport propagate");
198  }
199 } // Uzhi Nov. 2012
200 
201  // Fill particle change
202  unsigned int i;
203  for(i=0; i<theTransportResult->size(); i++)
204  {
205  G4DynamicParticle * aNew =
206  new G4DynamicParticle(theTransportResult->operator[](i)->GetDefinition(),
207  theTransportResult->operator[](i)->GetTotalEnergy(),
208  theTransportResult->operator[](i)->GetMomentum());
209  // @@@ - overkill? G4double newTime = theParticleChange->GetGlobalTime(theTransportResult->operator[](i)->GetFormationTime());
210  theParticleChange->AddSecondary(aNew);
211  delete theTransportResult->operator[](i);
212  }
213 
214  // some garbage collection
215  delete theTransportResult;
216 
217  // Done
218  return theParticleChange;
219 }
G4double G4ParticleHPJENDLHEData::G4double result
G4ReactionProductVector * Propagate(G4KineticTrackVector *theSecondaries, G4V3DNucleus *)
G4int GetA_asInt() const
Definition: G4Nucleus.hh:109
virtual G4ReactionProductVector * Propagate(G4KineticTrackVector *theSecondaries, G4V3DNucleus *theNucleus)=0
virtual G4int GetMassNumber()=0
int G4int
Definition: G4Types.hh:78
G4KineticTrackVector * Scatter(G4Nucleus &theNucleus, const G4DynamicParticle &thePrimary)
virtual G4KineticTrackVector * Scatter(const G4Nucleus &theNucleus, const G4DynamicParticle &thePrimary)=0
void SetStatusChange(G4HadFinalStateStatus aS)
void SetPrimaryProjectile(const G4HadProjectile &aPrimary)
virtual G4V3DNucleus * GetWoundedNucleus() const =0
std::vector< G4ReactionProduct * > G4ReactionProductVector
G4IonTable * GetIonTable() const
Hep3Vector vect() const
#define G4UniformRand()
Definition: Randomize.hh:97
G4GLOB_DLL std::ostream G4cout
const G4ParticleDefinition * GetDefinition() const
G4double GetIonMass(G4int Z, G4int A, G4int L=0, G4int lvl=0) const
Definition: G4IonTable.cc:1335
G4double GetKineticEnergy() const
static G4Proton * Proton()
Definition: G4Proton.cc:93
virtual G4V3DNucleus * GetProjectileNucleus() const
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
G4double GetFraction(G4Nucleus &theNucleus, const G4DynamicParticle &thePrimary)
const G4LorentzVector & Get4Momentum() const
void SetEnergyChange(G4double anEnergy)
G4double GetPDGMass() const
static G4ParticleTable * GetParticleTable()
virtual G4ReactionProductVector * PropagateNuclNucl(G4KineticTrackVector *theSecondaries, G4V3DNucleus *theNucleus, G4V3DNucleus *theProjectileNucleus)
Hep3Vector unit() const
G4int GetZ_asInt() const
Definition: G4Nucleus.hh:115
virtual const std::vector< G4Nucleon > & GetNucleons()=0
#define G4endl
Definition: G4ios.hh:61
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
double G4double
Definition: G4Types.hh:76
void SetMomentumChange(const G4ThreeVector &aV)

Here is the call graph for this function:

std::pair< G4double, G4double > G4TheoFSGenerator::GetEnergyMomentumCheckLevels ( ) const
virtual

Reimplemented from G4HadronicInteraction.

Definition at line 221 of file G4TheoFSGenerator.cc.

222 {
223  if ( theHighEnergyGenerator ) {
224  return theHighEnergyGenerator->GetEnergyMomentumCheckLevels();
225  } else {
226  return std::pair<G4double, G4double>(DBL_MAX, DBL_MAX);
227  }
228 }
std::pair< G4double, G4double > GetEnergyMomentumCheckLevels() const
#define DBL_MAX
Definition: templates.hh:83

Here is the call graph for this function:

void G4TheoFSGenerator::ModelDescription ( std::ostream &  outFile) const
virtual

Reimplemented from G4HadronicInteraction.

Definition at line 53 of file G4TheoFSGenerator.cc.

54 {
55  outFile << GetModelName() <<" consists of a " << theHighEnergyGenerator->GetModelName()
56  << " string model and a stage to de-excite the excited nuclear fragment."
57  << "\n<p>"
58  << "The string model simulates the interaction of\n"
59  << "an incident hadron with a nucleus, forming \n"
60  << "excited strings, decays these strings into hadrons,\n"
61  << "and leaves an excited nucleus. \n"
62  << "<p>The string model:\n";
63  theHighEnergyGenerator->ModelDescription(outFile);
64  outFile <<"\n<p>";
65  theTransport->PropagateModelDescription(outFile);
66 }
const G4String & GetModelName() const
virtual void PropagateModelDescription(std::ostream &outFile) const
virtual G4String GetModelName() const
virtual void ModelDescription(std::ostream &) const

Here is the call graph for this function:

void G4TheoFSGenerator::SetHighEnergyGenerator ( G4VHighEnergyGenerator *const  value)
inline

Definition at line 103 of file G4TheoFSGenerator.hh.

104 {
105  theHighEnergyGenerator= value;
106 }
const XML_Char int const XML_Char * value
Definition: expat.h:331

Here is the caller graph for this function:

void G4TheoFSGenerator::SetQuasiElasticChannel ( G4QuasiElasticChannel *const  value)
inline

Definition at line 108 of file G4TheoFSGenerator.hh.

109 {
110  theQuasielastic = value;
111 }
const XML_Char int const XML_Char * value
Definition: expat.h:331

Here is the caller graph for this function:

void G4TheoFSGenerator::SetTransport ( G4VIntraNuclearTransportModel *const  value)
inline

Definition at line 93 of file G4TheoFSGenerator.hh.

94 {
95  theTransport = value;
96 }
const XML_Char int const XML_Char * value
Definition: expat.h:331

Here is the caller graph for this function:


The documentation for this class was generated from the following files: