]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSCalibrationSPD.h
New macros to display the SDD calibration parameters from OCDB files (F. Prino)
[u/mrichter/AliRoot.git] / ITS / AliITSCalibrationSPD.h
1 #ifndef ALIITSCALIBRATIONSPD_H
2 #define ALIITSCALIBRATIONSPD_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7 #include "TRandom.h"
8 #include "AliITSCalibration.h"
9 #include "TArrayS.h"
10 #include "AliITSresponseSPD.h"
11
12
13 ////////////////////////////////////////////////////
14 //                                                //
15 // ITS response class for SPD                     //
16 ////////////////////////////////////////////////////
17 class AliITSCalibrationSPD :  public AliITSCalibration {
18  public:
19     AliITSCalibrationSPD(); // default constructor
20     virtual ~AliITSCalibrationSPD() {;} // destructror
21
22     virtual void   ClearBad();
23
24     virtual Int_t  GetNrBad() const;
25     virtual Int_t  GetNrBadInChip(Int_t chip) const;
26     virtual Int_t  GetNrBadInColumn(Int_t col) const;
27
28     virtual Int_t  GetBadColAt(UInt_t index) const;
29     virtual Int_t  GetBadRowAt(UInt_t index) const;
30     virtual void   GetBadPixel(Int_t index, Int_t &row, Int_t &col) const;
31
32     virtual Int_t  GetNrBadSingle() const {return fNrBad;}
33     virtual void   SetNrBadSingle(UInt_t nr) {fNrBad=nr;} // used to be called SetNrBad, but misleading
34     virtual void   SetBadList(TArrayS badlist) {fBadChannels=badlist;}
35     virtual void   SetNrBad(UInt_t /*nr*/); // Use SetNrBadSingle!!!
36
37     virtual Bool_t IsBad() const;
38     virtual Bool_t IsChipBad(Int_t chip) const;
39     virtual Bool_t IsColumnBad(Int_t col) const;
40     virtual Bool_t IsPixelBad(Int_t col, Int_t row) const;
41
42     virtual void   SetChipBad(UInt_t chip);
43     virtual void   UnSetChipBad(UInt_t chip);
44
45     virtual void   AddBad(UInt_t col, UInt_t row);
46
47     virtual Int_t  GetChipIndexFromCol(UInt_t col) const;
48     //    virtual Int_t  GetChipFromChipIndex(UInt_t index) const;
49
50
51     // Set Threshold and noise + threshold fluctuations parameter values
52     virtual  void   SetThresholds(Double_t thresh, Double_t sigma)
53         {fThresh=thresh; fSigma=sigma;}
54     // Get Threshold and noise + threshold fluctuations parameter values
55     virtual  void   Thresholds(Double_t &thresh, Double_t &sigma) const
56         {thresh=fThresh; sigma=fSigma;}
57     // Set Bias Voltage parameter
58     virtual void    SetBiasVoltage(Double_t bias=18.182) {fBiasVoltage=bias;}
59     Double_t  GetBiasVoltage() const {return fBiasVoltage;}
60     //Returns just baseline value
61     Double_t GetBaseline() const {return fBaseline;}
62     // Set noise and baseline in one (abstract method of AliITSCalibration)
63     virtual void SetNoiseParam(Double_t n,Double_t b)
64         {fNoise = n;fBaseline = b;}
65     // Get noise and baseline in one (abstract method of AliITSCalibration)
66     virtual void GetNoiseParam(Double_t &n,Double_t &b) const
67         {n =fNoise;b = fBaseline;}
68     // Returns just noise value
69     Double_t GetNoise() const {return fNoise;} 
70     //Declaration of member functions peculiar to this class
71     // Applies a random noise and addes the baseline
72     Double_t ApplyBaselineAndNoise() const {return fBaseline+
73                                                fNoise*gRandom->Gaus();}
74     // Set coupling parameters 
75     virtual void SetCouplingParam(Double_t col, Double_t row)
76         {fCouplCol = col; fCouplRow = row;}
77     // Get coupling parameters 
78     virtual void GetCouplingParam(Double_t &col, Double_t &row) const
79         {col = fCouplCol; row = fCouplRow;}
80
81
82     virtual void    GiveCompressParam(Int_t *) const
83       {NotImplemented("GiveCompressParam");}
84     virtual  void   SetDetParam(Double_t *)
85       {NotImplemented("SetDetParam");}
86     virtual void   GetDetParam(Double_t *) const 
87       {NotImplemented("GetDetParam");}
88     virtual  void   SetNDetParam(Int_t /* n */)
89       {NotImplemented("SetNDetParam");}
90     virtual Int_t  NDetParam() const
91       {NotImplemented("NDetParam"); return 0;}
92     virtual void    SetSigmaSpread(Double_t, Double_t) 
93       {NotImplemented("SetSigmaSpread");}
94     virtual void    SigmaSpread(Double_t & /* p1 */,Double_t & /* p2 */) const 
95       {NotImplemented("SigmaSpread");}
96
97     
98
99
100  protected:
101     // static const Double_t fgkDiffCoeffDefault; //default for fDiffCoeff
102     static const Double_t fgkThreshDefault; //default for fThresh
103     static const Double_t fgkSigmaDefault; //default for fSigma
104     static const Double_t fgkCouplColDefault; //default for fCouplCol
105     static const Double_t fgkCouplRowDefault; //default for fCouplRow
106     static const Double_t fgkBiasVoltageDefault; //default for fBiasVoltage
107     Double_t fBaseline;        // Base-line value
108     Double_t fNoise;           // Gaussian noise scale
109     Double_t fThresh;          // Threshold value
110     Double_t fSigma;           // Noise + threshold fluctuations value
111     Double_t fCouplCol;        // Coupling parameter along the cols
112     Double_t fCouplRow;        // Coupling parameter along the rows
113     Double_t fBiasVoltage;     // Bias Voltage for the SPD (used to compute DistanceOverVoltage)
114     UInt_t   fNrBad;           // Nr of SINGLE bad pixels
115     TArrayS  fBadChannels;     // Array with bad channels info (col0,row0,col1...rowN) N = fNrBad
116     Bool_t   fBadChip[5];     // Is chip completely dead?
117
118     ClassDef(AliITSCalibrationSPD,7) // SPD response
119 };
120
121 #endif