]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSCalibrationSPD.h
Updated online raw data QA for the SSD - occupancy calculation per module (Panos)
[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     // Set Threshold and noise + threshold fluctuations parameter values
23     virtual  void   SetThresholds(Double_t thresh, Double_t sigma)
24         {fThresh=thresh; fSigma=sigma;}
25     // Get Threshold and noise + threshold fluctuations parameter values
26     virtual  void   Thresholds(Double_t &thresh, Double_t &sigma) const
27         {thresh=fThresh; sigma=fSigma;}
28     // Set Bias Voltage parameter
29     virtual void    SetBiasVoltage(Double_t bias=18.182) {fBiasVoltage=bias;}
30     Double_t  GetBiasVoltage() const {return fBiasVoltage;}
31     //Returns just baseline value
32     Double_t GetBaseline() const {return fBaseline;}
33     // Set noise and baseline in one (abstract method of AliITSCalibration)
34     virtual void SetNoiseParam(Double_t n,Double_t b)
35         {fNoise = n;fBaseline = b;}
36     // Get noise and baseline in one (abstract method of AliITSCalibration)
37     virtual void GetNoiseParam(Double_t &n,Double_t &b) const
38         {n =fNoise;b = fBaseline;}
39     // Returns just noise value
40     Double_t GetNoise() const {return fNoise;} 
41     //Declaration of member functions peculiar to this class
42     // Applies a random noise and addes the baseline
43     Double_t ApplyBaselineAndNoise() const {return fBaseline+
44                                                fNoise*gRandom->Gaus();}
45     // Set coupling parameters 
46     virtual void SetCouplingParam(Double_t col, Double_t row)
47         {fCouplCol = col; fCouplRow = row;}
48     // Get coupling parameters 
49     virtual void GetCouplingParam(Double_t &col, Double_t &row) const
50         {col = fCouplCol; row = fCouplRow;}
51
52
53     virtual void    GiveCompressParam(Int_t *) const
54       {NotImplemented("GiveCompressParam");}
55     virtual  void   SetDetParam(Double_t *)
56       {NotImplemented("SetDetParam");}
57     virtual void   GetDetParam(Double_t *) const 
58       {NotImplemented("GetDetParam");}
59     virtual  void   SetNDetParam(Int_t /* n */)
60       {NotImplemented("SetNDetParam");}
61     virtual Int_t  NDetParam() const
62       {NotImplemented("NDetParam"); return 0;}
63     virtual void    SetSigmaSpread(Double_t, Double_t) 
64       {NotImplemented("SetSigmaSpread");}
65     virtual void    SigmaSpread(Double_t & /* p1 */,Double_t & /* p2 */) const 
66       {NotImplemented("SigmaSpread");}
67
68     virtual void GetCouplingOption(char *opt) const {((AliITSresponseSPD*)fResponse)->CouplingOption(opt);}
69     virtual void SetCouplingOption(const char* opt) {((AliITSresponseSPD*)fResponse)->SetCouplingOption(opt);}
70     virtual void SetSigmaDiffusionAsymmetry(Double_t ecc) {((AliITSresponseSPD*)fResponse)->SetSigmaDiffusionAsymmetry(ecc);}
71     virtual void GetSigmaDiffusionAsymmetry(Double_t &ecc) const {((AliITSresponseSPD*)fResponse)->GetSigmaDiffusionAsymmetry(ecc);}
72     
73     void   AddBad(UInt_t col, UInt_t row);
74     Int_t  GetNrBad() const {return fNrBad;}
75     Int_t  GetNrBadInChip(Int_t chip) const ;
76     Int_t  GetNrBadInColumn(Int_t col) const ;
77     Int_t  GetBadColAt(UInt_t index); //returns -1 if out of bounds
78     Int_t  GetBadRowAt(UInt_t index); //returns -1 if out of bounds
79     void   ClearBad() {fBadChannels.Reset(); fNrBad=0;}
80     Bool_t IsPixelBad(Int_t col, Int_t row) const ;
81     void GetBadPixel(Int_t i, Int_t &row, Int_t &col) const;
82
83     void   SetBadList(TArrayS badlist) {fBadChannels=badlist;}
84     void   SetNrBad(UInt_t nr) {fNrBad=nr;}
85     virtual Bool_t IsBad() const {return (GetNrBad()==256*160);};
86     virtual Bool_t IsChipBad(Int_t chip) const {return (GetNrBadInChip(chip)==256*32);};
87     Bool_t  IsColumnBad(Int_t col) const {return (GetNrBadInColumn(col)==256);};
88
89  protected:
90     // static const Double_t fgkDiffCoeffDefault; //default for fDiffCoeff
91     static const Double_t fgkThreshDefault; //default for fThresh
92     static const Double_t fgkSigmaDefault; //default for fSigma
93     static const Double_t fgkCouplColDefault; //default for fCouplCol
94     static const Double_t fgkCouplRowDefault; //default for fCouplRow
95     static const Double_t fgkBiasVoltageDefault; //default for fBiasVoltage
96     Double_t fBaseline;        // Base-line value
97     Double_t fNoise;           // Gaussian noise scale
98     Double_t fThresh;          // Threshold value
99     Double_t fSigma;           // Noise + threshold fluctuations value
100     Double_t fCouplCol;        // Coupling parameter along the cols
101     Double_t fCouplRow;        // Coupling parameter along the rows
102     Double_t fBiasVoltage;     // Bias Voltage for the SPD (used to compute DistanceOverVoltage)
103     UInt_t   fNrBad;           // Nr of bad pixels
104     TArrayS  fBadChannels;     // Array with bad channels info (col0,row0,col1...rowN) N = fNrBad
105
106     ClassDef(AliITSCalibrationSPD,6) // SPD response
107 };
108
109 #endif