fix in calling of gaussian spread function
[u/mrichter/AliRoot.git] / ITS / AliITSresponseSDD.h
... / ...
CommitLineData
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
19class 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 virtual ~AliITSresponseSDD(){};
25
26 virtual void SetSideATimeZero(Float_t tzero){
27 SetLayer3ATimeZero(tzero);
28 SetLayer4ATimeZero(tzero);
29 }
30 virtual void SetSideCTimeZero(Float_t tzero){
31 SetLayer3CTimeZero(tzero);
32 SetLayer4CTimeZero(tzero);
33 }
34 virtual void SetLayer3ATimeZero(Float_t tzero){
35 for(Int_t iLad=1; iLad<=kNLaddersLay3; iLad++) SetHalfLadderATimeZero(3,iLad,tzero);
36 }
37 virtual void SetLayer3CTimeZero(Float_t tzero){
38 for(Int_t iLad=1; iLad<=kNLaddersLay3; iLad++) SetHalfLadderCTimeZero(3,iLad,tzero);
39 }
40 virtual void SetLayer4ATimeZero(Float_t tzero){
41 for(Int_t iLad=1; iLad<=kNLaddersLay4; iLad++) SetHalfLadderATimeZero(4,iLad,tzero);
42 }
43 virtual void SetLayer4CTimeZero(Float_t tzero){
44 for(Int_t iLad=1; iLad<=kNLaddersLay4; iLad++) SetHalfLadderCTimeZero(4,iLad,tzero);
45 }
46 virtual void SetHalfLadderATimeZero(Int_t lay, Int_t lad, Float_t tzero);
47 virtual void SetHalfLadderCTimeZero(Int_t lay, Int_t lad, Float_t tzero);
48 virtual void SetModuleTimeZero(Int_t modIndex, Float_t tzero){
49 if(CheckModuleIndex(modIndex)) fTimeZero[modIndex-kNSPDmods]=tzero;
50 }
51
52 virtual void SetDeltaVDrift(Int_t modIndex, Float_t dv, Bool_t rightSide=kFALSE) {
53 int ind = GetVDIndex(modIndex,rightSide);
54 if (ind>=0) fDeltaVDrift[ind] = dv;
55 }
56
57 virtual Float_t GetDeltaVDrift(Int_t modIndex,Bool_t rightSide=kFALSE) const {
58 int ind = GetVDIndex(modIndex,rightSide);
59 return ind<0 ? 0.:fDeltaVDrift[ind];
60 }
61 //
62 Bool_t IsVDCorr2Side() const {return TestBit(kVDCorr2Side);}
63 Bool_t IsVDCorrMult() const {return TestBit(kVDCorrMult);}
64 void SetVDCorr2Side(Bool_t v=kTRUE) {SetBit(kVDCorr2Side,v);}
65 void SetVDCorrMult(Bool_t v=kTRUE) {SetBit(kVDCorrMult,v);}
66 //
67 static Float_t DefaultTimeOffset() {return fgkTimeOffsetDefault;}
68 virtual void SetTimeOffset(Float_t to){fTimeOffset = to;}
69 virtual Float_t GetTimeOffset()const {return fTimeOffset;}
70 virtual Float_t GetTimeZero(Int_t modIndex) const {
71 if(CheckModuleIndex(modIndex)) return fTimeZero[modIndex-kNSPDmods];
72 else return 0.;
73 }
74
75 virtual void SetADC2keV(Float_t conv){fADC2keV=conv;}
76 virtual Float_t GetADC2keV()const {return fADC2keV;}
77 virtual void SetADCtokeV(Int_t modIndex, Float_t conv){
78 if(CheckModuleIndex(modIndex)) fADCtokeV[modIndex-kNSPDmods]=conv;
79 }
80 virtual Float_t GetADCtokeV(Int_t modIndex) const {
81 if(CheckModuleIndex(modIndex)) return fADCtokeV[modIndex-kNSPDmods];
82 else return 0.;
83 }
84
85 virtual void SetChargevsTime(Float_t slope){fChargevsTime=slope;}
86 virtual Float_t GetChargevsTime()const {return fChargevsTime;}
87
88 virtual void SetADCvsDriftTime(Int_t modIndex, Float_t slope){
89 if(CheckModuleIndex(modIndex)) fADCvsDriftTime[modIndex-kNSPDmods]=slope;
90 }
91 virtual Float_t GetADCvsDriftTime(Int_t modIndex) const {
92 if(CheckModuleIndex(modIndex)) return fADCvsDriftTime[modIndex-kNSPDmods];
93 else return 0.;
94 }
95
96 static Float_t DefaultADC2keV() {return fgkADC2keVDefault;}
97 static Float_t DefaultChargevsTime() {return fgkChargevsTimeDefault;}
98 static Float_t DefaultADCvsDriftTime() {return fgkADCvsDrTimeDefault;}
99
100 static Float_t GetCarlosRXClockPeriod() {return fgkCarlosRXClockPeriod;}
101 void PrintChargeCalibrationParams() const;
102 void PrintTimeZeroes() const;
103 void PrintVdriftCorerctions() const;
104
105
106 protected:
107 //
108 virtual Int_t GetVDIndex(Int_t modIndex, Bool_t rightSide=kFALSE) const {
109 int ind = modIndex - kNSPDmods;
110 if(ind<0 || ind>=kNSDDmods) {AliError(Form("SDD module number %d out of range",modIndex)); return -1;}
111 return (rightSide && IsVDCorr2Side()) ? ind + kNSDDmods : ind;
112 }
113
114 virtual Bool_t CheckModuleIndex(Int_t modIndex) const {
115 if(modIndex<kNSPDmods || modIndex>=kNSPDmods+kNSDDmods){ AliError(Form("SDD module number %d out of range",modIndex)); return kFALSE;}
116 return kTRUE;
117 }
118
119 protected:
120
121 enum {kNSPDmods = 240};
122 enum {kNSDDmods = 260};
123 enum {kNLaddersLay3 = 14};
124 enum {kNLaddersLay4 = 22};
125
126
127 static const Float_t fgkTimeOffsetDefault; // default for fTimeOffset
128 static const Float_t fgkADC2keVDefault; // default for fADC2keV
129 static const Float_t fgkChargevsTimeDefault; // default for fChargevsTime
130 static const Float_t fgkADCvsDrTimeDefault; // default for fADCvsDriftTime
131 static const Float_t fgkCarlosRXClockPeriod; // clock period for CarlosRX
132
133 Float_t fTimeOffset; // Time offset due to electronic delays
134 // --> obsolete, kept for backw. comp.
135 Float_t fTimeZero[kNSDDmods]; // Time Zero for each module
136 Float_t fDeltaVDrift[2*kNSDDmods]; // Vdrift correction (um/ns) for each module left (<kNSDDmods) and right (>=kNSDDmods) sides
137 Float_t fADC2keV; // Conversion factor from ADC to keV
138 // --> obsolete, kept for backw. comp.
139 Float_t fChargevsTime; // --> obsolete, kept for backw. comp.
140
141 Float_t fADCvsDriftTime[kNSDDmods]; // Correction for zero suppression effect
142 Float_t fADCtokeV[kNSDDmods]; // ADC to keV conversion for each module
143
144 private:
145
146 AliITSresponseSDD(const AliITSresponseSDD &ob); // copy constructor
147 AliITSresponseSDD& operator=(const AliITSresponseSDD & /* source */); // ass. op.
148
149 ClassDef(AliITSresponseSDD,21)
150
151 };
152#endif