9 modified files
SlicDiagnostics/src/org/lcsim/slic/diagnostics
diff -u -r1.7 -r1.8
--- CalorimeterHitPlots.java 17 Aug 2005 04:14:31 -0000 1.7
+++ CalorimeterHitPlots.java 18 Aug 2005 00:50:00 -0000 1.8
@@ -9,21 +9,22 @@
import hep.aida.ICloud1D;
import hep.aida.ICloud2D;
-import hep.aida.ITree;
-
-import org.lcsim.util.Driver;
import org.lcsim.event.EventHeader;
-import org.lcsim.util.aida.AIDA;
import org.lcsim.event.EventHeader.LCMetaData;
import org.lcsim.event.SimCalorimeterHit;
import org.lcsim.event.MCParticle;
+import org.lcsim.geometry.segmentation.SegmentationBase;
+import org.lcsim.geometry.segmentation.ProjectiveCylinder;
+import org.lcsim.geometry.segmentation.ProjectiveZPlane;
+import org.lcsim.geometry.segmentation.NonprojectiveCylinder;
+import org.lcsim.geometry.IDDecoder;
/**
*
* @author jeremym
*/
public class CalorimeterHitPlots extends PlotsBase
-{
+{
/* cal plots: basic MCP stats */
ICloud1D mcpCountPerHit;
ICloud1D mcpPDG;
@@ -38,7 +39,7 @@
/** Creates a new instance of CalorimeterHitPlots */
public CalorimeterHitPlots(LCMetaData meta)
{
- super(meta.getName());
+ super(meta.getName());
definePlots();
}
@@ -47,14 +48,14 @@
this.hits = hits;
}
- public void definePlots()
+ protected void definePlots()
{
super.definePlots();
-
+
mcpCountPerHit = aida.cloud1D(makePlotName("Contributing MCParticles per Hit"));
mcpPDG = aida.cloud1D(makePlotName("MCParticle PDGID"));
mcpSingleContribPDG = aida.cloud1D(makePlotName("MCParticle Single Contribution PDGID"));
- hitCorrectedEnergy = aida.cloud1D(makePlotName("Hit Corrected Energy"));
+ hitCorrectedEnergy = aida.cloud1D(makePlotName("Hit Corrected Energy"));
hitRawVsCorrectedEnergy = aida.cloud2D(makePlotName("Hit Raw vs Corrected Energy"));
}
@@ -68,14 +69,45 @@
}
private void fill(List<SimCalorimeterHit> hits)
- {
+ {
if ( hits.size() > 0 )
{
+ EventHeader.LCMetaData metadata = eventHeader.getMetaData(hits);
+ IDDecoder decoder = metadata.getIDDecoder();
+ SegmentationBase segmentation = (SegmentationBase)decoder;
+
for ( SimCalorimeterHit hit : hits)
{
+ decoder.setID(hit.getCellID());
+
+ if ( segmentation instanceof ProjectiveCylinder ||
+ segmentation instanceof NonprojectiveCylinder ||
+ segmentation instanceof ProjectiveZPlane )
+ {
+ aida.cloud2D(makePlotName("Phi vs Phi Bin")).fill(
+ decoder.getPhi(),
+ (double)decoder.getValue("phi")
+ );
+
+ if ( segmentation instanceof ProjectiveCylinder ||
+ segmentation instanceof ProjectiveZPlane)
+ {
+ aida.cloud2D(makePlotName("Theta vs Theta Bin")).fill(
+ decoder.getTheta(),
+ (double)decoder.getValue("theta"));
+ }
+ else if ( segmentation instanceof NonprojectiveCylinder )
+ {
+ aida.cloud2D(makePlotName("Z vs Z Bin")).fill(
+ decoder.getZ(),
+ (double)decoder.getValue("z")
+ );
+ }
+ }
+
/* corrected energy */
hitCorrectedEnergy.fill(hit.getCorrectedEnergy());
-
+
/* raw vs corrected */
hitRawVsCorrectedEnergy.fill(hit.getRawEnergy(), hit.getCorrectedEnergy());
SlicDiagnostics/src/org/lcsim/slic/diagnostics
diff -u -r1.3 -r1.4
--- CalorimeterHitPlotsDriver.java 1 Aug 2005 06:34:50 -0000 1.3
+++ CalorimeterHitPlotsDriver.java 18 Aug 2005 00:50:00 -0000 1.4
@@ -14,30 +14,31 @@
* @author jeremym
*/
public class CalorimeterHitPlotsDriver extends Driver
-{
- Map<String, CalorimeterHitPlots> calorimeterHitPlots = new HashMap<String,CalorimeterHitPlots>();
-
+{
+ Map<String, CalorimeterHitPlots> calorimeterHitPlots = new HashMap<String,CalorimeterHitPlots>();
+
protected void process(EventHeader event)
{
- super.process(event);
+ super.process(event);
List<List<SimCalorimeterHit>> simCalorimeterHitCollections = event.get(SimCalorimeterHit.class);
for ( List<SimCalorimeterHit> simCalorimeterHits : simCalorimeterHitCollections)
{
- LCMetaData meta = event.getMetaData(simCalorimeterHits);
- CalorimeterHitPlots calPlots = getCalorimeterHitPlots(meta);
+ LCMetaData meta = event.getMetaData(simCalorimeterHits);
+ CalorimeterHitPlots calPlots = getCalorimeterHitPlots(meta);
+ calPlots.setEventHeader(event);
calPlots.setSimCalorimeterHitList(simCalorimeterHits);
calPlots.fill();
}
- }
-
+ }
+
private CalorimeterHitPlots getCalorimeterHitPlots(LCMetaData meta)
{
String name = meta.getName();
if ( calorimeterHitPlots.get(name) == null )
{
calorimeterHitPlots.put(name, new CalorimeterHitPlots(meta) );
- }
+ }
return calorimeterHitPlots.get(name);
- }
+ }
}
\ No newline at end of file
SlicDiagnostics/src/org/lcsim/slic/diagnostics
diff -u -r1.4 -r1.5
--- EventSummaryPlots.java 17 Aug 2005 03:43:49 -0000 1.4
+++ EventSummaryPlots.java 18 Aug 2005 00:50:00 -0000 1.5
@@ -50,7 +50,7 @@
this.event = event;
}
- public void definePlots()
+ protected void definePlots()
{
super.definePlots();
SlicDiagnostics/src/org/lcsim/slic/diagnostics
diff -u -r1.8 -r1.9
--- GenericHitPlots.java 17 Aug 2005 03:57:56 -0000 1.8
+++ GenericHitPlots.java 18 Aug 2005 00:50:00 -0000 1.9
@@ -8,7 +8,6 @@
import org.lcsim.geometry.subdetector.SubdetectorIDDecoder;
/**
- *
* @author jeremym
*/
class GenericHitPlots extends PlotsBase
@@ -44,13 +43,13 @@
}
/* plots for generic hits */
- public void definePlots()
+ protected void definePlots()
{
super.definePlots();
energy = aida.cloud1D(makePlotName("Hit Energy"));
hitAvgEnergy = aida.cloud1D(makePlotName("Hit Average Energy"));
- time = aida.histogram1D(makePlotName("Hit Time"), 60, 0, 20);
+ time = aida.histogram1D(makePlotName("Hit Time"), 100, 0, 50);
thetaPhi = aida.cloud2D(makePlotName("Hit Theta vs. Phi"));
xy = aida.cloud2D(makePlotName("Hit X vs. Y"));
rz = aida.cloud2D(makePlotName("Hit R vs. Z"));
SlicDiagnostics/src/org/lcsim/slic/diagnostics
diff -u -r1.6 -r1.7
--- MCParticlePlots.java 17 Aug 2005 03:43:49 -0000 1.6
+++ MCParticlePlots.java 18 Aug 2005 00:50:00 -0000 1.7
@@ -7,19 +7,19 @@
package org.lcsim.slic.diagnostics;
import java.util.List;
+import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
+import static java.lang.Math.sqrt;
import hep.aida.ICloud1D;
import hep.aida.IHistogram1D;
-import hep.aida.ITree;
+import hep.aida.IHistogram2D;
import hep.physics.vec.VecOp;
import hep.physics.particle.properties.ParticlePropertyManager;
import hep.physics.particle.properties.ParticlePropertyProvider;
-
-import org.lcsim.util.aida.AIDA;
+import hep.physics.vec.Hep3Vector;
import org.lcsim.event.MCParticle;
-import org.lcsim.util.Driver;
/**
*
@@ -29,14 +29,14 @@
{
ParticlePropertyProvider mcpLkp = ParticlePropertyManager.getParticlePropertyProvider();
- /* bins for sim status plot */
+ /* double values for sim status plot */
public static final double SIMULATION = 1.0;
public static final double BACKSCATTER = 2.0;
public static final double VERTEX_NOT_ENDPOINT = 3.0;
public static final double DECAYED_TRACKER = 4.0;
public static final double DECAYED_CALORIMETER = 5.0;
public static final double LEFT = 6.0;
- public static final double STOPPED = 7.0;
+ public static final double STOPPED = 7.0;
/* plots */
ICloud1D mcpCount;
@@ -44,7 +44,13 @@
ICloud1D mcpCosTheta;
ICloud1D mcpPhi;
IHistogram1D mcpSimStatus;
- IHistogram1D mcpGenStatus;
+ IHistogram1D mcpGenStatus;
+ IHistogram2D mcpSimVsGenStatus;
+ ICloud1D mcpVtxToEPDist;
+ IHistogram1D mcpVtxToEPDistLTMeV;
+ IHistogram1D mcpVtxToEPDistGTMeV;
+ ICloud1D mcpEnergyFinalState;
+ IHistogram1D mcpKE;
Map<String, Integer> particleCounts = new HashMap<String,Integer>();
@@ -64,16 +70,22 @@
this.mcps = mcps;
}
- public void definePlots()
+ protected void definePlots()
{
super.definePlots();
- mcpCount = aida.cloud1D(makePlotName("Particle Count By Event"));
+ mcpCount = aida.cloud1D(makePlotName("Particle Count By Event"));
mcpTotalEnergyFinalState = aida.cloud1D(makePlotName("Final State Energy Total by Event"));
- mcpSimStatus = aida.histogram1D(makePlotName("Simulator Status Code"), 7, 1.0, 8.0);
- mcpGenStatus = aida.histogram1D(makePlotName("Generator Status Code"), 4, 0.0, 4.0);
- mcpCosTheta = aida.cloud1D(makePlotName("Momentum CosTheta"));
- mcpPhi = aida.cloud1D(makePlotName("Momentum Phi"));
+ mcpEnergyFinalState = aida.cloud1D(makePlotName("Energy of Final State Particle"));
+ mcpSimStatus = aida.histogram1D(makePlotName("Simulator Status Code"), 7, 1.0, 8.0);
+ mcpGenStatus = aida.histogram1D(makePlotName("Generator Status Code"), 4, 0.0, 4.0);
+ mcpSimVsGenStatus = aida.histogram2D(makePlotName("Simulator vs Generator Status"), 7, 1.0, 8.0, 4, 0.0, 4.0);
+ mcpCosTheta = aida.cloud1D(makePlotName("Momentum CosTheta"));
+ mcpPhi = aida.cloud1D(makePlotName("Momentum Phi"));
+ mcpVtxToEPDist = aida.cloud1D(makePlotName("Vertex to Endpoint Distance"));
+ mcpVtxToEPDistLTMeV = aida.histogram1D(makePlotName("Vertex to Endpoint Distance for kE < 1 MeV"), 500, 0., 2000.0);
+ mcpVtxToEPDistGTMeV = aida.histogram1D(makePlotName("Vertex to Endpoint Distance for kE > 1 MeV"), 200, 0., 24000.0);
+ mcpKE = aida.histogram1D(makePlotName("Kinetic Energy"), 200, 0.0, 10.0);
}
public void fill()
@@ -85,30 +97,64 @@
}
}
- void fill(List<MCParticle> particles)
- {
+ private void fill(List<MCParticle> particles)
+ {
if ( particles.size() > 0 )
{
particleCounts.clear();
totE = 0;
for ( MCParticle particle : particles)
- {
- /* fill simulator status plot */
- fill(particle.getSimulatorStatus());
-
- /* fill generator status plot */
+ {
+ /* generator status */
mcpGenStatus.fill(particle.getGeneratorStatus());
- /* fill cosTheta of momentum plot */
+ /* make a list of doubles for sim statuses */
+ List<Double> statusList = makeSimulatorStatusList(particle.getSimulatorStatus());
+
+ /* loop over sim statuses */
+ for ( double d : statusList )
+ {
+ /* fill sim status */
+ mcpSimStatus.fill(d);
+
+ /* fill sim vs gen */
+ this.mcpSimVsGenStatus.fill(d, particle.getGeneratorStatus());
+ }
+
+ /* cosTheta of momentum */
mcpCosTheta.fill(VecOp.cosTheta(particle.getMomentum()));
- /* fill phi of momentum plot */
+ /* phi of momentum */
mcpPhi.fill(VecOp.phi(particle.getMomentum()));
+ /* vtx to EP distance */
+ double vtxEPdist = computeVertexToEndpointDistance(particle.getOrigin(), particle.getEndPoint());
+ if ( vtxEPdist != 0 )
+ {
+ mcpVtxToEPDist.fill(vtxEPdist);
+
+ double kE = particle.getEnergy() - particle.getMass();
+
+ mcpKE.fill(kE);
+
+ if ( kE < 0.001 )
+ {
+ /* vtx to EP distance for kE < 1 MeV */
+ mcpVtxToEPDistLTMeV.fill(vtxEPdist);
+ }
+ else
+ {
+ /* vtx to EP distance for kE > 1 MeV */
+ mcpVtxToEPDistGTMeV.fill(vtxEPdist);
+ }
+ }
+
/* fill plots for each final state particle type */
if ( particle.getGeneratorStatus() == MCParticle.FINAL_STATE )
{
totE += particle.getEnergy();
+
+ mcpEnergyFinalState.fill(particle.getEnergy());
String particleName = mcpLkp.get(particle.getPDGID()).getName();
@@ -136,7 +182,7 @@
aida.cloud1D(particleName + ": Momentum CosTheta").fill(
VecOp.cosTheta(particle.getMomentum()));
- /* keep track of particle counts */
+ /* increment particle count */
if ( particleCounts.containsKey(particleName) )
{
int cnt = particleCounts.get(particleName);
@@ -169,42 +215,52 @@
}
}
- /** Fill the simulator status plot. */
- private void fill(MCParticle.SimulatorStatus status)
+ private List<Double> makeSimulatorStatusList(MCParticle.SimulatorStatus status)
{
+ ArrayList statusList = new ArrayList<Double>();
+
if ( status.isCreatedInSimulation() )
{
- mcpSimStatus.fill(SIMULATION);
+ statusList.add(SIMULATION);
}
if ( status.isBackscatter() )
{
- mcpSimStatus.fill(BACKSCATTER);
+ statusList.add(BACKSCATTER);
}
if ( status.vertexIsNotEndpointOfParent() )
{
- mcpSimStatus.fill(VERTEX_NOT_ENDPOINT);
+ statusList.add(VERTEX_NOT_ENDPOINT);
}
if ( status.isDecayedInTracker() )
{
- mcpSimStatus.fill(DECAYED_TRACKER);
+ statusList.add(DECAYED_TRACKER);
}
if ( status.isDecayedInCalorimeter() )
{
- mcpSimStatus.fill(DECAYED_CALORIMETER);
+ statusList.add(DECAYED_CALORIMETER);
}
if ( status.hasLeftDetector() )
{
- mcpSimStatus.fill(LEFT);
+ statusList.add(LEFT);
}
if ( status.isStopped() )
{
- mcpSimStatus.fill(STOPPED);
- }
+ statusList.add(STOPPED);
+ }
+
+ return statusList;
+ }
+
+ private double computeVertexToEndpointDistance(Hep3Vector vtx, Hep3Vector ep)
+ {
+ return sqrt( (vtx.x() - ep.x())*(vtx.x() - ep.x()) +
+ (vtx.y() - ep.y())*(vtx.y() - ep.y()) +
+ (vtx.z() - ep.z())*(vtx.z() - ep.z() ));
}
}
\ No newline at end of file
SlicDiagnostics/src/org/lcsim/slic/diagnostics
diff -u -r1.5 -r1.6
--- Main.java 17 Aug 2005 04:15:34 -0000 1.5
+++ Main.java 18 Aug 2005 00:50:00 -0000 1.6
@@ -30,6 +30,11 @@
public class Main
{
SlicDiagnosticsDriver slicDiag = new SlicDiagnosticsDriver();
+
+ public Main(String[] args)
+ {
+ main(args);
+ }
public static void main(String[] args)
{
SlicDiagnostics/src/org/lcsim/slic/diagnostics
diff -u -r1.3 -r1.4
--- PlotsBase.java 17 Aug 2005 03:43:49 -0000 1.3
+++ PlotsBase.java 18 Aug 2005 00:50:01 -0000 1.4
@@ -8,6 +8,7 @@
import org.lcsim.util.aida.AIDA;
import hep.aida.ITree;
+import org.lcsim.event.EventHeader;
/**
*
@@ -17,6 +18,7 @@
{
protected static AIDA aida = org.lcsim.util.aida.AIDA.defaultInstance();
protected static ITree tree = aida.tree();
+ protected EventHeader eventHeader;
String name;
String dir;
@@ -32,27 +34,32 @@
this.cd();
}
+ public void setEventHeader(EventHeader eventHeader)
+ {
+ this.eventHeader = eventHeader;
+ }
+
public String getName()
{
return name;
}
- public String getDir()
+ protected String getDir()
{
return dir;
}
- public void cd()
+ protected void cd()
{
tree.cd(this.getDir());
}
- public void definePlots()
+ protected void definePlots()
{
cd();
}
- public String makePlotName(String plotName)
+ protected String makePlotName(String plotName)
{
return getName() + ": " + plotName;
}
SlicDiagnostics/src/org/lcsim/slic/diagnostics
diff -u -r1.3 -r1.4
--- Runner.java 17 Aug 2005 03:44:32 -0000 1.3
+++ Runner.java 18 Aug 2005 00:50:01 -0000 1.4
@@ -22,9 +22,9 @@
*
* Helper class to run SlicDiagnosticsDriver on a file or list of files.
*
- * For multiple input files, it will automatically name the output AIDA file
+ * For multiple input files, it will automatically name the output AIDA file
* after the first one in the list.
- *
+ *
*/
public class Runner
{
@@ -32,7 +32,7 @@
List<String> fileNames = new ArrayList<String>();
List<File> fileList = new ArrayList<File>();
- Runner()
+ public Runner()
{}
public void addFile(String filename)
@@ -109,7 +109,7 @@
}
catch (org.freehep.record.loop.NoLoopRecordException nlre)
{
- /* ignore this */
+ /* ignore this exception */
}
catch (Exception e)
{
SlicDiagnostics/src/org/lcsim/slic/diagnostics
diff -u -r1.7 -r1.8
--- SlicDiagnosticsDriver.java 17 Aug 2005 03:44:32 -0000 1.7
+++ SlicDiagnosticsDriver.java 18 Aug 2005 00:50:01 -0000 1.8
@@ -36,7 +36,7 @@
{
super();
addDefaultSubdrivers();
- System.out.println("Loaded SlicDiagnosticsDriver.");
+ message("org.lcsim.slic.diagnostics.SlicDiagnosticsDriver is loaded.");
}
private void addDefaultSubdrivers()
CVSspam 0.2.8