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