ITSSPDPHYSda: New detector algorithm for finding dead and noisy pixels.
[u/mrichter/AliRoot.git] / ITS / AliITSCalibrationSPD.h
CommitLineData
fcf95fc7 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
7#include "TRandom.h"
8#include "AliITSCalibration.h"
9#include "TArrayI.h"
10#include "AliITSresponseSPD.h"
11
12
13////////////////////////////////////////////////////
14// //
15// ITS response class for SPD //
16////////////////////////////////////////////////////
17class 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;}
5bfe44ce 28 // Set Bias Voltage parameter
29 virtual void SetBiasVoltage(Double_t bias=18.182) {fBiasVoltage=bias;}
30 Double_t GetBiasVoltage() const {return fBiasVoltage;}
fcf95fc7 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();}
5bfe44ce 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;}
fcf95fc7 51
fcf95fc7 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");}
5bfe44ce 67
68 virtual void GetCouplingOption(char *opt) const {((AliITSresponseSPD*)fResponse)->CouplingOption(opt);}
69 virtual void SetCouplingOption(const char* opt) {((AliITSresponseSPD*)fResponse)->SetCouplingOption(opt);}
fcf95fc7 70 virtual void SetParamOptions(const char* a,const char* b) {((AliITSresponseSPD*)fResponse)->SetParamOptions(a,b);}
71 virtual void GetParamOptions(char *a,char* b) const {((AliITSresponseSPD*)fResponse)->ParamOptions(a,b);}
5bfe44ce 72 virtual void SetSigmaDiffusionAsymmetry(Double_t ecc) {((AliITSresponseSPD*)fResponse)->SetSigmaDiffusionAsymmetry(ecc);}
73 virtual void GetSigmaDiffusionAsymmetry(Double_t &ecc) const {((AliITSresponseSPD*)fResponse)->GetSigmaDiffusionAsymmetry(ecc);}
74
6727e2db 75 void AddBad(UInt_t col, UInt_t row);
76 Int_t GetNrBad() const {return fNrBad;}
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 ;
5bfe44ce 81
6727e2db 82 void SetBadList(TArrayI badlist) {fBadChannels=badlist;}
83 void SetNrBad(UInt_t nr) {fNrBad=nr;}
fcf95fc7 84
85 protected:
86 // static const Double_t fgkDiffCoeffDefault; //default for fDiffCoeff
87 static const Double_t fgkThreshDefault; //default for fThresh
88 static const Double_t fgkSigmaDefault; //default for fSigma
5bfe44ce 89 static const Double_t fgkCouplColDefault; //default for fCouplCol
90 static const Double_t fgkCouplRowDefault; //default for fCouplRow
91 static const Double_t fgkBiasVoltageDefault; //default for fBiasVoltage
fcf95fc7 92 Double_t fBaseline; // Base-line value
93 Double_t fNoise; // Gaussian noise scale
94 Double_t fThresh; // Threshold value
95 Double_t fSigma; // Noise + threshold fluctuations value
5bfe44ce 96 Double_t fCouplCol; // Coupling parameter along the cols
97 Double_t fCouplRow; // Coupling parameter along the rows
98 Double_t fBiasVoltage; // Bias Voltage for the SPD (used to compute DistanceOverVoltage)
6727e2db 99 UInt_t fNrBad; // Nr of bad pixels
100 TArrayI fBadChannels; // Array with bad channels info (col0,row0,col1...rowN) N = fNrBad
fcf95fc7 101
6727e2db 102 ClassDef(AliITSCalibrationSPD,5) // SPD response
fcf95fc7 103};
104
105#endif