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