Index: fact/tools/rootmacros/PulseTemplates/templateextractors.C
===================================================================
--- fact/tools/rootmacros/PulseTemplates/templateextractors.C	(revision 14067)
+++ fact/tools/rootmacros/PulseTemplates/templateextractors.C	(revision 14081)
@@ -574,2 +574,54 @@
     return returnval;
 }
+
+double
+PulseFunction(
+        double*         time,
+        double*         baseline,
+        double*         risingChargeVoltage,
+        double*         risingImpedance,
+        double*         risingCapacity,
+        double*         fallingChargeVoltage,
+        double*         fallingImpedance,
+        double*         fallingCapacity
+        )
+{
+    double returnValue  = 0.0;
+    returnValue         += baseline;
+    returnValue         +=  ChargeDiode(
+                                    time,
+                                    risingChargeVoltage,
+                                    risingImpedance,
+                                    risingCapacity);
+    returnValue         +=  UnChargeDiode(
+                                    time,
+                                    fallingChargeVoltage,
+                                    fallingImpedance,
+                                    fallingCapacity);
+    return returnValue;
+}
+
+void
+FitPulse(
+        TString         name,
+        TH1F*           histo,
+        double          xMin,
+        double          xMax,
+        double*         parameters
+        )
+{
+    TF1* pulseFunction = new TF1(name, PulseFunction, xMin, xMax, 7 );
+    pulseFunction->SetParNames(
+                "Baseline",
+                "Charge-Voltage of rising Edge",
+                "Impedance for rising Edge",
+                "Capacity for rising Edge",
+                "Charge-Voltage of falling Edge",
+                "Impedance for falling Edge",
+                "Capacity for falling Edge"
+                );
+    pulseFunction->SetLineColor(kRed);
+    histo->Fit(pulseFunction, "RWM");
+    pulseFunction->GetParameters(parameters);
+    return 0;
+}
