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 */
9 #include "AliITSresponseSPD.h"
10 #include "AliITSsegmentationSPD.h"
11 #include "AliITSsimulation.h"
17 //-------------------------------------------------------------------
19 class AliITSsimulationSPD : public AliITSsimulation {
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 virtual AliITSsimulationSPD& operator=(const AliITSsimulation &source);
30 // Initilizes the variables
32 // Initilizes the variables with replacement segmentation/response class
33 void Init(AliITSsegmentationSPD *seg, AliITSresponseSPD *resp);
35 // Sum digitize module
36 // Create maps to build the lists of tracks for each summable digit
37 void InitSimulationModule(Int_t module,Int_t events);
38 // Digitize module from the sum of summable digits.
39 void FinishSDigitiseModule();
40 void SDigitiseModule(AliITSmodule *mod, Int_t dummy0,Int_t dummy1);
41 // digitize module. Also need to digitize modules with only noise.
42 void DigitiseModule(AliITSmodule *mod,Int_t dummy0, Int_t dummy1);
43 // sum digits to Digits.
44 void SDigitsToDigits(Int_t module,AliITSpList *pList);
45 // updates the Map of signal, adding the energy (ene) released by
47 void UpdateMapSignal(Int_t row,Int_t col,Int_t trk,Int_t hit,Int_t mod,
48 Double_t ene,AliITSpList *pList);
49 // updates the Map of noise, adding the energy (ene) give my noise
50 void UpdateMapNoise(Int_t row,Int_t col,Int_t mod,Double_t ene,
52 // Loops over all hits to produce Analog/floting point digits. This
53 // is also the first task in producing standard digits.
54 void HitsToAnalogDigits(AliITSmodule *mod,Int_t *frowpixel,
55 Int_t *fcolpixel,Double_t *fenepixel,
57 // Steering function to determine the digits associated to a given
59 // The digits are created by charge sharing (ChargeSharing) and by
60 // capacitive coupling (SetCoupling). At all the created digits is
61 // associated the track number of the hit (ntrack)
62 void HitToDigit(AliITSmodule *mod, Int_t hitpos,Int_t *frowpixel,
63 Int_t *fcolpixel, Double_t *fenepixel,AliITSpList *pList);
64 // Take into account the geometrical charge sharing when the track
65 // crosses more than one pixel.
66 void ChargeSharing(Float_t x1l,Float_t z1l,Float_t x2l,Float_t z2l,
67 Int_t c1,Int_t r1,Int_t c2,Int_t r2,Float_t etot,
68 Int_t &npixel,Int_t *frowpixel,Int_t *fcolpixel,
70 // Take into account the coupling between adiacent pixels.
71 // The parameters probcol and probrow are the fractions of the
72 // signal in one pixel shared in the two adjacent pixels along
73 // the column and row direction, respectively. Now done in a statistical
74 // way and not "mechanical" as in the Old version.
75 void SetCoupling(Int_t row,Int_t col,Int_t ntrack,Int_t idhit,Int_t module,
77 // Take into account the coupling between adiacent pixels.
78 // The parameters probcol and probrow are the fractions of the
79 // signal in one pixel shared in the two adjacent pixels along
80 // the column and row direction, respectively.
81 void SetCouplingOld(Int_t row,Int_t col,Int_t ntrack,Int_t idhit,
82 Int_t module,AliITSpList *pList);
83 // The pixels are fired if the energy deposited inside them is above
84 // the threshold parameter ethr. Fired pixed are interpreted as digits
85 // and stored in the file digitfilename. One also needs to write out
86 // cases when there is only noise (nhits==0).
87 void CreateDigit(Int_t module,AliITSpList *pList);
88 // Set the electronic noise and threshold non-uniformities to all the
89 // pixels in a detector.
90 // The parameter fSigma is the squared sum of the sigma due to noise
91 // and the sigma of the threshold distribution among pixels.
92 void SetFluctuations(AliITSpList *pList,Int_t module);
93 // Apply a mask to the SPD module. 1% of the pixel channels are
94 // masked. When the database will be ready, the masked pixels
95 // should be read from it.
98 void CreateHistograms();
99 // Reset histograms for this detector
100 void ResetHistograms();
101 // Fills the Summable digits Tree
102 void WriteSDigits(AliITSpList *pList);
103 // Fills fMap2A from the pList of Summable digits
104 void FillMapFrompList(AliITSpList *pList);
106 TObjArray* GetHistArray() {return fHis;}
109 // Getters for data kept in fSegmentation and fResponse.
110 // Returns the Threshold in electrons
111 Double_t GetThreshold(){Double_t a=0.0,b=0.0;
112 ((AliITSresponseSPD*)fResponse)->Thresholds(a,b); return a;}
113 // Returns the threshold and rms noise.
114 void GetThresholds(Double_t &t,Double_t &s){
115 ((AliITSresponseSPD*)fResponse)->Thresholds(t,s);}
116 // Returns the couplings Columb and Row.
117 void GetCouplings(Double_t &cc,Double_t &cr){
118 ((AliITSresponseSPD*)fResponse)->GetCouplingParam(cc,cr);}
119 // Returns the number of pixels in x
120 Int_t GetNPixelsX(){return ((AliITSsegmentationSPD*)fSegmentation)->Npx();}
121 // Returns the number of pixels in z
122 Int_t GetNPixelsZ(){return ((AliITSsegmentationSPD*)fSegmentation)->Npz();}
125 AliITSMapA2 *fMapA2; //! MapA2 for Local internal use only
126 TObjArray *fHis; //! just in case for histogramming for Local
129 ClassDef(AliITSsimulationSPD,1) // Simulation of SPD clusters