Author: [log in to unmask]
Date: Fri Jan 2 11:35:00 2015
New Revision: 1836
Log:
Modify DQM ECAL monitioring/steering to accomodate multiple clustering algorithms in same recon file.
Modified:
java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/EcalMonitoring.java
java/trunk/steering-files/src/main/resources/org/hps/steering/production/DataQualityEcalOnlyEngineeringRun.lcsim
Modified: java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/EcalMonitoring.java
=============================================================================
--- java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/EcalMonitoring.java (original)
+++ java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/EcalMonitoring.java Fri Jan 2 11:35:00 2015
@@ -54,51 +54,64 @@
IHistogram2D energyVsY;
IHistogram2D energyVsX;
+ int nEvents = 0;
+ int nTotHits = 0;
+ int nTotClusters = 0;
+ double sumHitE = 0;
+ double sumHitPerCluster = 0;
+ double sumClusterEnergy = 0;
+ double sumClusterTime=0;
+ boolean fillHitPlots = true;
private Map<String, Double> monitoredQuantityMap = new HashMap<>();
- String[] ecalQuantNames = {"Good", "Stuff", "For", "ECAL"};
+ String[] ecalQuantNames = {"avg_N_hits","avg_Hit_Energy",
+ "avg_N_clusters", "avg_N_hitsPerCluster","avg_Cluster_Energy","avg_ClusterTime"};
double maxE = 2.5;
private final String plotHitsDir = "EcalHits/";
private final String plotClustersDir = "EcalClusters/";
-
+
public void setReadoutHitCollectionName(String readoutHitCollectionName) {
this.readoutHitCollectionName = readoutHitCollectionName;
}
-
+
public void setCalibratedHitCollectionName(String calibratedHitCollectionName) {
this.calibratedHitCollectionName = calibratedHitCollectionName;
}
-
+
public void setClusterCollectionName(String clusterCollectionName) {
this.clusterCollectionName = clusterCollectionName;
+ }
+
+ public void setFillHitPlots(boolean fill) {
+ this.fillHitPlots = fill;
}
protected void detectorChanged(Detector detector) {
System.out.println("EcalMonitoring::detectorChanged Setting up the plotter");
aida.tree().cd("/");
-
- // Setup hit plots.
- hitCountPlot = aida.histogram1D(plotHitsDir + "Hit Count In Event", 40, -0.5, 39.5);
- hitTimePlot = aida.histogram1D(plotHitsDir + "Hit Time", 50, 0 * 4.0, 50 * 4.0);
- hitEnergyPlot = aida.histogram1D(plotHitsDir + "Hit Energy", 100, -0.1, maxE);
- fiducialHitCountPlot = aida.histogram1D(plotHitsDir + "Hit Count with Fiducial Cut", 10, -0.5, 9.5);
- fiducialEnergyPlot = aida.histogram1D(plotHitsDir + "Hit Energy with Fiducial Cut", 100, -0.1, maxE);
-
+ if (fillHitPlots) {
+ // Setup hit plots.
+ hitCountPlot = aida.histogram1D(plotHitsDir + calibratedHitCollectionName + " Hit Count In Event", 40, -0.5, 39.5);
+ hitTimePlot = aida.histogram1D(plotHitsDir + calibratedHitCollectionName + " Hit Time", 50, 0 * 4.0, 50 * 4.0);
+ hitEnergyPlot = aida.histogram1D(plotHitsDir + calibratedHitCollectionName + " Hit Energy", 100, -0.1, maxE);
+ fiducialHitCountPlot = aida.histogram1D(plotHitsDir + calibratedHitCollectionName + " Hit Count with Fiducial Cut", 10, -0.5, 9.5);
+ fiducialEnergyPlot = aida.histogram1D(plotHitsDir + calibratedHitCollectionName + " Hit Energy with Fiducial Cut", 100, -0.1, maxE);
+ }
// Setup cluster plots
- clusterCountPlot = aida.histogram1D(plotClustersDir + "Cluster Count per Event", 10, -0.5, 9.5);
- clusterSizePlot = aida.histogram1D(plotClustersDir + "Cluster Size", 10, -0.5, 9.5);
- clusterEnergyPlot = aida.histogram1D(plotClustersDir + "Cluster Energy", 100, -0.1, maxE);
- clusterTimes = aida.histogram1D(plotClustersDir + "Cluster Time Mean", 200, 0, 4.0 * 50);
- clusterTimeSigma = aida.histogram1D(plotClustersDir + "Cluster Time Sigma", 100, 0, 10);
- twoclusterTotEnergy = aida.histogram1D(plotClustersDir + "Two Cluster Energy Sum", 100, 0, maxE);
- twoclusterEnergyAsymmetry = aida.histogram1D(plotClustersDir + "Two Cluster Energy Asymmetry", 100, 0, 1.0);
- energyVsX = aida.histogram2D(plotClustersDir + "Energy vs X", 50, 0, 1.6, 50, .0, 200.0);
- energyVsY = aida.histogram2D(plotClustersDir + "Energy vs Y", 50, 0, 1.6, 50, 20.0, 85.0);
-
- fiducialClusterCountPlot = aida.histogram1D(plotClustersDir + "Cluster Count with Fiducal Cut", 10, -0.5, 9.5);
- fiducialClusterSizePlot = aida.histogram1D(plotClustersDir + "Cluster Size with Fiducal Cut", 10, -0.5, 9.5);
- fiducialClusterEnergyPlot = aida.histogram1D(plotClustersDir + "Cluster Energy with Fiducal Cut", 100, -0.1, maxE);
- fiducialenergyVsY = aida.histogram2D(plotClustersDir + "Energy vs Y with Fiducial Cuts", 50, 0, 1.6, 50, 45.0, 85.0);
- fiducialenergyVsX = aida.histogram2D(plotClustersDir + "Energy vs X with Fiducial Cuts", 50, 0, 1.6, 50, 0.0, 200.0);
+ clusterCountPlot = aida.histogram1D(plotClustersDir + clusterCollectionName + " Cluster Count per Event", 10, -0.5, 9.5);
+ clusterSizePlot = aida.histogram1D(plotClustersDir + clusterCollectionName + " Cluster Size", 10, -0.5, 9.5);
+ clusterEnergyPlot = aida.histogram1D(plotClustersDir + clusterCollectionName + " Cluster Energy", 100, -0.1, maxE);
+ clusterTimes = aida.histogram1D(plotClustersDir + clusterCollectionName + " Cluster Time Mean", 200, 0, 4.0 * 50);
+ clusterTimeSigma = aida.histogram1D(plotClustersDir + clusterCollectionName + " Cluster Time Sigma", 100, 0, 10);
+ twoclusterTotEnergy = aida.histogram1D(plotClustersDir + clusterCollectionName + " Two Cluster Energy Sum", 100, 0, maxE);
+ twoclusterEnergyAsymmetry = aida.histogram1D(plotClustersDir + clusterCollectionName + " Two Cluster Energy Asymmetry", 100, 0, 1.0);
+ energyVsX = aida.histogram2D(plotClustersDir + clusterCollectionName + " Energy vs X", 50, 0, 1.6, 50, .0, 200.0);
+ energyVsY = aida.histogram2D(plotClustersDir + clusterCollectionName + " Energy vs Y", 50, 0, 1.6, 50, 20.0, 85.0);
+
+ fiducialClusterCountPlot = aida.histogram1D(plotClustersDir + clusterCollectionName + " Cluster Count with Fiducal Cut", 10, -0.5, 9.5);
+ fiducialClusterSizePlot = aida.histogram1D(plotClustersDir + clusterCollectionName + " Cluster Size with Fiducal Cut", 10, -0.5, 9.5);
+ fiducialClusterEnergyPlot = aida.histogram1D(plotClustersDir + clusterCollectionName + " Cluster Energy with Fiducal Cut", 100, -0.1, maxE);
+ fiducialenergyVsY = aida.histogram2D(plotClustersDir + clusterCollectionName + " Energy vs Y with Fiducial Cuts", 50, 0, 1.6, 50, 45.0, 85.0);
+ fiducialenergyVsX = aida.histogram2D(plotClustersDir + clusterCollectionName + " Energy vs X with Fiducial Cuts", 50, 0, 1.6, 50, 0.0, 200.0);
}
@@ -111,19 +124,24 @@
else
return; //this might be a non-data event
- hitCountPlot.fill(hits.size());
- int fidHitCount = 0;
- for (CalorimeterHit hit : hits) {
-
- hitEnergyPlot.fill(hit.getCorrectedEnergy());
- hitTimePlot.fill(hit.getTime());
- int ix = hit.getIdentifierFieldValue("ix");
- int iy = hit.getIdentifierFieldValue("iy");
- if (Math.abs(iy) > 2) {
- fidHitCount++;
- fiducialEnergyPlot.fill(hit.getCorrectedEnergy());
- }
- fiducialHitCountPlot.fill(fidHitCount);
+ if (fillHitPlots) {
+ hitCountPlot.fill(hits.size());
+ int fidHitCount = 0;
+ for (CalorimeterHit hit : hits) {
+
+ hitEnergyPlot.fill(hit.getCorrectedEnergy());
+ hitTimePlot.fill(hit.getTime());
+ int ix = hit.getIdentifierFieldValue("ix");
+ int iy = hit.getIdentifierFieldValue("iy");
+ if (Math.abs(iy) > 2) {
+ fidHitCount++;
+ fiducialEnergyPlot.fill(hit.getCorrectedEnergy());
+ }
+ fiducialHitCountPlot.fill(fidHitCount);
+ sumHitE+=hit.getCorrectedEnergy();
+ }
+ nTotHits+=hits.size();
+
}
List<Cluster> clusters;
@@ -131,18 +149,19 @@
clusters = event.get(Cluster.class, clusterCollectionName);
else if (event.hasCollection(HPSEcalClusterIC.class, clusterCollectionName))
clusters = event.get(Cluster.class, clusterCollectionName);
- else if(event.hasCollection(Cluster.class, clusterCollectionName))
+ else if (event.hasCollection(Cluster.class, clusterCollectionName))
clusters = event.get(Cluster.class, clusterCollectionName);
else {
clusterCountPlot.fill(0);
return;
}
-
+ nEvents++;
clusterCountPlot.fill(clusters.size());
-
+ nTotClusters+=clusters.size();
int fidcnt = 0;
for (Cluster cluster : clusters) {
clusterEnergyPlot.fill(cluster.getEnergy());
+ sumClusterEnergy+=cluster.getEnergy();
double[] times = new double[cluster.getCalorimeterHits().size()];
double[] energies = new double[cluster.getCalorimeterHits().size()];
CalorimeterHit seed = cluster.getCalorimeterHits().get(0);
@@ -152,7 +171,7 @@
energyVsX.fill(cluster.getEnergy(), Math.abs(cluster.getPosition()[0]));
energyVsY.fill(cluster.getEnergy(), Math.abs(cluster.getPosition()[1]));
}
- if (Math.abs(iy) > 2&&cluster.getCalorimeterHits().size()>1) {
+ if (Math.abs(iy) > 2 && cluster.getCalorimeterHits().size() > 1) {
fidcnt++;
fiducialClusterSizePlot.fill(cluster.getCalorimeterHits().size());
fiducialClusterEnergyPlot.fill(cluster.getEnergy());
@@ -169,7 +188,9 @@
clusterTimes.fill(StatUtils.mean(times, 0, size));
clusterSizePlot.fill(size); //The number of "hits" in a "cluster"
clusterTimeSigma.fill(Math.sqrt(StatUtils.variance(times, 0, size)));
-
+ sumHitPerCluster+=size;
+ sumClusterTime+=StatUtils.mean(times, 0, size);
+
}
fiducialClusterCountPlot.fill(fidcnt);
//make some interesting 2-cluster plots
@@ -181,9 +202,8 @@
double e1 = cl1.getEnergy();
double e2 = cl2.getEnergy();
twoclusterTotEnergy.fill(e1 + e2);
- twoclusterEnergyAsymmetry.fill(Math.abs(e1 - e2)/(e1+e2));
- }
-
+ twoclusterEnergyAsymmetry.fill(Math.abs(e1 - e2) / (e1 + e2));
+ }
}
@@ -195,7 +215,9 @@
@Override
public void printDQMData() {
System.out.println("EcalMonitoring::printDQMData");
-
+ for (Map.Entry<String, Double> entry : monitoredQuantityMap.entrySet()) {
+ System.out.println(entry.getKey() + " = " + entry.getValue());
+ }
System.out.println("*******************************");
}
@@ -204,6 +226,14 @@
*/
@Override
public void calculateEndOfRunQuantities() {
+ if(fillHitPlots){
+ monitoredQuantityMap.put(calibratedHitCollectionName+" " +ecalQuantNames[0], (double) nTotHits / nEvents);
+ monitoredQuantityMap.put(calibratedHitCollectionName+" " +ecalQuantNames[1], (double) sumHitE / nTotHits);
+ }
+ monitoredQuantityMap.put(clusterCollectionName+" " +ecalQuantNames[2], (double) nTotClusters / nEvents);
+ monitoredQuantityMap.put(clusterCollectionName+" " +ecalQuantNames[3], (double) sumHitPerCluster / nTotClusters);
+ monitoredQuantityMap.put(clusterCollectionName+" " +ecalQuantNames[4], (double) sumClusterEnergy / nTotClusters);
+ monitoredQuantityMap.put(clusterCollectionName+" " +ecalQuantNames[5], (double) sumClusterTime / nTotClusters);
}
@Override
Modified: java/trunk/steering-files/src/main/resources/org/hps/steering/production/DataQualityEcalOnlyEngineeringRun.lcsim
=============================================================================
--- java/trunk/steering-files/src/main/resources/org/hps/steering/production/DataQualityEcalOnlyEngineeringRun.lcsim (original)
+++ java/trunk/steering-files/src/main/resources/org/hps/steering/production/DataQualityEcalOnlyEngineeringRun.lcsim Fri Jan 2 11:35:00 2015
@@ -7,6 +7,8 @@
<execute>
<driver name="EventMarkerDriver"/>
<driver name="EcalMonitoring"/>
+ <driver name="EcalMonitoringIC"/>
+ <driver name="EcalMonitoringGTP"/>
<driver name="AidaSaveDriver"/>
<driver name="CleanupDriver"/>
</execute>
@@ -18,6 +20,17 @@
<outputFileName>${outputFile}.root</outputFileName>
</driver>
<driver name="EcalMonitoring" type="org.hps.analysis.dataquality.EcalMonitoring">
+ <clusterCollectionName>EcalClusters</clusterCollectionName>
+ <overwriteDB>false</overwriteDB>
+ </driver>
+ <driver name="EcalMonitoringIC" type="org.hps.analysis.dataquality.EcalMonitoring">
+ <clusterCollectionName>EcalClustersIC</clusterCollectionName>
+ <fillHitPlots>false</fillHitPlots>
+ <overwriteDB>false</overwriteDB>
+ </driver>
+ <driver name="EcalMonitoringGTP" type="org.hps.analysis.dataquality.EcalMonitoring">
+ <clusterCollectionName>EcalClustersGTP</clusterCollectionName>
+ <fillHitPlots>false</fillHitPlots>
<overwriteDB>false</overwriteDB>
</driver>
<driver name="CleanupDriver" type="org.lcsim.recon.tracking.digitization.sisim.config.ReadoutCleanupDriver"/>
|