4 modified files
java/trunk/analysis/src/main/java/org/hps/analysis/dataquality
--- java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/DataQualityMonitor.java 2014-05-17 00:28:10 UTC (rev 593)
+++ java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/DataQualityMonitor.java 2014-05-18 00:56:42 UTC (rev 594)
@@ -11,8 +11,8 @@
* sort of an interface for DQM analysis drivers creates the DQM database
* manager, checks whether row exists in db etc
*
- * @author mgraham on Apr 15, 2014
- * update mgraham on May 15, 2014 to include calculateEndOfRunQuantities & printDQMData i.e. useful methods
+ * @author mgraham on Apr 15, 2014 update mgraham on May 15, 2014 to include
+ * calculateEndOfRunQuantities & printDQMData i.e. useful methods
*/
public class DataQualityMonitor extends Driver {
@@ -22,6 +22,7 @@
public static int runNumber = 1350;
public boolean overwriteDB = false;
public boolean connectToDB = false;
+ public boolean printDQMStrings = false;
public void setRecoVersion(String recoVersion) {
this.recoVersion = recoVersion;
@@ -35,11 +36,20 @@
this.overwriteDB = connect;
}
+ public void setPrintDQMStrings(boolean print) {
+ this.printDQMStrings = print;
+ }
+
public void DataQualityMonitor() {
}
public void endOfData() {
+ calculateEndOfRunQuantities();
+ fillEndOfRunPlots();
+ printDQMData();
+ if(printDQMStrings)
+ printDQMStrings();
if (connectToDB) {
manager = DQMDatabaseManager.getInstance();
//fill any plots that only get filled at end of data...e.g. SVT occupancy plots
@@ -61,9 +71,7 @@
dumpDQMData();
}
- calculateEndOfRunQuantities();
- fillEndOfRunPlots();
- printDQMData();
+
}
private void makeNewRow() {
@@ -100,7 +108,6 @@
public void calculateEndOfRunQuantities() {
}
-
//override this method to do something interesting
//like write the DQM data to the database
public void dumpDQMData() {
@@ -110,4 +117,10 @@
//like print the DQM data log file
public void printDQMData() {
}
+
+ //override this method to do something interesting
+ //like print the DQM db variable strings in a good
+ //format for making the db column headers
+ public void printDQMStrings() {
+ }
}
java/trunk/analysis/src/main/java/org/hps/analysis/dataquality
--- java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/EcalMonitoring.java 2014-05-17 00:28:10 UTC (rev 593)
+++ java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/EcalMonitoring.java 2014-05-18 00:56:42 UTC (rev 594)
@@ -8,39 +8,38 @@
import org.lcsim.event.ReconstructedParticle;
import org.lcsim.geometry.Detector;
-
/**
*
- * @author mgraham on Mar 28, 2014...just added empty (almost) file into svn
- * May 14, 2014 put some DQM template stuff in...ECal-ers should really fill in the guts
+ * @author mgraham on Mar 28, 2014...just added empty (almost) file into svn May
+ * 14, 2014 put some DQM template stuff in...ECal-ers should really fill in the
+ * guts
*/
+public class EcalMonitoring extends DataQualityMonitor {
-public class EcalMonitoring extends DataQualityMonitor {
- String readoutHitCollectionName="EcalReadoutHits";//these are in ADC counts
- String calibratedHitCollectionName="EcalCalHits";//these are in energy
+ String readoutHitCollectionName = "EcalReadoutHits";//these are in ADC counts
+ String calibratedHitCollectionName = "EcalCalHits";//these are in energy
String clusterCollectionName = "EcalClusters";
private Map<String, Double> monitoredQuantityMap = new HashMap<>();
- String[] ecalQuantNames = {"Good","Stuff","For","ECAL"};
-
- protected void detectorChanged(Detector detector) {
+ String[] ecalQuantNames = {"Good", "Stuff", "For", "ECAL"};
+
+ protected void detectorChanged(Detector detector) {
System.out.println("EcalMonitoring::detectorChanged Setting up the plotter");
aida.tree().cd("/");
//make some cool plots that will get saved in root format...2D is good too!
IHistogram1D energy = aida.histogram1D("Cluster Energy", 25, 0, 2.5);
-
+
}
- @Override
+
+ @Override
public void process(EventHeader event) {
/* make sure everything is there */
if (!event.hasCollection(RawCalorimeterHit.class, readoutHitCollectionName))
return;
-
-
+
}
-
@Override
public void dumpDQMData() {
System.out.println("EcalMonitoring::endOfData filling DQM database");
@@ -49,7 +48,7 @@
@Override
public void printDQMData() {
System.out.println("EcalMonitoring::printDQMData");
-
+
System.out.println("*******************************");
}
@@ -59,5 +58,10 @@
@Override
public void calculateEndOfRunQuantities() {
}
-
+
+ @Override
+ public void printDQMStrings() {
+
+ }
+
}
java/trunk/analysis/src/main/java/org/hps/analysis/dataquality
--- java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/ReconMonitoring.java 2014-05-17 00:28:10 UTC (rev 593)
+++ java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/ReconMonitoring.java 2014-05-18 00:56:42 UTC (rev 594)
@@ -6,7 +6,9 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import org.hps.recon.tracking.TrackUtils;
+import org.lcsim.detector.tracker.silicon.SiSensor;
import org.lcsim.event.Cluster;
import org.lcsim.event.EventHeader;
import org.lcsim.event.ReconstructedParticle;
@@ -14,14 +16,14 @@
import org.lcsim.geometry.Detector;
/**
- * DQM driver reconstructed particles (i.e. electrons, positrons, photons)
- * plots things like number of electrons (or positrons)/event, photons/event, e+/e- momentum,
- * and track-cluster matching stuff
- * @author mgraham on Mar 28, 2014
- * big update on May 14, 2014...right now the output is crap;
- * no charge<0 tracks & the track momentum isn't filled;
- * likely a problem with ReconParticle
- * TODO: may want to break out the V0 DQM (not written) into it's own class
+ * DQM driver reconstructed particles (i.e. electrons, positrons, photons) plots
+ * things like number of electrons (or positrons)/event, photons/event, e+/e-
+ * momentum, and track-cluster matching stuff
+ *
+ * @author mgraham on Mar 28, 2014 big update on May 14, 2014...right now the
+ * output is crap; no charge<0 tracks & the track momentum isn't filled; likely
+ * a problem with ReconParticle TODO: may want to break out the V0 DQM (not
+ * written) into it's own class
*/
public class ReconMonitoring extends DataQualityMonitor {
@@ -160,9 +162,7 @@
}
}
aida.histogram1D("Number of unassociated tracks per event").fill(nUnAssTracks);
- aida.histogram1D("Number of photons per event").fill(nPhotons);
- //Ok...done with the final state tracks! Now, do the A' candidates. Soon.
-
+ aida.histogram1D("Number of photons per event").fill(nPhotons);
}
@Override
@@ -172,10 +172,10 @@
@Override
public void printDQMData() {
- System.out.println("ReconMonitoring::printDQMData");
- for(int i =0;i<7;i++){//TODO: do this in a smarter way...loop over the map
- System.out.println(fpQuantNames[i]+" = "+monitoredQuantityMap.get(fpQuantNames[i]));
- }
+ System.out.println("ReconMonitoring::printDQMData");
+ for(Entry<String,Double> entry: monitoredQuantityMap.entrySet()){
+ System.out.println(entry.getKey()+" = "+entry.getValue());
+ }
System.out.println("*******************************");
}
@@ -192,4 +192,12 @@
monitoredQuantityMap.put(fpQuantNames[5], (double) sumdelY / nTotAss);
monitoredQuantityMap.put(fpQuantNames[6], (double) sumEoverP / nTotAss);
}
+
+ @Override
+ public void printDQMStrings() {
+ for (int i = 0; i < 7; i++) {//TODO: do this in a smarter way...loop over the map
+ System.out.println(fpQuantNames[i]);
+ }
+ }
+
}
java/trunk/analysis/src/main/java/org/hps/analysis/dataquality
--- java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/SvtMonitoring.java 2014-05-17 00:28:10 UTC (rev 593)
+++ java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/SvtMonitoring.java 2014-05-18 00:56:42 UTC (rev 594)
@@ -183,4 +183,10 @@
}
}
+ @Override
+ public void printDQMStrings() {
+ for (SiSensor sensor : sensors) {
+ System.out.println(avgOccupancyNames.get(sensor.getName()));
+ }
+ }
}
SVNspam 0.1