Commit in mcd-analysis/src/main/java/org/lcsim/mcd/analysis on MAIN | |||
CalAnalysisDriver.java | +25 | -26 | 1.1 -> 1.2 |
Driver to look at the timing in calorimeter cells
diff -u -r1.1 -r1.2 --- CalAnalysisDriver.java 11 Jan 2012 16:26:22 -0000 1.1 +++ CalAnalysisDriver.java 12 Jan 2012 15:41:11 -0000 1.2 @@ -7,7 +7,9 @@
import hep.aida.IAnalysisFactory; import hep.aida.ICloud1D;
+import hep.aida.ICloud2D;
import hep.aida.IHistogram1D;
+import hep.aida.IHistogram2D;
import hep.aida.IHistogramFactory; import hep.aida.ITree; import java.util.List;
@@ -15,7 +17,6 @@
import org.lcsim.event.EventHeader.LCMetaData; import org.lcsim.event.SimCalorimeterHit; import org.lcsim.util.Driver;
-import org.lcsim.util.aida.AIDA;
/** *
@@ -27,16 +28,14 @@
IAnalysisFactory af = IAnalysisFactory.create(); ITree tree = af.createTreeFactory().create(); IHistogramFactory hf = af.createHistogramFactory(tree);
- // tree.mkdir("/Histograms"); - // tree.cd("/Histograms"); - IHistogram1D h1 = hf.createHistogram1D("time", 1000, -1., 1.); -// IHistogram2D h2 = hf.createHistogram2D("Histogram 1D",); - //tree.mkdir("/Clouds"); - //tree.cd("/Clouds");
+ IHistogram1D hctime = hf.createHistogram1D("pathlength corrected time weighted by energy", 1000, -1., 1.); + IHistogram1D hctimef = hf.createHistogram1D("pathlength corrected time weighted by energy full range", 1000, -1., 1000.); + IHistogram1D htime = hf.createHistogram1D("time", 1000, 0., 1000.); + IHistogram1D htimeweighted = hf.createHistogram1D("time energy weighted", 1000, 0., 1000.);
ICloud1D c1 = hf.createCloud1D("Energy"); ICloud1D c2 = hf.createCloud1D("Radius");
-// private AIDA aida = AIDA.defaultInstance(); -// IHistogram1D h1 = aida.Histogram1D("Histogram 1D",50,-3,3);
+ IHistogram2D hrz = hf.createHistogram2D("r vs z energy weighted", 500, -6000., 6000., 500, 0., 5500.); + ICloud2D c3 = hf.createCloud2D("Radiusvsz energy weighted");
@Override protected void process(EventHeader event) {
@@ -45,24 +44,24 @@
LCMetaData meta = event.getMetaData(calHitList); String calName = meta.getName();
-// System.out.println(calName); - if ("Edep_EcalBarrelHits".equals(calName)||"Edep_HcalBarrelHits".equals(calName)) { - for (SimCalorimeterHit h : calHitList) { - double time = h.getTime(); - if (time < 0.0) { - System.out.println(time); - } - double energy = h.getRawEnergy(); - double[] xpos = h.getPosition(); - double radius = Math.sqrt(xpos[0] * xpos[0] + xpos[1] * xpos[1]); - double length = Math.sqrt(xpos[0] * xpos[0] + xpos[1] * xpos[1] + xpos[2] * xpos[2]); - h1.fill(time - length / clight, energy * 0.001); - c1.fill(energy); - c2.fill(radius); - //aida.cloud2D("rvsz").fill(xpos[2], radius); - //aida.cloud1D("energy").fill(energy); - }
+// if ("Edep_EcalBarrelHits".equals(calName)||"Edep_HcalBarrelHits".equals(calName)) { + for (SimCalorimeterHit h : calHitList) { + double time = h.getTime(); + double energy = h.getRawEnergy(); + double[] xpos = h.getPosition(); + double radius = Math.sqrt(xpos[0] * xpos[0] + xpos[1] * xpos[1]); + double length = Math.sqrt(xpos[0] * xpos[0] + xpos[1] * xpos[1] + xpos[2] * xpos[2]); + hctime.fill(time - length / clight, energy * 0.001); + hctimef.fill(time - length / clight, energy * 0.001); + htime.fill(time); + htimeweighted.fill(time, energy * 0.001); + c1.fill(energy); + c2.fill(radius); + c3.fill(xpos[2], radius, energy * 0.001); + hrz.fill(xpos[2], radius, energy * 0.001); + //aida.cloud1D("energy").fill(energy);
}
+// }
} }
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