lcsim-contrib/src/main/java/org/lcsim/contrib/Cassell/recon/analysis
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");
+ }
+}