]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSChannelDaSSD.h
AddRunType calls added in the constructor (F.Prino)
[u/mrichter/AliRoot.git] / ITS / AliITSChannelDaSSD.h
1 #ifndef ALIITSCHANNELDASSD_H
2 #define ALIITSCHANNELDASSD_H
3
4 /* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6 /*                                                                        */
7 /* $Id$ */
8
9 ///////////////////////////////////////////////////////////////////////////////
10 ///
11 /// This class provides storage container ITS SSD channel callibration data
12 /// used by DA. 
13 ///
14 ///////////////////////////////////////////////////////////////////////////////
15
16 #include "TMath.h"
17 #include "TObject.h"
18
19
20 class AliITSChannelDaSSD : public TObject {
21   public :
22     AliITSChannelDaSSD();
23     explicit AliITSChannelDaSSD(const UShort_t stripId);
24     AliITSChannelDaSSD(const UShort_t stripId, const Long_t eventsnumber);
25     AliITSChannelDaSSD(const AliITSChannelDaSSD& strip);
26     AliITSChannelDaSSD& operator = (const AliITSChannelDaSSD& strip);
27     virtual ~AliITSChannelDaSSD();
28     
29     UShort_t  GetStripId() const { return fStripId; }
30     Long_t    GetEventsNumber() const { return fEventsNumber; }
31     Short_t*  GetSignal()  const { return fSignal; }
32     Short_t*  GetSignal(const Long_t eventnumber)  const 
33                                 { return (eventnumber < fEventsNumber && fSignal) ? (fSignal+eventnumber) : NULL; }
34     
35     Float_t  GetPedestal() const { return fPedestal; }
36     Float_t  GetNoise()    const { return fNoise;    }
37     Float_t  GetNoiseCM()  const { return fNoiseCM;  }
38     Long_t   GetOverflowNumber() const { return fNOverflowEv; }
39     Bool_t   CheckNoise()   const { return (fNoise < fgkUndefinedValue) ? kTRUE : kFALSE; }
40     Bool_t   CheckNoiseCM() const { return (fNoiseCM < fgkUndefinedValue) ? kTRUE : kFALSE; }
41
42     Bool_t    SetEvenetsNumber(const Long_t eventsnumber);
43     Bool_t    SetSignal(const Long_t eventnumber, const Short_t signal);
44     void      SetStripId(const UShort_t stripId) { fStripId = stripId; }
45
46     void      SetPedestal(Float_t pedestal) { fPedestal = pedestal; }
47     void      SetNoise(Float_t noise)   { fNoise = noise; }
48     void      SetNoiseCM(Float_t noise) { fNoiseCM = noise; }
49     void      SetOverflowNumber(Long_t ovn) {fNOverflowEv = ovn; }
50     void      ClearNoise() { if (fNoise < fgkUndefinedValue) fNoise = fgkUndefinedValue; }
51     void      ClearNoiseCM() { if (fNoiseCM < fgkUndefinedValue) fNoiseCM = fgkUndefinedValue; }
52     void      ClearPedestal() { if (fPedestal < fgkUndefinedValue) fPedestal = fgkUndefinedValue; }
53     void      ClearSignal() { if (fSignal) for (Int_t i = 0; i < fEventsNumber; i++) 
54                                              fSignal[i] = 0x100 * fgkDefaultSignal + fgkDefaultSignal; }
55     void      DeleteSignal() { if (fSignal) { delete [] fSignal; fSignal = NULL; fEventsNumber = 0;} }
56
57     static  Short_t  GetOverflowConst()  { return fgkSignalOverflow;  }
58     static  Short_t  GetUnderflowConst() { return fgkSignalUnderflow; }
59     static  Float_t  GetUndefinedValue() { return fgkUndefinedValue;  }
60     static  Short_t  GetMaxStripIdConst(){ return fgkMaxStripId;      }
61
62   protected :
63     static const Short_t fgkMinStripId;         // minimum strip id
64     static const Short_t fgkMaxStripId;         // maximum strip id
65
66     static const Short_t  fgkSignalOverflow;     // ADC overflow value
67     static const Short_t  fgkSignalUnderflow;    // ADC underflow value
68     static const UShort_t fgkDefaultSignal;      // initialization value for fNoise, fPedestal, fSignal[i]
69     static const Float_t  fgkUndefinedValue;     // constant value which indicates that fNoise, fPedestal is undefined
70   
71     UShort_t          fStripId;             //  channel = strip number within SSD module 0-1535
72     Long_t            fEventsNumber;        //  number of events for fSignal memory allocation
73     Short_t          *fSignal;              //! array of signal data
74     
75     Float_t           fPedestal;            //  pedestal
76     Float_t           fNoise;               //  noise
77     Float_t           fNoiseCM;             //  noise with CM correction
78     Long_t            fNOverflowEv;         //  Number of events which exceed the pedestal calculation threshold
79                       
80     ClassDef(AliITSChannelDaSSD, 2)
81 };
82
83 #endif