Index: /trunk/ippToPsps/perl/ippToPsps/DetectionBatch.pm
===================================================================
--- /trunk/ippToPsps/perl/ippToPsps/DetectionBatch.pm	(revision 29194)
+++ /trunk/ippToPsps/perl/ippToPsps/DetectionBatch.pm	(revision 29195)
@@ -11,4 +11,29 @@
 use ippToPsps::Batch;
 our @ISA = qw(ippToPsps::Batch);    # inherits from Batch class
+
+
+###########################################################################
+#
+# Constructor (overrides superclass)
+#
+###########################################################################
+sub existing {
+    my ($class) = @_;
+
+    # Call the constructor of the parent class
+    my $self = $class->SUPER::existing(
+            $_[1],  # camera
+            $_[2],  # gpc1Db
+            $_[3],  # batchId
+            $_[4],  # ippToPspsDb
+            $_[5],  # path
+            $_[6],  # verbose
+            $_[7]   # save_temps
+            );
+
+    bless $self, $class;
+    return $self;
+}
+
 
 ###########################################################################
@@ -44,4 +69,21 @@
 #######################################################################################
 # 
+# Locates the relevant smf file for this exposure
+#
+#######################################################################################
+sub getSmfFile {
+    my ($self) = @_;
+
+    # get neb path of smf file
+    my $nebPath = $self->{_gpc1Db}->getCameraStageSmfForThisDvoDb($self->{_dvoDb}, $self->{_expId});
+    if (!$nebPath) { return 0; }
+
+    # get real filename from neb 'key'
+    my $fpaObjects = $self->{_ipprc}->filename("PSASTRO.OUTPUT",$nebPath) or return undef;
+    return $self->{_ipprc}->file_resolve($fpaObjects);
+}
+
+#######################################################################################
+# 
 # Locates the relevant smf file for this exposure and writes the path to the file passed-in
 #
@@ -50,14 +92,9 @@
     my ($self, $inputFile) = @_;
 
-    # get neb path of smf file
-    my $nebPath = $self->{_gpc1Db}->getCameraStageSmfForThisDvoDb($self->{_dvoDb}, $self->{_expId});
-    if (!$nebPath) { return 0; }
-
-    # get real filename from neb 'key'
-    my $fpaObjects = $self->{_ipprc}->filename("PSASTRO.OUTPUT",$nebPath) or return 0;
-    my $realFile = $self->{_ipprc}->file_resolve($fpaObjects) or return 0;
+    my $smfFile = $self->getSmfFile();
+    if (!defined $smfFile) {return 0;}
 
     # now write the path to this file out to temp file
-    print $inputFile $realFile . "\n";
+    print $inputFile $smfFile . "\n";
 
     return 1;
