LISTSERV mailing list manager LISTSERV 16.5

Help for LCDET-SVN Archives


LCDET-SVN Archives

LCDET-SVN Archives


LCDET-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

LCDET-SVN Home

LCDET-SVN Home

LCDET-SVN  March 2015

LCDET-SVN March 2015

Subject:

r3564 - /projects/lcsim/trunk/analysis/src/main/java/org/lcsim/analysis/StripIdrupEvent.java

From:

[log in to unmask]

Reply-To:

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

Date:

Mon, 2 Mar 2015 23:21:16 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (74 lines)

Author: [log in to unmask]
Date: Mon Mar  2 15:21:11 2015
New Revision: 3564

Log:
updates to add number of events to strip

Modified:
    projects/lcsim/trunk/analysis/src/main/java/org/lcsim/analysis/StripIdrupEvent.java   (contents, props changed)

Modified: projects/lcsim/trunk/analysis/src/main/java/org/lcsim/analysis/StripIdrupEvent.java
 =============================================================================
--- projects/lcsim/trunk/analysis/src/main/java/org/lcsim/analysis/StripIdrupEvent.java	(original)
+++ projects/lcsim/trunk/analysis/src/main/java/org/lcsim/analysis/StripIdrupEvent.java	Mon Mar  2 15:21:11 2015
@@ -15,9 +15,12 @@
 
     private boolean _debug = true;
     private int _idrupToWrite;
+    private int _numberToWrite;
+    private int _numberWritten;
 
     protected void process(EventHeader event)
     {
+//        System.out.println("in StripIdrupEvent process: number written: "+_numberWritten+" number to write: " +_numberToWrite);
         Map<String, int[]> iparams = event.getIntegerParameters();
         int idrup = 0;
         if (iparams.containsKey("idrup")) {
@@ -32,12 +35,17 @@
         if (fparams.containsKey("_weight")) {
             weight = fparams.get("_weight")[0];
         }
-        if(_debug) System.out.println("idrup= " + idrup + " : weight= " + weight);
+        if (_debug) {
+            System.out.println("idrup= " + idrup + " : weight= " + weight);
+        }
         boolean skipEvent = true;
 
         if (idrup == _idrupToWrite) {
-            System.out.println("writing event with idrup= " + idrup + " : weight= " + weight);
-            skipEvent = false;
+            if (_numberWritten < _numberToWrite) {
+                System.out.println("writing event "+_numberWritten+" of "+_numberToWrite+" with idrup= " + idrup + " : weight= " + weight);
+                skipEvent = false;
+                ++_numberWritten;
+            }
         }
 
         if (skipEvent) {
@@ -45,8 +53,18 @@
         }
     }
 
+    public void setDebug(boolean debug)
+    {
+        _debug = debug;
+    }
+
     public void setIdrup(int idrup)
     {
         _idrupToWrite = idrup;
     }
+    
+    public void setNumberToWrite(int numberToWrite)
+    {
+        _numberToWrite = numberToWrite;
+    }
 }

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the LCDET-SVN list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCDET-SVN&A=1

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

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