Pedestal subtraction for SSD (E. Fragiacomo)
[u/mrichter/AliRoot.git] / ITS / AliITSCalibrationSSD.cxx
1 /**************************************************************************
2  * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                         *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15 /* $Id$  */
16
17 #include "AliITSCalibrationSSD.h"
18 //////////////////////////////////////////////////////
19 //  Calibration class for set:ITS                   //
20 //  Specific subdetector implementation             //
21 //  for silicon strips detectors                    //
22 //                                                  //
23 //                                                  //
24 //////////////////////////////////////////////////////
25
26 const Double_t AliITSCalibrationSSD::fgkNoiseNDefault = 625.;
27 const Double_t AliITSCalibrationSSD::fgkNoisePDefault = 420.;
28 const Int_t AliITSCalibrationSSD::fgkNParDefault = 6;
29 const Double_t AliITSCalibrationSSD::fgkSigmaPDefault = 3.;
30 const Double_t AliITSCalibrationSSD::fgkSigmaNDefault = 2.;
31
32 ClassImp(AliITSCalibrationSSD)
33
34 //______________________________________________________________________
35 AliITSCalibrationSSD::AliITSCalibrationSSD():
36 fNPar(0),
37 fDetPar(0),
38 fNoiseP(0),
39 fNoiseN(0),
40 fSigmaP(0),
41 fSigmaN(0),
42 fNoise(0),
43 fGain(0),
44 fBadChannels(0),
45 fGainP(0),
46 fGainN(0),
47 fNoisP(0),
48 fNoisN(0),
49 fNoisePThreshold(0),
50 fNoisyPChannelsList(0),
51 fNoiseNThreshold(0),
52 fNoisyNChannelsList(0),
53 fDeadNChannelsList(0),
54 fDeadPChannelsList(0){
55     // Default Constructor
56
57     SetNoiseParam(fgkNoisePDefault,fgkNoiseNDefault);
58 }
59 //______________________________________________________________________
60 AliITSCalibrationSSD::AliITSCalibrationSSD(const char *dataType):
61 fNPar(0),
62 fDetPar(0),
63 fNoiseP(0),
64 fNoiseN(0),
65 fSigmaP(0),
66 fSigmaN(0),
67 fNoise(0),
68 fPedestal(0),
69 fGain(0),
70 fBadChannels(0),
71 fGainP(0),
72 fGainN(0),
73 fNoisP(0),
74 fNoisN(0),
75 fPedP(0),
76 fPedN(0),
77 fNoisePThreshold(0),
78 fNoisyPChannelsList(0),
79 fNoiseNThreshold(0),
80 fNoisyNChannelsList(0),
81 fDeadNChannelsList(0),
82 fDeadPChannelsList(0){
83     // constructor
84
85     SetNoiseParam(fgkNoisePDefault,fgkNoiseNDefault);
86     SetDataType(dataType);
87     SetSigmaSpread(fgkSigmaPDefault,fgkSigmaNDefault);
88     SetNDetParam(fgkNParDefault);   // Sets fNPar=6 by default.
89     fDetPar = new Double_t[fNPar];
90     if (fNPar==6) {
91         fDetPar[0]=10.;
92         fDetPar[1]=5.;
93         fDetPar[2]=0.02;
94         fDetPar[3]=0.02;
95         fDetPar[4]=0.02;
96         fDetPar[5]=0.03;
97     } // end if
98 }
99 //______________________________________________________________________
100 AliITSCalibrationSSD::~AliITSCalibrationSSD(){
101     // destructor
102
103     delete [] fDetPar;
104 }
105 //______________________________________________________________________
106 void AliITSCalibrationSSD::SetDetParam(Double_t  *par){
107     // set det param
108     Int_t i;
109
110     for (i=0; i<fNPar; i++) {
111         fDetPar[i]=par[i];
112         //printf("\n CompressPar %d %d \n",i,fCPar[i]);    
113     } // end for i
114 }
115 //______________________________________________________________________
116 void AliITSCalibrationSSD::GetDetParam(Double_t  *par) const {
117     // get det param
118     Int_t i;
119
120     for (i=0; i<fNPar; i++) {
121         par[i]=fDetPar[i];
122     } // end for i
123 }