lcsim/src/org/lcsim/mc/fast/reconstructedparticle
diff -u -r1.8 -r1.9
--- MCFastReconstructedParticle.java 8 Sep 2006 03:19:45 -0000 1.8
+++ MCFastReconstructedParticle.java 7 Oct 2006 00:25:28 -0000 1.9
@@ -1,5 +1,6 @@
package org.lcsim.mc.fast.reconstructedparticle;
+import org.lcsim.mc.fast.MCFast;
import hep.physics.vec.BasicHep3Vector;
import hep.physics.vec.BasicHepLorentzVector;
import hep.physics.vec.Hep3Vector;
@@ -42,12 +43,10 @@
private List<Track> _tracks = new ArrayList<Track>();
private BasicHepLorentzVector p_reco = new BasicHepLorentzVector();
private BasicHepLorentzVector p_track = new BasicHepLorentzVector();
- private static long iprint=0;
public MCFastReconstructedParticle(Track t, ParticleType type, Particle p, Cluster assoc_c, double wtcal)
{
- iprint++;
- if(iprint < -200) System.out.println(" PDGID= "+type.getPDGID()+" t.getPX,...= "+t.getPX()+" "+t.getPY()+" "+t.getPZ());
+ MCFast.log.info(" PDGID= "+type.getPDGID()+" t.getPX,...= "+t.getPX()+" "+t.getPY()+" "+t.getPZ());
_mass = type.getMass();
addTrack(t);
_charge = t.getCharge();
@@ -56,18 +55,15 @@
e_track = sqrt(((ReconTrack)t).getDocaMomentumVec(_referencePoint).magnitudeSquared()+ _mass*_mass);
p_track.setV3(e_track, ((ReconTrack)t).getDocaMomentumVec(_referencePoint));
p3_track = p_track.v3();
- if (iprint < -200)
+ if (assoc_c != null)
{
- if (assoc_c != null)
- {
- System.out.println(" PDGID= "+type.getPDGID()+" e_track= "+e_track+" e_assoc_clus= "+assoc_c.getEnergy());
- System.out.println(" PDGID= "+type.getPDGID()+" _referencePoint= "+_referencePoint.x()+" "+_referencePoint.y()+" "+_referencePoint.z());
- System.out.println(" PDGID= "+type.getPDGID()+" p3_track= "+p3_track.x()+" "+p3_track.y()+" "+p3_track.z());
- }
- else
- {
- System.out.println(" assoc_c = null PDGID= "+type.getPDGID());
- }
+ MCFast.log.info(" PDGID= "+type.getPDGID()+" e_track= "+e_track+" e_assoc_clus= "+assoc_c.getEnergy());
+ MCFast.log.info(" PDGID= "+type.getPDGID()+" _referencePoint= "+_referencePoint.x()+" "+_referencePoint.y()+" "+_referencePoint.z());
+ MCFast.log.info(" PDGID= "+type.getPDGID()+" p3_track= "+p3_track.x()+" "+p3_track.y()+" "+p3_track.z());
+ }
+ else
+ {
+ MCFast.log.info(" assoc_c = null PDGID= "+type.getPDGID());
}
if ( assoc_c != null && wtcal > 0. && abs(type.getPDGID()) != 11 )
{
@@ -89,6 +85,23 @@
_mass = type.getMass();
addCluster(c);
double e = c.getEnergy();
+ if (e < _mass)
+ {
+ if(e > _mass-1.e-5 && e > Double.MIN_VALUE)
+ {
+ _mass = e-Double.MIN_VALUE;
+ }
+ else
+ {
+ MCFast.log.warning(" MCFastReconstructedParticle e < _mass e= "+e+" _mass= "+_mass);
+ MCFast.log.warning(" MCFastReconstructedParticle type = "+type) ;
+ MCFast.log.warning(" MCFastReconstructedParticle program will continue, but problem should be fixed ");
+ _mass = e-Double.MIN_VALUE;
+ // System.exit(0);
+ }
+
+ }
+
double pm = sqrt(e*e-_mass*_mass);
// get direction from position of cluster and assume it comes from the origin
double[] point = c.getPosition();
@@ -107,18 +120,15 @@
public MCFastReconstructedParticle(double[] vxd, double[] mom, double mass, double charge, ParticleType type)
{
- iprint++;
_mass = mass;
_charge = charge;
_referencePoint = new BasicHep3Vector(vxd);
p3_track = new BasicHep3Vector(mom);
e_reco = sqrt(pow(_mass,2)+p3_track.magnitudeSquared());
p_reco.setV3(e_reco,p3_track);
- if (iprint < -200) {
- System.out.println(" PDGID= "+type.getPDGID()+" e_reco= "+e_reco+" mass= "+_mass);
- System.out.println(" PDGID= "+type.getPDGID()+" _referencePoint= "+_referencePoint.x()+" "+_referencePoint.y()+" "+_referencePoint.z());
- System.out.println(" PDGID= "+type.getPDGID()+" p3_track= "+p3_track.x()+" "+p3_track.y()+" "+p3_track.z());
- }
+ MCFast.log.info(" PDGID= "+type.getPDGID()+" e_reco= "+e_reco+" mass= "+_mass);
+ MCFast.log.info(" PDGID= "+type.getPDGID()+" _referencePoint= "+_referencePoint.x()+" "+_referencePoint.y()+" "+_referencePoint.z());
+ MCFast.log.info(" PDGID= "+type.getPDGID()+" p3_track= "+p3_track.x()+" "+p3_track.y()+" "+p3_track.z());
addParticleID(new MCFastParticleID(type));
}