Index: /trunk/Mars/Changelog
===================================================================
--- /trunk/Mars/Changelog	(revision 10114)
+++ /trunk/Mars/Changelog	(revision 10115)
@@ -18,4 +18,12 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2011/01/24 Thomas Bretz
+
+   * melectronics/MAvalanchePhotoDiode.h:
+     - shifted the Afterpulse class behind the APD class to make it
+       compile
+
+
 
  2011/01/07 Thomas Bretz
Index: /trunk/Mars/melectronics/MAvalanchePhotoDiode.h
===================================================================
--- /trunk/Mars/melectronics/MAvalanchePhotoDiode.h	(revision 10114)
+++ /trunk/Mars/melectronics/MAvalanchePhotoDiode.h	(revision 10115)
@@ -9,45 +9,4 @@
 #include <TSortedList.h>
 #endif
-
-class Afterpulse : public TObject
-{
-private:
-    UInt_t  fCellIndex;  // Index of G-APD cell the afterpulse belongs to
-
-    Float_t fTime;       // Time at which the afterpulse avalanch broke through
-    Float_t fAmplitude;  // Amplitude (crosstalk!) the pulse produced
-
-    Int_t Compare(const TObject *obj) const
-    {
-        return static_cast<const Afterpulse*>(obj)->fTime>fTime ? -1 : 1;
-    }
-
-    Bool_t IsSortable() const { return kTRUE; }
-
-public:
-    Afterpulse(UInt_t idx, Float_t t) : fCellIndex(idx), fTime(t), fAmplitude(0) { }
-
-    UInt_t GetCellIndex() const { return fCellIndex; }
-
-    Float_t GetTime() const { return fTime; }
-    Float_t GetAmplitude() const { return fAmplitude; }
-
-    Float_t Process(APD &apd)
-    {
-        // Do not process afterpulses twice (e.g. HitRelative + IncreaseTime)
-        // This should not happen anyway
-        //        if (fAmplitude>0)
-        //            return fAmplitude;
-
-        const UInt_t nx  = apd.GetNumCellsX()+2;
-
-        const UInt_t x = fCellIndex%nx;
-        const UInt_t y = fCellIndex/nx;
-
-        fAmplitude = apd.HitCellImp(x, y, fTime);
-
-        return fAmplitude;
-    }
-};
 
 class APD : public TObject  // FIXME: Derive from TH2?
@@ -163,3 +122,44 @@
 };
 
+class Afterpulse : public TObject
+{
+private:
+    UInt_t  fCellIndex;  // Index of G-APD cell the afterpulse belongs to
+
+    Float_t fTime;       // Time at which the afterpulse avalanch broke through
+    Float_t fAmplitude;  // Amplitude (crosstalk!) the pulse produced
+
+    Int_t Compare(const TObject *obj) const
+    {
+        return static_cast<const Afterpulse*>(obj)->fTime>fTime ? -1 : 1;
+    }
+
+    Bool_t IsSortable() const { return kTRUE; }
+
+public:
+    Afterpulse(UInt_t idx, Float_t t) : fCellIndex(idx), fTime(t), fAmplitude(0) { }
+
+    UInt_t GetCellIndex() const { return fCellIndex; }
+
+    Float_t GetTime() const { return fTime; }
+    Float_t GetAmplitude() const { return fAmplitude; }
+
+    Float_t Process(APD &apd)
+    {
+        // Do not process afterpulses twice (e.g. HitRelative + IncreaseTime)
+        // This should not happen anyway
+        //        if (fAmplitude>0)
+        //            return fAmplitude;
+
+        const UInt_t nx  = apd.GetNumCellsX()+2;
+
+        const UInt_t x = fCellIndex%nx;
+        const UInt_t y = fCellIndex/nx;
+
+        fAmplitude = apd.HitCellImp(x, y, fTime);
+
+        return fAmplitude;
+    }
+};
+
 #endif
