Changeset 10115


Ignore:
Timestamp:
01/24/11 09:52:27 (14 years ago)
Author:
tbretz
Message:
Reordered the classes in MAvalanchePhotoDiode.h to make it compile.
Location:
trunk/Mars
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/Changelog

    r10093 r10115  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20
     21 2011/01/24 Thomas Bretz
     22
     23   * melectronics/MAvalanchePhotoDiode.h:
     24     - shifted the Afterpulse class behind the APD class to make it
     25       compile
     26
     27
    2028
    2129 2011/01/07 Thomas Bretz
  • trunk/Mars/melectronics/MAvalanchePhotoDiode.h

    r10111 r10115  
    99#include <TSortedList.h>
    1010#endif
    11 
    12 class Afterpulse : public TObject
    13 {
    14 private:
    15     UInt_t  fCellIndex;  // Index of G-APD cell the afterpulse belongs to
    16 
    17     Float_t fTime;       // Time at which the afterpulse avalanch broke through
    18     Float_t fAmplitude;  // Amplitude (crosstalk!) the pulse produced
    19 
    20     Int_t Compare(const TObject *obj) const
    21     {
    22         return static_cast<const Afterpulse*>(obj)->fTime>fTime ? -1 : 1;
    23     }
    24 
    25     Bool_t IsSortable() const { return kTRUE; }
    26 
    27 public:
    28     Afterpulse(UInt_t idx, Float_t t) : fCellIndex(idx), fTime(t), fAmplitude(0) { }
    29 
    30     UInt_t GetCellIndex() const { return fCellIndex; }
    31 
    32     Float_t GetTime() const { return fTime; }
    33     Float_t GetAmplitude() const { return fAmplitude; }
    34 
    35     Float_t Process(APD &apd)
    36     {
    37         // Do not process afterpulses twice (e.g. HitRelative + IncreaseTime)
    38         // This should not happen anyway
    39         //        if (fAmplitude>0)
    40         //            return fAmplitude;
    41 
    42         const UInt_t nx  = apd.GetNumCellsX()+2;
    43 
    44         const UInt_t x = fCellIndex%nx;
    45         const UInt_t y = fCellIndex/nx;
    46 
    47         fAmplitude = apd.HitCellImp(x, y, fTime);
    48 
    49         return fAmplitude;
    50     }
    51 };
    5211
    5312class APD : public TObject  // FIXME: Derive from TH2?
     
    163122};
    164123
     124class Afterpulse : public TObject
     125{
     126private:
     127    UInt_t  fCellIndex;  // Index of G-APD cell the afterpulse belongs to
     128
     129    Float_t fTime;       // Time at which the afterpulse avalanch broke through
     130    Float_t fAmplitude;  // Amplitude (crosstalk!) the pulse produced
     131
     132    Int_t Compare(const TObject *obj) const
     133    {
     134        return static_cast<const Afterpulse*>(obj)->fTime>fTime ? -1 : 1;
     135    }
     136
     137    Bool_t IsSortable() const { return kTRUE; }
     138
     139public:
     140    Afterpulse(UInt_t idx, Float_t t) : fCellIndex(idx), fTime(t), fAmplitude(0) { }
     141
     142    UInt_t GetCellIndex() const { return fCellIndex; }
     143
     144    Float_t GetTime() const { return fTime; }
     145    Float_t GetAmplitude() const { return fAmplitude; }
     146
     147    Float_t Process(APD &apd)
     148    {
     149        // Do not process afterpulses twice (e.g. HitRelative + IncreaseTime)
     150        // This should not happen anyway
     151        //        if (fAmplitude>0)
     152        //            return fAmplitude;
     153
     154        const UInt_t nx  = apd.GetNumCellsX()+2;
     155
     156        const UInt_t x = fCellIndex%nx;
     157        const UInt_t y = fCellIndex/nx;
     158
     159        fAmplitude = apd.HitCellImp(x, y, fTime);
     160
     161        return fAmplitude;
     162    }
     163};
     164
    165165#endif
Note: See TracChangeset for help on using the changeset viewer.