Print

Print


Commit in lcsim-contrib/src/main/java/org/lcsim/contrib/Cassell/recon/analysis on MAIN
SPFinderSingleParticleTest.java+235added 1.1
SingleChargedReconAnal.java+490added 1.1
+725
2 added files
Single particle tests of new initial mip finding

lcsim-contrib/src/main/java/org/lcsim/contrib/Cassell/recon/analysis
SPFinderSingleParticleTest.java added at 1.1
diff -N SPFinderSingleParticleTest.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ SPFinderSingleParticleTest.java	6 Oct 2010 19:09:48 -0000	1.1
@@ -0,0 +1,235 @@
+package org.lcsim.contrib.Cassell.recon.analysis;
+import org.lcsim.util.Driver;
+import org.lcsim.event.EventHeader;
+import org.lcsim.event.ReconstructedParticle;
+import org.lcsim.event.MCParticle;
+import org.lcsim.event.Track;
+import org.lcsim.event.Cluster;
+import org.lcsim.event.CalorimeterHit;
+import org.lcsim.recon.cluster.util.*;
+import hep.physics.vec.*;
+import org.lcsim.util.aida.AIDA;
+import hep.aida.*;
+import org.lcsim.recon.ui.ReconDriver;
+import org.lcsim.recon.cheater.*;
+import java.util.*;
+import org.lcsim.digisim.DigiPackageDriver;
+import org.lcsim.recon.pfa.output.FlushReconstructedParticlesDriver;
+import org.lcsim.recon.pfa.structural.SetUpPFA;
+import org.lcsim.recon.util.CalorimeterInformation;
+import org.lcsim.contrib.Cassell.recon.RemoveHcalModuleNonProjBorderHits;
+import org.lcsim.geometry.IDDecoder;
+import org.lcsim.geometry.Calorimeter;
+import org.lcsim.geometry.Calorimeter.CalorimeterType;
+import org.lcsim.geometry.compact.Subdetector;
+import org.lcsim.geometry.subdetector.*;
+import org.lcsim.geometry.Detector;
+import org.lcsim.recon.cluster.mipfinder.trackxtrap.*;
+/**
+ *
+ * @author cassell
+ */
+public class SPFinderSingleParticleTest extends Driver
+{
+    private AIDA aida = AIDA.defaultInstance();
+    int ievt;
+    int nbh;
+    int nct;
+    int ntr;
+    int[] nsfm;
+    String ebsub;
+    String hbsub;
+    String eesub;
+    String hesub;
+    CalorimeterInformation ci;
+    int mx = 10000000;
+    int nmax = 10000000;
+    String[] pre0 = {"Barrel/","Cross/","Endcap/"};
+    public SPFinderSingleParticleTest()
+    {
+//       add(new ReconDriver());
+       ievt = 0;
+       nbh = 0;
+       nct = 0;
+       ntr = 0;
+       nsfm = new int[2];
+    }
+    protected void process(EventHeader event)
+    {
+       if(ci == null)
+       {
+          ci = CalorimeterInformation.instance();
+          ebsub = ci.getName("EM_BARREL");
+          hbsub = ci.getName("HAD_BARREL");
+          eesub = ci.getName("EM_ENDCAP");
+          hesub = ci.getName("HAD_ENDCAP");
+       }
+       List<MCParticle> mcl = event.get(MCParticle.class,"MCParticle");
+       MCParticle thisp = mcl.get(mcl.size()-1);
+       Hep3Vector ep = thisp.getEndPoint();
+       Hep3Vector mom = thisp.getMomentum();
+       double R = Math.sqrt(ep.x()*ep.x()+ep.y()*ep.y());
+       double Z = Math.abs(ep.z());
+       double ct = Math.abs(mom.z())/mom.magnitude();
+       ievt++;
+       System.out.println("Processing event "+ievt);
+       int ctb = 0;
+       if(ct < .75)ctb = 0;
+       else if(ct < .82)ctb = 1;
+       else if(ct < .97)ctb = 2;
+       else
+       {
+             nct++;
+             return;
+       }
+          if( (R < ci.getRMin("EM_BARREL"))&&(Z < ci.getZMin("EM_ENDCAP")) )
+          {
+//             System.out.println("Interaction before Ecal");
+             nbh++;
+             return;
+          }
+        super.process(event);
+        if(event.get(Track.class,"Tracks").size() != 1)
+        {
+           ntr++;
+           return;
+        }
+        List<TrackXtrapInfo> txil = new ArrayList<TrackXtrapInfo>(event.get(TrackXtrapInfo.class,"TrackXtrapInfo"));
+        TrackXtrapInfo txi = txil.get(0);
+         List<XtrapPosition> xpl = txi.getPositions();
+         int lastind = -1;
+         CalorimeterType[] sct = new CalorimeterType[xpl.size()];
+         int[] slay = new int[xpl.size()];
+         for(int i=0;i<xpl.size();i++)
+         {
+            XtrapPosition xp = xpl.get(i);
+            slay[i] = xp.getLayer();
+            sct[i] = xp.getCalorimeterType();
+            if(xpl.get(i).getPosition().magnitudeSquared() > ep.magnitudeSquared())continue;
+            lastind++;
+         }
+         int lay = -1;
+         String pre0 = "epECAL/";
+         String pre1 = "epBarrel/";
+         if(lastind > -1)
+         {
+            XtrapPosition xp = xpl.get(lastind);
+            lay = xp.getLayer();
+            CalorimeterType thisct = xp.getCalorimeterType();
+            if(thisct == CalorimeterType.HAD_BARREL)
+            {
+               lay += ci.getNLayers(CalorimeterType.EM_BARREL);
+               pre0 = "epHCAL/";
+            }
+            else if(thisct == CalorimeterType.HAD_ENDCAP)
+            {
+               lay += ci.getNLayers(CalorimeterType.EM_ENDCAP);
+               pre0 = "epHCAL/";
+               pre1 = "epEndcap/";
+            }
+            else if(thisct == CalorimeterType.EM_ENDCAP)
+            {
+               pre1 = "epEndcap/";
+            }
+         }
+//        System.out.println("Endpoint layer = "+lay);
+        aida.cloud1D("Endpoint layer",nmax).fill(lay);
+        List<List<Cluster>> cll = event.get(Cluster.class);
+        for(List<Cluster> cl:cll)
+        {
+           String name = event.getMetaData(cl).getName();
+           if(name.contains("ShowerFinder"))
+           {
+              String ppre = name +"/";
+              if(cl.size() != 1)
+              {
+                 aida.cloud1D(ppre+"No mip/Endpoint layer",nmax).fill(lay);
+                 aida.cloud1D(ppre+"No mip/Endpoint step",nmax).fill(lastind);
+                 aida.cloud1D(ppre+"No mip/MC energy",nmax).fill(thisp.getEnergy());
+                 aida.cloud1D(ppre+"No mip/MC cos theta",nmax).fill(ct);
+                 aida.cloud1D(ppre+pre0+"No mip/Endpoint layer",nmax).fill(lay);
+                 aida.cloud1D(ppre+pre0+"No mip/Endpoint step",nmax).fill(lastind);
+                 aida.cloud1D(ppre+pre0+"No mip/MC energy",nmax).fill(thisp.getEnergy());
+                 aida.cloud1D(ppre+pre0+"No mip/MC cos theta",nmax).fill(ct);
+                 aida.cloud1D(ppre+pre0+pre1+"No mip/Endpoint layer",nmax).fill(lay);
+                 aida.cloud1D(ppre+pre0+pre1+"No mip/Endpoint step",nmax).fill(lastind);
+                 aida.cloud1D(ppre+pre0+pre1+"No mip/MC energy",nmax).fill(thisp.getEnergy());
+                 aida.cloud1D(ppre+pre0+pre1+"No mip/MC cos theta",nmax).fill(ct);
+                 continue;
+              }
+              int nhim = cl.get(0).getCalorimeterHits().size();
+              aida.cloud1D(ppre+"# hits in mip",nmax).fill(nhim);
+              aida.cloud1D(ppre+pre0+"# hits in mip",nmax).fill(nhim);
+              aida.cloud1D(ppre+pre0+pre1+"# hits in mip",nmax).fill(nhim);
+              double maxR = 0.;
+              CalorimeterHit lh = null;
+              Hep3Vector lp = new BasicHep3Vector();
+              for(CalorimeterHit h:cl.get(0).getCalorimeterHits())
+              {
+                 Hep3Vector pp = new BasicHep3Vector(h.getPosition());
+                 double rr = pp.magnitude();
+                 if(rr > maxR)
+                 {
+                    maxR = rr;
+                    lp = pp;
+                    lh = h;
+                 }
+              }
+              IDDecoder idd = lh.getIDDecoder();
+              idd.setID(lh.getCellID());
+              int foundlay = idd.getVLayer();
+              CalorimeterType ct1 = ( (Calorimeter) (lh.getSubdetector()) ).getCalorimeterType();
+              int foundstep = -1;
+              for(int i=0;i<xpl.size();i++)
+              {
+                 if( (slay[i] == foundlay)&&(sct[i] == ct1) )
+                 {
+                    foundstep = i;
+                    break;
+                 }
+              }
+              if(ct1 == CalorimeterType.HAD_BARREL)foundlay += ci.getNLayers(CalorimeterType.EM_BARREL);
+              if(ct1 == CalorimeterType.HAD_ENDCAP)foundlay += ci.getNLayers(CalorimeterType.EM_ENDCAP);
+//              System.out.println(ppre+" found ep layer = "+foundlay);
+              int nrp = event.get(ReconstructedParticle.class,"ReconstructedParticles").size();
+              aida.cloud1D(ppre+"# Recon particles",nmax).fill(nrp);
+              aida.cloud1D(ppre+pre0+"# Recon particles",nmax).fill(nrp);
+              aida.cloud1D(ppre+pre0+pre1+"# Recon particles",nmax).fill(nrp);
+              int dlay = foundlay - lay;
+              int dstep = foundstep - lastind;
+              aida.cloud1D(ppre+"Endpoint layer",nmax).fill(lay);
+              aida.cloud1D(ppre+"Found layer",nmax).fill(foundlay);
+              aida.cloud1D(ppre+"Delta layer",nmax).fill(dlay);
+              aida.cloud2D(ppre+"Dlay vs Elay",nmax).fill(lay,dlay);
+              aida.cloud1D(ppre+"Endpoint step",nmax).fill(lastind);
+              aida.cloud1D(ppre+"Found step",nmax).fill(foundstep);
+              aida.cloud1D(ppre+"Delta step",nmax).fill(dstep);
+              aida.cloud2D(ppre+"Dstep vs Estep",nmax).fill(lastind,dstep);
+              aida.cloud1D(ppre+pre0+"Endpoint layer",nmax).fill(lay);
+              aida.cloud1D(ppre+pre0+"Found layer",nmax).fill(foundlay);
+              aida.cloud1D(ppre+pre0+"Delta layer",nmax).fill(dlay);
+              aida.cloud2D(ppre+pre0+"Dlay vs Elay",nmax).fill(lay,dlay);
+              aida.cloud1D(ppre+pre0+"Endpoint step",nmax).fill(lastind);
+              aida.cloud1D(ppre+pre0+"Found step",nmax).fill(foundstep);
+              aida.cloud1D(ppre+pre0+"Delta step",nmax).fill(dstep);
+              aida.cloud2D(ppre+pre0+"Dstep vs Estep",nmax).fill(lastind,dstep);
+              aida.cloud1D(ppre+pre0+pre1+"Endpoint layer",nmax).fill(lay);
+              aida.cloud1D(ppre+pre0+pre1+"Found layer",nmax).fill(foundlay);
+              aida.cloud1D(ppre+pre0+pre1+"Delta layer",nmax).fill(dlay);
+              aida.cloud2D(ppre+pre0+pre1+"Dlay vs Elay",nmax).fill(lay,dlay);
+              aida.cloud1D(ppre+pre0+pre1+"Endpoint step",nmax).fill(lastind);
+              aida.cloud1D(ppre+pre0+pre1+"Found step",nmax).fill(foundstep);
+              aida.cloud1D(ppre+pre0+pre1+"Delta step",nmax).fill(dstep);
+              aida.cloud2D(ppre+pre0+pre1+"Dstep vs Estep",nmax).fill(lastind,dstep);
+           }
+        }
+   }
+   protected void suspend()
+   {
+       System.out.println(ievt+" events processed");
+       System.out.println(nbh+" interactions before Ecal");
+       System.out.println(nct+" with cos theta > .97");
+       System.out.println(ntr+" events with no track");
+   }
+    
+}

lcsim-contrib/src/main/java/org/lcsim/contrib/Cassell/recon/analysis
SingleChargedReconAnal.java added at 1.1
diff -N SingleChargedReconAnal.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ SingleChargedReconAnal.java	6 Oct 2010 19:09:49 -0000	1.1
@@ -0,0 +1,490 @@
+package org.lcsim.contrib.Cassell.recon.analysis;
+import org.lcsim.util.Driver;
+import org.lcsim.event.EventHeader;
+import org.lcsim.event.ReconstructedParticle;
+import org.lcsim.event.MCParticle;
+import org.lcsim.event.Cluster;
+import org.lcsim.event.Track;
+import org.lcsim.event.CalorimeterHit;
+import org.lcsim.recon.cluster.util.*;
+import hep.physics.vec.*;
+import org.lcsim.util.aida.AIDA;
+import org.lcsim.recon.cheater.*;
+import java.util.*;
+import org.lcsim.digisim.DigiPackageDriver;
+import org.lcsim.recon.pfa.output.FlushReconstructedParticlesDriver;
+import org.lcsim.recon.pfa.structural.SetUpPFA;
+import org.lcsim.recon.util.*;
+import hep.aida.*;
+import org.lcsim.recon.ui.*;
+import org.lcsim.recon.cluster.muonfinder.*;
+/**
+ *
+ * @author cassell
+ */
+public class SingleChargedReconAnal extends Driver
+{
+      IAnalysisFactory     af ;
+      ITree                tree ;
+      IDataPointSetFactory dpsf ;
+       IHistogramFactory hf;
+      IDataPointSet dataPointSet;
+    private AIDA aida = AIDA.defaultInstance();
+    int ievt;
+    String CheatReconRname = "ReconPerfectReconParticles";
+    String CheatReconFSname = "ReconFSParticles";
+    CalorimeterInformation ci;
+    ClusterEnergyCalculator cecnh;
+    ClusterEnergyCalculator cecph;
+    int[][][] ntot;
+    int[][][] p0;
+    int[][][] p1;
+    int[][][] p2;
+    int[][][] p3;
+    int[][][] nrph;
+    int[][][] nrnh;
+    int[][][] nr;
+    double[][][] rE;
+    double[][][] calEsf;
+    double[][][] nEsf;
+    double[] Evals = {1.,2.,5.,10.,20.,50.,100.};
+    double[] ctlims = {.8,.97};
+    int nphibins = 10;
+    public SingleChargedReconAnal()
+    {
+       add(new ReconDriver());
+       add(new SPFinderSingleParticleTest());
+        // Cash general calorimeter information
+//        add(new CalInfoDriver());
+    	// Run digisim.
+//        add(new DigiPackageDriver());
+        
+       ievt = 0;
+       cecnh = new QNeutralHadronClusterEnergyCalculator();
+       cecph = new QPhotonClusterEnergyCalculator();
+       ntot = new int[Evals.length][ctlims.length][nphibins];
+       p0 = new int[Evals.length][ctlims.length][nphibins];
+       p1 = new int[Evals.length][ctlims.length][nphibins];
+       p2 = new int[Evals.length][ctlims.length][nphibins];
+       p3 = new int[Evals.length][ctlims.length][nphibins];
+       nrph = new int[Evals.length][ctlims.length][nphibins];
+       nrnh = new int[Evals.length][ctlims.length][nphibins];
+       nr = new int[Evals.length][ctlims.length][nphibins];
+       rE = new double[Evals.length][ctlims.length][nphibins];
+       calEsf = new double[Evals.length][ctlims.length][nphibins];
+       nEsf = new double[Evals.length][ctlims.length][nphibins];
+    }
+    protected void process(EventHeader event)
+    {
+       if(ci == null)ci = CalorimeterInformation.instance();
+       List<MCParticle> mcl = event.get(MCParticle.class,"MCParticle");
+       MCParticle thisp = mcl.get(mcl.size()-1);
+       int pdg = Math.abs(thisp.getPDGID());
+       Hep3Vector ep = thisp.getEndPoint();
+       double R = Math.sqrt(ep.x()*ep.x()+ep.y()*ep.y());
+       double Z = Math.abs(ep.z());
+          if( (R < ci.getRMin("EM_BARREL"))&&(Z < ci.getZMin("EM_ENDCAP")) )return;
+        super.process(event);
+       double E = thisp.getEnergy();
+       Hep3Vector p = thisp.getMomentum();
+       double costh = Math.abs(p.z())/p.magnitude();
+       double scth = p.z()/p.magnitude();
+       aida.cloud1D("Gen cos theta").fill(scth);
+       if(event.get(Track.class,"Tracks").size() > 0)aida.cloud1D("Gen ct with Track").fill(scth);
+       if(costh > ctlims[ctlims.length -1])return;
+       int Ebin = -1;
+       int Abin = -1;
+       for(int i=0;i<Evals.length;i++)
+       {
+          if(Math.abs(E-Evals[i])< .2)
+          {
+             Ebin = i;
+             break;
+          }
+       }
+       for(int i=0;i<ctlims.length;i++)
+       {
+          if(costh <= ctlims[i])
+          {
+             Abin = i;
+             break;
+          }
+       }
+       double phi = Math.atan2(p.y(),p.x());
+       double phif = phi;
+       while(phif > Math.PI/12.)phif -= Math.PI/6.;
+       while(phif < -Math.PI/12.)phif += Math.PI/6.;
+       double phidf2 = phif*180./Math.PI;
+       double phistep = Math.PI/6./nphibins;
+       double minphi = -Math.PI/12.;
+       int phibin = 0;
+       for(int i=0;i<nphibins;i++)
+       {
+          if(phif < minphi+(i+1)*phistep)break;
+          phibin++;
+       }
+       if(phibin > nphibins-1)phibin = nphibins - 1;
+       ntot[Ebin][Abin][phibin]++;
+       int Est = (int) (E + .5);
+       String pre = "PDG"+pdg+"/E="+Est+"/";
+       aida.cloud1D(pre+"Gen folded phi").fill(phif);
+       aida.cloud1D(pre+"Gen cos theta").fill(scth);
+       if(event.get(Track.class,"Tracks").size() > 0)aida.cloud1D(pre+"Gen ct with Track").fill(scth);
+       double lct = 0.;
+       if(Abin > 0)lct = ctlims[Abin-1];
+       String pre2 = pre + lct+"<ct<"+ctlims[Abin]+"/";
+       aida.cloud1D(pre2+"Gen folded phi").fill(phif);
+       aida.cloud1D(pre2+"Gen cos theta").fill(scth);
+       if(event.get(Track.class,"Tracks").size() > 0)aida.cloud1D(pre2+"Gen ct with Track").fill(scth);
+       BasicCluster allcal = new BasicCluster();
+       BasicCluster allcalEM = new BasicCluster();
+       BasicCluster allcalHAD = new BasicCluster();
+       double totCalEsf = 0.;
+       double totCalEEMsf = 0.;
+       double totCalEHADsf = 0.;
+       String[] collnames = {ci.getDigiCollectionName("EM_BARREL"),ci.getDigiCollectionName("EM_ENDCAP"),
+                                              ci.getDigiCollectionName("HAD_BARREL"),ci.getDigiCollectionName("HAD_ENDCAP"),
+                                              ci.getDigiCollectionName("MUON_ENDCAP")};
+       for(int i=0;i<collnames.length;i++)
+       {
+          for(CalorimeterHit h:event.get(CalorimeterHit.class,collnames[i]))
+          {
+             allcal.addHit(h);
+             totCalEsf += h.getCorrectedEnergy();
+             if(i < 2)
+             {
+                allcalEM.addHit(h);
+                totCalEEMsf += h.getCorrectedEnergy();
+             }
+             else
+             {
+                allcalHAD.addHit(h);
+                totCalEHADsf += h.getCorrectedEnergy();
+             }
+          }
+       }
+       ClusterEnergyCalculator cec = cecnh;
+       aida.cloud1D(pre+"Total Cal energy from sf").fill(totCalEsf);
+       aida.cloud1D(pre+"Total Cal energy from calibration").fill(cec.getEnergy(allcal));
+       aida.cloud1D(pre+"Total EMCal energy from sf").fill(totCalEEMsf);
+       aida.cloud1D(pre+"Total EMCal energy from calibration").fill(cec.getEnergy(allcalEM));
+       aida.cloud1D(pre+"Total HADCal energy from sf").fill(totCalEHADsf);
+       aida.cloud1D(pre+"Total HADCal energy from calibration").fill(cec.getEnergy(allcalHAD));
+       aida.cloud1D(pre+"Total calE-sfE HAD").fill(cec.getEnergy(allcalHAD)-totCalEHADsf);
+       aida.profile1D(pre+"<calEsf> vs phi",10,-Math.PI/12,Math.PI/12.).fill(phif,totCalEsf);
+       aida.profile1D(pre+"<calEcalib> vs phi",10,-Math.PI/12,Math.PI/12.).fill(phif,cec.getEnergy(allcal));
+       aida.profile1D(pre+"<calEsf> vs ct",40,-1.,1.).fill(scth,totCalEsf);
+       aida.profile1D(pre+"<calEcalib> vs ct",40,-1.,1.).fill(scth,cec.getEnergy(allcal));
+       aida.cloud1D(pre2+"Total Cal energy from sf").fill(totCalEsf);
+       aida.cloud1D(pre2+"Total Cal energy from calibration").fill(cec.getEnergy(allcal));
+       aida.cloud1D(pre2+"Total EMCal energy from sf").fill(totCalEEMsf);
+       aida.cloud1D(pre2+"Total EMCal energy from calibration").fill(cec.getEnergy(allcalEM));
+       aida.cloud1D(pre2+"Total HADCal energy from sf").fill(totCalEHADsf);
+       aida.cloud1D(pre2+"Total HADCal energy from calibration").fill(cec.getEnergy(allcalHAD));
+       aida.profile1D(pre2+"<calEsf> vs phi",10,-Math.PI/12,Math.PI/12.).fill(phif,totCalEsf);
+       aida.profile1D(pre2+"<calEcalib> vs phi",10,-Math.PI/12,Math.PI/12.).fill(phif,cec.getEnergy(allcal));
+       calEsf[Ebin][Abin][phibin] += totCalEsf;
+       double totE = 0.;
+       double totnhE = 0.;
+       double totphE = 0.;
+       double totchE = 0.;
+       double totmuE = 0.;
+       double totelE = 0.;
+       double maxrpE = 0.;
+       int nrp = 0;
+       int nnh = 0;
+       int nph = 0;
+       int nch = 0;
+       int nmu = 0;
+       int nel = 0;
+       int ntr = event.get(Track.class,"Tracks").size();
+       ReconstructedParticle maxrp = null;
+       List<Cluster> ncls = new ArrayList<Cluster>();
+       BasicCluster allncl = new BasicCluster();
+       for(ReconstructedParticle rp:event.get(ReconstructedParticle.class,"ReconstructedParticles"))
+       {
+          totE += rp.getEnergy();
+          nrp++;
+          if(rp.getEnergy() > maxrpE)
+          {
+             maxrpE = rp.getEnergy();
+             maxrp = rp;
+          }
+          if(rp.getCharge() == 0.)
+          {
+             if(rp.getMass() > 0.)
+             {
+                nnh++;
+                totnhE += rp.getEnergy();
+                aida.cloud2D(pre+"Recon neutral hadron E vs phi").fill(phif,rp.getEnergy());
+             }
+             else
+             {
+                nph++;
+                totphE += rp.getEnergy();
+                aida.cloud2D(pre+"Recon Photon E vs phi").fill(phif,rp.getEnergy());
+             }
+             ncls.addAll(rp.getClusters());
+             
+          }
+          else
+          {
+             nch++;
+             totchE += rp.getEnergy();
+             if(rp.getMass() < .11)
+             {
+                if(rp.getMass() < .01)
+                {
+                   nel++;
+                   totelE += rp.getEnergy();
+                }
+                else
+                {
+                   nmu++;
+                   totmuE += rp.getEnergy();
+                }
+             }
+          }
+       }
+       nr[Ebin][Abin][phibin] += nrp;
+       nrph[Ebin][Abin][phibin] += nph;
+       nrnh[Ebin][Abin][phibin] += nnh;
+       rE[Ebin][Abin][phibin] += totE;
+       aida.cloud1D(pre+"Total recon E").fill(totE);
+       aida.histogram1D(pre+"Total # recon particles",10,-.5,9.5).fill(nrp);
+       aida.cloud1D(pre+"Total recon nh E").fill(totnhE);
+       aida.histogram1D(pre+"Total # recon nh's",10,-.5,9.5).fill(nnh);
+       aida.cloud1D(pre+"Total recon ph E").fill(totphE);
+       aida.histogram1D(pre+"Total # recon photons",10,-.5,9.5).fill(nph);
+       aida.cloud1D(pre+"Total recon ch E").fill(totchE);
+       aida.histogram1D(pre+"Total # tracks",10,-.5,9.5).fill(ntr);
+       aida.histogram1D(pre+"Total # charged particles",10,-.5,9.5).fill(nch);
+       aida.histogram1D(pre+"Total # electrons",10,-.5,9.5).fill(nel);
+       aida.histogram1D(pre+"Total # muons",10,-.5,9.5).fill(nmu);
+       aida.profile1D(pre+"Total # tracks vs costh",20,0.,1.).fill(costh,ntr);
+       aida.profile1D(pre+"Total # charged particles vs costh",20,0.,1.).fill(costh,nch);
+       aida.profile1D(pre+"Total # recon particles vs costh",20,0.,1.).fill(costh,nrp);
+       aida.profile1D(pre+"Total # electrons vs costh",20,0.,1.).fill(costh,nel);
+       aida.profile1D(pre+"Total # muons vs costh",20,0.,1.).fill(costh,nmu);
+       aida.cloud1D(pre2+"Total recon E").fill(totE);
+       aida.histogram1D(pre2+"Total # recon particles",10,-.5,9.5).fill(nrp);
+       aida.cloud1D(pre2+"Total recon nh E").fill(totnhE);
+       aida.histogram1D(pre2+"Total # recon nh's",10,-.5,9.5).fill(nnh);
+       aida.cloud1D(pre2+"Total recon ph E").fill(totphE);
+       aida.histogram1D(pre2+"Total # recon photons",10,-.5,9.5).fill(nph);
+       aida.cloud1D(pre2+"Total recon ch E").fill(totchE);
+       aida.histogram1D(pre2+"Total # charged particles",10,-.5,9.5).fill(nch);
+       aida.profile1D(pre2+"Total # recon particles vs costh",20,0.,1.).fill(costh,nrp);
+       aida.histogram1D(pre2+"Total # electrons",10,-.5,9.5).fill(nel);
+       aida.histogram1D(pre2+"Total # muons",10,-.5,9.5).fill(nmu);
+       aida.histogram1D(pre2+"Total # tracks",10,-.5,9.5).fill(ntr);
+       aida.profile1D(pre2+"Total # tracks vs costh",20,0.,1.).fill(costh,ntr);
+       aida.profile1D(pre2+"Total # charged particles vs costh",20,0.,1.).fill(costh,nch);
+       aida.profile1D(pre2+"Total # electrons vs costh",20,0.,1.).fill(costh,nel);
+       aida.profile1D(pre2+"Total # muons vs costh",20,0.,1.).fill(costh,nmu);
+       if(event.get(Track.class,"Tracks").size() > 0)
+       {
+          String pre3 = "with Recon Track/";
+/*
+          String pre4 = "pi ID/";
+          if(nmu == 1)pre4 = "mu ID/";
+          List<MuonFinder3Debug> dbl = event.get(MuonFinder3Debug.class,"MuonDebug");
+          MuonFinder3Debug mdb = dbl.get(0);
+          aida.cloud1D(pre+pre3+pre4+"# mu mips").fill(mdb.getNMuMips());
+          aida.cloud1D(pre2+pre3+pre4+"# mu mips").fill(mdb.getNMuMips());
+          if(mdb.getNMuMips() == 1)
+          {
+             aida.cloud1D(pre+pre3+pre4+"ct0").fill(mdb.getCt0());
+             aida.cloud1D(pre+pre3+pre4+"ct1").fill(mdb.getCt1());
+             aida.cloud1D(pre+pre3+pre4+"ct2").fill(mdb.getCt2());
+             aida.cloud1D(pre+pre3+pre4+"cta").fill(mdb.getCta());
+             aida.cloud1D(pre2+pre3+pre4+"ct0").fill(mdb.getCt0());
+             aida.cloud1D(pre2+pre3+pre4+"ct1").fill(mdb.getCt1());
+             aida.cloud1D(pre2+pre3+pre4+"ct2").fill(mdb.getCt2());
+             aida.cloud1D(pre2+pre3+pre4+"cta").fill(mdb.getCta());
+             if(mdb.getCta() > .85)
+             {
+                aida.cloud1D(pre+pre3+pre4+"# iso last 20 steps").fill(mdb.getNIso20());
+                aida.cloud1D(pre2+pre3+pre4+"# iso last 20 steps").fill(mdb.getNIso20());
+                if(mdb.getNIso20() > 7)
+                {
+                   aida.cloud1D(pre+pre3+pre4+"# iso").fill(mdb.getNIsoa());
+                   aida.cloud1D(pre2+pre3+pre4+"# iso").fill(mdb.getNIsoa());
+                   aida.cloud1D(pre+pre3+pre4+"fraction iso").fill(mdb.getFracIso());
+                   aida.cloud1D(pre2+pre3+pre4+"fraction iso").fill(mdb.getFracIso());
+                   aida.cloud1D(pre+pre3+pre4+"max cons noniso steps").fill(mdb.getMaxConNoniso());
+                   aida.cloud1D(pre2+pre3+pre4+"max cons noniso steps").fill(mdb.getMaxConNoniso());
+                }
+             }
+          }
+*/
+          aida.cloud1D(pre+pre3+"Total recon E").fill(totE);
+          aida.histogram1D(pre+pre3+"Total # recon particles",10,-.5,9.5).fill(nrp);
+          aida.cloud1D(pre+pre3+"Total recon nh E").fill(totnhE);
+          aida.histogram1D(pre+pre3+"Total # recon nh's",10,-.5,9.5).fill(nnh);
+          aida.cloud1D(pre+pre3+"Total recon ph E").fill(totphE);
+          aida.histogram1D(pre+pre3+"Total # recon photons",10,-.5,9.5).fill(nph);
+          aida.cloud1D(pre+pre3+"Total recon ch E").fill(totchE);
+          aida.histogram1D(pre+pre3+"Total # tracks",10,-.5,9.5).fill(ntr);
+          aida.histogram1D(pre+pre3+"Total # charged particles",10,-.5,9.5).fill(nch);
+          aida.histogram1D(pre+pre3+"Total # electrons",10,-.5,9.5).fill(nel);
+          aida.histogram1D(pre+pre3+"Total # muons",10,-.5,9.5).fill(nmu);
+          aida.profile1D(pre+pre3+"Total # tracks vs costh",20,0.,1.).fill(costh,ntr);
+          aida.profile1D(pre+pre3+"Total # charged particles vs costh",20,0.,1.).fill(costh,nch);
+          aida.profile1D(pre+pre3+"Total # recon particles vs costh",20,0.,1.).fill(costh,nrp);
+          aida.profile1D(pre+pre3+"Total # electrons vs costh",20,0.,1.).fill(costh,nel);
+          aida.profile1D(pre+pre3+"Total # muons vs costh",20,0.,1.).fill(costh,nmu);
+          aida.cloud1D(pre2+pre3+"Total recon E").fill(totE);
+          aida.histogram1D(pre2+pre3+"Total # recon particles",10,-.5,9.5).fill(nrp);
+          aida.cloud1D(pre2+pre3+"Total recon nh E").fill(totnhE);
+          aida.histogram1D(pre2+pre3+"Total # recon nh's",10,-.5,9.5).fill(nnh);
+          aida.cloud1D(pre2+pre3+"Total recon ph E").fill(totphE);
+          aida.histogram1D(pre2+pre3+"Total # recon photons",10,-.5,9.5).fill(nph);
+          aida.cloud1D(pre2+pre3+"Total recon ch E").fill(totchE);
+          aida.histogram1D(pre2+pre3+"Total # charged particles",10,-.5,9.5).fill(nch);
+          aida.histogram1D(pre2+pre3+"Total # electrons",10,-.5,9.5).fill(nel);
+          aida.histogram1D(pre2+pre3+"Total # muons",10,-.5,9.5).fill(nmu);
+          aida.histogram1D(pre2+pre3+"Total # tracks",10,-.5,9.5).fill(ntr);
+          aida.profile1D(pre2+pre3+"Total # tracks vs costh",20,0.,1.).fill(costh,ntr);
+          aida.profile1D(pre2+pre3+"Total # charged particles vs costh",20,0.,1.).fill(costh,nch);
+          aida.profile1D(pre2+pre3+"Total # recon particles vs costh",20,0.,1.).fill(costh,nrp);
+          aida.profile1D(pre2+pre3+"Total # electrons vs costh",20,0.,1.).fill(costh,nel);
+          aida.profile1D(pre2+pre3+"Total # muons vs costh",20,0.,1.).fill(costh,nmu);
+          if(nch > 0)
+          {
+             pre3 = "with Ch Recon/";
+             aida.cloud1D(pre+pre3+"Total recon E").fill(totE);
+             aida.histogram1D(pre+pre3+"Total # recon particles",10,-.5,9.5).fill(nrp);
+             aida.cloud1D(pre+pre3+"Total recon nh E").fill(totnhE);
+             aida.histogram1D(pre+pre3+"Total # recon nh's",10,-.5,9.5).fill(nnh);
+             aida.cloud1D(pre+pre3+"Total recon ph E").fill(totphE);
+             aida.histogram1D(pre+pre3+"Total # recon photons",10,-.5,9.5).fill(nph);
+             aida.cloud1D(pre+pre3+"Total recon ch E").fill(totchE);
+             aida.histogram1D(pre+pre3+"Total # tracks",10,-.5,9.5).fill(ntr);
+             aida.histogram1D(pre+pre3+"Total # charged particles",10,-.5,9.5).fill(nch);
+             aida.histogram1D(pre+pre3+"Total # electrons",10,-.5,9.5).fill(nel);
+             aida.histogram1D(pre+pre3+"Total # muons",10,-.5,9.5).fill(nmu);
+             aida.profile1D(pre+pre3+"Total # tracks vs costh",20,0.,1.).fill(costh,ntr);
+             aida.profile1D(pre+pre3+"Total # charged particles vs costh",20,0.,1.).fill(costh,nch);
+             aida.profile1D(pre+pre3+"Total # recon particles vs costh",20,0.,1.).fill(costh,nrp);
+             aida.profile1D(pre+pre3+"Total # electrons vs costh",20,0.,1.).fill(costh,nel);
+             aida.profile1D(pre+pre3+"Total # muons vs costh",20,0.,1.).fill(costh,nmu);
+             aida.cloud1D(pre2+pre3+"Total recon E").fill(totE);
+             aida.histogram1D(pre2+pre3+"Total # recon particles",10,-.5,9.5).fill(nrp);
+             aida.cloud1D(pre2+pre3+"Total recon nh E").fill(totnhE);
+             aida.histogram1D(pre2+pre3+"Total # recon nh's",10,-.5,9.5).fill(nnh);
+             aida.cloud1D(pre2+pre3+"Total recon ph E").fill(totphE);
+             aida.histogram1D(pre2+pre3+"Total # recon photons",10,-.5,9.5).fill(nph);
+             aida.cloud1D(pre2+pre3+"Total recon ch E").fill(totchE);
+             aida.histogram1D(pre2+pre3+"Total # charged particles",10,-.5,9.5).fill(nch);
+             aida.histogram1D(pre2+pre3+"Total # electrons",10,-.5,9.5).fill(nel);
+             aida.histogram1D(pre2+pre3+"Total # muons",10,-.5,9.5).fill(nmu);
+             aida.histogram1D(pre2+pre3+"Total # tracks",10,-.5,9.5).fill(ntr);
+             aida.profile1D(pre2+pre3+"Total # tracks vs costh",20,0.,1.).fill(costh,ntr);
+             aida.profile1D(pre2+pre3+"Total # charged particles vs costh",20,0.,1.).fill(costh,nch);
+             aida.profile1D(pre2+pre3+"Total # recon particles vs costh",20,0.,1.).fill(costh,nrp);
+             aida.profile1D(pre2+pre3+"Total # electrons vs costh",20,0.,1.).fill(costh,nel);
+             aida.profile1D(pre2+pre3+"Total # muons vs costh",20,0.,1.).fill(costh,nmu);
+          }
+       }
+       double mpE = 0.;
+       if(maxrp != null)mpE = maxrp.getEnergy();
+       aida.cloud1D(pre+"Max E recon E").fill(mpE);
+       double snEsf = 0.;
+       for(Cluster c:ncls)
+       {
+          snEsf += c.getEnergy();
+          allncl.addCluster(c);
+       }
+       nEsf[Ebin][Abin][phibin] += snEsf;
+       if(event.get(Track.class,"Tracks").size() > 0)
+       {
+          String pre3 = "with Recon Track/";
+       aida.cloud1D(pre+pre3+"fraction of CalE IDed as neutral from sf").fill(snEsf/totCalEsf);
+       aida.cloud1D(pre+pre3+"fraction of CalE IDed as neutral from cal").fill(cecnh.getEnergy(allncl)/cecnh.getEnergy(allcal));
+       }
+       double fmn = 0.;
+       if(maxrp != null)
+       {
+          if(maxrp.getCharge() == 0)
+          {
+             fmn = maxrp.getClusters().get(0).getEnergy()/totCalEsf;
+          }
+       }
+       if(event.get(Track.class,"Tracks").size() > 0)
+       {
+          String pre3 = "with Recon Track/";
+          aida.cloud1D(pre+pre3+"fraction of CalE in maxRP IDed as neutral from sf").fill(fmn);
+          aida.profile1D(pre+pre3+"<reconE> vs phi",10,-15.,15.).fill(phidf2,totE);
+          aida.profile1D(pre+pre3+"<# particles> vs phi",10,-15.,15.).fill(phidf2,nrp);
+          aida.profile1D(pre+pre3+"<photonE> vs phi",10,-15.,15.).fill(phidf2,totphE);
+          aida.profile1D(pre+pre3+"<# photons> vs phi",10,-15.,15.).fill(phidf2,nph);
+          aida.profile1D(pre+pre3+"<nhE> vs phi",10,-15.,15.).fill(phidf2,totnhE);
+          aida.profile1D(pre+pre3+"<# nhs> vs phi",10,-15.,15.).fill(phidf2,nnh);
+          aida.cloud1D(pre2+pre3+"fraction of CalE in maxRP IDed as neutral from sf").fill(fmn);
+          aida.profile1D(pre2+pre3+"<reconE> vs phi",10,-15.,15.).fill(phidf2,totE);
+          aida.profile1D(pre2+pre3+"<# particles> vs phi",10,-15.,15.).fill(phidf2,nrp);
+          aida.profile1D(pre2+pre3+"<photonE> vs phi",10,-15.,15.).fill(phidf2,totphE);
+          aida.profile1D(pre2+pre3+"<# photons> vs phi",10,-15.,15.).fill(phidf2,nph);
+          aida.profile1D(pre2+pre3+"<nhE> vs phi",10,-15.,15.).fill(phidf2,totnhE);
+          aida.profile1D(pre2+pre3+"<# nhs> vs phi",10,-15.,15.).fill(phidf2,nnh);
+          if(nch > 0)
+          {
+             pre3 = "with Ch Recon/";
+             aida.cloud1D(pre+pre3+"fraction of CalE in maxRP IDed as neutral from sf").fill(fmn);
+             aida.profile1D(pre+pre3+"<reconE> vs phi",10,-15.,15.).fill(phidf2,totE);
+             aida.profile1D(pre+pre3+"<# particles> vs phi",10,-15.,15.).fill(phidf2,nrp);
+             aida.profile1D(pre+pre3+"<photonE> vs phi",10,-15.,15.).fill(phidf2,totphE);
+             aida.profile1D(pre+pre3+"<# photons> vs phi",10,-15.,15.).fill(phidf2,nph);
+             aida.profile1D(pre+pre3+"<nhE> vs phi",10,-15.,15.).fill(phidf2,totnhE);
+             aida.profile1D(pre+pre3+"<# nhs> vs phi",10,-15.,15.).fill(phidf2,nnh);
+             aida.cloud1D(pre2+pre3+"fraction of CalE in maxRP IDed as neutral from sf").fill(fmn);
+             aida.profile1D(pre2+pre3+"<reconE> vs phi",10,-15.,15.).fill(phidf2,totE);
+             aida.profile1D(pre2+pre3+"<# particles> vs phi",10,-15.,15.).fill(phidf2,nrp);
+             aida.profile1D(pre2+pre3+"<photonE> vs phi",10,-15.,15.).fill(phidf2,totphE);
+             aida.profile1D(pre2+pre3+"<# photons> vs phi",10,-15.,15.).fill(phidf2,nph);
+             aida.profile1D(pre2+pre3+"<nhE> vs phi",10,-15.,15.).fill(phidf2,totnhE);
+             aida.profile1D(pre2+pre3+"<# nhs> vs phi",10,-15.,15.).fill(phidf2,nnh);
+          }
+       }
+       int ieff0 = 0;
+       int ieff1 = 0;
+       int ieff2 = 0;
+       int ieff3 = 0;
+       int nf = nch;
+       double Ef = totchE;
+       double Efr = Ef/totE;
+       boolean mrpm = false;
+       if(maxrp != null)mrpm = maxrp.getCharge() != 0.;
+       if( (nf == 1)&&(nrp == 1) )ieff0 = 1;
+       if(event.get(Track.class,"Tracks").size() > 0)ieff1 = 1;
+       if( (nf > 0)&&(Efr > .9) )ieff2 = 1;
+       if(nf > 0)ieff3 = 1;
+       p0[Ebin][Abin][phibin] += ieff0;
+       p1[Ebin][Abin][phibin] += ieff1;
+       p2[Ebin][Abin][phibin] += ieff2;
+       p3[Ebin][Abin][phibin] += ieff3;
+       aida.profile1D(pre+"eff-1ch only vs phi",10,-15.,15.).fill(phidf2,ieff0);
+       aida.profile1D(pre+"eff-tracking vs phi",10,-15.,15.).fill(phidf2,ieff1);
+       aida.profile1D(pre+"eff-1ch > .9Erecon vs phi",10,-15.,15.).fill(phidf2,ieff2);
+       aida.profile1D(pre+"eff-used track vs phi",10,-15.,15.).fill(phidf2,ieff3);
+       aida.profile1D(pre2+"eff-1ch only vs phi",10,-15.,15.).fill(phidf2,ieff0);
+       aida.profile1D(pre2+"eff-tracking vs phi",10,-15.,15.).fill(phidf2,ieff1);
+       aida.profile1D(pre2+"eff-1ch > .9Erecon vs phi",10,-15.,15.).fill(phidf2,ieff2);
+       aida.profile1D(pre2+"eff-used track vs phi",10,-15.,15.).fill(phidf2,ieff3);
+       pre = lct+"<ct<"+ctlims[Abin]+"/";
+       aida.profile1D(pre+"eff-1ch only vs phi",10,-15.,15.).fill(phidf2,ieff0);
+       aida.profile1D(pre+"eff-tracking vs phi",10,-15.,15.).fill(phidf2,ieff1);
+       aida.profile1D(pre+"eff-1ch > .9Erecon vs phi",10,-15.,15.).fill(phidf2,ieff2);
+       aida.profile1D(pre+"eff-used track vs phi",10,-15.,15.).fill(phidf2,ieff3);
+       aida.profile1D(pre+"eff-1ch only vs ct",50,0.,1.).fill(costh,ieff0);
+       aida.profile1D(pre+"eff-tracking vs ct",50,0.,1.).fill(costh,ieff1);
+       aida.profile1D(pre+"eff-1ch > .9Erecon vs ct",50,0.,1.).fill(costh,ieff2);
+       aida.profile1D(pre+"eff-used track vs ct",50,0.,1.).fill(costh,ieff3);
+       aida.profile1D(pre+"eff-1ch only vs Ebin",Evals.length,-.5,Evals.length - .5).fill(Ebin,ieff0);
+       aida.profile1D(pre+"eff-tracking vs Ebin",Evals.length,-.5,Evals.length - .5).fill(Ebin,ieff1);
+       aida.profile1D(pre+"eff-1ch > .9Erecon vs Ebin",Evals.length,-.5,Evals.length - .5).fill(Ebin,ieff2);
+       aida.profile1D(pre+"eff-used track vs E",Evals.length,-.5,Evals.length - .5).fill(Ebin,ieff3);
+//       if(nmu > 0)throw new RuntimeException("Look at me");
+    }
+}
CVSspam 0.2.8