fix in calling of gaussian spread function
[u/mrichter/AliRoot.git] / ITS / AliITSsimulationSSD.h
CommitLineData
b0f5e3fc 1#ifndef ALIITSSIMULATIONSSD_H
2#define ALIITSSIMULATIONSSD_H
57817f7c 3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2727462b 4 * See cxx source for full Copyright notice */
88cb7938 5
57817f7c 6/* $Id$ */
b0f5e3fc 7
8ba39da9 8/////////////////////////////////////////////////////////////
9// Simulation class for SSD //
10/////////////////////////////////////////////////////////////
11
b0f5e3fc 12#include "AliITSsimulation.h"
c7a4dac0 13#include "AliITSsegmentationSSD.h" // function used in inline functions
b0f5e3fc 14
fd61217e 15class AliITSMapA2;
c7a4dac0 16class AliITSpList;
0dbfc771 17class AliITSTableSSD;
14a74335 18//class AliITSdcsSSD;
57817f7c 19class AliITSsegmentationSSD;
fcf95fc7 20class AliITSCalibrationSSD;
7d3b8602 21class TF1;
b0f5e3fc 22
23class AliITSsimulationSSD: public AliITSsimulation {
24
2727462b 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,
57817f7c 55 Double_t x,Double_t y,Double_t z,Double_t de,
633e7c28 56 AliITSTableSSD *tav);
2727462b 57 //returns a pointer to the SSD segmentation.
58 /*AliITSsegmentationSSD *GetSegmentation() {
57817f7c 59 return (AliITSsegmentationSSD*) fSegmentation;}
2727462b 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)
57817f7c 69 {fDifConst[0] = h;fDifConst[1]=e;}
2727462b 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)
57817f7c 74 {fDriftVel[0] = v0;fDriftVel[1] = v1;}
66b89079 75
76
77 // Decide whether to use or not the Lorentz drift
78 void SetLorentzDrift(Bool_t b=kFALSE)
79 {fLorentz=b; if(fLorentz) SetTanLorAngle();};
80 // Set the Lorentz angles
81 Bool_t SetTanLorAngle();
82 // Getter for the Lorentz angles
83 Double_t GetTanLorAngleP() const {return fTanLorAngP;};
84 Double_t GetTanLorAngleN() const {return fTanLorAngN;};
85 //
86
87
2727462b 88 // Standard ascii class print function
89 void Print(ostream *os);
90 // Standard ascii class read function
91 void Read(istream *is);
92 virtual void Print(Option_t *option="") const {TObject::Print(option);}
93 virtual Int_t Read(const char *name) {return TObject::Read(name);}
94 // Data members
95 protected:
8ba39da9 96
2727462b 97 // AliITSdcsSSD *fDCS; // Class containing detector controle paramters
b0f5e3fc 98
2727462b 99 private:
100 // Return the Response class
101 // AliITSCalibrationSSD* GetResp(){return (AliITSCalibrationSSD*)fResponse;}
102 // Return the Segmentation class
103 //AliITSsegmentationSSD* GetSeg(){
104 // return (AliITSsegmentationSSD*)fSegmentation;}
105 // returns the number of steps needed to proplerly distribute the charge
106 // in a step
107 Int_t NumOfSteps(Double_t x,Double_t y,Double_t z,
c7a4dac0 108 Double_t &dex,Double_t &dey,Double_t &dez);
2727462b 109 // Keepts track and orders tracks for a give strip.
110 void GetList(Int_t trk,Int_t ht,Int_t mod,AliITSpList *pLt,
0dbfc771 111 AliITSTableSSD *tav);
2727462b 112 // sets thresholds and fills digits
18f63405 113 void ChargeToSignal(Int_t module,const AliITSpList *pList);
2727462b 114 // Writes Summable Digits to a root file for later use.
115 void WriteSDigits(AliITSpList *pList);
116 // ReadSDigits and create Digits
117 void SDigitToDigit(Int_t module,AliITSpList *pList);
118 // Fills fMapA2 from pList AliITSpList
119 void FillMapFrompList(AliITSpList *pList);
120 // Diffuses the charge onto neighboring strips.
121 void IntegrateGaussian(Int_t k,Double_t par,Double_t av,Double_t sigma,
57817f7c 122 Double_t inf, Double_t sup,
633e7c28 123 AliITSTableSSD *tav);
2727462b 124 // Applies noise to strips randomly
125 void ApplyNoise(AliITSpList *pList,Int_t mod);
126 // Applies posible signal coupling between strips
127 void ApplyCoupling(AliITSpList *pList,Int_t mod);
128 // Kill dead channels
129 void ApplyDeadChannels(Int_t mod);
130 // Computes the integral of a gaussian using Error Function
131 Float_t F(Float_t av, Float_t x, Float_t s);
132 // returns, from the segmentation, the number of stips
133 Int_t GetNStrips() {AliITSsegmentationSSD* seg = (AliITSsegmentationSSD*)GetSegmentationModel(2);return seg->Npx();}
134 // returns, from the segmentation, the strip pitch
135 Float_t GetStripPitch() {AliITSsegmentationSSD* seg = (AliITSsegmentationSSD*)GetSegmentationModel(2);return seg->Dpx(0);}
57817f7c 136
2727462b 137 AliITSMapA2 *fMapA2; //! Map of ionization, used localy only
138 Double_t fIonE; // ionization energy of Si in GeV
139 Double_t fDifConst[2]; // Diffusion constants [h,e] in cm**2/sec
140 Double_t fDriftVel[2]; // Drift velocities [P,N sides] cm/sec
b0f5e3fc 141
7d3b8602 142 TF1 *fTimeResponse; // signal time response function
143
66b89079 144 Bool_t fLorentz; // kTRUE if Lorentz drift has been allowed
145 Double_t fTanLorAngP; //! Tangent of the Lorentz Angle for holes
146 Double_t fTanLorAngN; //! Tangent of the Lorentz Angle for electrons
147
148
e06798d9 149 ClassDef(AliITSsimulationSSD,3) // SSD signal simulation class
b0f5e3fc 150
57817f7c 151};
152// Input and output functions for standard C++ input/output.
153ostream &operator<<(ostream &os,AliITSsimulationSSD &source);
154istream &operator>>(istream &is,AliITSsimulationSSD &source);
b0f5e3fc 155#endif