1 added + 1 removed + 4 modified, total 6 files
hps-java/src/main/java/org/lcsim/hps/users/phansson
diff -u -r1.1 -r1.2
--- SimpleHPSConditions.java 12 Jul 2012 21:31:00 -0000 1.1
+++ SimpleHPSConditions.java 19 Jul 2012 19:35:03 -0000 1.2
@@ -6,8 +6,9 @@
import java.io.BufferedReader;
import java.io.FileNotFoundException;
-import java.io.FileReader;
import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
@@ -39,20 +40,21 @@
public List<SimpleHPSCondition> _conditionsList = new ArrayList<SimpleHPSCondition>();
- public SimpleHPSConditions(String pathToFile) {
+ public SimpleHPSConditions() {
- this.loadCond(pathToFile);
+ this.loadCond();
}
- public void loadCond(String pathToFile) {
- System.out.println("Reading beam currents from " + pathToFile);
- FileReader fReader;
+ public void loadCond() {
+// System.out.println("Reading beam currents from " + pathToFile);
+ InputStreamReader fReader;
BufferedReader bufReader;
try {
- fReader = new FileReader(pathToFile);
+ InputStream stream = this.getClass().getResourceAsStream("/org/lcsim/hps/steering/runConditions.txt");
+ fReader = new InputStreamReader(stream);
bufReader = new BufferedReader(fReader);
-
+
String line;
while( (line = bufReader.readLine()) != null) {
//System.out.println("Line: " + line);
hps-java/src/main/java/org/lcsim/hps/users/phansson
diff -u -r1.2 -r1.3
--- ECalHitMapPlots.java 12 Jul 2012 21:32:39 -0000 1.2
+++ ECalHitMapPlots.java 19 Jul 2012 19:35:03 -0000 1.3
@@ -81,7 +81,7 @@
public void plotBasic1D(IHistogram1D h, String title, String xTitle, String yTitle, String fillColor,boolean writeToFile) {
IPlotter plotter_hm = af.createPlotterFactory().create();
plotter_hm.setTitle(title);
- if(fillColor=="") fillColor="yellow";
+ if("".equals(fillColor)) fillColor="yellow";
//plotter_hm.createRegion(10.0,20.0, 460.0,100.0);
//plotter_hm.createRegion(d, d1, d2, d3)
plotter_hm.createRegions(1,1);//.plot(hm);
@@ -105,7 +105,7 @@
public void plotBasic1D(IHistogram1D h, IHistogram1D h2, String title, String xTitle, String yTitle, String leg1,String leg2,boolean writeToFile) {
IPlotter plotter_hm = af.createPlotterFactory().create();
- if(title!="") plotter_hm.setTitle(title);
+ if(!"".equals(title)) plotter_hm.setTitle(title);
//if(fillColor=="") fillColor="yellow";
//plotter_hm.createRegion(10.0,20.0, 460.0,100.0);
//plotter_hm.createRegion(d, d1, d2, d3)
@@ -130,8 +130,8 @@
// System.out.println(str);
//}
- if(xTitle!="") ((PlotterRegion) plotter_hm.region(0)).getPlot().getXAxis().setLabel(xTitle);
- if(yTitle!="") ((PlotterRegion) plotter_hm.region(0)).getPlot().getYAxis().setLabel(yTitle);
+ if(!"".equals(xTitle)) ((PlotterRegion) plotter_hm.region(0)).getPlot().getXAxis().setLabel(xTitle);
+ if(!"".equals(yTitle)) ((PlotterRegion) plotter_hm.region(0)).getPlot().getYAxis().setLabel(yTitle);
if(!hide) plotter_hm.show();
if(writeToFile) {
try {
hps-java/src/main/java/org/lcsim/hps/users/phansson
diff -u -r1.3 -r1.4
--- ecalPlots.java 17 Jul 2012 20:13:12 -0000 1.3
+++ ecalPlots.java 19 Jul 2012 19:35:03 -0000 1.4
@@ -5,15 +5,12 @@
package org.lcsim.hps.users.phansson;
import hep.aida.*;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.cli.*;
-import org.lcsim.util.aida.AIDA;
/**
*
@@ -130,7 +127,7 @@
}
- SimpleHPSConditions cond = new SimpleHPSConditions("runConditions.txt");
+ SimpleHPSConditions cond = new SimpleHPSConditions();
int idx = file_data.indexOf("run");
@@ -239,7 +236,7 @@
- SimpleHPSConditions cond = new SimpleHPSConditions("/Users/phansson/work/HPS/software/reco/hps-java/src/main/java/org/lcsim/hps/users/phansson/runConditions.txt");
+ SimpleHPSConditions cond = new SimpleHPSConditions();
int idx = file_data.indexOf("run");
int run_data = Integer.parseInt(file_data.substring(idx+3,idx+7));
@@ -260,7 +257,7 @@
System.out.printf("Run %d: rate %.1fHz rec rate %.1fHz\n",run_data,cond.getRate(run_bkg),cond.getRecRate(run_bkg));
System.out.printf("=> k_rate_bkg %.2f\n",k_rec_bkg );
- double k_norm_bkg = cond.getIntCurrent(run_data)/cond.getIntCurrent(run_bkg);;
+ double k_norm_bkg = cond.getIntCurrent(run_data)/cond.getIntCurrent(run_bkg);
System.out.printf("Run %d: intCurrent %.1fnC \n",run_bkg,cond.getIntCurrent(run_bkg));
System.out.printf("=> k_norm_bkg %.1f\n",k_norm_bkg );
@@ -304,14 +301,18 @@
}
System.out.println("Added " + iadded + " histograms");
-
- h_bkg.scale(k_norm_bkg*k_rec_data/k_rec_bkg);
-
+
+ //scale data by dead time efficiency
+ h_bkg.scale(1/k_rec_bkg);
+ h_obs.scale(1/k_rec_data);
+
+ //subtract normalized background from data
+ h_bkg.scale(k_norm_bkg);
IHistogram1D h_data = ecalhtplots.hf.subtract(h_obs.title() + " bkgsubtr", h_obs, h_bkg);
- if(dataToMCNorm) {
+ if(dataToMCNorm) { //normalize by setting histogram integrals equal
h_mc.scale(h_data.sumBinHeights()/h_mc.sumBinHeights());
- } else {
+ } else { //absolute normalization to beam current
h_mc.scale(k_Q);
}
//System.out.println("mc " + h_mc.entries() + "(" + h_mc.allEntries() + ")" + " obs " + h_obs.entries()+ "(" + h_obs.allEntries() + ")" + " bkg " + h_bkg.entries()+ "(" + h_bkg.allEntries() + ")" + " obs " + h_data.entries()+ "(" + h_data.allEntries() + ")");
hps-java/src/main/java/org/lcsim/hps/users/phansson
diff -N runConditions.txt
--- runConditions.txt 12 Jul 2012 21:34:09 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,10 +0,0 @@
-run # start time end time integrated beam current (nC) thickness (%r.l.) Rate(Hz) Recorded(Hz) Magnet Polarity
-1349 1337323714 1337324625 51344.0926551819 54879.7343788147 1.6 1262.120 1174.728 -1
-1351 1337324962 1337325268 24385.9185791016 26928.0426635742 1.6 1933.479 1696.808 -1
-1353 1337325717 1337328357 193508.881838322 204325.132622242 0.18 436.895 425.659 -1
-1354 1337328521 1337330670 140709.898532331 148839.141475141 0.45 596.055 570.870 -1
-1358 1337331152 1337332431 88079.5567516331 92523.9428218845 0 309.785 304.253 -1
-1359 1337332615 1337334014 91653.0026320741 91761.4541434497 0 318.640 311.540 1
-1360 1337334136 1337336898 198670.590789914 209883.979889035 0.18 451.067 446.510 1
-1362 1337337264 1337338713 105642.70688653 110298.553449392 1.6 1864.090 1659.675 1
-1363 1337340178 1337340456 8556.8459701538 8556.8459701538 1.6 1864.090 1659.675 1
hps-java/src/main/resources/org/lcsim/hps/steering
diff -N runConditions.txt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ runConditions.txt 19 Jul 2012 19:35:03 -0000 1.1
@@ -0,0 +1,10 @@
+run # start time end time integrated beam current (nC) thickness (%r.l.) Rate(Hz) Recorded(Hz) Magnet Polarity
+1349 1337323714 1337324625 51344.0926551819 54879.7343788147 1.6 1262.120 1174.728 -1
+1351 1337324962 1337325268 24385.9185791016 26928.0426635742 1.6 1933.479 1696.808 -1
+1353 1337325717 1337328357 193508.881838322 204325.132622242 0.18 436.895 425.659 -1
+1354 1337328521 1337330670 140709.898532331 148839.141475141 0.45 596.055 570.870 -1
+1358 1337331152 1337332431 88079.5567516331 92523.9428218845 0 309.785 304.253 -1
+1359 1337332615 1337334014 91653.0026320741 91761.4541434497 0 318.640 311.540 1
+1360 1337334136 1337336898 198670.590789914 209883.979889035 0.18 451.067 446.510 1
+1362 1337337264 1337338713 105642.70688653 110298.553449392 1.6 1864.090 1659.675 1
+1363 1337340178 1337340456 8556.8459701538 8556.8459701538 1.6 1864.090 1659.675 1
hps-java/src/main/resources/org/lcsim/hps/steering
diff -u -r1.1 -r1.2
--- MultScatAna.lcsim 17 Jul 2012 20:13:12 -0000 1.1
+++ MultScatAna.lcsim 19 Jul 2012 19:35:03 -0000 1.2
@@ -12,10 +12,10 @@
<driver name="EcalRawConverter"/>
<driver name="EcalClusterer"/>
- <driver name="RawTrackerHitMaker"/>
+<!-- <driver name="RawTrackerHitMaker"/>
<driver name="RawTrackerHitFitterDriver"/>
<driver name="TrackerHitDriver"/>
- <driver name="TrackerReconDriver"/>
+ <driver name="TrackerReconDriver"/>-->
<!--
<driver name="SVTOccupancyPlots"/>
<driver name="TrackingReconstructionPlots"/>
@@ -47,22 +47,22 @@
<!-- <outputPlotFileName>/Users/phansson/work/HPS/software/reco/run/multscatana_1353_0_682913.aida</outputPlotFileName> -->
<!-- <outputPlotFileName>/Users/phansson/work/HPS/software/reco/run/multscatana_1353_1_328525.aida</outputPlotFileName> -->
<!-- <outputPlotFileName>/Users/phansson/work/HPS/software/reco/run/multscatana_1354_0_692635.aida</outputPlotFileName> -->
- <outputPlotFileName>/Users/phansson/work/HPS/software/reco/run/multscatana.aida</outputPlotFileName>
+ <outputPlotFileName>multscatana.aida</outputPlotFileName>
</driver>
<driver name="TrigRateDriver"
type="org.lcsim.hps.users.phansson.TrigRateDriver">
<debug>false</debug>
<hideFrame>false</hideFrame>
- <outputPlotFileName>/Users/phansson/work/HPS/software/reco/run/trigratefile.aida</outputPlotFileName>
+ <outputPlotFileName>trigratefile.aida</outputPlotFileName>
</driver>
- <driver name="GainCalibrationDriver"
+<!-- <driver name="GainCalibrationDriver"
type="org.lcsim.hps.recon.ecal.GainCalibrationDriver">
<debug>false</debug>
<hideFrame>false</hideFrame>
<outputPlotFileName></outputPlotFileName>
- </driver>
+ </driver>-->
CVSspam 0.2.12