1 #ifndef ALIITSSIMULATIONSDD_H
2 #define ALIITSSIMULATIONSDD_H
10 #include "AliITSsimulation.h"
12 //___________________________________________________
28 //___________________________________________________
30 class AliITSsimulationSDD : public AliITSsimulation {
34 AliITSsimulationSDD();
35 AliITSsimulationSDD(AliITSsegmentation *seg, AliITSresponse *res);
36 AliITSsimulationSDD(AliITSsimulationSDD &source);
37 virtual ~AliITSsimulationSDD();
38 AliITSsimulationSDD& operator=(AliITSsimulationSDD &source);
40 // get the address of the array mapping the signal or pointers to arrays
41 virtual AliITSMap* HitMap(Int_t i);
43 // set the scale size factor for the smples in FFT
44 virtual void SetScaleFourier(Int_t scale=4) {fScaleSize=scale;}
45 Int_t ScaleFourier() {return fScaleSize;}
46 // set perpendicular tracks flag
47 virtual void SetPerpendTracksFlag(Bool_t flag=1) {fFlag=1;}
48 Bool_t PerpendTracksFlag() {return fFlag;}
49 // set compression parameters for 2D or 1D via response functions
50 void SetCompressParam();
51 // retrieve compression parameters for 2D or 1D
52 void CompressionParam(Int_t i, Int_t &db, Int_t &tl, Int_t &th);
53 void CompressionParam(Int_t i, Int_t &db, Int_t &tl);
55 virtual Int_t Convert10to8(Int_t signal);
56 virtual Int_t Convert8to10(Int_t signal);
57 virtual void ZeroSuppression(const char *opt);
58 virtual void Init2D();
59 virtual void Compress2D();
60 virtual void Init1D();
61 virtual void Compress1D();
62 virtual void StoreAllDigits();
63 virtual void ReadBaseline();
64 virtual void GetAnodeBaseline(Int_t i, Float_t &baseline, Float_t &noise);
65 virtual void AddDigit(Int_t i, Int_t j, Int_t signal);
66 virtual void FindCluster
67 (Int_t i, Int_t j,Int_t signal,Int_t minval,Bool_t &cond);
70 // get parameters for 1D - this could be changed when we get more
71 // input from Torino after they have a look at the code
72 virtual Int_t Tolerance(Int_t i) {return fTol[i];}
73 virtual Int_t Disable(Int_t i) {return fT2[i];}
74 // Set the output file name - for 1D encoding
75 virtual void SetFileName(const char *filnam) {fFileName=filnam;}
77 void ChargeToSignal();
78 void DigitiseModule(AliITSmodule *mod,Int_t md,Int_t ev);
79 void SortTracks(Int_t *tracks,Float_t *charges,Int_t *hits,Int_t ntracks);
80 void ListOfFiredCells(Int_t *arg,Double_t timeAmplitude,TObjArray *list,
83 void CreateHistograms(Int_t scale);
84 void FillHistograms();
85 void ResetHistograms();
86 // Get the pointer to the array of histograms
87 TObjArray* GetHistArray() {return fHis;}
89 // create a separate tree for background monitoring (2D)
90 virtual void MakeTreeB(Option_t *option="B")
91 { fTreeB = new TNtuple("ntuple","2D backgr","nz:nl:nh:low:anode");}
92 void GetTreeB(Int_t) { }
94 // Return pointer to TreeB
95 TNtuple *TreeB() {return fTreeB;}
97 void WriteToFile(TFile *fp);
98 TH1F *GetAnode(Int_t wing, Int_t anode);
99 void SetCheckNoise(Bool_t check=kFALSE) {fCheckNoise=check;}
101 void SetDoFFT(Int_t doFFT=1) {fDoFFT=doFFT;}
105 AliITS *fITS; //! local pointer to ITS
107 AliITSMapA1 *fHitMap1; //! local pointer to map of digits
108 AliITSMapA2 *fHitMap2; //! local pointer to map of signals
109 AliITSInStream *fStream; //! input file stream
110 AliITSetfSDD *fElectronics; //! local pointer to electronics simulation
112 TArrayI fD; // decrease values for baseline eq.
113 TArrayI fT1; // low thresholds
114 TArrayI fT2; // high thresholds(2D) or disable (1D)
115 TArrayI fTol; // tolerance
116 TArrayF fBaseline; // Baseline
117 TArrayF fNoise; // Noise value
118 TNtuple *fTreeB; // Background info tree for 2D
119 TString fParam; // Compresion algorithm options
120 TString fFileName; // File name for possible options above
122 Bool_t fFlag; // Flag used to simulate perpendicular tracks
123 Bool_t fCheckNoise; // Flag used to check the simulated noise
124 Int_t fDoFFT; // Flag used to switch off electronics when 0
125 Int_t fNofMaps; // Number of anodes used ( 1 - 2*nanodes per wing )
126 Int_t fMaxNofSamples; // Number of time samples
127 Int_t fScaleSize; // scale size factor for the samples in FFT
128 Int_t fModule; // in case bgr, noise, param change module-by-module
129 Int_t fEvent; // solely for output from bgr monitoring of 2D
131 TObjArray *fHis; // just in case for histogramming
133 Double_t *fInZR; // ! [fScaleSize*fMaxNofSamples]
134 // input of the real part of FFT
135 Double_t *fInZI; // ! [fScaleSize*fMaxNofSamples]
136 // input of the imaginary part of FFT
137 Double_t *fOutZR; // ! [fScaleSize*fMaxNofSamples]
138 // output of the real part of FFT
139 Double_t *fOutZI; // ! [fScaleSize*fMaxNofSamples]
140 // output of the imaginary part of FFT
142 ClassDef(AliITSsimulationSDD,1) // Simulation of SDD clusters