Print

Print


Commit in java/branches/hps-java_ecal-commissioning on MAIN
conditions/src/main/java/org/hps/conditions/deprecated/EcalConditions.java+2-21180 -> 1181
conditions/src/main/resources/HPS-ECalCommissioning/calibECal/default01.ped-2221180 removed
                                                             /default02.ped-2221180 removed
evio/pom.xml+1-11180 -> 1181
monitoring-drivers/src/main/java/org/hps/monitoring/ecal/plots/EcalEventDisplay.java+3-31180 -> 1181
steering-files/src/main/resources/org/hps/steering/monitoring/EcalMonitoringFinal.lcsim+4-41180 -> 1181
steering-files/src/main/resources/org/hps/steering/users/celentan/PedestalComputionRaw.lcsim+36added 1181
users/src/main/java/org/hps/users/celentan/RawPedestalComputator.java+131added 1181
+177-454
2 added + 2 removed + 4 modified, total 8 files
Commit work on monitoring to the branch. Also, new pedestals

java/branches/hps-java_ecal-commissioning/conditions/src/main/java/org/hps/conditions/deprecated
EcalConditions.java 1180 -> 1181
--- java/branches/hps-java_ecal-commissioning/conditions/src/main/java/org/hps/conditions/deprecated/EcalConditions.java	2014-10-14 22:33:12 UTC (rev 1180)
+++ java/branches/hps-java_ecal-commissioning/conditions/src/main/java/org/hps/conditions/deprecated/EcalConditions.java	2014-10-14 22:44:30 UTC (rev 1181)
@@ -97,9 +97,9 @@
         ConditionsManager conditions = ConditionsManager.defaultInstance();
         try {
             Reader pedestalsReader = conditions.getRawConditions("calibECal/default01.ped").getReader();
-            loadPedestals(pedestalsReader, 1);
+            loadPedestals(pedestalsReader, 37); //TOP CRATE
             pedestalsReader = conditions.getRawConditions("calibECal/default02.ped").getReader();
-            loadPedestals(pedestalsReader, 2);
+            loadPedestals(pedestalsReader, 39); //BOTTOM CRATE
         } catch (IOException e) {
             throw new RuntimeException("couldn't get pedestals file", e);
         }

java/branches/hps-java_ecal-commissioning/conditions/src/main/resources/HPS-ECalCommissioning/calibECal
default01.ped removed after 1180
--- java/branches/hps-java_ecal-commissioning/conditions/src/main/resources/HPS-ECalCommissioning/calibECal/default01.ped	2014-10-14 22:33:12 UTC (rev 1180)
+++ java/branches/hps-java_ecal-commissioning/conditions/src/main/resources/HPS-ECalCommissioning/calibECal/default01.ped	2014-10-14 22:44:30 UTC (rev 1181)
@@ -1,222 +0,0 @@
-#slot	ch	ped	noise
-3	0	120.0	10.0
-3	1	120.0	10.0
-3	2	120.0	10.0
-3	3	120.0	10.0
-3	4	120.0	10.0
-3	5	120.0	10.0
-3	6	120.0	10.0
-3	7	120.0	10.0
-3	8	120.0	10.0
-3	9	120.0	10.0
-3	10	120.0	10.0
-3	11	120.0	10.0
-3	12	120.0	10.0
-4	0	120.0	10.0
-4	1	120.0	10.0
-4	2	120.0	10.0
-4	3	120.0	10.0
-4	4	120.0	10.0
-4	5	120.0	10.0
-4	6	120.0	10.0
-4	7	120.0	10.0
-4	8	120.0	10.0
-4	9	120.0	10.0
-4	10	120.0	10.0
-4	11	120.0	10.0
-4	12	120.0	10.0
-4	13	120.0	10.0
-4	14	120.0	10.0
-4	15	120.0	10.0
-5	0	120.0	10.0
-5	1	120.0	10.0
-5	2	120.0	10.0
-5	3	120.0	10.0
-5	4	120.0	10.0
-5	5	120.0	10.0
-5	6	120.0	10.0
-5	7	120.0	10.0
-5	8	120.0	10.0
-5	9	120.0	10.0
-5	10	120.0	10.0
-5	11	120.0	10.0
-5	12	120.0	10.0
-5	13	120.0	10.0
-5	14	120.0	10.0
-5	15	120.0	10.0
-6	0	120.0	10.0
-6	1	120.0	10.0
-6	2	120.0	10.0
-6	3	120.0	10.0
-6	4	120.0	10.0
-6	5	120.0	10.0
-6	6	120.0	10.0
-6	7	120.0	10.0
-6	8	120.0	10.0
-6	9	120.0	10.0
-6	10	120.0	10.0
-6	11	120.0	10.0
-6	12	120.0	10.0
-6	13	120.0	10.0
-6	14	120.0	10.0
-6	15	120.0	10.0
-7	0	120.0	10.0
-7	1	120.0	10.0
-7	2	120.0	10.0
-7	3	120.0	10.0
-7	4	120.0	10.0
-7	5	120.0	10.0
-7	6	120.0	10.0
-7	7	120.0	10.0
-7	8	120.0	10.0
-7	9	120.0	10.0
-7	10	120.0	10.0
-7	11	120.0	10.0
-7	12	120.0	10.0
-7	13	120.0	10.0
-7	14	120.0	10.0
-7	15	120.0	10.0
-8	0	120.0	10.0
-8	1	120.0	10.0
-8	2	120.0	10.0
-8	3	120.0	10.0
-8	4	120.0	10.0
-8	5	120.0	10.0
-8	6	120.0	10.0
-8	7	120.0	10.0
-8	8	120.0	10.0
-8	9	120.0	10.0
-8	10	120.0	10.0
-8	11	120.0	10.0
-8	12	120.0	10.0
-8	13	120.0	10.0
-8	14	120.0	10.0
-8	15	120.0	10.0
-9	0	120.0	10.0
-9	1	120.0	10.0
-9	2	120.0	10.0
-9	3	120.0	10.0
-9	4	120.0	10.0
-9	5	120.0	10.0
-9	6	120.0	10.0
-9	7	120.0	10.0
-9	8	120.0	10.0
-9	9	120.0	10.0
-9	10	120.0	10.0
-9	11	120.0	10.0
-9	12	120.0	10.0
-9	13	120.0	10.0
-9	14	120.0	10.0
-9	15	120.0	10.0
-10	0	120.0	10.0
-10	1	120.0	10.0
-10	2	120.0	10.0
-10	3	120.0	10.0
-10	4	120.0	10.0
-10	5	120.0	10.0
-10	6	120.0	10.0
-10	7	120.0	10.0
-10	8	120.0	10.0
-10	9	120.0	10.0
-10	10	120.0	10.0
-10	11	120.0	10.0
-10	12	120.0	10.0
-10	13	120.0	10.0
-10	14	120.0	10.0
-10	15	120.0	10.0
-13	0	120.0	10.0
-13	1	120.0	10.0
-13	2	120.0	10.0
-13	3	120.0	10.0
-13	4	120.0	10.0
-13	5	120.0	10.0
-13	6	120.0	10.0
-13	7	120.0	10.0
-13	8	120.0	10.0
-13	9	120.0	10.0
-13	10	120.0	10.0
-13	11	120.0	10.0
-13	12	120.0	10.0
-13	13	120.0	10.0
-13	14	120.0	10.0
-13	15	120.0	10.0
-14	0	120.0	10.0
-14	1	120.0	10.0
-14	2	120.0	10.0
-14	3	120.0	10.0
-14	4	120.0	10.0
-14	5	120.0	10.0
-14	6	120.0	10.0
-14	7	120.0	10.0
-14	8	120.0	10.0
-14	9	120.0	10.0
-14	10	120.0	10.0
-14	11	120.0	10.0
-14	12	120.0	10.0
-14	13	120.0	10.0
-14	14	120.0	10.0
-14	15	120.0	10.0
-15	0	120.0	10.0
-15	1	120.0	10.0
-15	2	120.0	10.0
-15	3	120.0	10.0
-15	4	120.0	10.0
-15	5	120.0	10.0
-15	6	120.0	10.0
-15	7	120.0	10.0
-15	8	120.0	10.0
-15	9	120.0	10.0
-15	10	120.0	10.0
-15	11	120.0	10.0
-15	12	120.0	10.0
-15	13	120.0	10.0
-15	14	120.0	10.0
-15	15	120.0	10.0
-16	0	120.0	10.0
-16	1	120.0	10.0
-16	2	120.0	10.0
-16	3	120.0	10.0
-16	4	120.0	10.0
-16	5	120.0	10.0
-16	6	120.0	10.0
-16	7	120.0	10.0
-16	8	120.0	10.0
-16	9	120.0	10.0
-16	10	120.0	10.0
-16	11	120.0	10.0
-16	12	120.0	10.0
-16	13	120.0	10.0
-16	14	120.0	10.0
-16	15	120.0	10.0
-17	0	120.0	10.0
-17	1	120.0	10.0
-17	2	120.0	10.0
-17	3	120.0	10.0
-17	4	120.0	10.0
-17	5	120.0	10.0
-17	6	120.0	10.0
-17	7	120.0	10.0
-17	8	120.0	10.0
-17	9	120.0	10.0
-17	10	120.0	10.0
-17	11	120.0	10.0
-17	12	120.0	10.0
-17	13	120.0	10.0
-17	14	120.0	10.0
-17	15	120.0	10.0
-18	0	120.0	10.0
-18	1	120.0	10.0
-18	2	120.0	10.0
-18	3	120.0	10.0
-18	4	120.0	10.0
-18	5	120.0	10.0
-18	6	120.0	10.0
-18	7	120.0	10.0
-18	8	120.0	10.0
-18	9	120.0	10.0
-18	10	120.0	10.0
-18	11	120.0	10.0
-18	12	120.0	10.0
-18	13	120.0	10.0
-18	14	120.0	10.0
-18	15	120.0	10.0

java/branches/hps-java_ecal-commissioning/conditions/src/main/resources/HPS-ECalCommissioning/calibECal
default02.ped removed after 1180
--- java/branches/hps-java_ecal-commissioning/conditions/src/main/resources/HPS-ECalCommissioning/calibECal/default02.ped	2014-10-14 22:33:12 UTC (rev 1180)
+++ java/branches/hps-java_ecal-commissioning/conditions/src/main/resources/HPS-ECalCommissioning/calibECal/default02.ped	2014-10-14 22:44:30 UTC (rev 1181)
@@ -1,222 +0,0 @@
-#slot	ch	ped	noise
-4	0	120.0	10.0
-4	1	120.0	10.0
-4	2	120.0	10.0
-4	3	120.0	10.0
-4	4	120.0	10.0
-4	5	120.0	10.0
-4	6	120.0	10.0
-4	7	120.0	10.0
-4	8	120.0	10.0
-4	9	120.0	10.0
-4	10	120.0	10.0
-4	11	120.0	10.0
-4	12	120.0	10.0
-4	13	120.0	10.0
-4	14	120.0	10.0
-4	15	120.0	10.0
-5	0	120.0	10.0
-5	1	120.0	10.0
-5	2	120.0	10.0
-5	3	120.0	10.0
-5	4	120.0	10.0
-5	5	120.0	10.0
-5	6	120.0	10.0
-5	7	120.0	10.0
-5	8	120.0	10.0
-5	9	120.0	10.0
-5	10	120.0	10.0
-5	11	120.0	10.0
-5	12	120.0	10.0
-5	13	120.0	10.0
-5	14	120.0	10.0
-5	15	120.0	10.0
-6	0	120.0	10.0
-6	1	120.0	10.0
-6	2	120.0	10.0
-6	3	120.0	10.0
-6	4	120.0	10.0
-6	5	120.0	10.0
-6	6	120.0	10.0
-6	7	120.0	10.0
-6	8	120.0	10.0
-6	9	120.0	10.0
-6	10	120.0	10.0
-6	11	120.0	10.0
-6	12	120.0	10.0
-6	13	120.0	10.0
-6	14	120.0	10.0
-6	15	120.0	10.0
-7	0	120.0	10.0
-7	1	120.0	10.0
-7	2	120.0	10.0
-7	3	120.0	10.0
-7	4	120.0	10.0
-7	5	120.0	10.0
-7	6	120.0	10.0
-7	7	120.0	10.0
-7	8	120.0	10.0
-7	9	120.0	10.0
-7	10	120.0	10.0
-7	11	120.0	10.0
-7	12	120.0	10.0
-7	13	120.0	10.0
-7	14	120.0	10.0
-7	15	120.0	10.0
-8	0	120.0	10.0
-8	1	120.0	10.0
-8	2	120.0	10.0
-8	3	120.0	10.0
-8	4	120.0	10.0
-8	5	120.0	10.0
-8	6	120.0	10.0
-8	7	120.0	10.0
-8	8	120.0	10.0
-8	9	120.0	10.0
-8	10	120.0	10.0
-8	11	120.0	10.0
-8	12	120.0	10.0
-8	13	120.0	10.0
-8	14	120.0	10.0
-8	15	120.0	10.0
-9	0	120.0	10.0
-9	1	120.0	10.0
-9	2	120.0	10.0
-9	3	120.0	10.0
-9	4	120.0	10.0
-9	5	120.0	10.0
-9	6	120.0	10.0
-9	7	120.0	10.0
-9	8	120.0	10.0
-9	9	120.0	10.0
-9	10	120.0	10.0
-9	11	120.0	10.0
-9	12	120.0	10.0
-9	13	120.0	10.0
-9	14	120.0	10.0
-9	15	120.0	10.0
-10	0	120.0	10.0
-10	1	120.0	10.0
-10	2	120.0	10.0
-10	3	120.0	10.0
-10	4	120.0	10.0
-10	5	120.0	10.0
-10	6	120.0	10.0
-10	7	120.0	10.0
-10	8	120.0	10.0
-10	9	120.0	10.0
-10	10	120.0	10.0
-10	11	120.0	10.0
-10	12	120.0	10.0
-10	13	120.0	10.0
-10	14	120.0	10.0
-10	15	120.0	10.0
-13	0	120.0	10.0
-13	1	120.0	10.0
-13	2	120.0	10.0
-13	3	120.0	10.0
-13	4	120.0	10.0
-13	5	120.0	10.0
-13	6	120.0	10.0
-13	7	120.0	10.0
-13	8	120.0	10.0
-13	9	120.0	10.0
-13	10	120.0	10.0
-13	11	120.0	10.0
-13	12	120.0	10.0
-13	13	120.0	10.0
-13	14	120.0	10.0
-13	15	120.0	10.0
-14	0	120.0	10.0
-14	1	120.0	10.0
-14	2	120.0	10.0
-14	3	120.0	10.0
-14	4	120.0	10.0
-14	5	120.0	10.0
-14	6	120.0	10.0
-14	7	120.0	10.0
-14	8	120.0	10.0
-14	9	120.0	10.0
-14	10	120.0	10.0
-14	11	120.0	10.0
-14	12	120.0	10.0
-14	13	120.0	10.0
-14	14	120.0	10.0
-14	15	120.0	10.0
-15	0	120.0	10.0
-15	1	120.0	10.0
-15	2	120.0	10.0
-15	3	120.0	10.0
-15	4	120.0	10.0
-15	5	120.0	10.0
-15	6	120.0	10.0
-15	7	120.0	10.0
-15	8	120.0	10.0
-15	9	120.0	10.0
-15	10	120.0	10.0
-15	11	120.0	10.0
-15	12	120.0	10.0
-15	13	120.0	10.0
-15	14	120.0	10.0
-15	15	120.0	10.0
-16	0	120.0	10.0
-16	1	120.0	10.0
-16	2	120.0	10.0
-16	3	120.0	10.0
-16	4	120.0	10.0
-16	5	120.0	10.0
-16	6	120.0	10.0
-16	7	120.0	10.0
-16	8	120.0	10.0
-16	9	120.0	10.0
-16	10	120.0	10.0
-16	11	120.0	10.0
-16	12	120.0	10.0
-16	13	120.0	10.0
-16	14	120.0	10.0
-16	15	120.0	10.0
-17	0	120.0	10.0
-17	1	120.0	10.0
-17	2	120.0	10.0
-17	3	120.0	10.0
-17	4	120.0	10.0
-17	5	120.0	10.0
-17	6	120.0	10.0
-17	7	120.0	10.0
-17	8	120.0	10.0
-17	9	120.0	10.0
-17	10	120.0	10.0
-17	11	120.0	10.0
-17	12	120.0	10.0
-17	13	120.0	10.0
-17	14	120.0	10.0
-17	15	120.0	10.0
-18	0	120.0	10.0
-18	1	120.0	10.0
-18	2	120.0	10.0
-18	3	120.0	10.0
-18	4	120.0	10.0
-18	5	120.0	10.0
-18	6	120.0	10.0
-18	7	120.0	10.0
-18	8	120.0	10.0
-18	9	120.0	10.0
-18	10	120.0	10.0
-18	11	120.0	10.0
-18	12	120.0	10.0
-18	13	120.0	10.0
-18	14	120.0	10.0
-18	15	120.0	10.0
-19	0	120.0	10.0
-19	1	120.0	10.0
-19	2	120.0	10.0
-19	3	120.0	10.0
-19	4	120.0	10.0
-19	5	120.0	10.0
-19	6	120.0	10.0
-19	7	120.0	10.0
-19	8	120.0	10.0
-19	9	120.0	10.0
-19	10	120.0	10.0
-19	11	120.0	10.0
-19	12	120.0	10.0

java/branches/hps-java_ecal-commissioning/evio
pom.xml 1180 -> 1181
--- java/branches/hps-java_ecal-commissioning/evio/pom.xml	2014-10-14 22:33:12 UTC (rev 1180)
+++ java/branches/hps-java_ecal-commissioning/evio/pom.xml	2014-10-14 22:44:30 UTC (rev 1181)
@@ -19,7 +19,7 @@
         <dependency>
             <groupId>org.jlab.coda</groupId>
             <artifactId>jevio</artifactId>
-            <version>4.3.1</version>
+            <version>4.0</version>
         </dependency>
         <dependency>
             <groupId>org.hps</groupId>

java/branches/hps-java_ecal-commissioning/monitoring-drivers/src/main/java/org/hps/monitoring/ecal/plots
EcalEventDisplay.java 1180 -> 1181
--- java/branches/hps-java_ecal-commissioning/monitoring-drivers/src/main/java/org/hps/monitoring/ecal/plots/EcalEventDisplay.java	2014-10-14 22:33:12 UTC (rev 1180)
+++ java/branches/hps-java_ecal-commissioning/monitoring-drivers/src/main/java/org/hps/monitoring/ecal/plots/EcalEventDisplay.java	2014-10-14 22:44:30 UTC (rev 1181)
@@ -136,9 +136,9 @@
        for(int ii = 0; ii < (47*11); ii = ii +1){
              int row=ECalUtils.getRowFromHistoID(ii);
              int column=ECalUtils.getColumnFromHistoID(ii);      
-             channelEnergyPlot.add(aida.histogram1D(detector.getDetectorName() + " : " + inputCollection + " : Hit Energy : " + (column) + " "+ (row)+ ": "+ii, 100, 0, maxEch));  
+             channelEnergyPlot.add(aida.histogram1D(detector.getDetectorName() + " : " + inputCollection + " : Hit Energy : " + (column) + " "+ (row)+ ": "+ii, 100, -.2, maxEch));  
              channelTimePlot.add(aida.histogram1D(detector.getDetectorName() + " : " + inputCollection + " : Hit Time : " + (column) + " "+ (row)+ ": "+ii, 100, 0, 400));     
-             channelTimeVsEnergyPlot.add(aida.histogram2D(detector.getDetectorName() + " : " + inputCollection + " : Hit Time Vs Energy : " + (column) + " "+ (row)+ ": "+ii, 100, 0, 400,100, 0, maxEch));              
+             channelTimeVsEnergyPlot.add(aida.histogram2D(detector.getDetectorName() + " : " + inputCollection + " : Hit Time Vs Energy : " + (column) + " "+ (row)+ ": "+ii, 100, 0, 400,100, -.2, maxEch));              
              channelRawWaveform.add(aida.histogram1D(detector.getDetectorName() + " : " + inputCollection + " : Hit Energy : " + (column) + " "+ (row)+ ": "+ii));
              //the above instruction is a terrible hack, just to fill the arrayList with all the elements. They'll be initialized properly during the event readout,
              //since we want to account for possibly different raw waveform dimensions!
@@ -152,7 +152,7 @@
    	   ix=ECalUtils.getColumnFromHistoID(id);  
    	   
    	   
-    	plotterFactory = aida.analysisFactory().createPlotterFactory("Ecal LED commissioning");       
+    	plotterFactory = aida.analysisFactory().createPlotterFactory("Single channel");       
         plotter = plotterFactory.create("Single channel");
    	    pstyle = this.createDefaultStyle(); 		
         plotter.setTitle("");

java/branches/hps-java_ecal-commissioning/steering-files/src/main/resources/org/hps/steering/monitoring
EcalMonitoringFinal.lcsim 1180 -> 1181
--- java/branches/hps-java_ecal-commissioning/steering-files/src/main/resources/org/hps/steering/monitoring/EcalMonitoringFinal.lcsim	2014-10-14 22:33:12 UTC (rev 1180)
+++ java/branches/hps-java_ecal-commissioning/steering-files/src/main/resources/org/hps/steering/monitoring/EcalMonitoringFinal.lcsim	2014-10-14 22:44:30 UTC (rev 1181)
@@ -8,14 +8,14 @@
     </control>    
     <execute>
         <driver name="EventMarkerDriver"/>
-        <driver name="ConditionsDriver"/>
-        <driver name="CalibrationDriver"/>
+<!--        <driver name="ConditionsDriver"/> -->
+        <driver name="CalibrationDriver"/> 
         <driver name="EcalRawConverter"/> 
         <driver name="EcalClusterer"/> 
         <driver name="EcalMonitoringPlots"/>      <!-- General plots -->
         <driver name="EcalHitPlots"/>             <!-- Single hit distributions -->
         <driver name="EcalClusterPlots"/>         <!-- Clusters distributions -->
-        <driver name="EcalDaqPlots"/>              <!-- DAQ Plots -->
+      <!--     <driver name="EcalDaqPlots"/>    -->          <!-- DAQ Plots -->
         <driver name="EcalEventDisplay"/>         <!-- Ecal event display -->
 
 
@@ -38,7 +38,7 @@
         </driver>
 
         <driver name="ConditionsDriver" type="org.hps.conditions.ConditionsDriver">
-            <conditionsReaderClass>org.hps.conditions.deprecated.TestRunConditionsReader</conditionsReaderClass>
+  <!--          <conditionsReaderClass>org.hps.conditions.deprecated.TestRunConditionsReader</conditionsReaderClass> -->
         </driver>
 
         <driver name="CalibrationDriver" type="org.hps.conditions.deprecated.CalibrationDriver"/>   

java/branches/hps-java_ecal-commissioning/steering-files/src/main/resources/org/hps/steering/users/celentan
PedestalComputionRaw.lcsim added at 1181
--- java/branches/hps-java_ecal-commissioning/steering-files/src/main/resources/org/hps/steering/users/celentan/PedestalComputionRaw.lcsim	                        (rev 0)
+++ java/branches/hps-java_ecal-commissioning/steering-files/src/main/resources/org/hps/steering/users/celentan/PedestalComputionRaw.lcsim	2014-10-14 22:44:30 UTC (rev 1181)
@@ -0,0 +1,36 @@
+<lcsim xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" 
+       xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/lcsim/1.0/lcsim.xsd">       
+    <control>
+        <numberOfEvents>-1</numberOfEvents> 
+        <printInputFiles>true</printInputFiles>
+        <printDriversDetailed>true</printDriversDetailed>
+    </control>    
+    <execute>
+        <driver name="EventMarkerDriver"/>
+  <!--      <driver name="ConditionsDriver"/> -->
+        <driver name="CalibrationDriver"/>
+        <driver name="EcalRawConverter"/>     
+        <driver name="Pedestal"/>        
+
+
+<!--        <driver name="RunControlDriver" />-->
+        <!--<driver name="AidaSaveDriver"/>-->
+    </execute>   
+    
+<!--  Here starts the drivers description -->
+    <drivers>
+       <driver name="EventMarkerDriver" type="org.lcsim.job.EventMarkerDriver">
+            <eventInterval>1</eventInterval>
+        </driver>
+
+        <driver name="CalibrationDriver" type="org.hps.conditions.deprecated.CalibrationDriver"/>   
+        
+        <driver name="EcalRawConverter" type="org.hps.recon.ecal.EcalRawConverterDriver">
+<!--            <threshold>150</threshold>-->
+            <applyBadCrystalMap>false</applyBadCrystalMap>
+<!--            <dropBadFADC>true</dropBadFADC>-->
+        </driver> 
+        <driver name="Pedestal" type="org.hps.users.celentan.RawPedestalComputator"/>               
+    </drivers>
+</lcsim>
+    
\ No newline at end of file

java/branches/hps-java_ecal-commissioning/users/src/main/java/org/hps/users/celentan
RawPedestalComputator.java added at 1181
--- java/branches/hps-java_ecal-commissioning/users/src/main/java/org/hps/users/celentan/RawPedestalComputator.java	                        (rev 0)
+++ java/branches/hps-java_ecal-commissioning/users/src/main/java/org/hps/users/celentan/RawPedestalComputator.java	2014-10-14 22:44:30 UTC (rev 1181)
@@ -0,0 +1,131 @@
+package org.hps.users.celentan;
+
+import java.util.List;
+
+import org.hps.conditions.deprecated.EcalConditions;
+import org.hps.recon.ecal.ECalUtils;
+import org.lcsim.event.CalorimeterHit;
+import org.lcsim.event.EventHeader;
+import org.lcsim.event.GenericObject;
+import org.lcsim.event.RawCalorimeterHit;
+import org.lcsim.event.RawTrackerHit;
+import org.lcsim.geometry.Detector;
+import org.lcsim.lcio.LCIOConstants;
+import org.lcsim.util.Driver;
+import java.io.PrintWriter;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+
+public class RawPedestalComputator extends Driver{
+	
+	   String inputCollectionRaw = "EcalReadoutHits";
+	   int row,column;
+	   
+	   int[] windowRaw=new int[47*11];//in case we have the raw waveform, this is the window lenght (in samples)
+	   boolean[] isFirstRaw=new boolean[47*11];  
+	   
+	   double[] pedestal=new double[47*11];
+	   double[] noise=new double[47*11];
+	   double[] result;
+	   
+	   int pedSamples=50;
+	   int nEvents=0;
+	   @Override
+	    public void detectorChanged(Detector detector) {
+	    	System.out.println("Pedestal computator: detector changed");
+	    	for (int ii=0;ii<11*47;ii++){
+	    		isFirstRaw[ii]=true;
+	    		pedestal[ii]=0;
+	    		noise[ii]=0;
+	    	}
+	   }
+	   
+
+	    @Override
+	    public void process(EventHeader event) {
+	    	int ii=0;
+	    	if (event.hasCollection(RawTrackerHit.class, inputCollectionRaw)){       	
+	    		List<RawTrackerHit> hits = event.get(RawTrackerHit.class, inputCollectionRaw);
+	          	for (RawTrackerHit hit : hits) {
+	          		row=hit.getIdentifierFieldValue("iy");
+	                column=hit.getIdentifierFieldValue("ix");	
+	                ii = ECalUtils.getHistoIDFromRowColumn(row,column);
+	                if ((row!=0)&&(column!=0)){
+	                	if (!ECalUtils.isInHole(row,column)){
+	                		if (isFirstRaw[ii]){ //at the very first hit we read for this channel, we need to read the window length and save it
+	                			isFirstRaw[ii]=false;
+	                			windowRaw[ii]=hit.getADCValues().length;  
+	                		 }
+	                  		result=ECalUtils.computeAmplitude(hit.getADCValues(),windowRaw[ii],pedSamples);
+	                  		pedestal[ii]+=result[1];
+	                  		noise[ii]+=result[2];	                  		
+	                	}
+	                }	
+	          	}		
+	    	  }	
+	    	nEvents++;
+	    }
+	    
+	    @Override
+	    public void endOfData() {
+	    	try{
+	    	PrintWriter writerTop = new PrintWriter("default01.ped","UTF-8");
+    		PrintWriter writerBottom = new PrintWriter("default02.ped","UTF-8");	
+	    	
+	    	for (int ii=0;ii<11*47;ii++){	    	
+	    		int row,column;	
+	    		row=ECalUtils.getRowFromHistoID(ii);
+	    		column=ECalUtils.getColumnFromHistoID(ii);
+	    		if (ECalUtils.isInHole(row,column)) continue;
+   				if ((row==0)||(column==0)) continue;
+	    		pedestal[ii]/=nEvents;
+	    		noise[ii]/=nEvents;
+
+	    		long daqID=EcalConditions.physicalToDaqID(EcalConditions.makePhysicalID(column,row));
+	    		
+	    		int crate=EcalConditions.getCrate(daqID);
+	    		int slot=EcalConditions.getSlot(daqID);
+	    		int channel=EcalConditions.getChannel(daqID);
+
+	    		System.out.println(column+" "+row+" "+crate+" "+slot+" "+channel+" "+pedestal[ii]+" "+noise[ii]);
+	    		
+	    		
+	    		
+	    		if (crate==37){
+	    			writerTop.print(slot+" "+channel+" "+(int)(Math.round(pedestal[ii]))+" "+(int)(Math.round(noise[ii]))+"\r\n");
+	    		}
+	    		else if (crate==39){
+	    			writerBottom.print(slot+" "+channel+" "+(int)(Math.round(pedestal[ii]))+" "+(int)(Math.round(noise[ii]))+"\r\n");
+	    		}
+	    		
+	    	}
+
+    		writerTop.close();
+    		writerBottom.close();
+	    	}
+	    	 catch(FileNotFoundException fnfe)
+	        {
+
+	            System.out.println(fnfe.getMessage());
+
+	        }
+
+	        catch(IOException ioe)
+	        {
+
+	            System.out.println(ioe.getMessage());
+
+	        }
+	    }
+}
+
+
+
+
+
+
+
+
+
+
SVNspam 0.1