]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSCalibrationSSD.h
SSD: updated segmentation class and cleanup of ClusterFinder (M. Van Leeuwen). Elimin...
[u/mrichter/AliRoot.git] / ITS / AliITSCalibrationSSD.h
1 #ifndef ALIITSCALIBRATIONSSD_H
2 #define ALIITSCALIBRATIONSSD_H
3 /* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */ 
5 #include "AliITSCalibration.h"
6 #include "AliITSNoiseSSDv2.h"
7 #include "AliITSPedestalSSDv2.h"
8 #include "AliITSGainSSDv2.h"
9 #include "AliITSBadChannelsSSDv2.h"
10 #include "TArrayF.h"
11 #include "TArrayI.h"
12
13 /* $Id$ */
14 //////////////////////////////////////////////
15 // Calibration class for SSD                   //
16 //                                          //
17 //////////////////////////////////////////////
18 class AliITSCalibrationSSD : public AliITSCalibration {
19
20  public:
21     AliITSCalibrationSSD();
22     AliITSCalibrationSSD(const char *dataType);
23     virtual ~AliITSCalibrationSSD();
24
25     virtual  void   SetNoiseParam(Double_t , Double_t ) {
26       NotImplemented("SetNoiseParam");}
27     
28     virtual void    GetNoiseParam(Double_t &, Double_t &) const {
29       NotImplemented("SetNoiseParam");}
30
31     Float_t GetNoiseP(Int_t n) {return fNoise->GetNoiseP(fModule,n); }
32     Float_t GetNoiseN(Int_t n) {return fNoise->GetNoiseN(fModule,n); }
33     void SetNoise( AliITSNoiseSSDv2* noise) {fNoise=noise;}
34
35     Float_t GetPedestalP(Int_t n) {return fPedestal->GetPedestalP(fModule,n); }
36     Float_t GetPedestalN(Int_t n) {return fPedestal->GetPedestalN(fModule,n); }
37     void SetPedestal( AliITSPedestalSSDv2* pedestal) {fPedestal=pedestal;}
38
39     Float_t GetGainP(Int_t n) {return fGain->GetGainP(fModule,n); }
40     Float_t GetGainN(Int_t n) {return fGain->GetGainN(fModule,n); }
41     void SetGainP(Int_t n, Float_t value) {fGain->AddGainP(fModule,n,value);}
42     void SetGainN(Int_t n, Float_t value) {fGain->AddGainN(fModule,n,value);}
43     void SetGain( AliITSGainSSDv2* gain) {fGain=gain;}
44
45     void   SetBad() {
46       fIsBad = kTRUE;
47       for(Int_t i=0;i<fgkChipsPerModule;i++) fIsChipBad[i]=kTRUE;
48     }
49     virtual Bool_t IsBad() const { return fIsBad; }
50     void   SetChipBad(Int_t nChip) {
51       fIsChipBad[nChip] = kTRUE;
52     }
53     void FillBadChipMap();
54     virtual Bool_t IsChipBad(Int_t nChip) const {
55       return fIsChipBad[nChip];
56     }
57     Int_t ChipsPerModule() const{return fgkChipsPerModule;} // # chips/module
58     Int_t ChannelsPerChip() const{ return fgkChannelsPerChip;}// #channels/chip
59
60     void SetBadChannels( AliITSBadChannelsSSDv2* badchannels) {
61       fBadChannels=badchannels;}
62     Char_t GetBadPChannel(Int_t n) {
63       return fBadChannels->GetBadChannelP(fModule,n); }
64     Char_t GetBadNChannel(Int_t n) {
65       return fBadChannels->GetBadChannelN(fModule,n); }
66     Bool_t IsPChannelBad(Int_t n) {
67       return fBadChannels->GetBadChannelP(fModule,n)&1; }
68     Bool_t IsNChannelBad(Int_t n) {
69       return fBadChannels->GetBadChannelN(fModule,n)&1; }
70
71     //
72     virtual  void   SetNDetParam(Int_t npar) {
73         // set number of param
74         fNPar=npar;
75     }
76     virtual  void   SetDetParam(Double_t *par);
77
78     // Parameters options
79     virtual Int_t   NDetParam() const {
80         // number of param
81         return fNPar;
82     }
83     virtual void    GetDetParam(Double_t *dpar) const; 
84
85     virtual void    SetSigmaSpread(Double_t, Double_t) {
86       NotImplemented("SetSigmaSpread");}
87     
88     virtual void    SigmaSpread(Double_t &, Double_t &) const {
89       NotImplemented("SetSigmaSpread");}
90     
91     
92     virtual void   SetThresholds(Double_t /* a */, Double_t /* b */)
93       {NotImplemented("SetThresholds");}
94     virtual void   Thresholds(Double_t & /* a */, Double_t & /* b */) const 
95       {NotImplemented("Thresholds");}
96   
97  void SetModule(Int_t mod){fModule = mod;}
98
99   void SetKeVperADC(Double_t a=86.4/120.){fKeVperADC = a;}
100   Double_t ADCToKeV(Double_t adc) const {return adc*fKeVperADC;}
101
102   void SetSSDADCpereV(Double_t a=120./24888.9){fSSDADCpereV = a;}
103   Double_t GetSSDDEvToADC(Double_t eV) const {return eV*fSSDADCpereV;}
104   Int_t GetSSDIEvToADC(Double_t eV) const { 
105       return ((Int_t) GetSSDDEvToADC(eV)); }
106
107
108  protected:
109
110     static const Int_t fgkChipsPerModule  = 12;    // Number of chips/module
111     static const Int_t fgkChannelsPerChip = 128;   // Number of channels/chip
112
113     static const Int_t fgkNParDefault; // default for fNPar
114
115     Int_t fModule;          //! module number (range 0 -> 1697)
116     
117     Int_t   fNPar;            // Number of detector param 
118     Double_t *fDetPar;         //[fNPar] Array of parameters
119
120     AliITSNoiseSSDv2 *fNoise;
121     AliITSPedestalSSDv2 *fPedestal;
122     AliITSGainSSDv2 *fGain;
123     AliITSBadChannelsSSDv2 *fBadChannels;
124
125     Bool_t   fIsBad;                         // module is dead or alive ?
126     Bool_t   fIsChipBad[fgkChipsPerModule];  // chip is dead or alive ?
127
128     Double_t fSSDADCpereV;    // Constant to convert eV to ADC for SSD.
129     Double_t fKeVperADC;       // Constant to convert ADC to keV
130
131  private:
132     AliITSCalibrationSSD(const AliITSCalibrationSSD &source); // copy constructor
133     AliITSCalibrationSSD& operator=(const AliITSCalibrationSSD &source); // ass. op.
134
135     ClassDef(AliITSCalibrationSSD,5) //Response class for SSD
136       };
137 #endif