protected void Add(Particle particle) { IInteractStrong strong = particle as IInteractStrong; if (strong == null) { throw new Exception("INVALID HADRONIC STRUCTURE!"); } bottomness += strong.Bottomness; topness += strong.Topness; strangeness += strong.Strangeness; charmness += strong.Charmness; isospinZ += strong.IsospinZ; hypercharge += strong.Hypercharge; IInteractElectromagnetic eCharged = particle as IInteractElectromagnetic; if (eCharged != null) { electricCharge += eCharged.ElectricCharge; } this.constituents.Add(particle); }
// TABLES private string DisplayGaugeBosonsTable() { StringBuilder str = new StringBuilder(); str.Append("GAUGE BOSONS"); str.Append("<TABLE BORDER=1 BGCOLOR=#CFCFCF STYLE='COLOR=#000000'>"); str.Append("<TR ALIGN=CENTER BGCOLOR=#AAAAAA STYLE='COLOR=#FFFFFF'>"); str.Append("<TD>NAME</TD>"); str.Append("<TD>SYMBOL</TD>"); str.Append("<TD>CHARGE</TD>"); str.Append("<TD>SPIN</TD>"); str.Append("<TD>OBSERVED</TD>"); str.Append("<TR>"); foreach (Particle particle in particles) { if (particle is GaugeBoson) { GaugeBoson p = (GaugeBoson)particle; str.Append("<TR ALIGN=CENTER BGCOLOR=#EAEAEA>"); str.Append("<TD>" + p.GetType().Name + "</TD>"); str.Append("<TD>" + p.Symbol + "</TD>"); IInteractElectromagnetic e = p as IInteractElectromagnetic; if (e != null) { str.Append("<TD>" + e.ElectricCharge + "</TD>"); } else { str.Append("<TD>0</TD>"); } str.Append("<TD>" + p.Spin + "</TD>"); str.Append("<TD>" + p.Observed + "</TD>"); str.Append("<TR>"); } } str.Append("</TABLE>"); return(str.ToString()); }
private string DisplayLeptonsTable() { StringBuilder str = new StringBuilder(); str.Append("LEPTONS"); str.Append("<TABLE BORDER=1 BGCOLOR=#CFCFCF STYLE='COLOR=#000000'>"); str.Append("<TR ALIGN=CENTER BGCOLOR=#AAAAAA STYLE='COLOR=#FFFFFF'>"); str.Append("<TD>SYMBOL</TD>"); str.Append("<TD>NAME</TD>"); str.Append("<TD>CHARGE</TD>"); str.Append("<TD>T<SUB>Z</SUB></TD>"); str.Append("<TD>Y<SUB>W</SUB></TD>"); str.Append("<TR>"); foreach (Particle particle in particles) { if (particle is Lepton) { Lepton p = (Lepton)particle; str.Append("<TR ALIGN=CENTER BGCOLOR=#EAEAEA>"); str.Append("<TD>" + p.Symbol + "</TD>"); str.Append("<TD>" + p.GetType().Name + "</TD>"); IInteractElectromagnetic e = p as IInteractElectromagnetic; if (e != null) { str.Append("<TD>" + e.ElectricCharge + "</TD>"); } else { str.Append("<TD>0</TD>"); } str.Append("<TD>" + p.WeakIsospin + "</TD>"); str.Append("<TD>" + p.WeakHypercharge + "</TD>"); str.Append("<TR>"); } } str.Append("</TABLE>"); return(str.ToString()); }