Print

Print


Commit in lcsim/src/org/lcsim/contrib/Cassell/recon/Cheat on MAIN
CheatReconDriver.java+50-141.1 -> 1.2
Intermediate checkin while I work on it

lcsim/src/org/lcsim/contrib/Cassell/recon/Cheat
CheatReconDriver.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- CheatReconDriver.java	28 Apr 2007 00:35:09 -0000	1.1
+++ CheatReconDriver.java	30 Aug 2007 18:14:12 -0000	1.2
@@ -47,16 +47,16 @@
     String outCname = "CheatReconClusters";
     String[] diginames = {"EcalBarrDigiHits", "EcalEndcapDigiHits",
         "HcalBarrDigiHits", "HcalEndcapDigiHits"};
-    double mintfromin = 4;
-    double mintfromout = 3;
-    double mintlength = 10.;
-    double ptcut = .1;
-    double emR = 1270.;
-    double emZ = 1680.;
-    double tccut = 200.;
-    double minneutlen = 200.;
-    Map<MCParticle,Track> tmap;
-    CheatParticleDriver cpd;
+        double mintfromin = 4;
+        double mintfromout = 3;
+        double mintlength = 100.;
+        double ptcut = .1;
+        double emR = 1270.;
+        double emZ = 1680.;
+        double tccut = 400.;
+        double minneutlen = 200.;
+        Map<MCParticle,Track> tmap;
+        CheatParticleDriver cpd;
         /** Creates a new instance of CheatSimReconParticleDriver */
         public CheatReconDriver()
         {
@@ -194,6 +194,42 @@
 //
 //     Done checking for parentage replacement. Now check for offspring replacement
 //
+//
+//     Start with a special case for photon conversions. Only replace the photon
+//     if both electrons are trackable
+//
+                if(p.getPDGID() == 22)
+                {
+                    if(hasTrackableDaughters(p))
+                    {
+                        boolean hasep = false;
+                        boolean hasem = false;
+                        for(MCParticle d:p.getDaughters())
+                        {
+                            if(d.getSimulatorStatus().isBackscatter())continue;
+                            if(d.getSimulatorStatus().vertexIsNotEndpointOfParent())continue;
+                            if(tmap.containsKey(d))
+                            {
+                                if(d.getPDGID() == 11)hasem = true;
+                                if(d.getPDGID() == -11)hasep = true;
+                            }
+                        }
+                        if(hasem&&hasep)
+                        {
+                            remove.add(p);
+                            for(MCParticle d:p.getDaughters())
+                            {
+                                if(d.getSimulatorStatus().isBackscatter())continue;
+                                if(d.getSimulatorStatus().vertexIsNotEndpointOfParent())continue;
+                                add.add(d);
+                            }
+                        }
+                    }
+                    continue;
+                }
+//
+//     And on to the general case
+//
                 if(hasTrackableDaughters(p))
                 {
                     remove.add(p);
@@ -347,8 +383,8 @@
             Hep3Vector vtx = p.getOrigin();
             Hep3Vector ep = p.getEndPoint();
             double d = Math.sqrt( (ep.x()-vtx.x())*(ep.x()-vtx.x()) +
-                                  (ep.y()-vtx.y())*(ep.y()-vtx.y()) + 
-                                  (ep.z()-vtx.z())*(ep.z()-vtx.z()) );
+                (ep.y()-vtx.y())*(ep.y()-vtx.y()) +
+                (ep.z()-vtx.z())*(ep.z()-vtx.z()) );
             if(d > mintlength)
             {
                 if( (Math.sqrt(ep.x()*ep.x()+ep.y()*ep.y())>emR)||(Math.abs(ep.z())>emZ) )
@@ -425,8 +461,8 @@
                     Hep3Vector v = par.getOrigin();
                     Hep3Vector e = par.getEndPoint();
                     double l = Math.sqrt( (e.x()-v.x())*(e.x()-v.x()) +
-                                          (e.y()-v.y())*(e.y()-v.y()) +
-                                          (e.z()-v.z())*(e.z()-v.z()) );
+                        (e.y()-v.y())*(e.y()-v.y()) +
+                        (e.z()-v.z())*(e.z()-v.z()) );
                     if(l > length)
                     {
                         length = l;
CVSspam 0.2.8