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