Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4ParticleHPContEnergyAngular Class Reference

#include <G4ParticleHPContEnergyAngular.hh>

Inheritance diagram for G4ParticleHPContEnergyAngular:
Collaboration diagram for G4ParticleHPContEnergyAngular:

Public Member Functions

 G4ParticleHPContEnergyAngular (G4ParticleDefinition *proj)
 
 ~G4ParticleHPContEnergyAngular ()
 
void Init (std::istream &aDataFile)
 
G4double MeanEnergyOfThisInteraction ()
 
G4ReactionProductSample (G4double anEnergy, G4double massCode, G4double mass)
 
void ClearHistories ()
 
- Public Member Functions inherited from G4VParticleHPEnergyAngular
 G4VParticleHPEnergyAngular ()
 
virtual ~G4VParticleHPEnergyAngular ()
 
void SetProjectileRP (G4ReactionProduct *aIncidentParticleRP)
 
void SetTarget (G4ReactionProduct *aTarget)
 
G4ReactionProductGetTarget ()
 
G4ReactionProductGetProjectileRP ()
 
G4ReactionProductGetCMS ()
 
void SetQValue (G4double aValue)
 

Additional Inherited Members

- Protected Member Functions inherited from G4VParticleHPEnergyAngular
G4double GetQValue ()
 

Detailed Description

Definition at line 46 of file G4ParticleHPContEnergyAngular.hh.

Constructor & Destructor Documentation

G4ParticleHPContEnergyAngular::G4ParticleHPContEnergyAngular ( G4ParticleDefinition proj)
inline

Definition at line 50 of file G4ParticleHPContEnergyAngular.hh.

51  : theProjectile(proj)
52  {
53  theAngular = 0;
54  currentMeanEnergy.Put( -2 );
55  theTargetCode = -1.0;
56  theAngularRep = -1;
57  nEnergy = -1;
58  theInterpolation = -1;
59  }
void Put(const value_type &val) const
Definition: G4Cache.hh:286

Here is the call graph for this function:

G4ParticleHPContEnergyAngular::~G4ParticleHPContEnergyAngular ( )
inline

Definition at line 61 of file G4ParticleHPContEnergyAngular.hh.

62  {
63  if(theAngular!=0) delete [] theAngular;
64  }

Member Function Documentation

void G4ParticleHPContEnergyAngular::ClearHistories ( )
virtual

Reimplemented from G4VParticleHPEnergyAngular.

Definition at line 123 of file G4ParticleHPContEnergyAngular.cc.

124 {
125  if ( theAngular!= NULL )
126  {
127  for ( G4int i = 0 ; i< nEnergy ; i++ )
128  theAngular[i].ClearHistories();
129  }
130 }
int G4int
Definition: G4Types.hh:78
void G4ParticleHPContEnergyAngular::Init ( std::istream &  aDataFile)
inlinevirtual

Implements G4VParticleHPEnergyAngular.

Definition at line 68 of file G4ParticleHPContEnergyAngular.hh.

69  {
70  aDataFile >> theTargetCode >> theAngularRep >> theInterpolation >> nEnergy;
71  theAngular = new G4ParticleHPContAngularPar[nEnergy];
72  theManager.Init(aDataFile);
73  for(G4int i=0; i<nEnergy; i++)
74  {
75  theAngular[i].Init(aDataFile, theProjectile);
76  theAngular[i].SetInterpolation(theInterpolation);
77 #ifndef PHP_AS_HP
78  if( i != 0 ) {
79  theAngular[i].PrepareTableInterpolation(&(theAngular[i-1]));
80  } else {
82  }
83 #endif
84  }
85 
86  }
void Init(G4int aScheme, G4int aRange)
void SetInterpolation(G4int theInterpolation)
int G4int
Definition: G4Types.hh:78
void Init(std::istream &aDataFile, G4ParticleDefinition *projectile)
void PrepareTableInterpolation(const G4ParticleHPContAngularPar *angularPrev)

Here is the call graph for this function:

G4double G4ParticleHPContEnergyAngular::MeanEnergyOfThisInteraction ( )
virtual

Implements G4VParticleHPEnergyAngular.

Definition at line 106 of file G4ParticleHPContEnergyAngular.cc.

107 {
108  G4double result(0);
109  if(currentMeanEnergy.Get()<-1)
110  {
111  throw G4HadronicException(__FILE__, __LINE__, "G4ParticleHPContEnergyAngular: Logical error in Product class");
112  }
113  else
114  {
115  result = currentMeanEnergy.Get();
116  }
117  currentMeanEnergy.Put( -2 );
118  return result;
119 }
G4double G4ParticleHPJENDLHEData::G4double result
value_type & Get() const
Definition: G4Cache.hh:282
double G4double
Definition: G4Types.hh:76
void Put(const value_type &val) const
Definition: G4Cache.hh:286

Here is the call graph for this function:

Here is the caller graph for this function:

G4ReactionProduct * G4ParticleHPContEnergyAngular::Sample ( G4double  anEnergy,
G4double  massCode,
G4double  mass 
)
virtual

Implements G4VParticleHPEnergyAngular.

Definition at line 36 of file G4ParticleHPContEnergyAngular.cc.

37 {
39  G4int i(0);
40  G4int it(0);
41  for(i=0;i<nEnergy;i++)
42  {
43  it = i;
44 #ifdef PHP_AS_HP
45  if(theAngular[i].GetEnergy()>anEnergy) break;
46 #else
47  if(theAngular[i].GetEnergy()>=anEnergy) break;
48 #endif
49  }
50  if( getenv("G4PHPTEST") ) G4cout << i << " G4ParticleHPContEnergyAngular dataE " << theAngular[i].GetEnergy() << " > " << anEnergy << " it_theAngular " << it << " interpolation " << theInterpolation << G4endl; //GDEB
51  G4double targetMass = GetTarget()->GetMass();
52  if(it==0)
53  {
54  theAngular[0].SetTarget(GetTarget());
55  theAngular[0].SetTargetCode(theTargetCode);
56  theAngular[0].SetPrimary(GetProjectileRP());
57  result = theAngular[0].Sample(anEnergy, massCode, targetMass,
58  theAngularRep, theInterpolation);
59  currentMeanEnergy.Put( theAngular[0].MeanEnergyOfThisInteraction() );
60  }
61  else
62  {
63  // interpolation through alternating sampling. This needs improvement @@@
64  // This is the cause of the He3 problem !!!!!!!!
65  // See to it, if you can improve this.
66  //080714 TK commnet Randomizing use angular distribution
67  //080714 TK Always use the upper side distribution. enabling ClearHistories method.
68  //G4double random = G4UniformRand();
69  //G4double deltaE = theAngular[it].GetEnergy()-theAngular[it-1].GetEnergy();
70  //G4double offset = theAngular[it].GetEnergy()-anEnergy;
71  //if(random<offset/deltaE) it--;
72  //--- create new
73  // if( theManager.GetScheme(0) != LINLIN ) { // asserted in G4ParticleHPContEnergyAngular::init there is only one range
74 #ifdef PHP_AS_HP
75  theAngular[it].SetTarget(GetTarget());
76  theAngular[it].SetTargetCode(theTargetCode);
77  theAngular[it].SetPrimary(GetProjectileRP());
78  result = theAngular[it].Sample(anEnergy, massCode, targetMass,
79  theAngularRep, theInterpolation);
80  currentMeanEnergy.Put( theAngular[it].MeanEnergyOfThisInteraction() );
81 #else
82  if( getenv("G4PHPTEST") ) G4cout << i << " G4ParticleHPContEnergyAngular To BUILDBYINTERPOLATION " << it << " : " << theAngular[it].GetEnergy()<< " , " << theAngular[it].GetNEnergies() << " " << it-1 << " : " << theAngular[it-1].GetEnergy()<< " : " << theAngular[it-1].GetNEnergies() << G4endl; //GDEB
83 
84  G4ParticleHPContAngularPar * angular = new G4ParticleHPContAngularPar(theProjectile );
85 
86  angular->SetInterpolation(theInterpolation);
87  angular->BuildByInterpolation( anEnergy, theManager.GetScheme(0), (theAngular[it-1]), (theAngular[it]) );
88 
89  angular->SetTarget(GetTarget());
90  angular->SetTargetCode(theTargetCode);
91  angular->SetPrimary(GetProjectileRP());
92  result = angular->Sample(anEnergy, massCode, targetMass,
93  theAngularRep, theInterpolation);
94  currentMeanEnergy.Put( angular->MeanEnergyOfThisInteraction() );
95 
96  delete angular;
97 #endif
98  }
99 
100  // G4cout << " 0 0 @@@ G4ParticleHPContEnergyAngular::Sample " << result->GetDefinition()->GetParticleName() << " E= " << result->GetKineticEnergy() << G4endl;//GDEB
101 
102  return result;
103 }
G4double G4ParticleHPJENDLHEData::G4double result
void SetTargetCode(G4double aTargetCode)
G4ReactionProduct * Sample(G4double anEnergy, G4double massCode, G4double mass, G4int angularRep, G4int interpol)
void BuildByInterpolation(G4double anEnergy, G4InterpolationScheme aScheme, G4ParticleHPContAngularPar &store1, G4ParticleHPContAngularPar &store2)
void SetInterpolation(G4int theInterpolation)
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
G4InterpolationScheme GetScheme(G4int index) const
void SetPrimary(G4ReactionProduct *aPrimary)
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
void Put(const value_type &val) const
Definition: G4Cache.hh:286
G4double GetMass() const
void SetTarget(G4ReactionProduct *aTarget)

Here is the call graph for this function:


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