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"
14 //////////////////////////////////////////////
15 // Calibration class for SSD //
17 //////////////////////////////////////////////
18 class AliITSCalibrationSSD : public AliITSCalibration {
21 AliITSCalibrationSSD();
22 AliITSCalibrationSSD(const char *dataType);
23 virtual ~AliITSCalibrationSSD();
25 Float_t GetNoiseP(Int_t n) {return fNoise->GetNoiseP(fModule,n); }
26 Float_t GetNoiseN(Int_t n) {return fNoise->GetNoiseN(fModule,n); }
27 void SetNoise( AliITSNoiseSSDv2* noise) {fNoise=noise;}
29 Float_t GetPedestalP(Int_t n) {return fPedestal->GetPedestalP(fModule,n); }
30 Float_t GetPedestalN(Int_t n) {return fPedestal->GetPedestalN(fModule,n); }
31 void SetPedestal( AliITSPedestalSSDv2* pedestal) {fPedestal=pedestal;}
33 Float_t GetGainP(Int_t n) {return fGain->GetGainP(fModule,n); }
34 Float_t GetGainN(Int_t n) {return fGain->GetGainN(fModule,n); }
35 void SetGainP(Int_t n, Float_t value) {fGain->AddGainP(fModule,n,value);}
36 void SetGainN(Int_t n, Float_t value) {fGain->AddGainN(fModule,n,value);}
37 void SetGain( AliITSGainSSDv2* gain) {fGain=gain;}
41 for(Int_t i=0;i<fgkChipsPerModule;i++) fIsChipBad[i]=kTRUE;
43 virtual Bool_t IsBad() const { return fIsBad; }
44 void SetChipBad(Int_t nChip) {
45 fIsChipBad[nChip] = kTRUE;
47 void FillBadChipMap();
48 virtual Bool_t IsChipBad(Int_t nChip) const {
49 return fIsChipBad[nChip];
51 Int_t ChipsPerModule() const{return fgkChipsPerModule;} // # chips/module
52 Int_t ChannelsPerChip() const{ return fgkChannelsPerChip;}// #channels/chip
54 void SetBadChannels( AliITSBadChannelsSSDv2* badchannels) {
55 fBadChannels=badchannels;}
56 Char_t GetBadPChannel(Int_t n) {
57 return fBadChannels->GetBadChannelP(fModule,n); }
58 Char_t GetBadNChannel(Int_t n) {
59 return fBadChannels->GetBadChannelN(fModule,n); }
60 Bool_t IsPChannelBad(Int_t n) {
61 return fBadChannels->GetBadChannelP(fModule,n)&1; }
62 Bool_t IsNChannelBad(Int_t n) {
63 return fBadChannels->GetBadChannelN(fModule,n)&1; }
66 virtual void SetNDetParam(Int_t npar) {
67 // set number of param
70 virtual void SetDetParam(Double_t *par);
73 virtual Int_t NDetParam() const {
77 virtual void GetDetParam(Double_t *dpar) const;
79 virtual void SetSigmaSpread(Double_t, Double_t) {
80 NotImplemented("SetSigmaSpread");}
82 virtual void SigmaSpread(Double_t &, Double_t &) const {
83 NotImplemented("SetSigmaSpread");}
85 void SetModule(Int_t mod){fModule = mod;}
86 void SetModuleIndex(Int_t modId){
87 fModule=modId-500; // temporary patch, 500 is n. of SPD+SDD modules
90 void SetKeVperADC(Double_t a=86.4/120.){fKeVperADC = a;}
91 Double_t ADCToKeV(Double_t adc) const {return adc*fKeVperADC;}
93 void SetSSDADCpereV(Double_t a=(120./24888.9)*(85.0/77.0)){fSSDADCpereV = a;}
94 Double_t GetSSDDEvToADC(Double_t eV) const {return eV*fSSDADCpereV;}
95 Int_t GetSSDIEvToADC(Double_t eV) const {
96 return ((Int_t) GetSSDDEvToADC(eV)); }
101 static const Int_t fgkChipsPerModule = 12; // Number of chips/module
102 static const Int_t fgkChannelsPerChip = 128; // Number of channels/chip
104 static const Int_t fgkNParDefault; // default for fNPar
106 Int_t fModule; //! module number (range 0 -> 1697)
108 Int_t fNPar; // Number of detector param
109 Double_t *fDetPar; //[fNPar] Array of parameters
111 AliITSNoiseSSDv2 *fNoise;
112 AliITSPedestalSSDv2 *fPedestal;
113 AliITSGainSSDv2 *fGain;
114 AliITSBadChannelsSSDv2 *fBadChannels;
116 Bool_t fIsBad; // module is dead or alive ?
117 Bool_t fIsChipBad[fgkChipsPerModule]; // chip is dead or alive ?
119 Double_t fSSDADCpereV; // Constant to convert eV to ADC for SSD.
120 Double_t fKeVperADC; // Constant to convert ADC to keV
123 AliITSCalibrationSSD(const AliITSCalibrationSSD &source); // copy constructor
124 AliITSCalibrationSSD& operator=(const AliITSCalibrationSSD &source); // ass. op.
126 ClassDef(AliITSCalibrationSSD,6) //Response class for SSD