]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSCalibration.h
Possibility of switching on Lorentz drift in SPD (G. Bruno)
[u/mrichter/AliRoot.git] / ITS / AliITSCalibration.h
1 #ifndef ALIITSCALIBRATION_H
2 #define ALIITSCALIBRATION_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id:$ */
7
8 //////////////////////////////////////////////
9 // Base ITS calibration class               //
10 //////////////////////////////////////////////
11
12 #include <TObject.h>
13 #include <TString.h>
14 #include "AliLog.h"
15 #include "AliITSresponse.h"
16 #include "AliITSMapSDD.h"
17 #include "AliITSDriftSpeedArraySDD.h"
18
19 class AliITSsegmentation;
20 class TF1;
21 class AliITSgeom;
22
23
24 /////////////////////////////////////////////
25 //                                         //
26 // ITS calibration virtual base class      //
27 /////////////////////////////////////////////
28 class AliITSCalibration : public TObject {
29  public:
30     // Default Constructor
31     AliITSCalibration();
32     // Standard Constructor
33     AliITSCalibration(Double_t Thickness);
34
35     // Destructor.
36     virtual ~AliITSCalibration() {;}
37     //
38     // Configuration methods
39     //
40     // fGeVcharge is set by default 3.6e-9 GeV See for ex. PDG 2004.
41     virtual void SetGeVToCharge(Double_t gc=3.6e-9){fGeVcharge = gc;}
42     // Returns the value fGeVcharge
43     virtual Double_t GetGeVToCharge() const {return fGeVcharge;}
44     // Converts deposited energy to number of electrons liberated
45     virtual Double_t GeVToCharge(Double_t gev) const {return gev/fGeVcharge;}
46     // Temperature in [degree K]
47     virtual void    SetTemperature(Double_t t=300.0) {fT = t;}
48     // Get temperature [degree K]
49     virtual Double_t Temperature() const {return fT;}
50     // Set the impurity concentrations in [#/cm^3]
51     virtual void SetImpurity(Double_t n=0.0){fN = n;}
52     // Returns the impurity consentration in [#/cm^3]
53     virtual Double_t Impurity() const {return fN;}
54     // Sets the applied ratio distance/voltage [cm/volt]
55     virtual void SetDistanceOverVoltage(Double_t d,Double_t v){fdv = d/v;}
56     // Sets the applied ration distance/voltage [cm/volt]. Default value
57     // is 300E-4cm/80 volts = 0.000375 cm/volts
58     virtual void SetDistanceOverVoltage(Double_t dv=0.000375){fdv = dv;}
59     // Returns the ration distance/voltage
60     virtual Double_t DistanceOverVoltage() const {return fdv;}
61  
62     // Get data type
63     virtual const char  *DataType() const {return fDataType.Data();}
64     // Type of data - real or simulated
65     virtual void    SetDataType(const char *data="simulated") {fDataType=data;}
66     // Set parameters options: "same" or read from "file" or "SetInvalid" or...
67     //  virtual void   SetParamOptions(const char*,const char*) = 0;
68     // Set noise parameters 
69     virtual void   SetNoiseParam(Double_t, Double_t) = 0;
70     // Number of parameters to be set
71     virtual  void   SetNDetParam(Int_t) = 0;
72     // Set detector parameters: gain, coupling ...
73     virtual  void   SetDetParam(Double_t *) = 0;
74
75     // Parameters options
76     //  virtual void   ParamOptions(char *,char*) const = 0;
77     virtual Int_t  NDetParam() const = 0;
78     virtual void   GetDetParam(Double_t *) const = 0;
79     virtual void   GetNoiseParam(Double_t&, Double_t&) const = 0;
80     virtual void   SetThresholds(Double_t, Double_t) = 0;
81     virtual void   Thresholds(Double_t &, Double_t &) const = 0;
82     virtual void   SetMapA(Int_t, AliITSMapSDD*) {AliError("This method must be implemented in a derived class");}
83     virtual void   SetMapT(Int_t, AliITSMapSDD*) {AliError("This method must be implemented in a derived class");}
84     virtual void   SetDriftSpeed(Int_t, AliITSDriftSpeedArraySDD*) {AliError("This method must be implemented in a derived class");}
85     virtual Double_t DriftSpeed() const {return SpeedElectron();};
86     // Set sigmas of the charge spread function
87     virtual void    SetSigmaSpread(Double_t, Double_t) = 0;
88     // Get sigmas for the charge spread
89     virtual void    SigmaSpread(Double_t &,Double_t &) const = 0;
90     // Pulse height from scored quantity (eloss)
91     virtual Double_t IntPH(Double_t) const {return 0.;}
92     // Charge disintegration
93     virtual Double_t IntXZ(AliITSsegmentation *) const {return 0.;}
94     // Electron mobility in Si. [cm^2/(Volt Sec)]. T in degree K, N in #/cm^3
95     virtual Double_t MobilityElectronSiEmp() const ;
96     // Hole mobility in Si. [cm^2/(Volt Sec)]  T in degree K, N in #/cm^3
97     virtual Double_t MobilityHoleSiEmp() const ;
98     // Einstein relation for Diffusion Coefficient of Electrons. [cm^2/sec]
99     //  T in degree K, N in #/cm^3
100     virtual Double_t DiffusionCoefficientElectron() const ;
101     // Einstein relation for Diffusion Coefficient of Holes. [cm^2/sec]
102     //  T in [degree K], N in [#/cm^3]
103     virtual Double_t DiffusionCoefficientHole() const ;
104     // Electron <speed> under an applied electric field E=Volts/cm. [cm/sec]
105     // d distance-thickness in [cm], v in [volts], T in [degree K],
106     // N in [#/cm^3]
107     virtual Double_t SpeedElectron() const ;
108     // Holes <speed> under an applied electric field E=Volts/cm. [cm/sec]
109     // d distance-thickness in [cm], v in [volts], T in [degree K],
110     // N in [#/cm^3]
111     virtual Double_t SpeedHole() const ;
112     // Returns the Gaussian sigma == <x^2+z^2> [cm^2] due to the defusion of
113     // electrons or holes through a distance l [cm] caused by an applied
114     // voltage v [volt] through a distance d [cm] in any material at a
115     // temperature T [degree K].
116     virtual Double_t SigmaDiffusion3D(Double_t  l) const;
117     // Returns the Gaussian sigma == <x^2 +y^2+z^2> [cm^2] due to the
118     // defusion of electrons or holes through a distance l [cm] caused by an
119     // applied voltage v [volt] through a distance d [cm] in any material at a
120     // temperature T [degree K].
121     virtual Double_t SigmaDiffusion2D(Double_t l) const;
122     // Returns the Gaussian sigma == <x^2+z^2> [cm^2] due to the defusion of
123     // electrons or holes through a distance l [cm] caused by an applied
124     // voltage v [volt] through a distance d [cm] in any material at a
125     // temperature T [degree K].
126     virtual Double_t SigmaDiffusion1D(Double_t l) const;
127     // Computes the Lorentz angle for Electron and Hole, under the Magnetic field bz (in kGauss)
128     virtual Double_t LorentzAngleElectron(Double_t bz) const;
129     virtual Double_t LorentzAngleHole(Double_t bz) const;
130     // Compute the thickness of the depleted region in a Si detector, version A
131     virtual Double_t DepletedRegionThicknessA(Double_t dopCons,
132                                               Double_t voltage,
133                                               Double_t elecCharge,
134                                               Double_t voltBuiltIn=0.5)const;
135     // Compute the thickness of the depleted region in a Si detector, version B
136     virtual Double_t DepletedRegionThicknessB(Double_t resist,Double_t voltage,
137                                               Double_t mobility,
138                                               Double_t voltBuiltIn=0.5,
139                                               Double_t dielConst=1.E-12)const;
140     // Computes the temperature dependance of the reverse bias current
141     virtual Double_t ReverseBiasCurrent(Double_t temp,Double_t revBiasCurT1,
142                                     Double_t tempT1,Double_t energy=1.2)const;
143     // Prints out the content of this class in ASCII format.
144     virtual void Print(ostream *os) const;
145     // Reads in the content of this class in the format of Print
146     virtual void Read(istream *is);
147     virtual void Print(Option_t *option="") const {TObject::Print(option);}
148     virtual Int_t Read(const char *name) {return TObject::Read(name);}
149
150     void SetResponse(AliITSresponse* response) {fResponse=response;}
151     AliITSresponse* GetResponse() const {return fResponse;}
152
153     virtual void SetDiffCoeff(Float_t p1, Float_t p2) {fResponse->SetDiffCoeff(p1,p2);}
154     virtual void DiffCoeff(Float_t &diff,Float_t &diff1) const {fResponse->DiffCoeff(diff,diff1);} 
155     virtual void SetFilenames(const char *f1="",const char *f2="",
156                                  const char *f3="") {fResponse->SetFilenames(f1,f2,f3);}    
157     virtual void Filenames(char* input,char* baseline,char* param) {fResponse->Filenames(input,baseline,param);}
158     virtual void SetOutputOption(Bool_t write=kFALSE) {fResponse->SetOutputOption(write);}
159     virtual Bool_t OutputOption() const {return fResponse->OutputOption();} 
160
161  protected:
162     AliITSCalibration(const AliITSCalibration &ob); // copy constructor
163     AliITSCalibration& operator=(const AliITSCalibration& source); // ass.
164     void NotImplemented(const char *method) const {if(gDebug>0)
165          Warning(method,"This method is not implemented for this sub-class");}
166
167     TString  fDataType;   // data type - real or simulated
168     
169     Double_t fdv;  // The parameter d/v where d is the disance over which the
170                    // the potential v is applied d/v [cm/volts]
171     Double_t fN;   // the impurity consentration of the material in #/cm^3
172     Float_t fT;   // The temperature of the Si in Degree K.
173     Double_t fGeVcharge; // Energy to ionize (free an electron) in GeV
174     AliITSresponse* fResponse; //! ptr to base response obj. It is not
175                  // deleted here but in AliITSDetTypeSim and AliITSDetTypeRec
176
177     ClassDef(AliITSCalibration,1) // Detector type response virtual base class 
178 };
179 // Input and output function for standard C++ input/output.
180 ostream& operator<<(ostream &os,AliITSCalibration &source);
181 istream& operator>>(istream &os,AliITSCalibration &source);
182 #endif