Index: fact/tools/rootmacros/PulseTemplates/FPulseOverlay.C
===================================================================
--- fact/tools/rootmacros/PulseTemplates/FPulseOverlay.C	(revision 13577)
+++ fact/tools/rootmacros/PulseTemplates/FPulseOverlay.C	(revision 13581)
@@ -192,5 +192,5 @@
         const char*     OutRootFileName     = "/home_nfs/isdc/jbbuss/analysis/FPulseTemplate/test.root",
         bool            ProduceGraphic      = true,
-        bool            spikeDebug          = false,
+        bool            spikeDebug          = true,
         bool            debugPixel          = true,
         bool            testmode            = false,
@@ -198,11 +198,11 @@
         int             verbosityLevel      = 1,        // different verbosity levels can be implemented here
         int             firstevent          = 1,        // Hast to be between 1 and infinity NOT 0!!!!
-        int             nevents             = 1000,
+        int             nevents             = 10000,
         int             firstpixel          = 15,
         int             npixel              = 3,
         int             pixelSetSize       = 40,
-        int             maxPulseOrder       = 4,
+        int             maxPulseOrder       = 3,
         int             AmplWindowWidth     = 14,       //Width of Window for selection of pulses to histograms
-        TString         histoOptions        = "S",
+        TString         histoOptions        = "SRM",
         float           GainMean            = 9,
         float           BSLMean             = -1,        //4 Histogramms will be drawn, decide how far pulsehights differ from eachother
@@ -1028,9 +1028,18 @@
        debugHistos[Vcfd2_].SetBinContent( sl, Vcfd2[sl] );
     }
-
-
+    bool has_negative_slope = false;
     cFiltered->cd(1);
     gPad->SetGrid();
     debugHistos[Ameas_].Draw();
+
+    vector<Region>::iterator reg;
+    for (reg = pZXings->begin() ; reg < pZXings->end() ; reg++){
+        if (reg->slopeOfRisingEdge < 0)
+        {
+            has_negative_slope = true;
+            cout << "Slope is: " << reg->slopeOfRisingEdge << endl;
+        }
+
+    }
 
     cFiltered->cd(2);
@@ -1064,15 +1073,17 @@
 //            zeroline->SetLineColor(kBlue);
 //            zeroline->Draw();
-
-    cFiltered->Update();
-
-
-    //Process gui events asynchronously during input
-    TTimer timer("gSystem->ProcessEvents();", 50, kFALSE);
-    timer.TurnOn();
-    TString input = Getline("Type 'q' to exit, <return> to go on: ");
-    timer.TurnOff();
-    if (input=="q\n") {
-            breakout=true;
+    if (has_negative_slope)
+    {
+        cFiltered->Update();
+
+
+        //Process gui events asynchronously during input
+        TTimer timer("gSystem->ProcessEvents();", 50, kFALSE);
+        timer.TurnOn();
+        TString input = Getline("Type 'q' to exit, <return> to go on: ");
+        timer.TurnOff();
+        if (input=="q\n") {
+                breakout=true;
+        }
     }
 
