G4PartialWidthTable Class Reference

#include <G4PartialWidthTable.hh>


Public Member Functions

 G4PartialWidthTable (const G4double *energies, G4int entries)
virtual ~G4PartialWidthTable ()
G4bool operator== (const G4PartialWidthTable &right) const
G4bool operator!= (const G4PartialWidthTable &right) const
G4int NumberOfChannels () const
const G4PhysicsVectorWidth (const G4String &name1, const G4String &name2) const
void AddWidths (const G4double *widths, const G4String &name1, const G4String &name2)
void Dump () const


Detailed Description

Definition at line 50 of file G4PartialWidthTable.hh.


Constructor & Destructor Documentation

G4PartialWidthTable::G4PartialWidthTable ( const G4double energies,
G4int  entries 
)

Definition at line 49 of file G4PartialWidthTable.cc.

00049                                                                                 : nEnergies(entries)
00050 { 
00051   // Fill the vector with tabulated energies
00052   G4int i;
00053   for (i=0; i<entries; i++)
00054     {
00055       G4double e = *(energies + i) * GeV;
00056       energy.push_back(e);
00057     }
00058 }

G4PartialWidthTable::~G4PartialWidthTable (  )  [virtual]

Definition at line 61 of file G4PartialWidthTable.cc.

00062 { }


Member Function Documentation

void G4PartialWidthTable::AddWidths ( const G4double widths,
const G4String name1,
const G4String name2 
)

Definition at line 105 of file G4PartialWidthTable.cc.

References G4PhysicsFreeVector::PutValue().

00107 {
00108   G4PhysicsFreeVector* width = new G4PhysicsFreeVector(nEnergies);
00109   G4int i;
00110   for (i=0; i<nEnergies; i++)
00111     {
00112       G4double value = *(channelWidth+ i) * GeV;
00113       G4double e = energy[i];
00114       width->PutValue(i,e,value);
00115     }               
00116 
00117   widths.push_back(width);
00118   daughter1.push_back(name1);
00119   daughter2.push_back(name2);
00120 
00121   return;
00122 }

void G4PartialWidthTable::Dump (  )  const

Definition at line 125 of file G4PartialWidthTable.cc.

References G4cout, G4endl, and G4PhysicsVector::GetValue().

00126 {
00127   G4int entries = widths.size();
00128 
00129   G4int i;
00130   for (i=0; i<entries; i++)
00131     {
00132       G4cout << " Channel " << i  << ": " 
00133            << daughter1[i] << " " << daughter2[i] << G4endl;
00134       G4PhysicsFreeVector* width = widths[i];
00135       G4int j;
00136       for (j=0; j<nEnergies; j++)
00137         {
00138           G4bool dummy = false;
00139           G4double e = energy[i];
00140           G4double w = width->GetValue(e,dummy);
00141           G4cout << j << ") Energy = " << e << ", Width = " << w << G4endl;
00142         }
00143     }
00144   return;
00145 }

G4int G4PartialWidthTable::NumberOfChannels (  )  const

Definition at line 77 of file G4PartialWidthTable.cc.

00078 {
00079   return widths.size();
00080 }

G4bool G4PartialWidthTable::operator!= ( const G4PartialWidthTable right  )  const

Definition at line 71 of file G4PartialWidthTable.cc.

00072 {
00073   return (this != (G4PartialWidthTable *) &right);
00074 }

G4bool G4PartialWidthTable::operator== ( const G4PartialWidthTable right  )  const

Definition at line 65 of file G4PartialWidthTable.cc.

00066 {
00067   return (this == (G4PartialWidthTable *) &right);
00068 }

const G4PhysicsVector * G4PartialWidthTable::Width ( const G4String name1,
const G4String name2 
) const

Definition at line 83 of file G4PartialWidthTable.cc.

References CLHEP::detail::n.

00084 {
00085   // Returned pointer is not owned by the client
00086   G4int i;
00087   G4PhysicsVector* width = 0;
00088   G4int n = 0;
00089   G4int entries = widths.size();
00090   for (i=0; i<entries; i++)
00091     {
00092       if ( (daughter1[i] == name1 && daughter2[i] == name2) ||
00093            (daughter2[i] == name1 && daughter1[i] == name2) )
00094         {
00095           width = (G4PhysicsVector*) (widths[i]);
00096           n++;
00097         }
00098     }
00099   if (n > 1) throw G4HadronicException(__FILE__, __LINE__, "G4PartialWidthTable::Width - ambiguity");
00100 
00101   return width;
00102 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:52:50 2013 for Geant4 by  doxygen 1.4.7