45 for (
const auto& i :
pList) {
48 GeneratePropertyTable(particle);
52void G4HtmlPPReporter::SparseOption(
const G4String& option)
57 baseDir = savedToken();
58 if (!baseDir.empty()) {
59 if (baseDir.back() !=
'/') {
63 comment = savedToken();
66void G4HtmlPPReporter::GenerateIndex()
69 G4String fileName = baseDir +
"index.html";
70 std::ofstream outFile(fileName, std::ios::out);
71 outFile.setf(std::ios::scientific, std::ios::floatfield);
77 outFile <<
"<! -- " << comment <<
" -- !> " <<
G4endl;
80 outFile << sTABLE <<
'"' <<
"80%" <<
'"' <<
" > " <<
G4endl;
84 outFile << sTD << sLFONT <<
"Code" << eLFONT << eTD;
85 outFile << sTD << sLFONT <<
"Name" << eLFONT << eTD;
86 outFile << sTD << sLFONT <<
"Mass" << eLFONT << eTD;
87 outFile << sTD << sLFONT <<
"Charge" << eLFONT << eTD;
88 outFile << sTD << sLFONT <<
"Life Time" << eLFONT << eTD;
89 outFile << sTD << sLFONT <<
"Anti-Particle" << eLFONT << eTD;
95 outFile << sTD <<
" " << eTD;
96 outFile << sTD <<
" " << eTD;
97 outFile << sTD <<
" [GeV/c" << sSUP <<
"2" << eSUP <<
"]" << eTD;
98 outFile << sTD <<
" " << eTD;
99 outFile << sTD <<
" [ns]" << eTD;
100 outFile << sTD <<
" " << eTD;
104 for (
const auto& i :
pList) {
105 if (i->GetPDGEncoding() < 0)
continue;
110 outFile << sTD << i->GetPDGEncoding() << eTD <<
G4endl;
117 if (name ==
"J/psi") fname =
"jpsi.html";
120 outFile <<
"<A HREF=" <<
'"' << fname <<
'"' <<
">";
124 outFile << sTD << i->GetPDGMass() / GeV << eTD <<
G4endl;
127 outFile << sTD << i->GetPDGCharge() / eplus << eTD <<
G4endl;
130 outFile << sTD << i->GetPDGLifeTime() / ns << eTD <<
G4endl;
133 if ((i->GetAntiPDGEncoding() != 0) && (i->GetAntiPDGEncoding() != i->GetPDGEncoding())) {
146 outFile << eTABLE <<
G4endl;
149 PrintFooter(outFile);
160 if (name ==
"J/psi") fileName = baseDir +
"jpsi.html";
161 std::ofstream outFile(fileName, std::ios::out);
162 outFile.setf(std::ios::scientific, std::ios::floatfield);
163 outFile << std::setprecision(7) <<
G4endl;
165 PrintHeader(outFile);
168 outFile <<
"<H2>" <<
name <<
"</H2>" <<
G4endl;
169 outFile <<
"<HR>" <<
G4endl;
172 outFile << sTABLE <<
'"' <<
"40%" <<
'"' <<
" > " <<
G4endl;
173 outFile << sTR << sTD << sB <<
"PDG encoding" << eB << eTD;
175 outFile << sTR << sTD << sB <<
"Type" << eB << eTD;
177 outFile << eTABLE <<
G4endl;
178 outFile <<
"<HR>" <<
G4endl;
181 outFile << sTABLE <<
'"' <<
"60%" <<
'"' <<
" > " <<
G4endl;
183 outFile << sTR << sTD << sB <<
"Mass" << eB << eTD;
184 outFile << sTD << particle->
GetPDGMass() / GeV;
185 outFile <<
" [GeV/c" << sSUP <<
"2" << eSUP <<
"]" << eTD << eTR <<
G4endl;
187 outFile << sTR << sTD << sB <<
"Width" << eB << eTD;
189 outFile <<
" [GeV/c" << sSUP <<
"2" << eSUP <<
"]" << eTD << eTR <<
G4endl;
191 outFile << sTR << sTD << sB <<
"I J" << sSUP <<
"PC" << eSUP << eB << eTD;
193 outFile << sTD <<
" ";
196 outFile << sTD <<
"1/2 ";
199 outFile << sTD <<
"3/2 ";
228 outFile << sSUP << sSYMBOL;
247 outFile << eSYMBOL << eSUP;
248 outFile << eTD << eTR <<
G4endl;
250 outFile << sTR << sTD << sB <<
"Charge" << eB << eTD;
252 outFile << eTD << eTR <<
G4endl;
254 outFile << sTR << sTD << sB <<
"Magnetic Moment" << eB << eTD;
257 outFile <<
"[MeV/T]" << eTD << eTR <<
G4endl;
260 outFile << sTD <<
" not defined ";
261 outFile << eTD << eTR <<
G4endl;
264 outFile << sTR << sTD << sB <<
"Life Time" << eB << eTD;
267 outFile <<
"[sec]" << eTD <<
G4endl;
271 outFile << sTD <<
"stable" << eTD;
274 outFile << sTD <<
"short-lived" << eTD;
277 outFile << sTD <<
"not Defined" << eTD;
282 outFile << eTABLE <<
G4endl;
283 outFile <<
"<HR>" <<
G4endl;
290 outFile << sTABLE <<
'"' <<
"60%" <<
'"' <<
" > " <<
G4endl;
293 outFile << sTD << sB <<
"flavour " << eB << eTD;
294 outFile << sTD << sB <<
" quark " << eB << eTD;
295 outFile << sTD << sB <<
" anti-quark " << eB << eTD;
298 static const char* quarkName[6] = {
"d",
"u",
"s",
"c",
"b",
"t"};
299 for (
G4int flv = 0; flv < 6; flv++) {
301 outFile << sTD << sB << quarkName[flv] << eB << eTD;
302 outFile << sTD << sB << particle->
GetQuarkContent(flv + 1) << eB << eTD;
306 outFile << eTABLE <<
G4endl;
307 outFile <<
"<HR>" <<
G4endl;
311 if (dcyTable !=
nullptr) {
316 outFile << sTABLE <<
'"' <<
"80%" <<
'"' <<
" > " <<
G4endl;
319 outFile << sTD << sB <<
"BR" << eB << eTD;
320 outFile << sTD << sB <<
"kinematics" << eB << eTD;
328 outFile << sTD << channel->
GetBR() << eTD;
337 outFile << eTABLE <<
G4endl;
338 outFile <<
"<HR>" <<
G4endl;
342 outFile <<
"<A HREF=" <<
'"' <<
"index.html" <<
'"' <<
">back to index</A>";
345 PrintFooter(outFile);
348void G4HtmlPPReporter::PrintHeader(std::ofstream& outFile)
350 outFile <<
"<HTML>" <<
G4endl;
351 outFile <<
"<HEAD>" <<
G4endl;
352 outFile <<
" <META HTTP-EQUIV="
356 outFile <<
" CONTENT="
358 <<
"text/html; charset=iso-8859-1"
361 outFile <<
" <TITLE>Geant4 Particle List </TITLE>" <<
G4endl;
362 outFile <<
"</HEAD>" <<
G4endl;
363 outFile <<
"<! -- Generated automatically by Geant4, "
365 outFile <<
"<BODY>" <<
G4endl;
368void G4HtmlPPReporter::PrintFooter(std::ofstream& outFile)
370 outFile <<
"<HR>" <<
G4endl;
371 outFile <<
"</BODY>" <<
G4endl;
372 outFile <<
"</HTML>" <<
G4endl;
375const char* G4HtmlPPReporter::sTABLE =
"<TABLE WIDTH=";
376const char* G4HtmlPPReporter::eTABLE =
"</TABLE>";
377const char* G4HtmlPPReporter::sTR =
"<TR>";
378const char* G4HtmlPPReporter::eTR =
"</TR>";
379const char* G4HtmlPPReporter::sTD =
"<TD>";
380const char* G4HtmlPPReporter::eTD =
"</TD>";
381const char* G4HtmlPPReporter::sB =
"<B>";
382const char* G4HtmlPPReporter::eB =
"</B>";
383const char* G4HtmlPPReporter::sLFONT =
"<FONT SIZE = +1>";
384const char* G4HtmlPPReporter::eLFONT =
"</FONT>";
385const char* G4HtmlPPReporter::sSYMBOL =
"<FONT FACE = \"symbol\" >";
386const char* G4HtmlPPReporter::eSYMBOL =
"</FONT>";
387const char* G4HtmlPPReporter::sSUP =
"<SUP>";
388const char* G4HtmlPPReporter::eSUP =
"</SUP>";
389const char* G4HtmlPPReporter::sSUB =
"<SUB>";
390const char* G4HtmlPPReporter::eSUB =
"</SUB>";
G4VDecayChannel * GetDecayChannel(G4int index) const
void Print(const G4String &option="") override
G4double GetPDGMagneticMoment() const
G4int GetPDGiIsospin() const
G4bool GetPDGStable() const
G4int GetPDGiConjugation() const
const G4String & GetParticleType() const
G4bool IsShortLived() const
G4double GetPDGMass() const
G4int GetPDGiParity() const
G4int GetPDGEncoding() const
G4int GetQuarkContent(G4int flavor) const
G4double GetPDGWidth() const
G4double GetPDGCharge() const
G4int GetPDGiSpin() const
G4DecayTable * GetDecayTable() const
G4double GetPDGLifeTime() const
const G4String & GetParticleName() const
G4int GetAntiQuarkContent(G4int flavor) const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()
const G4String & GetKinematicsName() const
G4int GetNumberOfDaughters() const
G4ParticleDefinition * GetDaughter(G4int anIndex)
const char * name(G4int ptype)