]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/ITSbase/AliITSresponseSDD.h
doxy: consider comments after last line
[u/mrichter/AliRoot.git] / ITS / ITSbase / AliITSresponseSDD.h
CommitLineData
b0f5e3fc 1#ifndef ALIITSRESPONSESDD_H
2#define ALIITSRESPONSESDD_H
48058160 3
c2bd28b6 4/* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
48058160 5 * See cxx source for full Copyright notice */
6
88cb7938 7
253e68a0 8#include <TObject.h>
3176641e 9#include <AliLog.h>
b0f5e3fc 10
c2bd28b6 11/* $Id$ */
12
fcf95fc7 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/////////////////////////////////////////////////////////////
b0f5e3fc 18
253e68a0 19class AliITSresponseSDD : public TObject {
69b82143 20 public:
ef24eb3b 21 enum {kVDCorr2Side = BIT(14),kVDCorrMult = BIT(15)}; // if bit set, the object contains separate corrections for 2 sides
e71a6286 22 //
69b82143 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 }
7bba0484 46 virtual void SetMCDefaults();
69b82143 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){
776c19a3 50 if(CheckModuleIndex(modIndex)) fTimeZero[modIndex-kNSPDmods]=tzero;
69b82143 51 }
52
e71a6286 53 virtual void SetDeltaVDrift(Int_t modIndex, Float_t dv, Bool_t rightSide=kFALSE) {
54 int ind = GetVDIndex(modIndex,rightSide);
55 if (ind>=0) fDeltaVDrift[ind] = dv;
57019696 56 }
69b82143 57
e71a6286 58 virtual Float_t GetDeltaVDrift(Int_t modIndex,Bool_t rightSide=kFALSE) const {
59 int ind = GetVDIndex(modIndex,rightSide);
60 return ind<0 ? 0.:fDeltaVDrift[ind];
61 }
62 //
63 Bool_t IsVDCorr2Side() const {return TestBit(kVDCorr2Side);}
ef24eb3b 64 Bool_t IsVDCorrMult() const {return TestBit(kVDCorrMult);}
e71a6286 65 void SetVDCorr2Side(Bool_t v=kTRUE) {SetBit(kVDCorr2Side,v);}
ef24eb3b 66 void SetVDCorrMult(Bool_t v=kTRUE) {SetBit(kVDCorrMult,v);}
e71a6286 67 //
57019696 68 static Float_t DefaultTimeOffset() {return fgkTimeOffsetDefault;}
69b82143 69 virtual void SetTimeOffset(Float_t to){fTimeOffset = to;}
70 virtual Float_t GetTimeOffset()const {return fTimeOffset;}
57019696 71 virtual Float_t GetTimeZero(Int_t modIndex) const {
776c19a3 72 if(CheckModuleIndex(modIndex)) return fTimeZero[modIndex-kNSPDmods];
73 else return 0.;
69b82143 74 }
57019696 75
76 virtual void SetADC2keV(Float_t conv){fADC2keV=conv;}
77 virtual Float_t GetADC2keV()const {return fADC2keV;}
78 virtual void SetADCtokeV(Int_t modIndex, Float_t conv){
776c19a3 79 if(CheckModuleIndex(modIndex)) fADCtokeV[modIndex-kNSPDmods]=conv;
57019696 80 }
81 virtual Float_t GetADCtokeV(Int_t modIndex) const {
776c19a3 82 if(CheckModuleIndex(modIndex)) return fADCtokeV[modIndex-kNSPDmods];
83 else return 0.;
69b82143 84 }
a66a0eb6 85
d644eb2d 86 virtual void SetChargevsTime(Float_t slope){fChargevsTime=slope;}
d644eb2d 87 virtual Float_t GetChargevsTime()const {return fChargevsTime;}
88
374200ee 89 virtual void SetADCvsDriftTime(Int_t modIndex, Float_t slope){
776c19a3 90 if(CheckModuleIndex(modIndex)) fADCvsDriftTime[modIndex-kNSPDmods]=slope;
374200ee 91 }
7bba0484 92 virtual Float_t GetADCvsDriftTime(Int_t modIndex, Bool_t isMC=kFALSE) const {
93 if(CheckModuleIndex(modIndex)){
94 if(isMC) return fADCvsDriftTimeMC[modIndex-kNSPDmods];
95 return fADCvsDriftTime[modIndex-kNSPDmods];
96 }
776c19a3 97 else return 0.;
374200ee 98 }
99
d644eb2d 100 static Float_t DefaultADC2keV() {return fgkADC2keVDefault;}
101 static Float_t DefaultChargevsTime() {return fgkChargevsTimeDefault;}
374200ee 102 static Float_t DefaultADCvsDriftTime() {return fgkADCvsDrTimeDefault;}
a66a0eb6 103
69b82143 104 static Float_t GetCarlosRXClockPeriod() {return fgkCarlosRXClockPeriod;}
dfb09666 105 void PrintChargeCalibrationParams() const;
106 void PrintTimeZeroes() const;
107 void PrintVdriftCorerctions() const;
e71a6286 108
109
110 protected:
111 //
112 virtual Int_t GetVDIndex(Int_t modIndex, Bool_t rightSide=kFALSE) const {
113 int ind = modIndex - kNSPDmods;
114 if(ind<0 || ind>=kNSDDmods) {AliError(Form("SDD module number %d out of range",modIndex)); return -1;}
115 return (rightSide && IsVDCorr2Side()) ? ind + kNSDDmods : ind;
116 }
117
776c19a3 118 virtual Bool_t CheckModuleIndex(Int_t modIndex) const {
119 if(modIndex<kNSPDmods || modIndex>=kNSPDmods+kNSDDmods){ AliError(Form("SDD module number %d out of range",modIndex)); return kFALSE;}
120 return kTRUE;
121 }
8ba39da9 122
48058160 123 protected:
fcf95fc7 124
69b82143 125 enum {kNSPDmods = 240};
126 enum {kNSDDmods = 260};
127 enum {kNLaddersLay3 = 14};
128 enum {kNLaddersLay4 = 22};
3176641e 129
130
69b82143 131 static const Float_t fgkTimeOffsetDefault; // default for fTimeOffset
132 static const Float_t fgkADC2keVDefault; // default for fADC2keV
d644eb2d 133 static const Float_t fgkChargevsTimeDefault; // default for fChargevsTime
374200ee 134 static const Float_t fgkADCvsDrTimeDefault; // default for fADCvsDriftTime
69b82143 135 static const Float_t fgkCarlosRXClockPeriod; // clock period for CarlosRX
703a4e51 136
69b82143 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
e71a6286 140 Float_t fDeltaVDrift[2*kNSDDmods]; // Vdrift correction (um/ns) for each module left (<kNSDDmods) and right (>=kNSDDmods) sides
69b82143 141 Float_t fADC2keV; // Conversion factor from ADC to keV
57019696 142 // --> obsolete, kept for backw. comp.
374200ee 143 Float_t fChargevsTime; // --> obsolete, kept for backw. comp.
144
145 Float_t fADCvsDriftTime[kNSDDmods]; // Correction for zero suppression effect
7bba0484 146 Float_t fADCvsDriftTimeMC[kNSDDmods]; // Correction for zero suppression effect (MC)
374200ee 147 Float_t fADCtokeV[kNSDDmods]; // ADC to keV conversion for each module
57019696 148
703a4e51 149 private:
703a4e51 150
69b82143 151 AliITSresponseSDD(const AliITSresponseSDD &ob); // copy constructor
152 AliITSresponseSDD& operator=(const AliITSresponseSDD & /* source */); // ass. op.
fa1750f9 153
7bba0484 154 ClassDef(AliITSresponseSDD,22)
69b82143 155
50d05d7b 156 };
b0f5e3fc 157#endif