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