Print

Print


Commit in slic on MAIN
include/EventSource.hh+2-21.7 -> 1.8
       /EventSourceWithInputFile.hh+2-21.7 -> 1.8
src/EventSourceWithInputFile.cc+18-71.6 -> 1.7
   /EventSource.cc+2-21.4 -> 1.5
+24-13
4 modified files
JM: Added print outs to event skipping and changed skipEvents to return number of events actually skipped.

slic/include
EventSource.hh 1.7 -> 1.8
diff -u -r1.7 -r1.8
--- EventSource.hh	5 Sep 2006 23:21:42 -0000	1.7
+++ EventSource.hh	14 Nov 2006 09:08:39 -0000	1.8
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/include/EventSource.hh,v 1.7 2006/09/05 23:21:42 jeremy Exp $
+// $Header: /cvs/lcd/slic/include/EventSource.hh,v 1.8 2006/11/14 09:08:39 jeremy Exp $
 
 #ifndef SLIC_EVENTSOURCE_HH
 #define SLIC_EVENTSOURCE_HH 1
@@ -35,7 +35,7 @@
     virtual void generate(G4Event* evt) = 0;
     virtual void dumpCurrentEvent(std::ostream& os) = 0;
     virtual void reset();
-    virtual void skipEvents(unsigned int);
+    virtual unsigned int skipEvents(unsigned int);
     virtual void beginEvent(const G4Event*);
     virtual void endEvent(const G4Event*);
     virtual void beginRun(const G4Run*);

slic/include
EventSourceWithInputFile.hh 1.7 -> 1.8
diff -u -r1.7 -r1.8
--- EventSourceWithInputFile.hh	5 Sep 2006 23:21:42 -0000	1.7
+++ EventSourceWithInputFile.hh	14 Nov 2006 09:08:39 -0000	1.8
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/include/EventSourceWithInputFile.hh,v 1.7 2006/09/05 23:21:42 jeremy Exp $
+// $Header: /cvs/lcd/slic/include/EventSourceWithInputFile.hh,v 1.8 2006/11/14 09:08:39 jeremy Exp $
 
 #ifndef SLIC_EVENTSOURCEWITHINPUTFILE_HH
 #define SLIC_EVENTSOURCEWITHINPUTFILE_HH 1
@@ -43,7 +43,7 @@
     virtual void reset();
 
     // skip n events
-    virtual void skipEvents(unsigned int nevents);
+    virtual unsigned int skipEvents(unsigned int nevents);
 
     // current status = EOF?
     virtual bool isEOF();

slic/src
EventSourceWithInputFile.cc 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- EventSourceWithInputFile.cc	22 Sep 2005 21:39:05 -0000	1.6
+++ EventSourceWithInputFile.cc	14 Nov 2006 09:08:42 -0000	1.7
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/src/EventSourceWithInputFile.cc,v 1.6 2005/09/22 21:39:05 jeremy Exp $
+// $Header: /cvs/lcd/slic/src/EventSourceWithInputFile.cc,v 1.7 2006/11/14 09:08:42 jeremy Exp $
 #include "EventSourceWithInputFile.hh"
 
 // slic
@@ -45,16 +45,18 @@
     m_eof = false;
   }
 
-  void EventSourceWithInputFile::skipEvents(unsigned int nevents)
+  unsigned int EventSourceWithInputFile::skipEvents(unsigned int nevents)
   {
-    for (unsigned int i = 0; i < nevents; i++) {
-
-      readNextEvent();
-
+    unsigned int i;
+    for (i=0; i<nevents; i++) {
+      
       if ( isEOF() ) {
 	break;
       }
+
+      readNextEvent();
     }
+    return i;
   }
 
   bool EventSourceWithInputFile::isEOF()
@@ -92,10 +94,19 @@
 
     // get num events to skip from mgr
     int nskip = EventSourceManager::instance()->getSkipEvents();
+
     if ( nskip ) {
 
+      G4cout << "Skipping <" << nskip << "> events ..." << G4endl;
+
       // skip events according to current mgr val
-      skipEvents(nskip);
+      int actualskipped = skipEvents(nskip);
+
+      G4cout << "Skipped <" << actualskipped << "> events." << G4endl;
+
+      if (actualskipped < nskip) {
+	G4cout << "Ran out of records to skip on event file!" << G4endl;
+      }
 
       // reset skip events
       EventSourceManager::instance()->setSkipEvents(0);

slic/src
EventSource.cc 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- EventSource.cc	22 Feb 2006 23:59:14 -0000	1.4
+++ EventSource.cc	14 Nov 2006 09:08:43 -0000	1.5
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/src/EventSource.cc,v 1.4 2006/02/22 23:59:14 jeremy Exp $
+// $Header: /cvs/lcd/slic/src/EventSource.cc,v 1.5 2006/11/14 09:08:43 jeremy Exp $
 #include "EventSource.hh"
 
 // geant4
@@ -12,7 +12,7 @@
     // no-op -- implement if generator can be reset to event 0 or new file/source
   }
 
-  void EventSource::skipEvents(unsigned int)
+  unsigned int EventSource::skipEvents(unsigned int)
   {
     // no-op -- implement if generator can "skip" an event
   }
CVSspam 0.2.8