LISTSERV mailing list manager LISTSERV 16.5

Help for HPS-SVN Archives


HPS-SVN Archives

HPS-SVN Archives


HPS-SVN@LISTSERV.SLAC.STANFORD.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

HPS-SVN Home

HPS-SVN Home

HPS-SVN  January 2016

HPS-SVN January 2016

Subject:

r4125 - in /java/branches/gbl-standalone-branch: ./ analysis/src/main/java/org/hps/analysis/dataquality/ detector-data/detectors/HPS-EngRun2015-Nominal-v4-4-fieldmap/ detector-data/detectors/HPS-EngRun2015-Nominal-v5-fieldmap/ users/src/main/java/org/hps/users/meeg/

From:

[log in to unmask]

Reply-To:

Notification of commits to the hps svn repository <[log in to unmask]>

Date:

Thu, 14 Jan 2016 18:30:26 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (318 lines)

Author: [log in to unmask]
Date: Thu Jan 14 10:30:18 2016
New Revision: 4125

Log:
merge with trunk

Added:
    java/branches/gbl-standalone-branch/detector-data/detectors/HPS-EngRun2015-Nominal-v5-fieldmap/
      - copied from r4124, java/trunk/detector-data/detectors/HPS-EngRun2015-Nominal-v5-fieldmap/
Modified:
    java/branches/gbl-standalone-branch/   (props changed)
    java/branches/gbl-standalone-branch/analysis/src/main/java/org/hps/analysis/dataquality/TridentMonitoring.java
    java/branches/gbl-standalone-branch/detector-data/detectors/HPS-EngRun2015-Nominal-v4-4-fieldmap/HPS-EngRun2015-Nominal-v4-4-fieldmap.lcdd
    java/branches/gbl-standalone-branch/users/src/main/java/org/hps/users/meeg/SvtChargeIntegrator.java

Modified: java/branches/gbl-standalone-branch/analysis/src/main/java/org/hps/analysis/dataquality/TridentMonitoring.java
 =============================================================================
--- java/branches/gbl-standalone-branch/analysis/src/main/java/org/hps/analysis/dataquality/TridentMonitoring.java	(original)
+++ java/branches/gbl-standalone-branch/analysis/src/main/java/org/hps/analysis/dataquality/TridentMonitoring.java	Thu Jan 14 10:30:18 2016
@@ -9,17 +9,18 @@
 import hep.physics.vec.BasicHep3Matrix;
 import hep.physics.vec.Hep3Vector;
 import hep.physics.vec.VecOp;
-
 import java.util.ArrayList;
 import java.util.EnumSet;
 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;
 import org.hps.recon.tracking.TrackUtils;
+import org.hps.recon.vertexing.BilliorTrack;
+import org.hps.recon.vertexing.BilliorVertex;
+import org.hps.recon.vertexing.BilliorVertexer;
 import org.lcsim.event.EventHeader;
 import org.lcsim.event.ReconstructedParticle;
 import org.lcsim.event.RelationalTable;
@@ -155,10 +156,10 @@
     private IHistogram1D vertMass;
     private IHistogram2D vertZVsMass;
 //    private IHistogram1D vertX;
-//    private IHistogram1D vertY;
+    private IHistogram1D vertY;
 //    private IHistogram1D vertZ;
-//    private IHistogram2D vertZY;
-//    private IHistogram2D vertXY;
+    private IHistogram2D vertZY;
+    private IHistogram2D vertXY;
 //    private IHistogram1D vertPx;
 //    private IHistogram1D vertPy;
 //    private IHistogram1D vertPz;
@@ -189,6 +190,8 @@
     private IHistogram1D vertRadU;
     private IHistogram1D vertRadV;
 
+    private IHistogram2D vertRadUnconBsconChi2;
+
     private IHistogram1D nTriCand;
     private IHistogram1D nVtxCand;
 //    IHistogram1D vertexW;
@@ -224,15 +227,25 @@
     private final double maxChi2GBLTrack = 15.0;
     private final double maxVertChi2 = 7.0;
 
-    //v0 cuts   
+    //v0 plot ranges
     private final double v0PzMax = 1.25 * ebeam;//GeV 
     private final double v0PzMin = 0.1;// GeV
     private final double v0PyMax = 0.04;//GeV absolute value
     private final double v0PxMax = 0.04;//GeV absolute value
     private final double v0VzMax = 50.0;// mm from target...someday make mass dependent
-    private final double v0VyMax = 1.0;// mm from target...someday make mass dependent
+    private final double v0VyMax = 2.0;// mm from target...someday make mass dependent
     private final double v0VxMax = 2.0;// mm from target...someday make mass dependent
-    //  track quality cuts
+
+    //v0 cuts
+    private final double v0PzMaxCut = 1.25 * ebeam;//GeV 
+    private final double v0PzMinCut = 0.1;// GeV
+    private final double v0PyCut = 0.04;//GeV absolute value
+    private final double v0PxCut = 0.04;//GeV absolute value
+    private final double v0VzCut = 50.0;// mm from target...someday make mass dependent
+    private final double v0VyCut = 2.0;// mm from target...someday make mass dependent
+    private final double v0VxCut = 2.0;// mm from target...someday make mass dependent
+    
+//  track quality cuts
     private final double beamPCut = 0.85;
     private final double minPCut = 0.05;
 //    private double trkPyMax = 0.2;
@@ -242,12 +255,14 @@
     private final double clusterTimeDiffCut = 2.5;
 
     private final double l1IsoMin = 1.0;
+
+    private double[] beamSize = {0.001, 0.130, 0.050}; //rough estimate from harp scans during engineering run production running
+
 //cluster matching
 //    private boolean reqCluster = false;
 //    private int nClustMax = 3;
 //    private double eneLossFactor = 0.7; //average E/p roughly
 //    private double eneOverPCut = 0.3; //|(E/p)_meas - (E/p)_mean|<eneOverPCut
-
 //counters
     private float nEvents = 0;
     private float nRecoV0 = 0;
@@ -346,10 +361,10 @@
         vertMass = aida.histogram1D(plotDir + trkType + triggerType + "/" + "Vertex: Vertex mass", 100, 0, 0.11);
         vertZVsMass = aida.histogram2D(plotDir + trkType + triggerType + "/" + "Vertex: Vertex Z vs. mass", 100, 0, 0.11, 100, -v0VzMax, v0VzMax);
 //        vertX = aida.histogram1D(plotDir + trkType + triggerType + "/" + "Vertex: Vertex X", 100, -v0VxMax, v0VxMax);
-//        vertY = aida.histogram1D(plotDir + trkType + triggerType + "/" + "Vertex: Vertex Y", 100, -v0VyMax, v0VyMax);
+        vertY = aida.histogram1D(plotDir + trkType + triggerType + "/" + "Vertex: Vertex Y", 100, -v0VyMax, v0VyMax);
 //        vertZ = aida.histogram1D(plotDir + trkType + triggerType + "/" + "Vertex: Vertex Z", 100, -v0VzMax, v0VzMax);
-//        vertXY = aida.histogram2D(plotDir + trkType + triggerType + "/" + "Vertex: Vertex Y vs. X", 100, -v0VxMax, v0VxMax, 100, -v0VyMax, v0VyMax);
-//        vertZY = aida.histogram2D(plotDir + trkType + triggerType + "/" + "Vertex: Vertex Z vs. Y", 100, -v0VyMax, v0VyMax, 100, -v0VzMax, v0VzMax);
+        vertXY = aida.histogram2D(plotDir + trkType + triggerType + "/" + "Vertex: Vertex Y vs. X", 100, -v0VxMax, v0VxMax, 100, -v0VyMax, v0VyMax);
+        vertZY = aida.histogram2D(plotDir + trkType + triggerType + "/" + "Vertex: Vertex Z vs. Y", 100, -v0VyMax, v0VyMax, 100, -v0VzMax, v0VzMax);
 //        vertPx = aida.histogram1D(plotDir + trkType + triggerType + "/" + "Vertex: Vertex Px", 100, -v0PxMax, v0PxMax);
 //        vertPy = aida.histogram1D(plotDir + trkType + triggerType + "/" + "Vertex: Vertex Py", 100, -v0PyMax, v0PyMax);
 //        vertPz = aida.histogram1D(plotDir + trkType + triggerType + "/" + "Vertex: Vertex Pz", 100, v0PzMin, v0PzMax);
@@ -382,6 +397,8 @@
         vertRadU = aida.histogram1D(plotDir + trkType + triggerType + "/" + "Radiative vertex: Vertex Px over Ptot", 100, -0.1, 0.1);
         vertRadV = aida.histogram1D(plotDir + trkType + triggerType + "/" + "Radiative vertex: Vertex Py over Ptot", 100, -0.1, 0.1);
 
+        vertRadUnconBsconChi2 = aida.histogram2D(plotDir + trkType + triggerType + "/" + "Radiative vertex: beamspot chi2 vs. uncon chi2", 100, 0, 25.0, 100, 0, 25.0);
+
         nVtxCand = aida.histogram1D(plotDir + trkType + triggerType + "/" + "Number of Vertexing Candidates", 5, 0, 4);
 
         maxTrkChi2 = aida.histogram1D(plotDir + trkType + triggerType + "/" + "Cut: Trk Chi2", 50, 0.0, 50.0);
@@ -527,8 +544,8 @@
                 bits.add(Cut.VTX_QUALITY);
             }
 
-            boolean vertexMomentumCut = v0MomRot.z() < v0PzMax && v0MomRot.z() > v0PzMin && Math.abs(v0MomRot.x()) < v0PxMax && Math.abs(v0MomRot.y()) < v0PyMax;
-            boolean vertexPositionCut = Math.abs(v0Vtx.x()) < v0VxMax && Math.abs(v0Vtx.y()) < v0VyMax && Math.abs(v0Vtx.z()) < v0VzMax;
+            boolean vertexMomentumCut = v0MomRot.z() < v0PzMaxCut && v0MomRot.z() > v0PzMinCut && Math.abs(v0MomRot.x()) < v0PxCut && Math.abs(v0MomRot.y()) < v0PyCut;
+            boolean vertexPositionCut = Math.abs(v0Vtx.x()) < v0VxCut && Math.abs(v0Vtx.y()) < v0VyCut && Math.abs(v0Vtx.z()) < v0VzCut;
             if (vertexMomentumCut && vertexPositionCut) {
                 bits.add(Cut.VERTEX_CUTS);
             }
@@ -715,6 +732,7 @@
         if (!vertCandidateList.isEmpty()) {
             // pick the best candidate...for now just pick a random one. 
             ReconstructedParticle bestCandidate = vertCandidateList.get((int) (Math.random() * vertCandidateList.size()));
+            Vertex unconVertex = bestCandidate.getStartVertex();
 
             //fill some stuff: 
             ReconstructedParticle electron = bestCandidate.getParticles().get(ReconParticleDriver.ELECTRON);
@@ -728,7 +746,7 @@
             Hep3Vector pBestV0Rot = VecOp.mult(beamAxisRotation, bestCandidate.getMomentum());
             Hep3Vector pEleRot = VecOp.mult(beamAxisRotation, electron.getMomentum());
             Hep3Vector pPosRot = VecOp.mult(beamAxisRotation, positron.getMomentum());
-            Hep3Vector v0Vtx = VecOp.mult(beamAxisRotation, bestCandidate.getStartVertex().getPosition());
+            Hep3Vector v0Vtx = VecOp.mult(beamAxisRotation, unconVertex.getPosition());
 
 //            vertTrackTime2D.fill(tEle, tPos);
 //            vertTrackTimeDiff.fill(tEle - tPos);
@@ -744,16 +762,26 @@
             vertMass.fill(bestCandidate.getMass());
             vertZVsMass.fill(bestCandidate.getMass(), v0Vtx.z());
 //            vertX.fill(v0Vtx.x());
-//            vertY.fill(v0Vtx.y());
+            vertY.fill(v0Vtx.y());
 //            vertZ.fill(v0Vtx.z());
 //            vertPx.fill(pBestV0Rot.x());
 //            vertPy.fill(pBestV0Rot.y());
 //            vertPz.fill(pBestV0Rot.z());
 //            vertU.fill(pBestV0Rot.x() / pBestV0Rot.magnitude());
 //            vertV.fill(pBestV0Rot.y() / pBestV0Rot.magnitude());
-//            vertXY.fill(v0Vtx.x(), v0Vtx.y());
-//            vertZY.fill(v0Vtx.y(), v0Vtx.z());
+            vertXY.fill(v0Vtx.x(), v0Vtx.y());
+            vertZY.fill(v0Vtx.y(), v0Vtx.z());
             if (bestCandidate.getMomentum().magnitude() > radCut) {
+
+                BilliorVertexer vtxFitter = new BilliorVertexer(TrackUtils.getBField(event.getDetector()).y());
+                vtxFitter.setBeamSize(beamSize);
+                List<BilliorTrack> billiorTracks = new ArrayList<BilliorTrack>();
+                billiorTracks.add(new BilliorTrack(electron.getTracks().get(0)));
+                billiorTracks.add(new BilliorTrack(positron.getTracks().get(0)));
+                vtxFitter.doBeamSpotConstraint(true);
+                BilliorVertex bsconVertex = vtxFitter.fitVertex(billiorTracks);
+                vertRadUnconBsconChi2.fill(unconVertex.getChi2(), bsconVertex.getChi2());
+
                 vertRadTrackTime2D.fill(tEle, tPos);
                 vertRadTrackTimeDiff.fill(tEle - tPos);
                 vertRadZVsMomentum.fill(bestCandidate.getMomentum().magnitude(), v0Vtx.z());

Modified: java/branches/gbl-standalone-branch/detector-data/detectors/HPS-EngRun2015-Nominal-v4-4-fieldmap/HPS-EngRun2015-Nominal-v4-4-fieldmap.lcdd
 =============================================================================
--- java/branches/gbl-standalone-branch/detector-data/detectors/HPS-EngRun2015-Nominal-v4-4-fieldmap/HPS-EngRun2015-Nominal-v4-4-fieldmap.lcdd	(original)
+++ java/branches/gbl-standalone-branch/detector-data/detectors/HPS-EngRun2015-Nominal-v4-4-fieldmap/HPS-EngRun2015-Nominal-v4-4-fieldmap.lcdd	Thu Jan 14 10:30:18 2016
@@ -4,7 +4,7 @@
     <detector name="HPS-EngRun2015-Nominal-v4-4-fieldmap" />
     <generator name="GeomConverter" version="1.0" file="detectors/HPS-EngRun2015-Nominal-v4-4-fieldmap/compact.xml" checksum="546271450" />
     <author name="NONE" />
-    <comment>HPS detector for 2015 Engineering Run with tracker fully open this detector uses the corrected fieldmap scaled to -0.24T for 1.056 GeV running including SVT mechanical survey. The ECal top is shifted up 2.7 mm from nominal and the bottom is shifted down 0.9 mm from nominal. SVT alignment: 1) start from v3-2-fieldmap 2) beamspot BS_D: 3)BS_D-20k.gbl-5mradScatAngle-L01_L12_L23_L01_L12_L34_L45_L01_L12_tu</comment>
+    <comment>HPS detector for 2015 Engineering Run with tracker fully open this detector uses the corrected fieldmap scaled to -0.24T for 1.056 GeV running including SVT mechanical survey. The ECal top is shifted up 2.3 mm from nominal and the bottom is shifted down 2.4 mm from nominal, based only on tracking. SVT alignment: 1) start from v3-2-fieldmap 2) beamspot BS_D: 3)BS_D-20k.gbl-5mradScatAngle-L01_L12_L23_L01_L12_L34_L45_L01_L12_tu</comment>
   </header>
   <iddict>
     <idspec name="TrackerHitsFieldDef" length="46">

Modified: java/branches/gbl-standalone-branch/users/src/main/java/org/hps/users/meeg/SvtChargeIntegrator.java
 =============================================================================
--- java/branches/gbl-standalone-branch/users/src/main/java/org/hps/users/meeg/SvtChargeIntegrator.java	(original)
+++ java/branches/gbl-standalone-branch/users/src/main/java/org/hps/users/meeg/SvtChargeIntegrator.java	Thu Jan 14 10:30:18 2016
@@ -26,6 +26,7 @@
 import org.hps.conditions.svt.SvtBiasConstant.SvtBiasConstantCollection;
 import org.hps.conditions.svt.SvtMotorPosition;
 import org.hps.conditions.svt.SvtMotorPosition.SvtMotorPositionCollection;
+import org.hps.conditions.svt.SvtTimingConstants;
 import org.hps.run.database.RunManager;
 
 /**
@@ -35,9 +36,9 @@
 public class SvtChargeIntegrator {
 
     private static final double angleTolerance = 1e-4;
+    private static final double burstModeNoiseEfficiency = 0.965;
 
     /**
-     * Load SVT HV bias constants into the conditions database.
      *
      * @param args the command line arguments (requires a CSV run/file log file
      * and a MYA dump file.)
@@ -88,9 +89,9 @@
             String line;
             System.err.println("myaData header: " + br.readLine()); //discard the first line
             if (perRun) {
-                System.out.println("run_num\tnominal_position\tnEvents\ttotalQ\ttotalQ_withbias\ttotalQ_atnom\tgatedQ\tgatedQ_withbias\tgatedQ_atnom");
+                System.out.println("run_num\tnominal_position\tnEvents\ttotalQ\ttotalQ_withbias\ttotalQ_atnom\tgatedQ\tgatedQ_withbias\tgatedQ_atnom\tgoodQ\tgoodQ_withbias\tgoodQ_atnom");
             } else {
-                System.out.println("run_num\tfile_num\tnominal_position\tnEvents\ttotalQ\ttotalQ_withbias\ttotalQ_atnom\tgatedQ\tgatedQ_withbias\tgatedQ_atnom");
+                System.out.println("run_num\tfile_num\tnominal_position\tnEvents\ttotalQ\ttotalQ_withbias\ttotalQ_atnom\tgatedQ\tgatedQ_withbias\tgatedQ_atnom\tgoodQ\tgoodQ_withbias\tgoodQ_atnom");
             }
 
             int currentRun = 0;
@@ -98,6 +99,7 @@
             double nominalAngleBottom = -999;
             String nominalPosition = null;
             long tiTimeOffset = 0;
+            double efficiency = 0;
             SvtBiasConstantCollection svtBiasConstants = null;
             SvtMotorPositionCollection svtPositionConstants = null;
             SvtAlignmentConstant.SvtAlignmentConstantCollection alignmentConstants = null;
@@ -169,7 +171,20 @@
                         alignmentConstants = null;
                         nominalPosition = "unknown";
                     }
-
+                    efficiency = burstModeNoiseEfficiency;
+                    SvtTimingConstants svtTimingConstants;
+                    try {
+                        svtTimingConstants = DatabaseConditionsManager.getInstance().getCachedConditions(SvtTimingConstants.SvtTimingConstantsCollection.class, "svt_timing_constants").getCachedData().get(0);
+                    } catch (Exception ex) {
+                        svtTimingConstants = null;
+                    }
+                    if (svtTimingConstants != null) {
+                        if (svtTimingConstants.getOffsetTime() > 27) {
+                            efficiency *= 2.0 / 3.0; // bad latency: drop 2 out of 6 trigger phases
+                        }// otherwise, we have good latency
+                    } else {
+                        efficiency = 0;
+                    }//no latency info in conditions: give up
                     currentRun = runNum;
                 }
 
@@ -210,6 +225,9 @@
                 double totalGatedCharge = 0;
                 double totalGatedChargeWithBias = 0;
                 double totalGatedChargeWithBiasAtNominal = 0;
+                double totalGoodCharge = 0;
+                double totalGoodChargeWithBias = 0;
+                double totalGoodChargeWithBiasAtNominal = 0;
                 br.mark(1000);
 
                 while ((line = br.readLine()) != null) {
@@ -278,17 +296,18 @@
                                 positionDt = (positionEnd - positionStart) / 1000.0;
                             }
                         }
-                        double dq = dt * current; // nC
-                        double dqGated = dt * current * livetime; // nC
 //                        System.out.format("start %d end %d date %d lastDate %d current %f dt %f\n", startDate.getTime(), endDate.getTime(), date.getTime(), lastDate.getTime(), current, dt);
-                        totalCharge += dq;
-                        totalGatedCharge += dqGated;
+                        totalCharge += dt * current; // nC
+                        totalGatedCharge += dt * current * livetime;
+                        totalGoodCharge += dt * current * livetime * efficiency;
                         if (biasGood) {
                             totalChargeWithBias += biasDt * current;
                             totalGatedChargeWithBias += biasDt * current * livetime;
+                            totalGoodChargeWithBias += biasDt * current * livetime * efficiency;
                             if (positionGood) {
                                 totalChargeWithBiasAtNominal += positionDt * current;
                                 totalGatedChargeWithBiasAtNominal += positionDt * current * livetime;
+                                totalGoodChargeWithBiasAtNominal += positionDt * current * livetime * efficiency;
                             }
                         }
                     }
@@ -304,11 +323,11 @@
                 }
                 if (perRun) {
                     int nEvents = Integer.parseInt(record.get(9));
-                    System.out.format("%d\t%s\t%d\t%.3f\t%.3f\t%.3f\t%.3f\t%.3f\t%.3f\n", runNum, nominalPosition, nEvents, totalCharge, totalChargeWithBias, totalChargeWithBiasAtNominal, totalGatedCharge, totalGatedChargeWithBias, totalGatedChargeWithBiasAtNominal);
+                    System.out.format("%d\t%s\t%d\t%.3f\t%.3f\t%.3f\t%.3f\t%.3f\t%.3f\t%.3f\t%.3f\t%.3f\n", runNum, nominalPosition, nEvents, totalCharge, totalChargeWithBias, totalChargeWithBiasAtNominal, totalGatedCharge, totalGatedChargeWithBias, totalGatedChargeWithBiasAtNominal, totalGoodCharge, totalGoodChargeWithBias, totalGoodChargeWithBiasAtNominal);
                 } else {
                     int fileNum = Integer.parseInt(record.get(1));
                     int nEvents = Integer.parseInt(record.get(2));
-                    System.out.format("%d\t%d\t%s\t%d\t%.3f\t%.3f\t%.3f\t%.3f\t%.3f\t%.3f\n", runNum, fileNum, nominalPosition, nEvents, totalCharge, totalChargeWithBias, totalChargeWithBiasAtNominal, totalGatedCharge, totalGatedChargeWithBias, totalGatedChargeWithBiasAtNominal);
+                    System.out.format("%d\t%d\t%s\t%d\t%.3f\t%.3f\t%.3f\t%.3f\t%.3f\t%.3f\t%.3f\t%.3f\t%.3f\n", runNum, fileNum, nominalPosition, nEvents, totalCharge, totalChargeWithBias, totalChargeWithBiasAtNominal, totalGatedCharge, totalGatedChargeWithBias, totalGatedChargeWithBiasAtNominal, totalGoodCharge, totalGoodChargeWithBias, totalGoodChargeWithBiasAtNominal);
                 }
             }
         } catch (Exception ex) {

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

November 2017
August 2017
July 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013

ATOM RSS1 RSS2



LISTSERV.SLAC.STANFORD.EDU

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager

Privacy Notice, Security Notice and Terms of Use