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  October 2015

HPS-SVN October 2015

Subject:

r3885 - /java/trunk/users/src/main/java/org/hps/users/kmccarty/TriggerProcessAnalysisDriver.java

From:

[log in to unmask]

Reply-To:

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

Date:

Fri, 23 Oct 2015 04:33:17 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (205 lines)

Author: [log in to unmask]
Date: Thu Oct 22 21:33:15 2015
New Revision: 3885

Log:
Added new cuts to pair process analysis driver to try and reduce background.

Modified:
    java/trunk/users/src/main/java/org/hps/users/kmccarty/TriggerProcessAnalysisDriver.java

Modified: java/trunk/users/src/main/java/org/hps/users/kmccarty/TriggerProcessAnalysisDriver.java
 =============================================================================
--- java/trunk/users/src/main/java/org/hps/users/kmccarty/TriggerProcessAnalysisDriver.java	(original)
+++ java/trunk/users/src/main/java/org/hps/users/kmccarty/TriggerProcessAnalysisDriver.java	Thu Oct 22 21:33:15 2015
@@ -21,14 +21,18 @@
 import org.lcsim.util.aida.AIDA;
 
 public class TriggerProcessAnalysisDriver extends Driver {
-	private boolean checkSVT = false;
 	private int eventsProcessed = 0;
 	private int møllersProcessed = 0;
+	private boolean checkSVT = false;
 	private int tridentsProcessed = 0;
 	private int gblMøllersProcessed = 0;
 	private int gblTridentsProcessed = 0;
 	private double timeCoincidence = 2.5;
+	private double elasticThreshold = 0.800;
+	private double møllerLowerRange = 0.900;
+	private double møllerUpperRange = 1.200;
 	private AIDA aida = AIDA.defaultInstance();
+	private boolean checkTriggerTimeWindow = false;
 	private String clusterCollectionName = "EcalClustersCorr";
 	private String particleCollectionName = "FinalStateParticles";
 	
@@ -281,6 +285,10 @@
 	
 	public void setCheckSVT(boolean state) {
 		checkSVT = state;
+	}
+	
+	public void setCheckTriggerTimeWindow(boolean state) {
+		checkTriggerTimeWindow = state;
 	}
 	
 	/**
@@ -448,10 +456,10 @@
 				continue tridentTrackLoop;
 			}
 			
-			// Require that the negative track have less than 900 MeV
-			// momentum to exclude elastic electrons.
-			if(pair[0].getCharge() < 0 && pair[0].getMomentum().magnitude() > 0.900
-					|| pair[1].getCharge() < 0 && pair[1].getMomentum().magnitude() > 0.900) {
+			// Require that the negative track have less than the
+			// elastic threshold momentum to exclude elastic electrons.
+			if(pair[0].getCharge() < 0 && pair[0].getMomentum().magnitude() > elasticThreshold
+					|| pair[1].getCharge() < 0 && pair[1].getMomentum().magnitude() > elasticThreshold) {
 				continue tridentTrackLoop;
 			}
 			
@@ -505,15 +513,32 @@
 			}
 			
 			// The clusters must within a limited time window.
+			/*
 			Cluster[] trackClusters = { pair[0].getClusters().get(0), pair[1].getClusters().get(0) };
 			if(TriggerModule.getValueTimeCoincidence(trackClusters) > timeCoincidence) {
 				continue tridentLoop;
 			}
+			*/
+			
+			// The clusters must be coincidental within an energy
+			// dependent coincidence window.
+			Cluster[] trackClusters = { pair[0].getClusters().get(0), pair[1].getClusters().get(0) };
+			if(!isCoincidental(trackClusters)) {
+				continue tridentLoop;
+			}
 			
 			// Require that the electron in the pair have an energy
-			// below 900 MeV to exclude elastic electrons.
-			if(electron.getMomentum().magnitude() >= 0.900) {
+			// below the elastic threshold to exclude elastic electrons.
+			if(electron.getMomentum().magnitude() >= elasticThreshold) {
 				continue tridentLoop;
+			}
+			
+			// Require that all clusters occur within the trigger time
+			// window to exclude accidentals.
+			if(checkTriggerTimeWindow) {
+				if(!inTriggerWindow(trackClusters[0]) || !inTriggerWindow(trackClusters[1])) {
+					continue tridentLoop;
+				}
 			}
 			
 			// If all the above conditions are met, the pair is to be
@@ -553,15 +578,15 @@
 			}
 			
 			// Require that the electrons in the pair have energies
-			// below 900 MeV to exclude elastic electrons.
-			if(pair[0].getMomentum().magnitude() > 0.900 || pair[1].getMomentum().magnitude() > 0.900) {
+			// below the elastic threshold to exclude said electrons.
+			if(pair[0].getMomentum().magnitude() > elasticThreshold || pair[1].getMomentum().magnitude() > elasticThreshold) {
 				continue møllerLoop;
 			}
 			
 			// Require that the energy of the pair be within a range
 			// that is sufficiently "Møller-like."
 			double momentumSum = VecOp.add(pair[0].getMomentum(), pair[1].getMomentum()).magnitude();
-			if(momentumSum < 0.800 || momentumSum > 1.500) {
+			if(momentumSum < møllerLowerRange || momentumSum > møllerUpperRange) {
 				continue møllerLoop;
 			}
 			
@@ -605,22 +630,39 @@
 			}
 			
 			// The clusters must within a limited time window.
+			/*
 			Cluster[] trackClusters = { pair[0].getClusters().get(0), pair[1].getClusters().get(0) };
 			if(TriggerModule.getValueTimeCoincidence(trackClusters) > timeCoincidence) {
 				continue møllerLoop;
 			}
+			*/
+			
+			// The clusters must be coincidental within an energy
+			// dependent coincidence window.
+			Cluster[] trackClusters = { pair[0].getClusters().get(0), pair[1].getClusters().get(0) };
+			if(!isCoincidental(trackClusters)) {
+				continue møllerLoop;
+			}
 			
 			// Require that the electrons in the pair have energies
-			// below 900 MeV to exclude elastic electrons.
-			if(pair[0].getMomentum().magnitude() > 0.900 || pair[1].getMomentum().magnitude() > 0.900) {
+			// below the elastic threshold to exclude said electrons.
+			if(pair[0].getMomentum().magnitude() > elasticThreshold || pair[1].getMomentum().magnitude() > elasticThreshold) {
 				continue møllerLoop;
 			}
 			
 			// Require that the energy of the pair be within a range
 			// that is sufficiently "Møller-like."
 			double momentumSum = VecOp.add(pair[0].getMomentum(), pair[1].getMomentum()).magnitude();
-			if(momentumSum < 0.800 || momentumSum > 1.500) {
-				continue møllerLoop;
+			if(momentumSum < møllerLowerRange || momentumSum > møllerUpperRange) {
+				continue møllerLoop;
+			}
+			
+			// Require that all clusters occur within the trigger time
+			// window to exclude accidentals.
+			if(checkTriggerTimeWindow) {
+				if(!inTriggerWindow(trackClusters[0]) || !inTriggerWindow(trackClusters[1])) {
+					continue møllerLoop;
+				}
 			}
 			
 			// If all the above conditions are met, the pair is to be
@@ -704,5 +746,43 @@
 	private static final double getCalculatedCoplanarity(Track[] pair) {
 		return getCalculatedCoplanarity(TrackUtils.getTrackPositionAtEcal(pair[0]).v(), TrackUtils.getTrackPositionAtEcal(pair[1]).v());
 	}
-}
-// [log in to unmask]
+	
+	private static final boolean inTriggerWindow(Cluster cluster) {
+		// Get the cluster time.
+		double clusterTime = TriggerModule.getClusterTime(cluster);
+		
+		// Check that it is within the allowed bounds.
+		return (35 <= clusterTime && clusterTime <= 50);
+	}
+	
+	private static final boolean isCoincidental(Cluster[] pair) {
+		// Get the energy sum and the time coincidence.
+		double energySum = pair[0].getEnergy() + pair[1].getEnergy();
+		double timeCoincidence = TriggerModule.getValueTimeCoincidence(pair);
+		
+		// Get the upper and lower bounds of the allowed range.
+		double mean = getTimeDependenceMean(energySum);
+		double threeSigma = 3.0 * getTimeDependenceSigma(energySum);
+		double lowerBound = mean - threeSigma;
+		double upperBound = mean + threeSigma;
+		
+		// Perform the time coincidence check.
+		return (lowerBound <= timeCoincidence && timeCoincidence <= upperBound);
+	}
+	
+	private static final double getTimeDependenceMean(double energySum) {
+		// Define the fit parameters.
+		double[] param = { 0.289337, -2.81998, 9.03475, -12.93, 8.71476, -2.26969 };
+		
+		// Calculate the mean.
+		return param[0] + energySum * (param[1] + energySum * (param[2] + energySum * (param[3] + energySum * (param[4] + energySum * (param[5])))));
+	}
+	
+	private static final double getTimeDependenceSigma(double energySum) {
+		// Define the fit parameters.
+		double[] param = { 4.3987, -24.2371, 68.9567, -98.2586, 67.562, -17.8987 };
+		
+		// Calculate the standard deviation.
+		return param[0] + energySum * (param[1] + energySum * (param[2] + energySum * (param[3] + energySum * (param[4] + energySum * (param[5])))));
+	}
+}

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