Author: [log in to unmask]
Date: Wed Oct 7 19:47:33 2015
New Revision: 3804
Log:
Convert DQM print outs to use logger.
Modified:
java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/DQMDatabaseDriver.java
java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/DQMDatabaseManager.java
java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/DataQualityMonitor.java
java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/EcalMonitoring.java
java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/FinalStateMonitoring.java
java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/PlotAndFitUtilities.java
java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/SVTHitMCEfficiency.java
java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/SvtMonitoring.java
java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/TrackMCEfficiency.java
java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/TrackingMonitoring.java
java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/TrackingResiduals.java
java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/TridentMonitoring.java
java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/V0Monitoring.java
Modified: java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/DQMDatabaseDriver.java
=============================================================================
--- java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/DQMDatabaseDriver.java (original)
+++ java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/DQMDatabaseDriver.java Wed Oct 7 19:47:33 2015
@@ -1,8 +1,8 @@
package org.hps.analysis.dataquality;
-import java.sql.ResultSet;
import java.sql.SQLException;
-import org.lcsim.conditions.ConditionsReader;
+import java.util.logging.Logger;
+
import org.lcsim.geometry.Detector;
import org.lcsim.util.Driver;
@@ -14,6 +14,8 @@
* cribbed heavily from {@link org.hps.conditions.ConditionsDriver}
*/
public class DQMDatabaseDriver extends Driver {
+
+ private static Logger LOGGER = Logger.getLogger(DQMDatabaseDriver.class.getPackage().getName());
// Static instance of the manager.
static DQMDatabaseManager manager;
@@ -27,7 +29,7 @@
* connection parameters and configuration.
*/
public DQMDatabaseDriver() throws SQLException {
- System.out.println("DQMDatabaseDriver.ctor");
+ LOGGER.info("DQMDatabaseDriver.ctor");
manager = new DQMDatabaseManager();
manager.setConnectionResource(_defaultConnectionResource);
manager.setup();
@@ -35,7 +37,7 @@
// ResultSet result=manager.selectQuery("SELECT * from dqm where run=1111;");
// result.next();
// float occ = result.getFloat(3);
- // System.out.println(occ);
+ // LOGGER.info(occ);
}
/**
Modified: java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/DQMDatabaseManager.java
=============================================================================
--- java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/DQMDatabaseManager.java (original)
+++ java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/DQMDatabaseManager.java Wed Oct 7 19:47:33 2015
@@ -25,7 +25,7 @@
@SuppressWarnings("rawtypes")
public class DQMDatabaseManager {
-
+
int runNumber = -1;
String detectorName;
List<TableMetaData> tableMetaData;
@@ -45,7 +45,7 @@
* Class constructor, which is only package accessible.
*/
DQMDatabaseManager() {
- System.out.println("Making the instance of DQMDatabaseManager");
+ LOGGER.info("Making the instance of DQMDatabaseManager");
}
Modified: java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/DataQualityMonitor.java
=============================================================================
--- java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/DataQualityMonitor.java (original)
+++ java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/DataQualityMonitor.java Wed Oct 7 19:47:33 2015
@@ -23,6 +23,8 @@
* calculateEndOfRunQuantities & printDQMData i.e. useful methods
*/
public class DataQualityMonitor extends Driver {
+
+ private static Logger LOGGER = Logger.getLogger(DataQualityMonitor.class.getPackage().getName());
protected AIDA aida = AIDA.defaultInstance();
protected DQMDatabaseManager manager;
@@ -89,16 +91,16 @@
printDQMData();
if (printDQMStrings)
printDQMStrings();
- System.out.println("Should I write to the database? " + connectToDB);
+ LOGGER.info("Should I write to the database? " + connectToDB);
if (connectToDB) {
- System.out.println("Connecting To Database...getting DQMDBManager");
+ LOGGER.info("Connecting To Database...getting DQMDBManager");
manager = DQMDatabaseManager.getInstance();
//check to see if I need to make a new db entry
boolean entryExists = false;
try {
entryExists = checkRowExists();
if (entryExists)
- System.out.println("Found an existing run/reco entry in the dqm database; overwrite = " + overwriteDB);
+ LOGGER.info("Found an existing run/reco entry in the dqm database; overwrite = " + overwriteDB);
} catch (SQLException ex) {
Logger.getLogger(DataQualityMonitor.class.getName()).log(Level.SEVERE, null, ex);
}
@@ -111,15 +113,15 @@
}
private void makeNewRow() {
- System.out.println("is the data base connected? " + manager.isConnected);
+ LOGGER.info("is the data base connected? " + manager.isConnected);
if (manager.isConnected) {
String ins = "insert into dqm SET runNumber=" + runNumber;
-// System.out.println(ins);
+// LOGGER.info(ins);
manager.updateQuery(ins);
ins = "update dqm SET recoVersion='" + recoVersion + "' where runNumber=" + runNumber;
manager.updateQuery(ins);
}
- System.out.println("Made a new row for runNumber=" + runNumber + "; recoVersion=" + recoVersion);
+ LOGGER.info("Made a new row for runNumber=" + runNumber + "; recoVersion=" + recoVersion);
}
private boolean checkRowExists() throws SQLException {
@@ -137,7 +139,7 @@
double result = res.getDouble(var);
if (res.wasNull())
return true;
- System.out.println("checkSelectionIsNULL::" + var + " = " + result);
+ LOGGER.info("checkSelectionIsNULL::" + var + " = " + result);
return false;
}
@@ -166,11 +168,11 @@
Logger.getLogger(SvtMonitoring.class.getName()).log(Level.SEVERE, null, ex);
}
if (!overwriteDB && !isnull) {
- System.out.println("Not writing because " + name + " is already filled for this entry");
+ LOGGER.info("Not writing because " + name + " is already filled for this entry");
continue; //entry exists and I don't want to overwrite
}
String put = "update dqm SET " + name + " = " + val + " WHERE " + getRunRecoString();
- System.out.println(put);
+ LOGGER.info(put);
manager.updateQuery(put);
}
@@ -206,7 +208,7 @@
match = false;
}
} else if (debug)
- System.out.println(this.getClass().getSimpleName() + ": No trigger bank found...running over all trigger types");
+ LOGGER.info(this.getClass().getSimpleName() + ": No trigger bank found...running over all trigger types");
return match;
}
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 Wed Oct 7 19:47:33 2015
@@ -2,8 +2,11 @@
import hep.aida.IHistogram1D;
import hep.aida.IHistogram2D;
+
import java.util.List;
import java.util.Map;
+import java.util.logging.Logger;
+
import org.apache.commons.math.stat.StatUtils;
import org.hps.recon.ecal.cluster.ClusterUtilities;
import org.lcsim.event.CalorimeterHit;
@@ -21,6 +24,8 @@
* mostly copied from online monitoring
*/
public class EcalMonitoring extends DataQualityMonitor {
+
+ private static Logger LOGGER = Logger.getLogger(EcalMonitoring.class.getPackage().getName());
String readoutHitCollectionName = "EcalReadoutHits";//these are in ADC counts
String calibratedHitCollectionName = "EcalCalHits";//these are in energy
@@ -91,7 +96,7 @@
@Override
protected void detectorChanged(Detector detector) {
- System.out.println("EcalMonitoring::detectorChanged Setting up the plotter");
+ LOGGER.info("EcalMonitoring::detectorChanged Setting up the plotter");
aida.tree().cd("/");
if (fillHitPlots) {
// Setup hit plots.
@@ -230,15 +235,15 @@
@Override
public void dumpDQMData() {
- System.out.println("EcalMonitoring::endOfData filling DQM database");
+ LOGGER.info("EcalMonitoring::endOfData filling DQM database");
}
@Override
public void printDQMData() {
- System.out.println("EcalMonitoring::printDQMData");
+ LOGGER.info("EcalMonitoring::printDQMData");
for (Map.Entry<String, Double> entry : monitoredQuantityMap.entrySet())
- System.out.println(entry.getKey() + " = " + entry.getValue());
- System.out.println("*******************************");
+ LOGGER.info(entry.getKey() + " = " + entry.getValue());
+ LOGGER.info("*******************************");
}
/**
Modified: java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/FinalStateMonitoring.java
=============================================================================
--- java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/FinalStateMonitoring.java (original)
+++ java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/FinalStateMonitoring.java Wed Oct 7 19:47:33 2015
@@ -10,11 +10,13 @@
import hep.aida.IPlotterStyle;
import hep.physics.vec.BasicHep3Vector;
import hep.physics.vec.Hep3Vector;
+
import java.io.IOException;
import java.util.List;
import java.util.Map.Entry;
import java.util.logging.Level;
import java.util.logging.Logger;
+
import org.hps.recon.ecal.cluster.ClusterUtilities;
import org.hps.recon.tracking.TrackType;
import org.hps.recon.tracking.TrackUtils;
@@ -40,6 +42,8 @@
*
*/
public class FinalStateMonitoring extends DataQualityMonitor {
+
+ private static Logger LOGGER = Logger.getLogger(FinalStateMonitoring.class.getPackage().getName());
String finalStateParticlesColName = "FinalStateParticles";
@@ -99,7 +103,7 @@
@Override
protected void detectorChanged(Detector detector) {
- System.out.println("FinalStateMonitoring::detectorChanged Setting up the plotter");
+ LOGGER.info("Setting up the plotter");
aida.tree().cd("/");
String trkType="SeedTrack/";
if(isGBL)
@@ -147,7 +151,7 @@
if (!event.hasCollection(ReconstructedParticle.class, finalStateParticlesColName)) {
if (debug) {
- System.out.println(finalStateParticlesColName + " collection not found???");
+ LOGGER.info(finalStateParticlesColName + " collection not found???");
}
return;
}
@@ -165,11 +169,11 @@
int nUnAssTracks = 0; //number of tracks w/o clusters
List<ReconstructedParticle> finalStateParticles = event.get(ReconstructedParticle.class, finalStateParticlesColName);
if (debug) {
- System.out.println("This events has " + finalStateParticles.size() + " final state particles");
+ LOGGER.info("This events has " + finalStateParticles.size() + " final state particles");
}
for (ReconstructedParticle fsPart : finalStateParticles) {
if (debug) {
- System.out.println("PDGID = " + fsPart.getParticleIDUsed() + "; charge = " + fsPart.getCharge() + "; pz = " + fsPart.getMomentum().x());
+ LOGGER.info("PDGID = " + fsPart.getParticleIDUsed() + "; charge = " + fsPart.getCharge() + "; pz = " + fsPart.getMomentum().x());
}
if (isGBL != TrackType.isGBL(fsPart.getType()))
continue;
@@ -269,7 +273,7 @@
trackTvsECalT.fill(ClusterUtilities.getSeedHitTime(fsCluster), TrackUtils.getTrackTime(fsTrack, hitToStrips, hitToRotated));
timeMatchDeltaT.fill(ClusterUtilities.getSeedHitTime(fsCluster) - TrackUtils.getTrackTime(fsTrack, hitToStrips, hitToRotated));
// if(dy<-20)
- // System.out.println("Big deltaY...")
+ // LOGGER.info("Big deltaY...")
}
if (!hasCluster) {//if there is no cluster, can't be a track or else it wouldn't be in list
@@ -283,11 +287,11 @@
@Override
public void printDQMData() {
- System.out.println("FinalStateMonitoring::printDQMData");
+ LOGGER.info("FinalStateMonitoring::printDQMData");
for (Entry<String, Double> entry : monitoredQuantityMap.entrySet()) {
- System.out.println(entry.getKey() + " = " + entry.getValue());
- }
- System.out.println("*******************************");
+ LOGGER.info(entry.getKey() + " = " + entry.getValue());
+ }
+ LOGGER.info("*******************************");
}
/**
@@ -302,7 +306,7 @@
if (result != null) {
double[] pars = result.fittedParameters();
for (int i = 0; i < 5; i++) {
- System.out.println("Beam Energy Peak: " + result.fittedParameterNames()[i] + " = " + pars[i]);
+ LOGGER.info("Beam Energy Peak: " + result.fittedParameterNames()[i] + " = " + pars[i]);
}
monitoredQuantityMap.put(finalStateParticlesColName + " " + triggerType + " " + fpQuantNames[7], (double) pars[1]);
monitoredQuantityMap.put(finalStateParticlesColName + " " + triggerType + " " + fpQuantNames[8], (double) pars[2]);
@@ -336,7 +340,7 @@
public void printDQMStrings() {
for (int i = 0; i < 9; i++)//TODO: do this in a smarter way...loop over the map
{
- System.out.println("ALTER TABLE dqm ADD " + fpQuantNames[i] + " double;");
+ LOGGER.info("ALTER TABLE dqm ADD " + fpQuantNames[i] + " double;");
}
}
@@ -350,7 +354,7 @@
try {
ifr = fitter.fit(h1d, "g+p1", init);
} catch (RuntimeException ex) {
- System.out.println(this.getClass().getSimpleName() + ": caught exception in fitGaussian");
+ LOGGER.info(this.getClass().getSimpleName() + ": caught exception in fitGaussian");
}
return ifr;
Modified: java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/PlotAndFitUtilities.java
=============================================================================
--- java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/PlotAndFitUtilities.java (original)
+++ java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/PlotAndFitUtilities.java Wed Oct 7 19:47:33 2015
@@ -16,8 +16,10 @@
import hep.aida.IProfile2D;
import hep.aida.ref.plotter.style.registry.IStyleStore;
import hep.aida.ref.plotter.style.registry.StyleRegistry;
+
import java.util.logging.Level;
import java.util.logging.Logger;
+
import org.lcsim.util.aida.AIDA;
/**
@@ -26,6 +28,8 @@
*/
public class PlotAndFitUtilities {
+ private static Logger LOGGER = Logger.getLogger(PlotAndFitUtilities.class.getPackage().getName());
+
static private AIDA aida = AIDA.defaultInstance();
/*
@@ -50,7 +54,7 @@
static void plot(IPlotter plotter, IBaseHistogram histogram, IPlotterStyle style, int region) {
if (style == null)
style = getPlotterStyle(histogram);
- System.out.println("Putting plot in region " + region);
+ LOGGER.info("Putting plot in region " + region);
plotter.region(region).plot(histogram, style);
}
@@ -62,7 +66,7 @@
static void plot(IPlotter plotter, IFunction function, IPlotterStyle style, int region) {
if (style == null)
style = getPlotterStyle(function);
- System.out.println("Putting function in region " + region);
+ LOGGER.info("Putting function in region " + region);
plotter.region(region).plot(function, style);
}
@@ -125,7 +129,7 @@
try {
fitResult = fitter.fit(histogram, function);
} catch (RuntimeException e) {
- System.out.println(e.getMessage());
+ LOGGER.info(e.getMessage());
}
return fitResult;
}
Modified: java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/SVTHitMCEfficiency.java
=============================================================================
--- java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/SVTHitMCEfficiency.java (original)
+++ java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/SVTHitMCEfficiency.java Wed Oct 7 19:47:33 2015
@@ -4,10 +4,13 @@
import hep.aida.IHistogram2D;
import hep.aida.IProfile1D;
import hep.aida.IProfile2D;
+
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.logging.Logger;
+
import org.hps.recon.tracking.FittedRawTrackerHit;
import org.hps.recon.tracking.ShapeFitParameters;
import org.lcsim.detector.tracker.silicon.SiSensor;
@@ -32,6 +35,8 @@
// TODO: Add some quantities for DQM monitoring: e.g. <efficiency>, probably within first 1 cm or so.
public class SVTHitMCEfficiency extends DataQualityMonitor {
+ private static Logger LOGGER = Logger.getLogger(SVTHitMCEfficiency.class.getPackage().getName());
+
private final String rawTrackerHitCollectionName = "SVTRawTrackerHits";
private String helicalTrackHitCollectionName = "HelicalTrackHits";
private final String rotatedTrackHitCollectionName = "RotatedHelicalTrackHits";
@@ -207,7 +212,7 @@
getLayerPlot2D(plotDir + "goodClusterFits", simhit.getLayer()).fill(ShapeFitParameters.getT0(fit), ShapeFitParameters.getAmp(fit));
}
} else {
-// System.out.println(clust.getRawHits().size());
+// LOGGER.info(clust.getRawHits().size());
for (RawTrackerHit rth : (List<RawTrackerHit>) clust.getRawHits()) {
GenericObject fit = (GenericObject) rthtofit.to(rth);
getLayerPlot2D(plotDir + "badClusterFits", simhit.getLayer()).fill(ShapeFitParameters.getT0(fit), ShapeFitParameters.getAmp(fit));
@@ -316,14 +321,14 @@
@Override
public void printDQMData() {
for (SiSensor sensor : sensors) {
- System.out.println(avgClusterEffNames.get(sensor.getName()) + ": " + avgClusterEffMap.get(sensor.getName()));
+ LOGGER.info(avgClusterEffNames.get(sensor.getName()) + ": " + avgClusterEffMap.get(sensor.getName()));
}
}
@Override
public void printDQMStrings() {
for (SiSensor sensor : sensors) {
- System.out.println("ALTER TABLE dqm ADD " + avgClusterEffNames.get(sensor.getName()) + " double;");
+ LOGGER.info("ALTER TABLE dqm ADD " + avgClusterEffNames.get(sensor.getName()) + " double;");
}
}
Modified: java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/SvtMonitoring.java
=============================================================================
--- java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/SvtMonitoring.java (original)
+++ java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/SvtMonitoring.java Wed Oct 7 19:47:33 2015
@@ -8,6 +8,7 @@
import hep.aida.IHistogram2D;
import hep.aida.IPlotter;
import hep.aida.IPlotterStyle;
+
import java.io.IOException;
import java.sql.SQLException;
import java.util.HashMap;
@@ -15,6 +16,7 @@
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
+
import org.hps.recon.tracking.FittedRawTrackerHit;
import org.hps.recon.tracking.ShapeFitParameters;
import org.lcsim.detector.tracker.silicon.HpsSiSensor;
@@ -36,6 +38,8 @@
*/
//TODO: add some more quantities to DQM database: <t0> or <sigma>_t0 for intime events; <chi^2>, <amplitude> etc
public class SvtMonitoring extends DataQualityMonitor {
+
+ private static Logger LOGGER = Logger.getLogger(SvtMonitoring.class.getPackage().getName());
private String rawTrackerHitCollectionName = "SVTRawTrackerHits";
private String fittedTrackerHitCollectionName = "SVTFittedRawTrackerHits";
@@ -72,7 +76,7 @@
@Override
protected void detectorChanged(Detector detector) {
- System.out.println("SvtMonitoring::detectorChanged Setting up the plotter");
+ LOGGER.info("Setting up the plotter");
this.detector = detector;
aida.tree().cd("/");
@@ -120,7 +124,7 @@
Map<String, Integer> hitsPerSensor = new HashMap<String, Integer>();
if (event.hasCollection(RawTrackerHit.class, rawTrackerHitCollectionName)) {
-// System.out.println("Found a raw hit collection");
+// LOGGER.info("Found a raw hit collection");
List<RawTrackerHit> rawTrackerHits = event.get(RawTrackerHit.class, rawTrackerHitCollectionName);
for (RawTrackerHit hit : rawTrackerHits) {
int[] strips = occupancyMap.get(hit.getDetectorElement().getName());
@@ -179,13 +183,13 @@
}
if (event.hasItem(trackerHitCollectionName)) {
-// System.out.println("Found a Si cluster collection");
+// LOGGER.info("Found a Si cluster collection");
List<TrackerHit> siClusters = (List<TrackerHit>) event.get(trackerHitCollectionName);
for (TrackerHit cluster : siClusters) {
String sensorName = getNiceSensorName((HpsSiSensor) ((RawTrackerHit) cluster.getRawHits().get(0)).getDetectorElement());
double t0 = cluster.getTime();
double dedx = cluster.getdEdx() * 1e6;
-// System.out.println("dedx = "+dedx);
+// LOGGER.info("dedx = "+dedx);
getSensorPlot(plotDir + triggerType + "/"+"t0Cluster_", sensorName).fill(t0);
getSensorPlot2D(plotDir + triggerType + "/"+"t0ClusterTrigTime_", sensorName).fill(t0, event.getTimeStamp() % 24);
getSensorPlot(plotDir + triggerType + "/"+"electrons_", sensorName).fill(dedx);
@@ -271,7 +275,7 @@
@Override
public void fillEndOfRunPlots() {
// Plot strip occupancies.
- System.out.println("SvtMonitoring::endOfData filling occupancy plots");
+ LOGGER.info("SvtMonitoring::endOfData filling occupancy plots");
for (HpsSiSensor sensor : sensors) {
Double avg = 0.0;
//IHistogram1D sensorHist = aida.histogram1D(sensor.getName());
@@ -358,18 +362,18 @@
@Override
public void printDQMData() {
for (HpsSiSensor sensor : sensors) {
- System.out.println(avgOccupancyNames.get(sensor.getName()) + " " +triggerType+" " + avgOccupancyMap.get(sensor.getName()));
- System.out.println(avgt0Names.get(sensor.getName()) + " " +triggerType+" " + avgt0Map.get(sensor.getName()));
- System.out.println(sigt0Names.get(sensor.getName()) + " " +triggerType+" " + sigt0Map.get(sensor.getName()));
+ LOGGER.info(avgOccupancyNames.get(sensor.getName()) + " " +triggerType+" " + avgOccupancyMap.get(sensor.getName()));
+ LOGGER.info(avgt0Names.get(sensor.getName()) + " " +triggerType+" " + avgt0Map.get(sensor.getName()));
+ LOGGER.info(sigt0Names.get(sensor.getName()) + " " +triggerType+" " + sigt0Map.get(sensor.getName()));
}
}
@Override
public void printDQMStrings() {
for (HpsSiSensor sensor : sensors) {
- System.out.println("ALTER TABLE dqm ADD " + avgOccupancyNames.get(sensor.getName()) + " double;");
- System.out.println("ALTER TABLE dqm ADD " + avgt0Names.get(sensor.getName()) + " double;");
- System.out.println("ALTER TABLE dqm ADD " + sigt0Names.get(sensor.getName()) + " double;");
+ LOGGER.info("ALTER TABLE dqm ADD " + avgOccupancyNames.get(sensor.getName()) + " double;");
+ LOGGER.info("ALTER TABLE dqm ADD " + avgt0Names.get(sensor.getName()) + " double;");
+ LOGGER.info("ALTER TABLE dqm ADD " + sigt0Names.get(sensor.getName()) + " double;");
}
}
@@ -388,11 +392,11 @@
Logger.getLogger(SvtMonitoring.class.getName()).log(Level.SEVERE, null, ex);
}
if (!overwriteDB && !isnull) {
- System.out.println("Not writing because " + name + " is already filled for this entry");
+ LOGGER.info("Not writing because " + name + " is already filled for this entry");
return; //entry exists and I don't want to overwrite
}
String put = "update dqm SET " + name + " = " + val + " WHERE " + getRunRecoString();
- System.out.println(put);
+ LOGGER.info(put);
manager.updateQuery(put);
}
}
Modified: java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/TrackMCEfficiency.java
=============================================================================
--- java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/TrackMCEfficiency.java (original)
+++ java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/TrackMCEfficiency.java Wed Oct 7 19:47:33 2015
@@ -5,10 +5,13 @@
import hep.aida.IProfile1D;
import hep.physics.vec.BasicHep3Vector;
import hep.physics.vec.Hep3Vector;
+
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.logging.Logger;
+
import org.hps.analysis.examples.TrackAnalysis;
import org.hps.recon.tracking.FindableTrack;
import org.hps.recon.tracking.FittedRawTrackerHit;
@@ -37,6 +40,8 @@
// TODO: Add some quantities for DQM monitoring: e.g. <efficiency>, <eff>_findable
public class TrackMCEfficiency extends DataQualityMonitor {
+ private static Logger LOGGER = Logger.getLogger(TrackMCEfficiency.class.getPackage().getName());
+
private String rawTrackerHitCollectionName = "SVTRawTrackerHits";
private String trackHitCollectionName = "RotatedHelicalTrackHits";
private String fittedSVTHitCollectionName = "SVTFittedRawTrackerHits";
@@ -118,33 +123,33 @@
//make sure the required collections exist
if (!event.hasCollection(RawTrackerHit.class, rawTrackerHitCollectionName)) {
if (debug)
- System.out.println(this.getClass().getSimpleName() + ": no collection found " + rawTrackerHitCollectionName);
+ LOGGER.info(this.getClass().getSimpleName() + ": no collection found " + rawTrackerHitCollectionName);
return;
}
if (!event.hasCollection(LCRelation.class, fittedSVTHitCollectionName))
if (debug)
- System.out.println(this.getClass().getSimpleName() + ": no collection found " + fittedSVTHitCollectionName); //mg...2/1/2015...don't return if the fitted collection isn't there...
+ LOGGER.info(this.getClass().getSimpleName() + ": no collection found " + fittedSVTHitCollectionName); //mg...2/1/2015...don't return if the fitted collection isn't there...
//allow us to run if we simulated in "simple" mode (i.e. no time evolution)
// return;
if (!event.hasCollection(Track.class, trackCollectionName)) {
if (debug)
- System.out.println(this.getClass().getSimpleName() + ": no collection found " + trackCollectionName);
+ LOGGER.info(this.getClass().getSimpleName() + ": no collection found " + trackCollectionName);
return;
}
if (!event.hasCollection(LCRelation.class, trackHitMCRelationsCollectionName)) {
if (debug)
- System.out.println(this.getClass().getSimpleName() + ": no collection found " + trackHitMCRelationsCollectionName);
+ LOGGER.info(this.getClass().getSimpleName() + ": no collection found " + trackHitMCRelationsCollectionName);
return;
}
if (!event.hasCollection(TrackerHit.class, siClusterCollectionName)) {
if (debug)
- System.out.println(this.getClass().getSimpleName() + ": no collection found " + siClusterCollectionName);
+ LOGGER.info(this.getClass().getSimpleName() + ": no collection found " + siClusterCollectionName);
return;
}
if (!event.hasCollection(SimTrackerHit.class, trackerHitCollectionName)) {
if (debug)
- System.out.println(this.getClass().getSimpleName() + ": no collection found " + trackerHitCollectionName);
+ LOGGER.info(this.getClass().getSimpleName() + ": no collection found " + trackerHitCollectionName);
return;
}
//
@@ -156,12 +161,12 @@
RelationalTable hittomc = new BaseRelationalTable(RelationalTable.Mode.MANY_TO_MANY, RelationalTable.Weighting.UNWEIGHTED);
List<LCRelation> mcrelations = event.get(LCRelation.class, trackHitMCRelationsCollectionName);
if (debugTrackEfficiency)
- System.out.println(this.getClass().getSimpleName() + ": number of MC relations = " + mcrelations.size());
+ LOGGER.info(this.getClass().getSimpleName() + ": number of MC relations = " + mcrelations.size());
for (LCRelation relation : mcrelations)
if (relation != null && relation.getFrom() != null && relation.getTo() != null)
hittomc.add(relation.getFrom(), relation.getTo());
if (debugTrackEfficiency)
- System.out.println(this.getClass().getSimpleName() + ": number of hittomc relations = " + hittomc.size());
+ LOGGER.info(this.getClass().getSimpleName() + ": number of hittomc relations = " + hittomc.size());
RelationalTable mcHittomcP = new BaseRelationalTable(RelationalTable.Mode.MANY_TO_MANY, RelationalTable.Weighting.UNWEIGHTED);
// Get the collections of SimTrackerHits
List<List<SimTrackerHit>> simcols = event.get(SimTrackerHit.class);
@@ -220,14 +225,14 @@
List<Track> tracks = event.get(Track.class, trackCollectionName);
if (debugTrackEfficiency)
- System.out.println(this.getClass().getSimpleName() + ": nTracks = " + tracks.size());
+ LOGGER.info(this.getClass().getSimpleName() + ": nTracks = " + tracks.size());
for (Track trk : tracks) {
TrackAnalysis tkanal = new TrackAnalysis(trk, hittomc, rawtomc, hittostrip, hittorotated);
tkanalMap.put(trk, tkanal);
MCParticle mcp = tkanal.getMCParticleNew();
if (mcp != null) {// Create a map between the tracks found and the assigned MC particle
if (debugTrackEfficiency)
- System.out.println(this.getClass().getSimpleName() + ": found MCP match");
+ LOGGER.info(this.getClass().getSimpleName() + ": found MCP match");
trktomc.add(trk, tkanal.getMCParticleNew());
}
}
@@ -250,11 +255,11 @@
double phi = Math.atan2(px, pz);
// Find the number of layers hit by this mc particle
if (debugTrackEfficiency)
- System.out.println("MC pt=" + pt);
+ LOGGER.info("MC pt=" + pt);
int nhits = findable.LayersHit(mcp);
boolean isFindable = findable.InnerTrackerIsFindable(mcp, nlayers - 2);
if (debugTrackEfficiency)
- System.out.println("nhits Findable =" + nhits + "; is findable? " + isFindable);
+ LOGGER.info("nhits Findable =" + nhits + "; is findable? " + isFindable);
// Calculate the helix parameters for this MC particle
HelixParamCalculator helix = new HelixParamCalculator(mcp, bfield);
double d0 = helix.getDCA();
@@ -299,7 +304,7 @@
wgt = 1.;
foundTracks += wgt;
if (debugTrackEfficiency)
- System.out.println("...is findable; filling plots with weight " + wgt);
+ LOGGER.info("...is findable; filling plots with weight " + wgt);
peffFindable.fill(p, wgt);
phieffFindable.fill(phi, wgt);
ctheffFindable.fill(cth, wgt);
@@ -310,17 +315,17 @@
if (debugTrackEfficiency)
if (fittomc != null) {
Set<FittedRawTrackerHit> fitlist = fittomc.allTo(mcp);
- System.out.println(this.getClass().getSimpleName() + ": Missed a findable track with MC p = " + p);
+ LOGGER.info(this.getClass().getSimpleName() + ": Missed a findable track with MC p = " + p);
if (!hasHTHInEachLayer(hitlist, fitlist))
- System.out.println("\t\tThis track failed becasue it's missing a helical track hit");
+ LOGGER.info("\t\tThis track failed becasue it's missing a helical track hit");
}
}
}
if (debugTrackEfficiency){
- System.out.println("# of mc parents " + mcp.getParents().size());
+ LOGGER.info("# of mc parents " + mcp.getParents().size());
if(mcp.getParents().size() > 0 )
- System.out.println("PDG ID of parent 0 is " + mcp.getParents().get(0).getPDGID());
+ LOGGER.info("PDG ID of parent 0 is " + mcp.getParents().get(0).getPDGID());
}
if (mcp.getParents().size() == 1 && mcp.getParents().get(0).getPDGID() == 622) {
totelectrons++;
@@ -329,7 +334,7 @@
if (ntrk > 0)
wgt = 1.;
if (debugTrackEfficiency)
- System.out.println("...is from A'; filling plots with weight " + wgt);
+ LOGGER.info("...is from A'; filling plots with weight " + wgt);
foundelectrons += wgt;
peffElectrons.fill(p, wgt);
phieffElectrons.fill(phi, wgt);
@@ -382,30 +387,30 @@
if (hit.Layer() == layer)
hasThisLayer = true;
if (!hasThisLayer) {
-// System.out.println("Missing reconstructed hit in layer = " + layer);
+// LOGGER.info("Missing reconstructed hit in layer = " + layer);
boolean hasFitHitSL1 = false;
boolean hasFitHitSL2 = false;
FittedRawTrackerHit fitSL1 = null;
FittedRawTrackerHit fitSL2 = null;
-// System.out.println("fitted hit list size = " + fitlist.size());
+// LOGGER.info("fitted hit list size = " + fitlist.size());
for (FittedRawTrackerHit fit : fitlist) {
-// System.out.println("fitted hit layer number = " + fit.getRawTrackerHit().getLayerNumber());
+// LOGGER.info("fitted hit layer number = " + fit.getRawTrackerHit().getLayerNumber());
if (fit.getRawTrackerHit().getLayerNumber() == layer) {
hasFitHitSL1 = true;
fitSL1 = fit;
-// System.out.println("Found a hit in SL1 with t0 = " + fitSL1.getT0() + "; amp = " + fitSL1.getAmp() + "; chi^2 = " + fitSL1.getShapeFitParameters().getChiProb() + "; strip = " + fitSL1.getRawTrackerHit().getCellID());
+// LOGGER.info("Found a hit in SL1 with t0 = " + fitSL1.getT0() + "; amp = " + fitSL1.getAmp() + "; chi^2 = " + fitSL1.getShapeFitParameters().getChiProb() + "; strip = " + fitSL1.getRawTrackerHit().getCellID());
}
if (fit.getRawTrackerHit().getLayerNumber() == layer + 1) {
hasFitHitSL2 = true;
fitSL2 = fit;
-// System.out.println("Found a hit in SL2 with t0 = " + fitSL2.getT0() + "; amp = " + fitSL2.getAmp() + "; chi^2 = " + fitSL2.getShapeFitParameters().getChiProb() + "; strip = " + fitSL2.getRawTrackerHit().getCellID());
+// LOGGER.info("Found a hit in SL2 with t0 = " + fitSL2.getT0() + "; amp = " + fitSL2.getAmp() + "; chi^2 = " + fitSL2.getShapeFitParameters().getChiProb() + "; strip = " + fitSL2.getRawTrackerHit().getCellID());
}
}
// if (!hasFitHitSL1)
-// System.out.println("MISSING a hit in SL1!!!");
+// LOGGER.info("MISSING a hit in SL1!!!");
// if (!hasFitHitSL2)
-// System.out.println("MISSING a hit in SL2!!!");
+// LOGGER.info("MISSING a hit in SL2!!!");
return false;
}
Modified: java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/TrackingMonitoring.java
=============================================================================
--- java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/TrackingMonitoring.java (original)
+++ java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/TrackingMonitoring.java Wed Oct 7 19:47:33 2015
@@ -8,9 +8,12 @@
import hep.physics.vec.BasicHep3Matrix;
import hep.physics.vec.Hep3Vector;
import hep.physics.vec.VecOp;
+
import java.util.Collection;
import java.util.List;
import java.util.Map;
+import java.util.logging.Logger;
+
import org.hps.recon.tracking.CoordinateTransformations;
import org.hps.recon.tracking.TrackUtils;
import org.lcsim.detector.tracker.silicon.HpsSiSensor;
@@ -33,6 +36,8 @@
// TODO: Add some quantities for DQM monitoring: e.g. <tracks>, <hits/track>, etc
public class TrackingMonitoring extends DataQualityMonitor {
+ private static Logger LOGGER = Logger.getLogger(SvtMonitoring.class.getPackage().getName());
+
private String helicalTrackHitCollectionName = "HelicalTrackHits";
private final String rotatedTrackHitCollectionName = "RotatedHelicalTrackHits";
private final String helicalTrackHitRelationsCollectionName = "HelicalTrackHitRelations";
@@ -566,7 +571,7 @@
IHistogram1D hitTimeResidual = getSensorPlot(plotDir + trackCollectionName + "/" + triggerType + "/" + timeresidDir + "hitTimeResidual_", getNiceSensorName(sensor));
IFitResult result = fitGaussian(hitTimeResidual, fitter, "range=\"(-20.0,20.0)\"");
if (result != null) {
- System.out.format("%s\t%f\t%f\t%d\t%d\n", getNiceSensorName(sensor), result.fittedParameters()[1], result.fittedParameters()[2], sensor.getFebID(), sensor.getFebHybridID());
+ LOGGER.info(String.format("%s\t%f\t%f\t%d\t%d", getNiceSensorName(sensor), result.fittedParameters()[1], result.fittedParameters()[2], sensor.getFebID(), sensor.getFebHybridID()));
}
}
@@ -584,7 +589,7 @@
try {
ifr = fitter.fit(h1d, "g", init, range);
} catch (RuntimeException ex) {
- System.out.println(this.getClass().getSimpleName() + ": caught exception in fitGaussian");
+ LOGGER.info(this.getClass().getSimpleName() + ": caught exception in fitGaussian");
}
return ifr;
// double[] init = {20.0, 0.0, 1.0, 20, -1};
@@ -593,17 +598,16 @@
@Override
public void printDQMData() {
- System.out.println("ReconMonitoring::printDQMData");
+ LOGGER.info("ReconMonitoring::printDQMData");
for (Map.Entry<String, Double> entry : monitoredQuantityMap.entrySet()) {
- System.out.println(entry.getKey() + " = " + entry.getValue());
- }
- System.out.println("*******************************");
+ LOGGER.info(entry.getKey() + " = " + entry.getValue());
+ }
}
@Override
public void printDQMStrings() {
for (Map.Entry<String, Double> entry : monitoredQuantityMap.entrySet()) {
- System.out.println("ALTER TABLE dqm ADD " + entry.getKey() + " double;");
+ LOGGER.info("ALTER TABLE dqm ADD " + entry.getKey() + " double;");
}
}
Modified: java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/TrackingResiduals.java
=============================================================================
--- java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/TrackingResiduals.java (original)
+++ java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/TrackingResiduals.java Wed Oct 7 19:47:33 2015
@@ -7,12 +7,14 @@
import hep.aida.IHistogram1D;
import hep.aida.IPlotter;
import hep.aida.IPlotterStyle;
+
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
+
import org.hps.recon.tracking.gbl.GBLStripClusterData;
import org.lcsim.event.EventHeader;
import org.lcsim.event.GenericObject;
@@ -26,6 +28,8 @@
// TODO: Add some quantities for DQM monitoring:
public class TrackingResiduals extends DataQualityMonitor {
+ private static Logger LOGGER = Logger.getLogger(TrackingResiduals.class.getPackage().getName());
+
// Collection Names
String trackTimeDataCollectionName = "TrackTimeData";
String trackResidualsCollectionName = "TrackResiduals";
@@ -303,52 +307,52 @@
@Override
public void printDQMData() {
- System.out.println("TrackingResiduals::printDQMData");
+ LOGGER.info("TrackingResiduals::printDQMData");
for (Map.Entry<String, Double> entry : xposTopMeanResidMap.entrySet())
- System.out.println(entry.getKey() + " = " + entry.getValue());
+ LOGGER.info(entry.getKey() + " = " + entry.getValue());
for (Map.Entry<String, Double> entry : xposBotMeanResidMap.entrySet())
- System.out.println(entry.getKey() + " = " + entry.getValue());
+ LOGGER.info(entry.getKey() + " = " + entry.getValue());
for (Map.Entry<String, Double> entry : xposTopSigmaResidMap.entrySet())
- System.out.println(entry.getKey() + " = " + entry.getValue());
+ LOGGER.info(entry.getKey() + " = " + entry.getValue());
for (Map.Entry<String, Double> entry : xposBotSigmaResidMap.entrySet())
- System.out.println(entry.getKey() + " = " + entry.getValue());
+ LOGGER.info(entry.getKey() + " = " + entry.getValue());
for (Map.Entry<String, Double> entry : yposTopMeanResidMap.entrySet())
- System.out.println(entry.getKey() + " = " + entry.getValue());
+ LOGGER.info(entry.getKey() + " = " + entry.getValue());
for (Map.Entry<String, Double> entry : yposBotMeanResidMap.entrySet())
- System.out.println(entry.getKey() + " = " + entry.getValue());
+ LOGGER.info(entry.getKey() + " = " + entry.getValue());
for (Map.Entry<String, Double> entry : yposTopSigmaResidMap.entrySet())
- System.out.println(entry.getKey() + " = " + entry.getValue());
+ LOGGER.info(entry.getKey() + " = " + entry.getValue());
for (Map.Entry<String, Double> entry : yposBotSigmaResidMap.entrySet())
- System.out.println(entry.getKey() + " = " + entry.getValue());
+ LOGGER.info(entry.getKey() + " = " + entry.getValue());
for (Map.Entry<String, Double> entry : timeMeanResidMap.entrySet())
- System.out.println(entry.getKey() + " = " + entry.getValue());
+ LOGGER.info(entry.getKey() + " = " + entry.getValue());
for (Map.Entry<String, Double> entry : timeSigmaResidMap.entrySet())
- System.out.println(entry.getKey() + " = " + entry.getValue());
- System.out.println("*******************************");
+ LOGGER.info(entry.getKey() + " = " + entry.getValue());
+ LOGGER.info("*******************************");
}
@Override
public void printDQMStrings() {
for (Map.Entry<String, Double> entry : xposTopMeanResidMap.entrySet())
- System.out.println("ALTER TABLE dqm ADD " + entry.getKey() + " double;");
+ LOGGER.info("ALTER TABLE dqm ADD " + entry.getKey() + " double;");
for (Map.Entry<String, Double> entry : xposBotMeanResidMap.entrySet())
- System.out.println("ALTER TABLE dqm ADD " + entry.getKey() + " double;");
+ LOGGER.info("ALTER TABLE dqm ADD " + entry.getKey() + " double;");
for (Map.Entry<String, Double> entry : xposTopSigmaResidMap.entrySet())
- System.out.println("ALTER TABLE dqm ADD " + entry.getKey() + " double;");
+ LOGGER.info("ALTER TABLE dqm ADD " + entry.getKey() + " double;");
for (Map.Entry<String, Double> entry : xposBotSigmaResidMap.entrySet())
- System.out.println("ALTER TABLE dqm ADD " + entry.getKey() + " double;");
+ LOGGER.info("ALTER TABLE dqm ADD " + entry.getKey() + " double;");
for (Map.Entry<String, Double> entry : yposTopMeanResidMap.entrySet())
- System.out.println("ALTER TABLE dqm ADD " + entry.getKey() + " double;");
+ LOGGER.info("ALTER TABLE dqm ADD " + entry.getKey() + " double;");
for (Map.Entry<String, Double> entry : yposBotMeanResidMap.entrySet())
- System.out.println("ALTER TABLE dqm ADD " + entry.getKey() + " double;");
+ LOGGER.info("ALTER TABLE dqm ADD " + entry.getKey() + " double;");
for (Map.Entry<String, Double> entry : yposTopSigmaResidMap.entrySet())
- System.out.println("ALTER TABLE dqm ADD " + entry.getKey() + " double;");
+ LOGGER.info("ALTER TABLE dqm ADD " + entry.getKey() + " double;");
for (Map.Entry<String, Double> entry : yposBotSigmaResidMap.entrySet())
- System.out.println("ALTER TABLE dqm ADD " + entry.getKey() + " double;");
+ LOGGER.info("ALTER TABLE dqm ADD " + entry.getKey() + " double;");
for (Map.Entry<String, Double> entry : timeMeanResidMap.entrySet())
- System.out.println("ALTER TABLE dqm ADD " + entry.getKey() + " double;");
+ LOGGER.info("ALTER TABLE dqm ADD " + entry.getKey() + " double;");
for (Map.Entry<String, Double> entry : timeSigmaResidMap.entrySet())
- System.out.println("ALTER TABLE dqm ADD " + entry.getKey() + " double;");
+ LOGGER.info("ALTER TABLE dqm ADD " + entry.getKey() + " double;");
}
private void resetOccupancyMap() {
@@ -385,7 +389,7 @@
try {
ifr = fitter.fit(h1d, "g", init, range);
} catch (RuntimeException ex) {
- System.out.println(this.getClass().getSimpleName() + ": caught exception in fitGaussian");
+ LOGGER.info(this.getClass().getSimpleName() + ": caught exception in fitGaussian");
}
return ifr;
// double[] init = {20.0, 0.0, 1.0, 20, -1};
Modified: java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/TridentMonitoring.java
=============================================================================
--- java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/TridentMonitoring.java (original)
+++ java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/TridentMonitoring.java Wed Oct 7 19:47:33 2015
@@ -9,9 +9,12 @@
import hep.physics.vec.BasicHep3Matrix;
import hep.physics.vec.Hep3Vector;
import hep.physics.vec.VecOp;
+
import java.util.ArrayList;
import java.util.List;
import java.util.Map.Entry;
+import java.util.logging.Logger;
+
import org.hps.recon.ecal.cluster.ClusterUtilities;
import org.hps.recon.particle.ReconParticleDriver;
import org.hps.recon.tracking.TrackType;
@@ -33,6 +36,8 @@
*/
public class TridentMonitoring extends DataQualityMonitor {
+ private static Logger LOGGER = Logger.getLogger(TridentMonitoring.class.getPackage().getName());
+
private double ebeam = 1.05;
private final BasicHep3Matrix beamAxisRotation = new BasicHep3Matrix();
private static final int nCuts = 9;
@@ -217,7 +222,7 @@
@Override
protected void detectorChanged(Detector detector) {
- System.out.println("TridendMonitoring::detectorChanged Setting up the plotter");
+ LOGGER.info("TridendMonitoring::detectorChanged Setting up the plotter");
beamAxisRotation.setActiveEuler(Math.PI / 2, -0.0305, -Math.PI / 2);
aida.tree().cd("/");
@@ -759,7 +764,8 @@
}
@Override
- public void printDQMData() {
+ // TODO: Change from System.out to use logger instead.
+ public void printDQMData() {
System.out.println("TridendMonitoring::printDQMData");
for (Entry<String, Double> entry : monitoredQuantityMap.entrySet()) {
System.out.println(entry.getKey() + " = " + entry.getValue());
@@ -770,7 +776,7 @@
System.out.println("\t\t\tTridend Selection Summary");
System.out.println("******************************************************************************************");
- System.out.format("Number of V0:\t%8.0f\t%8.6f\t%8.6f\t%8.6f\n", nRecoV0, nRecoV0 / nRecoV0, nRecoV0 / nRecoV0, nRecoV0 / nEvents);
+ System.out.println(String.format("Number of V0:\t%8.0f\t%8.6f\t%8.6f\t%8.6f\n", nRecoV0, nRecoV0 / nRecoV0, nRecoV0 / nRecoV0, nRecoV0 / nEvents));
for (int i = 0; i < nCuts; i++) {
if (i == firstVertexingCut) {
@@ -799,7 +805,7 @@
public void printDQMStrings() {
for (int i = 0; i < 9; i++)//TODO: do this in a smarter way...loop over the map
{
- System.out.println("ALTER TABLE dqm ADD " + fpQuantNames[i] + " double;");
+ LOGGER.info("ALTER TABLE dqm ADD " + fpQuantNames[i] + " double;");
}
}
Modified: java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/V0Monitoring.java
=============================================================================
--- java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/V0Monitoring.java (original)
+++ java/trunk/analysis/src/main/java/org/hps/analysis/dataquality/V0Monitoring.java Wed Oct 7 19:47:33 2015
@@ -11,12 +11,14 @@
import hep.physics.vec.Hep3Vector;
import hep.physics.vec.BasicHep3Matrix;
import hep.physics.vec.VecOp;
+
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map.Entry;
import java.util.logging.Level;
import java.util.logging.Logger;
+
import org.hps.recon.tracking.TrackType;
import org.hps.recon.tracking.TrackUtils;
import org.hps.recon.vertexing.BilliorTrack;
@@ -39,6 +41,8 @@
*/
public class V0Monitoring extends DataQualityMonitor {
+ private static Logger LOGGER = Logger.getLogger(V0Monitoring.class.getPackage().getName());
+
String finalStateParticlesColName = "FinalStateParticles";
String unconstrainedV0CandidatesColName = "UnconstrainedV0Candidates";
String beamConV0CandidatesColName = "BeamspotConstrainedV0Candidates";
@@ -156,7 +160,7 @@
protected void detectorChanged(Detector detector) {
beamAxisRotation.setActiveEuler(Math.PI / 2, -0.0305, -Math.PI / 2);
- System.out.println("V0Monitoring::detectorChanged Setting up the plotter");
+ LOGGER.info("Setting up the plotter");
aida.tree().cd("/");
String xtra = "Extras";
String trkType = "SeedTrack/";
@@ -381,7 +385,7 @@
}
List<ReconstructedParticle> finalStateParticles = event.get(ReconstructedParticle.class, finalStateParticlesColName);
if (debug)
- System.out.println("This events has " + finalStateParticles.size() + " final state particles");
+ LOGGER.info("This events has " + finalStateParticles.size() + " final state particles");
ReconstructedParticle ele1 = null;
ReconstructedParticle ele2 = null;
@@ -391,7 +395,7 @@
if (isGBL != TrackType.isGBL(fsPart.getType()))
continue;
if (debug)
- System.out.println("PDGID = " + fsPart.getParticleIDUsed() + "; charge = " + fsPart.getCharge() + "; pz = " + fsPart.getMomentum().x());
+ LOGGER.info("PDGID = " + fsPart.getParticleIDUsed() + "; charge = " + fsPart.getCharge() + "; pz = " + fsPart.getMomentum().x());
double charge = fsPart.getCharge();
sumCharge += charge;
if (charge != 0) {
@@ -410,8 +414,8 @@
Hep3Vector p1 = VecOp.mult(beamAxisRotation, ele1.getMomentum());
Hep3Vector p2 = VecOp.mult(beamAxisRotation, ele2.getMomentum());
// Hep3Vector beamAxis = new BasicHep3Vector(Math.sin(0.0305), 0, Math.cos(0.0305));
-// System.out.println(p1);
-// System.out.println(VecOp.mult(rot, p1));
+// LOGGER.info(p1);
+// LOGGER.info(VecOp.mult(rot, p1));
double theta1 = Math.acos(p1.z() / p1.magnitude());
double theta2 = Math.acos(p2.z() / p2.magnitude());
@@ -447,7 +451,7 @@
BilliorTrack btEle1 = new BilliorTrack(stEle1.getSeedCandidate().getHelix());
BilliorTrack btEle2 = new BilliorTrack(stEle2.getSeedCandidate().getHelix());
BilliorVertex bv = fitVertex(btEle1, btEle2);
-// System.out.println("ee vertex: "+bv.toString());
+// LOGGER.info("ee vertex: "+bv.toString());
mollerMass.fill(bv.getParameters().get("invMass"));
mollerVx.fill(bv.getPosition().x());
mollerVy.fill(bv.getPosition().y());
@@ -470,10 +474,10 @@
@Override
public void printDQMData() {
- System.out.println("V0Monitoring::printDQMData");
+ LOGGER.info("V0Monitoring::printDQMData");
for (Entry<String, Double> entry : monitoredQuantityMap.entrySet())
- System.out.println(entry.getKey() + " = " + entry.getValue());
- System.out.println("*******************************");
+ LOGGER.info(entry.getKey() + " = " + entry.getValue());
+ LOGGER.info("*******************************");
}
/**
@@ -498,7 +502,7 @@
double[] parsVz = resVz.fittedParameters();
for (int i = 0; i < 5; i++)
- System.out.println("Vertex Fit Parameters: " + resVx.fittedParameterNames()[i] + " = " + parsVx[i] + "; " + parsVy[i] + "; " + parsVz[i]);
+ LOGGER.info("Vertex Fit Parameters: " + resVx.fittedParameterNames()[i] + " = " + parsVx[i] + "; " + parsVy[i] + "; " + parsVz[i]);
IPlotter plotter = analysisFactory.createPlotterFactory().create("Vertex Position");
plotter.createRegions(1, 3);
@@ -538,7 +542,7 @@
@Override
public void printDQMStrings() {
for (int i = 0; i < 9; i++)//TODO: do this in a smarter way...loop over the map
- System.out.println("ALTER TABLE dqm ADD " + fpQuantNames[i] + " double;");
+ LOGGER.info("ALTER TABLE dqm ADD " + fpQuantNames[i] + " double;");
}
IFitResult fitVertexPosition(IHistogram1D h1d, IFitter fitter, double[] init, String range
@@ -547,7 +551,7 @@
try {
ifr = fitter.fit(h1d, "g+p1", init, range);
} catch (RuntimeException ex) {
- System.out.println(this.getClass().getSimpleName() + ": caught exception in fitGaussian");
+ LOGGER.info(this.getClass().getSimpleName() + ": caught exception in fitGaussian");
}
return ifr;
}
|