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

#include <G4TextPPReporter.hh>

Inheritance diagram for G4TextPPReporter:
Collaboration diagram for G4TextPPReporter:

Public Member Functions

 G4TextPPReporter ()
 
virtual ~G4TextPPReporter ()
 
virtual void Print (const G4String &option="")
 
- Public Member Functions inherited from G4VParticlePropertyReporter
 G4VParticlePropertyReporter ()
 
virtual ~G4VParticlePropertyReporter ()
 
G4int operator== (const G4VParticlePropertyReporter &right) const
 
G4int operator!= (const G4VParticlePropertyReporter &right) const
 
virtual G4bool FillList (G4String name)
 
virtual void Clear ()
 
const G4PPDContainerGetList () const
 

Protected Member Functions

void SparseOption (const G4String &option)
 
void GeneratePropertyTable (const G4ParticleDefinition *)
 

Protected Attributes

G4String baseDir
 
- Protected Attributes inherited from G4VParticlePropertyReporter
G4PPDContainer pList
 
G4ParticlePropertyTablepPropertyTable
 

Additional Inherited Members

- Public Types inherited from G4VParticlePropertyReporter
typedef std::vector
< G4ParticlePropertyData * > 
G4PPDContainer
 

Detailed Description

Definition at line 44 of file G4TextPPReporter.hh.

Constructor & Destructor Documentation

G4TextPPReporter::G4TextPPReporter ( )

Definition at line 49 of file G4TextPPReporter.cc.

G4TextPPReporter::~G4TextPPReporter ( )
virtual

Definition at line 54 of file G4TextPPReporter.cc.

55 {
56 }

Member Function Documentation

void G4TextPPReporter::GeneratePropertyTable ( const G4ParticleDefinition particle)
protected

Definition at line 86 of file G4TextPPReporter.cc.

87 {
88  G4String name = particle->GetParticleName();
89 
90  //--- open file -----
91  G4String fileName = baseDir + name + ".txt";
92  // exception
93  if (name == "J/psi") fileName = baseDir +"jpsi.txt";
94 
95  std::ofstream outFile(fileName, std::ios::out );
96  outFile.setf( std::ios:: scientific, std::ios::floatfield );
97  outFile << std::setprecision(7) << G4endl;
98 
99  // particle name encoding
100  outFile << name << " "
101  << particle->GetPDGEncoding() << G4endl;
102 
103  // IJPC
104  outFile << particle->GetPDGiIsospin() << " "
105  << particle->GetPDGiSpin() << " "
106  << particle->GetPDGiParity() << " "
107  << particle->GetPDGiConjugation() << G4endl;
108 
109  // mass, width, charge
110  outFile << particle->GetPDGMass()/GeV << " "
111  << particle->GetPDGWidth()/GeV << " "
112  << particle->GetPDGCharge()/eplus << G4endl;
113 
114  // life time
115  outFile << particle->GetPDGLifeTime()/second << G4endl;
116 
117 // Decay Table
118  G4DecayTable* dcyTable = particle->GetDecayTable();
119  if (dcyTable != 0) {
120  for (G4int i=0; i< dcyTable->entries(); i++){
121  G4VDecayChannel * channel = dcyTable->GetDecayChannel(i);
122  // column 1 : BR
123  outFile << channel->GetBR() << " ";
124  // column 2. : daughters
125  outFile << channel->GetNumberOfDaughters() << " ";
126  // column 3 : Kinematics
127  outFile << channel->GetKinematicsName() << " ";
128  // daughters
129  for (G4int j=0; j< channel->GetNumberOfDaughters(); j++){
130  outFile << channel->GetDaughter(j)->GetParticleName() << " ";
131  }
132  outFile << G4endl;
133  }
134  }
135 }
const XML_Char * name
Definition: expat.h:151
G4double GetBR() const
G4int GetNumberOfDaughters() const
G4ParticleDefinition * GetDaughter(G4int anIndex)
const G4String & GetKinematicsName() const
G4VDecayChannel * GetDecayChannel(G4int index) const
static constexpr double second
Definition: G4SIunits.hh:157
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
G4int entries() const
G4DecayTable * GetDecayTable() const
G4double GetPDGWidth() const
static constexpr double eplus
Definition: G4SIunits.hh:199
G4int GetPDGiConjugation() const
G4double GetPDGMass() const
static constexpr double GeV
Definition: G4SIunits.hh:217
G4double GetPDGLifeTime() const
#define G4endl
Definition: G4ios.hh:61
G4double GetPDGCharge() const

Here is the call graph for this function:

Here is the caller graph for this function:

void G4TextPPReporter::Print ( const G4String option = "")
virtual

Implements G4VParticlePropertyReporter.

Definition at line 59 of file G4TextPPReporter.cc.

60 {
61  SparseOption( option );
62 
63  for (size_t i=0; i< pList.size(); i++){
64  G4ParticleDefinition* particle = G4ParticleTable::GetParticleTable()->FindParticle( pList[i]->GetParticleName() );
65 
66  GeneratePropertyTable(particle);
67  }
68 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
void GeneratePropertyTable(const G4ParticleDefinition *)
void SparseOption(const G4String &option)
static G4ParticleTable * GetParticleTable()

Here is the call graph for this function:

void G4TextPPReporter::SparseOption ( const G4String option)
protected

Definition at line 71 of file G4TextPPReporter.cc.

72 {
73  G4Tokenizer savedToken( option );
74 
75  // 1st option : base directory
76  baseDir = savedToken();
77  if (!baseDir.isNull()) {
78  if(baseDir(baseDir.length()-1)!='/') {
79  baseDir += "/";
80  }
81  }
82 }
G4bool isNull() const

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

G4String G4TextPPReporter::baseDir
protected

Definition at line 61 of file G4TextPPReporter.hh.


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