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