SlicDiagnostics/src/org/lcsim/slic/diagnostics/calorimeterhit
diff -u -r1.1 -r1.2
--- SimCalHitNoDetectorPlots.java 7 Oct 2009 03:17:27 -0000 1.1
+++ SimCalHitNoDetectorPlots.java 7 Oct 2009 06:09:18 -0000 1.2
@@ -31,6 +31,11 @@
{
public void definePlots()
{
+ c1d("Raw Energy by Event", "Energy [GeV]", "Number of Entries");
+ c1d("Hit Corrected Energy", "Energy [GeV]", "Number of Entries");
+ c1d("Corrected Energy by Event", "Energy [GeV]", "Number of Entries");
+ c2d("Event Energy vs Hits", "Energy [GeV]","Number of Hits");
+ c1d("Raw Energy", "Energy [GeV]", "Number of Entries");
c1d("X Position", "X [mm]", "Number of Entries");
c1d("Y Position", "Y [mm]", "Number of Entries");
c1d("Z Position", "Z [mm]", "Number of Entries");
@@ -38,16 +43,12 @@
c2d("Z vs X", "Z [mm]", "X [mm]");
c2d("Z vs Y", "Z [mm]", "Y [mm]");
c1d("Spherical Radius", "R [mm]", "Number of Entries");
+ c2d("Spherical Radius vs Raw Energy", "R [mm]", "Number of Entries");
+ c2d("Spherical Radius vs Time", "Spherical Radius", "Time");
c1d("Cylindrical Radius", "R [mm]", "Number of Entries");
- ICloud1D time = c1d("Time","Time [ns]","Number of Entries");
- time.annotation().addItem("xAxisScale", "log");
- ICloud1D avgTime = c1d("Average Hit Time by Event","Time [ns]","Number of Entries");
- avgTime.annotation().addItem("xAxisScale", "log");
- c1d("Raw Energy", "Energy [GeV]", "Number of Entries");
c1d("Cos Theta", "cos(theta)", "Number of Entries");
c1d("Phi", "phi [radians]", "Number of Entries");
- c1d("Number of Hits by Event", "Hit Count", "Number of Entries");
- c1d("Total Raw Energy by Event", "Energy [GeV]", "Number of Entries");
+ c1d("Hits by Event", "Hit Count", "Number of Entries");
c1d("Average Hit Energy by Event", "Energy [GeV]", "Number of Entries");
c1d("Minimum Hit Raw Energy by Event", "Energy [GeV]", "Number of Entries");
c1d("Maximum Hit Raw Energy by Event", "Energy [GeV]", "Number of Entries");
@@ -55,9 +56,14 @@
c1d("Maximum Cylindrical Radius by Event", "Radius [mm]", "Number of Entries");
c1d("Minimum Spherical Radius by Event", "Radius [mm]", "Number of Entries");
c1d("Maximum Spherical Radius by Event", "Radius [mm]", "Number of Entries");
- c1d("Number of MC Contribs per Hit", "Count", "Number of Entries");
- c1d("Averge Number of MC Contribs per Hit by Event", "Count", "Number of Entries");
- c1d("Number of Unique MCP Contributions by Event", "Count", "Number of Entries");
+ c1d("Particles per Hit", "Count", "Number of Entries");
+ c1d("Particles by Event", "Count", "Number of Entries");
+ c1d("Particle Contributions by Event", "Count", "Number of Entries");
+
+ ICloud1D time = c1d("Time","Time [ns]","Number of Entries");
+ time.annotation().addItem("xAxisScale", "log");
+ ICloud1D avgTime = c1d("Average Hit Time by Event","Time [ns]","Number of Entries");
+ avgTime.annotation().addItem("xAxisScale", "log");
}
public void plotCollection(EventHeader event, String collectionName)
@@ -73,6 +79,7 @@
int contribs = 0;
double timeSum = 0.;
double esum = 0.;
+ double cesum = 0.;
double mine = Double.MAX_VALUE;
double maxe = 0.;
double minsr = Double.MAX_VALUE;
@@ -84,9 +91,35 @@
Set<MCParticle> uniqMcps = new HashSet<MCParticle>();
for (SimCalorimeterHit hit : collection)
- {
- double[] position = hit.getPosition();
+ {
double e = hit.getRawEnergy();
+ double t = hit.getTime();
+ c1d("Time").fill(t);
+ if (t > maxt)
+ maxt = t;
+ if (t < mint)
+ mint = t;
+
+ c1d("Raw Energy").fill(e);
+ esum += e;
+ if (e > maxe)
+ maxe = e;
+ if (e < mine)
+ mine = e;
+ double ce=0.;
+ try
+ {
+ // This could fail in a number of ways so catch anything!
+ ce = hit.getCorrectedEnergy();
+ }
+ catch (Throwable x)
+ {
+ // Oops! No detector?
+ }
+ cesum += ce;
+ c1d("Hit Corrected Energy").fill(ce);
+
+ double[] position = hit.getPosition();
Hep3Vector positionVector =
new BasicHep3Vector(position[0], position[1], position[2]);
@@ -98,14 +131,10 @@
c2d("Z vs X").fill(position[2], position[0]);
c2d("Z vs Y").fill(position[2], position[1]);
- c1d("Raw Energy").fill(e);
- if (e > maxe)
- maxe = e;
- if (e < mine)
- mine = e;
-
double sr = getSphericalRadius(position);
c1d("Spherical Radius").fill(sr);
+ c2d("Spherical Radius vs Raw Energy").fill(sr,e);
+ c2d("Spherical Radius vs Time").fill(sr,e);
if (sr > maxsr)
maxsr = sr;
if (sr < minsr)
@@ -118,21 +147,17 @@
if (sr < mincr)
mincr = cr;
- double t = hit.getTime();
- c1d("Time").fill(t);
- if (t > maxt)
- maxt = t;
- if (t < mint)
- mint = t;
-
- c1d("Cos Theta").fill(VecOp.cosTheta(positionVector));
- c1d("Phi").fill(VecOp.phi(positionVector));
+ double cosTheta = VecOp.cosTheta(positionVector);
+ double phi = VecOp.phi(positionVector);
+ c1d("Cos Theta").fill(cosTheta);
+ c2d("Cos Theta vs Energy").fill(cosTheta,e);
+ c1d("Phi").fill(phi);
+ c2d("Phi vs Energy").fill(phi,e);
int mcpCount = hit.getMCParticleCount();
- c1d("Number of MC Contribs per Hit").fill(mcpCount);
+ c1d("Particles per Hit").fill(mcpCount);
contribs += mcpCount;
- esum += e;
++hits;
timeSum += t;
@@ -141,14 +166,14 @@
uniqMcps.add(hit.getMCParticle(i));
}
}
-
- c1d("Average Hit Energy by Event").fill(esum / hits);
- c1d("Number of Hits by Event").fill(hits);
- c1d("Total Raw Energy by Event").fill(esum);
- c1d("Averge Number of MC Contribs per Hit by Event").fill(contribs / hits);
- c1d("Average Hit Time by Event","Time [ns]","Number of Entries").fill(timeSum / hits);
- c1d("Number of Unique MCP Contributions by Event").fill(uniqMcps.size());
-
+ c2d("Event Energy vs Hits").fill(esum, hits);
+ c1d("Average Hit Energy by Event").fill(esum/hits);
+ c1d("Hits by Event").fill(hits);
+ c1d("Raw Energy by Event").fill(esum);
+ c1d("Corrected Energy by Event").fill(cesum);
+ c1d("Average MC Contribs per Hit by Event").fill(contribs / hits);
+ c1d("Average Hit Time by Event","Time [ns]","Number of Entries").fill(timeSum/hits);
+ c1d("Particles by Event").fill(uniqMcps.size());
c1d("Maximum Hit Raw Energy by Event").fill(maxe);
c1d("Minimum Hit Raw Energy by Event").fill(mine);
c1d("Minimum Cylindrical Radius by Event").fill(mincr);
@@ -174,16 +199,4 @@
{
super.startOfData();
}
-
- public void endOfData()
- {
- try
- {
- AIDA.defaultInstance().saveAs("calHitPlots.aida");
- }
- catch (Exception x)
- {
- throw new RuntimeException(x);
- }
- }
}