]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSsimulationSSD.h
Digitizer: improved access to CDB for multievent jobs. Memory leak fixed in AliITSDet...
[u/mrichter/AliRoot.git] / ITS / AliITSsimulationSSD.h
1 #ifndef ALIITSSIMULATIONSSD_H
2 #define ALIITSSIMULATIONSSD_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 // Simulation class for SSD                                //
10 /////////////////////////////////////////////////////////////
11
12 #include "AliITSsimulation.h"
13 #include "AliITSsegmentationSSD.h" // function used in inline functions
14
15 class AliITSMapA2;
16 class AliITSpList;
17 class AliITSTableSSD;
18 class AliITSdcsSSD;
19 class AliITSsegmentationSSD;
20 class AliITSCalibrationSSD;
21
22 class AliITSsimulationSSD: public AliITSsimulation {
23
24  public:
25     AliITSsimulationSSD(); // Default constructor
26     AliITSsimulationSSD(const AliITSsimulationSSD &source); // copy constructor
27     // operator =
28     AliITSsimulationSSD& operator=(const AliITSsimulationSSD &source);
29     virtual AliITSsimulation& operator=(const AliITSsimulation &source);
30     //Standard Constructor
31     AliITSsimulationSSD(AliITSDetTypeSim* dettyp);
32     //Destructor
33     virtual ~AliITSsimulationSSD();
34     // Get a pointer to the segmentation object
35     virtual AliITSsegmentation* GetSegmentationModel(Int_t /*dt*/){return fDetType->GetSegmentationModel(2);}
36     // set pointer to segmentation objec
37     virtual void SetSegmentationModel(Int_t /*dt*/, AliITSsegmentation *seg){fDetType->SetSegmentationModel(2,seg);}
38     // Initilize variables for this simulation
39     void Init();
40     // Initilize variables for this simulation
41     //void Init(AliITSsegmentationSSD *seg,AliITSCalibrationSSD *resp);
42     // Create maps to build the lists of tracks for each summable digit
43     void InitSimulationModule(Int_t module,Int_t events);
44     // Digitize module from the sum of summable digits.
45     void FinishSDigitiseModule();
46     //Digitizes all of the hits in a module
47     void DigitiseModule(AliITSmodule *mod,Int_t dummy0,Int_t dummy1);
48     // Computes the Summable Digits
49     void SDigitiseModule(AliITSmodule *mod,Int_t module,Int_t dummy);
50     // Computes the Charge on each Strip/ Analog/summable digits
51     void HitsToAnalogDigits(AliITSmodule *mod,AliITSpList *pList);
52     //Computes the signal from one hit
53     void HitToDigit(Int_t module,Double_t x0,Double_t y0,Double_t z0, 
54                     Double_t x,Double_t y,Double_t z,Double_t de,
55                     AliITSTableSSD *tav);
56     //returns a pointer to the SSD segmentation.
57     /*AliITSsegmentationSSD *GetSegmentation() {
58         return (AliITSsegmentationSSD*) fSegmentation;}
59     */
60     //Returns the ionization energy for Si in GeV.
61     Double_t GetIonizeE() const {return fIonE;}
62     //Sets the ionization energy for Si in GeV.
63     void SetIonizeE(Double_t e=3.62E-09){fIonE = e;}
64     //Returns the Diffusion constant h in cm**2/sec
65     Double_t GetDiffConst(Int_t i) const {return fDifConst[i];}
66     //Sets the Diffusion constant h in cm**2/sec
67     void SetDiffConst(Double_t h=11.0,Double_t e=30.0)
68         {fDifConst[0] = h;fDifConst[1]=e;}
69     //Returns the Drift velocity for the side i
70     Double_t GetDriftVelocity(Int_t i) const {return fDriftVel[i];}
71     //Sets the Drift velocity for the P and N sides
72     void SetDriftVelocity(Double_t v0=0.86E+06,Double_t v1=2.28E+06)
73         {fDriftVel[0] = v0;fDriftVel[1] = v1;}
74     // Standard ascii class print function
75     void Print(ostream *os);
76     // Standard ascii class read function
77     void Read(istream *is);
78     virtual void Print(Option_t *option="") const {TObject::Print(option);}
79     virtual Int_t Read(const char *name) {return TObject::Read(name);}
80     // Data members
81  protected:
82
83     AliITSdcsSSD *fDCS;   // Class containing detector controle paramters
84
85  private:
86     // Return the Response class
87     //    AliITSCalibrationSSD* GetResp(){return (AliITSCalibrationSSD*)fResponse;}
88     // Return the Segmentation class
89     //AliITSsegmentationSSD* GetSeg(){
90     //  return (AliITSsegmentationSSD*)fSegmentation;}
91     // returns the number of steps needed to proplerly distribute the charge
92     // in a step
93     Int_t NumOfSteps(Double_t x,Double_t y,Double_t z,
94                      Double_t  &dex,Double_t &dey,Double_t &dez);
95     // Keepts track and orders tracks for a give strip.
96     void GetList(Int_t trk,Int_t ht,Int_t mod,AliITSpList *pLt,
97                  AliITSTableSSD *tav);
98     // sets thresholds and fills digits
99     void ChargeToSignal(Int_t module,AliITSpList *pList);
100     // Writes Summable Digits to a root file for later use.
101     void WriteSDigits(AliITSpList *pList);
102     // ReadSDigits and create Digits
103     void SDigitToDigit(Int_t module,AliITSpList *pList);
104     // Fills fMapA2 from pList AliITSpList
105     void FillMapFrompList(AliITSpList *pList);
106     // Diffuses the charge onto neighboring strips.
107     void    IntegrateGaussian(Int_t k,Double_t par,Double_t av,Double_t sigma, 
108                               Double_t inf, Double_t sup,
109                               AliITSTableSSD *tav);
110      // Applies noise to strips randomly
111     void    ApplyNoise(AliITSpList *pList,Int_t mod);
112      // Applies posible signal coupling between strips
113     void    ApplyCoupling(AliITSpList *pList,Int_t mod);
114     // Computes the integral of a gaussian using Error Function
115     Float_t F(Float_t av, Float_t x, Float_t s);
116     // returns, from the segmentation, the number of stips
117     Int_t GetNStrips() {AliITSsegmentationSSD* seg = (AliITSsegmentationSSD*)GetSegmentationModel(2);return seg->Npx();}
118     // returns, from the segmentation, the strip pitch
119     Float_t GetStripPitch() {AliITSsegmentationSSD* seg = (AliITSsegmentationSSD*)GetSegmentationModel(2);return seg->Dpx(0);}
120
121     AliITSMapA2 *fMapA2;      //! Map of ionization, used localy only
122     Double_t    fIonE;        // ionization energy of Si in GeV
123     Double_t    fDifConst[2]; // Diffusion constants [h,e] in cm**2/sec
124     Double_t    fDriftVel[2]; // Drift velocities [P,N sides] cm/sec
125
126     ClassDef(AliITSsimulationSSD,2) // SSD signal simulation class
127
128 };
129 // Input and output functions for standard C++ input/output.
130 ostream &operator<<(ostream &os,AliITSsimulationSSD &source);
131 istream &operator>>(istream &is,AliITSsimulationSSD &source);
132 #endif