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  November 2016

HPS-SVN November 2016

Subject:

r4565 - in /java/trunk/analysis/src/main/java/org/hps/analysis/wab: ./ StripMcWabConversionDriver.java

From:

[log in to unmask]

Reply-To:

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

Date:

Wed, 9 Nov 2016 18:05:06 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (70 lines)

Author: [log in to unmask]
Date: Wed Nov  9 10:05:02 2016
New Revision: 4565

Log:
Driver to strip MC WAB conversions in the tracker

Added:
    java/trunk/analysis/src/main/java/org/hps/analysis/wab/
    java/trunk/analysis/src/main/java/org/hps/analysis/wab/StripMcWabConversionDriver.java

Added: java/trunk/analysis/src/main/java/org/hps/analysis/wab/StripMcWabConversionDriver.java
 =============================================================================
--- java/trunk/analysis/src/main/java/org/hps/analysis/wab/StripMcWabConversionDriver.java	(added)
+++ java/trunk/analysis/src/main/java/org/hps/analysis/wab/StripMcWabConversionDriver.java	Wed Nov  9 10:05:02 2016
@@ -0,0 +1,53 @@
+package org.hps.analysis.wab;
+
+import java.util.List;
+import org.lcsim.event.EventHeader;
+import org.lcsim.event.MCParticle;
+import org.lcsim.event.MCParticle.SimulatorStatus;
+import org.lcsim.util.Driver;
+
+/**
+ * Driver to select events in which the bremsstrahlung photon has converted in
+ * the tracker. Input files should be WAB events, i.e. events with just the
+ * incoming electron as particle 0 and the photon as particle 1
+ *
+ * @author Norman A Graf
+ *
+ * @version $Id:
+ */
+public class StripMcWabConversionDriver extends Driver
+{
+
+    private int _numberOfEventsWritten = 0;
+    private int _numberOfEventsRead = 0;
+
+    protected void process(EventHeader event)
+    {
+        _numberOfEventsRead++;
+        boolean skipEvent = true;
+        List<MCParticle> mclist = event.getMCParticles();
+        //
+        // HPS Wide angle bremsstrahlung events list the electron first, followed by the bremsstrahlung photon.
+        // If that changes, so will the next line.
+        // TODO add some selection code here to recognize MC WAB events in mixed files.
+        // assert that particle 0 is electron, particle 1 is photon
+        // assert that sum of particle 0 and 1 has the beam energy and is directed along the beam direction
+        //
+        MCParticle brem = mclist.get(1);
+        SimulatorStatus stat = brem.getSimulatorStatus();
+        // select events in which the photon converted in the tracker
+        if (stat.isDecayedInTracker()) {
+            skipEvent = false;
+        }
+        if (skipEvent) {
+            throw new Driver.NextEventException();
+        } else {
+            _numberOfEventsWritten++;
+        }
+    }
+
+    protected void endOfData()
+    {
+        System.out.println("Wrote " + _numberOfEventsWritten + " events of " + _numberOfEventsRead + " read.");
+    }
+}

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