libAnalyzerDisplay: Added option for processing all events before displaying

Issue #6 resolved
Former user created an issue
diff --git a/libAnalyzerDisplay/TRootanaDisplay.cxx b/libAnalyzerDisplay/TRootanaDisplay.cxx
index d7d1869..ba2bb63 100644
--- a/libAnalyzerDisplay/TRootanaDisplay.cxx
+++ b/libAnalyzerDisplay/TRootanaDisplay.cxx
@@ -239,7 +239,7 @@ bool TRootanaDisplay::ProcessMidasEventOffline(TDataContainer& dataContainer){
     fCanvasHandlers[i].second->UpdateCanvasHistograms(*fCachedDataContainer);

   // Keep skipping if we haven't processed enough
-  if(fNumberSkipEventsOffline >= fNumberProcessed){
+  if(fNumberSkipEventsOffline >= fNumberProcessed || fNumberSkipEventsOffline == -1){
     return true;
   }

@@ -316,6 +316,21 @@ void TRootanaDisplay::EndRunRAD(int transition,int run,int time){
     fCanvasHandlers[i].second->EndRun(transition,run,time);
   UpdatePlotsAction();

+  if(fNumberSkipEventsOffline == -1){
+    // Pause the display
+    while(1){
+      usleep(10000);
+
+      // Break out if next button or next interesting button pressed.
+      if(!waitingForNextButton || !waitingForNextInterestingButton) break;
+
+      // Resize windows, if needed.
+      fMainWindow->ResetSize();
+
+      // handle GUI events
+      gSystem->ProcessEvents();
+    }
+  }
 }


diff --git a/libAnalyzerDisplay/TRootanaDisplay.hxx b/libAnalyzerDisplay/TRootanaDisplay.hxx
index 93b32a4..00f05fb 100644
--- a/libAnalyzerDisplay/TRootanaDisplay.hxx
+++ b/libAnalyzerDisplay/TRootanaDisplay.hxx
@@ -158,16 +158,20 @@ public:
   }

   bool CheckOptionRAD(std::string option){
-    if(option.find("-s") != std::string::npos){
+    if(option.find("-s") == 0){
       std::string sub = option.substr(2);
       fNumberSkipEventsOffline = atoi(sub.c_str());
       printf("Will process %i events before plotting first event.\n",fNumberSkipEventsOffline);
       return true;
+    } else if(option == "-S"){
+      fNumberSkipEventsOffline = -1;
+      return true;
     }
     return false;
   }
   void UsageRAD(){
     printf("\t-s: will process specified number of events before displaying (for display programs)\n");
+    printf("\t-S: will process all events of a run before displaying (for display programs)\n");
   }

 private: 

Comments (3)

  1. dd1
    • changed status to open

    I need to implement the same in manalyzer - most likely - in graphical interactive mode, after processing all events, after calling run->EndRun() but before destroying the run objects, go back to the interactive mode - to allow user to frob all the histograms, etc - in non-interactive and in non-graphical mode, there is nothing the user can do, so no need to drop into interactive mode. This fits in the interactive module EndRun() method. Good. Will close this bug when implemented. K.O.

  2. Log in to comment