Overlaps corrected, new shape of sectors
[u/mrichter/AliRoot.git] / ITS / AliITSsimulationSPDgeom.h
CommitLineData
5bfe44ce 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////////////////////////////////////////////////////////////////////////
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
18#include "AliITSCalibrationSPD.h"
19#include "AliITSsegmentationSPD.h"
20#include "AliITSsimulation.h"
bb292d31 21//#include "AliITSresponseSPD.h"
5bfe44ce 22
23class AliITSMapA2;
24class AliITSpList;
25class AliITSmodule;
26
27//-------------------------------------------------------------------
28
29class AliITSsimulationSPD : public AliITSsimulation {
30
31 public:
32 AliITSsimulationSPD(); // Default constructor
33 // Standard constructor
34 AliITSsimulationSPD(AliITSDetTypeSim *dettyp);
35 virtual ~AliITSsimulationSPD();// destructor
36 AliITSsimulationSPD(const AliITSsimulationSPD &source); // copy constructo
37 // assignment operator
38 AliITSsimulationSPD& operator=(const AliITSsimulationSPD &source);
39 virtual AliITSsimulation& operator=(const AliITSsimulation &source);
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);}
44 // Initilizes the variables
45 void Init();
46 // Initilizes the variables with replacement segmentation/response class
47 // void Init(AliITSsegmentationSPD *seg, AliITSCalibrationSPD *resp);
48
49 // Sum digitize module
50 // Create maps to build the lists of tracks for each summable digit
51 void InitSimulationModule(Int_t module,Int_t events);
52 // Digitize module from the sum of summable digits.
53 void FinishSDigitiseModule();
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
87 // the column and row direction, respectively. Now done in a statistical
88 // way and not "mechanical" as in the Old version.
89 void SetCoupling(Int_t row,Int_t col,Int_t ntrack,Int_t idhit,Int_t module,
90 AliITSpList *pList);
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);
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.
110 void SetMask(Int_t mod);
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);
119 // get hist array
120 TObjArray* GetHistArray() {return fHis;}
121
122 private:
123 // Getters for data kept in fSegmentation and fResponse.
124 // Returns the Threshold in electrons
125 Double_t GetThreshold(){Double_t a=0.0,b=0.0;
126 AliITSCalibrationSPD* res = (AliITSCalibrationSPD*)GetCalibrationModel(GetModuleNumber());
127 res->Thresholds(a,b); return a;}
128 // Returns the threshold and rms noise.
129 void GetThresholds(Double_t &t,Double_t &s){
130 AliITSCalibrationSPD* res = (AliITSCalibrationSPD*)GetCalibrationModel(GetModuleNumber());
131 res->Thresholds(t,s);}
132 // Returns the couplings Columb and Row.
133 void GetCouplings(Double_t &cc,Double_t &cr){
134 AliITSCalibrationSPD* res = (AliITSCalibrationSPD*)GetCalibrationModel(GetModuleNumber());
135 res->GetCouplingParam(cc,cr);}
136 // Returns the number of pixels in x
137 Int_t GetNPixelsX(){AliITSsegmentationSPD* seg= (AliITSsegmentationSPD*)GetSegmentationModel(0);return seg->Npx();}
138 // Returns the number of pixels in z
139 Int_t GetNPixelsZ(){AliITSsegmentationSPD* seg= (AliITSsegmentationSPD*)GetSegmentationModel(0);return seg->Npz();}
140
141 private:
142 AliITSMapA2 *fMapA2; //! MapA2 for Local internal use only
143 TObjArray *fHis; //! just in case for histogramming for Local
144 // internal use only
145
146 ClassDef(AliITSsimulationSPD,1) // Simulation of SPD clusters
147
148};
149
150#endif