Line data Source code
1 : #ifndef ALIITSRESPONSESDD_H
2 : #define ALIITSRESPONSESDD_H
3 :
4 : /* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
5 : * See cxx source for full Copyright notice */
6 :
7 :
8 : #include <TObject.h>
9 : #include <AliLog.h>
10 :
11 : /* $Id$ */
12 :
13 : /////////////////////////////////////////////////////////////
14 : // Base settings for the ITS response classes. //
15 : // The data member of this class are static and set once //
16 : // for all the modules. //
17 : /////////////////////////////////////////////////////////////
18 :
19 : class AliITSresponseSDD : public TObject {
20 : public:
21 : enum {kVDCorr2Side = BIT(14),kVDCorrMult = BIT(15)}; // if bit set, the object contains separate corrections for 2 sides
22 : //
23 : AliITSresponseSDD();
24 18 : virtual ~AliITSresponseSDD(){};
25 :
26 : virtual void SetSideATimeZero(Float_t tzero){
27 0 : SetLayer3ATimeZero(tzero);
28 0 : SetLayer4ATimeZero(tzero);
29 0 : }
30 : virtual void SetSideCTimeZero(Float_t tzero){
31 0 : SetLayer3CTimeZero(tzero);
32 0 : SetLayer4CTimeZero(tzero);
33 0 : }
34 : virtual void SetLayer3ATimeZero(Float_t tzero){
35 0 : for(Int_t iLad=1; iLad<=kNLaddersLay3; iLad++) SetHalfLadderATimeZero(3,iLad,tzero);
36 0 : }
37 : virtual void SetLayer3CTimeZero(Float_t tzero){
38 0 : for(Int_t iLad=1; iLad<=kNLaddersLay3; iLad++) SetHalfLadderCTimeZero(3,iLad,tzero);
39 0 : }
40 : virtual void SetLayer4ATimeZero(Float_t tzero){
41 0 : for(Int_t iLad=1; iLad<=kNLaddersLay4; iLad++) SetHalfLadderATimeZero(4,iLad,tzero);
42 0 : }
43 : virtual void SetLayer4CTimeZero(Float_t tzero){
44 0 : for(Int_t iLad=1; iLad<=kNLaddersLay4; iLad++) SetHalfLadderCTimeZero(4,iLad,tzero);
45 0 : }
46 : virtual void SetMCDefaults();
47 : virtual void SetHalfLadderATimeZero(Int_t lay, Int_t lad, Float_t tzero);
48 : virtual void SetHalfLadderCTimeZero(Int_t lay, Int_t lad, Float_t tzero);
49 : virtual void SetModuleTimeZero(Int_t modIndex, Float_t tzero){
50 0 : if(CheckModuleIndex(modIndex)) fTimeZero[modIndex-kNSPDmods]=tzero;
51 0 : }
52 :
53 : virtual void SetDeltaVDrift(Int_t modIndex, Float_t dv, Bool_t rightSide=kFALSE) {
54 0 : int ind = GetVDIndex(modIndex,rightSide);
55 0 : if (ind>=0) fDeltaVDrift[ind] = dv;
56 0 : }
57 :
58 : virtual Float_t GetDeltaVDrift(Int_t modIndex,Bool_t rightSide=kFALSE) const {
59 1073 : int ind = GetVDIndex(modIndex,rightSide);
60 3219 : return ind<0 ? 0.:fDeltaVDrift[ind];
61 : }
62 : //
63 1044 : Bool_t IsVDCorr2Side() const {return TestBit(kVDCorr2Side);}
64 0 : Bool_t IsVDCorrMult() const {return TestBit(kVDCorrMult);}
65 3 : void SetVDCorr2Side(Bool_t v=kTRUE) {SetBit(kVDCorr2Side,v);}
66 0 : void SetVDCorrMult(Bool_t v=kTRUE) {SetBit(kVDCorrMult,v);}
67 : //
68 0 : static Float_t DefaultTimeOffset() {return fgkTimeOffsetDefault;}
69 0 : virtual void SetTimeOffset(Float_t to){fTimeOffset = to;}
70 0 : virtual Float_t GetTimeOffset()const {return fTimeOffset;}
71 : virtual Float_t GetTimeZero(Int_t modIndex) const {
72 984 : if(CheckModuleIndex(modIndex)) return fTimeZero[modIndex-kNSPDmods];
73 0 : else return 0.;
74 328 : }
75 :
76 0 : virtual void SetADC2keV(Float_t conv){fADC2keV=conv;}
77 0 : virtual Float_t GetADC2keV()const {return fADC2keV;}
78 : virtual void SetADCtokeV(Int_t modIndex, Float_t conv){
79 0 : if(CheckModuleIndex(modIndex)) fADCtokeV[modIndex-kNSPDmods]=conv;
80 0 : }
81 : virtual Float_t GetADCtokeV(Int_t modIndex) const {
82 978 : if(CheckModuleIndex(modIndex)) return fADCtokeV[modIndex-kNSPDmods];
83 0 : else return 0.;
84 326 : }
85 :
86 0 : virtual void SetChargevsTime(Float_t slope){fChargevsTime=slope;}
87 0 : virtual Float_t GetChargevsTime()const {return fChargevsTime;}
88 :
89 : virtual void SetADCvsDriftTime(Int_t modIndex, Float_t slope){
90 0 : if(CheckModuleIndex(modIndex)) fADCvsDriftTime[modIndex-kNSPDmods]=slope;
91 0 : }
92 : virtual Float_t GetADCvsDriftTime(Int_t modIndex, Bool_t isMC=kFALSE) const {
93 228 : if(CheckModuleIndex(modIndex)){
94 342 : if(isMC) return fADCvsDriftTimeMC[modIndex-kNSPDmods];
95 114 : return fADCvsDriftTime[modIndex-kNSPDmods];
96 : }
97 0 : else return 0.;
98 228 : }
99 :
100 0 : static Float_t DefaultADC2keV() {return fgkADC2keVDefault;}
101 0 : static Float_t DefaultChargevsTime() {return fgkChargevsTimeDefault;}
102 0 : static Float_t DefaultADCvsDriftTime() {return fgkADCvsDrTimeDefault;}
103 :
104 460 : static Float_t GetCarlosRXClockPeriod() {return fgkCarlosRXClockPeriod;}
105 : void PrintChargeCalibrationParams() const;
106 : void PrintTimeZeroes() const;
107 : void PrintVdriftCorerctions() const;
108 :
109 :
110 : protected:
111 : //
112 : virtual Int_t GetVDIndex(Int_t modIndex, Bool_t rightSide=kFALSE) const {
113 1073 : int ind = modIndex - kNSPDmods;
114 1073 : if(ind<0 || ind>=kNSDDmods) {AliError(Form("SDD module number %d out of range",modIndex)); return -1;}
115 3741 : return (rightSide && IsVDCorr2Side()) ? ind + kNSDDmods : ind;
116 1073 : }
117 :
118 : virtual Bool_t CheckModuleIndex(Int_t modIndex) const {
119 1764 : if(modIndex<kNSPDmods || modIndex>=kNSPDmods+kNSDDmods){ AliError(Form("SDD module number %d out of range",modIndex)); return kFALSE;}
120 882 : return kTRUE;
121 882 : }
122 :
123 : protected:
124 :
125 : enum {kNSPDmods = 240};
126 : enum {kNSDDmods = 260};
127 : enum {kNLaddersLay3 = 14};
128 : enum {kNLaddersLay4 = 22};
129 :
130 :
131 : static const Float_t fgkTimeOffsetDefault; // default for fTimeOffset
132 : static const Float_t fgkADC2keVDefault; // default for fADC2keV
133 : static const Float_t fgkChargevsTimeDefault; // default for fChargevsTime
134 : static const Float_t fgkADCvsDrTimeDefault; // default for fADCvsDriftTime
135 : static const Float_t fgkCarlosRXClockPeriod; // clock period for CarlosRX
136 :
137 : Float_t fTimeOffset; // Time offset due to electronic delays
138 : // --> obsolete, kept for backw. comp.
139 : Float_t fTimeZero[kNSDDmods]; // Time Zero for each module
140 : Float_t fDeltaVDrift[2*kNSDDmods]; // Vdrift correction (um/ns) for each module left (<kNSDDmods) and right (>=kNSDDmods) sides
141 : Float_t fADC2keV; // Conversion factor from ADC to keV
142 : // --> obsolete, kept for backw. comp.
143 : Float_t fChargevsTime; // --> obsolete, kept for backw. comp.
144 :
145 : Float_t fADCvsDriftTime[kNSDDmods]; // Correction for zero suppression effect
146 : Float_t fADCvsDriftTimeMC[kNSDDmods]; // Correction for zero suppression effect (MC)
147 : Float_t fADCtokeV[kNSDDmods]; // ADC to keV conversion for each module
148 :
149 : private:
150 :
151 : AliITSresponseSDD(const AliITSresponseSDD &ob); // copy constructor
152 : AliITSresponseSDD& operator=(const AliITSresponseSDD & /* source */); // ass. op.
153 :
154 142 : ClassDef(AliITSresponseSDD,22)
155 :
156 : };
157 : #endif
|