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