Commit in java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/ecal/plots on MAIN
EcalClusterPlots.java+22-13643 -> 644
EcalDaqPlots.java+18-18643 -> 644
EcalHitPlots.java+15-4643 -> 644
EcalMonitoringPlots.java+2-2643 -> 644
+57-37
4 modified files
Minor changes to Ecal monitoring system drivers

java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/ecal/plots
EcalClusterPlots.java 643 -> 644
--- java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/ecal/plots/EcalClusterPlots.java	2014-05-30 22:17:06 UTC (rev 643)
+++ java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/ecal/plots/EcalClusterPlots.java	2014-06-01 10:32:13 UTC (rev 644)
@@ -12,6 +12,7 @@
 import org.apache.commons.math.stat.StatUtils;
 import org.hps.readout.ecal.TriggerData;
 import org.hps.recon.ecal.ECalUtils;
+import org.hps.recon.ecal.HPSEcalCluster;
 import org.hps.util.Resettable;
 import org.lcsim.event.CalorimeterHit;
 import org.lcsim.event.Cluster;
@@ -108,7 +109,9 @@
         plotter3.style().dataStyle().fillStyle().setParameter("showZeroHeightBins",Boolean.FALSE.toString());
         plotter3.style().dataStyle().errorBarStyle().setVisible(false);
         plotter3.createRegions(1, 2);
-        plotter3.style().yAxisStyle().setParameter("scale", "log");
+        if (logScale){
+            plotter3.style().yAxisStyle().setParameter("scale", "log");
+        }
         plotter3.region(0).plot(clusterTimes);
         plotter3.region(1).plot(clusterTimeSigma);
 
@@ -117,7 +120,9 @@
         plotter4.style().setParameter("hist2DStyle", "colorMap");
         plotter4.style().dataStyle().fillStyle().setParameter("showZeroHeightBins",Boolean.FALSE.toString());
         plotter4.style().dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
-        plotter4.style().zAxisStyle().setParameter("scale", "log");
+        if (logScale) {
+            plotter4.style().zAxisStyle().setParameter("scale", "log");
+        }
         plotter4.createRegion(); 
         plotter4.region(0).plot(edgePlot);
         
@@ -143,11 +148,11 @@
                 botTrig = triggerData.getBotTrig();
             }
         }
-        if (event.hasCollection(Cluster.class, inputCollection)) {
-            List<Cluster> clusters = event.get(Cluster.class, inputCollection);
+        if (event.hasCollection(HPSEcalCluster.class, inputCollection)) {
+            List<HPSEcalCluster> clusters = event.get(HPSEcalCluster.class, inputCollection);
             clusterCountPlot.fill(clusters.size());
             double maxEnergy = 0;
-            for (Cluster cluster : clusters) {
+            for (HPSEcalCluster cluster : clusters) {
 //                if ((botTrig == 0 && cluster.getEnergy() > 130 && cluster.getPosition()[1] < 0) || (topTrig == 0 && cluster.getEnergy() > 130 && cluster.getPosition()[1] > 0)) {
 //                if ((botTrig == 0 && cluster.getPosition()[1] < 0) || (topTrig == 0 && cluster.getPosition()[1] > 0)) {
                     clusterEnergyPlot.fill(cluster.getEnergy());
@@ -155,6 +160,7 @@
                     maxEnergy = cluster.getEnergy();
                 }
                 int size = 0;
+                double eTOT = 0;
                 double[] times = new double[cluster.getCalorimeterHits().size()];
                 double[] energies = new double[cluster.getCalorimeterHits().size()];
                 
@@ -163,22 +169,25 @@
 //                    System.out.format("cluster:\n");
                 for (CalorimeterHit hit : cluster.getCalorimeterHits()) {
                     if (hit.getRawEnergy() != 0) {
-                    energies[size] = hit.getRawEnergy();
+                        energies[size] = hit.getRawEnergy();
                         times[size] = hit.getTime();
                         X += energies[size] * hit.getIdentifierFieldValue("ix");
                         Y += energies[size] * hit.getIdentifierFieldValue("iy");
+                        eTOT+=energies[size];
                         size++;
 //                            System.out.format("x=%d, y=%d, time=%f, energy=%f\n", hit.getIdentifierFieldValue("ix"), hit.getIdentifierFieldValue("iy"), hit.getTime(), hit.getRawEnergy());
                     }
                 }
-                X/=size;
-                Y/=size;
-                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)));
-                edgePlot.fill(X,Y);
+                if (eTOT>0){
+                    X/=eTOT;
+                    Y/=eTOT;
+                    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)));
+                    edgePlot.fill(X,Y);
+                }
             }
-            clusterMaxEnergyPlot.fill(maxEnergy);
+            if (maxEnergy>0) clusterMaxEnergyPlot.fill(maxEnergy);
         } else {
             clusterCountPlot.fill(0);
         }

java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/ecal/plots
EcalDaqPlots.java 643 -> 644
--- java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/ecal/plots/EcalDaqPlots.java	2014-05-30 22:17:06 UTC (rev 643)
+++ java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/ecal/plots/EcalDaqPlots.java	2014-06-01 10:32:13 UTC (rev 644)
@@ -92,10 +92,11 @@
 
         List<EcalCrystal> crystals = detector.getDetectorElement().findDescendants(EcalCrystal.class);
         /*I do not want the ECAL Crates and Slots to be hard-coded. 
-         * It is fine to assume that the channels are from 0 to 15:
+         * It is fine to assume that the FADC channels are from 0 to 15:
          * This is determined by JLAB FADC architecture
-         * It is also fine to say that there are 14 slots occupied by FADCs in each crate: 14*16=224, number of channel in each ecal sector (a part from the hole)
-         *          * 
+         * It is also fine to say that there are 14 slots occupied by FADCs in each crate: 
+         * 14*16=224, number of channel in each Ecal sector (a part from the hole)
+         *          
          */
         
         slotsT=new ArrayList<Integer>();
@@ -113,27 +114,26 @@
             if (y>0){
             	if (!slotsT.contains(slot)) slotsT.add(slot);
             }
-            else {
+            else if (y<0){
             	if (!slotsB.contains(slot)) slotsB.add(slot);
             }
             if (!crates.contains(crate)) crates.add(crate);
         }
-        
-        System.out.println("These DAQ slots found:");
-        /*Order the slots in increasing order*/
-     
+        /*Order the slots in increasing order*/       
         Collections.sort(slotsB);
         Collections.sort(slotsT);
         
+        System.out.println("These DAQ slots found:");     
         System.out.println("TOP: ");
        	for (int slot : slotsT){
-            System.out.println(slot);
+            System.out.print(slot+" ");
         }
+       	System.out.println("");
         System.out.println("BOTTOM: ");
-       	for (int slot : slotsT){
-            System.out.println(slot);
+       	for (int slot : slotsB){
+            System.out.print(slot+" ");
         }
-           
+       	System.out.println("");   
         
         aida = AIDA.defaultInstance();
         aida.tree().cd("/");
@@ -142,7 +142,7 @@
         
     
         for (int j = 0; j < 14; j++) { // TOP slot           
-                plots.add(aida.histogram1D("ECAL: Top Crate Slot " + slotsT.get(j), 16, 0, 16));   
+            plots.add(aida.histogram1D("ECAL: Top Crate Slot " + slotsT.get(j), 16, 0, 16));   
         }
         
         for (int j = 0; j < 14; j++) { // BOTTOM slot           
@@ -162,15 +162,15 @@
             for (int j = 0; j < 14; j++) { // slot               
                 id=i*14+j;
             	plot_id = 0;
-                if (i==0){
+                if (i==0){ //first-crate
                     if (j%2==0) plot_id=j*2;
                     else plot_id=(j-1)*2+1;
                 }
-                else if (i==1){
+                else if (i==1){ //second-crate
                     if (j%2==0) plot_id=j*2+2;
                     else plot_id=(j-1)*2+3;
-                }
-                        
+                } 
+                System.out.println("Plot in region " + plot_id + " the plot "+plots.get(id).title() + "(index: "+id+")");
                 plotter.region(plot_id).plot(plots.get(id));
             }
         }
@@ -211,7 +211,7 @@
             	//Top CRATE
             	if (row>0){
             		 int index = slotsT.indexOf(slotN);
-            		    plots.get(index).fill(channelN);
+            		 plots.get(index).fill(channelN);
             	}
             	else if (row<0){
             		 int index = slotsB.indexOf(slotN);

java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/ecal/plots
EcalHitPlots.java 643 -> 644
--- java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/ecal/plots/EcalHitPlots.java	2014-05-30 22:17:06 UTC (rev 643)
+++ java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/ecal/plots/EcalHitPlots.java	2014-06-01 10:32:13 UTC (rev 644)
@@ -123,8 +123,13 @@
         style.setParameter("hist2DStyle", "colorMap");
         style.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
         style.dataStyle().fillStyle().setParameter("showZeroHeightBins",Boolean.FALSE.toString());
-        style.zAxisStyle().setParameter("scale", "log");
+        if (logScale){
+        	plotter.region(0).style().zAxisStyle().setParameter("scale", "log");
+        }
+        else plotter.region(0).style().zAxisStyle().setParameter("scale", "lin");
+        
         plotter.region(2).plot(occupancyPlot);
+        plotter.region(2).style.zAxisStyle().SetParameter("scale","lin");
         
         // Setup the plotter.
         plotter2 = plotterFactory.create("Hit Energies");
@@ -154,8 +159,11 @@
         plotter3.region(5).plot(orTrigTimePlot);
         for (int i = 0; i < 6; i++) {
             if (plotter3.region(i).style() != null) {
-               // plotter3.region(i).style().yAxisStyle().setParameter("scale", "log");
-            }
+            	if (logScale){
+                  plotter3.region(i).style().yAxisStyle().setParameter("scale", "log");
+                }
+            	else plotter3.region(i).style().yAxisStyle().setParameter("scale", "lin");
+            } 	
         }
         plotter3.region(6).plot(topTimePlot2D);
         plotter3.region(7).plot(botTimePlot2D);
@@ -164,7 +172,10 @@
             if (plotter3.region(i).style() != null) {
                 plotter3.region(i).style().setParameter("hist2DStyle", "colorMap");
                 plotter3.region(i).style().dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
-             //   plotter3.region(i).style().zAxisStyle().setParameter("scale", "log");
+                if (logScale){
+                    plotter3.region(i).style().zAxisStyle().setParameter("scale","log");
+                }
+                else plotter3.region(i).style().zAxisStyle().setParameter("scale","lin");
             }
         }
         

java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/ecal/plots
EcalMonitoringPlots.java 643 -> 644
--- java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/ecal/plots/EcalMonitoringPlots.java	2014-05-30 22:17:06 UTC (rev 643)
+++ java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/ecal/plots/EcalMonitoringPlots.java	2014-06-01 10:32:13 UTC (rev 644)
@@ -123,7 +123,7 @@
     public void process(EventHeader event) {
         int nhits=0;
         int chits[]=new int[11*47];
-        if (event.hasCollection(BaseRawCalorimeterHit.class, inputCollection)) {
+        /*if (event.hasCollection(BaseRawCalorimeterHit.class, inputCollection)) {
             List<BaseRawCalorimeterHit> hits = event.get(BaseRawCalorimeterHit.class, inputCollection);
             for (BaseRawCalorimeterHit hit : hits) {
                 int column=hit.getIdentifierFieldValue("ix");
@@ -144,7 +144,7 @@
                 chits[id]++;
                 nhits++;
             }
-        }
+        }*/
         if (event.hasCollection(CalorimeterHit.class, inputCollection)) {
             List<CalorimeterHit> hits = event.get(CalorimeterHit.class, inputCollection);
             for (CalorimeterHit hit : hits) {
SVNspam 0.1