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