57 SparseOption( option );
61 for (
size_t i=0; i<
pList.size(); i++){
63 GeneratePropertyTable(particle);
68void G4HtmlPPReporter::SparseOption(
const G4String& option)
73 baseDir = savedToken();
75 if(baseDir(baseDir.length()-1)!=
'/') {
79 comment = savedToken();
82 void G4HtmlPPReporter::GenerateIndex()
85 G4String fileName = baseDir +
"index.html";
86 std::ofstream outFile(fileName, std::ios::out );
87 outFile.setf( std::ios:: scientific, std::ios::floatfield );
93 outFile <<
"<! -- " << comment <<
" -- !> " <<
G4endl;
97 outFile << sTABLE <<
'"' <<
"80%" <<
'"' <<
" > " <<
G4endl;
101 outFile << sTD << sLFONT <<
"Code" << eLFONT<< eTD;
102 outFile << sTD << sLFONT <<
"Name" << eLFONT<< eTD;
103 outFile << sTD << sLFONT <<
"Mass" << eLFONT << eTD;
104 outFile << sTD << sLFONT <<
"Charge" << eLFONT << eTD;
105 outFile << sTD << sLFONT <<
"Life Time" << eLFONT << eTD;
106 outFile << sTD << sLFONT <<
"Anti-Particle" << eLFONT<< eTD;
107 outFile << eTR <<
G4endl;;
111 outFile << sTD <<
" " << eTD;
112 outFile << sTD <<
" " << eTD;
113 outFile << sTD <<
" [GeV/c" << sSUP <<
"2" << eSUP <<
"]" << eTD;
114 outFile << sTD <<
" " << eTD;
115 outFile << sTD <<
" [ns]" << eTD;
116 outFile << sTD <<
" " << eTD;
117 outFile << eTR <<
G4endl;;
119 for (
size_t i=0; i<
pList.size(); i++){
120 if (
pList[i]->GetPDGEncoding()<0)
continue;
122 outFile << sTR <<
G4endl;;
124 outFile << sTD <<
pList[i]->GetPDGEncoding() << eTD <<
G4endl;;
130 if (name ==
"J/psi") fname =
"jpsi.html";
133 outFile <<
"<A HREF=" <<
'"' << fname <<
'"' <<
">";
137 outFile << sTD <<
pList[i]->GetPDGMass()/GeV << eTD <<
G4endl;
140 outFile << sTD <<
pList[i]->GetPDGCharge()/eplus << eTD <<
G4endl;
143 outFile << sTD <<
pList[i]->GetPDGLifeTime()/
ns << eTD <<
G4endl;
146 if ( (
pList[i]->GetAntiPDGEncoding()!= 0) &&
147 (
pList[i]->GetAntiPDGEncoding() !=
pList[i]->GetPDGEncoding() ) ) {
154 outFile << eTR <<
G4endl;;
157 outFile << eTABLE <<
G4endl;
160 PrintFooter(outFile);
172 if (name ==
"J/psi") fileName = baseDir +
"jpsi.html";
173 std::ofstream outFile(fileName, std::ios::out );
174 outFile.setf( std::ios:: scientific, std::ios::floatfield );
175 outFile << std::setprecision(7) <<
G4endl;
177 PrintHeader(outFile);
180 outFile <<
"<H2>" <<
name <<
"</H2>" <<
G4endl;
181 outFile <<
"<HR>" <<
G4endl;
184 outFile << sTABLE <<
'"' <<
"40%" <<
'"' <<
" > " <<
G4endl;
185 outFile << sTR << sTD << sB <<
"PDG encoding" << eB << eTD;
187 outFile << sTR << sTD << sB <<
"Type" << eB << eTD;
189 outFile << eTABLE <<
G4endl;
190 outFile <<
"<HR>" <<
G4endl;
193 outFile << sTABLE <<
'"' <<
"60%" <<
'"' <<
" > " <<
G4endl;
195 outFile << sTR << sTD << sB <<
"Mass" << eB << eTD;
197 outFile <<
" [GeV/c" << sSUP <<
"2" << eSUP <<
"]" << eTD << eTR <<
G4endl;
199 outFile << sTR << sTD << sB <<
"Width" << eB << eTD;
201 outFile <<
" [GeV/c" << sSUP <<
"2" << eSUP <<
"]" << eTD << eTR <<
G4endl;
203 outFile << sTR << sTD << sB <<
"I J" << sSUP <<
"PC"<< eSUP << eB << eTD;
205 outFile << sTD <<
" ";
207 outFile << sTD <<
"1/2 ";
209 outFile << sTD <<
"3/2 ";
230 outFile << sSUP << sSYMBOL;
245 outFile << eSYMBOL << eSUP;
246 outFile << eTD << eTR <<
G4endl;
248 outFile << sTR << sTD << sB <<
"Charge" << eB << eTD;
250 outFile << eTD << eTR <<
G4endl;
252 outFile << sTR << sTD << sB <<
"Magnetic Moment" << eB << eTD;
255 outFile <<
"[MeV/T]" << eTD << eTR <<
G4endl;
257 outFile << sTD <<
" not defined ";
258 outFile << eTD << eTR <<
G4endl;
261 outFile << sTR << sTD << sB <<
"Life Time" << eB << eTD;
264 outFile <<
"[sec]" << eTD <<
G4endl;
267 outFile << sTD <<
"stable" << eTD;
269 outFile << sTD <<
"short-lived" << eTD;
271 outFile << sTD <<
"not Defined" << eTD;
276 outFile << eTABLE <<
G4endl;
277 outFile <<
"<HR>" <<
G4endl;
280 outFile <<
"<H2>" <<
" Quark Content " <<
"</H2>" <<
G4endl;
282 outFile << sTABLE <<
'"' <<
"60%" <<
'"' <<
" > " <<
G4endl;
285 outFile << sTD << sB <<
"flavour " << eB << eTD ;
286 outFile << sTD << sB <<
" quark " << eB << eTD;
287 outFile << sTD << sB <<
" anti-quark " << eB << eTD;
290 static const char* quarkName[6] = {
"d",
"u",
"s",
"c",
"b",
"t" };
291 for (
G4int flv = 0; flv <6 ; flv++ ){
293 outFile << sTD << sB << quarkName[flv] << eB << eTD ;
294 outFile << sTD << sB << particle->
GetQuarkContent(flv+1) << eB << eTD ;
298 outFile << eTABLE <<
G4endl;
299 outFile <<
"<HR>" <<
G4endl;
304 outFile <<
"<H2>" <<
" Decay Table " <<
"</H2>" <<
G4endl;
306 outFile << sTABLE <<
'"' <<
"80%" <<
'"' <<
" > " <<
G4endl;
309 outFile << sTD << sB <<
"BR" << eB << eTD ;
310 outFile << sTD << sB <<
"kinematics" << eB << eTD;
315 outFile << sTR <<
G4endl;;
317 outFile << sTD << channel->
GetBR() << eTD;
326 outFile << eTABLE <<
G4endl;
327 outFile <<
"<HR>" <<
G4endl;
331 outFile <<
"<A HREF=" <<
'"' <<
"index.html" <<
'"' <<
">back to index</A>";
334 PrintFooter(outFile);
337 void G4HtmlPPReporter::PrintHeader(std::ofstream& outFile)
339 outFile <<
"<HTML>" <<
G4endl;
340 outFile <<
"<HEAD>" <<
G4endl;
341 outFile <<
" <META HTTP-EQUIV=" <<
"\"" <<
" Content-Type" <<
"\"";
342 outFile <<
" CONTENT="
343 <<
"\"" <<
"text/html; charset=iso-8859-1"
345 outFile <<
" <TITLE>Geant4 Particle List </TITLE>" <<
G4endl;
346 outFile <<
"</HEAD>" <<
G4endl;
347 outFile <<
"<! -- Generated automatically by Geant4, "
349 outFile <<
"<BODY>" <<
G4endl;
352 void G4HtmlPPReporter::PrintFooter(std::ofstream& outFile)
354 outFile <<
"<HR>" <<
G4endl;
355 outFile <<
"</BODY>" <<
G4endl;
356 outFile <<
"</HTML>" <<
G4endl;
359const char* G4HtmlPPReporter::sTABLE =
"<TABLE WIDTH=";
360const char* G4HtmlPPReporter::eTABLE =
"</TABLE>";
361const char* G4HtmlPPReporter::sTR =
"<TR>";
362const char* G4HtmlPPReporter::eTR =
"</TR>";
363const char* G4HtmlPPReporter::sTD =
"<TD>";
364const char* G4HtmlPPReporter::eTD =
"</TD>";
365const char* G4HtmlPPReporter::sB =
"<B>";
366const char* G4HtmlPPReporter::eB =
"</B>";
367const char* G4HtmlPPReporter::sLFONT =
"<FONT SIZE = +1>";
368const char* G4HtmlPPReporter::eLFONT =
"</FONT>";
369const char* G4HtmlPPReporter::sSYMBOL =
"<FONT FACE = \"symbol\" >";
370const char* G4HtmlPPReporter::eSYMBOL =
"</FONT>";
371const char* G4HtmlPPReporter::sSUP =
"<SUP>";
372const char* G4HtmlPPReporter::eSUP =
"</SUP>";
373const char* G4HtmlPPReporter::sSUB =
"<SUB>";
374const char* G4HtmlPPReporter::eSUB =
"</SUB>";
G4VDecayChannel * GetDecayChannel(G4int index) const
virtual void Print(const G4String &option="")
virtual ~G4HtmlPPReporter()
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)