]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSsimulationSPD.h
negative indexes allowed
[u/mrichter/AliRoot.git] / ITS / AliITSsimulationSPD.h
1 #ifndef ALIITSSIMULATIONSPD_H
2 #define ALIITSSIMULATIONSPD_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /*
7 $Id$
8 */
9 #include "AliITSresponseSPD.h"
10 #include "AliITSsegmentationSPD.h"
11 #include "AliITSsimulation.h"
12
13 class AliITSMapA2;
14 class AliITSpList;
15 class AliITSmodule;
16
17 //-------------------------------------------------------------------
18
19 class AliITSsimulationSPD : public AliITSsimulation {
20
21  public:        
22     AliITSsimulationSPD(); // Default constructor
23     // Standard constructor
24     AliITSsimulationSPD(AliITSsegmentation *seg, AliITSresponse *res);
25     ~AliITSsimulationSPD();// destructor
26     AliITSsimulationSPD(const AliITSsimulationSPD &source); // copy constructo
27     // assignment operator
28     AliITSsimulationSPD& operator=(const AliITSsimulationSPD &source);
29     // Initilizes the variables
30     void Init(AliITSsegmentationSPD *seg, AliITSresponseSPD *resp);
31
32     // Sum digitize module
33     // Create maps to build the lists of tracks for each summable digit
34     void InitSimulationModule(Int_t module,Int_t events);
35     // Digitize module from the sum of summable digits.
36     void FinishSDigitiseModule();
37     void SDigitiseModule(AliITSmodule *mod, Int_t dummy0,Int_t dummy1);
38     // digitize module. Also need to digitize modules with only noise.
39     void DigitiseModule(AliITSmodule *mod,Int_t dummy0, Int_t dummy1);
40     // sum digits to Digits.
41     void SDigitsToDigits(Int_t module,AliITSpList *pList);
42     // updates the Map of signal, adding the energy  (ene) released by
43     // the current track
44     void UpdateMapSignal(Int_t row,Int_t col,Int_t trk,Int_t hit,Int_t mod,
45                          Double_t ene,AliITSpList *pList);
46     // updates the Map of noise, adding the energy  (ene) give my noise
47     void UpdateMapNoise(Int_t row,Int_t col,Int_t mod,Double_t ene,
48                         AliITSpList *pList);
49     // Loops over all hits to produce Analog/floting point digits. This
50     // is also the first task in producing standard digits.
51     void HitsToAnalogDigits(AliITSmodule *mod,Int_t *frowpixel,
52                             Int_t *fcolpixel,Double_t *fenepixel,
53                             AliITSpList *pList);
54     //  Steering function to determine the digits associated to a given
55     // hit (hitpos)
56     // The digits are created by charge sharing (ChargeSharing) and by
57     // capacitive coupling (SetCoupling). At all the created digits is
58     // associated the track number of the hit (ntrack)
59     void HitToDigit(AliITSmodule *mod, Int_t hitpos,Int_t *frowpixel,
60                     Int_t *fcolpixel, Double_t *fenepixel,AliITSpList *pList);
61     //  Take into account the geometrical charge sharing when the track
62     //  crosses more than one pixel.
63     void ChargeSharing(Float_t x1l,Float_t z1l,Float_t x2l,Float_t z2l,
64                        Int_t c1,Int_t r1,Int_t c2,Int_t r2,Float_t etot,
65                        Int_t &npixel,Int_t *frowpixel,Int_t *fcolpixel,
66                        Double_t *fenepixel);
67     //  Take into account the coupling between adiacent pixels.
68     //  The parameters probcol and probrow are the fractions of the
69     //  signal in one pixel shared in the two adjacent pixels along
70     //  the column and row direction, respectively. Now done in a statistical
71     //  way and not "mechanical" as in the Old version.
72     void SetCoupling(Int_t row,Int_t col,Int_t ntrack,Int_t idhit,Int_t module,
73                      AliITSpList *pList);
74     //  Take into account the coupling between adiacent pixels.
75     //  The parameters probcol and probrow are the fractions of the
76     //  signal in one pixel shared in the two adjacent pixels along
77     //  the column and row direction, respectively.
78     void SetCouplingOld(Int_t row,Int_t col,Int_t ntrack,Int_t idhit,
79                         Int_t module,AliITSpList *pList);
80     // The pixels are fired if the energy deposited inside them is above
81     // the threshold parameter ethr. Fired pixed are interpreted as digits
82     // and stored in the file digitfilename. One also needs to write out
83     // cases when there is only noise (nhits==0).
84     void CreateDigit(Int_t module,AliITSpList *pList);
85     //  Set the electronic noise and threshold non-uniformities to all the
86     //  pixels in a detector.
87     //  The parameter fSigma is the squared sum of the sigma due to noise
88     //  and the sigma of the threshold distribution among pixels.
89     void SetFluctuations(AliITSpList *pList,Int_t module);
90     //  Apply a mask to the SPD module. 1% of the pixel channels are
91     //  masked. When the database will be ready, the masked pixels
92     //  should be read from it.
93     void SetMask();
94     // Create Histograms
95     void CreateHistograms();
96     // Reset histograms for this detector
97     void ResetHistograms();
98     // Fills the Summable digits Tree
99     void WriteSDigits(AliITSpList *pList);
100     // Fills fMap2A from the pList of Summable digits
101     void FillMapFrompList(AliITSpList *pList);
102     // get hist array
103     TObjArray*  GetHistArray() {return fHis;}
104
105  private:
106     // Getters for data kept in fSegmentation and fResponse.
107     // Returns the Threshold in electrons
108     Double_t GetThreshold(){Float_t a=0.0,b=0.0;
109     ((AliITSresponseSPD*)fResponse)->Thresholds(a,b); return a;}
110     // Returns the threshold and rms noise.
111     void GetThresholds(Float_t &t,Float_t &s){
112     ((AliITSresponseSPD*)fResponse)->Thresholds(t,s);}
113     // Returns the couplings Columb and Row.
114     void GetCouplings(Float_t &cc,Float_t &cr){
115         ((AliITSresponseSPD*)fResponse)->GetNoiseParam(cc,cr);}
116     // Returns the number of pixels in x
117     Int_t GetNPixelsX(){return ((AliITSsegmentationSPD*)fSegmentation)->Npx();}
118     // Returns the number of pixels in z
119     Int_t GetNPixelsZ(){return ((AliITSsegmentationSPD*)fSegmentation)->Npz();}
120
121  private:
122 /*    Float_t      fThresh;   //! Threshold from fResponse
123     Float_t      fSigma;    //! Noise from fResponse
124     Float_t      fCouplCol; //! Coupling along columns from fResponse
125     Float_t      fCouplRow; //! Coupling along rows from fResponse
126     Int_t        fNPixelsX; //! NPixelsX from fSegmentation
127     Int_t        fNPixelsZ; //! NPixelsZ from fSegmentation
128 */
129 //    AliITSpList  *fList;    //! Internal map and sdigits
130 //    Int_t         fModule;  //! Module number being simulated
131 //    Int_t         fEvent;   //! Event number being simulated
132     AliITSMapA2  *fMapA2;   //! MapA2 for Local internal use only
133     TObjArray    *fHis;     //! just in case for histogramming for Local
134                             // internal use only
135
136     ClassDef(AliITSsimulationSPD,1)  // Simulation of SPD clusters
137
138 };
139
140 #endif