Index: fact/tools/rootmacros/gainfit2.C
===================================================================
--- fact/tools/rootmacros/gainfit2.C	(revision 12916)
+++ fact/tools/rootmacros/gainfit2.C	(revision 12918)
@@ -97,8 +97,12 @@
 
 int gainfit2(
-        const char * InputRootFileName = "../analysis/fpeak/20111110_005/20111110_005_fpeak.root",
-        const char * InputBaselineFileName = "../analysis/fpeak/20111110_005/20111110_005_fbsl.root",
-        const char * OutTextFileName = "../analysis/fpeak/20111110_005/20111110_005_gainfit.txt",
-        const char * RootOutFileName = "../analysis/fpeak/20111110_005/20111110_005_gainfit.root",
+        const char * InputRootFileName = "../analysis/fpeak/20111109_006/20111109_006_fpeak.root",
+        const char * InputBaselineFileName = "../analysis/fpeak/20111109_006/20111109_006_fbsl.root",
+        const char * OutTextFileName = "../analysis/fpeak/20111109_006_gainfit_test.txt",
+        const char * RootOutFileName = "../analysis/fpeak/20111109_006_gainfit_test.root",
+//        const char * InputRootFileName = "../analysis/fpeak/20111110_005/20111110_005_fpeak.root",
+//        const char * InputBaselineFileName = "../analysis/fpeak/20111110_005/20111110_005_fbsl.root",
+//        const char * OutTextFileName = "../analysis/fpeak/20111110_005/20111110_005_gainfit.txt",
+//        const char * RootOutFileName = "../analysis/fpeak/20111110_005/20111110_005_gainfit.root",
         bool showHistos = false,
         bool debug = false,
@@ -144,5 +148,5 @@
     TF1 *fspek_fit = new TF1("fspek_fit", spek_fit, 5, 60, 6);
     fspek_fit->SetParNames("1.Max", "Gain", "Sigma", "2.Max", "Baseline", "Xtalk");
-    TF1 *fspek_fit2 = new TF1("fspek_fit2g3", spek_fit2, 5, 60, 4);
+    TF1 *fspek_fit2 = new TF1("fspek_fit2", spek_fit2, 5, 60, 4);
     fspek_fit2->SetParNames("1.Max", "Gain", "Sigma", "2.Max");
 //Create Canvases
@@ -276,4 +280,5 @@
 
         if( showHistos ){
+        cGainFit->cd(4);
         hPixelAmplSpek[ pixel ]->Draw();
         }
@@ -482,8 +487,13 @@
 
     hList.Write(); // write the major histograms into the top level directory
-    tf.mkdir("PeakSpektra"); tf.cd("PeakSpektra"); // go to new subdirectory
+
+    tf.mkdir("PeakSpektra");
+    tf.cd("PeakSpektra"); // go to new subdirectory
     hListPeakSpektra.Write(); // write histos into subdirectory
-    tf.mkdir("CrazyPixels"); tf.cd("CrazyPixels"); // go to new subdirectory
+
+    tf.mkdir("CrazyPixels");
+    tf.cd("CrazyPixels"); // go to new subdirectory
     hListCrazy.Write(); // write histos into subdirector
+
     tf.Close(); // close the file
 }
