Definition at line 18 of file Collision.java.
Public Member Functions | |
Collision (int id) throws JetWebException | |
Collision () | |
Collision | addParticle (Particle p, Integer pNumber) throws JetWebException |
void | addParticle (Particle p) throws JetWebException |
Collection< Particle > | getParticles () |
Integer | getNumberOfParticles () |
void | setId (int id) |
Particle | getParticle1 () |
Particle | getParticle2 () |
boolean | equals (Object obj) |
int | hashCode () |
int | getId () |
boolean | retrieve () throws JetWebException |
boolean | store () throws JetWebException |
double | getCMEnergy () |
String | toString () |
Static Public Member Functions | |
Vector< Collision > | getAll () |
Private Member Functions | |
void | calcCME () |
Private Attributes | |
double | ecms = -1.0 |
HashMap< Integer, Particle > | particles |
int | collisionId = 0 |
Particle | particle1 |
Particle | particle2 |
|
Create a collision from a unique collision ID. Definition at line 31 of file Collision.java. References Collision.collisionId, and Collision.retrieve(). 00031 { 00032 00033 collisionId = id; 00034 retrieve(); 00035 00036 }
|
|
Create an empty collision. Definition at line 40 of file Collision.java. 00040 { 00041 }
|
|
Definition at line 54 of file Collision.java. References Collision.particles. 00055 { 00056 00057 if(particles.size()>=2){ 00058 throw new JetWebException("Too many particles for this collision", 00059 p.getName()); 00060 } 00061 00062 Integer pNumber = null; 00063 Integer ii=1; 00064 while(pNumber==null){ 00065 if (particles.get(ii)==null){ 00066 pNumber = ii; 00067 } 00068 ++ii; 00069 } 00070 00071 if(pNumber >2){ 00072 throw new JetWebException("Too many particles for this collision", 00073 p.getName()); 00074 } 00075 00076 particles.put(pNumber, p); 00077 }
|
|
Definition at line 43 of file Collision.java. References Collision.particles. Referenced by JetWebLogReader.fillCollision(). 00044 { 00045 if(pNumber >2){ 00046 throw new JetWebException("Too many particles for this collision", 00047 p.getName()); 00048 } 00049 particles.put(pNumber, p); 00050 00051 return this; 00052 }
|
|
Definition at line 168 of file Collision.java. References Collision.ecms, Collision.getParticle1(), and Collision.getParticle2(). Referenced by Collision.getCMEnergy(). 00168 { 00169 ecms = 2.*Math.sqrt( getParticle1().getEnergy()* 00170 getParticle2().getEnergy() ); 00171 }
|
|
Override the Object equals method. Use the processId. Definition at line 98 of file Collision.java. References Collision.collisionId, Particle.equals(), Collision.getId(), Collision.getParticle1(), and Collision.getParticle2(). Referenced by MCProcessType.matches(). 00098 { 00099 00100 if (obj==null) { return false; } 00101 00102 if ( !this.getClass().equals(obj.getClass()) ) { return false; } 00103 00104 Collision c = (Collision)obj; 00105 if (collisionId>0 && c.getId() > 0){ 00106 return (collisionId==c.getId()); 00107 } else { 00108 return (getParticle1().equals(c.getParticle1()) && 00109 getParticle2().equals(c.getParticle2()) ); 00110 } 00111 }
|
|
Returns a list of all valid Collisions in the database. Definition at line 158 of file Collision.java. 00158 { 00159 try { 00160 Vector<Collision> colls = DBManager.getAllCollisions(); 00161 return colls; 00162 } catch (JetWebException j) { 00163 System.out.println(j); 00164 return null; 00165 } 00166 }
|
|
Gets beam centre-of-mass energy
Definition at line 147 of file Collision.java. References Collision.calcCME(), and Collision.ecms. Referenced by HTMLJobWriter.getDescription().
|
|
Get the unique ID of the object Implements Storeable. Definition at line 115 of file Collision.java. References Collision.collisionId. Referenced by HTMLProcessWriter.addNewProcess(), MCProcessType.compareTo(), HTMLProcessWriter.display(), Collision.equals(), JetWebLogReader.fillCollision(), MCProcessType.getCollisionId(), RealPlot.getMCProcessType(), DBManager.selectId(), and HTMLPaperWriter.writePlotEntry(). 00115 { 00116 if (collisionId==0) { 00117 // See if this collision is one we understand. 00118 try { 00119 00120 System.out.println("Looking up Collison Id in DB"); 00121 00122 DBManager.selectId(this); 00123 00124 System.out.println("collision id = "+collisionId); 00125 00126 } catch (Exception e){ 00127 collisionId=-1; 00128 } 00129 } 00130 if (collisionId==0) collisionId=-1; 00131 return collisionId; 00132 }
|
|
Definition at line 84 of file Collision.java. References Collision.particles. Referenced by JetWebLogReader.fillCollision(). 00084 { 00085 return(particles.size()); 00086 }
|
|
Definition at line 90 of file Collision.java. References Collision.particles. Referenced by Collision.calcCME(), Collision.equals(), MCProcessType.getBeams(), HTMLJobWriter.getDescription(), MCProcessType.hasPhoton(), MCProcessType.hasProton(), and Collision.toString(). 00090 { return particles.get(1); }
|
|
Definition at line 92 of file Collision.java. References Collision.particles. Referenced by Collision.calcCME(), Collision.equals(), MCProcessType.getBeams(), HTMLJobWriter.getDescription(), MCProcessType.hasPhoton(), MCProcessType.hasProton(), and Collision.toString(). 00092 { return particles.get(2); }
|
|
Definition at line 80 of file Collision.java. References Collision.particles. 00080 { 00081 return particles.values(); 00082 }
|
|
Definition at line 113 of file Collision.java. 00113 { return collisionId; }
|
|
Populate the object in memory from the database. Return true if the information retrieved is up to date. Implements Storeable. Definition at line 134 of file Collision.java. Referenced by Collision.Collision(). 00134 { 00135 return DBManager.selectFromDB(this); 00136 }
|
|
Definition at line 88 of file Collision.java. References Collision.collisionId. 00088 {collisionId = id; }
|
|
Write the object in memory to the database. If the ID does not exist in the DB the object is inserted as a new entry. If the ID exists, that entry is updated.
Implements Storeable. Definition at line 138 of file Collision.java. 00138 { 00139 return DBManager.addToDB(this); 00140 }
|
|
Definition at line 173 of file Collision.java. References Collision.getParticle1(), Collision.getParticle2(), and Particle.toString(). Referenced by HTMLProcessWriter.addNewProcess(), HTMLProcessWriter.display(), MCProcessType.toString(), and HTMLPaperWriter.writePlotEntry(). 00173 { 00174 00175 StringBuffer str = new StringBuffer(); 00176 str.append(getParticle1().getEnergy()); 00177 str.append(getParticle1().getName()); 00178 str.append("_"); 00179 str.append(getParticle2().getEnergy()); 00180 str.append(getParticle2().getName()); 00181 return str.toString(); 00182 }
|
|
Definition at line 24 of file Collision.java. Referenced by Collision.Collision(), Collision.equals(), Collision.getId(), and Collision.setId(). |
|
Definition at line 20 of file Collision.java. Referenced by Collision.calcCME(), and Collision.getCMEnergy(). |
|
Definition at line 25 of file Collision.java. |
|
Definition at line 26 of file Collision.java. |
|
Initial value:
new HashMap<Integer Particle>()
Definition at line 22 of file Collision.java. Referenced by Collision.addParticle(), Collision.getNumberOfParticles(), Collision.getParticle1(), Collision.getParticle2(), and Collision.getParticles(). |
Generated Wed Jan 17 09:14:27 GMT 2007