]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSCalibrationSSD.h
SSD calibration with float precision instead of double (M.masera, E.Fragiacomo)
[u/mrichter/AliRoot.git] / ITS / AliITSCalibrationSSD.h
1 #ifndef ALIITSCALIBRATIONSSD_H
2 #define ALIITSCALIBRATIONSSD_H
3  
4 #include "AliITSCalibration.h"
5 #include "AliITSresponseSSD.h"
6 #include "TArrayF.h"
7 #include "TArrayI.h"
8
9 //////////////////////////////////////////////
10 // Response class for SSD                   //
11 //                                          //
12 //////////////////////////////////////////////
13 class AliITSCalibrationSSD : public AliITSCalibration {
14
15  public:
16     AliITSCalibrationSSD();
17     AliITSCalibrationSSD(const char *dataType);
18     virtual ~AliITSCalibrationSSD();
19
20     virtual  void   SetNoiseParam(Double_t np, Double_t nn) {
21         // set noise par
22         fNoiseP=np; fNoiseN=nn;
23     }
24
25     virtual void    GetNoiseParam(Double_t &np, Double_t &nn) const {
26         // get noise par
27         np=fNoiseP; nn=fNoiseN;
28     }
29
30     // EF
31     void SetNNoiseP(Int_t n) { fNoisP.Set(n); }
32     void AddNoiseP(Int_t c, Float_t n) { fNoisP.AddAt(n,c);}       
33     TArrayF GetNoiseP() const {return fNoisP; }
34     Float_t GetNoiseP(Int_t n) {return fNoisP.At(n); }
35     void SetNNoiseN(Int_t n) { fNoisN.Set(n); }
36     void AddNoiseN(Int_t c, Float_t n) { fNoisN.AddAt(n,c);}
37     TArrayF GetNoiseN() const {return fNoisN; }
38     Float_t GetNoiseN(Int_t n) {return fNoisN.At(n); }
39
40     void SetNGainP(Int_t n) { fGainP.Set(n); }
41     void AddGainP(Int_t c, Float_t n) { fGainP.AddAt(n,c);}       
42     TArrayF GetGainP() const {return fGainP; }
43     Float_t GetGainP(Int_t n) {return fGainP.At(n); }
44     void SetNGainN(Int_t n) { fGainN.Set(n); }
45     void AddGainN(Int_t c, Float_t n) { fGainN.AddAt(n,c);}
46     TArrayF GetGainN() const {return fGainN; }
47     Float_t GetGainN(Int_t n) {return fGainN.At(n); }
48
49     void SetNoisePThreshold(Int_t threshold) { fNoisePThreshold = threshold;}
50     void AddNoisyPChannel(Int_t c, Int_t n) { fNoisyPChannelsList.AddAt(n,c);}
51     TArrayI GetNoisyPChannelsList() const {return fNoisyPChannelsList; }
52     void SetNoiseNThreshold(Int_t threshold) { fNoiseNThreshold = threshold;}
53     void AddNoisyNChannel(Int_t c, Int_t n) { fNoisyNChannelsList.AddAt(n,c);}
54     TArrayI GetNoisyNChannelsList() const {return fNoisyNChannelsList; }
55
56     void SetNDeadPChannelsList(Int_t n) { fDeadPChannelsList.Set(n); }
57     void AddDeadPChannel(Int_t c, Int_t n) { fDeadPChannelsList.AddAt(n,c);}
58     TArrayI GetDeadPChannelsList() const {return fDeadPChannelsList; }
59     void SetNDeadNChannelsList(Int_t n) { fDeadNChannelsList.Set(n); }
60     void AddDeadNChannel(Int_t c, Int_t n) { fDeadNChannelsList.AddAt(n,c);}
61     TArrayI GetDeadNChannelsList() const {return fDeadNChannelsList; }
62     //
63
64
65     virtual  void   SetNDetParam(Int_t npar) {
66         // set number of param
67         fNPar=npar;
68     }
69     virtual  void   SetDetParam(Double_t *par);
70
71     // Parameters options
72     virtual Int_t   NDetParam() const {
73         // number of param
74         return fNPar;
75     }
76     virtual void    GetDetParam(Double_t *dpar) const; 
77
78     virtual void    SetSigmaSpread(Double_t p1, Double_t p2) {
79         // Set sigmas of the charge spread function: Pside-Nside
80         // square of (microns)
81         fSigmaP=p1; fSigmaN=p2;
82     }
83
84     virtual void    SigmaSpread(Double_t &sP, Double_t &sN) const {
85       // Get sigmas for the charge spread 
86       sP=fSigmaP; sN=fSigmaN;
87     }
88
89     virtual void   SetThresholds(Double_t /* a */, Double_t /* b */)
90       {NotImplemented("SetThresholds");}
91     virtual void   Thresholds(Double_t & /* a */, Double_t & /* b */) const 
92       {NotImplemented("Thresholds");}
93   
94     virtual void SetParamOptions(const char *opt1, const char *opt2) {((AliITSresponseSSD*)fResponse)->SetParamOptions(opt1,opt2);}
95     virtual void GetParamOptions(char *opt1,char *opt2) const {((AliITSresponseSSD*)fResponse)->ParamOptions(opt1,opt2);}
96     virtual void SetADCpereV(Double_t a=200./30000.0) {((AliITSresponseSSD*)fResponse)->SetADCpereV(a);}
97     virtual Double_t GetDEvToADC(Double_t eV) const {return ((AliITSresponseSSD*)fResponse)->DEvToADC(eV);}
98     virtual Int_t IEvToADC(Double_t eV) const {return ((AliITSresponseSSD*)fResponse)->IEvToADC(eV);} 
99
100   virtual Double_t GetCouplingPR() const {return ((AliITSresponseSSD*)fResponse)->GetCouplingPR();}
101   virtual Double_t GetCouplingPL() const {return ((AliITSresponseSSD*)fResponse)->GetCouplingPL();}
102   virtual Double_t GetCouplingNR() const {return ((AliITSresponseSSD*)fResponse)->GetCouplingNR();}
103   virtual Double_t GetCouplingNL() const {return ((AliITSresponseSSD*)fResponse)->GetCouplingNL();}
104   virtual void SetCouplings(Double_t pr, Double_t pl, Double_t nr, Double_t nl) 
105     { ((AliITSresponseSSD*)fResponse)->SetCouplings(pr,pl,nr,nl);}
106
107   virtual Int_t GetZSThreshold() const {return ((AliITSresponseSSD*)fResponse)->GetZSThreshold();}
108   virtual void SetZSThreshold(Int_t zsth) 
109     { ((AliITSresponseSSD*)fResponse)->SetZSThreshold(zsth);}
110
111 protected:
112     static const Double_t fgkNoiseNDefault; // default for fNoiseN
113     static const Double_t fgkNoisePDefault; // default for fNoiseP
114     static const Int_t fgkNParDefault; // default for fNPar
115     static const Double_t fgkSigmaPDefault; //default for fSigmaP
116     static const Double_t fgkSigmaNDefault; //default for fSigmaP
117
118     Int_t   fNPar;            // Number of detector param 
119     Double_t *fDetPar;         //[fNPar] Array of parameters
120
121     Double_t fNoiseP;          // Noise on Pside
122     Double_t fNoiseN;          // Noise on Nside
123     Double_t fSigmaP;          // Sigma charge spread on Pside
124     Double_t fSigmaN;          // Sigma charge spread on Nside
125     
126     TArrayF fGainP;           // Gain for P side channels
127     TArrayF fGainN;           // Gain for N side channels
128
129     TArrayF fNoisP;           // Noise for P side channels
130     TArrayF fNoisN;           // Noise for N side channels
131
132     Float_t fNoisePThreshold;     // need to decide if channel is noisy  
133     TArrayI  fNoisyPChannelsList; // list of P side noisy channels
134     Float_t fNoiseNThreshold;     // need to decide if channel is noisy  
135     TArrayI  fNoisyNChannelsList; // list of N side noisy channels
136
137     TArrayI  fDeadNChannelsList;  // list of P side dead channels
138     TArrayI  fDeadPChannelsList;  // list of N side dead channels
139
140  private:
141     AliITSCalibrationSSD(const AliITSCalibrationSSD &source); // copy constructor
142     AliITSCalibrationSSD& operator=(const AliITSCalibrationSSD &source); // ass. op.
143
144     ClassDef(AliITSCalibrationSSD,1) //Response class for SSD
145 };
146 #endif