]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - ITS/AliITSresponseSDD.cxx
Protection against events with no or insufficient number of clusters. Plus some chang...
[u/mrichter/AliRoot.git] / ITS / AliITSresponseSDD.cxx
... / ...
CommitLineData
1/**************************************************************************
2 * Copyright(c) 1998-1999, 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
16/* $Id$ */
17
18//////////////////////////////////////////////////////
19// Base response class forITS //
20// It is used to set static data members //
21// connected to parameters equal for all //
22// the modules //
23// //
24// //
25//////////////////////////////////////////////////////
26
27#include <TMath.h>
28
29#include "AliITSresponseSDD.h"
30
31const Int_t AliITSresponseSDD::fgkMaxAdcDefault = 1024;
32const Float_t AliITSresponseSDD::fgkDynamicRangeDefault = 132.;
33const Float_t AliITSresponseSDD::fgkfChargeLossDefault = 0;
34const Float_t AliITSresponseSDD::fgkDiffCoeffDefault = 3.23;
35const Float_t AliITSresponseSDD::fgkDiffCoeff1Default = 30.;
36const TString AliITSresponseSDD::fgkParam1Default = "same";
37const TString AliITSresponseSDD::fgkParam2Default = "same";
38const TString AliITSresponseSDD::fgkOptionDefault = "1D";
39const Float_t AliITSresponseSDD::fgkDriftSpeedDefault = 7.3;
40const Float_t AliITSresponseSDD::fgkTimeOffsetDefault = 54.07;
41const Float_t AliITSresponseSDD::fgkADC2keVDefault = 5.243;
42const Float_t AliITSresponseSDD::fgkNsigmasDefault = 3.;
43const Int_t AliITSresponseSDD::fgkNcompsDefault = 121;
44
45ClassImp(AliITSresponseSDD)
46
47//_________________________________________________________________________
48AliITSresponseSDD::AliITSresponseSDD():
49AliITSresponse(),
50fJitterError(0.),
51fDynamicRange(0.),
52fChargeLoss(0.),
53fTimeOffset(fgkTimeOffsetDefault),
54fADC2keV(fgkADC2keVDefault),
55fElectronics(0),
56fMaxAdc(fgkMaxAdcDefault),
57fNsigmas(fgkNsigmasDefault),
58fGaus(),
59fNcomps(fgkNcompsDefault),
60fBitComp(kFALSE),
61fOption(),
62fParam1(),
63fParam2() {
64 // default constructor
65 fGaus = 0;
66 SetDiffCoeff(fgkDiffCoeffDefault,fgkDiffCoeff1Default);
67 // SetNLookUp(fgkNcompsDefault);
68
69 SetJitterError();
70 SetElectronics();
71 SetDynamicRange(fgkDynamicRangeDefault);
72 SetChargeLoss(fgkfChargeLossDefault);
73 SetParamOptions(fgkParam1Default.Data(),fgkParam2Default.Data());
74 SetZeroSupp(fgkOptionDefault);
75 SetDo10to8();
76 SetOutputOption();
77}
78
79
80//______________________________________________________________________
81AliITSresponseSDD::~AliITSresponseSDD() {
82
83 if(fGaus) delete fGaus;
84}
85
86
87//______________________________________________________________________
88Int_t AliITSresponseSDD::Convert8to10(Int_t signal) const {
89 // Undo the lossive 10 to 8 bit compression.
90 // code from Davide C. and Albert W.
91
92 if(Do10to8()){ // kTRUE if the compression is active
93 if (signal < 0 || signal > 255) {
94 Warning("Convert8to10","out of range signal=%d",signal);
95 return 0;
96 } // end if signal <0 || signal >255
97
98 if (signal < 128) return signal;
99 if (signal < 192) {
100 if (TMath::Odd(signal)) return (128+((signal-128)<<1));
101 else return (128+((signal-128)<<1)+1);
102 } // end if signal < 192
103 if (signal < 224) {
104 if (TMath::Odd(signal)) return (256+((signal-192)<<3)+3);
105 else return (256+((signal-192)<<3)+4);
106 } // end if signal < 224
107 if (TMath::Odd(signal)) return (512+((signal-224)<<4)+7);
108 return (512+((signal-224)<<4)+8);
109 }
110 else {
111 return signal;
112 }
113}
114
115//________________________________________________________________________
116void AliITSresponseSDD::SetNLookUp(Int_t p1){
117 // Set number of sigmas over which cluster disintegration is performed
118 fNcomps=p1;
119 if (fGaus) delete fGaus;
120 fGaus = new TArrayF(fNcomps+1);
121 for(Int_t i=0; i<=fNcomps; i++) {
122 Float_t x = -fNsigmas + (2.*i*fNsigmas)/(fNcomps-1);
123 (*fGaus)[i] = exp(-((x*x)/2));
124 }
125}