Commit in mcd-analysis/src/main/java/org/lcsim/mcd/analysis/DRCorrection/alexDRCorr on MAIN
pion_calibration_steering.xml+32added 1.1
neutron_calibration_steering.xml+33added 1.1
backgroundAnalysisDriver.java+72-121.2 -> 1.3
proton_resolution_steering.xml+2-21.2 -> 1.3
correctionFunctions.java+1-11.1 -> 1.2
electronCorrection.java+17-51.3 -> 1.4
ElectronCalibrationDriver.java+6-121.1 -> 1.2
DRResolutionDriver.java+6-121.1 -> 1.2
DualCorrection.java+26-81.3 -> 1.4
Resolution.java+25-131.3 -> 1.4
proton_calibration_steering.xml+2-21.2 -> 1.3
electron_calibration_steering.xml+2-31.1 -> 1.2
cutConfiguration.java+9-161.1 -> 1.2
DRCalibrationDriver.java+6-121.1 -> 1.2
+239-98
2 added + 12 modified, total 14 files
Changed from separate C,S cuts to MIP cut.

mcd-analysis/src/main/java/org/lcsim/mcd/analysis/DRCorrection/alexDRCorr
pion_calibration_steering.xml added at 1.1
diff -N pion_calibration_steering.xml
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ pion_calibration_steering.xml	9 May 2014 21:27:19 -0000	1.1
@@ -0,0 +1,32 @@
+<lcsim xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
+       xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/lcsim/1.0/lcsim.xsd">
+    
+    <classpath>
+        <jar>/home/aconway/NetBeansProjects/mcd-analysis/target/mcd-analysis-1.0-SNAPSHOT.jar</jar>
+    </classpath>
+
+    <inputFiles>
+        <file>/home/aconway/fermi/eventdata/slcio/singleparticle/pipl/pipl-90deg-1gev.slcio</file>
+        <file>/home/aconway/fermi/eventdata/slcio/singleparticle/pipl/pipl-90deg-2gev.slcio</file>
+        <file>/home/aconway/fermi/eventdata/slcio/singleparticle/pipl/pipl-90deg-5gev.slcio</file>
+        <file>/home/aconway/fermi/eventdata/slcio/singleparticle/pipl/pipl-90deg-10gev.slcio</file>
+        <file>/home/aconway/fermi/eventdata/slcio/singleparticle/pipl/pipl-90deg-25gev.slcio</file>
+    </inputFiles>
+    <control>
+        <numberOfEvents>-1</numberOfEvents>
+    </control>
+
+    <execute>
+        <driver name="DRCalibrationDriver"/>
+    </execute>
+    <drivers>
+        <driver name="DRCalibrationDriver" 
+                type="org.lcsim.mcd.analysis.DRCorrection.alexDRCorr.DRCalibrationDriver">
+            <myP_name>pion</myP_name>
+            <myS_thresh>10.0</myS_thresh>
+            <myC_thresh>300.0</myC_thresh>
+            <myT_thresh>3.0</myT_thresh>
+            <myTag>default</myTag>
+        </driver>
+    </drivers>
+</lcsim>
\ No newline at end of file

mcd-analysis/src/main/java/org/lcsim/mcd/analysis/DRCorrection/alexDRCorr
neutron_calibration_steering.xml added at 1.1
diff -N neutron_calibration_steering.xml
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ neutron_calibration_steering.xml	9 May 2014 21:27:19 -0000	1.1
@@ -0,0 +1,33 @@
+<lcsim xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
+       xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/lcsim/1.0/lcsim.xsd">
+    
+    <classpath>
+        <jar>/home/aconway/NetBeansProjects/mcd-analysis/target/mcd-analysis-1.0-SNAPSHOT.jar</jar>
+    </classpath>
+
+    <inputFiles>
+        <file>/home/aconway/fermi/eventdata/slcio/singleparticle/neutron/neutron-90deg-1gev.slcio</file>
+        <file>/home/aconway/fermi/eventdata/slcio/singleparticle/neutron/neutron-90deg-2gev.slcio</file>
+        <file>/home/aconway/fermi/eventdata/slcio/singleparticle/neutron/neutron-90deg-5gev.slcio</file>
+        <file>/home/aconway/fermi/eventdata/slcio/singleparticle/neutron/neutron-90deg-10gev.slcio</file>
+        <file>/home/aconway/fermi/eventdata/slcio/singleparticle/neutron/neutron-90deg-25gev.slcio</file>
+        <file>/home/aconway/fermi/eventdata/slcio/singleparticle/neutron/neutron-90deg-50gev.slcio</file>
+    </inputFiles>
+    <control>
+        <numberOfEvents>-1</numberOfEvents>
+    </control>
+
+    <execute>
+        <driver name="DRCalibrationDriver"/>
+    </execute>
+    <drivers>
+        <driver name="DRCalibrationDriver" 
+                type="org.lcsim.mcd.analysis.DRCorrection.alexDRCorr.DRCalibrationDriver">
+            <myP_name>neutron</myP_name>
+            <myS_thresh>0.0</myS_thresh>
+            <myC_thresh>0.0</myC_thresh>
+            <myT_thresh>0.0</myT_thresh>
+            <myTag>default</myTag>
+        </driver>
+    </drivers>
+</lcsim>
\ No newline at end of file

mcd-analysis/src/main/java/org/lcsim/mcd/analysis/DRCorrection/alexDRCorr
backgroundAnalysisDriver.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- backgroundAnalysisDriver.java	19 Apr 2014 00:26:02 -0000	1.2
+++ backgroundAnalysisDriver.java	9 May 2014 21:27:19 -0000	1.3
@@ -20,32 +20,53 @@
 public class backgroundAnalysisDriver extends Driver {
     AIDA aida = AIDA.defaultInstance();
     IHistogram1D Edep_vs_tofl;
-    double[] t_cuts = {1.0,2.0,3.0,4.0,5.0,7.0,10.0};
+    double[] t_cuts = {1.0,2.0,3.0,4.0,5.0,7.0,10.0,10000.0};
+    double[] e_cuts = {0.0,0.001,0.005,0.01,0.03};
+    double[] c_cuts = {0.0,300.0,500.0,1000.0,2000.0,3000.0};
     
-    HashMap<Long,HashMap<Double,Double>> Scintmap;
-    HashMap<Long,HashMap<Double,Double>> Cerenmap;
+    HashMap<Long,HashMap<Double,Double>> eCalScintmap;
+    HashMap<Long,HashMap<Double,Double>> hCalScintmap;
+    HashMap<Long,HashMap<Double,Double>> eCalCerenmap;
+    HashMap<Long,HashMap<Double,Double>> hCalCerenmap;
     HashMap<Long,HashMap<Double,Double>> Mucalmap;
     
     @Override
     protected void startOfData() {
-        Scintmap = new HashMap<Long,HashMap<Double,Double>>();
-        Cerenmap = new HashMap<Long,HashMap<Double,Double>>();
+        eCalScintmap = new HashMap<Long,HashMap<Double,Double>>();
+        hCalScintmap = new HashMap<Long,HashMap<Double,Double>>();
+        eCalCerenmap = new HashMap<Long,HashMap<Double,Double>>();
+        hCalCerenmap = new HashMap<Long,HashMap<Double,Double>>();
         Mucalmap = new HashMap<Long,HashMap<Double,Double>>();
     }
     
     @Override
     protected void process(EventHeader event) {
+//        eCalScintmap = new HashMap<Long,HashMap<Double,Double>>();
+//        hCalScintmap = new HashMap<Long,HashMap<Double,Double>>();
+//        eCalCerenmap = new HashMap<Long,HashMap<Double,Double>>();
+//        hCalCerenmap = new HashMap<Long,HashMap<Double,Double>>();
+        Mucalmap = new HashMap<Long,HashMap<Double,Double>>();
         List<List<SimCalorimeterHit>> simCalorimeterHitCollections = event.get(SimCalorimeterHit.class);
         for (List<SimCalorimeterHit> simCalHits : simCalorimeterHitCollections) {
             String CollectionName = event.getMetaData(simCalHits).getName();
             HashMap<Long,HashMap<Double,Double>> map;
             String pfix = "MuCal";
             if (CollectionName.contains("Edep")) {
-                pfix = "Scint";
-                map = Scintmap;
+                if (CollectionName.contains("ECal")) {
+                    pfix = "ECal/Scint";
+                    map = eCalScintmap;
+                } else {
+                    pfix = "HCal/Scint";
+                    map = hCalScintmap;
+                }
             } else if (CollectionName.contains("Opti")) {
-                pfix = "Ceren";
-                map = Cerenmap;
+                if (CollectionName.contains("ECal")) {
+                    pfix = "ECal/Ceren";
+                    map = eCalCerenmap;
+                } else {
+                    pfix = "HCal/Ceren";
+                    map = hCalCerenmap;
+                }
             } else {
                 map = Mucalmap;
             }
@@ -94,24 +115,63 @@
                 }
             }
         }
+//        mapPlots(eCalScintmap, "ECal/Scint");
+//        mapPlots(eCalCerenmap, "ECal/Ceren");
+//        mapPlots(hCalScintmap, "HCal/Scint");
+//        mapPlots(hCalCerenmap, "HCal/Ceren");
+//        mapPlots(Mucalmap, "Mucal");
     }
     
     @Override
     protected void endOfData() {
-        mapPlots(Scintmap, "Scint");
-        mapPlots(Cerenmap, "Ceren");
+        mapPlots(eCalScintmap, "ECal/Scint");
+        mapPlots(eCalCerenmap, "ECal/Ceren");
+        mapPlots(hCalScintmap, "HCal/Scint");
+        mapPlots(hCalCerenmap, "HCal/Ceren");
         mapPlots(Mucalmap, "Mucal");
     }
     
     private void mapPlots(HashMap<Long,HashMap<Double,Double>> map, String name) {
+        double[] cuts;
+        if (name.contains("Scint")) {
+            cuts = e_cuts;
+        } else if (name.contains("Ceren")) {
+            cuts = c_cuts;
+        } else {
+            cuts = new double[0];
+        }
+        double[] sumEs = new double[cuts.length];
+        double totE = 0.0;
         for (HashMap<Double,Double> submap : map.values()) {
             for (Double tcut : submap.keySet()) {
                 Double edep = submap.get(tcut);
                 String pfix = "/maps/" + name + "/Edep " + String.valueOf(tcut) + "ns";
-                aida.cloud1D(pfix).fill(Math.log10(edep));                
+                aida.cloud1D(pfix).fill(Math.log10(edep));
                 pfix = "/maps/" + name + "/wtd Edep " + String.valueOf(tcut) + "ns";
                 aida.cloud1D(pfix).fill(Math.log10(edep),edep);
+                
+                if (edep > 0.0) {
+                    pfix = "/maps/" + name + "/MIP log wtd Edep " + String.valueOf(tcut) + "ns";
+                    aida.cloud1D(pfix).fill(Math.log10(edep),edep);
+                    pfix = "/maps/" + name + "/MIP wtd Edep " + String.valueOf(tcut) + "ns";
+                    aida.cloud1D(pfix).fill(edep,edep);
+                }
+                
+                if (tcut == 10000.0) {
+                    totE += edep;
+                }
+                for (int i=0; i< cuts.length; i++) {
+                    if (edep > cuts[i] && tcut == 3.0) {
+                        sumEs[i] += edep;
+                    }
+                }
             }
         }
+        for (int i=0; i<sumEs.length; i++) {
+            double cutE = sumEs[i];
+            double ecut = cuts[i];
+            double pct = 100.0*cutE/totE;
+            System.out.println(name+": "+String.valueOf(ecut)+" cut: "+String.valueOf(pct)+"%. ("+String.valueOf(cutE)+" / "+String.valueOf(totE));
+        }
     }
 }

mcd-analysis/src/main/java/org/lcsim/mcd/analysis/DRCorrection/alexDRCorr
proton_resolution_steering.xml 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- proton_resolution_steering.xml	18 Apr 2014 22:02:58 -0000	1.2
+++ proton_resolution_steering.xml	9 May 2014 21:27:19 -0000	1.3
@@ -24,8 +24,8 @@
         <driver name="DRResolutionDriver" 
                 type="org.lcsim.mcd.analysis.DRCorrection.alexDRCorr.DRResolutionDriver">
             <myP_name>proton</myP_name>
-            <myS_thresh>1.0</myS_thresh>
-            <myC_thresh>0.0</myC_thresh>
+            <myS_thresh>10.0</myS_thresh>
+            <myC_thresh>300.0</myC_thresh>
             <myT_thresh>3.0</myT_thresh>
             <myTag>default</myTag>
         </driver>

mcd-analysis/src/main/java/org/lcsim/mcd/analysis/DRCorrection/alexDRCorr
correctionFunctions.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- correctionFunctions.java	18 Apr 2014 20:52:20 -0000	1.1
+++ correctionFunctions.java	9 May 2014 21:27:19 -0000	1.2
@@ -24,7 +24,7 @@
         map = new HashMap<cutConfiguration, Map<String,IFunction>>();
         Map submap = new HashMap<String,IFunction>();
         
-        cutConfiguration cutcon = new cutConfiguration(0.0,0.0,0.0,"any","default");
+        cutConfiguration cutcon = new cutConfiguration(0.0,0.0,"any","default");
         double[] defSCparms = {0.0,1.0};
         double[] defCCparms = {3.6605e-3,1.87977e-5};
         IFunction SC = functionFactory.createFunctionByName("SC", "p1");

mcd-analysis/src/main/java/org/lcsim/mcd/analysis/DRCorrection/alexDRCorr
electronCorrection.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- electronCorrection.java	19 Apr 2014 00:26:02 -0000	1.3
+++ electronCorrection.java	9 May 2014 21:27:19 -0000	1.4
@@ -138,8 +138,14 @@
         for (List<SimCalorimeterHit> simCalorimeterHits : simCalorimeterHitCollections) {
             String CollectionName = event.getMetaData(simCalorimeterHits).getName();
             if (CollectionName.contains("Edep")) {
+                double e_thresh = 0.0;
+                if (CollectionName.contains("ECal")) {
+                    e_thresh = 0.02*cutCon.mip_thresh;
+                } else {
+                    e_thresh = 0.05*cutCon.mip_thresh;
+                }
                 for (SimCalorimeterHit calorimeterHit : simCalorimeterHits) {
-                    if (cutCon.T_thresh > 0.0 || cutCon.S_thresh > 0.0) {
+                    if (cutCon.T_thresh > 0.0 || e_thresh > 0.0) {
                         Hep3Vector diffvec = VecOp.sub(calorimeterHit.getPositionVec(), origin);
                         double E_contrib = 0.0;
                         int ncontribs = calorimeterHit.getMCParticleCount();
@@ -150,7 +156,7 @@
                                 E_contrib += calorimeterHit.getContributedEnergy(i);
                             }
                         }
-                        if (E_contrib > cutCon.S_thresh/1000.0) {
+                        if (E_contrib > e_thresh) {
                             sumEEdep += E_contrib;
                         }
                     }
@@ -160,8 +166,14 @@
                 }
             } // end if Edep
             if (CollectionName.contains("Opti")) {
+                double e_thresh = 0.0;
+                if (CollectionName.contains("ECal")) {
+                    e_thresh = 1000.0*cutCon.mip_thresh;
+                } else {
+                    e_thresh = 2500.0*cutCon.mip_thresh;
+                }
                 for (SimCalorimeterHit calorimeterHit : simCalorimeterHits) {
-                    if (cutCon.T_thresh > 0.0 || cutCon.C_thresh > 0.0) {
+                    if (cutCon.T_thresh > 0.0 || e_thresh > 0.0) {
                         Hep3Vector diffvec = VecOp.sub(calorimeterHit.getPositionVec(), origin);
                         double E_contrib = 0.0;
                         int ncontribs = calorimeterHit.getMCParticleCount();
@@ -172,8 +184,8 @@
                                 E_contrib += calorimeterHit.getContributedEnergy(i);
                             }
                         }
-                        if (E_contrib > cutCon.C_thresh) {
-                            sumEEdep += E_contrib;
+                        if (E_contrib > e_thresh) {
+                            sumECeren += E_contrib;
                         }
                     }
                     else {

mcd-analysis/src/main/java/org/lcsim/mcd/analysis/DRCorrection/alexDRCorr
ElectronCalibrationDriver.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- ElectronCalibrationDriver.java	18 Apr 2014 20:52:20 -0000	1.1
+++ ElectronCalibrationDriver.java	9 May 2014 21:27:19 -0000	1.2
@@ -10,8 +10,7 @@
     
     private String P_name = "any";
     private String tag = "default";
-    private Double C_thresh = 0.0;
-    private Double S_thresh = 0.0;
+    private Double mip_thresh = 0.0;
     private Double T_thresh = 0.0;
     private String AIDAFile = null;
     
@@ -27,9 +26,9 @@
         System.out.println("ElectronCalibrationDriver:startOfData");
         cutConfiguration cutco;
         if (tag.equals("default")) {
-            cutco = new cutConfiguration(C_thresh, S_thresh, T_thresh, "any");
+            cutco = new cutConfiguration(mip_thresh, T_thresh, "any");
         } else {
-            cutco = new cutConfiguration(C_thresh, S_thresh, T_thresh, "any", tag);
+            cutco = new cutConfiguration(mip_thresh, T_thresh, "any", tag);
         }
         AIDAFile = "EC-" + cutco.toString() + ".aida";
         elec.setMyAIDAFilename(AIDAFile);
@@ -47,14 +46,9 @@
         this.tag = tag;
     }
     
-    public void setMyC_thresh(double cthresh) {
-        System.out.println("ElectronCalibrationDriver:setMyC_thresh = " + cthresh);
-        this.C_thresh = cthresh;
-    }
-    
-    public void setMyS_thresh(double sthresh) {
-        System.out.println("ElectronCalibrationDriver:setMyS_thresh = " + sthresh);
-        this.S_thresh = sthresh;
+    public void setMyMIP_thresh(double mipthresh) {
+        System.out.println("ElectronCalibrationDriver:setMyMIP_thresh = " + mipthresh);
+        this.mip_thresh = mipthresh;
     }
     
     public void setMyT_thresh(double tthresh) {

mcd-analysis/src/main/java/org/lcsim/mcd/analysis/DRCorrection/alexDRCorr
DRResolutionDriver.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- DRResolutionDriver.java	18 Apr 2014 20:52:20 -0000	1.1
+++ DRResolutionDriver.java	9 May 2014 21:27:19 -0000	1.2
@@ -10,8 +10,7 @@
     
     private String P_name = "any";
     private String tag = "default";
-    private Double C_thresh = 0.0;
-    private Double S_thresh = 0.0;
+    private Double mip_thresh = 0.0;
     private Double T_thresh = 0.0;
     private String AIDAFile = null;
     
@@ -27,9 +26,9 @@
         System.out.println("DRResolutionDriver:startOfData");
         cutConfiguration cutco;
         if (tag.equals("default")) {
-            cutco = new cutConfiguration(C_thresh, S_thresh, T_thresh, P_name);
+            cutco = new cutConfiguration(mip_thresh, T_thresh, P_name);
         } else {
-            cutco = new cutConfiguration(C_thresh, S_thresh, T_thresh, P_name, tag);
+            cutco = new cutConfiguration(mip_thresh, T_thresh, P_name, tag);
         }
         AIDAFile = "res-" + cutco.toString() + ".aida";
         resol.setMyAIDAFilename(AIDAFile);
@@ -48,14 +47,9 @@
         this.tag = tag;
     }
     
-    public void setMyC_thresh(double cthresh) {
-        System.out.println("DRResolutionDriver:setMyC_thresh = " + cthresh);
-        this.C_thresh = cthresh;
-    }
-    
-    public void setMyS_thresh(double sthresh) {
-        System.out.println("DRResolutionDriver:setMyS_thresh = " + sthresh);
-        this.S_thresh = sthresh;
+    public void setMyMIP_thresh(double mipthresh) {
+        System.out.println("DRResolutionDriver:setMyMIP_thresh = " + mipthresh);
+        this.mip_thresh = mipthresh;
     }
     
     public void setMyT_thresh(double tthresh) {

mcd-analysis/src/main/java/org/lcsim/mcd/analysis/DRCorrection/alexDRCorr
DualCorrection.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- DualCorrection.java	19 Apr 2014 00:26:02 -0000	1.3
+++ DualCorrection.java	9 May 2014 21:27:19 -0000	1.4
@@ -158,8 +158,14 @@
         for (List<SimCalorimeterHit> simCalorimeterHits : simCalorimeterHitCollections) {
             String CollectionName = event.getMetaData(simCalorimeterHits).getName();
             if (CollectionName.contains("Edep")) {
+                double e_thresh = 0.0;
+                if (CollectionName.contains("ECal")) {
+                    e_thresh = 0.02*cutCon.mip_thresh;
+                } else {
+                    e_thresh = 0.05*cutCon.mip_thresh;
+                }
                 for (SimCalorimeterHit calorimeterHit : simCalorimeterHits) {
-                    if (cutCon.T_thresh > 0.0 || cutCon.S_thresh > 0.0) {
+                    if (cutCon.T_thresh > 0.0 || e_thresh > 0.0) {
                         Hep3Vector diffvec = VecOp.sub(calorimeterHit.getPositionVec(), origin);
                         double E_contrib = 0.0;
                         int ncontribs = calorimeterHit.getMCParticleCount();
@@ -170,7 +176,7 @@
                                 E_contrib += calorimeterHit.getContributedEnergy(i);
                             }
                         }
-                        if (E_contrib > cutCon.S_thresh/1000.0) {
+                        if (E_contrib > e_thresh) {
                             sumEEdep += E_contrib;
                         }
                     }
@@ -180,8 +186,14 @@
                 }
             } // end if Edep
             if (CollectionName.contains("Opti")) {
+                double e_thresh = 0.0;
+                if (CollectionName.contains("ECal")) {
+                    e_thresh = 1000.0*cutCon.mip_thresh;
+                } else {
+                    e_thresh = 2500.0*cutCon.mip_thresh;
+                }
                 for (SimCalorimeterHit calorimeterHit : simCalorimeterHits) {
-                    if (cutCon.T_thresh > 0.0 || cutCon.C_thresh > 0.0) {
+                    if (cutCon.T_thresh > 0.0 || e_thresh > 0.0) {
                         Hep3Vector diffvec = VecOp.sub(calorimeterHit.getPositionVec(), origin);
                         double E_contrib = 0.0;
                         int ncontribs = calorimeterHit.getMCParticleCount();
@@ -192,7 +204,7 @@
                                 E_contrib += calorimeterHit.getContributedEnergy(i);
                             }
                         }
-                        if (E_contrib > cutCon.C_thresh) {
+                        if (E_contrib > e_thresh) {
                             sumECeren += E_contrib;
                         }
                     }
@@ -204,7 +216,12 @@
         }
         Edep.fill(sumEEdep);
         Eceren.fill(sumECeren);
-        Edep_frac.fill(sumEEdep / E_kin);
+        double E_mc_in = E_in;
+        if (Particlename.equals("p") || Particlename.equals("n")) {
+            E_mc_in = E_kin;
+        }
+//        Edep_frac.fill(sumEEdep / E_kin);
+        Edep_frac.fill(sumEEdep / E_mc_in);
 
         if (sumEEdep > 0.0) {
             double[] xval = {0.0};
@@ -215,7 +232,8 @@
             Edep_cor.fill(sumEEdep_cor);
             Eceren_cor.fill(sumECeren_cor);
             double ratio = sumECeren_cor / sumEEdep_cor;
-            double fraction = sumEEdep_cor / E_kin;
+//            double fraction = sumEEdep_cor / E_kin;
+            double fraction = sumEEdep_cor / E_mc_in;
             aida.cloud1D("frac").fill(fraction);
             aida.cloud1D("c_CerenEdep_ratio").fill(ratio);
             c_Ceren_vs_Edep.fill(sumECeren_cor, sumEEdep_cor);
@@ -254,7 +272,7 @@
                 double meanc = slices[i].mean();
                 double rmsc = slices[i].rms();
                 double nsigmas = 3.;
-                int nbins = 100;
+                int nbins = 50;
                 double minx = meanc - nsigmas * rmsc;
                 double maxx = meanc + nsigmas * rmsc;
                 slices[i].setConversionParameters(nbins, minx, maxx);
@@ -262,7 +280,7 @@
                 conv_slices[i] = slices[i].histogram();
             }
             int entries = conv_slices[i].entries();
-            if (entries > 300) {
+            if (entries > 150) {
                 System.out.println("Fitter:  " + fitter);
                 double meanguess = 0;
                 for (int j = 0; j < conv_slices[i].axis().bins(); j++) {

mcd-analysis/src/main/java/org/lcsim/mcd/analysis/DRCorrection/alexDRCorr
Resolution.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- Resolution.java	19 Apr 2014 00:26:02 -0000	1.3
+++ Resolution.java	9 May 2014 21:27:19 -0000	1.4
@@ -170,8 +170,14 @@
         for (List<SimCalorimeterHit> simCalorimeterHits : simCalorimeterHitCollections) {
             String CollectionName = event.getMetaData(simCalorimeterHits).getName();
             if (CollectionName.contains("Edep")) {
+                double e_thresh = 0.0;
+                if (CollectionName.contains("ECal")) {
+                    e_thresh = 0.02*cutCon.mip_thresh;
+                } else {
+                    e_thresh = 0.05*cutCon.mip_thresh;
+                }
                 for (SimCalorimeterHit calorimeterHit : simCalorimeterHits) {
-                    if (cutCon.T_thresh > 0.0 || cutCon.S_thresh > 0.0) {
+                    if (cutCon.T_thresh > 0.0 || e_thresh > 0.0) {
                         Hep3Vector diffvec = VecOp.sub(calorimeterHit.getPositionVec(), origin);
                         double E_contrib = 0.0;
                         int ncontribs = calorimeterHit.getMCParticleCount();
@@ -182,7 +188,7 @@
                                 E_contrib += calorimeterHit.getContributedEnergy(i);
                             }
                         }
-                        if (E_contrib > cutCon.S_thresh/1000.0) {
+                        if (E_contrib > e_thresh) {
                             sumEEdep += E_contrib;
                         }
                     }
@@ -192,8 +198,14 @@
                 }
             } // end if Edep
             if (CollectionName.contains("Opti")) {
+                double e_thresh = 0.0;
+                if (CollectionName.contains("ECal")) {
+                    e_thresh = 1000.0*cutCon.mip_thresh;
+                } else {
+                    e_thresh = 2500.0*cutCon.mip_thresh;
+                }
                 for (SimCalorimeterHit calorimeterHit : simCalorimeterHits) {
-                    if (cutCon.T_thresh > 0.0 || cutCon.C_thresh > 0.0) {
+                    if (cutCon.T_thresh > 0.0 || e_thresh > 0.0) {
                         Hep3Vector diffvec = VecOp.sub(calorimeterHit.getPositionVec(), origin);
                         double E_contrib = 0.0;
                         int ncontribs = calorimeterHit.getMCParticleCount();
@@ -204,7 +216,7 @@
                                 E_contrib += calorimeterHit.getContributedEnergy(i);
                             }
                         }
-                        if (E_contrib > cutCon.C_thresh) {
+                        if (E_contrib > e_thresh) {
                             sumECeren += E_contrib;
                         }
                     }
@@ -297,12 +309,12 @@
             dp_Correctede.coordinate(1).setErrorPlus(Ein_prev * 0.001);
             dp_Correctede.coordinate(1).setErrorMinus(Ein_prev * 0.001);
             point_Correctede[i]++;
-            IDataPoint dp_Resolution = dps_DRResolution[i].addPoint();
+            IDataPoint dp_DRResolution = dps_DRResolution[i].addPoint();
             double sigma = Math.abs(result[2]);
-            dp_Resolution.coordinate(0).setValue(1.0/Math.sqrt(Ein_prev));
-            dp_Resolution.coordinate(1).setValue(Math.abs(sigma)/Ein_prev);
-            dp_Resolution.coordinate(1).setErrorMinus(errsplus[2]/Ein_prev);
-            dp_Resolution.coordinate(1).setErrorPlus(errsminu[2]/Ein_prev);
+            dp_DRResolution.coordinate(0).setValue(1.0/Math.sqrt(Ein_prev));
+            dp_DRResolution.coordinate(1).setValue(Math.abs(sigma)/Ein_prev);
+            dp_DRResolution.coordinate(1).setErrorMinus(errsplus[2]/Ein_prev);
+            dp_DRResolution.coordinate(1).setErrorPlus(errsminu[2]/Ein_prev);
             IDataPoint dp_DCorrFrac = dps_DCorrFrac[i].addPoint();
             double mean = result[1];
             dp_DCorrFrac.coordinate(0).setValue(Ein_prev);
@@ -334,10 +346,10 @@
             errors = jminuitResult.errors();
             IDataPoint dp_SRResolution = dps_SRResolution[i].addPoint();
             sigma = Math.abs(result[2]);
-            dp_Resolution.coordinate(0).setValue(1.0/Math.sqrt(Ein_prev));
-            dp_Resolution.coordinate(1).setValue(Math.abs(sigma)/Ein_prev);
-            dp_Resolution.coordinate(1).setErrorMinus(errsplus[2]/Ein_prev);
-            dp_Resolution.coordinate(1).setErrorPlus(errsminu[2]/Ein_prev);
+            dp_SRResolution.coordinate(0).setValue(1.0/Math.sqrt(Ein_prev));
+            dp_SRResolution.coordinate(1).setValue(Math.abs(sigma)/Ein_prev);
+            dp_SRResolution.coordinate(1).setErrorMinus(errors[2]/Ein_prev);
+            dp_SRResolution.coordinate(1).setErrorPlus(errors[2]/Ein_prev);
         }
         
 

mcd-analysis/src/main/java/org/lcsim/mcd/analysis/DRCorrection/alexDRCorr
proton_calibration_steering.xml 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- proton_calibration_steering.xml	18 Apr 2014 22:02:58 -0000	1.2
+++ proton_calibration_steering.xml	9 May 2014 21:27:19 -0000	1.3
@@ -24,8 +24,8 @@
         <driver name="DRCalibrationDriver" 
                 type="org.lcsim.mcd.analysis.DRCorrection.alexDRCorr.DRCalibrationDriver">
             <myP_name>proton</myP_name>
-            <myS_thresh>1.0</myS_thresh>
-            <myC_thresh>0.0</myC_thresh>
+            <myS_thresh>10.0</myS_thresh>
+            <myC_thresh>300.0</myC_thresh>
             <myT_thresh>3.0</myT_thresh>
             <myTag>default</myTag>
         </driver>

mcd-analysis/src/main/java/org/lcsim/mcd/analysis/DRCorrection/alexDRCorr
electron_calibration_steering.xml 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- electron_calibration_steering.xml	18 Apr 2014 20:52:20 -0000	1.1
+++ electron_calibration_steering.xml	9 May 2014 21:27:19 -0000	1.2
@@ -23,9 +23,8 @@
         <driver name="ElectronCalibrationDriver"
                 type="org.lcsim.mcd.analysis.DRCorrection.alexDRCorr.ElectronCalibrationDriver">
             <myP_name>any</myP_name>
-            <myS_thresh>0.0</myS_thresh>
-            <myC_thresh>0.0</myC_thresh>
-            <myT_thresh>0.0</myT_thresh>
+            <myMIP_thresh>0.02</myMIP_thresh>
+            <myT_thresh>3.0</myT_thresh>
             <myTag>default</myTag>
         </driver>
     </drivers>

mcd-analysis/src/main/java/org/lcsim/mcd/analysis/DRCorrection/alexDRCorr
cutConfiguration.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- cutConfiguration.java	18 Apr 2014 20:52:20 -0000	1.1
+++ cutConfiguration.java	9 May 2014 21:27:19 -0000	1.2
@@ -11,23 +11,20 @@
  * @author aconway
  */
 public class cutConfiguration {
-    public Double C_thresh;
-    public Double S_thresh;
+    public Double mip_thresh;
     public Double T_thresh;
     public String P_name;
     public String tag;
     
-    public cutConfiguration(Double Ct, Double St, Double Tt, String name) {
-        C_thresh = Ct;
-        S_thresh = St;
+    public cutConfiguration(Double Mt, Double Tt, String name) {
+        mip_thresh = Mt;
         T_thresh = Tt;
         P_name = name;
         tag = "default";
     }
     
-    public cutConfiguration(Double Ct, Double St, Double Tt, String name, String t) {
-        C_thresh = Ct;
-        S_thresh = St;
+    public cutConfiguration(Double Mt, Double Tt, String name, String t) {
+        mip_thresh = Mt;
         T_thresh = Tt;
         P_name = name;
         tag = t;
@@ -38,8 +35,7 @@
         if ((o instanceof cutConfiguration) &&
                 (((cutConfiguration) o).P_name.equals(this.P_name)) &&
                 (((cutConfiguration) o).tag.equals(this.tag)) &&
-                (((cutConfiguration) o).C_thresh.compareTo(this.C_thresh) == 0) &&
-                (((cutConfiguration) o).S_thresh.compareTo(this.S_thresh) == 0) &&
+                (((cutConfiguration) o).mip_thresh.compareTo(this.mip_thresh) == 0) &&
                 (((cutConfiguration) o).T_thresh.compareTo(this.T_thresh) == 0))
         {
             return true;
@@ -52,8 +48,7 @@
     public int hashCode() {
         int hash = 7;
         hash = 53 * hash + (this.P_name != null ? this.P_name.hashCode() : 0);
-        hash = 53 * hash + (this.C_thresh != null ? this.C_thresh.hashCode() : 0);
-        hash = 53 * hash + (this.S_thresh != null ? this.S_thresh.hashCode() : 0);
+        hash = 53 * hash + (this.mip_thresh != null ? this.mip_thresh.hashCode() : 0);
         hash = 53 * hash + (this.T_thresh != null ? this.T_thresh.hashCode() : 0);
         return hash;
     }
@@ -62,8 +57,7 @@
     public String toString() {
         String rv = P_name + "-" +
                 String.valueOf(this.T_thresh) + "ns-" +
-                String.valueOf(this.S_thresh) + "mev-" +
-                String.valueOf(this.C_thresh);
+                String.valueOf(this.mip_thresh) + "mip";
         if (!this.tag.equals("default")) {
             rv  = rv + "-" + this.tag;
         }
@@ -73,8 +67,7 @@
     public String toStringAnyP() {
         String rv = "any" + "-" +
                 String.valueOf(this.T_thresh) + "ns-" +
-                String.valueOf(this.S_thresh) + "mev-" +
-                String.valueOf(this.C_thresh);
+                String.valueOf(this.mip_thresh) + "mip";
         if (!this.tag.equals("default")) {
             rv  = rv + "-" + this.tag;
         }

mcd-analysis/src/main/java/org/lcsim/mcd/analysis/DRCorrection/alexDRCorr
DRCalibrationDriver.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- DRCalibrationDriver.java	18 Apr 2014 20:52:20 -0000	1.1
+++ DRCalibrationDriver.java	9 May 2014 21:27:19 -0000	1.2
@@ -10,8 +10,7 @@
     
     private String P_name = "any";
     private String tag = "default";
-    private Double C_thresh = 0.0;
-    private Double S_thresh = 0.0;
+    private Double mip_thresh = 0.0;
     private Double T_thresh = 0.0;
     private String AIDAFile = null;
     
@@ -27,9 +26,9 @@
         System.out.println("DRCalibrationDriver:startOfData");
         cutConfiguration cutco;
         if (tag.equals("default")) {
-            cutco = new cutConfiguration(C_thresh, S_thresh, T_thresh, P_name);
+            cutco = new cutConfiguration(mip_thresh, T_thresh, P_name);
         } else {
-            cutco = new cutConfiguration(C_thresh, S_thresh, T_thresh, P_name, tag);
+            cutco = new cutConfiguration(mip_thresh, T_thresh, P_name, tag);
         }
         AIDAFile = "DR-" + cutco.toString() + ".aida";
         dual.setMyAIDAFilename(AIDAFile);
@@ -48,14 +47,9 @@
         this.tag = tag;
     }
     
-    public void setMyC_thresh(double cthresh) {
-        System.out.println("ElectronCalibrationDriver:setMyC_thresh = " + cthresh);
-        this.C_thresh = cthresh;
-    }
-    
-    public void setMyS_thresh(double sthresh) {
-        System.out.println("ElectronCalibrationDriver:setMyS_thresh = " + sthresh);
-        this.S_thresh = sthresh;
+    public void setMyMIP_thresh(double mipthresh) {
+        System.out.println("ElectronCalibrationDriver:setMyMIP_thresh = " + mipthresh);
+        this.mip_thresh = mipthresh;
     }
     
     public void setMyT_thresh(double tthresh) {
CVSspam 0.2.12


Use REPLY-ALL to reply to list

To unsubscribe from the LCD-CVS list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCD-CVS&A=1