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